From 3c30261fd876759d83ce823b3e56d42fe0273f25 Mon Sep 17 00:00:00 2001 From: Omri Armstrong Date: Mon, 23 Jan 2017 15:16:23 +0200 Subject: [PATCH 01/11] Adding create, edit and save capabilities --- demo/code-demo/scripts/codesamples.js | 110 +++++ demo/code-demo/scripts/report.js | 19 + demo/code-demo/scripts/step_authorize.js | 37 +- demo/code-demo/scripts/step_embed.js | 22 + demo/code-demo/scripts/step_interact.js | 29 +- demo/code-demo/settings_create.html | 31 ++ demo/code-demo/settings_embed.html | 12 + demo/code-demo/settings_interact.html | 12 + demo/code-demo/step_authorize.html | 1 + demo/code-demo/step_create.html | 32 ++ demo/code-demo/style/style.css | 9 + dist/create.d.ts | 28 ++ dist/embed.d.ts | 65 ++- dist/powerbi.js | 598 +++++++++++++++++++---- dist/powerbi.js.map | 2 +- dist/powerbi.min.js | 12 +- dist/report.d.ts | 8 +- dist/service.d.ts | 7 + src/create.ts | 54 ++ src/embed.ts | 150 +++++- src/report.ts | 22 +- src/service.ts | 31 ++ 22 files changed, 1152 insertions(+), 139 deletions(-) create mode 100644 demo/code-demo/settings_create.html create mode 100644 demo/code-demo/step_create.html create mode 100644 dist/create.d.ts create mode 100644 src/create.ts diff --git a/demo/code-demo/scripts/codesamples.js b/demo/code-demo/scripts/codesamples.js index af07529d..5bd894af 100644 --- a/demo/code-demo/scripts/codesamples.js +++ b/demo/code-demo/scripts/codesamples.js @@ -25,6 +25,7 @@ function _Embed_BasicEmbed() { accessToken: txtAccessToken, embedUrl: txtEmbedUrl, id: txtEmbedReportId, + permissions: 3/*All*/, settings: { filterPaneEnabled: true, navContentPaneEnabled: true @@ -77,6 +78,39 @@ function _Embed_EmbedWithDefaultFilter() { powerbi.embed(reportContainer, embedConfiguration); } +function _Embed_Create() { + // Read embed application token from textbox + var txtAccessToken = $('#txtAccessToken').val(); + + // Read embed URL from textbox + var txtEmbedUrl = $('#txtReportEmbed').val(); + + // Read dataset Id from textbox + var txtEmbedDatasetId = $('#txtEmbedDatasetId').val(); + + // Embed create configuration used to describe the what and how to create report. + // This object is used when calling powerbi.createReport. + var embedCreateConfiguration = { + accessToken: txtAccessToken, + embedUrl: txtEmbedUrl, + datasetId: txtEmbedDatasetId, + }; + + // Grab the reference to the div HTML element that will host the report + var reportContainer = $('#reportContainer')[0]; + + // Create report + var report = powerbi.createReport(reportContainer, embedCreateConfiguration); + + // Report.off removes a given event handler if it exists. + report.off("loaded"); + + // Report.on will add an event handler which prints to Log window. + report.on("loaded", function() { + Log.logText("Loaded"); + }); +} + // ---- Report Operations ---------------------------------------------------- function _Report_GetId() { @@ -251,6 +285,82 @@ function _Report_ExitFullScreen() { report.exitFullscreen(); } +function _Report_switchModeEdit() { + // Get a reference to the embedded report. + report = powerbi.embeds[0]; + + // Switch to edit mode. + report.switchMode("edit"); +} + +function _Report_switchModeView() { + // Get a reference to the embedded report. + report = powerbi.embeds[0]; + + // Switch to view mode. + report.switchMode("view"); +} + +function _Report_save() { + // Get a reference to report. + report = powerbi.embeds[0]; + + // Save report + report.save(); + + // report.off removes a given event handler if it exists. + report.off("saved"); + + // report.on will add an event handler which prints to Log window. + report.on("saved", function() { + var reportObjectId = event.detail.reportObjectId; + var isSaveAs = event.detail.saveAs; + Log.logText("Save Report Completed, reportObjectId: " + reportObjectId); + Log.logText("Is saveAs: " + isSaveAs.toString()); + }); +} + +function _Report_saveAs() { + // Get a reference to report. + report = powerbi.embeds[0]; + + var saveAsParameters = { + name: "newReport" + }; + + // SaveAs report + report.saveAs(saveAsParameters); + + // report.off removes a given event handler if it exists. + report.off("saved"); + + // report.on will add an event handler which prints to Log window. + report.on("saved", function() { + var reportObjectId = event.detail.reportObjectId; + var isSaveAs = event.detail.saveAs; + var name = event.detail.reportName; + Log.logText("Report name " + name); + Log.logText("Save Report Completed, new reportObjectId: " + reportObjectId); + Log.logText("Is saveAs: " + isSaveAs.toString()); + }); +} + +function _Report_setAccessToken() { + // Get a reference to report. + report = powerbi.embeds[0]; + + // New AccessToken + var newAccessToken = "newAccessToken"; + + // Set new AccessToken + report.setAccessToken(newAccessToken).then(function (result) { + Log.log("AccessToken set"); + }) + .catch(function (errors) { + Log.log(errors); + }); +} + // ---- Page Operations ---------------------------------------------------- function _Page_SetActive() { diff --git a/demo/code-demo/scripts/report.js b/demo/code-demo/scripts/report.js index 8b83e877..6ecd4b6d 100644 --- a/demo/code-demo/scripts/report.js +++ b/demo/code-demo/scripts/report.js @@ -54,3 +54,22 @@ function OpenInteractStep() { LoadCodeArea("#embedCodeDiv", _Report_GetId); }); } + +function OpenCreateStep() { + $("#steps-auth a").removeClass(active_class); + $('#steps-embed a').addClass(active_class); + $('#steps-interact a').removeClass(active_class); + + $("#steps-auth .step-div").removeClass(active_div); + $('#steps-embed .step-div').addClass(active_div); + $('#steps-interact .step-div').removeClass(active_div); + + // Hide Embed view in authorization step. + $("#authorize-step-wrapper").hide(); + $("#embed-and-interact-steps-wrapper").show(); + + $("#settings").load("settings_create.html", function() { + SetTextBoxesFromSessionOrUrlParam("#txtAccessToken", "#txtReportEmbed", "#txtEmbedDatasetId"); + LoadCodeArea("#embedCodeDiv", _Embed_Create); + }); +} \ No newline at end of file diff --git a/demo/code-demo/scripts/step_authorize.js b/demo/code-demo/scripts/step_authorize.js index 2e1e4cad..d97078ad 100644 --- a/demo/code-demo/scripts/step_authorize.js +++ b/demo/code-demo/scripts/step_authorize.js @@ -1,12 +1,14 @@ function OpenEmbedStepWithSampleValues(accessToken, embedUrl, reportId) { - SetSession(SessionKeys.AccessToken, accessToken); - SetSession(SessionKeys.EmbedUrl, embedUrl); - SetSession(SessionKeys.EmbedId, reportId); - + setSession(accessToken, embedUrl, reportId); OpenEmbedStep(); } +function OpenCleanEmbedStep() +{ + OpenEmbedStepWithSampleValues("","",""); +} + function OpenEmbedStepWithSample() { var staticReportUrl = 'https://powerbi-embed-api.azurewebsites.net/api/reports/c52af8ab-0468-4165-92af-dc39858d66ad'; fetch(staticReportUrl).then(function (response) { @@ -20,4 +22,31 @@ function OpenEmbedStepWithSample() { var accessToken = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ2ZXIiOiIwLjIuMCIsIndjbiI6IlBvd2VyQmlBenVyZVNhbXBsZXMiLCJ3aWQiOiJmODFjMTk2Ni1lZGVlLTQxMWItOGY4YS1mODQ0NjAxOWIwNDQiLCJyaWQiOiJjNTJhZjhhYi0wNDY4LTQxNjUtOTJhZi1kYzM5ODU4ZDY2YWQiLCJpc3MiOiJQb3dlckJJU0RLIiwiYXVkIjoiaHR0cHM6Ly9hbmFseXNpcy53aW5kb3dzLm5ldC9wb3dlcmJpL2FwaSIsImV4cCI6MTg5MzQ0ODgwMCwibmJmIjoxNDgxMDM3MTY5fQ.m4SwqmRWA9rJgfl72lEQ_G-Ijpw9Up5YwmBOfXi00YU"; OpenEmbedStepWithSampleValues(accessToken, embedUrl, reportId); +} + +function OpenEmbedStepCreateWithSampleValues(accessToken, embedUrl, datasetId) +{ + setSession(accessToken, embedUrl, datasetId); + OpenCreateStep(); +} + +function OpenCleanEmbedStepCreate() +{ + OpenEmbedStepCreateWithSampleValues("","",""); +} + +function OpenEmbedStepCreateWithSample() { + // Default values - report with embed token which expires on 1/1/2030. + var embedUrl = 'https://dxt.powerbi.com/appTokenReportEmbed?reportEmbedEditingEnabled=true'; + var datasetId = '56603ccc-e43f-46ad-ba2f-b9e9a145f0b7'; + var accessToken = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ3Y24iOiJTYWdlRFhUV0MiLCJ3aWQiOiIwZmI4MGMyNC05ODlmLTQ4NDEtOWU0OS1iOWFjOWNhMzRmZTIiLCJkaWQiOiI1NjYwM2NjYy1lNDNmLTQ2YWQtYmEyZi1iOWU5YTE0NWYwYjciLCJ2ZXIiOiIwLjIuMCIsInR5cGUiOiJlbWJlZCIsInNjcCI6IkRhdGFzZXQuUmVhZCBXb3Jrc3BhY2UuUmVwb3J0LkNyZWF0ZSIsImlzcyI6IlBvd2VyQklTREsiLCJhdWQiOiJodHRwczovL2FuYWx5c2lzLndpbmRvd3MubmV0L3Bvd2VyYmkvYXBpIiwiZXhwIjoxNDkzNzE3MTU2LCJuYmYiOjE0ODUwNzM1NTZ9.3V7S7JinkJygkXaLtyK_StfYSR53Mbc56-VPFJFlETI"; + + OpenEmbedStepCreateWithSampleValues(accessToken, embedUrl, datasetId); +} + +function setSession(accessToken, embedUrl, datasetId) +{ + SetSession(SessionKeys.AccessToken, accessToken); + SetSession(SessionKeys.EmbedUrl, embedUrl); + SetSession(SessionKeys.EmbedId, datasetId); } \ No newline at end of file diff --git a/demo/code-demo/scripts/step_embed.js b/demo/code-demo/scripts/step_embed.js index 1149557d..c3134d8f 100644 --- a/demo/code-demo/scripts/step_embed.js +++ b/demo/code-demo/scripts/step_embed.js @@ -70,3 +70,25 @@ function Events_PageChanged() { function Events_DataSelected() { SetCode(_Events_DataSelected); } + +// ---- Edit and Save Operations ---------------------------------------------------- + +function Report_switchModeEdit() { + SetCode(_Report_switchModeEdit); +} + +function Report_switchModeView() { + SetCode(_Report_switchModeView); +} + +function Report_save() { + SetCode(_Report_save); +} + +function Report_saveAs() { + SetCode(_Report_saveAs); +} + +function Report_setAccessToken() { + SetCode(_Report_setAccessToken); +} \ No newline at end of file diff --git a/demo/code-demo/scripts/step_interact.js b/demo/code-demo/scripts/step_interact.js index c6c85a11..5c7cc191 100644 --- a/demo/code-demo/scripts/step_interact.js +++ b/demo/code-demo/scripts/step_interact.js @@ -2,11 +2,13 @@ function OpenReportOperations() { $("#report-operations-div").show(); $("#page-operations-div").hide(); $("#events-operations-div").hide(); - + $("#editandsave-operations-div").hide(); + $("#report-operations-li").addClass('active'); $('#page-operations-li').removeClass('active'); $('#events-operations-li').removeClass('active'); - + $('#editandsave-operations-li').removeClass('active'); + $("#report-operations-div .function-ul li.active").click() $("#selected-catogory-button").html("Report operations"); @@ -17,10 +19,12 @@ function OpenPageOperations() { $("#page-operations-div").show(); $("#report-operations-div").hide(); $("#events-operations-div").hide(); + $("#editandsave-operations-div").hide(); $("#page-operations-li").addClass('active'); $('#report-operations-li').removeClass('active'); $('#events-operations-li').removeClass('active'); + $('#editandsave-operations-li').removeClass('active'); $("#page-operations-div .function-ul li.active").click(); @@ -32,17 +36,36 @@ function OpenEventOperations() { $("#page-operations-div").hide(); $("#report-operations-div").hide(); $("#events-operations-div").show(); + $("#editandsave-operations-div").hide(); $("#page-operations-li").removeClass('active'); $('#report-operations-li').removeClass('active'); $('#events-operations-li').addClass('active'); - + $('#editandsave-operations-li').removeClass('active'); + $("#events-operations-div .function-ul li.active").click(); $("#selected-catogory-button").html("Events Listener"); HideCategoriesList(); } +function OpenEditAndSaveOperations() { + $("#page-operations-div").hide(); + $("#report-operations-div").hide(); + $("#events-operations-div").hide(); + $("#editandsave-operations-div").show(); + + $("#page-operations-li").removeClass('active'); + $('#report-operations-li').removeClass('active'); + $('#events-operations-li').removeClass('active'); + $('#editandsave-operations-li').addClass('active'); + + $("#editandsave-operations-div .function-ul li.active").click(); + + $("#selected-catogory-button").html("Edit and save operations"); + HideCategoriesList(); +} + function HideCategoriesList() { $("#operations-ul-wrapper").hide(); } diff --git a/demo/code-demo/settings_create.html b/demo/code-demo/settings_create.html new file mode 100644 index 00000000..0b3485b1 --- /dev/null +++ b/demo/code-demo/settings_create.html @@ -0,0 +1,31 @@ +
+ +
+ +
+ +
+

Create Report

+ Fill in the fields below to get the code to create your report. +
+
+
+ Embed App Token +
+
+
+ Embed URL +
+
+
+ Dataset Id +
+
+
\ No newline at end of file diff --git a/demo/code-demo/settings_embed.html b/demo/code-demo/settings_embed.html index 8aded0e2..6d0bf232 100644 --- a/demo/code-demo/settings_embed.html +++ b/demo/code-demo/settings_embed.html @@ -1,4 +1,16 @@
+ +
+ +
+

Embed Report

Fill in the fields below to get the code to embed your report. diff --git a/demo/code-demo/settings_interact.html b/demo/code-demo/settings_interact.html index 4910f444..0e056a6c 100644 --- a/demo/code-demo/settings_interact.html +++ b/demo/code-demo/settings_interact.html @@ -16,6 +16,9 @@
  • Events listener
  • +
  • + Edit and save operations +
  • @@ -51,6 +54,15 @@
  • Data Selected
  • +
    diff --git a/demo/code-demo/step_authorize.html b/demo/code-demo/step_authorize.html index 7a0aaeaa..72a627a1 100644 --- a/demo/code-demo/step_authorize.html +++ b/demo/code-demo/step_authorize.html @@ -7,6 +7,7 @@

    Sample Report

    +
    diff --git a/demo/code-demo/step_create.html b/demo/code-demo/step_create.html new file mode 100644 index 00000000..0101edae --- /dev/null +++ b/demo/code-demo/step_create.html @@ -0,0 +1,32 @@ + +
    + + + + + + + + + + + + + +
    Embed App Token
    Embed url + +
    Dataset Id
    + +

    Code

    +

    + + + + +
    + + diff --git a/demo/code-demo/style/style.css b/demo/code-demo/style/style.css index 72055dbb..85f71b2c 100644 --- a/demo/code-demo/style/style.css +++ b/demo/code-demo/style/style.css @@ -490,3 +490,12 @@ a { position: relative; top: -1px; } + +.tabContainer { + margin-bottom: 5px; + padding-left: 0; +} + +.nav-tabs { + border-bottom: 0px; +} \ No newline at end of file diff --git a/dist/create.d.ts b/dist/create.d.ts new file mode 100644 index 00000000..b10b8e7b --- /dev/null +++ b/dist/create.d.ts @@ -0,0 +1,28 @@ +/*! powerbi-client v2.2.3 | (c) 2016 Microsoft Corporation MIT */ +import * as service from './service'; +import * as models from 'powerbi-models'; +import * as embed from './embed'; +export declare class Create extends embed.Embed { + constructor(service: service.Service, element: HTMLElement, config: embed.IEmbedConfiguration); + /** + * Gets the dataset ID from the first available location: createConfig or embed url. + * + * @returns {string} + */ + getId(): string; + /** + * Validate create report configuration. + */ + validate(config: models.IReportCreateConfiguration): models.IError[]; + /** + * Adds the ability to get datasetId from url. + * (e.g. http://embedded.powerbi.com/appTokenReportEmbed?datasetId=854846ed-2106-4dc2-bc58-eb77533bf2f1). + * + * By extracting the ID we can ensure that the ID is always explicitly provided as part of the create configuration. + * + * @static + * @param {string} url + * @returns {string} + */ + static findIdFromEmbedUrl(url: string): string; +} diff --git a/dist/embed.d.ts b/dist/embed.d.ts index 8c115955..45d63974 100644 --- a/dist/embed.d.ts +++ b/dist/embed.d.ts @@ -27,6 +27,8 @@ export interface IEmbedConfiguration { pageName?: string; filters?: models.IFilter[]; pageView?: models.PageView; + datasetId?: string; + permissions?: models.Permissions; } export interface IInternalEmbedConfiguration extends models.IReportLoadConfiguration { uniqueId: string; @@ -83,6 +85,12 @@ export declare abstract class Embed { * @type {IInternalEmbedConfiguration} */ config: IInternalEmbedConfiguration; + /** + * Gets or sets the configuration settings for creating report. + * + * @type {models.IReportCreateConfiguration} + */ + createConfig: models.IReportCreateConfiguration; /** * Url used in the load request. */ @@ -97,7 +105,32 @@ export declare abstract class Embed { * @param {HTMLElement} element * @param {IEmbedConfiguration} config */ - constructor(service: service.Service, element: HTMLElement, config: IEmbedConfiguration); + constructor(service: service.Service, element: HTMLElement, config: IEmbedConfiguration, iframe?: HTMLIFrameElement); + /** + * Sends createReport configuration data. + * + * ```javascript + * createReport({ + * datasetId: '5dac7a4a-4452-46b3-99f6-a25915e0fe55', + * accessToken: 'eyJ0eXA ... TaE2rTSbmg', + * ``` + * + * @param {models.IReportCreateConfiguration} config + * @returns {Promise} + */ + createReport(config: models.IReportCreateConfiguration): Promise; + /** + * Saves Report. + * + * @returns {Promise} + */ + save(): Promise; + /** + * SaveAs Report. + * + * @returns {Promise} + */ + saveAs(saveAsParameters: models.ISaveAsParameters): Promise; /** * Sends load configuration data. * @@ -168,6 +201,12 @@ export declare abstract class Embed { * ``` */ reload(): Promise; + /** + * Set accessToken. + * + * @returns {Promise} + */ + setAccessToken(accessToken: string): Promise; /** * Gets an access token from the first available location: config, attribute, global. * @@ -176,6 +215,22 @@ export declare abstract class Embed { * @returns {string} */ private getAccessToken(globalAccessToken); + /** + * Sets Embed for load + * + * @private + * @param {} + * @returns {void} + */ + private setEmbedForLoad(); + /** + * Sets Embed for create report + * + * @private + * @param {IEmbedConfiguration} config + * @returns {void} + */ + private setEmbedForCreate(config); /** * Gets an embed url from the first available location: options, attribute. * @@ -216,7 +271,11 @@ export declare abstract class Embed { */ private isFullscreen(iframe); /** - * Validate load configuration. + * Validate load and create configuration. + */ + abstract validate(config: models.IReportLoadConfiguration | models.IDashboardLoadConfiguration | models.IReportCreateConfiguration): models.IError[]; + /** + * Sets Iframe for embed */ - abstract validate(config: models.IReportLoadConfiguration | models.IDashboardLoadConfiguration): models.IError[]; + private setIframe(isLoad); } diff --git a/dist/powerbi.js b/dist/powerbi.js index ceb6acec..1a4fdf36 100644 --- a/dist/powerbi.js +++ b/dist/powerbi.js @@ -57,7 +57,7 @@ return /******/ (function(modules) { // webpackBootstrap var service = __webpack_require__(1); exports.service = service; - var factories = __webpack_require__(9); + var factories = __webpack_require__(10); exports.factories = factories; var models = __webpack_require__(5); exports.models = models; @@ -88,6 +88,7 @@ return /******/ (function(modules) { // webpackBootstrap var tile_1 = __webpack_require__(8); var page_1 = __webpack_require__(6); var utils = __webpack_require__(3); + var create = __webpack_require__(9); /** * The Power BI Service embed component, which is the entry point to embed all other Power BI components into your application * @@ -147,6 +148,20 @@ return /******/ (function(modules) { // webpackBootstrap this.enableAutoEmbed(); } } + /** + * Creates new report + * @param {HTMLElement} element + * @param {embed.IEmbedConfiguration} [config={}] + * @returns {embed.Embed} + */ + Service.prototype.createReport = function (element, config) { + config.type = 'create'; + var powerBiElement = element; + var component = new create.Create(this, powerBiElement, config); + powerBiElement.powerBiEmbed = component; + this.embeds.push(component); + return component; + }; /** * TODO: Add a description here * @@ -225,6 +240,17 @@ return /******/ (function(modules) { // webpackBootstrap * then we can call the embedNew function which would allow setting the proper embedUrl and construction of object based on the new type. */ if (typeof config.type === "string" && config.type !== component.config.type) { + /** + * When loading report after create we want to use existing Iframe ptimize load period + */ + if (config.type === "report" && component.config.type === "create") { + var report = new report_1.Report(this, element, config, element.powerBiEmbed.iframe); + report.load(config); + element.powerBiEmbed = report; + this.embeds.pop(); + this.embeds.push(report); + return report; + } throw new Error("Embedding on an existing element with a different type than the previous embed object is not supported. Attempted to embed using config " + JSON.stringify(config) + " on element " + element.outerHTML + ", but the existing element contains an embed of type: " + this.config.type + " which does not match the new type: " + config.type); } component.load(config); @@ -357,25 +383,76 @@ return /******/ (function(modules) { // webpackBootstrap * @param {HTMLElement} element * @param {IEmbedConfiguration} config */ - function Embed(service, element, config) { - var _this = this; + function Embed(service, element, config, iframe) { this.allowedEvents = []; Array.prototype.push.apply(this.allowedEvents, Embed.allowedEvents); this.eventHandlers = []; this.service = service; this.element = element; + this.iframe = iframe; // TODO: Change when Object.assign is available. var settings = utils.assign({}, Embed.defaultSettings, config.settings); this.config = utils.assign({ settings: settings }, config); - this.config.accessToken = this.getAccessToken(service.accessToken); - this.config.embedUrl = this.getEmbedUrl(); - this.config.id = this.getId(); this.config.uniqueId = this.getUniqueId(); - var iframeHtml = ""; - this.element.innerHTML = iframeHtml; - this.iframe = this.element.childNodes[0]; - this.iframe.addEventListener('load', function () { return _this.load(_this.config); }, false); + if (config.type === 'create') { + this.setEmbedForCreate(config); + } + else { + this.setEmbedForLoad(); + } } + /** + * Sends createReport configuration data. + * + * ```javascript + * createReport({ + * datasetId: '5dac7a4a-4452-46b3-99f6-a25915e0fe55', + * accessToken: 'eyJ0eXA ... TaE2rTSbmg', + * ``` + * + * @param {models.IReportCreateConfiguration} config + * @returns {Promise} + */ + Embed.prototype.createReport = function (config) { + var errors = this.validate(config); + if (errors) { + throw errors; + } + return this.service.hpm.post("/report/create", config, { uid: this.config.uniqueId }, this.iframe.contentWindow) + .then(function (response) { + return response.body; + }, function (response) { + throw response.body; + }); + }; + /** + * Saves Report. + * + * @returns {Promise} + */ + Embed.prototype.save = function () { + return this.service.hpm.post('/report/save', null, { uid: this.config.uniqueId }, this.iframe.contentWindow) + .then(function (response) { + return response.body; + }) + .catch(function (response) { + throw response.body; + }); + }; + /** + * SaveAs Report. + * + * @returns {Promise} + */ + Embed.prototype.saveAs = function (saveAsParameters) { + return this.service.hpm.post('/report/saveAs', saveAsParameters, { uid: this.config.uniqueId }, this.iframe.contentWindow) + .then(function (response) { + return response.body; + }) + .catch(function (response) { + throw response.body; + }); + }; /** * Sends load configuration data. * @@ -486,6 +563,20 @@ return /******/ (function(modules) { // webpackBootstrap Embed.prototype.reload = function () { return this.load(this.config); }; + /** + * Set accessToken. + * + * @returns {Promise} + */ + Embed.prototype.setAccessToken = function (accessToken) { + return this.service.hpm.post('/report/token', accessToken, { uid: this.config.uniqueId }, this.iframe.contentWindow) + .then(function (response) { + return response.body; + }) + .catch(function (response) { + throw response.body; + }); + }; /** * Gets an access token from the first available location: config, attribute, global. * @@ -500,6 +591,32 @@ return /******/ (function(modules) { // webpackBootstrap } return accessToken; }; + /** + * Sets Embed for load + * + * @private + * @param {} + * @returns {void} + */ + Embed.prototype.setEmbedForLoad = function () { + this.config.id = this.getId(); + this.config.accessToken = this.getAccessToken(this.service.accessToken); + this.setIframe(true /*set EventListener to call load() on 'load' event*/); + }; + /** + * Sets Embed for create report + * + * @private + * @param {IEmbedConfiguration} config + * @returns {void} + */ + Embed.prototype.setEmbedForCreate = function (config) { + this.createConfig = { + datasetId: config.datasetId || this.getId(), + accessToken: this.getAccessToken(this.service.accessToken) + }; + this.setIframe(false /*set EventListener to call create() on 'load' event*/); + }; /** * Gets an embed url from the first available location: options, attribute. * @@ -552,7 +669,25 @@ return /******/ (function(modules) { // webpackBootstrap var options = ['fullscreenElement', 'webkitFullscreenElement', 'mozFullscreenScreenElement', 'msFullscreenElement']; return options.some(function (option) { return document[option] === iframe; }); }; - Embed.allowedEvents = ["loaded"]; + /** + * Sets Iframe for embed + */ + Embed.prototype.setIframe = function (isLoad) { + var _this = this; + if (!this.iframe) { + this.config.embedUrl = this.getEmbedUrl(); + var iframeHtml = ""; + this.element.innerHTML = iframeHtml; + this.iframe = this.element.childNodes[0]; + } + if (isLoad) { + this.iframe.addEventListener('load', function () { return _this.load(_this.config); }, false); + } + else { + this.iframe.addEventListener('load', function () { return _this.createReport(_this.createConfig); }, false); + } + }; + Embed.allowedEvents = ["loaded", "saved"]; Embed.accessTokenAttribute = 'powerbi-access-token'; Embed.embedUrlAttribute = 'powerbi-embed-url'; Embed.nameAttribute = 'powerbi-name'; @@ -711,7 +846,7 @@ return /******/ (function(modules) { // webpackBootstrap * @param {HTMLElement} element * @param {embed.IEmbedConfiguration} config */ - function Report(service, element, config) { + function Report(service, element, config, iframe) { var filterPaneEnabled = (config.settings && config.settings.filterPaneEnabled) || !(element.getAttribute(Report.filterPaneEnabledAttribute) === "false"); var navContentPaneEnabled = (config.settings && config.settings.navContentPaneEnabled) || !(element.getAttribute(Report.navContentPaneEnabledAttribute) === "false"); var settings = utils.assign({ @@ -719,7 +854,7 @@ return /******/ (function(modules) { // webpackBootstrap navContentPaneEnabled: navContentPaneEnabled }, config.settings); var configCopy = utils.assign({ settings: settings }, config); - _super.call(this, service, element, configCopy); + _super.call(this, service, element, configCopy, iframe); this.loadPath = "/report/load"; Array.prototype.push.apply(this.allowedEvents, Report.allowedEvents); } @@ -914,7 +1049,22 @@ return /******/ (function(modules) { // webpackBootstrap Report.prototype.validate = function (config) { return models.validateReportLoad(config); }; - Report.allowedEvents = ["dataSelected", "filtersApplied", "pageChanged", "error"]; + /** + * Switch Report view mode. + * + * @returns {Promise} + */ + Report.prototype.switchMode = function (viewMode) { + var url = '/report/switchMode/' + viewMode; + return this.service.hpm.post(url, null, { uid: this.config.uniqueId }, this.iframe.contentWindow) + .then(function (response) { + return response.body; + }) + .catch(function (response) { + throw response.body; + }); + }; + Report.allowedEvents = ["rendered", "dataSelected", "filtersApplied", "pageChanged", "error", "saved"]; Report.reportIdAttribute = 'powerbi-report-id'; Report.filterPaneEnabledAttribute = 'powerbi-settings-filter-pane-enabled'; Report.navContentPaneEnabledAttribute = 'powerbi-settings-nav-content-pane-enabled'; @@ -929,7 +1079,7 @@ return /******/ (function(modules) { // webpackBootstrap /* 5 */ /***/ function(module, exports, __webpack_require__) { - /*! powerbi-models v0.10.1 | (c) 2016 Microsoft Corporation MIT */ + /*! powerbi-models v0.10.4 | (c) 2016 Microsoft Corporation MIT */ (function webpackUniversalModuleDefinition(root, factory) { if(true) module.exports = factory(); @@ -999,8 +1149,10 @@ return /******/ (function(modules) { // webpackBootstrap exports.pageSchema = __webpack_require__(5); exports.settingsSchema = __webpack_require__(6); exports.basicFilterSchema = __webpack_require__(7); + exports.createReportSchema = __webpack_require__(8); + exports.saveAsParametersSchema = __webpack_require__(9); /* tslint:enable:no-var-requires */ - var jsen = __webpack_require__(8); + var jsen = __webpack_require__(10); function normalizeError(error) { var message = error.message; if (!message) { @@ -1039,6 +1191,7 @@ return /******/ (function(modules) { // webpackBootstrap advancedFilter: exports.advancedFilterSchema } }); + exports.validateCreateReport = validate(exports.createReportSchema); exports.validateDashboardLoad = validate(exports.dashboardLoadSchema); exports.validatePage = validate(exports.pageSchema); exports.validateFilter = validate(exports.filterSchema, { @@ -1053,6 +1206,14 @@ return /******/ (function(modules) { // webpackBootstrap FilterType[FilterType["Unknown"] = 2] = "Unknown"; })(exports.FilterType || (exports.FilterType = {})); var FilterType = exports.FilterType; + function isFilterKeyColumnsTarget(target) { + return isColumn(target) && !!target.keys; + } + exports.isFilterKeyColumnsTarget = isFilterKeyColumnsTarget; + function isBasicFilterWithKeys(filter) { + return getFilterType(filter) === FilterType.Basic && !!filter.keyValues; + } + exports.isBasicFilterWithKeys = isBasicFilterWithKeys; function getFilterType(filter) { var basicFilter = filter; var advancedFilter = filter; @@ -1105,8 +1266,8 @@ return /******/ (function(modules) { // webpackBootstrap _super.call(this, target); this.operator = operator; this.schemaUrl = BasicFilter.schemaUrl; - if (values.length === 0) { - throw new Error("values must be a non-empty array. You passed: " + values); + if (values.length === 0 && operator !== "All") { + throw new Error("values must be a non-empty array unless your operator is \"All\"."); } /** * Accept values as array instead of as individual arguments @@ -1130,6 +1291,36 @@ return /******/ (function(modules) { // webpackBootstrap return BasicFilter; }(Filter)); exports.BasicFilter = BasicFilter; + var BasicFilterWithKeys = (function (_super) { + __extends(BasicFilterWithKeys, _super); + function BasicFilterWithKeys(target, operator, values, keyValues) { + _super.call(this, target, operator, values); + this.keyValues = keyValues; + this.target = target; + var numberOfKeys = target.keys ? target.keys.length : 0; + if (numberOfKeys > 0 && !keyValues) { + throw new Error("You shold pass the values to be filtered for each key. You passed: no values and " + numberOfKeys + " keys"); + } + if (numberOfKeys === 0 && keyValues && keyValues.length > 0) { + throw new Error("You passed key values but your target object doesn't contain the keys to be filtered"); + } + for (var i = 0; i < this.keyValues.length; i++) { + if (this.keyValues[i]) { + var lengthOfArray = this.keyValues[i].length; + if (lengthOfArray !== numberOfKeys) { + throw new Error("Each tuple of key values should contain a value for each of the keys. You passed: " + lengthOfArray + " values and " + numberOfKeys + " keys"); + } + } + } + } + BasicFilterWithKeys.prototype.toJSON = function () { + var filter = _super.prototype.toJSON.call(this); + filter.keyValues = this.keyValues; + return filter; + }; + return BasicFilterWithKeys; + }(BasicFilter)); + exports.BasicFilterWithKeys = BasicFilterWithKeys; var AdvancedFilter = (function (_super) { __extends(AdvancedFilter, _super); function AdvancedFilter(target, logicalOperator) { @@ -1178,6 +1369,20 @@ return /******/ (function(modules) { // webpackBootstrap return AdvancedFilter; }(Filter)); exports.AdvancedFilter = AdvancedFilter; + (function (Permissions) { + Permissions[Permissions["Read"] = 0] = "Read"; + Permissions[Permissions["ReadWrite"] = 1] = "ReadWrite"; + Permissions[Permissions["Copy"] = 2] = "Copy"; + Permissions[Permissions["Create"] = 4] = "Create"; + Permissions[Permissions["All"] = 7] = "All"; + })(exports.Permissions || (exports.Permissions = {})); + var Permissions = exports.Permissions; + (function (ViewMode) { + ViewMode[ViewMode["View"] = 0] = "View"; + ViewMode[ViewMode["Edit"] = 1] = "Edit"; + })(exports.ViewMode || (exports.ViewMode = {})); + var ViewMode = exports.ViewMode; + exports.validateSaveAsParameters = validate(exports.saveAsParametersSchema); /***/ }, @@ -1336,6 +1541,26 @@ return /******/ (function(modules) { // webpackBootstrap ] }, "invalidMessage": "filters property is invalid" + }, + "permissions": { + "type": "number", + "enum": [ + 0, + 1, + 2, + 3 + ], + "default": 0, + "invalidMessage": "permissions property is invalid" + }, + "viewMode": { + "type": "number", + "enum": [ + 0, + 1 + ], + "default": 0, + "invalidMessage": "viewMode property is invalid" } }, "required": [ @@ -1419,6 +1644,12 @@ return /******/ (function(modules) { // webpackBootstrap "messages": { "type": "navContentPaneEnabled must be a boolean" } + }, + "useCustomSaveAsDialog": { + "type": "boolean", + "messages": { + "type": "useCustomSaveAsDialog must be a boolean" + } } } }; @@ -1477,12 +1708,62 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, /* 8 */ - /***/ function(module, exports, __webpack_require__) { + /***/ function(module, exports) { - module.exports = __webpack_require__(9); + module.exports = { + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "accessToken": { + "type": "string", + "messages": { + "type": "accessToken must be a string", + "required": "accessToken is required" + } + }, + "datasetId": { + "type": "string", + "messages": { + "type": "datasetId must be a string", + "required": "datasetId is required" + } + } + }, + "required": [ + "accessToken", + "datasetId" + ] + }; /***/ }, /* 9 */ + /***/ function(module, exports) { + + module.exports = { + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "name": { + "type": "string", + "messages": { + "type": "name must be a string", + "required": "name is required" + } + } + }, + "required": [ + "name" + ] + }; + + /***/ }, + /* 10 */ + /***/ function(module, exports, __webpack_require__) { + + module.exports = __webpack_require__(11); + + /***/ }, + /* 11 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -1493,12 +1774,12 @@ return /******/ (function(modules) { // webpackBootstrap INVALID_SCHEMA = 'jsen: invalid schema object', browser = typeof window === 'object' && !!window.navigator, // jshint ignore: line regescape = new RegExp('/').source !== '/', // node v0.x does not properly escape '/'s in inline regex - func = __webpack_require__(10), - equal = __webpack_require__(11), - unique = __webpack_require__(12), - SchemaResolver = __webpack_require__(13), - formats = __webpack_require__(21), - ucs2length = __webpack_require__(22), + func = __webpack_require__(12), + equal = __webpack_require__(13), + unique = __webpack_require__(14), + SchemaResolver = __webpack_require__(15), + formats = __webpack_require__(24), + ucs2length = __webpack_require__(25), types = {}, keywords = {}; @@ -2581,7 +2862,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, - /* 10 */ + /* 12 */ /***/ function(module, exports) { 'use strict'; @@ -2652,7 +2933,7 @@ return /******/ (function(modules) { // webpackBootstrap }; /***/ }, - /* 11 */ + /* 13 */ /***/ function(module, exports) { 'use strict'; @@ -2729,12 +3010,12 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = equal; /***/ }, - /* 12 */ + /* 14 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; - var equal = __webpack_require__(11); + var equal = __webpack_require__(13); function findIndex(arr, value, comparator) { for (var i = 0, len = arr.length; i < len; i++) { @@ -2755,13 +3036,13 @@ return /******/ (function(modules) { // webpackBootstrap module.exports.findIndex = findIndex; /***/ }, - /* 13 */ + /* 15 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; - var url = __webpack_require__(14), - metaschema = __webpack_require__(20), + var url = __webpack_require__(16), + metaschema = __webpack_require__(23), INVALID_SCHEMA_REFERENCE = 'jsen: invalid schema reference', DUPLICATE_SCHEMA_ID = 'jsen: duplicate schema id', CIRCULAR_SCHEMA_REFERENCE = 'jsen: circular schema reference'; @@ -3049,7 +3330,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = SchemaResolver; /***/ }, - /* 14 */ + /* 16 */ /***/ function(module, exports, __webpack_require__) { // Copyright Joyent, Inc. and other Node contributors. @@ -3073,7 +3354,10 @@ return /******/ (function(modules) { // webpackBootstrap // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. - var punycode = __webpack_require__(15); + 'use strict'; + + var punycode = __webpack_require__(17); + var util = __webpack_require__(19); exports.parse = urlParse; exports.resolve = urlResolve; @@ -3104,6 +3388,9 @@ return /******/ (function(modules) { // webpackBootstrap var protocolPattern = /^([a-z0-9.+-]+:)/i, portPattern = /:[0-9]*$/, + // Special case for a simple path URL + simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/, + // RFC 2396: characters reserved for delimiting URLs. // We actually just auto-escape these. delims = ['<', '>', '"', '`', ' ', '\r', '\n', '\t'], @@ -3120,8 +3407,8 @@ return /******/ (function(modules) { // webpackBootstrap nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape), hostEndingChars = ['/', '?', '#'], hostnameMaxLen = 255, - hostnamePartPattern = /^[a-z0-9A-Z_-]{0,63}$/, - hostnamePartStart = /^([a-z0-9A-Z_-]{0,63})(.*)$/, + hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/, + hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, // protocols that can allow "unsafe" and "unwise" chars. unsafeProtocol = { 'javascript': true, @@ -3145,10 +3432,10 @@ return /******/ (function(modules) { // webpackBootstrap 'gopher:': true, 'file:': true }, - querystring = __webpack_require__(17); + querystring = __webpack_require__(20); function urlParse(url, parseQueryString, slashesDenoteHost) { - if (url && isObject(url) && url instanceof Url) return url; + if (url && util.isObject(url) && url instanceof Url) return url; var u = new Url; u.parse(url, parseQueryString, slashesDenoteHost); @@ -3156,16 +3443,49 @@ return /******/ (function(modules) { // webpackBootstrap } Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { - if (!isString(url)) { + if (!util.isString(url)) { throw new TypeError("Parameter 'url' must be a string, not " + typeof url); } + // Copy chrome, IE, opera backslash-handling behavior. + // Back slashes before the query string get converted to forward slashes + // See: https://code.google.com/p/chromium/issues/detail?id=25916 + var queryIndex = url.indexOf('?'), + splitter = + (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#', + uSplit = url.split(splitter), + slashRegex = /\\/g; + uSplit[0] = uSplit[0].replace(slashRegex, '/'); + url = uSplit.join(splitter); + var rest = url; // trim before proceeding. // This is to support parse stuff like " http://foo.com \n" rest = rest.trim(); + if (!slashesDenoteHost && url.split('#').length === 1) { + // Try fast path regexp + var simplePath = simplePathPattern.exec(rest); + if (simplePath) { + this.path = rest; + this.href = rest; + this.pathname = simplePath[1]; + if (simplePath[2]) { + this.search = simplePath[2]; + if (parseQueryString) { + this.query = querystring.parse(this.search.substr(1)); + } else { + this.query = this.search.substr(1); + } + } else if (parseQueryString) { + this.search = ''; + this.query = {}; + } + return this; + } + } + var proto = protocolPattern.exec(rest); if (proto) { proto = proto[0]; @@ -3303,18 +3623,11 @@ return /******/ (function(modules) { // webpackBootstrap } if (!ipv6Hostname) { - // IDNA Support: Returns a puny coded representation of "domain". - // It only converts the part of the domain name that - // has non ASCII characters. I.e. it dosent matter if - // you call it with a domain that already is in ASCII. - var domainArray = this.hostname.split('.'); - var newOut = []; - for (var i = 0; i < domainArray.length; ++i) { - var s = domainArray[i]; - newOut.push(s.match(/[^A-Za-z0-9_-]/) ? - 'xn--' + punycode.encode(s) : s); - } - this.hostname = newOut.join('.'); + // IDNA Support: Returns a punycoded representation of "domain". + // It only converts parts of the domain name that + // have non-ASCII characters, i.e. it doesn't matter if + // you call it with a domain that already is ASCII-only. + this.hostname = punycode.toASCII(this.hostname); } var p = this.port ? ':' + this.port : ''; @@ -3341,6 +3654,8 @@ return /******/ (function(modules) { // webpackBootstrap // need to be. for (var i = 0, l = autoEscape.length; i < l; i++) { var ae = autoEscape[i]; + if (rest.indexOf(ae) === -1) + continue; var esc = encodeURIComponent(ae); if (esc === ae) { esc = escape(ae); @@ -3394,7 +3709,7 @@ return /******/ (function(modules) { // webpackBootstrap // If it's an obj, this is a no-op. // this way, you can call url_format() on strings // to clean up potentially wonky urls. - if (isString(obj)) obj = urlParse(obj); + if (util.isString(obj)) obj = urlParse(obj); if (!(obj instanceof Url)) return Url.prototype.format.call(obj); return obj.format(); } @@ -3425,7 +3740,7 @@ return /******/ (function(modules) { // webpackBootstrap } if (this.query && - isObject(this.query) && + util.isObject(this.query) && Object.keys(this.query).length) { query = querystring.stringify(this.query); } @@ -3469,16 +3784,18 @@ return /******/ (function(modules) { // webpackBootstrap } Url.prototype.resolveObject = function(relative) { - if (isString(relative)) { + if (util.isString(relative)) { var rel = new Url(); rel.parse(relative, false, true); relative = rel; } var result = new Url(); - Object.keys(this).forEach(function(k) { - result[k] = this[k]; - }, this); + var tkeys = Object.keys(this); + for (var tk = 0; tk < tkeys.length; tk++) { + var tkey = tkeys[tk]; + result[tkey] = this[tkey]; + } // hash is always overridden, no matter what. // even href="" will remove it. @@ -3493,10 +3810,12 @@ return /******/ (function(modules) { // webpackBootstrap // hrefs like //foo/bar always cut to the protocol. if (relative.slashes && !relative.protocol) { // take everything except the protocol from relative - Object.keys(relative).forEach(function(k) { - if (k !== 'protocol') - result[k] = relative[k]; - }); + var rkeys = Object.keys(relative); + for (var rk = 0; rk < rkeys.length; rk++) { + var rkey = rkeys[rk]; + if (rkey !== 'protocol') + result[rkey] = relative[rkey]; + } //urlParse appends trailing / to urls like http://www.example.com if (slashedProtocol[result.protocol] && @@ -3518,9 +3837,11 @@ return /******/ (function(modules) { // webpackBootstrap // because that's known to be hostless. // anything else is assumed to be absolute. if (!slashedProtocol[relative.protocol]) { - Object.keys(relative).forEach(function(k) { + var keys = Object.keys(relative); + for (var v = 0; v < keys.length; v++) { + var k = keys[v]; result[k] = relative[k]; - }); + } result.href = result.format(); return result; } @@ -3609,14 +3930,14 @@ return /******/ (function(modules) { // webpackBootstrap srcPath = srcPath.concat(relPath); result.search = relative.search; result.query = relative.query; - } else if (!isNullOrUndefined(relative.search)) { + } else if (!util.isNullOrUndefined(relative.search)) { // just pull out the search. // like href='https://github.com/?foo'. // Put this after the other two cases because it simplifies the booleans if (psychotic) { result.hostname = result.host = srcPath.shift(); //occationaly the auth can get stuck only in host - //this especialy happens in cases like + //this especially happens in cases like //url.resolveObject('mailto:local1@domain1', 'local2@domain2') var authInHost = result.host && result.host.indexOf('@') > 0 ? result.host.split('@') : false; @@ -3628,7 +3949,7 @@ return /******/ (function(modules) { // webpackBootstrap result.search = relative.search; result.query = relative.query; //to support http.request - if (!isNull(result.pathname) || !isNull(result.search)) { + if (!util.isNull(result.pathname) || !util.isNull(result.search)) { result.path = (result.pathname ? result.pathname : '') + (result.search ? result.search : ''); } @@ -3655,15 +3976,15 @@ return /******/ (function(modules) { // webpackBootstrap // then it must NOT get a trailing slash. var last = srcPath.slice(-1)[0]; var hasTrailingSlash = ( - (result.host || relative.host) && (last === '.' || last === '..') || - last === ''); + (result.host || relative.host || srcPath.length > 1) && + (last === '.' || last === '..') || last === ''); // strip single dots, resolve double dots to parent dir // if the path tries to go above the root, `up` ends up > 0 var up = 0; for (var i = srcPath.length; i >= 0; i--) { last = srcPath[i]; - if (last == '.') { + if (last === '.') { srcPath.splice(i, 1); } else if (last === '..') { srcPath.splice(i, 1); @@ -3698,7 +4019,7 @@ return /******/ (function(modules) { // webpackBootstrap result.hostname = result.host = isAbsolute ? '' : srcPath.length ? srcPath.shift() : ''; //occationaly the auth can get stuck only in host - //this especialy happens in cases like + //this especially happens in cases like //url.resolveObject('mailto:local1@domain1', 'local2@domain2') var authInHost = result.host && result.host.indexOf('@') > 0 ? result.host.split('@') : false; @@ -3722,7 +4043,7 @@ return /******/ (function(modules) { // webpackBootstrap } //to support request.http - if (!isNull(result.pathname) || !isNull(result.search)) { + if (!util.isNull(result.pathname) || !util.isNull(result.search)) { result.path = (result.pathname ? result.pathname : '') + (result.search ? result.search : ''); } @@ -3744,25 +4065,10 @@ return /******/ (function(modules) { // webpackBootstrap } if (host) this.hostname = host; }; - - function isString(arg) { - return typeof arg === "string"; - } - - function isObject(arg) { - return typeof arg === 'object' && arg !== null; - } - - function isNull(arg) { - return arg === null; - } - function isNullOrUndefined(arg) { - return arg == null; - } /***/ }, - /* 15 */ + /* 17 */ /***/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(module, global) {/*! https://mths.be/punycode v1.3.2 by @mathias */ @@ -4294,10 +4600,10 @@ return /******/ (function(modules) { // webpackBootstrap }(this)); - /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(16)(module), (function() { return this; }()))) + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(18)(module), (function() { return this; }()))) /***/ }, - /* 16 */ + /* 18 */ /***/ function(module, exports) { module.exports = function(module) { @@ -4313,17 +4619,39 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, - /* 17 */ + /* 19 */ + /***/ function(module, exports) { + + 'use strict'; + + module.exports = { + isString: function(arg) { + return typeof(arg) === 'string'; + }, + isObject: function(arg) { + return typeof(arg) === 'object' && arg !== null; + }, + isNull: function(arg) { + return arg === null; + }, + isNullOrUndefined: function(arg) { + return arg == null; + } + }; + + + /***/ }, + /* 20 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; - exports.decode = exports.parse = __webpack_require__(18); - exports.encode = exports.stringify = __webpack_require__(19); + exports.decode = exports.parse = __webpack_require__(21); + exports.encode = exports.stringify = __webpack_require__(22); /***/ }, - /* 18 */ + /* 21 */ /***/ function(module, exports) { // Copyright Joyent, Inc. and other Node contributors. @@ -4409,7 +4737,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, - /* 19 */ + /* 22 */ /***/ function(module, exports) { // Copyright Joyent, Inc. and other Node contributors. @@ -4479,7 +4807,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, - /* 20 */ + /* 23 */ /***/ function(module, exports) { module.exports = { @@ -4705,7 +5033,7 @@ return /******/ (function(modules) { // webpackBootstrap }; /***/ }, - /* 21 */ + /* 24 */ /***/ function(module, exports) { 'use strict'; @@ -4729,7 +5057,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = formats; /***/ }, - /* 22 */ + /* 25 */ /***/ function(module, exports) { 'use strict'; @@ -4995,10 +5323,68 @@ return /******/ (function(modules) { // webpackBootstrap /* 9 */ /***/ function(module, exports, __webpack_require__) { - var config_1 = __webpack_require__(10); - var wpmp = __webpack_require__(11); - var hpm = __webpack_require__(12); - var router = __webpack_require__(13); + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var models = __webpack_require__(5); + var embed = __webpack_require__(2); + var Create = (function (_super) { + __extends(Create, _super); + function Create(service, element, config) { + _super.call(this, service, element, config); + } + /** + * Gets the dataset ID from the first available location: createConfig or embed url. + * + * @returns {string} + */ + Create.prototype.getId = function () { + var datasetId = this.createConfig.datasetId || Create.findIdFromEmbedUrl(this.config.embedUrl); + if (typeof datasetId !== 'string' || datasetId.length === 0) { + throw new Error("Dataset id is required, but it was not found. You must provide an id either as part of embed configuration'."); + } + return datasetId; + }; + /** + * Validate create report configuration. + */ + Create.prototype.validate = function (config) { + return models.validateCreateReport(config); + }; + /** + * Adds the ability to get datasetId from url. + * (e.g. http://embedded.powerbi.com/appTokenReportEmbed?datasetId=854846ed-2106-4dc2-bc58-eb77533bf2f1). + * + * By extracting the ID we can ensure that the ID is always explicitly provided as part of the create configuration. + * + * @static + * @param {string} url + * @returns {string} + */ + Create.findIdFromEmbedUrl = function (url) { + var datasetIdRegEx = /datasetId="?([^&]+)"?/; + var datasetIdMatch = url.match(datasetIdRegEx); + var datasetId; + if (datasetIdMatch) { + datasetId = datasetIdMatch[1]; + } + return datasetId; + }; + return Create; + }(embed.Embed)); + exports.Create = Create; + + +/***/ }, +/* 10 */ +/***/ function(module, exports, __webpack_require__) { + + var config_1 = __webpack_require__(11); + var wpmp = __webpack_require__(12); + var hpm = __webpack_require__(13); + var router = __webpack_require__(14); exports.hpmFactory = function (wpmp, defaultTargetWindow, sdkVersion, sdkType) { if (sdkVersion === void 0) { sdkVersion = config_1.default.version; } if (sdkType === void 0) { sdkType = config_1.default.type; } @@ -5025,7 +5411,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 10 */ +/* 11 */ /***/ function(module, exports) { var config = { @@ -5037,7 +5423,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 11 */ +/* 12 */ /***/ function(module, exports, __webpack_require__) { /*! window-post-message-proxy v0.2.4 | (c) 2016 Microsoft Corporation MIT */ @@ -5337,7 +5723,7 @@ return /******/ (function(modules) { // webpackBootstrap //# sourceMappingURL=windowPostMessageProxy.js.map /***/ }, -/* 12 */ +/* 13 */ /***/ function(module, exports, __webpack_require__) { /*! http-post-message v0.2.3 | (c) 2016 Microsoft Corporation MIT */ @@ -5521,7 +5907,7 @@ return /******/ (function(modules) { // webpackBootstrap //# sourceMappingURL=httpPostMessage.js.map /***/ }, -/* 13 */ +/* 14 */ /***/ function(module, exports, __webpack_require__) { /*! powerbi-router v0.1.5 | (c) 2016 Microsoft Corporation MIT */ diff --git a/dist/powerbi.js.map b/dist/powerbi.js.map index 45a93e7f..d76a7e07 100644 --- a/dist/powerbi.js.map +++ b/dist/powerbi.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 02b4c9e441e8e5fb73dd","webpack:///./src/powerbi.ts","webpack:///./src/service.ts","webpack:///./src/embed.ts","webpack:///./src/util.ts","webpack:///./src/report.ts","webpack:///./~/powerbi-models/dist/models.js","webpack:///./src/page.ts","webpack:///./src/dashboard.ts","webpack:///./src/tile.ts","webpack:///./src/factories.ts","webpack:///./src/config.ts","webpack:///./~/window-post-message-proxy/dist/windowPostMessageProxy.js","webpack:///./~/http-post-message/dist/httpPostMessage.js","webpack:///./~/powerbi-router/dist/router.js"],"names":[],"mappings":"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,MAAuC;SAC9C,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC;KAC3C,CAAC;KAzOM,oBAAa,GAAG,CAAC,cAAc,EAAE,gBAAgB,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC;KAC3E,wBAAiB,GAAG,mBAAmB,CAAC;KACxC,iCAA0B,GAAG,sCAAsC,CAAC;KACpE,qCAA8B,GAAG,2CAA2C,CAAC;KAC7E,oBAAa,GAAG,cAAc,CAAC;KAC/B,WAAI,GAAG,QAAQ,CAAC;KAqOzB,aAAC;AAAD,EAAC,CA3O2B,KAAK,CAAC,KAAK,GA2OtC;AA3OY,eAAM,SA2OlB;;;;;;;ACzQD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD,qCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;AACA,qBAAoB,sBAAsB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA,GAAE,gDAAgD;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA,0BAAyB,uBAAuB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA,0BAAyB,uBAAuB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAiD,+BAA+B,GAAG,sCAAsC;AACzH,mDAAkD,+BAA+B,GAAG,sCAAsC;AAC1H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;;;AAGA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAQ;AACR;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;AACA,SAAQ;AACR;AACA;AACA,SAAQ;AACR;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;AACA,SAAQ;AACR;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA,OAAM;AACN;AACA;AACA,OAAM;AACN;AACA;AACA,OAAM;AACN;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;;AAEA,QAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAe;AACf;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,+BAA8B;AAC9B;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,uFAAsF;AACtF;AACA,qBAAoB;AACpB;;AAEA;AACA;AACA,oFAAmF;AACnF;AACA,yBAAwB;AACxB;AACA;;AAEA;AACA;AACA,sFAAqF;AACrF;AACA,yBAAwB;AACxB;AACA;;AAEA;AACA;AACA,oFAAmF;AACnF;AACA,yBAAwB;AACxB;AACA;;AAEA;AACA;AACA,sFAAqF;AACrF;AACA,yBAAwB;AACxB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,8JAA6J;AAC7J,WAAU;AACV,6FAA4F;AAC5F;;AAEA;AACA,yBAAwB;AACxB;AACA;;AAEA;AACA;AACA,kGAAiG;AACjG;AACA,yBAAwB;AACxB;AACA;;AAEA;AACA;AACA,kGAAiG;AACjG;AACA,yBAAwB;AACxB;AACA;;AAEA;AACA;;AAEA;AACA,yFAAwF;AACxF;AACA,yBAAwB;AACxB;AACA;;AAEA;AACA;AACA;AACA;;AAEA,+FAA8F;AAC9F;AACA,qBAAoB;AACpB;;AAEA;AACA;AACA,4FAA2F;AAC3F;AACA,yBAAwB;AACxB;AACA;;AAEA;AACA;AACA,4FAA2F;AAC3F;AACA,yBAAwB;AACxB;AACA;;AAEA;AACA;AACA,gGAA+F;AAC/F;AACA,yBAAwB;AACxB;AACA;;AAEA;AACA;AACA,kGAAiG;AACjG;AACA,yBAAwB;AACxB;AACA;;AAEA;AACA;AACA;;AAEA;AACA,+CAA8C,6CAA6C,mBAAmB;;AAE9G;;AAEA,yBAAwB;AACxB;AACA;AACA,gBAAe,iCAAiC;AAChD,+EAA8E;;AAE9E;;AAEA,6BAA4B;AAC5B;;AAEA;AACA,2DAA0D,6CAA6C,mBAAmB;;AAE1H;;AAEA,6BAA4B;AAC5B;AACA;AACA;;AAEA;AACA;AACA,8GAA6G;AAC7G;AACA,yBAAwB;AACxB;AACA;;AAEA;AACA;AACA,8GAA6G;AAC7G;AACA,yBAAwB;AACxB;AACA;;AAEA;AACA;AACA;AACA;;AAEA,qBAAoB,oCAAoC;AACxD,2GAA0G;AAC1G;AACA,yBAAwB;AACxB;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,iBAAgB,qBAAqB;AACrC;AACA;;AAEA,+DAA8D;;AAE9D;;AAEA,yBAAwB;;AAExB;AACA,kCAAiC;AACjC;AACA,6BAA4B;AAC5B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,uCAAsC,iCAAiC,eAAe;AACtF;;AAEA,kEAAiE;AACjE;AACA,aAAY;;AAEZ;AACA;AACA;;AAEA;AACA,iBAAgB,qBAAqB;AACrC;;AAEA,+EAA8E;;AAE9E;;AAEA;AACA;AACA;;AAEA,yBAAwB;AACxB;;AAEA;AACA;AACA;AACA;;AAEA;AACA,0EAAyE;AACzE;AACA,iBAAgB;AAChB;;AAEA,6CAA4C;;AAE5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,yBAAwB;AACxB;;AAEA,qBAAoB;AACpB;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,YAAW,SAAS;AACpB;AACA;;AAEA,oFAAmF;;AAEnF;AACA;AACA;AACA;AACA;AACA;AACA,qBAAoB,gBAAgB;AACpC,+FAA8F;AAC9F;AACA,iCAAgC;AAChC;AACA;;AAEA,yBAAwB;AACxB;AACA;;AAEA;AACA;AACA;AACA;;AAEA,qBAAoB,iCAAiC;AACrD;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,YAAW,iCAAiC;AAC5C,6CAA4C;;AAE5C;;AAEA;;AAEA;;AAEA;AACA,aAAY;AACZ;;AAEA;;AAEA,yCAAwC;;AAExC;;AAEA,qBAAoB,OAAO;AAC3B;AACA,SAAQ;AACR;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,YAAW,iCAAiC;AAC5C;;AAEA;;AAEA;;AAEA,iEAAgE;AAChE;AACA,aAAY;AACZ;;AAEA;;AAEA,iDAAgD;;AAEhD;;AAEA,qBAAoB,OAAO;AAC3B;AACA,SAAQ;AACR;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,6DAA4D;;AAE5D;;AAEA,qBAAoB,OAAO;AAC3B;AACA,SAAQ;AACR;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAgB,iBAAiB;AACjC;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAgB,SAAS;AACzB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,wCAAuC,SAAS;AAChD;AACA;AACA;AACA;AACA;AACA;;AAEA,uCAAsC,SAAS;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,2CAA0C,SAAS;AACnD;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA,iBAAgB,4BAA4B;AAC5C;AACA;;AAEA,qBAAoB,iBAAiB;AACrC;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA,qBAAoB,kBAAkB;AACtC;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,yBAAwB,qBAAqB;AAC7C;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAwB,yBAAyB;AACjD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAwB,gBAAgB;AACxC;AACA;AACA;AACA;AACA;AACA;;AAEA,qBAAoB,yBAAyB;AAC7C;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;;AAEN;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,8BAA6B;;AAE7B;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,SAAQ;;AAER;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,yCAAwC,SAAS;AACjD;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA,iBAAgB;AAChB;;AAEA;;AAEA;AACA,qCAAoC;AACpC;;AAEA,iBAAgB,qBAAqB;AACrC;;AAEA,mFAAkF;;AAElF;;AAEA,sBAAqB;;AAErB;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,4BAA2B;AAC3B,uCAAsC;AACtC;AACA;AACA,eAAc,sBAAsB;AACpC;AACA,0BAAyB;AACzB;AACA;AACA,+BAA8B,GAAG;AACjC;AACA,0BAAyB;AACzB;AACA;;AAEA;AACA;AACA,OAAM;;AAEN;AACA;;AAEA;AACA;AACA,qFAAoF;AACpF;AACA,8BAA6B;AAC7B;AACA;AACA,uDAAsD;AACtD,uDAAsD;;AAEtD;;AAEA,iHAAgH;AAChH;AACA,8BAA6B;AAC7B;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,4BAA2B,0BAA0B,EAAE;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA;AACA;AACA,wBAAuB,yBAAyB;;AAEhD;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;AAGA,QAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAgB;AAChB,iBAAgB;AAChB;AACA;AACA,qCAAoC,WAAW;AAC/C;AACA,WAAU;AACV;AACA;AACA,WAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,kEAAiE;AACjE;AACA,8CAA6C;AAC7C,wBAAuB;AACvB;;AAEA;AACA;AACA,+BAA8B;AAC9B;AACA,8CAA6C,iBAAiB,EAAE;;AAEhE;AACA;;AAEA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,iBAAgB,kBAAkB;AAClC;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,wBAAuB;AACvB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,qBAAoB,cAAc;AAClC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA,QAAO;AACP;AACA;;AAEA;;AAEA;;AAEA;AACA,uCAAsC,SAAS;AAC/C;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,OAAM;AACN;;AAEA;;AAEA,QAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAM;;AAEN;AACA;AACA;;AAEA;AACA;;AAEA;AACA,sEAAqE;AACrE;AACA;AACA;AACA;AACA;AACA,uBAAsB;AACtB;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,0BAAyB;AACzB;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,iBAAgB,iBAAiB;AACjC;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,WAAU;;AAEV;AACA,OAAM;;AAEN;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,oCAAmC,SAAS;AAC5C;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,kBAAiB,KAAK;;AAEtB;AACA;AACA;AACA;AACA;AACA;AACA,uCAAsC;AACtC;AACA;AACA,4CAA2C,KAAK;AAChD,2CAA0C,KAAK;AAC/C;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;AACN;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,sCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,qBAAoB,4BAA4B;AAChD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,qBAAoB,yBAAyB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,6CAA4C,OAAO;AACnD;AACA;AACA;AACA;AACA,4CAA2C,OAAO;AAClD;AACA;AACA;AACA;AACA;AACA,eAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAsB,wBAAwB;AAC9C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,4CAA2C,OAAO;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAI;AACJ;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAI;;AAEJ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;;AAEN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAQ;AACR;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,gCAA+B,QAAQ;AACvC;AACA;AACA;AACA,OAAM;AACN;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA,YAAW,MAAM;AACjB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAI;AACJ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAGA,QAAO;AACP;AACA;;AAEA,oCAAmC,sDAAsD;AACzF,GAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,cAAa,OAAO;AACpB,gBAAe,MAAM;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAa,MAAM;AACnB,cAAa,SAAS;AACtB;AACA,gBAAe,MAAM;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB,cAAa,SAAS;AACtB;AACA,gBAAe,MAAM;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB,gBAAe,MAAM;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAsC;AACtC;AACA,OAAM;AACN,8BAA6B;AAC7B;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAa,MAAM;AACnB,gBAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;;AAEA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB,gBAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB,gBAAe,OAAO;AACtB;AACA;AACA,WAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAgC,mCAAmC;AACnE;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB,gBAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,eAAc,WAAW;AACzB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,0BAAyB;;AAEzB,2CAA0C,qBAAqB;;AAE/D;AACA;AACA;AACA;AACA;AACA,oCAAmC,oBAAoB;;AAEvD;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB,gBAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,eAAc,iBAAiB;AAC/B;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,4BAA2B,iBAAiB;AAC5C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,gBAAe,iBAAiB;AAChC;;AAEA;AACA;AACA;;AAEA;AACA;AACA,gCAA+B,oBAAoB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB;AACA,gBAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB;AACA,gBAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ,IAAG;AACH,wCAAuC;AACvC;AACA,KAAI,OAAO;AACX;AACA;AACA;AACA;AACA,IAAG,OAAO;AACV;AACA;;AAEA,GAAE;;AAEF,8BAA6B,6DAA6D,aAAa,EAAE;;AAEzG,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA,QAAO;AACP;AACA;;AAEA;;AAEA;AACA;;;AAGA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,mBAAkB,SAAS;AAC3B;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,OAAM;AACN;AACA,OAAM;AACN;AACA;AACA;;AAEA;AACA;;;AAGA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV,SAAQ;AACR;AACA;AACA,OAAM;;AAEN;;AAEA;AACA;AACA;AACA;;;AAGA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ,iBAAgB;AAChB;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA,MAAK;AACL;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA,MAAK;AACL;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA,MAAK;AACL;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,6CAA4C,IAAI;AAChD;AACA;AACA,+CAA8C,EAAE,gCAAgC,KAAK,6CAA6C,KAAK;AACvI;AACA,kEAAiE,EAAE;AACnE;AACA,iCAAgC,IAAI,GAAG,IAAI,YAAY,IAAI,cAAc,IAAI,GAAG,IAAI,eAAe,IAAI,GAAG,IAAI,aAAa,IAAI,cAAc,IAAI,GAAG,IAAI,cAAc,IAAI,EAAE,IAAI,cAAc,IAAI,GAAG,IAAI,cAAc,IAAI,EAAE,IAAI,cAAc,IAAI,GAAG,IAAI,cAAc,IAAI,EAAE,IAAI,cAAc,IAAI,GAAG,IAAI,cAAc,IAAI,EAAE,IAAI,aAAa,IAAI,gBAAgB,IAAI,EAAE,IAAI,kBAAkB,IAAI,EAAE,IAAI,6BAA6B,IAAI,EAAE,IAAI,aAAa,GAAG,SAAS,EAAE,IAAI,IAAI,EAAE,IAAI,GAAG,IAAI,oBAAoB,IAAI,OAAO,IAAI,UAAU,IAAI,mBAAmB,IAAI,OAAO,IAAI,oBAAoB,IAAI,GAAG,IAAI,qBAAqB,IAAI,OAAO,IAAI,UAAU,IAAI,mBAAmB,IAAI,OAAO,IAAI;AACvqB;AACA,4DAA2D,KAAK,oDAAoD,KAAK;;AAEzH;;AAEA,QAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,gDAA+C;AAC/C;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA,EAAC;AACD;AACA,mC;;;;;;AC7uHA;;;;;;;IAOG;AACH;KAqBE;;;;;;QAMG;KACH,cAAY,MAAmB,EAAE,IAAY,EAAE,WAAoB;SACjE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;SACrB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;SACjB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;KACjC,CAAC;KAED;;;;;;;;;QASG;KACH,yBAAU,GAAV;SACE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAmB,mBAAiB,IAAI,CAAC,IAAI,aAAU,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC;cAC/J,IAAI,CAAC,kBAAQ,IAAI,eAAQ,CAAC,IAAI,EAAb,CAAa,EAC/B,kBAAQ;aACN,MAAM,QAAQ,CAAC,IAAI,CAAC;SACtB,CAAC,CAAC,CAAC;KACP,CAAC;KAED;;;;;;;;QAQG;KACH,4BAAa,GAAb;SACE,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;KAC7B,CAAC;KAED;;;;;;;;QAQG;KACH,wBAAS,GAAT;SACE,IAAM,IAAI,GAAiB;aACzB,IAAI,EAAE,IAAI,CAAC,IAAI;aACf,WAAW,EAAE,IAAI;UAClB,CAAC;SAEF,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAkB,sBAAsB,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC;cACtJ,KAAK,CAAC,kBAAQ;aACb,MAAM,QAAQ,CAAC,IAAI,CAAC;SACtB,CAAC,CAAC,CAAC;KACP,CAAC;KAED;;;;;;;;;;QAUG;KACH,yBAAU,GAAV,UAAW,OAAyB;SAClC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAkB,mBAAiB,IAAI,CAAC,IAAI,aAAU,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC;cACvK,KAAK,CAAC,kBAAQ;aACb,MAAM,QAAQ,CAAC,IAAI,CAAC;SACtB,CAAC,CAAC,CAAC;KACP,CAAC;KACH,WAAC;AAAD,EAAC;AAvGY,aAAI,OAuGhB;;;;;;;;;;;;AC7HD,KAAY,KAAK,uBAAM,CAAS,CAAC;AACjC,KAAY,MAAM,uBAAM,CAAgB,CAAC;AAiBzC;;;;;;;;IAQG;AACH;KAA+B,6BAAW;KAMtC;;;;;QAKG;KACH,mBAAY,OAAwB,EAAE,OAAoB,EAAE,MAAiC;SACzF,kBAAM,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;SAChC,IAAI,CAAC,QAAQ,GAAG,iBAAiB,CAAC;SAClC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC,aAAa,CAAC,CAAC;KAC5E,CAAC;KAED;;;;;;;;;QASG;KACI,4BAAkB,GAAzB,UAA0B,GAAW;SACjC,IAAM,gBAAgB,GAAG,yBAAyB;SAClD,IAAM,gBAAgB,GAAG,GAAG,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;SAErD,IAAI,WAAW,CAAC;SAChB,EAAE,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC;aACnB,WAAW,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;SACtC,CAAC;SAED,MAAM,CAAC,WAAW,CAAC;KACvB,CAAC;KAED;;;;QAIG;KACH,yBAAK,GAAL;SACI,IAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,SAAS,CAAC,oBAAoB,CAAC,IAAI,SAAS,CAAC,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;SAEtJ,EAAE,CAAC,CAAC,OAAO,WAAW,KAAK,QAAQ,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC;aAC9D,MAAM,IAAI,KAAK,CAAC,mIAAiI,SAAS,CAAC,oBAAoB,OAAI,CAAC,CAAC;SACzL,CAAC;SAED,MAAM,CAAC,WAAW,CAAC;KACvB,CAAC;KAED;;QAEG;KACH,4BAAQ,GAAR,UAAS,MAA0C;SACjD,IAAI,KAAK,GAAG,MAAM,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;SACjD,MAAM,CAAC,KAAK,GAAG,KAAK,GAAG,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;KAChE,CAAC;KAED;;QAEG;KACK,oCAAgB,GAAxB,UAAyB,QAAyB;SAChD,EAAE,CAAC,CAAC,QAAQ,IAAI,QAAQ,KAAK,YAAY,IAAI,QAAQ,KAAK,WAAW,IAAI,QAAQ,KAAK,YAAY,CAAC,CAAC,CAAC;aACnG,MAAM,CAAC,CAAC,EAAC,OAAO,EAAE,2EAA2E,EAAC,CAAC,CAAC;SAClG,CAAC;KACH,CAAC;KArEM,uBAAa,GAAG,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;KACzC,8BAAoB,GAAG,sBAAsB,CAAC;KAC9C,uBAAa,GAAG,cAAc,CAAC;KAC/B,cAAI,GAAG,WAAW,CAAC;KAmE9B,gBAAC;AAAD,EAAC,CAvE8B,KAAK,CAAC,KAAK,GAuEzC;AAvEY,kBAAS,YAuErB;;;;;;;;;;;;AClGD,mCAAsB,CAAS,CAAC;AAEhC;;;;;;IAMG;AACH;KAA0B,wBAAK;KAA/B;SAA0B,8BAAK;KAkB/B,CAAC;KAfC;;;;QAIG;KACH,oBAAK,GAAL;SACE,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;KAC5E,CAAC;KAED;;QAEG;KACH,uBAAQ,GAAR,UAAS,MAAW;SAClB,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;KAC5E,CAAC;KAhBM,SAAI,GAAG,MAAM,CAAC;KAiBvB,WAAC;AAAD,EAAC,CAlByB,aAAK,GAkB9B;AAlBY,aAAI,OAkBhB;;;;;;;ACxBD,oCAAmB,EAAU,CAAC;AAC9B,KAAY,IAAI,uBAAM,EAA2B,CAAC;AAClD,KAAY,GAAG,uBAAM,EAAmB,CAAC;AACzC,KAAY,MAAM,uBAAM,EAAgB,CAAC;AAQ5B,mBAAU,GAAgB,UAAC,IAAI,EAAE,mBAAmB,EAAE,UAA2B,EAAE,OAAqB;KAAlD,0BAA2B,GAA3B,aAAa,gBAAM,CAAC,OAAO;KAAE,uBAAqB,GAArB,UAAU,gBAAM,CAAC,IAAI;KACnH,MAAM,CAAC,IAAI,GAAG,CAAC,eAAe,CAAC,IAAI,EAAE;SACnC,YAAY,EAAE,OAAO;SACrB,eAAe,EAAE,UAAU;MAC5B,EAAE,mBAAmB,CAAC,CAAC;AAC1B,EAAC,CAAC;AAEW,oBAAW,GAAiB,UAAC,IAAa,EAAE,WAAqB,EAAE,yBAAkC;KAChH,MAAM,CAAC,IAAI,IAAI,CAAC,sBAAsB,CAAC;SACrC,yBAAyB,EAAE;aACzB,qBAAqB,EAAE,GAAG,CAAC,eAAe,CAAC,qBAAqB;aAChE,qBAAqB,EAAE,GAAG,CAAC,eAAe,CAAC,qBAAqB;UACjE;SACD,cAAc,EAAE,GAAG,CAAC,eAAe,CAAC,cAAc;SAClD,UAAI;SACJ,wBAAW;SACX,oDAAyB;MAC1B,CAAC,CAAC;AACL,EAAC,CAAC;AAEW,sBAAa,GAAmB,UAAC,IAAI;KAChD,MAAM,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AACjC,EAAC,CAAC;;;;;;;ACrCF,KAAM,MAAM,GAAG;KACb,OAAO,EAAE,OAAO;KAChB,IAAI,EAAE,IAAI;EACX,CAAC;AAEF;mBAAe,MAAM,CAAC;;;;;;;ACLtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD,qCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,mCAAkC;AAClC;AACA;AACA;AACA,eAAc;AACd;AACA;AACA;AACA,YAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAuD,uCAAuC;AAC9F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2FAA0F;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAsB;AACtB;AACA;AACA,eAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;;;AAGA;AACA;AACA,EAAC;AACD;AACA,mD;;;;;;ACtSA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD,qCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,0CAAyC,qBAAqB;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAkC,cAAc;AAChD,wCAAuC,yCAAyC;AAChF;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA,mCAAkC,cAAc;AAChD,wCAAuC,yCAAyC;AAChF;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA,mCAAkC,cAAc;AAChD,wCAAuC,yCAAyC;AAChF;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA,mCAAkC,cAAc;AAChD,wCAAuC,yCAAyC;AAChF;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA,gCAA+B,aAAa;AAC5C,mCAAkC,cAAc;AAChD,wCAAuC,yCAAyC;AAChF;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA,wCAAuC,yCAAyC;AAChF,0CAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAAyB,uBAAuB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA;AACA,GAAE;AACF;;;AAGA;AACA;AACA,EAAC;AACD;AACA,4C;;;;;;AClLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD,qCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAqC,iBAAiB,EAAE;AACxD;AACA;AACA,eAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;;;AAGA,QAAO;AACP;AACA;;AAEA,oCAAmC,8CAA8C;AACjF;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,wCAAuC,6EAA6E;AACpH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAQ;;AAER;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,WAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;AACA,qBAAoB,qBAAqB;AACzC;AACA;;AAEA;AACA,qBAAoB;AACpB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAY;AACZ;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA,iCAAgC,+BAA+B;AAC/D,gBAAe,iBAAiB;AAChC,SAAQ;AACR;;AAEA;AACA;AACA,8BAA6B,KAAK;AAClC;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,0DAAyD,sBAAsB;AAC/E;AACA;AACA;;AAEA,uBAAsB,iBAAiB;AACvC;AACA,6CAA4C,yDAAyD;AACrG;;AAEA;AACA,SAAQ;;AAER;AACA;AACA,SAAQ;;AAER;AACA;AACA;AACA;;AAEA,yDAAwD,kBAAkB;AAC1E;AACA;AACA,mCAAkC,yDAAyD;AAC3F,SAAQ;;AAER;AACA;AACA,SAAQ;;AAER;AACA;AACA;AACA;;AAEA,sDAAqD,kBAAkB;AACvE;AACA;AACA,mCAAkC,wDAAwD;AAC1F,SAAQ;;AAER;AACA;AACA,SAAQ;;AAER;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAQ;AACR,2BAA0B,WAAW,EAAE;AACvC,8BAA6B,WAAW;AACxC;;AAEA;AACA;AACA;AACA,sCAAqC,yBAAyB;;AAE9D;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,qBAAoB,mBAAmB;AACvC;;AAEA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA;AACA,WAAU;AACV;AACA;AACA,WAAU;AACV;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,uBAAsB,qBAAqB;AAC3C;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAQ;;AAER;AACA;;AAEA;AACA;AACA,2CAA0C,cAAc;;AAExD;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAQ;;AAER;AACA;AACA;AACA;;AAEA;;AAEA,uBAAsB,qBAAqB;AAC3C;;AAEA;;AAEA;AACA,6CAA4C,sBAAsB;AAClE,aAAY;AACZ,6CAA4C,sBAAsB;AAClE;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAQ;AACR;;AAEA;AACA;;AAEA,sCAAqC,KAAK;AAC1C;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;;AAEN;AACA;AACA;AACA;;AAEA;;AAEA,qBAAoB,mBAAmB;AACvC;;AAEA,uBAAsB,gBAAgB;AACtC;AACA;;AAEA,uBAAsB;AACtB;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAQ,eAAe;AACvB;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,8BAA6B;AAC7B;;AAEA;;AAEA,uBAAsB,iBAAiB;AACvC;;AAEA;;AAEA;;AAEA,yBAAwB,mBAAmB;AAC3C;;AAEA,0EAAyE,UAAU;;AAEnF;;AAEA;AACA,+CAA8C,0DAA0D;AACxG;;AAEA;AACA;AACA;AACA;AACA,2BAA0B;AAC1B;AACA;;AAEA;AACA,6CAA4C,0DAA0D;AACtG;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAQ;;AAER;AACA;;AAEA,uBAAsB,oDAAoD;;AAE1E;;AAEA,uBAAsB,yBAAyB;AAC/C;AACA;;AAEA;AACA,SAAQ;;AAER;AACA;AACA,SAAQ;;AAER;AACA;AACA,uBAAsB,oDAAoD;;AAE1E;;AAEA,uBAAsB,mBAAmB;AACzC;;AAEA,wEAAuE,UAAU;;AAEjF;AACA;AACA;;AAEA,yCAAwC,uBAAuB;;AAE/D;AACA;AACA;;AAEA;AACA,SAAQ;;AAER;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAwB,iBAAiB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA4B,kBAAkB;AAC9C;AACA;AACA;AACA,aAAY;AACZ;AACA;AACA;AACA;;AAEA,mCAAkC,WAAW;;AAE7C;AACA,SAAQ;;AAER;AACA;AACA,sBAAqB,kBAAkB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAY;AACZ;AACA;AACA;AACA;AACA,SAAQ;;AAER;AACA;AACA,yDAAwD;AACxD;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,uCAAsC,mBAAmB;;AAEzD;AACA;AACA;AACA;AACA;;AAEA,mBAAkB,eAAe;AACjC;AACA,iCAAgC,OAAO;AACvC;;AAEA;AACA,mBAAkB,iBAAiB;AACnC,qCAAoC,2BAA2B;AAC/D;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA,sDAAqD,oCAAoC,EAAE;AAC3F,OAAM;AACN;AACA,OAAM;AACN;AACA;AACA,GAAE;;AAEF;AACA,8BAA6B;;AAE7B,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA,QAAO;AACP;AACA;;AAEA,+BAA8B,mDAAmD;;;AAGjF;AACA;AACA,EAAC;AACD;AACA,mC","file":"powerbi.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"powerbi-client\"] = factory();\n\telse\n\t\troot[\"powerbi-client\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 02b4c9e441e8e5fb73dd","import * as service from './service';\r\nimport * as factories from './factories';\r\nimport * as models from 'powerbi-models';\r\nimport { IFilterable } from './ifilterable';\r\n\r\nexport {\r\n IFilterable,\r\n service,\r\n factories,\r\n models\r\n};\r\nexport {\r\n Report\r\n} from './report';\r\nexport {\r\n Tile\r\n} from './tile';\r\nexport {\r\n IEmbedConfiguration,\r\n Embed\r\n} from './embed';\r\nexport {\r\n Page\r\n} from './page';\r\n\r\ndeclare var powerbi: service.Service;\r\ndeclare global {\r\n interface Window {\r\n powerbi: service.Service;\r\n }\r\n}\r\n\r\n/**\r\n * Makes Power BI available to the global object for use in applications that don't have module loading support.\r\n *\r\n * Note: create an instance of the class with the default configuration for normal usage, or save the class so that you can create an instance of the service.\r\n */\r\nvar powerbi = new service.Service(factories.hpmFactory, factories.wpmpFactory, factories.routerFactory);\r\nwindow.powerbi = powerbi;\n\n\n// WEBPACK FOOTER //\n// ./src/powerbi.ts","import * as embed from './embed';\r\nimport { Report } from './report';\r\nimport { Dashboard } from './dashboard';\r\nimport { Tile } from './tile';\r\nimport { Page } from './page';\r\nimport * as utils from './util';\r\nimport * as wpmp from 'window-post-message-proxy';\r\nimport * as hpm from 'http-post-message';\r\nimport * as router from 'powerbi-router';\r\nimport * as models from 'powerbi-models';\r\n\r\nexport interface IEvent {\r\n type: string;\r\n id: string;\r\n name: string;\r\n value: T;\r\n}\r\n\r\nexport interface ICustomEvent extends CustomEvent {\r\n detail: T;\r\n}\r\n\r\nexport interface IEventHandler {\r\n (event: ICustomEvent): any;\r\n}\r\n\r\nexport interface IHpmFactory {\r\n (wpmp: wpmp.WindowPostMessageProxy, targetWindow?: Window, version?: string, type?: string, origin?: string): hpm.HttpPostMessage;\r\n}\r\n\r\nexport interface IWpmpFactory {\r\n (name?: string, logMessages?: boolean, eventSourceOverrideWindow?: Window): wpmp.WindowPostMessageProxy;\r\n}\r\n\r\nexport interface IRouterFactory {\r\n (wpmp: wpmp.WindowPostMessageProxy): router.Router;\r\n}\r\n\r\nexport interface IPowerBiElement extends HTMLElement {\r\n powerBiEmbed: embed.Embed;\r\n}\r\n\r\nexport interface IDebugOptions {\r\n logMessages?: boolean;\r\n wpmpName?: string;\r\n}\r\n\r\nexport interface IServiceConfiguration extends IDebugOptions {\r\n autoEmbedOnContentLoaded?: boolean;\r\n onError?: (error: any) => any;\r\n version?: string;\r\n type?: string;\r\n}\r\n\r\nexport interface IService {\r\n hpm: hpm.HttpPostMessage;\r\n}\r\n\r\n/**\r\n * The Power BI Service embed component, which is the entry point to embed all other Power BI components into your application\r\n * \r\n * @export\r\n * @class Service\r\n * @implements {IService}\r\n */\r\nexport class Service implements IService {\r\n\r\n /**\r\n * A list of components that this service can embed\r\n */\r\n private static components: (typeof Report | typeof Tile | typeof Dashboard)[] = [\r\n Tile,\r\n Report,\r\n Dashboard\r\n ];\r\n\r\n /**\r\n * The default configuration for the service\r\n */\r\n private static defaultConfig: IServiceConfiguration = {\r\n autoEmbedOnContentLoaded: false,\r\n onError: (...args) => console.log(args[0], args.slice(1))\r\n };\r\n\r\n /**\r\n * Gets or sets the access token as the global fallback token to use when a local token is not provided for a report or tile.\r\n * \r\n * @type {string}\r\n */\r\n accessToken: string;\r\n\r\n /**The Configuration object for the service*/\r\n private config: IServiceConfiguration;\r\n\r\n /** A list of Dashboard, Report and Tile components that have been embedded using this service instance. */\r\n private embeds: embed.Embed[];\r\n /** TODO: Look for way to make hpm private without sacraficing ease of maitenance. This should be private but in embed needs to call methods. */\r\n hpm: hpm.HttpPostMessage;\r\n /** TODO: Look for way to make wpmp private. This is only public to allow stopping the wpmp in tests */\r\n wpmp: wpmp.WindowPostMessageProxy;\r\n private router: router.Router;\r\n\r\n /**\r\n * Creates an instance of a Power BI Service.\r\n * \r\n * @param {IHpmFactory} hpmFactory The http post message factory used in the postMessage communication layer\r\n * @param {IWpmpFactory} wpmpFactory The window post message factory used in the postMessage communication layer\r\n * @param {IRouterFactory} routerFactory The router factory used in the postMessage communication layer\r\n * @param {IServiceConfiguration} [config={}]\r\n */\r\n constructor(hpmFactory: IHpmFactory, wpmpFactory: IWpmpFactory, routerFactory: IRouterFactory, config: IServiceConfiguration = {}) {\r\n this.wpmp = wpmpFactory(config.wpmpName, config.logMessages);\r\n this.hpm = hpmFactory(this.wpmp, null, config.version, config.type);\r\n this.router = routerFactory(this.wpmp);\r\n\r\n /**\r\n * Adds handler for report events.\r\n */\r\n this.router.post(`/reports/:uniqueId/events/:eventName`, (req, res) => {\r\n const event: IEvent = {\r\n type: 'report',\r\n id: req.params.uniqueId,\r\n name: req.params.eventName,\r\n value: req.body\r\n };\r\n\r\n this.handleEvent(event);\r\n });\r\n this.router.post(`/reports/:uniqueId/pages/:pageName/events/:eventName`, (req, res) => {\r\n const event: IEvent = {\r\n type: 'report',\r\n id: req.params.uniqueId,\r\n name: req.params.eventName,\r\n value: req.body\r\n };\r\n\r\n this.handleEvent(event);\r\n });\r\n\r\n this.router.post(`/dashboards/:uniqueId/events/:eventName`, (req, res) => {\r\n const event: IEvent = {\r\n type: 'dashboard',\r\n id: req.params.uniqueId,\r\n name: req.params.eventName,\r\n value: req.body\r\n };\r\n\r\n this.handleEvent(event);\r\n });\r\n\r\n this.embeds = [];\r\n\r\n // TODO: Change when Object.assign is available.\r\n this.config = utils.assign({}, Service.defaultConfig, config);\r\n\r\n if (this.config.autoEmbedOnContentLoaded) {\r\n this.enableAutoEmbed();\r\n }\r\n }\r\n\r\n /**\r\n * TODO: Add a description here\r\n * \r\n * @param {HTMLElement} [container]\r\n * @param {embed.IEmbedConfiguration} [config=undefined]\r\n * @returns {embed.Embed[]}\r\n */\r\n init(container?: HTMLElement, config: embed.IEmbedConfiguration = undefined): embed.Embed[] {\r\n container = (container && container instanceof HTMLElement) ? container : document.body;\r\n\r\n const elements = Array.prototype.slice.call(container.querySelectorAll(`[${embed.Embed.embedUrlAttribute}]`));\r\n return elements.map(element => this.embed(element, config));\r\n }\r\n\r\n /**\r\n * Given a configuration based on an HTML element,\r\n * if the component has already been created and attached to the element, reuses the component instance and existing iframe,\r\n * otherwise creates a new component instance.\r\n * \r\n * @param {HTMLElement} element\r\n * @param {embed.IEmbedConfiguration} [config={}]\r\n * @returns {embed.Embed}\r\n */\r\n embed(element: HTMLElement, config: embed.IEmbedConfiguration = {}): embed.Embed {\r\n let component: embed.Embed;\r\n let powerBiElement = element;\r\n\r\n if (powerBiElement.powerBiEmbed) {\r\n component = this.embedExisting(powerBiElement, config);\r\n }\r\n else {\r\n component = this.embedNew(powerBiElement, config);\r\n }\r\n\r\n return component;\r\n }\r\n\r\n /**\r\n * Given a configuration based on a Power BI element, saves the component instance that reference the element for later lookup.\r\n * \r\n * @private\r\n * @param {IPowerBiElement} element\r\n * @param {embed.IEmbedConfiguration} config\r\n * @returns {embed.Embed}\r\n */\r\n private embedNew(element: IPowerBiElement, config: embed.IEmbedConfiguration): embed.Embed {\r\n const componentType = config.type || element.getAttribute(embed.Embed.typeAttribute);\r\n if (!componentType) {\r\n throw new Error(`Attempted to embed using config ${JSON.stringify(config)} on element ${element.outerHTML}, but could not determine what type of component to embed. You must specify a type in the configuration or as an attribute such as '${embed.Embed.typeAttribute}=\"${Report.type.toLowerCase()}\"'.`);\r\n }\r\n\r\n // Saves the type as part of the configuration so that it can be referenced later at a known location.\r\n config.type = componentType;\r\n\r\n const Component = utils.find(component => componentType === component.type.toLowerCase(), Service.components);\r\n if (!Component) {\r\n throw new Error(`Attempted to embed component of type: ${componentType} but did not find any matching component. Please verify the type you specified is intended.`);\r\n }\r\n\r\n const component = new Component(this, element, config);\r\n element.powerBiEmbed = component;\r\n this.embeds.push(component);\r\n\r\n return component;\r\n }\r\n\r\n /**\r\n * Given an element that already contains an embed component, load with a new configuration.\r\n * \r\n * @private\r\n * @param {IPowerBiElement} element\r\n * @param {embed.IEmbedConfiguration} config\r\n * @returns {embed.Embed}\r\n */\r\n private embedExisting(element: IPowerBiElement, config: embed.IEmbedConfiguration): embed.Embed {\r\n const component = utils.find(x => x.element === element, this.embeds);\r\n if (!component) {\r\n throw new Error(`Attempted to embed using config ${JSON.stringify(config)} on element ${element.outerHTML} which already has embedded comopnent associated, but could not find the existing comopnent in the list of active components. This could indicate the embeds list is out of sync with the DOM, or the component is referencing the incorrect HTML element.`);\r\n }\r\n\r\n /**\r\n * TODO: Dynamic embed type switching could be supported but there is work needed to prepare the service state and DOM cleanup.\r\n * remove all event handlers from the DOM, then reset the element to initial state which removes iframe, and removes from list of embeds\r\n * then we can call the embedNew function which would allow setting the proper embedUrl and construction of object based on the new type.\r\n */\r\n if (typeof config.type === \"string\" && config.type !== component.config.type) {\r\n throw new Error(`Embedding on an existing element with a different type than the previous embed object is not supported. Attempted to embed using config ${JSON.stringify(config)} on element ${element.outerHTML}, but the existing element contains an embed of type: ${this.config.type} which does not match the new type: ${config.type}`);\r\n }\r\n\r\n component.load(config);\r\n\r\n return component;\r\n }\r\n\r\n /**\r\n * Adds an event handler for DOMContentLoaded, which searches the DOM for elements that have the 'powerbi-embed-url' attribute,\r\n * and automatically attempts to embed a powerbi component based on information from other powerbi-* attributes.\r\n *\r\n * Note: Only runs if `config.autoEmbedOnContentLoaded` is true when the service is created.\r\n * This handler is typically useful only for applications that are rendered on the server so that all required data is available when the handler is called.\r\n */\r\n enableAutoEmbed(): void {\r\n window.addEventListener('DOMContentLoaded', (event: Event) => this.init(document.body), false);\r\n }\r\n\r\n /**\r\n * Returns an instance of the component associated with the element.\r\n * \r\n * @param {HTMLElement} element\r\n * @returns {(Report | Tile)}\r\n */\r\n get(element: HTMLElement): Report | Tile | Dashboard {\r\n const powerBiElement = element;\r\n\r\n if (!powerBiElement.powerBiEmbed) {\r\n throw new Error(`You attempted to get an instance of powerbi component associated with element: ${element.outerHTML} but there was no associated instance.`);\r\n }\r\n\r\n return powerBiElement.powerBiEmbed;\r\n }\r\n\r\n /**\r\n * Finds an embed instance by the name or unique ID that is provided.\r\n * \r\n * @param {string} uniqueId\r\n * @returns {(Report | Tile)}\r\n */\r\n find(uniqueId: string): Report | Tile | Dashboard {\r\n return utils.find(x => x.config.uniqueId === uniqueId, this.embeds);\r\n }\r\n\r\n /**\r\n * Given an HTML element that has a component embedded within it, removes the component from the list of embedded components, removes the association between the element and the component, and removes the iframe.\r\n * \r\n * @param {HTMLElement} element\r\n * @returns {void}\r\n */\r\n reset(element: HTMLElement): void {\r\n const powerBiElement = element;\r\n\r\n if (!powerBiElement.powerBiEmbed) {\r\n return;\r\n }\r\n\r\n /** Removes the component from an internal list of components. */\r\n utils.remove(x => x === powerBiElement.powerBiEmbed, this.embeds);\r\n /** Deletes a property from the HTML element. */\r\n delete powerBiElement.powerBiEmbed;\r\n /** Removes the iframe from the element. */\r\n const iframe = element.querySelector('iframe');\r\n if (iframe) {\r\n iframe.remove();\r\n }\r\n }\r\n\r\n /**\r\n * Given an event object, finds the embed component with the matching type and ID, and invokes its handleEvent method with the event object.\r\n * \r\n * @private\r\n * @param {IEvent} event\r\n */\r\n private handleEvent(event: IEvent): void {\r\n const embed = utils.find(embed => {\r\n return (embed.config.type === event.type\r\n && embed.config.uniqueId === event.id);\r\n }, this.embeds);\r\n\r\n if (embed) {\r\n const value = event.value;\r\n\r\n if (event.name === 'pageChanged') {\r\n const pageKey = 'newPage';\r\n const page: models.IPage = value[pageKey];\r\n if (!page) {\r\n throw new Error(`Page model not found at 'event.value.${pageKey}'.`);\r\n }\r\n value[pageKey] = new Page(embed, page.name, page.displayName);\r\n }\r\n\r\n utils.raiseCustomEvent(embed.element, event.name, value);\r\n }\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/service.ts","import * as utils from './util';\r\nimport * as service from './service';\r\nimport * as models from 'powerbi-models';\r\nimport * as hpm from 'http-post-message';\r\n\r\ndeclare global {\r\n interface Document {\r\n // Mozilla Fullscreen\r\n mozCancelFullScreen: Function;\r\n\r\n // Ms Fullscreen\r\n msExitFullscreen: Function;\r\n }\r\n\r\n interface HTMLIFrameElement {\r\n // Mozilla Fullscreen\r\n mozRequestFullScreen: Function;\r\n\r\n // Ms Fullscreen\r\n msRequestFullscreen: Function;\r\n }\r\n}\r\n\r\n// TODO: Re-use ILoadConfiguration interface to prevent duplicating properties.\r\n// Current issue is that they are optional when embedding since they can be specificed as attributes but they are required when loading.\r\n/**\r\n * Configuration settings for Power BI embed components\r\n * \r\n * @export\r\n * @interface IEmbedConfiguration\r\n */\r\nexport interface IEmbedConfiguration {\r\n type?: string;\r\n id?: string;\r\n uniqueId?: string;\r\n embedUrl?: string;\r\n accessToken?: string;\r\n settings?: models.ISettings;\r\n pageName?: string;\r\n filters?: models.IFilter[];\r\n pageView?: models.PageView;\r\n}\r\n\r\nexport interface IInternalEmbedConfiguration extends models.IReportLoadConfiguration {\r\n uniqueId: string;\r\n type: string;\r\n embedUrl: string;\r\n}\r\n\r\nexport interface IInternalEventHandler {\r\n test(event: service.IEvent): boolean;\r\n handle(event: service.ICustomEvent): void;\r\n}\r\n\r\n/**\r\n * Base class for all Power BI embed components\r\n * \r\n * @export\r\n * @abstract\r\n * @class Embed\r\n */\r\nexport abstract class Embed {\r\n static allowedEvents = [\"loaded\"];\r\n static accessTokenAttribute = 'powerbi-access-token';\r\n static embedUrlAttribute = 'powerbi-embed-url';\r\n static nameAttribute = 'powerbi-name';\r\n static typeAttribute = 'powerbi-type';\r\n static type: string;\r\n\r\n private static defaultSettings: models.ISettings = {\r\n filterPaneEnabled: true\r\n };\r\n\r\n allowedEvents = [];\r\n\r\n /**\r\n * Gets or sets the event handler registered for this embed component.\r\n * \r\n * @type {IInternalEventHandler[]}\r\n */\r\n eventHandlers: IInternalEventHandler[];\r\n\r\n /**\r\n * Gets or sets the Power BI embed service.\r\n * \r\n * @type {service.Service}\r\n */\r\n service: service.Service;\r\n\r\n /**\r\n * Gets or sets the HTML element that contains the Power BI embed component.\r\n * \r\n * @type {HTMLElement}\r\n */\r\n element: HTMLElement;\r\n\r\n /**\r\n * Gets or sets the HTML iframe element that renders the Power BI embed component.\r\n * \r\n * @type {HTMLIFrameElement}\r\n */\r\n iframe: HTMLIFrameElement;\r\n\r\n /**\r\n * Gets or sets the configuration settings for the Power BI embed component.\r\n * \r\n * @type {IInternalEmbedConfiguration}\r\n */\r\n config: IInternalEmbedConfiguration;\r\n\r\n /**\r\n * Url used in the load request.\r\n */\r\n loadPath: string;\r\n\r\n /**\r\n * Creates an instance of Embed.\r\n * \r\n * Note: there is circular reference between embeds and the service, because\r\n * the service has a list of all embeds on the host page, and each embed has a reference to the service that created it.\r\n * \r\n * @param {service.Service} service\r\n * @param {HTMLElement} element\r\n * @param {IEmbedConfiguration} config\r\n */\r\n constructor(service: service.Service, element: HTMLElement, config: IEmbedConfiguration) {\r\n Array.prototype.push.apply(this.allowedEvents, Embed.allowedEvents);\r\n this.eventHandlers = [];\r\n this.service = service;\r\n this.element = element;\r\n\r\n // TODO: Change when Object.assign is available.\r\n const settings = utils.assign({}, Embed.defaultSettings, config.settings);\r\n this.config = utils.assign({ settings }, config);\r\n this.config.accessToken = this.getAccessToken(service.accessToken);\r\n this.config.embedUrl = this.getEmbedUrl();\r\n this.config.id = this.getId();\r\n this.config.uniqueId = this.getUniqueId();\r\n\r\n const iframeHtml = ``;\r\n\r\n this.element.innerHTML = iframeHtml;\r\n this.iframe = this.element.childNodes[0];\r\n this.iframe.addEventListener('load', () => this.load(this.config), false);\r\n }\r\n\r\n /**\r\n * Sends load configuration data.\r\n * \r\n * ```javascript\r\n * report.load({\r\n * type: 'report',\r\n * id: '5dac7a4a-4452-46b3-99f6-a25915e0fe55',\r\n * accessToken: 'eyJ0eXA ... TaE2rTSbmg',\r\n * settings: {\r\n * navContentPaneEnabled: false\r\n * },\r\n * pageName: \"DefaultPage\",\r\n * filters: [\r\n * {\r\n * ... DefaultReportFilter ...\r\n * }\r\n * ]\r\n * })\r\n * .catch(error => { ... });\r\n * ```\r\n * \r\n * @param {models.ILoadConfiguration} config\r\n * @returns {Promise}\r\n */\r\n load(config: models.IReportLoadConfiguration | models.IDashboardLoadConfiguration): Promise {\r\n const errors = this.validate(config);\r\n if (errors) {\r\n throw errors;\r\n }\r\n\r\n return this.service.hpm.post(this.loadPath, config, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n utils.assign(this.config, config);\r\n return response.body;\r\n },\r\n response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Removes one or more event handlers from the list of handlers.\r\n * If a reference to the existing handle function is specified, remove the specific handler.\r\n * If the handler is not specified, remove all handlers for the event name specified.\r\n * \r\n * ```javascript\r\n * report.off('pageChanged')\r\n * \r\n * or \r\n * \r\n * const logHandler = function (event) {\r\n * console.log(event);\r\n * };\r\n * \r\n * report.off('pageChanged', logHandler);\r\n * ```\r\n * \r\n * @template T\r\n * @param {string} eventName\r\n * @param {service.IEventHandler} [handler]\r\n */\r\n off(eventName: string, handler?: service.IEventHandler): void {\r\n const fakeEvent: service.IEvent = { name: eventName, type: null, id: null, value: null };\r\n if (handler) {\r\n utils.remove(eventHandler => eventHandler.test(fakeEvent) && (eventHandler.handle === handler), this.eventHandlers);\r\n this.element.removeEventListener(eventName, handler);\r\n }\r\n else {\r\n const eventHandlersToRemove = this.eventHandlers\r\n .filter(eventHandler => eventHandler.test(fakeEvent));\r\n\r\n eventHandlersToRemove\r\n .forEach(eventHandlerToRemove => {\r\n utils.remove(eventHandler => eventHandler === eventHandlerToRemove, this.eventHandlers);\r\n this.element.removeEventListener(eventName, eventHandlerToRemove.handle);\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Adds an event handler for a specific event.\r\n * \r\n * ```javascript\r\n * report.on('pageChanged', (event) => {\r\n * console.log('PageChanged: ', event.page.name);\r\n * });\r\n * ```\r\n * \r\n * @template T\r\n * @param {string} eventName\r\n * @param {service.IEventHandler} handler\r\n */\r\n on(eventName: string, handler: service.IEventHandler): void {\r\n if (this.allowedEvents.indexOf(eventName) === -1) {\r\n throw new Error(`eventName is must be one of ${this.allowedEvents}. You passed: ${eventName}`);\r\n }\r\n\r\n this.eventHandlers.push({\r\n test: (event: service.IEvent) => event.name === eventName,\r\n handle: handler\r\n });\r\n\r\n this.element.addEventListener(eventName, handler)\r\n }\r\n\r\n /**\r\n * Reloads embed using existing configuration.\r\n * E.g. For reports this effectively clears all filters and makes the first page active which simulates resetting a report back to loaded state.\r\n * \r\n * ```javascript\r\n * report.reload();\r\n * ```\r\n */\r\n reload(): Promise {\r\n return this.load(this.config);\r\n }\r\n\r\n /**\r\n * Gets an access token from the first available location: config, attribute, global.\r\n * \r\n * @private\r\n * @param {string} globalAccessToken\r\n * @returns {string}\r\n */\r\n private getAccessToken(globalAccessToken: string): string {\r\n const accessToken = this.config.accessToken || this.element.getAttribute(Embed.accessTokenAttribute) || globalAccessToken;\r\n\r\n if (!accessToken) {\r\n throw new Error(`No access token was found for element. You must specify an access token directly on the element using attribute '${Embed.accessTokenAttribute}' or specify a global token at: powerbi.accessToken.`);\r\n }\r\n\r\n return accessToken;\r\n }\r\n\r\n /**\r\n * Gets an embed url from the first available location: options, attribute.\r\n * \r\n * @private\r\n * @returns {string}\r\n */\r\n private getEmbedUrl(): string {\r\n const embedUrl = this.config.embedUrl || this.element.getAttribute(Embed.embedUrlAttribute);\r\n\r\n if (typeof embedUrl !== 'string' || embedUrl.length === 0) {\r\n throw new Error(`Embed Url is required, but it was not found. You must provide an embed url either as part of embed configuration or as attribute '${Embed.embedUrlAttribute}'.`);\r\n }\r\n\r\n return embedUrl;\r\n }\r\n\r\n /**\r\n * Gets a unique ID from the first available location: options, attribute.\r\n * If neither is provided generate a unique string.\r\n * \r\n * @private\r\n * @returns {string}\r\n */\r\n private getUniqueId(): string {\r\n return this.config.uniqueId || this.element.getAttribute(Embed.nameAttribute) || utils.createRandomString();\r\n }\r\n\r\n /**\r\n * Gets the report ID from the first available location: options, attribute.\r\n * \r\n * @abstract\r\n * @returns {string}\r\n */\r\n abstract getId(): string;\r\n\r\n /**\r\n * Requests the browser to render the component's iframe in fullscreen mode.\r\n */\r\n fullscreen(): void {\r\n const requestFullScreen = this.iframe.requestFullscreen || this.iframe.msRequestFullscreen || this.iframe.mozRequestFullScreen || this.iframe.webkitRequestFullscreen;\r\n requestFullScreen.call(this.iframe);\r\n }\r\n\r\n /**\r\n * Requests the browser to exit fullscreen mode.\r\n */\r\n exitFullscreen(): void {\r\n if (!this.isFullscreen(this.iframe)) {\r\n return;\r\n }\r\n\r\n const exitFullscreen = document.exitFullscreen || document.mozCancelFullScreen || document.webkitExitFullscreen || document.msExitFullscreen;\r\n exitFullscreen.call(document);\r\n }\r\n\r\n /**\r\n * Returns true if the iframe is rendered in fullscreen mode,\r\n * otherwise returns false.\r\n * \r\n * @private\r\n * @param {HTMLIFrameElement} iframe\r\n * @returns {boolean}\r\n */\r\n private isFullscreen(iframe: HTMLIFrameElement): boolean {\r\n const options = ['fullscreenElement', 'webkitFullscreenElement', 'mozFullscreenScreenElement', 'msFullscreenElement'];\r\n\r\n return options.some(option => document[option] === iframe);\r\n }\r\n \r\n /**\r\n * Validate load configuration.\r\n */\r\n abstract validate(config: models.IReportLoadConfiguration | models.IDashboardLoadConfiguration): models.IError[];\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/embed.ts","\r\n/**\r\n * Raises a custom event with event data on the specified HTML element.\r\n * \r\n * @export\r\n * @param {HTMLElement} element\r\n * @param {string} eventName\r\n * @param {*} eventData\r\n */\r\nexport function raiseCustomEvent(element: HTMLElement, eventName: string, eventData: any): void {\r\n let customEvent;\r\n if (typeof CustomEvent === 'function') {\r\n customEvent = new CustomEvent(eventName, {\r\n detail: eventData,\r\n bubbles: true,\r\n cancelable: true\r\n });\r\n } else {\r\n customEvent = document.createEvent('CustomEvent');\r\n customEvent.initCustomEvent(eventName, true, true, eventData);\r\n }\r\n\r\n element.dispatchEvent(customEvent);\r\n}\r\n\r\n/**\r\n * Finds the index of the first value in an array that matches the specified predicate.\r\n * \r\n * @export\r\n * @template T\r\n * @param {(x: T) => boolean} predicate\r\n * @param {T[]} xs\r\n * @returns {number}\r\n */\r\nexport function findIndex(predicate: (x: T) => boolean, xs: T[]): number {\r\n if (!Array.isArray(xs)) {\r\n throw new Error(`You attempted to call find with second parameter that was not an array. You passed: ${xs}`);\r\n }\r\n\r\n let index;\r\n xs.some((x, i) => {\r\n if (predicate(x)) {\r\n index = i;\r\n return true;\r\n }\r\n });\r\n\r\n return index;\r\n}\r\n\r\n/**\r\n * Finds the first value in an array that matches the specified predicate.\r\n * \r\n * @export\r\n * @template T\r\n * @param {(x: T) => boolean} predicate\r\n * @param {T[]} xs\r\n * @returns {T}\r\n */\r\nexport function find(predicate: (x: T) => boolean, xs: T[]): T {\r\n const index = findIndex(predicate, xs);\r\n return xs[index];\r\n}\r\n\r\nexport function remove(predicate: (x: T) => boolean, xs: T[]): void {\r\n const index = findIndex(predicate, xs);\r\n xs.splice(index, 1);\r\n}\r\n\r\n// See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\r\n// TODO: replace in favor of using polyfill\r\n/**\r\n * Copies the values of all enumerable properties from one or more source objects to a target object, and returns the target object.\r\n * \r\n * @export\r\n * @param {any} args\r\n * @returns\r\n */\r\nexport function assign(...args) {\r\n var target = args[0];\r\n\r\n 'use strict';\r\n if (target === undefined || target === null) {\r\n throw new TypeError('Cannot convert undefined or null to object');\r\n }\r\n\r\n var output = Object(target);\r\n for (var index = 1; index < arguments.length; index++) {\r\n var source = arguments[index];\r\n if (source !== undefined && source !== null) {\r\n for (var nextKey in source) {\r\n if (source.hasOwnProperty(nextKey)) {\r\n output[nextKey] = source[nextKey];\r\n }\r\n }\r\n }\r\n }\r\n return output;\r\n}\r\n\r\n/**\r\n * Generates a random 7 character string.\r\n * \r\n * @export\r\n * @returns {string}\r\n */\r\nexport function createRandomString(): string {\r\n return (Math.random() + 1).toString(36).substring(7);\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/util.ts","import * as service from './service';\r\nimport * as embed from './embed';\r\nimport * as models from 'powerbi-models';\r\nimport * as wpmp from 'window-post-message-proxy';\r\nimport * as hpm from 'http-post-message';\r\nimport * as utils from './util';\r\nimport { IFilterable } from './ifilterable';\r\nimport { IPageNode, Page } from './page';\r\n\r\n/**\r\n * A Report node within a report hierarchy\r\n * \r\n * @export\r\n * @interface IReportNode\r\n */\r\nexport interface IReportNode {\r\n iframe: HTMLIFrameElement;\r\n service: service.IService;\r\n config: embed.IInternalEmbedConfiguration\r\n}\r\n\r\n/**\r\n * The Power BI Report embed component\r\n * \r\n * @export\r\n * @class Report\r\n * @extends {embed.Embed}\r\n * @implements {IReportNode}\r\n * @implements {IFilterable}\r\n */\r\nexport class Report extends embed.Embed implements IReportNode, IFilterable {\r\n static allowedEvents = [\"dataSelected\", \"filtersApplied\", \"pageChanged\", \"error\"];\r\n static reportIdAttribute = 'powerbi-report-id';\r\n static filterPaneEnabledAttribute = 'powerbi-settings-filter-pane-enabled';\r\n static navContentPaneEnabledAttribute = 'powerbi-settings-nav-content-pane-enabled';\r\n static typeAttribute = 'powerbi-type';\r\n static type = \"Report\";\r\n\r\n /**\r\n * Creates an instance of a Power BI Report.\r\n * \r\n * @param {service.Service} service\r\n * @param {HTMLElement} element\r\n * @param {embed.IEmbedConfiguration} config\r\n */\r\n constructor(service: service.Service, element: HTMLElement, config: embed.IEmbedConfiguration) {\r\n const filterPaneEnabled = (config.settings && config.settings.filterPaneEnabled) || !(element.getAttribute(Report.filterPaneEnabledAttribute) === \"false\");\r\n const navContentPaneEnabled = (config.settings && config.settings.navContentPaneEnabled) || !(element.getAttribute(Report.navContentPaneEnabledAttribute) === \"false\");\r\n const settings = utils.assign({\r\n filterPaneEnabled,\r\n navContentPaneEnabled\r\n }, config.settings);\r\n const configCopy = utils.assign({ settings }, config);\r\n\r\n super(service, element, configCopy);\r\n this.loadPath = \"/report/load\";\r\n Array.prototype.push.apply(this.allowedEvents, Report.allowedEvents);\r\n }\r\n\r\n /**\r\n * Adds backwards compatibility for the previous load configuration, which used the reportId query parameter to specify the report ID\r\n * (e.g. http://embedded.powerbi.com/appTokenReportEmbed?reportId=854846ed-2106-4dc2-bc58-eb77533bf2f1).\r\n * \r\n * By extracting the ID we can ensure that the ID is always explicitly provided as part of the load configuration.\r\n * \r\n * @static\r\n * @param {string} url\r\n * @returns {string}\r\n */\r\n static findIdFromEmbedUrl(url: string): string {\r\n const reportIdRegEx = /reportId=\"?([^&]+)\"?/\r\n const reportIdMatch = url.match(reportIdRegEx);\r\n\r\n let reportId;\r\n if (reportIdMatch) {\r\n reportId = reportIdMatch[1];\r\n }\r\n\r\n return reportId;\r\n }\r\n\r\n /**\r\n * Gets filters that are applied at the report level.\r\n * \r\n * ```javascript\r\n * // Get filters applied at report level\r\n * report.getFilters()\r\n * .then(filters => {\r\n * ...\r\n * });\r\n * ```\r\n * \r\n * @returns {Promise}\r\n */\r\n getFilters(): Promise {\r\n return this.service.hpm.get(`/report/filters`, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => response.body,\r\n response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Gets the report ID from the first available location: options, attribute, embed url.\r\n * \r\n * @returns {string}\r\n */\r\n getId(): string {\r\n const reportId = this.config.id || this.element.getAttribute(Report.reportIdAttribute) || Report.findIdFromEmbedUrl(this.config.embedUrl);\r\n\r\n if (typeof reportId !== 'string' || reportId.length === 0) {\r\n throw new Error(`Report id is required, but it was not found. You must provide an id either as part of embed configuration or as attribute '${Report.reportIdAttribute}'.`);\r\n }\r\n\r\n return reportId;\r\n }\r\n\r\n /**\r\n * Gets the list of pages within the report.\r\n * \r\n * ```javascript\r\n * report.getPages()\r\n * .then(pages => {\r\n * ...\r\n * });\r\n * ```\r\n * \r\n * @returns {Promise}\r\n */\r\n getPages(): Promise {\r\n return this.service.hpm.get('/report/pages', { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n return response.body\r\n .map(page => {\r\n return new Page(this, page.name, page.displayName);\r\n });\r\n }, response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Creates an instance of a Page.\r\n * \r\n * Normally you would get Page objects by calling `report.getPages()`, but in the case\r\n * that the page name is known and you want to perform an action on a page without having to retrieve it\r\n * you can create it directly.\r\n * \r\n * Note: Because you are creating the page manually there is no guarantee that the page actually exists in the report, and subsequent requests could fail.\r\n * \r\n * ```javascript\r\n * const page = report.page('ReportSection1');\r\n * page.setActive();\r\n * ```\r\n * \r\n * @param {string} name\r\n * @param {string} [displayName]\r\n * @returns {Page}\r\n */\r\n page(name: string, displayName?: string): Page {\r\n return new Page(this, name, displayName);\r\n }\r\n\r\n /**\r\n * Prints the active page of the report by invoking `window.print()` on the embed iframe component.\r\n */\r\n print(): Promise {\r\n return this.service.hpm.post('/report/print', null, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n return response.body;\r\n })\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Removes all filters at the report level.\r\n * \r\n * ```javascript\r\n * report.removeFilters();\r\n * ```\r\n * \r\n * @returns {Promise}\r\n */\r\n removeFilters(): Promise {\r\n return this.setFilters([]);\r\n }\r\n\r\n /**\r\n * Sets the active page of the report.\r\n * \r\n * ```javascript\r\n * report.setPage(\"page2\")\r\n * .catch(error => { ... });\r\n * ```\r\n * \r\n * @param {string} pageName\r\n * @returns {Promise}\r\n */\r\n setPage(pageName: string): Promise {\r\n const page: models.IPage = {\r\n name: pageName,\r\n displayName: null\r\n };\r\n\r\n return this.service.hpm.put('/report/pages/active', page, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Sets filters at the report level.\r\n * \r\n * ```javascript\r\n * const filters: [\r\n * ...\r\n * ];\r\n * \r\n * report.setFilters(filters)\r\n * .catch(errors => {\r\n * ...\r\n * });\r\n * ```\r\n * \r\n * @param {(models.IFilter[])} filters\r\n * @returns {Promise}\r\n */\r\n setFilters(filters: models.IFilter[]): Promise {\r\n return this.service.hpm.put(`/report/filters`, filters, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Updates visibility settings for the filter pane and the page navigation pane.\r\n * \r\n * ```javascript\r\n * const newSettings = {\r\n * navContentPaneEnabled: true,\r\n * filterPaneEnabled: false\r\n * };\r\n * \r\n * report.updateSettings(newSettings)\r\n * .catch(error => { ... });\r\n * ```\r\n * \r\n * @param {models.ISettings} settings\r\n * @returns {Promise}\r\n */\r\n updateSettings(settings: models.ISettings): Promise {\r\n return this.service.hpm.patch('/report/settings', settings, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Validate load configuration.\r\n */\r\n validate(config: models.IReportLoadConfiguration): models.IError[] {\r\n return models.validateReportLoad(config);\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/report.ts","/*! powerbi-models v0.10.1 | (c) 2016 Microsoft Corporation MIT */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"powerbi-models\"] = factory();\n\telse\n\t\troot[\"powerbi-models\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __extends = (this && this.__extends) || function (d, b) {\n\t for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n\t function __() { this.constructor = d; }\n\t d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n\t};\n\t/* tslint:disable:no-var-requires */\n\texports.advancedFilterSchema = __webpack_require__(1);\n\texports.filterSchema = __webpack_require__(2);\n\texports.loadSchema = __webpack_require__(3);\n\texports.dashboardLoadSchema = __webpack_require__(4);\n\texports.pageSchema = __webpack_require__(5);\n\texports.settingsSchema = __webpack_require__(6);\n\texports.basicFilterSchema = __webpack_require__(7);\n\t/* tslint:enable:no-var-requires */\n\tvar jsen = __webpack_require__(8);\n\tfunction normalizeError(error) {\n\t var message = error.message;\n\t if (!message) {\n\t message = error.path + \" is invalid. Not meeting \" + error.keyword + \" constraint\";\n\t }\n\t return {\n\t message: message\n\t };\n\t}\n\t/**\n\t * Takes in schema and returns function which can be used to validate the schema with better semantics around exposing errors\n\t */\n\tfunction validate(schema, options) {\n\t return function (x) {\n\t var validate = jsen(schema, options);\n\t var isValid = validate(x);\n\t if (isValid) {\n\t return undefined;\n\t }\n\t else {\n\t return validate.errors\n\t .map(normalizeError);\n\t }\n\t };\n\t}\n\texports.validateSettings = validate(exports.settingsSchema, {\n\t schemas: {\n\t basicFilter: exports.basicFilterSchema,\n\t advancedFilter: exports.advancedFilterSchema\n\t }\n\t});\n\texports.validateReportLoad = validate(exports.loadSchema, {\n\t schemas: {\n\t settings: exports.settingsSchema,\n\t basicFilter: exports.basicFilterSchema,\n\t advancedFilter: exports.advancedFilterSchema\n\t }\n\t});\n\texports.validateDashboardLoad = validate(exports.dashboardLoadSchema);\n\texports.validatePage = validate(exports.pageSchema);\n\texports.validateFilter = validate(exports.filterSchema, {\n\t schemas: {\n\t basicFilter: exports.basicFilterSchema,\n\t advancedFilter: exports.advancedFilterSchema\n\t }\n\t});\n\t(function (FilterType) {\n\t FilterType[FilterType[\"Advanced\"] = 0] = \"Advanced\";\n\t FilterType[FilterType[\"Basic\"] = 1] = \"Basic\";\n\t FilterType[FilterType[\"Unknown\"] = 2] = \"Unknown\";\n\t})(exports.FilterType || (exports.FilterType = {}));\n\tvar FilterType = exports.FilterType;\n\tfunction getFilterType(filter) {\n\t var basicFilter = filter;\n\t var advancedFilter = filter;\n\t if ((typeof basicFilter.operator === \"string\")\n\t && (Array.isArray(basicFilter.values))) {\n\t return FilterType.Basic;\n\t }\n\t else if ((typeof advancedFilter.logicalOperator === \"string\")\n\t && (Array.isArray(advancedFilter.conditions))) {\n\t return FilterType.Advanced;\n\t }\n\t else {\n\t return FilterType.Unknown;\n\t }\n\t}\n\texports.getFilterType = getFilterType;\n\tfunction isMeasure(arg) {\n\t return arg.table !== undefined && arg.measure !== undefined;\n\t}\n\texports.isMeasure = isMeasure;\n\tfunction isColumn(arg) {\n\t return arg.table !== undefined && arg.column !== undefined;\n\t}\n\texports.isColumn = isColumn;\n\tfunction isHierarchy(arg) {\n\t return arg.table !== undefined && arg.hierarchy !== undefined && arg.hierarchyLevel !== undefined;\n\t}\n\texports.isHierarchy = isHierarchy;\n\tvar Filter = (function () {\n\t function Filter(target) {\n\t this.target = target;\n\t }\n\t Filter.prototype.toJSON = function () {\n\t return {\n\t $schema: this.schemaUrl,\n\t target: this.target\n\t };\n\t };\n\t ;\n\t return Filter;\n\t}());\n\texports.Filter = Filter;\n\tvar BasicFilter = (function (_super) {\n\t __extends(BasicFilter, _super);\n\t function BasicFilter(target, operator) {\n\t var values = [];\n\t for (var _i = 2; _i < arguments.length; _i++) {\n\t values[_i - 2] = arguments[_i];\n\t }\n\t _super.call(this, target);\n\t this.operator = operator;\n\t this.schemaUrl = BasicFilter.schemaUrl;\n\t if (values.length === 0) {\n\t throw new Error(\"values must be a non-empty array. You passed: \" + values);\n\t }\n\t /**\n\t * Accept values as array instead of as individual arguments\n\t * new BasicFilter('a', 'b', 1, 2);\n\t * new BasicFilter('a', 'b', [1,2]);\n\t */\n\t if (Array.isArray(values[0])) {\n\t this.values = values[0];\n\t }\n\t else {\n\t this.values = values;\n\t }\n\t }\n\t BasicFilter.prototype.toJSON = function () {\n\t var filter = _super.prototype.toJSON.call(this);\n\t filter.operator = this.operator;\n\t filter.values = this.values;\n\t return filter;\n\t };\n\t BasicFilter.schemaUrl = \"http://powerbi.com/product/schema#basic\";\n\t return BasicFilter;\n\t}(Filter));\n\texports.BasicFilter = BasicFilter;\n\tvar AdvancedFilter = (function (_super) {\n\t __extends(AdvancedFilter, _super);\n\t function AdvancedFilter(target, logicalOperator) {\n\t var conditions = [];\n\t for (var _i = 2; _i < arguments.length; _i++) {\n\t conditions[_i - 2] = arguments[_i];\n\t }\n\t _super.call(this, target);\n\t this.schemaUrl = AdvancedFilter.schemaUrl;\n\t // Guard statements\n\t if (typeof logicalOperator !== \"string\" || logicalOperator.length === 0) {\n\t // TODO: It would be nicer to list out the possible logical operators.\n\t throw new Error(\"logicalOperator must be a valid operator, You passed: \" + logicalOperator);\n\t }\n\t this.logicalOperator = logicalOperator;\n\t var extractedConditions;\n\t /**\n\t * Accept conditions as array instead of as individual arguments\n\t * new AdvancedFilter('a', 'b', \"And\", { value: 1, operator: \"Equals\" }, { value: 2, operator: \"IsGreaterThan\" });\n\t * new AdvancedFilter('a', 'b', \"And\", [{ value: 1, operator: \"Equals\" }, { value: 2, operator: \"IsGreaterThan\" }]);\n\t */\n\t if (Array.isArray(conditions[0])) {\n\t extractedConditions = conditions[0];\n\t }\n\t else {\n\t extractedConditions = conditions;\n\t }\n\t if (extractedConditions.length === 0) {\n\t throw new Error(\"conditions must be a non-empty array. You passed: \" + conditions);\n\t }\n\t if (extractedConditions.length > 2) {\n\t throw new Error(\"AdvancedFilters may not have more than two conditions. You passed: \" + conditions.length);\n\t }\n\t if (extractedConditions.length === 1 && logicalOperator !== \"And\") {\n\t throw new Error(\"Logical Operator must be \\\"And\\\" when there is only one condition provided\");\n\t }\n\t this.conditions = extractedConditions;\n\t }\n\t AdvancedFilter.prototype.toJSON = function () {\n\t var filter = _super.prototype.toJSON.call(this);\n\t filter.logicalOperator = this.logicalOperator;\n\t filter.conditions = this.conditions;\n\t return filter;\n\t };\n\t AdvancedFilter.schemaUrl = \"http://powerbi.com/product/schema#advanced\";\n\t return AdvancedFilter;\n\t}(Filter));\n\texports.AdvancedFilter = AdvancedFilter;\n\n\n/***/ },\n/* 1 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"target\": {\n\t\t\t\t\"oneOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\t\"table\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"column\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"required\": [\n\t\t\t\t\t\t\t\"table\",\n\t\t\t\t\t\t\t\"column\"\n\t\t\t\t\t\t]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\t\"table\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"hierarchy\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"hierarchyLevel\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"required\": [\n\t\t\t\t\t\t\t\"table\",\n\t\t\t\t\t\t\t\"hierarchy\",\n\t\t\t\t\t\t\t\"hierarchyLevel\"\n\t\t\t\t\t\t]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\t\"table\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"measure\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"required\": [\n\t\t\t\t\t\t\t\"table\",\n\t\t\t\t\t\t\t\"measure\"\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"logicalOperator\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"conditions\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\"value\": {\n\t\t\t\t\t\t\t\"type\": [\n\t\t\t\t\t\t\t\t\"string\",\n\t\t\t\t\t\t\t\t\"boolean\",\n\t\t\t\t\t\t\t\t\"number\"\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"operator\": {\n\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\"required\": [\n\t\t\t\t\t\t\"value\",\n\t\t\t\t\t\t\"operator\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"target\",\n\t\t\t\"logicalOperator\",\n\t\t\t\"conditions\"\n\t\t]\n\t};\n\n/***/ },\n/* 2 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"oneOf\": [\n\t\t\t{\n\t\t\t\t\"$ref\": \"#basicFilter\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"$ref\": \"#advancedFilter\"\n\t\t\t}\n\t\t],\n\t\t\"invalidMessage\": \"filter is invalid\"\n\t};\n\n/***/ },\n/* 3 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"accessToken\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"accessToken must be a string\",\n\t\t\t\t\t\"required\": \"accessToken is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"id\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"id must be a string\",\n\t\t\t\t\t\"required\": \"id is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"settings\": {\n\t\t\t\t\"$ref\": \"#settings\"\n\t\t\t},\n\t\t\t\"pageName\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"pageName must be a string\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"filters\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\"oneOf\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"$ref\": \"#basicFilter\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"$ref\": \"#advancedFilter\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t\"invalidMessage\": \"filters property is invalid\"\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"accessToken\",\n\t\t\t\"id\"\n\t\t]\n\t};\n\n/***/ },\n/* 4 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"accessToken\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"accessToken must be a string\",\n\t\t\t\t\t\"required\": \"accessToken is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"id\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"id must be a string\",\n\t\t\t\t\t\"required\": \"id is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"pageView\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"pageView must be a string with one of the following values: \\\"actualSize\\\", \\\"fitToWidth\\\", \\\"oneColumn\\\"\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"accessToken\",\n\t\t\t\"id\"\n\t\t]\n\t};\n\n/***/ },\n/* 5 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"name\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"name must be a string\",\n\t\t\t\t\t\"required\": \"name is required\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"name\"\n\t\t]\n\t};\n\n/***/ },\n/* 6 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"filterPaneEnabled\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"filterPaneEnabled must be a boolean\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"navContentPaneEnabled\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"navContentPaneEnabled must be a boolean\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n/***/ },\n/* 7 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"target\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"properties\": {\n\t\t\t\t\t\"table\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"column\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"hierarchy\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"hierarchyLevel\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"measure\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"required\": [\n\t\t\t\t\t\"table\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"operator\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"values\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"type\": [\n\t\t\t\t\t\t\"string\",\n\t\t\t\t\t\t\"boolean\",\n\t\t\t\t\t\t\"number\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"target\",\n\t\t\t\"operator\",\n\t\t\t\"values\"\n\t\t]\n\t};\n\n/***/ },\n/* 8 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = __webpack_require__(9);\n\n/***/ },\n/* 9 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar REGEX_ESCAPE_EXPR = /[\\/]/g,\n\t STR_ESCAPE_EXPR = /(\")/gim,\n\t VALID_IDENTIFIER_EXPR = /^[a-z_$][0-9a-z]*$/gi,\n\t INVALID_SCHEMA = 'jsen: invalid schema object',\n\t browser = typeof window === 'object' && !!window.navigator, // jshint ignore: line\n\t regescape = new RegExp('/').source !== '/', // node v0.x does not properly escape '/'s in inline regex\n\t func = __webpack_require__(10),\n\t equal = __webpack_require__(11),\n\t unique = __webpack_require__(12),\n\t SchemaResolver = __webpack_require__(13),\n\t formats = __webpack_require__(21),\n\t ucs2length = __webpack_require__(22),\n\t types = {},\n\t keywords = {};\n\t\n\tfunction inlineRegex(regex) {\n\t regex = regex instanceof RegExp ? regex : new RegExp(regex);\n\t\n\t return regescape ?\n\t regex.toString() :\n\t '/' + regex.source.replace(REGEX_ESCAPE_EXPR, '\\\\$&') + '/';\n\t}\n\t\n\tfunction encodeStr(str) {\n\t return '\"' + str.replace(STR_ESCAPE_EXPR, '\\\\$1') + '\"';\n\t}\n\t\n\tfunction appendToPath(path, key) {\n\t VALID_IDENTIFIER_EXPR.lastIndex = 0;\n\t\n\t return VALID_IDENTIFIER_EXPR.test(key) ?\n\t path + '.' + key :\n\t path + '[' + encodeStr(key) + ']';\n\t}\n\t\n\tfunction type(obj) {\n\t if (obj === undefined) {\n\t return 'undefined';\n\t }\n\t\n\t var str = Object.prototype.toString.call(obj);\n\t return str.substr(8, str.length - 9).toLowerCase();\n\t}\n\t\n\tfunction isInteger(obj) {\n\t return (obj | 0) === obj; // jshint ignore: line\n\t}\n\t\n\ttypes['null'] = function (path) {\n\t return path + ' === null';\n\t};\n\t\n\ttypes.boolean = function (path) {\n\t return 'typeof ' + path + ' === \"boolean\"';\n\t};\n\t\n\ttypes.string = function (path) {\n\t return 'typeof ' + path + ' === \"string\"';\n\t};\n\t\n\ttypes.number = function (path) {\n\t return 'typeof ' + path + ' === \"number\"';\n\t};\n\t\n\ttypes.integer = function (path) {\n\t return 'typeof ' + path + ' === \"number\" && !(' + path + ' % 1)';\n\t};\n\t\n\ttypes.array = function (path) {\n\t return 'Array.isArray(' + path + ')';\n\t};\n\t\n\ttypes.object = function (path) {\n\t return 'typeof ' + path + ' === \"object\" && ' + path + ' !== null && !Array.isArray(' + path + ')';\n\t};\n\t\n\ttypes.date = function (path) {\n\t return path + ' instanceof Date';\n\t};\n\t\n\tkeywords.enum = function (context) {\n\t var arr = context.schema['enum'];\n\t\n\t context.code('if (!equalAny(' + context.path + ', ' + JSON.stringify(arr) + ')) {');\n\t context.error('enum');\n\t context.code('}');\n\t};\n\t\n\tkeywords.minimum = function (context) {\n\t if (typeof context.schema.minimum === 'number') {\n\t context.code('if (' + context.path + ' < ' + context.schema.minimum + ') {');\n\t context.error('minimum');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.exclusiveMinimum = function (context) {\n\t if (context.schema.exclusiveMinimum === true && typeof context.schema.minimum === 'number') {\n\t context.code('if (' + context.path + ' === ' + context.schema.minimum + ') {');\n\t context.error('exclusiveMinimum');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.maximum = function (context) {\n\t if (typeof context.schema.maximum === 'number') {\n\t context.code('if (' + context.path + ' > ' + context.schema.maximum + ') {');\n\t context.error('maximum');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.exclusiveMaximum = function (context) {\n\t if (context.schema.exclusiveMaximum === true && typeof context.schema.maximum === 'number') {\n\t context.code('if (' + context.path + ' === ' + context.schema.maximum + ') {');\n\t context.error('exclusiveMaximum');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.multipleOf = function (context) {\n\t if (typeof context.schema.multipleOf === 'number') {\n\t var mul = context.schema.multipleOf,\n\t decimals = mul.toString().length - mul.toFixed(0).length - 1,\n\t pow = decimals > 0 ? Math.pow(10, decimals) : 1,\n\t path = context.path;\n\t\n\t if (decimals > 0) {\n\t context.code('if (+(Math.round((' + path + ' * ' + pow + ') + \"e+\" + ' + decimals + ') + \"e-\" + ' + decimals + ') % ' + (mul * pow) + ' !== 0) {');\n\t } else {\n\t context.code('if (((' + path + ' * ' + pow + ') % ' + (mul * pow) + ') !== 0) {');\n\t }\n\t\n\t context.error('multipleOf');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.minLength = function (context) {\n\t if (isInteger(context.schema.minLength)) {\n\t context.code('if (ucs2length(' + context.path + ') < ' + context.schema.minLength + ') {');\n\t context.error('minLength');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.maxLength = function (context) {\n\t if (isInteger(context.schema.maxLength)) {\n\t context.code('if (ucs2length(' + context.path + ') > ' + context.schema.maxLength + ') {');\n\t context.error('maxLength');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.pattern = function (context) {\n\t var pattern = context.schema.pattern;\n\t\n\t if (typeof pattern === 'string' || pattern instanceof RegExp) {\n\t context.code('if (!(' + inlineRegex(pattern) + ').test(' + context.path + ')) {');\n\t context.error('pattern');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.format = function (context) {\n\t if (typeof context.schema.format !== 'string' || !formats[context.schema.format]) {\n\t return;\n\t }\n\t\n\t context.code('if (!(' + formats[context.schema.format] + ').test(' + context.path + ')) {');\n\t context.error('format');\n\t context.code('}');\n\t};\n\t\n\tkeywords.minItems = function (context) {\n\t if (isInteger(context.schema.minItems)) {\n\t context.code('if (' + context.path + '.length < ' + context.schema.minItems + ') {');\n\t context.error('minItems');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.maxItems = function (context) {\n\t if (isInteger(context.schema.maxItems)) {\n\t context.code('if (' + context.path + '.length > ' + context.schema.maxItems + ') {');\n\t context.error('maxItems');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.additionalItems = function (context) {\n\t if (context.schema.additionalItems === false && Array.isArray(context.schema.items)) {\n\t context.code('if (' + context.path + '.length > ' + context.schema.items.length + ') {');\n\t context.error('additionalItems');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.uniqueItems = function (context) {\n\t if (context.schema.uniqueItems) {\n\t context.code('if (unique(' + context.path + ').length !== ' + context.path + '.length) {');\n\t context.error('uniqueItems');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.items = function (context) {\n\t var index = context.declare(0),\n\t i = 0;\n\t\n\t if (type(context.schema.items) === 'object') {\n\t context.code('for (' + index + ' = 0; ' + index + ' < ' + context.path + '.length; ' + index + '++) {');\n\t\n\t context.descend(context.path + '[' + index + ']', context.schema.items);\n\t\n\t context.code('}');\n\t }\n\t else if (Array.isArray(context.schema.items)) {\n\t for (; i < context.schema.items.length; i++) {\n\t context.code('if (' + context.path + '.length - 1 >= ' + i + ') {');\n\t\n\t context.descend(context.path + '[' + i + ']', context.schema.items[i]);\n\t\n\t context.code('}');\n\t }\n\t\n\t if (type(context.schema.additionalItems) === 'object') {\n\t context.code('for (' + index + ' = ' + i + '; ' + index + ' < ' + context.path + '.length; ' + index + '++) {');\n\t\n\t context.descend(context.path + '[' + index + ']', context.schema.additionalItems);\n\t\n\t context.code('}');\n\t }\n\t }\n\t};\n\t\n\tkeywords.maxProperties = function (context) {\n\t if (isInteger(context.schema.maxProperties)) {\n\t context.code('if (Object.keys(' + context.path + ').length > ' + context.schema.maxProperties + ') {');\n\t context.error('maxProperties');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.minProperties = function (context) {\n\t if (isInteger(context.schema.minProperties)) {\n\t context.code('if (Object.keys(' + context.path + ').length < ' + context.schema.minProperties + ') {');\n\t context.error('minProperties');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.required = function (context) {\n\t if (!Array.isArray(context.schema.required)) {\n\t return;\n\t }\n\t\n\t for (var i = 0; i < context.schema.required.length; i++) {\n\t context.code('if (' + appendToPath(context.path, context.schema.required[i]) + ' === undefined) {');\n\t context.error('required', context.schema.required[i]);\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.properties = function (context) {\n\t var props = context.schema.properties,\n\t propKeys = type(props) === 'object' ? Object.keys(props) : [],\n\t required = Array.isArray(context.schema.required) ? context.schema.required : [],\n\t prop, i, nestedPath;\n\t\n\t if (!propKeys.length) {\n\t return;\n\t }\n\t\n\t for (i = 0; i < propKeys.length; i++) {\n\t prop = propKeys[i];\n\t nestedPath = appendToPath(context.path, prop);\n\t\n\t context.code('if (' + nestedPath + ' !== undefined) {');\n\t\n\t context.descend(nestedPath, props[prop]);\n\t\n\t context.code('}');\n\t\n\t if (required.indexOf(prop) > -1) {\n\t context.code('else {');\n\t context.error('required', prop);\n\t context.code('}');\n\t }\n\t }\n\t};\n\t\n\tkeywords.patternProperties = keywords.additionalProperties = function (context) {\n\t var propKeys = type(context.schema.properties) === 'object' ?\n\t Object.keys(context.schema.properties) : [],\n\t patProps = context.schema.patternProperties,\n\t patterns = type(patProps) === 'object' ? Object.keys(patProps) : [],\n\t addProps = context.schema.additionalProperties,\n\t addPropsCheck = addProps === false || type(addProps) === 'object',\n\t props, keys, key, n, found, pattern, i;\n\t\n\t if (!patterns.length && !addPropsCheck) {\n\t return;\n\t }\n\t\n\t keys = context.declare('[]');\n\t key = context.declare('\"\"');\n\t n = context.declare(0);\n\t\n\t if (addPropsCheck) {\n\t found = context.declare(false);\n\t }\n\t\n\t context.code(keys + ' = Object.keys(' + context.path + ')');\n\t\n\t context.code('for (' + n + ' = 0; ' + n + ' < ' + keys + '.length; ' + n + '++) {')\n\t (key + ' = ' + keys + '[' + n + ']')\n\t\n\t ('if (' + context.path + '[' + key + '] === undefined) {')\n\t ('continue')\n\t ('}');\n\t\n\t if (addPropsCheck) {\n\t context.code(found + ' = false');\n\t }\n\t\n\t // validate pattern properties\n\t for (i = 0; i < patterns.length; i++) {\n\t pattern = patterns[i];\n\t\n\t context.code('if ((' + inlineRegex(pattern) + ').test(' + key + ')) {');\n\t\n\t context.descend(context.path + '[' + key + ']', patProps[pattern]);\n\t\n\t if (addPropsCheck) {\n\t context.code(found + ' = true');\n\t }\n\t\n\t context.code('}');\n\t }\n\t\n\t // validate additional properties\n\t if (addPropsCheck) {\n\t if (propKeys.length) {\n\t props = context.declare(JSON.stringify(propKeys));\n\t\n\t // do not validate regular properties\n\t context.code('if (' + props + '.indexOf(' + key + ') > -1) {')\n\t ('continue')\n\t ('}');\n\t }\n\t\n\t context.code('if (!' + found + ') {');\n\t\n\t if (addProps === false) {\n\t // do not allow additional properties\n\t context.error('additionalProperties', undefined, key);\n\t }\n\t else {\n\t // validate additional properties\n\t context.descend(context.path + '[' + key + ']', addProps);\n\t }\n\t\n\t context.code('}');\n\t }\n\t\n\t context.code('}');\n\t};\n\t\n\tkeywords.dependencies = function (context) {\n\t if (type(context.schema.dependencies) !== 'object') {\n\t return;\n\t }\n\t\n\t var depKeys = Object.keys(context.schema.dependencies),\n\t len = depKeys.length,\n\t key, dep, i = 0, k = 0;\n\t\n\t for (; k < len; k++) {\n\t key = depKeys[k];\n\t dep = context.schema.dependencies[key];\n\t\n\t context.code('if (' + appendToPath(context.path, key) + ' !== undefined) {');\n\t\n\t if (type(dep) === 'object') {\n\t //schema dependency\n\t context.descend(context.path, dep);\n\t }\n\t else {\n\t // property dependency\n\t for (i; i < dep.length; i++) {\n\t context.code('if (' + appendToPath(context.path, dep[i]) + ' === undefined) {');\n\t context.error('dependencies', dep[i]);\n\t context.code('}');\n\t }\n\t }\n\t\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.allOf = function (context) {\n\t if (!Array.isArray(context.schema.allOf)) {\n\t return;\n\t }\n\t\n\t for (var i = 0; i < context.schema.allOf.length; i++) {\n\t context.descend(context.path, context.schema.allOf[i]);\n\t }\n\t};\n\t\n\tkeywords.anyOf = function (context) {\n\t if (!Array.isArray(context.schema.anyOf)) {\n\t return;\n\t }\n\t\n\t var greedy = context.greedy,\n\t errCount = context.declare(0),\n\t initialCount = context.declare(0),\n\t found = context.declare(false),\n\t i = 0;\n\t\n\t context.code(initialCount + ' = errors.length');\n\t\n\t for (; i < context.schema.anyOf.length; i++) {\n\t context.code('if (!' + found + ') {');\n\t\n\t context.code(errCount + ' = errors.length');\n\t\n\t context.greedy = true;\n\t\n\t context.descend(context.path, context.schema.anyOf[i]);\n\t\n\t context.code(found + ' = errors.length === ' + errCount)\n\t ('}');\n\t }\n\t\n\t context.greedy = greedy;\n\t\n\t context.code('if (!' + found + ') {');\n\t\n\t context.error('anyOf');\n\t\n\t context.code('} else {')\n\t ('errors.length = ' + initialCount)\n\t ('}');\n\t};\n\t\n\tkeywords.oneOf = function (context) {\n\t if (!Array.isArray(context.schema.oneOf)) {\n\t return;\n\t }\n\t\n\t var greedy = context.greedy,\n\t matching = context.declare(0),\n\t initialCount = context.declare(0),\n\t errCount = context.declare(0),\n\t i = 0;\n\t\n\t context.code(initialCount + ' = errors.length');\n\t context.code(matching + ' = 0');\n\t\n\t for (; i < context.schema.oneOf.length; i++) {\n\t context.code(errCount + ' = errors.length');\n\t\n\t context.greedy = true;\n\t\n\t context.descend(context.path, context.schema.oneOf[i]);\n\t\n\t context.code('if (errors.length === ' + errCount + ') {')\n\t (matching + '++')\n\t ('}');\n\t }\n\t\n\t context.greedy = greedy;\n\t\n\t context.code('if (' + matching + ' !== 1) {');\n\t\n\t context.error('oneOf');\n\t\n\t context.code('} else {')\n\t ('errors.length = ' + initialCount)\n\t ('}');\n\t};\n\t\n\tkeywords.not = function (context) {\n\t if (type(context.schema.not) !== 'object') {\n\t return;\n\t }\n\t\n\t var greedy = context.greedy,\n\t errCount = context.declare(0);\n\t\n\t context.code(errCount + ' = errors.length');\n\t\n\t context.greedy = true;\n\t\n\t context.descend(context.path, context.schema.not);\n\t\n\t context.greedy = greedy;\n\t\n\t context.code('if (errors.length === ' + errCount + ') {');\n\t\n\t context.error('not');\n\t\n\t context.code('} else {')\n\t ('errors.length = ' + errCount)\n\t ('}');\n\t};\n\t\n\tfunction decorateGenerator(type, keyword) {\n\t keywords[keyword].type = type;\n\t keywords[keyword].keyword = keyword;\n\t}\n\t\n\t['minimum', 'exclusiveMinimum', 'maximum', 'exclusiveMaximum', 'multipleOf']\n\t .forEach(decorateGenerator.bind(null, 'number'));\n\t\n\t['minLength', 'maxLength', 'pattern', 'format']\n\t .forEach(decorateGenerator.bind(null, 'string'));\n\t\n\t['minItems', 'maxItems', 'additionalItems', 'uniqueItems', 'items']\n\t .forEach(decorateGenerator.bind(null, 'array'));\n\t\n\t['maxProperties', 'minProperties', 'required', 'properties', 'patternProperties', 'additionalProperties', 'dependencies']\n\t .forEach(decorateGenerator.bind(null, 'object'));\n\t\n\t['enum', 'allOf', 'anyOf', 'oneOf', 'not']\n\t .forEach(decorateGenerator.bind(null, null));\n\t\n\tfunction groupKeywords(schema) {\n\t var keys = Object.keys(schema),\n\t propIndex = keys.indexOf('properties'),\n\t patIndex = keys.indexOf('patternProperties'),\n\t ret = {\n\t enum: Array.isArray(schema.enum) && schema.enum.length > 0,\n\t type: null,\n\t allType: [],\n\t perType: {}\n\t },\n\t key, gen, i;\n\t\n\t if (schema.type) {\n\t if (typeof schema.type === 'string') {\n\t ret.type = [schema.type];\n\t }\n\t else if (Array.isArray(schema.type) && schema.type.length) {\n\t ret.type = schema.type.slice(0);\n\t }\n\t }\n\t\n\t for (i = 0; i < keys.length; i++) {\n\t key = keys[i];\n\t\n\t if (key === 'enum' || key === 'type') {\n\t continue;\n\t }\n\t\n\t gen = keywords[key];\n\t\n\t if (!gen) {\n\t continue;\n\t }\n\t\n\t if (gen.type) {\n\t if (!ret.perType[gen.type]) {\n\t ret.perType[gen.type] = [];\n\t }\n\t\n\t if (!(propIndex > -1 && key === 'required') &&\n\t !(patIndex > -1 && key === 'additionalProperties')) {\n\t ret.perType[gen.type].push(key);\n\t }\n\t }\n\t else {\n\t ret.allType.push(key);\n\t }\n\t }\n\t\n\t return ret;\n\t}\n\t\n\tfunction getPathExpression(path, key) {\n\t var path_ = path.substr(4),\n\t len = path_.length,\n\t tokens = [],\n\t token = '',\n\t isvar = false,\n\t char, i;\n\t\n\t for (i = 0; i < len; i++) {\n\t char = path_[i];\n\t\n\t switch (char) {\n\t case '.':\n\t if (token) {\n\t token += char;\n\t }\n\t break;\n\t case '[':\n\t if (isNaN(+path_[i + 1])) {\n\t isvar = true;\n\t\n\t if (token) {\n\t tokens.push('\"' + token + '\"');\n\t token = '';\n\t }\n\t }\n\t else {\n\t isvar = false;\n\t\n\t if (token) {\n\t token += '.';\n\t }\n\t }\n\t break;\n\t case ']':\n\t tokens.push(isvar ? token : '\"' + token + '\"');\n\t token = '';\n\t break;\n\t default:\n\t token += char;\n\t }\n\t }\n\t\n\t if (token) {\n\t tokens.push('\"' + token + '\"');\n\t }\n\t\n\t if (key) {\n\t tokens.push('\"' + key + '\"');\n\t }\n\t\n\t if (tokens.length === 1 && isvar) {\n\t return '\"\" + ' + tokens[0] + ' + \"\"';\n\t }\n\t\n\t return tokens.join(' + \".\" + ') || '\"\"';\n\t}\n\t\n\tfunction clone(obj) {\n\t var cloned = obj,\n\t objType = type(obj),\n\t keys, len, key, i;\n\t\n\t if (objType === 'object') {\n\t cloned = {};\n\t keys = Object.keys(obj);\n\t\n\t for (i = 0, len = keys.length; i < len; i++) {\n\t key = keys[i];\n\t cloned[key] = clone(obj[key]);\n\t }\n\t }\n\t else if (objType === 'array') {\n\t cloned = [];\n\t\n\t for (i = 0, len = obj.length; i < len; i++) {\n\t cloned[i] = clone(obj[i]);\n\t }\n\t }\n\t else if (objType === 'regexp') {\n\t return new RegExp(obj);\n\t }\n\t else if (objType === 'date') {\n\t return new Date(obj.toJSON());\n\t }\n\t\n\t return cloned;\n\t}\n\t\n\tfunction equalAny(obj, options) {\n\t for (var i = 0, len = options.length; i < len; i++) {\n\t if (equal(obj, options[i])) {\n\t return true;\n\t }\n\t }\n\t\n\t return false;\n\t}\n\t\n\tfunction PropertyMarker() {\n\t this.objects = [];\n\t this.properties = [];\n\t}\n\t\n\tPropertyMarker.prototype.mark = function (obj, key) {\n\t var index = this.objects.indexOf(obj),\n\t prop;\n\t\n\t if (index < 0) {\n\t this.objects.push(obj);\n\t\n\t prop = {};\n\t prop[key] = 1;\n\t\n\t this.properties.push(prop);\n\t\n\t return;\n\t }\n\t\n\t prop = this.properties[index];\n\t\n\t prop[key] = prop[key] ? prop[key] + 1 : 1;\n\t};\n\t\n\tPropertyMarker.prototype.deleteDuplicates = function () {\n\t var props, keys, key, i, j;\n\t\n\t for (i = 0; i < this.properties.length; i++) {\n\t props = this.properties[i];\n\t keys = Object.keys(props);\n\t\n\t for (j = 0; j < keys.length; j++) {\n\t key = keys[j];\n\t\n\t if (props[key] > 1) {\n\t delete this.objects[i][key];\n\t }\n\t }\n\t }\n\t};\n\t\n\tPropertyMarker.prototype.dispose = function () {\n\t this.objects.length = 0;\n\t this.properties.length = 0;\n\t};\n\t\n\tfunction build(schema, def, additional, resolver, parentMarker) {\n\t var defType, defValue, key, i, propertyMarker, props, defProps;\n\t\n\t if (type(schema) !== 'object') {\n\t return def;\n\t }\n\t\n\t schema = resolver.resolve(schema);\n\t\n\t if (def === undefined && schema.hasOwnProperty('default')) {\n\t def = clone(schema['default']);\n\t }\n\t\n\t defType = type(def);\n\t\n\t if (defType === 'object' && type(schema.properties) === 'object') {\n\t props = Object.keys(schema.properties);\n\t\n\t for (i = 0; i < props.length; i++) {\n\t key = props[i];\n\t defValue = build(schema.properties[key], def[key], additional, resolver);\n\t\n\t if (defValue !== undefined) {\n\t def[key] = defValue;\n\t }\n\t }\n\t\n\t if (additional !== 'always') {\n\t defProps = Object.keys(def);\n\t\n\t for (i = 0; i < defProps.length; i++) {\n\t key = defProps[i];\n\t\n\t if (props.indexOf(key) < 0 &&\n\t (schema.additionalProperties === false ||\n\t (additional === false && !schema.additionalProperties))) {\n\t\n\t if (parentMarker) {\n\t parentMarker.mark(def, key);\n\t }\n\t else {\n\t delete def[key];\n\t }\n\t }\n\t }\n\t }\n\t }\n\t else if (defType === 'array' && schema.items) {\n\t if (type(schema.items) === 'array') {\n\t for (i = 0; i < schema.items.length; i++) {\n\t defValue = build(schema.items[i], def[i], additional, resolver);\n\t\n\t if (defValue !== undefined || i < def.length) {\n\t def[i] = defValue;\n\t }\n\t }\n\t }\n\t else if (def.length) {\n\t for (i = 0; i < def.length; i++) {\n\t def[i] = build(schema.items, def[i], additional, resolver);\n\t }\n\t }\n\t }\n\t else if (type(schema.allOf) === 'array' && schema.allOf.length) {\n\t propertyMarker = new PropertyMarker();\n\t\n\t for (i = 0; i < schema.allOf.length; i++) {\n\t def = build(schema.allOf[i], def, additional, resolver, propertyMarker);\n\t }\n\t\n\t propertyMarker.deleteDuplicates();\n\t propertyMarker.dispose();\n\t }\n\t\n\t return def;\n\t}\n\t\n\tfunction ValidationContext(options) {\n\t this.path = 'data';\n\t this.schema = options.schema;\n\t this.formats = options.formats;\n\t this.greedy = options.greedy;\n\t this.resolver = options.resolver;\n\t this.id = options.id;\n\t this.funcache = options.funcache || {};\n\t this.scope = options.scope || {\n\t equalAny: equalAny,\n\t unique: unique,\n\t ucs2length: ucs2length,\n\t refs: {}\n\t };\n\t}\n\t\n\tValidationContext.prototype.clone = function (schema) {\n\t var ctx = new ValidationContext({\n\t schema: schema,\n\t formats: this.formats,\n\t greedy: this.greedy,\n\t resolver: this.resolver,\n\t id: this.id,\n\t funcache: this.funcache,\n\t scope: this.scope\n\t });\n\t\n\t return ctx;\n\t};\n\t\n\tValidationContext.prototype.declare = function (def) {\n\t var variname = this.id();\n\t this.code.def(variname, def);\n\t return variname;\n\t};\n\t\n\tValidationContext.prototype.cache = function (cacheKey, schema) {\n\t var cached = this.funcache[cacheKey],\n\t context;\n\t\n\t if (!cached) {\n\t cached = this.funcache[cacheKey] = {\n\t key: this.id()\n\t };\n\t\n\t context = this.clone(schema);\n\t\n\t cached.func = context.compile(cached.key);\n\t\n\t this.scope.refs[cached.key] = cached.func;\n\t\n\t context.dispose();\n\t }\n\t\n\t return 'refs.' + cached.key;\n\t};\n\t\n\tValidationContext.prototype.error = function (keyword, key, additional) {\n\t var schema = this.schema,\n\t path = this.path,\n\t errorPath = path !== 'data' || key ?\n\t '(path ? path + \".\" : \"\") + ' + getPathExpression(path, key) + ',' :\n\t 'path,',\n\t res = key && schema.properties && schema.properties[key] ?\n\t this.resolver.resolve(schema.properties[key]) : null,\n\t message = res ? res.requiredMessage : schema.invalidMessage;\n\t\n\t if (!message) {\n\t message = (res && res.messages && res.messages[keyword]) ||\n\t (schema.messages && schema.messages[keyword]);\n\t }\n\t\n\t this.code('errors.push({');\n\t\n\t if (message) {\n\t this.code('message: ' + encodeStr(message) + ',');\n\t }\n\t\n\t if (additional) {\n\t this.code('additionalProperties: ' + additional + ',');\n\t }\n\t\n\t this.code('path: ' + errorPath)\n\t ('keyword: ' + encodeStr(keyword))\n\t ('})');\n\t\n\t if (!this.greedy) {\n\t this.code('return');\n\t }\n\t};\n\t\n\tValidationContext.prototype.refactor = function (path, schema, cacheKey) {\n\t var parentPathExp = path !== 'data' ?\n\t '(path ? path + \".\" : \"\") + ' + getPathExpression(path) :\n\t 'path',\n\t cachedRef = this.cache(cacheKey, schema),\n\t refErrors = this.declare();\n\t\n\t this.code(refErrors + ' = ' + cachedRef + '(' + path + ', ' + parentPathExp + ', errors)');\n\t\n\t if (!this.greedy) {\n\t this.code('if (errors.length) { return }');\n\t }\n\t};\n\t\n\tValidationContext.prototype.descend = function (path, schema) {\n\t var origPath = this.path,\n\t origSchema = this.schema;\n\t\n\t this.path = path;\n\t this.schema = schema;\n\t\n\t this.generate();\n\t\n\t this.path = origPath;\n\t this.schema = origSchema;\n\t};\n\t\n\tValidationContext.prototype.generate = function () {\n\t var path = this.path,\n\t schema = this.schema,\n\t context = this,\n\t scope = this.scope,\n\t encodedFormat,\n\t format,\n\t schemaKeys,\n\t typeKeys,\n\t typeIndex,\n\t validatedType,\n\t i;\n\t\n\t if (type(schema) !== 'object') {\n\t return;\n\t }\n\t\n\t if (schema.$ref !== undefined) {\n\t schema = this.resolver.resolve(schema);\n\t\n\t if (this.resolver.hasRef(schema)) {\n\t this.refactor(path, schema,\n\t this.resolver.getNormalizedRef(this.schema) || this.schema.$ref);\n\t\n\t return;\n\t }\n\t else {\n\t // substitute $ref schema with the resolved instance\n\t this.schema = schema;\n\t }\n\t }\n\t\n\t schemaKeys = groupKeywords(schema);\n\t\n\t if (schemaKeys.enum) {\n\t keywords.enum(context);\n\t\n\t return; // do not process the schema further\n\t }\n\t\n\t typeKeys = Object.keys(schemaKeys.perType);\n\t\n\t function generateForKeyword(keyword) {\n\t keywords[keyword](context); // jshint ignore: line\n\t }\n\t\n\t for (i = 0; i < typeKeys.length; i++) {\n\t validatedType = typeKeys[i];\n\t\n\t this.code((i ? 'else ' : '') + 'if (' + types[validatedType](path) + ') {');\n\t\n\t schemaKeys.perType[validatedType].forEach(generateForKeyword);\n\t\n\t this.code('}');\n\t\n\t if (schemaKeys.type) {\n\t typeIndex = schemaKeys.type.indexOf(validatedType);\n\t\n\t if (typeIndex > -1) {\n\t schemaKeys.type.splice(typeIndex, 1);\n\t }\n\t }\n\t }\n\t\n\t if (schemaKeys.type) { // we have types in the schema\n\t if (schemaKeys.type.length) { // case 1: we still have some left to check\n\t this.code((typeKeys.length ? 'else ' : '') + 'if (!(' + schemaKeys.type.map(function (type) {\n\t return types[type] ? types[type](path) : 'true';\n\t }).join(' || ') + ')) {');\n\t this.error('type');\n\t this.code('}');\n\t }\n\t else {\n\t this.code('else {'); // case 2: we don't have any left to check\n\t this.error('type');\n\t this.code('}');\n\t }\n\t }\n\t\n\t schemaKeys.allType.forEach(function (keyword) {\n\t keywords[keyword](context);\n\t });\n\t\n\t if (schema.format && this.formats) {\n\t format = this.formats[schema.format];\n\t\n\t if (format) {\n\t if (typeof format === 'string' || format instanceof RegExp) {\n\t this.code('if (!(' + inlineRegex(format) + ').test(' + path + ')) {');\n\t this.error('format');\n\t this.code('}');\n\t }\n\t else if (typeof format === 'function') {\n\t (scope.formats || (scope.formats = {}))[schema.format] = format;\n\t (scope.schemas || (scope.schemas = {}))[schema.format] = schema;\n\t\n\t encodedFormat = encodeStr(schema.format);\n\t\n\t this.code('if (!formats[' + encodedFormat + '](' + path + ', schemas[' + encodedFormat + '])) {');\n\t this.error('format');\n\t this.code('}');\n\t }\n\t }\n\t }\n\t};\n\t\n\tValidationContext.prototype.compile = function (id) {\n\t this.code = func('jsen_compiled' + (id ? '_' + id : ''), 'data', 'path', 'errors');\n\t this.generate();\n\t\n\t return this.code.compile(this.scope);\n\t};\n\t\n\tValidationContext.prototype.dispose = function () {\n\t for (var key in this) {\n\t this[key] = undefined;\n\t }\n\t};\n\t\n\tfunction jsen(schema, options) {\n\t if (type(schema) !== 'object') {\n\t throw new Error(INVALID_SCHEMA);\n\t }\n\t\n\t options = options || {};\n\t\n\t var counter = 0,\n\t id = function () { return 'i' + (counter++); },\n\t resolver = new SchemaResolver(schema, options.schemas, options.missing$Ref || false),\n\t context = new ValidationContext({\n\t schema: schema,\n\t resolver: resolver,\n\t id: id,\n\t schemas: options.schemas,\n\t formats: options.formats,\n\t greedy: options.greedy || false\n\t }),\n\t compiled = func('validate', 'data')\n\t ('validate.errors = []')\n\t ('gen(data, \"\", validate.errors)')\n\t ('return validate.errors.length === 0')\n\t .compile({ gen: context.compile() });\n\t\n\t context.dispose();\n\t context = null;\n\t\n\t compiled.errors = [];\n\t\n\t compiled.build = function (initial, options) {\n\t return build(\n\t schema,\n\t (options && options.copy === false ? initial : clone(initial)),\n\t options && options.additionalProperties,\n\t resolver);\n\t };\n\t\n\t return compiled;\n\t}\n\t\n\tjsen.browser = browser;\n\tjsen.clone = clone;\n\tjsen.equal = equal;\n\tjsen.unique = unique;\n\tjsen.ucs2length = ucs2length;\n\tjsen.SchemaResolver = SchemaResolver;\n\tjsen.resolve = SchemaResolver.resolvePointer;\n\t\n\tmodule.exports = jsen;\n\n\n/***/ },\n/* 10 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = function func() {\n\t var args = Array.apply(null, arguments),\n\t name = args.shift(),\n\t tab = ' ',\n\t lines = '',\n\t vars = '',\n\t ind = 1, // indentation\n\t bs = '{[', // block start\n\t be = '}]', // block end\n\t space = function () {\n\t var sp = tab, i = 0;\n\t while (i++ < ind - 1) { sp += tab; }\n\t return sp;\n\t },\n\t add = function (line) {\n\t lines += space() + line + '\\n';\n\t },\n\t builder = function (line) {\n\t var first = line[0],\n\t last = line[line.length - 1];\n\t\n\t if (be.indexOf(first) > -1 && bs.indexOf(last) > -1) {\n\t ind--;\n\t add(line);\n\t ind++;\n\t }\n\t else if (bs.indexOf(last) > -1) {\n\t add(line);\n\t ind++;\n\t }\n\t else if (be.indexOf(first) > -1) {\n\t ind--;\n\t add(line);\n\t }\n\t else {\n\t add(line);\n\t }\n\t\n\t return builder;\n\t };\n\t\n\t builder.def = function (id, def) {\n\t vars += (vars ? ',\\n' + tab + ' ' : '') + id + (def !== undefined ? ' = ' + def : '');\n\t return builder;\n\t };\n\t\n\t builder.toSource = function () {\n\t return 'function ' + name + '(' + args.join(', ') + ') {\\n' +\n\t tab + '\"use strict\"' + '\\n' +\n\t (vars ? tab + 'var ' + vars + ';\\n' : '') +\n\t lines + '}';\n\t };\n\t\n\t builder.compile = function (scope) {\n\t var src = 'return (' + builder.toSource() + ')',\n\t scp = scope || {},\n\t keys = Object.keys(scp),\n\t vals = keys.map(function (key) { return scp[key]; });\n\t\n\t return Function.apply(null, keys.concat(src)).apply(null, vals);\n\t };\n\t\n\t return builder;\n\t};\n\n/***/ },\n/* 11 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tfunction type(obj) {\n\t var str = Object.prototype.toString.call(obj);\n\t return str.substr(8, str.length - 9).toLowerCase();\n\t}\n\t\n\tfunction deepEqual(a, b) {\n\t var keysA = Object.keys(a).sort(),\n\t keysB = Object.keys(b).sort(),\n\t i, key;\n\t\n\t if (!equal(keysA, keysB)) {\n\t return false;\n\t }\n\t\n\t for (i = 0; i < keysA.length; i++) {\n\t key = keysA[i];\n\t\n\t if (!equal(a[key], b[key])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t}\n\t\n\tfunction equal(a, b) { // jshint ignore: line\n\t var typeA = typeof a,\n\t typeB = typeof b,\n\t i;\n\t\n\t // get detailed object type\n\t if (typeA === 'object') {\n\t typeA = type(a);\n\t }\n\t\n\t // get detailed object type\n\t if (typeB === 'object') {\n\t typeB = type(b);\n\t }\n\t\n\t if (typeA !== typeB) {\n\t return false;\n\t }\n\t\n\t if (typeA === 'object') {\n\t return deepEqual(a, b);\n\t }\n\t\n\t if (typeA === 'regexp') {\n\t return a.toString() === b.toString();\n\t }\n\t\n\t if (typeA === 'array') {\n\t if (a.length !== b.length) {\n\t return false;\n\t }\n\t\n\t for (i = 0; i < a.length; i++) {\n\t if (!equal(a[i], b[i])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t }\n\t\n\t return a === b;\n\t}\n\t\n\tmodule.exports = equal;\n\n/***/ },\n/* 12 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar equal = __webpack_require__(11);\n\t\n\tfunction findIndex(arr, value, comparator) {\n\t for (var i = 0, len = arr.length; i < len; i++) {\n\t if (comparator(arr[i], value)) {\n\t return i;\n\t }\n\t }\n\t\n\t return -1;\n\t}\n\t\n\tmodule.exports = function unique(arr) {\n\t return arr.filter(function uniqueOnly(value, index, self) {\n\t return findIndex(self, value, equal) === index;\n\t });\n\t};\n\t\n\tmodule.exports.findIndex = findIndex;\n\n/***/ },\n/* 13 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar url = __webpack_require__(14),\n\t metaschema = __webpack_require__(20),\n\t INVALID_SCHEMA_REFERENCE = 'jsen: invalid schema reference',\n\t DUPLICATE_SCHEMA_ID = 'jsen: duplicate schema id',\n\t CIRCULAR_SCHEMA_REFERENCE = 'jsen: circular schema reference';\n\t\n\tfunction get(obj, path) {\n\t if (!path.length) {\n\t return obj;\n\t }\n\t\n\t var key = path.shift(),\n\t val;\n\t\n\t if (obj && typeof obj === 'object' && obj.hasOwnProperty(key)) {\n\t val = obj[key];\n\t }\n\t\n\t if (path.length) {\n\t if (val && typeof val === 'object') {\n\t return get(val, path);\n\t }\n\t\n\t return undefined;\n\t }\n\t\n\t return val;\n\t}\n\t\n\tfunction refToObj(ref) {\n\t var index = ref.indexOf('#'),\n\t ret = {\n\t base: ref.substr(0, index),\n\t path: []\n\t };\n\t\n\t if (index < 0) {\n\t ret.base = ref;\n\t return ret;\n\t }\n\t\n\t ref = ref.substr(index + 1);\n\t\n\t if (!ref) {\n\t return ret;\n\t }\n\t\n\t ret.path = ref.split('/').map(function (segment) {\n\t // Reference: http://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-08#section-3\n\t return decodeURIComponent(segment)\n\t .replace(/~1/g, '/')\n\t .replace(/~0/g, '~');\n\t });\n\t\n\t if (ref[0] === '/') {\n\t ret.path.shift();\n\t }\n\t\n\t return ret;\n\t}\n\t\n\t// TODO: Can we prevent nested resolvers and combine schemas instead?\n\tfunction SchemaResolver(rootSchema, external, missing$Ref, baseId) { // jshint ignore: line\n\t this.rootSchema = rootSchema;\n\t this.resolvers = null;\n\t this.resolvedRootSchema = null;\n\t this.cache = {};\n\t this.idCache = {};\n\t this.refCache = { refs: [], schemas: [] };\n\t this.missing$Ref = missing$Ref;\n\t this.refStack = [];\n\t\n\t baseId = baseId || '';\n\t\n\t this._buildIdCache(rootSchema, baseId);\n\t\n\t // get updated base id after normalizing root schema id\n\t baseId = this.refCache.refs[this.refCache.schemas.indexOf(this.rootSchema)] || baseId;\n\t\n\t this._buildResolvers(external, baseId);\n\t}\n\t\n\tSchemaResolver.prototype._cacheId = function (id, schema, resolver) {\n\t if (this.idCache[id]) {\n\t throw new Error(DUPLICATE_SCHEMA_ID + ' ' + id);\n\t }\n\t\n\t this.idCache[id] = { resolver: resolver, schema: schema };\n\t};\n\t\n\tSchemaResolver.prototype._buildIdCache = function (schema, baseId) {\n\t var id = baseId,\n\t ref, keys, i;\n\t\n\t if (!schema || typeof schema !== 'object') {\n\t return;\n\t }\n\t\n\t if (typeof schema.id === 'string' && schema.id) {\n\t id = url.resolve(baseId, schema.id);\n\t\n\t this._cacheId(id, schema, this);\n\t }\n\t else if (schema === this.rootSchema && baseId) {\n\t this._cacheId(baseId, schema, this);\n\t }\n\t\n\t if (schema.$ref && typeof schema.$ref === 'string') {\n\t ref = url.resolve(id, schema.$ref);\n\t\n\t this.refCache.schemas.push(schema);\n\t this.refCache.refs.push(ref);\n\t }\n\t\n\t keys = Object.keys(schema);\n\t\n\t for (i = 0; i < keys.length; i++) {\n\t this._buildIdCache(schema[keys[i]], id);\n\t }\n\t};\n\t\n\tSchemaResolver.prototype._buildResolvers = function (schemas, baseId) {\n\t if (!schemas || typeof schemas !== 'object') {\n\t return;\n\t }\n\t\n\t var that = this,\n\t resolvers = {};\n\t\n\t Object.keys(schemas).forEach(function (key) {\n\t var id = url.resolve(baseId, key),\n\t resolver = new SchemaResolver(schemas[key], null, that.missing$Ref, id);\n\t\n\t that._cacheId(id, resolver.rootSchema, resolver);\n\t\n\t Object.keys(resolver.idCache).forEach(function (idKey) {\n\t that.idCache[idKey] = resolver.idCache[idKey];\n\t });\n\t\n\t resolvers[key] = resolver;\n\t });\n\t\n\t this.resolvers = resolvers;\n\t};\n\t\n\tSchemaResolver.prototype.getNormalizedRef = function (schema) {\n\t var index = this.refCache.schemas.indexOf(schema);\n\t return this.refCache.refs[index];\n\t};\n\t\n\tSchemaResolver.prototype._resolveRef = function (ref) {\n\t var err = new Error(INVALID_SCHEMA_REFERENCE + ' ' + ref),\n\t idCache = this.idCache,\n\t externalResolver, cached, descriptor, path, dest;\n\t\n\t if (!ref || typeof ref !== 'string') {\n\t throw err;\n\t }\n\t\n\t if (ref === metaschema.id) {\n\t dest = metaschema;\n\t }\n\t\n\t cached = idCache[ref];\n\t\n\t if (cached) {\n\t dest = cached.resolver.resolve(cached.schema);\n\t }\n\t\n\t if (dest === undefined) {\n\t descriptor = refToObj(ref);\n\t path = descriptor.path;\n\t\n\t if (descriptor.base) {\n\t cached = idCache[descriptor.base] || idCache[descriptor.base + '#'];\n\t\n\t if (cached) {\n\t dest = cached.resolver.resolve(get(cached.schema, path.slice(0)));\n\t }\n\t else {\n\t path.unshift(descriptor.base);\n\t }\n\t }\n\t }\n\t\n\t if (dest === undefined && this.resolvedRootSchema) {\n\t dest = get(this.resolvedRootSchema, path.slice(0));\n\t }\n\t\n\t if (dest === undefined) {\n\t dest = get(this.rootSchema, path.slice(0));\n\t }\n\t\n\t if (dest === undefined && path.length && this.resolvers) {\n\t externalResolver = get(this.resolvers, path);\n\t\n\t if (externalResolver) {\n\t dest = externalResolver.resolve(externalResolver.rootSchema);\n\t }\n\t }\n\t\n\t if (dest === undefined || typeof dest !== 'object') {\n\t if (this.missing$Ref) {\n\t dest = {};\n\t } else {\n\t throw err;\n\t }\n\t }\n\t\n\t if (this.cache[ref] === dest) {\n\t return dest;\n\t }\n\t\n\t this.cache[ref] = dest;\n\t\n\t if (dest.$ref !== undefined) {\n\t dest = this.resolve(dest);\n\t }\n\t\n\t return dest;\n\t};\n\t\n\tSchemaResolver.prototype.resolve = function (schema) {\n\t if (!schema || typeof schema !== 'object' || schema.$ref === undefined) {\n\t return schema;\n\t }\n\t\n\t var ref = this.getNormalizedRef(schema) || schema.$ref,\n\t resolved = this.cache[ref];\n\t\n\t if (resolved !== undefined) {\n\t return resolved;\n\t }\n\t\n\t if (this.refStack.indexOf(ref) > -1) {\n\t throw new Error(CIRCULAR_SCHEMA_REFERENCE + ' ' + ref);\n\t }\n\t\n\t this.refStack.push(ref);\n\t\n\t resolved = this._resolveRef(ref);\n\t\n\t this.refStack.pop();\n\t\n\t if (schema === this.rootSchema) {\n\t // cache the resolved root schema\n\t this.resolvedRootSchema = resolved;\n\t }\n\t\n\t return resolved;\n\t};\n\t\n\tSchemaResolver.prototype.hasRef = function (schema) {\n\t var keys = Object.keys(schema),\n\t len, key, i, hasChildRef;\n\t\n\t if (keys.indexOf('$ref') > -1) {\n\t return true;\n\t }\n\t\n\t for (i = 0, len = keys.length; i < len; i++) {\n\t key = keys[i];\n\t\n\t if (schema[key] && typeof schema[key] === 'object' && !Array.isArray(schema[key])) {\n\t hasChildRef = this.hasRef(schema[key]);\n\t\n\t if (hasChildRef) {\n\t return true;\n\t }\n\t }\n\t }\n\t\n\t return false;\n\t};\n\t\n\tSchemaResolver.resolvePointer = function (obj, pointer) {\n\t var descriptor = refToObj(pointer),\n\t path = descriptor.path;\n\t\n\t if (descriptor.base) {\n\t path = [descriptor.base].concat(path);\n\t }\n\t\n\t return get(obj, path);\n\t};\n\t\n\tmodule.exports = SchemaResolver;\n\n/***/ },\n/* 14 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t// Copyright Joyent, Inc. and other Node contributors.\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a\n\t// copy of this software and associated documentation files (the\n\t// \"Software\"), to deal in the Software without restriction, including\n\t// without limitation the rights to use, copy, modify, merge, publish,\n\t// distribute, sublicense, and/or sell copies of the Software, and to permit\n\t// persons to whom the Software is furnished to do so, subject to the\n\t// following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included\n\t// in all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n\t// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\t// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n\t// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n\t// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n\t// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n\t// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\t\n\tvar punycode = __webpack_require__(15);\n\t\n\texports.parse = urlParse;\n\texports.resolve = urlResolve;\n\texports.resolveObject = urlResolveObject;\n\texports.format = urlFormat;\n\t\n\texports.Url = Url;\n\t\n\tfunction Url() {\n\t this.protocol = null;\n\t this.slashes = null;\n\t this.auth = null;\n\t this.host = null;\n\t this.port = null;\n\t this.hostname = null;\n\t this.hash = null;\n\t this.search = null;\n\t this.query = null;\n\t this.pathname = null;\n\t this.path = null;\n\t this.href = null;\n\t}\n\t\n\t// Reference: RFC 3986, RFC 1808, RFC 2396\n\t\n\t// define these here so at least they only have to be\n\t// compiled once on the first module load.\n\tvar protocolPattern = /^([a-z0-9.+-]+:)/i,\n\t portPattern = /:[0-9]*$/,\n\t\n\t // RFC 2396: characters reserved for delimiting URLs.\n\t // We actually just auto-escape these.\n\t delims = ['<', '>', '\"', '`', ' ', '\\r', '\\n', '\\t'],\n\t\n\t // RFC 2396: characters not allowed for various reasons.\n\t unwise = ['{', '}', '|', '\\\\', '^', '`'].concat(delims),\n\t\n\t // Allowed by RFCs, but cause of XSS attacks. Always escape these.\n\t autoEscape = ['\\''].concat(unwise),\n\t // Characters that are never ever allowed in a hostname.\n\t // Note that any invalid chars are also handled, but these\n\t // are the ones that are *expected* to be seen, so we fast-path\n\t // them.\n\t nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape),\n\t hostEndingChars = ['/', '?', '#'],\n\t hostnameMaxLen = 255,\n\t hostnamePartPattern = /^[a-z0-9A-Z_-]{0,63}$/,\n\t hostnamePartStart = /^([a-z0-9A-Z_-]{0,63})(.*)$/,\n\t // protocols that can allow \"unsafe\" and \"unwise\" chars.\n\t unsafeProtocol = {\n\t 'javascript': true,\n\t 'javascript:': true\n\t },\n\t // protocols that never have a hostname.\n\t hostlessProtocol = {\n\t 'javascript': true,\n\t 'javascript:': true\n\t },\n\t // protocols that always contain a // bit.\n\t slashedProtocol = {\n\t 'http': true,\n\t 'https': true,\n\t 'ftp': true,\n\t 'gopher': true,\n\t 'file': true,\n\t 'http:': true,\n\t 'https:': true,\n\t 'ftp:': true,\n\t 'gopher:': true,\n\t 'file:': true\n\t },\n\t querystring = __webpack_require__(17);\n\t\n\tfunction urlParse(url, parseQueryString, slashesDenoteHost) {\n\t if (url && isObject(url) && url instanceof Url) return url;\n\t\n\t var u = new Url;\n\t u.parse(url, parseQueryString, slashesDenoteHost);\n\t return u;\n\t}\n\t\n\tUrl.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {\n\t if (!isString(url)) {\n\t throw new TypeError(\"Parameter 'url' must be a string, not \" + typeof url);\n\t }\n\t\n\t var rest = url;\n\t\n\t // trim before proceeding.\n\t // This is to support parse stuff like \" http://foo.com \\n\"\n\t rest = rest.trim();\n\t\n\t var proto = protocolPattern.exec(rest);\n\t if (proto) {\n\t proto = proto[0];\n\t var lowerProto = proto.toLowerCase();\n\t this.protocol = lowerProto;\n\t rest = rest.substr(proto.length);\n\t }\n\t\n\t // figure out if it's got a host\n\t // user@server is *always* interpreted as a hostname, and url\n\t // resolution will treat //foo/bar as host=foo,path=bar because that's\n\t // how the browser resolves relative URLs.\n\t if (slashesDenoteHost || proto || rest.match(/^\\/\\/[^@\\/]+@[^@\\/]+/)) {\n\t var slashes = rest.substr(0, 2) === '//';\n\t if (slashes && !(proto && hostlessProtocol[proto])) {\n\t rest = rest.substr(2);\n\t this.slashes = true;\n\t }\n\t }\n\t\n\t if (!hostlessProtocol[proto] &&\n\t (slashes || (proto && !slashedProtocol[proto]))) {\n\t\n\t // there's a hostname.\n\t // the first instance of /, ?, ;, or # ends the host.\n\t //\n\t // If there is an @ in the hostname, then non-host chars *are* allowed\n\t // to the left of the last @ sign, unless some host-ending character\n\t // comes *before* the @-sign.\n\t // URLs are obnoxious.\n\t //\n\t // ex:\n\t // http://a@b@c/ => user:a@b host:c\n\t // http://a@b?@c => user:a host:c path:/?@c\n\t\n\t // v0.12 TODO(isaacs): This is not quite how Chrome does things.\n\t // Review our test case against browsers more comprehensively.\n\t\n\t // find the first instance of any hostEndingChars\n\t var hostEnd = -1;\n\t for (var i = 0; i < hostEndingChars.length; i++) {\n\t var hec = rest.indexOf(hostEndingChars[i]);\n\t if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n\t hostEnd = hec;\n\t }\n\t\n\t // at this point, either we have an explicit point where the\n\t // auth portion cannot go past, or the last @ char is the decider.\n\t var auth, atSign;\n\t if (hostEnd === -1) {\n\t // atSign can be anywhere.\n\t atSign = rest.lastIndexOf('@');\n\t } else {\n\t // atSign must be in auth portion.\n\t // http://a@b/c@d => host:b auth:a path:/c@d\n\t atSign = rest.lastIndexOf('@', hostEnd);\n\t }\n\t\n\t // Now we have a portion which is definitely the auth.\n\t // Pull that off.\n\t if (atSign !== -1) {\n\t auth = rest.slice(0, atSign);\n\t rest = rest.slice(atSign + 1);\n\t this.auth = decodeURIComponent(auth);\n\t }\n\t\n\t // the host is the remaining to the left of the first non-host char\n\t hostEnd = -1;\n\t for (var i = 0; i < nonHostChars.length; i++) {\n\t var hec = rest.indexOf(nonHostChars[i]);\n\t if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n\t hostEnd = hec;\n\t }\n\t // if we still have not hit it, then the entire thing is a host.\n\t if (hostEnd === -1)\n\t hostEnd = rest.length;\n\t\n\t this.host = rest.slice(0, hostEnd);\n\t rest = rest.slice(hostEnd);\n\t\n\t // pull out port.\n\t this.parseHost();\n\t\n\t // we've indicated that there is a hostname,\n\t // so even if it's empty, it has to be present.\n\t this.hostname = this.hostname || '';\n\t\n\t // if hostname begins with [ and ends with ]\n\t // assume that it's an IPv6 address.\n\t var ipv6Hostname = this.hostname[0] === '[' &&\n\t this.hostname[this.hostname.length - 1] === ']';\n\t\n\t // validate a little.\n\t if (!ipv6Hostname) {\n\t var hostparts = this.hostname.split(/\\./);\n\t for (var i = 0, l = hostparts.length; i < l; i++) {\n\t var part = hostparts[i];\n\t if (!part) continue;\n\t if (!part.match(hostnamePartPattern)) {\n\t var newpart = '';\n\t for (var j = 0, k = part.length; j < k; j++) {\n\t if (part.charCodeAt(j) > 127) {\n\t // we replace non-ASCII char with a temporary placeholder\n\t // we need this to make sure size of hostname is not\n\t // broken by replacing non-ASCII by nothing\n\t newpart += 'x';\n\t } else {\n\t newpart += part[j];\n\t }\n\t }\n\t // we test again with ASCII char only\n\t if (!newpart.match(hostnamePartPattern)) {\n\t var validParts = hostparts.slice(0, i);\n\t var notHost = hostparts.slice(i + 1);\n\t var bit = part.match(hostnamePartStart);\n\t if (bit) {\n\t validParts.push(bit[1]);\n\t notHost.unshift(bit[2]);\n\t }\n\t if (notHost.length) {\n\t rest = '/' + notHost.join('.') + rest;\n\t }\n\t this.hostname = validParts.join('.');\n\t break;\n\t }\n\t }\n\t }\n\t }\n\t\n\t if (this.hostname.length > hostnameMaxLen) {\n\t this.hostname = '';\n\t } else {\n\t // hostnames are always lower case.\n\t this.hostname = this.hostname.toLowerCase();\n\t }\n\t\n\t if (!ipv6Hostname) {\n\t // IDNA Support: Returns a puny coded representation of \"domain\".\n\t // It only converts the part of the domain name that\n\t // has non ASCII characters. I.e. it dosent matter if\n\t // you call it with a domain that already is in ASCII.\n\t var domainArray = this.hostname.split('.');\n\t var newOut = [];\n\t for (var i = 0; i < domainArray.length; ++i) {\n\t var s = domainArray[i];\n\t newOut.push(s.match(/[^A-Za-z0-9_-]/) ?\n\t 'xn--' + punycode.encode(s) : s);\n\t }\n\t this.hostname = newOut.join('.');\n\t }\n\t\n\t var p = this.port ? ':' + this.port : '';\n\t var h = this.hostname || '';\n\t this.host = h + p;\n\t this.href += this.host;\n\t\n\t // strip [ and ] from the hostname\n\t // the host field still retains them, though\n\t if (ipv6Hostname) {\n\t this.hostname = this.hostname.substr(1, this.hostname.length - 2);\n\t if (rest[0] !== '/') {\n\t rest = '/' + rest;\n\t }\n\t }\n\t }\n\t\n\t // now rest is set to the post-host stuff.\n\t // chop off any delim chars.\n\t if (!unsafeProtocol[lowerProto]) {\n\t\n\t // First, make 100% sure that any \"autoEscape\" chars get\n\t // escaped, even if encodeURIComponent doesn't think they\n\t // need to be.\n\t for (var i = 0, l = autoEscape.length; i < l; i++) {\n\t var ae = autoEscape[i];\n\t var esc = encodeURIComponent(ae);\n\t if (esc === ae) {\n\t esc = escape(ae);\n\t }\n\t rest = rest.split(ae).join(esc);\n\t }\n\t }\n\t\n\t\n\t // chop off from the tail first.\n\t var hash = rest.indexOf('#');\n\t if (hash !== -1) {\n\t // got a fragment string.\n\t this.hash = rest.substr(hash);\n\t rest = rest.slice(0, hash);\n\t }\n\t var qm = rest.indexOf('?');\n\t if (qm !== -1) {\n\t this.search = rest.substr(qm);\n\t this.query = rest.substr(qm + 1);\n\t if (parseQueryString) {\n\t this.query = querystring.parse(this.query);\n\t }\n\t rest = rest.slice(0, qm);\n\t } else if (parseQueryString) {\n\t // no query string, but parseQueryString still requested\n\t this.search = '';\n\t this.query = {};\n\t }\n\t if (rest) this.pathname = rest;\n\t if (slashedProtocol[lowerProto] &&\n\t this.hostname && !this.pathname) {\n\t this.pathname = '/';\n\t }\n\t\n\t //to support http.request\n\t if (this.pathname || this.search) {\n\t var p = this.pathname || '';\n\t var s = this.search || '';\n\t this.path = p + s;\n\t }\n\t\n\t // finally, reconstruct the href based on what has been validated.\n\t this.href = this.format();\n\t return this;\n\t};\n\t\n\t// format a parsed object into a url string\n\tfunction urlFormat(obj) {\n\t // ensure it's an object, and not a string url.\n\t // If it's an obj, this is a no-op.\n\t // this way, you can call url_format() on strings\n\t // to clean up potentially wonky urls.\n\t if (isString(obj)) obj = urlParse(obj);\n\t if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n\t return obj.format();\n\t}\n\t\n\tUrl.prototype.format = function() {\n\t var auth = this.auth || '';\n\t if (auth) {\n\t auth = encodeURIComponent(auth);\n\t auth = auth.replace(/%3A/i, ':');\n\t auth += '@';\n\t }\n\t\n\t var protocol = this.protocol || '',\n\t pathname = this.pathname || '',\n\t hash = this.hash || '',\n\t host = false,\n\t query = '';\n\t\n\t if (this.host) {\n\t host = auth + this.host;\n\t } else if (this.hostname) {\n\t host = auth + (this.hostname.indexOf(':') === -1 ?\n\t this.hostname :\n\t '[' + this.hostname + ']');\n\t if (this.port) {\n\t host += ':' + this.port;\n\t }\n\t }\n\t\n\t if (this.query &&\n\t isObject(this.query) &&\n\t Object.keys(this.query).length) {\n\t query = querystring.stringify(this.query);\n\t }\n\t\n\t var search = this.search || (query && ('?' + query)) || '';\n\t\n\t if (protocol && protocol.substr(-1) !== ':') protocol += ':';\n\t\n\t // only the slashedProtocols get the //. Not mailto:, xmpp:, etc.\n\t // unless they had them to begin with.\n\t if (this.slashes ||\n\t (!protocol || slashedProtocol[protocol]) && host !== false) {\n\t host = '//' + (host || '');\n\t if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname;\n\t } else if (!host) {\n\t host = '';\n\t }\n\t\n\t if (hash && hash.charAt(0) !== '#') hash = '#' + hash;\n\t if (search && search.charAt(0) !== '?') search = '?' + search;\n\t\n\t pathname = pathname.replace(/[?#]/g, function(match) {\n\t return encodeURIComponent(match);\n\t });\n\t search = search.replace('#', '%23');\n\t\n\t return protocol + host + pathname + search + hash;\n\t};\n\t\n\tfunction urlResolve(source, relative) {\n\t return urlParse(source, false, true).resolve(relative);\n\t}\n\t\n\tUrl.prototype.resolve = function(relative) {\n\t return this.resolveObject(urlParse(relative, false, true)).format();\n\t};\n\t\n\tfunction urlResolveObject(source, relative) {\n\t if (!source) return relative;\n\t return urlParse(source, false, true).resolveObject(relative);\n\t}\n\t\n\tUrl.prototype.resolveObject = function(relative) {\n\t if (isString(relative)) {\n\t var rel = new Url();\n\t rel.parse(relative, false, true);\n\t relative = rel;\n\t }\n\t\n\t var result = new Url();\n\t Object.keys(this).forEach(function(k) {\n\t result[k] = this[k];\n\t }, this);\n\t\n\t // hash is always overridden, no matter what.\n\t // even href=\"\" will remove it.\n\t result.hash = relative.hash;\n\t\n\t // if the relative url is empty, then there's nothing left to do here.\n\t if (relative.href === '') {\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t // hrefs like //foo/bar always cut to the protocol.\n\t if (relative.slashes && !relative.protocol) {\n\t // take everything except the protocol from relative\n\t Object.keys(relative).forEach(function(k) {\n\t if (k !== 'protocol')\n\t result[k] = relative[k];\n\t });\n\t\n\t //urlParse appends trailing / to urls like http://www.example.com\n\t if (slashedProtocol[result.protocol] &&\n\t result.hostname && !result.pathname) {\n\t result.path = result.pathname = '/';\n\t }\n\t\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t if (relative.protocol && relative.protocol !== result.protocol) {\n\t // if it's a known url protocol, then changing\n\t // the protocol does weird things\n\t // first, if it's not file:, then we MUST have a host,\n\t // and if there was a path\n\t // to begin with, then we MUST have a path.\n\t // if it is file:, then the host is dropped,\n\t // because that's known to be hostless.\n\t // anything else is assumed to be absolute.\n\t if (!slashedProtocol[relative.protocol]) {\n\t Object.keys(relative).forEach(function(k) {\n\t result[k] = relative[k];\n\t });\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t result.protocol = relative.protocol;\n\t if (!relative.host && !hostlessProtocol[relative.protocol]) {\n\t var relPath = (relative.pathname || '').split('/');\n\t while (relPath.length && !(relative.host = relPath.shift()));\n\t if (!relative.host) relative.host = '';\n\t if (!relative.hostname) relative.hostname = '';\n\t if (relPath[0] !== '') relPath.unshift('');\n\t if (relPath.length < 2) relPath.unshift('');\n\t result.pathname = relPath.join('/');\n\t } else {\n\t result.pathname = relative.pathname;\n\t }\n\t result.search = relative.search;\n\t result.query = relative.query;\n\t result.host = relative.host || '';\n\t result.auth = relative.auth;\n\t result.hostname = relative.hostname || relative.host;\n\t result.port = relative.port;\n\t // to support http.request\n\t if (result.pathname || result.search) {\n\t var p = result.pathname || '';\n\t var s = result.search || '';\n\t result.path = p + s;\n\t }\n\t result.slashes = result.slashes || relative.slashes;\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'),\n\t isRelAbs = (\n\t relative.host ||\n\t relative.pathname && relative.pathname.charAt(0) === '/'\n\t ),\n\t mustEndAbs = (isRelAbs || isSourceAbs ||\n\t (result.host && relative.pathname)),\n\t removeAllDots = mustEndAbs,\n\t srcPath = result.pathname && result.pathname.split('/') || [],\n\t relPath = relative.pathname && relative.pathname.split('/') || [],\n\t psychotic = result.protocol && !slashedProtocol[result.protocol];\n\t\n\t // if the url is a non-slashed url, then relative\n\t // links like ../.. should be able\n\t // to crawl up to the hostname, as well. This is strange.\n\t // result.protocol has already been set by now.\n\t // Later on, put the first path part into the host field.\n\t if (psychotic) {\n\t result.hostname = '';\n\t result.port = null;\n\t if (result.host) {\n\t if (srcPath[0] === '') srcPath[0] = result.host;\n\t else srcPath.unshift(result.host);\n\t }\n\t result.host = '';\n\t if (relative.protocol) {\n\t relative.hostname = null;\n\t relative.port = null;\n\t if (relative.host) {\n\t if (relPath[0] === '') relPath[0] = relative.host;\n\t else relPath.unshift(relative.host);\n\t }\n\t relative.host = null;\n\t }\n\t mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === '');\n\t }\n\t\n\t if (isRelAbs) {\n\t // it's absolute.\n\t result.host = (relative.host || relative.host === '') ?\n\t relative.host : result.host;\n\t result.hostname = (relative.hostname || relative.hostname === '') ?\n\t relative.hostname : result.hostname;\n\t result.search = relative.search;\n\t result.query = relative.query;\n\t srcPath = relPath;\n\t // fall through to the dot-handling below.\n\t } else if (relPath.length) {\n\t // it's relative\n\t // throw away the existing file, and take the new path instead.\n\t if (!srcPath) srcPath = [];\n\t srcPath.pop();\n\t srcPath = srcPath.concat(relPath);\n\t result.search = relative.search;\n\t result.query = relative.query;\n\t } else if (!isNullOrUndefined(relative.search)) {\n\t // just pull out the search.\n\t // like href='https://github.com/?foo'.\n\t // Put this after the other two cases because it simplifies the booleans\n\t if (psychotic) {\n\t result.hostname = result.host = srcPath.shift();\n\t //occationaly the auth can get stuck only in host\n\t //this especialy happens in cases like\n\t //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n\t var authInHost = result.host && result.host.indexOf('@') > 0 ?\n\t result.host.split('@') : false;\n\t if (authInHost) {\n\t result.auth = authInHost.shift();\n\t result.host = result.hostname = authInHost.shift();\n\t }\n\t }\n\t result.search = relative.search;\n\t result.query = relative.query;\n\t //to support http.request\n\t if (!isNull(result.pathname) || !isNull(result.search)) {\n\t result.path = (result.pathname ? result.pathname : '') +\n\t (result.search ? result.search : '');\n\t }\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t if (!srcPath.length) {\n\t // no path at all. easy.\n\t // we've already handled the other stuff above.\n\t result.pathname = null;\n\t //to support http.request\n\t if (result.search) {\n\t result.path = '/' + result.search;\n\t } else {\n\t result.path = null;\n\t }\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t // if a url ENDs in . or .., then it must get a trailing slash.\n\t // however, if it ends in anything else non-slashy,\n\t // then it must NOT get a trailing slash.\n\t var last = srcPath.slice(-1)[0];\n\t var hasTrailingSlash = (\n\t (result.host || relative.host) && (last === '.' || last === '..') ||\n\t last === '');\n\t\n\t // strip single dots, resolve double dots to parent dir\n\t // if the path tries to go above the root, `up` ends up > 0\n\t var up = 0;\n\t for (var i = srcPath.length; i >= 0; i--) {\n\t last = srcPath[i];\n\t if (last == '.') {\n\t srcPath.splice(i, 1);\n\t } else if (last === '..') {\n\t srcPath.splice(i, 1);\n\t up++;\n\t } else if (up) {\n\t srcPath.splice(i, 1);\n\t up--;\n\t }\n\t }\n\t\n\t // if the path is allowed to go above the root, restore leading ..s\n\t if (!mustEndAbs && !removeAllDots) {\n\t for (; up--; up) {\n\t srcPath.unshift('..');\n\t }\n\t }\n\t\n\t if (mustEndAbs && srcPath[0] !== '' &&\n\t (!srcPath[0] || srcPath[0].charAt(0) !== '/')) {\n\t srcPath.unshift('');\n\t }\n\t\n\t if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) {\n\t srcPath.push('');\n\t }\n\t\n\t var isAbsolute = srcPath[0] === '' ||\n\t (srcPath[0] && srcPath[0].charAt(0) === '/');\n\t\n\t // put the host back\n\t if (psychotic) {\n\t result.hostname = result.host = isAbsolute ? '' :\n\t srcPath.length ? srcPath.shift() : '';\n\t //occationaly the auth can get stuck only in host\n\t //this especialy happens in cases like\n\t //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n\t var authInHost = result.host && result.host.indexOf('@') > 0 ?\n\t result.host.split('@') : false;\n\t if (authInHost) {\n\t result.auth = authInHost.shift();\n\t result.host = result.hostname = authInHost.shift();\n\t }\n\t }\n\t\n\t mustEndAbs = mustEndAbs || (result.host && srcPath.length);\n\t\n\t if (mustEndAbs && !isAbsolute) {\n\t srcPath.unshift('');\n\t }\n\t\n\t if (!srcPath.length) {\n\t result.pathname = null;\n\t result.path = null;\n\t } else {\n\t result.pathname = srcPath.join('/');\n\t }\n\t\n\t //to support request.http\n\t if (!isNull(result.pathname) || !isNull(result.search)) {\n\t result.path = (result.pathname ? result.pathname : '') +\n\t (result.search ? result.search : '');\n\t }\n\t result.auth = relative.auth || result.auth;\n\t result.slashes = result.slashes || relative.slashes;\n\t result.href = result.format();\n\t return result;\n\t};\n\t\n\tUrl.prototype.parseHost = function() {\n\t var host = this.host;\n\t var port = portPattern.exec(host);\n\t if (port) {\n\t port = port[0];\n\t if (port !== ':') {\n\t this.port = port.substr(1);\n\t }\n\t host = host.substr(0, host.length - port.length);\n\t }\n\t if (host) this.hostname = host;\n\t};\n\t\n\tfunction isString(arg) {\n\t return typeof arg === \"string\";\n\t}\n\t\n\tfunction isObject(arg) {\n\t return typeof arg === 'object' && arg !== null;\n\t}\n\t\n\tfunction isNull(arg) {\n\t return arg === null;\n\t}\n\tfunction isNullOrUndefined(arg) {\n\t return arg == null;\n\t}\n\n\n/***/ },\n/* 15 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(module, global) {/*! https://mths.be/punycode v1.3.2 by @mathias */\n\t;(function(root) {\n\t\n\t\t/** Detect free variables */\n\t\tvar freeExports = typeof exports == 'object' && exports &&\n\t\t\t!exports.nodeType && exports;\n\t\tvar freeModule = typeof module == 'object' && module &&\n\t\t\t!module.nodeType && module;\n\t\tvar freeGlobal = typeof global == 'object' && global;\n\t\tif (\n\t\t\tfreeGlobal.global === freeGlobal ||\n\t\t\tfreeGlobal.window === freeGlobal ||\n\t\t\tfreeGlobal.self === freeGlobal\n\t\t) {\n\t\t\troot = freeGlobal;\n\t\t}\n\t\n\t\t/**\n\t\t * The `punycode` object.\n\t\t * @name punycode\n\t\t * @type Object\n\t\t */\n\t\tvar punycode,\n\t\n\t\t/** Highest positive signed 32-bit float value */\n\t\tmaxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1\n\t\n\t\t/** Bootstring parameters */\n\t\tbase = 36,\n\t\ttMin = 1,\n\t\ttMax = 26,\n\t\tskew = 38,\n\t\tdamp = 700,\n\t\tinitialBias = 72,\n\t\tinitialN = 128, // 0x80\n\t\tdelimiter = '-', // '\\x2D'\n\t\n\t\t/** Regular expressions */\n\t\tregexPunycode = /^xn--/,\n\t\tregexNonASCII = /[^\\x20-\\x7E]/, // unprintable ASCII chars + non-ASCII chars\n\t\tregexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g, // RFC 3490 separators\n\t\n\t\t/** Error messages */\n\t\terrors = {\n\t\t\t'overflow': 'Overflow: input needs wider integers to process',\n\t\t\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t\t\t'invalid-input': 'Invalid input'\n\t\t},\n\t\n\t\t/** Convenience shortcuts */\n\t\tbaseMinusTMin = base - tMin,\n\t\tfloor = Math.floor,\n\t\tstringFromCharCode = String.fromCharCode,\n\t\n\t\t/** Temporary variable */\n\t\tkey;\n\t\n\t\t/*--------------------------------------------------------------------------*/\n\t\n\t\t/**\n\t\t * A generic error utility function.\n\t\t * @private\n\t\t * @param {String} type The error type.\n\t\t * @returns {Error} Throws a `RangeError` with the applicable error message.\n\t\t */\n\t\tfunction error(type) {\n\t\t\tthrow RangeError(errors[type]);\n\t\t}\n\t\n\t\t/**\n\t\t * A generic `Array#map` utility function.\n\t\t * @private\n\t\t * @param {Array} array The array to iterate over.\n\t\t * @param {Function} callback The function that gets called for every array\n\t\t * item.\n\t\t * @returns {Array} A new array of values returned by the callback function.\n\t\t */\n\t\tfunction map(array, fn) {\n\t\t\tvar length = array.length;\n\t\t\tvar result = [];\n\t\t\twhile (length--) {\n\t\t\t\tresult[length] = fn(array[length]);\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\n\t\t/**\n\t\t * A simple `Array#map`-like wrapper to work with domain name strings or email\n\t\t * addresses.\n\t\t * @private\n\t\t * @param {String} domain The domain name or email address.\n\t\t * @param {Function} callback The function that gets called for every\n\t\t * character.\n\t\t * @returns {Array} A new string of characters returned by the callback\n\t\t * function.\n\t\t */\n\t\tfunction mapDomain(string, fn) {\n\t\t\tvar parts = string.split('@');\n\t\t\tvar result = '';\n\t\t\tif (parts.length > 1) {\n\t\t\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t\t\t// the local part (i.e. everything up to `@`) intact.\n\t\t\t\tresult = parts[0] + '@';\n\t\t\t\tstring = parts[1];\n\t\t\t}\n\t\t\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\t\t\tstring = string.replace(regexSeparators, '\\x2E');\n\t\t\tvar labels = string.split('.');\n\t\t\tvar encoded = map(labels, fn).join('.');\n\t\t\treturn result + encoded;\n\t\t}\n\t\n\t\t/**\n\t\t * Creates an array containing the numeric code points of each Unicode\n\t\t * character in the string. While JavaScript uses UCS-2 internally,\n\t\t * this function will convert a pair of surrogate halves (each of which\n\t\t * UCS-2 exposes as separate characters) into a single code point,\n\t\t * matching UTF-16.\n\t\t * @see `punycode.ucs2.encode`\n\t\t * @see \n\t\t * @memberOf punycode.ucs2\n\t\t * @name decode\n\t\t * @param {String} string The Unicode input string (UCS-2).\n\t\t * @returns {Array} The new array of code points.\n\t\t */\n\t\tfunction ucs2decode(string) {\n\t\t\tvar output = [],\n\t\t\t counter = 0,\n\t\t\t length = string.length,\n\t\t\t value,\n\t\t\t extra;\n\t\t\twhile (counter < length) {\n\t\t\t\tvalue = string.charCodeAt(counter++);\n\t\t\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t\t\t// high surrogate, and there is a next character\n\t\t\t\t\textra = string.charCodeAt(counter++);\n\t\t\t\t\tif ((extra & 0xFC00) == 0xDC00) { // low surrogate\n\t\t\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// unmatched surrogate; only append this code unit, in case the next\n\t\t\t\t\t\t// code unit is the high surrogate of a surrogate pair\n\t\t\t\t\t\toutput.push(value);\n\t\t\t\t\t\tcounter--;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\toutput.push(value);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn output;\n\t\t}\n\t\n\t\t/**\n\t\t * Creates a string based on an array of numeric code points.\n\t\t * @see `punycode.ucs2.decode`\n\t\t * @memberOf punycode.ucs2\n\t\t * @name encode\n\t\t * @param {Array} codePoints The array of numeric code points.\n\t\t * @returns {String} The new Unicode string (UCS-2).\n\t\t */\n\t\tfunction ucs2encode(array) {\n\t\t\treturn map(array, function(value) {\n\t\t\t\tvar output = '';\n\t\t\t\tif (value > 0xFFFF) {\n\t\t\t\t\tvalue -= 0x10000;\n\t\t\t\t\toutput += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);\n\t\t\t\t\tvalue = 0xDC00 | value & 0x3FF;\n\t\t\t\t}\n\t\t\t\toutput += stringFromCharCode(value);\n\t\t\t\treturn output;\n\t\t\t}).join('');\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a basic code point into a digit/integer.\n\t\t * @see `digitToBasic()`\n\t\t * @private\n\t\t * @param {Number} codePoint The basic numeric code point value.\n\t\t * @returns {Number} The numeric value of a basic code point (for use in\n\t\t * representing integers) in the range `0` to `base - 1`, or `base` if\n\t\t * the code point does not represent a value.\n\t\t */\n\t\tfunction basicToDigit(codePoint) {\n\t\t\tif (codePoint - 48 < 10) {\n\t\t\t\treturn codePoint - 22;\n\t\t\t}\n\t\t\tif (codePoint - 65 < 26) {\n\t\t\t\treturn codePoint - 65;\n\t\t\t}\n\t\t\tif (codePoint - 97 < 26) {\n\t\t\t\treturn codePoint - 97;\n\t\t\t}\n\t\t\treturn base;\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a digit/integer into a basic code point.\n\t\t * @see `basicToDigit()`\n\t\t * @private\n\t\t * @param {Number} digit The numeric value of a basic code point.\n\t\t * @returns {Number} The basic code point whose value (when used for\n\t\t * representing integers) is `digit`, which needs to be in the range\n\t\t * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n\t\t * used; else, the lowercase form is used. The behavior is undefined\n\t\t * if `flag` is non-zero and `digit` has no uppercase form.\n\t\t */\n\t\tfunction digitToBasic(digit, flag) {\n\t\t\t// 0..25 map to ASCII a..z or A..Z\n\t\t\t// 26..35 map to ASCII 0..9\n\t\t\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n\t\t}\n\t\n\t\t/**\n\t\t * Bias adaptation function as per section 3.4 of RFC 3492.\n\t\t * http://tools.ietf.org/html/rfc3492#section-3.4\n\t\t * @private\n\t\t */\n\t\tfunction adapt(delta, numPoints, firstTime) {\n\t\t\tvar k = 0;\n\t\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\t\tdelta += floor(delta / numPoints);\n\t\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t\t}\n\t\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n\t\t * symbols.\n\t\t * @memberOf punycode\n\t\t * @param {String} input The Punycode string of ASCII-only symbols.\n\t\t * @returns {String} The resulting string of Unicode symbols.\n\t\t */\n\t\tfunction decode(input) {\n\t\t\t// Don't use UCS-2\n\t\t\tvar output = [],\n\t\t\t inputLength = input.length,\n\t\t\t out,\n\t\t\t i = 0,\n\t\t\t n = initialN,\n\t\t\t bias = initialBias,\n\t\t\t basic,\n\t\t\t j,\n\t\t\t index,\n\t\t\t oldi,\n\t\t\t w,\n\t\t\t k,\n\t\t\t digit,\n\t\t\t t,\n\t\t\t /** Cached calculation results */\n\t\t\t baseMinusT;\n\t\n\t\t\t// Handle the basic code points: let `basic` be the number of input code\n\t\t\t// points before the last delimiter, or `0` if there is none, then copy\n\t\t\t// the first basic code points to the output.\n\t\n\t\t\tbasic = input.lastIndexOf(delimiter);\n\t\t\tif (basic < 0) {\n\t\t\t\tbasic = 0;\n\t\t\t}\n\t\n\t\t\tfor (j = 0; j < basic; ++j) {\n\t\t\t\t// if it's not a basic code point\n\t\t\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\t\t\terror('not-basic');\n\t\t\t\t}\n\t\t\t\toutput.push(input.charCodeAt(j));\n\t\t\t}\n\t\n\t\t\t// Main decoding loop: start just after the last delimiter if any basic code\n\t\t\t// points were copied; start at the beginning otherwise.\n\t\n\t\t\tfor (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\t\n\t\t\t\t// `index` is the index of the next character to be consumed.\n\t\t\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t\t\t// which gets added to `i`. The overflow checking is easier\n\t\t\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t\t\t// value at the end to obtain `delta`.\n\t\t\t\tfor (oldi = i, w = 1, k = base; /* no condition */; k += base) {\n\t\n\t\t\t\t\tif (index >= inputLength) {\n\t\t\t\t\t\terror('invalid-input');\n\t\t\t\t\t}\n\t\n\t\t\t\t\tdigit = basicToDigit(input.charCodeAt(index++));\n\t\n\t\t\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\t\t\terror('overflow');\n\t\t\t\t\t}\n\t\n\t\t\t\t\ti += digit * w;\n\t\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\n\t\t\t\t\tif (digit < t) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tbaseMinusT = base - t;\n\t\t\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\t\t\terror('overflow');\n\t\t\t\t\t}\n\t\n\t\t\t\t\tw *= baseMinusT;\n\t\n\t\t\t\t}\n\t\n\t\t\t\tout = output.length + 1;\n\t\t\t\tbias = adapt(i - oldi, out, oldi == 0);\n\t\n\t\t\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t\t\t// incrementing `n` each time, so we'll fix that now:\n\t\t\t\tif (floor(i / out) > maxInt - n) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\t\n\t\t\t\tn += floor(i / out);\n\t\t\t\ti %= out;\n\t\n\t\t\t\t// Insert `n` at position `i` of the output\n\t\t\t\toutput.splice(i++, 0, n);\n\t\n\t\t\t}\n\t\n\t\t\treturn ucs2encode(output);\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a string of Unicode symbols (e.g. a domain name label) to a\n\t\t * Punycode string of ASCII-only symbols.\n\t\t * @memberOf punycode\n\t\t * @param {String} input The string of Unicode symbols.\n\t\t * @returns {String} The resulting Punycode string of ASCII-only symbols.\n\t\t */\n\t\tfunction encode(input) {\n\t\t\tvar n,\n\t\t\t delta,\n\t\t\t handledCPCount,\n\t\t\t basicLength,\n\t\t\t bias,\n\t\t\t j,\n\t\t\t m,\n\t\t\t q,\n\t\t\t k,\n\t\t\t t,\n\t\t\t currentValue,\n\t\t\t output = [],\n\t\t\t /** `inputLength` will hold the number of code points in `input`. */\n\t\t\t inputLength,\n\t\t\t /** Cached calculation results */\n\t\t\t handledCPCountPlusOne,\n\t\t\t baseMinusT,\n\t\t\t qMinusT;\n\t\n\t\t\t// Convert the input in UCS-2 to Unicode\n\t\t\tinput = ucs2decode(input);\n\t\n\t\t\t// Cache the length\n\t\t\tinputLength = input.length;\n\t\n\t\t\t// Initialize the state\n\t\t\tn = initialN;\n\t\t\tdelta = 0;\n\t\t\tbias = initialBias;\n\t\n\t\t\t// Handle the basic code points\n\t\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\t\tcurrentValue = input[j];\n\t\t\t\tif (currentValue < 0x80) {\n\t\t\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\thandledCPCount = basicLength = output.length;\n\t\n\t\t\t// `handledCPCount` is the number of code points that have been handled;\n\t\t\t// `basicLength` is the number of basic code points.\n\t\n\t\t\t// Finish the basic string - if it is not empty - with a delimiter\n\t\t\tif (basicLength) {\n\t\t\t\toutput.push(delimiter);\n\t\t\t}\n\t\n\t\t\t// Main encoding loop:\n\t\t\twhile (handledCPCount < inputLength) {\n\t\n\t\t\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t\t\t// larger one:\n\t\t\t\tfor (m = maxInt, j = 0; j < inputLength; ++j) {\n\t\t\t\t\tcurrentValue = input[j];\n\t\t\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\t\t\tm = currentValue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\t// Increase `delta` enough to advance the decoder's state to ,\n\t\t\t\t// but guard against overflow\n\t\t\t\thandledCPCountPlusOne = handledCPCount + 1;\n\t\t\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\t\n\t\t\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\t\t\tn = m;\n\t\n\t\t\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\t\t\tcurrentValue = input[j];\n\t\n\t\t\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\t\t\terror('overflow');\n\t\t\t\t\t}\n\t\n\t\t\t\t\tif (currentValue == n) {\n\t\t\t\t\t\t// Represent delta as a generalized variable-length integer\n\t\t\t\t\t\tfor (q = delta, k = base; /* no condition */; k += base) {\n\t\t\t\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tqMinusT = q - t;\n\t\t\t\t\t\t\tbaseMinusT = base - t;\n\t\t\t\t\t\t\toutput.push(\n\t\t\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\t\t\tdelta = 0;\n\t\t\t\t\t\t++handledCPCount;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\t++delta;\n\t\t\t\t++n;\n\t\n\t\t\t}\n\t\t\treturn output.join('');\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a Punycode string representing a domain name or an email address\n\t\t * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n\t\t * it doesn't matter if you call it on a string that has already been\n\t\t * converted to Unicode.\n\t\t * @memberOf punycode\n\t\t * @param {String} input The Punycoded domain name or email address to\n\t\t * convert to Unicode.\n\t\t * @returns {String} The Unicode representation of the given Punycode\n\t\t * string.\n\t\t */\n\t\tfunction toUnicode(input) {\n\t\t\treturn mapDomain(input, function(string) {\n\t\t\t\treturn regexPunycode.test(string)\n\t\t\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t\t\t: string;\n\t\t\t});\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a Unicode string representing a domain name or an email address to\n\t\t * Punycode. Only the non-ASCII parts of the domain name will be converted,\n\t\t * i.e. it doesn't matter if you call it with a domain that's already in\n\t\t * ASCII.\n\t\t * @memberOf punycode\n\t\t * @param {String} input The domain name or email address to convert, as a\n\t\t * Unicode string.\n\t\t * @returns {String} The Punycode representation of the given domain name or\n\t\t * email address.\n\t\t */\n\t\tfunction toASCII(input) {\n\t\t\treturn mapDomain(input, function(string) {\n\t\t\t\treturn regexNonASCII.test(string)\n\t\t\t\t\t? 'xn--' + encode(string)\n\t\t\t\t\t: string;\n\t\t\t});\n\t\t}\n\t\n\t\t/*--------------------------------------------------------------------------*/\n\t\n\t\t/** Define the public API */\n\t\tpunycode = {\n\t\t\t/**\n\t\t\t * A string representing the current Punycode.js version number.\n\t\t\t * @memberOf punycode\n\t\t\t * @type String\n\t\t\t */\n\t\t\t'version': '1.3.2',\n\t\t\t/**\n\t\t\t * An object of methods to convert from JavaScript's internal character\n\t\t\t * representation (UCS-2) to Unicode code points, and back.\n\t\t\t * @see \n\t\t\t * @memberOf punycode\n\t\t\t * @type Object\n\t\t\t */\n\t\t\t'ucs2': {\n\t\t\t\t'decode': ucs2decode,\n\t\t\t\t'encode': ucs2encode\n\t\t\t},\n\t\t\t'decode': decode,\n\t\t\t'encode': encode,\n\t\t\t'toASCII': toASCII,\n\t\t\t'toUnicode': toUnicode\n\t\t};\n\t\n\t\t/** Expose `punycode` */\n\t\t// Some AMD build optimizers, like r.js, check for specific condition patterns\n\t\t// like the following:\n\t\tif (\n\t\t\ttrue\n\t\t) {\n\t\t\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function() {\n\t\t\t\treturn punycode;\n\t\t\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t\t} else if (freeExports && freeModule) {\n\t\t\tif (module.exports == freeExports) { // in Node.js or RingoJS v0.8.0+\n\t\t\t\tfreeModule.exports = punycode;\n\t\t\t} else { // in Narwhal or RingoJS v0.7.0-\n\t\t\t\tfor (key in punycode) {\n\t\t\t\t\tpunycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]);\n\t\t\t\t}\n\t\t\t}\n\t\t} else { // in Rhino or a web browser\n\t\t\troot.punycode = punycode;\n\t\t}\n\t\n\t}(this));\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(16)(module), (function() { return this; }())))\n\n/***/ },\n/* 16 */\n/***/ function(module, exports) {\n\n\tmodule.exports = function(module) {\n\t\tif(!module.webpackPolyfill) {\n\t\t\tmodule.deprecate = function() {};\n\t\t\tmodule.paths = [];\n\t\t\t// module.parent = undefined by default\n\t\t\tmodule.children = [];\n\t\t\tmodule.webpackPolyfill = 1;\n\t\t}\n\t\treturn module;\n\t}\n\n\n/***/ },\n/* 17 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\texports.decode = exports.parse = __webpack_require__(18);\n\texports.encode = exports.stringify = __webpack_require__(19);\n\n\n/***/ },\n/* 18 */\n/***/ function(module, exports) {\n\n\t// Copyright Joyent, Inc. and other Node contributors.\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a\n\t// copy of this software and associated documentation files (the\n\t// \"Software\"), to deal in the Software without restriction, including\n\t// without limitation the rights to use, copy, modify, merge, publish,\n\t// distribute, sublicense, and/or sell copies of the Software, and to permit\n\t// persons to whom the Software is furnished to do so, subject to the\n\t// following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included\n\t// in all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n\t// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\t// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n\t// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n\t// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n\t// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n\t// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\t\n\t'use strict';\n\t\n\t// If obj.hasOwnProperty has been overridden, then calling\n\t// obj.hasOwnProperty(prop) will break.\n\t// See: https://github.com/joyent/node/issues/1707\n\tfunction hasOwnProperty(obj, prop) {\n\t return Object.prototype.hasOwnProperty.call(obj, prop);\n\t}\n\t\n\tmodule.exports = function(qs, sep, eq, options) {\n\t sep = sep || '&';\n\t eq = eq || '=';\n\t var obj = {};\n\t\n\t if (typeof qs !== 'string' || qs.length === 0) {\n\t return obj;\n\t }\n\t\n\t var regexp = /\\+/g;\n\t qs = qs.split(sep);\n\t\n\t var maxKeys = 1000;\n\t if (options && typeof options.maxKeys === 'number') {\n\t maxKeys = options.maxKeys;\n\t }\n\t\n\t var len = qs.length;\n\t // maxKeys <= 0 means that we should not limit keys count\n\t if (maxKeys > 0 && len > maxKeys) {\n\t len = maxKeys;\n\t }\n\t\n\t for (var i = 0; i < len; ++i) {\n\t var x = qs[i].replace(regexp, '%20'),\n\t idx = x.indexOf(eq),\n\t kstr, vstr, k, v;\n\t\n\t if (idx >= 0) {\n\t kstr = x.substr(0, idx);\n\t vstr = x.substr(idx + 1);\n\t } else {\n\t kstr = x;\n\t vstr = '';\n\t }\n\t\n\t k = decodeURIComponent(kstr);\n\t v = decodeURIComponent(vstr);\n\t\n\t if (!hasOwnProperty(obj, k)) {\n\t obj[k] = v;\n\t } else if (Array.isArray(obj[k])) {\n\t obj[k].push(v);\n\t } else {\n\t obj[k] = [obj[k], v];\n\t }\n\t }\n\t\n\t return obj;\n\t};\n\n\n/***/ },\n/* 19 */\n/***/ function(module, exports) {\n\n\t// Copyright Joyent, Inc. and other Node contributors.\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a\n\t// copy of this software and associated documentation files (the\n\t// \"Software\"), to deal in the Software without restriction, including\n\t// without limitation the rights to use, copy, modify, merge, publish,\n\t// distribute, sublicense, and/or sell copies of the Software, and to permit\n\t// persons to whom the Software is furnished to do so, subject to the\n\t// following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included\n\t// in all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n\t// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\t// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n\t// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n\t// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n\t// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n\t// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\t\n\t'use strict';\n\t\n\tvar stringifyPrimitive = function(v) {\n\t switch (typeof v) {\n\t case 'string':\n\t return v;\n\t\n\t case 'boolean':\n\t return v ? 'true' : 'false';\n\t\n\t case 'number':\n\t return isFinite(v) ? v : '';\n\t\n\t default:\n\t return '';\n\t }\n\t};\n\t\n\tmodule.exports = function(obj, sep, eq, name) {\n\t sep = sep || '&';\n\t eq = eq || '=';\n\t if (obj === null) {\n\t obj = undefined;\n\t }\n\t\n\t if (typeof obj === 'object') {\n\t return Object.keys(obj).map(function(k) {\n\t var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;\n\t if (Array.isArray(obj[k])) {\n\t return obj[k].map(function(v) {\n\t return ks + encodeURIComponent(stringifyPrimitive(v));\n\t }).join(sep);\n\t } else {\n\t return ks + encodeURIComponent(stringifyPrimitive(obj[k]));\n\t }\n\t }).join(sep);\n\t\n\t }\n\t\n\t if (!name) return '';\n\t return encodeURIComponent(stringifyPrimitive(name)) + eq +\n\t encodeURIComponent(stringifyPrimitive(obj));\n\t};\n\n\n/***/ },\n/* 20 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"id\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"description\": \"Core schema meta-schema\",\n\t\t\"definitions\": {\n\t\t\t\"schemaArray\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"minItems\": 1,\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"positiveInteger\": {\n\t\t\t\t\"type\": \"integer\",\n\t\t\t\t\"minimum\": 0\n\t\t\t},\n\t\t\t\"positiveIntegerDefault0\": {\n\t\t\t\t\"allOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#/definitions/positiveInteger\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"default\": 0\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"simpleTypes\": {\n\t\t\t\t\"enum\": [\n\t\t\t\t\t\"array\",\n\t\t\t\t\t\"boolean\",\n\t\t\t\t\t\"integer\",\n\t\t\t\t\t\"null\",\n\t\t\t\t\t\"number\",\n\t\t\t\t\t\"object\",\n\t\t\t\t\t\"string\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"stringArray\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t},\n\t\t\t\t\"minItems\": 1,\n\t\t\t\t\"uniqueItems\": true\n\t\t\t}\n\t\t},\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"id\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"uri\"\n\t\t\t},\n\t\t\t\"$schema\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"uri\"\n\t\t\t},\n\t\t\t\"title\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"description\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"default\": {},\n\t\t\t\"multipleOf\": {\n\t\t\t\t\"type\": \"number\",\n\t\t\t\t\"minimum\": 0,\n\t\t\t\t\"exclusiveMinimum\": true\n\t\t\t},\n\t\t\t\"maximum\": {\n\t\t\t\t\"type\": \"number\"\n\t\t\t},\n\t\t\t\"exclusiveMaximum\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"minimum\": {\n\t\t\t\t\"type\": \"number\"\n\t\t\t},\n\t\t\t\"exclusiveMinimum\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"maxLength\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveInteger\"\n\t\t\t},\n\t\t\t\"minLength\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveIntegerDefault0\"\n\t\t\t},\n\t\t\t\"pattern\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"regex\"\n\t\t\t},\n\t\t\t\"additionalItems\": {\n\t\t\t\t\"anyOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"boolean\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"items\": {\n\t\t\t\t\"anyOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#/definitions/schemaArray\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"maxItems\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveInteger\"\n\t\t\t},\n\t\t\t\"minItems\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveIntegerDefault0\"\n\t\t\t},\n\t\t\t\"uniqueItems\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"maxProperties\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveInteger\"\n\t\t\t},\n\t\t\t\"minProperties\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveIntegerDefault0\"\n\t\t\t},\n\t\t\t\"required\": {\n\t\t\t\t\"$ref\": \"#/definitions/stringArray\"\n\t\t\t},\n\t\t\t\"additionalProperties\": {\n\t\t\t\t\"anyOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"boolean\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"definitions\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": {\n\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t},\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"properties\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": {\n\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t},\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"patternProperties\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": {\n\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t},\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"dependencies\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": {\n\t\t\t\t\t\"anyOf\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"$ref\": \"#/definitions/stringArray\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"enum\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"minItems\": 1,\n\t\t\t\t\"uniqueItems\": true\n\t\t\t},\n\t\t\t\"type\": {\n\t\t\t\t\"anyOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#/definitions/simpleTypes\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"array\",\n\t\t\t\t\t\t\"items\": {\n\t\t\t\t\t\t\t\"$ref\": \"#/definitions/simpleTypes\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"minItems\": 1,\n\t\t\t\t\t\t\"uniqueItems\": true\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"allOf\": {\n\t\t\t\t\"$ref\": \"#/definitions/schemaArray\"\n\t\t\t},\n\t\t\t\"anyOf\": {\n\t\t\t\t\"$ref\": \"#/definitions/schemaArray\"\n\t\t\t},\n\t\t\t\"oneOf\": {\n\t\t\t\t\"$ref\": \"#/definitions/schemaArray\"\n\t\t\t},\n\t\t\t\"not\": {\n\t\t\t\t\"$ref\": \"#\"\n\t\t\t}\n\t\t},\n\t\t\"dependencies\": {\n\t\t\t\"exclusiveMaximum\": [\n\t\t\t\t\"maximum\"\n\t\t\t],\n\t\t\t\"exclusiveMinimum\": [\n\t\t\t\t\"minimum\"\n\t\t\t]\n\t\t},\n\t\t\"default\": {}\n\t};\n\n/***/ },\n/* 21 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tvar formats = {};\n\t\n\t// reference: http://dansnetwork.com/javascript-iso8601rfc3339-date-parser/\n\tformats['date-time'] = /(\\d\\d\\d\\d)(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))/;\n\t// reference: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js#L7\n\tformats.uri = /^([a-zA-Z][a-zA-Z0-9+-.]*:){0,1}\\/\\/[^\\s]*$/;\n\t// reference: http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363\n\t// http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'willful violation')\n\tformats.email = /^[a-zA-Z0-9.!#$%&'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n\t// reference: https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html\n\tformats.ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;\n\t// reference: http://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses\n\tformats.ipv6 = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|[fF][eE]80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::([fF]{4}(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;\n\t// reference: http://stackoverflow.com/questions/106179/regular-expression-to-match-dns-hostname-or-ip-address#answer-3824105\n\tformats.hostname = /^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])(\\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]))*$/;\n\t\n\tmodule.exports = formats;\n\n/***/ },\n/* 22 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\t// Reference: https://github.com/bestiejs/punycode.js/blob/master/punycode.js#L101`\n\t// Info: https://mathiasbynens.be/notes/javascript-unicode\n\tfunction ucs2length(string) {\n\t var ucs2len = 0,\n\t counter = 0,\n\t length = string.length,\n\t value, extra;\n\t\n\t while (counter < length) {\n\t ucs2len++;\n\t value = string.charCodeAt(counter++);\n\t\n\t if (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t // It's a high surrogate, and there is a next character.\n\t extra = string.charCodeAt(counter++);\n\t\n\t if ((extra & 0xFC00) !== 0xDC00) { /* Low surrogate. */ // jshint ignore: line\n\t counter--;\n\t }\n\t }\n\t }\n\t\n\t return ucs2len;\n\t}\n\t\n\tmodule.exports = ucs2length;\n\n/***/ }\n/******/ ])\n});\n;\n//# sourceMappingURL=models.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/powerbi-models/dist/models.js\n// module id = 5\n// module chunks = 0","import { IFilterable } from './ifilterable';\r\nimport { IReportNode } from './report';\r\nimport * as models from 'powerbi-models';\r\n\r\n/**\r\n * A Page node within a report hierarchy\r\n * \r\n * @export\r\n * @interface IPageNode\r\n */\r\nexport interface IPageNode {\r\n report: IReportNode;\r\n name: string;\r\n}\r\n\r\n/**\r\n * A Power BI report page\r\n * \r\n * @export\r\n * @class Page\r\n * @implements {IPageNode}\r\n * @implements {IFilterable}\r\n */\r\nexport class Page implements IPageNode, IFilterable {\r\n /**\r\n * The parent Power BI report that this page is a member of\r\n * \r\n * @type {IReportNode}\r\n */\r\n report: IReportNode;\r\n /**\r\n * The report page name\r\n * \r\n * @type {string}\r\n */\r\n name: string;\r\n\r\n /**\r\n * The user defined display name of the report page, which is undefined if the page is created manually\r\n * \r\n * @type {string}\r\n */\r\n displayName: string;\r\n\r\n /**\r\n * Creates an instance of a Power BI report page.\r\n * \r\n * @param {IReportNode} report\r\n * @param {string} name\r\n * @param {string} [displayName]\r\n */\r\n constructor(report: IReportNode, name: string, displayName?: string) {\r\n this.report = report;\r\n this.name = name;\r\n this.displayName = displayName;\r\n }\r\n\r\n /**\r\n * Gets all page level filters within the report.\r\n * \r\n * ```javascript\r\n * page.getFilters()\r\n * .then(pages => { ... });\r\n * ```\r\n * \r\n * @returns {(Promise)}\r\n */\r\n getFilters(): Promise {\r\n return this.report.service.hpm.get(`/report/pages/${this.name}/filters`, { uid: this.report.config.uniqueId }, this.report.iframe.contentWindow)\r\n .then(response => response.body,\r\n response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Removes all filters from this page of the report.\r\n * \r\n * ```javascript\r\n * page.removeFilters();\r\n * ```\r\n * \r\n * @returns {Promise}\r\n */\r\n removeFilters(): Promise {\r\n return this.setFilters([]);\r\n }\r\n\r\n /**\r\n * Makes the current page the active page of the report.\r\n * \r\n * ```javascripot\r\n * page.setActive();\r\n * ```\r\n * \r\n * @returns {Promise}\r\n */\r\n setActive(): Promise {\r\n const page: models.IPage = {\r\n name: this.name,\r\n displayName: null\r\n };\r\n\r\n return this.report.service.hpm.put('/report/pages/active', page, { uid: this.report.config.uniqueId }, this.report.iframe.contentWindow)\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Sets all filters on the current page.\r\n * \r\n * ```javascript\r\n * page.setFilters(filters);\r\n * .catch(errors => { ... });\r\n * ```\r\n * \r\n * @param {(models.IFilter[])} filters\r\n * @returns {Promise}\r\n */\r\n setFilters(filters: models.IFilter[]): Promise {\r\n return this.report.service.hpm.put(`/report/pages/${this.name}/filters`, filters, { uid: this.report.config.uniqueId }, this.report.iframe.contentWindow)\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/page.ts","import * as service from './service';\r\nimport * as embed from './embed';\r\nimport * as models from 'powerbi-models';\r\nimport * as wpmp from 'window-post-message-proxy';\r\nimport * as hpm from 'http-post-message';\r\nimport * as utils from './util';\r\n\r\n/**\r\n * A Dashboard node within a dashboard hierarchy\r\n * \r\n * @export\r\n * @interface IDashboardNode\r\n */\r\nexport interface IDashboardNode {\r\n iframe: HTMLIFrameElement;\r\n service: service.IService;\r\n config: embed.IInternalEmbedConfiguration\r\n}\r\n\r\n/**\r\n * A Power BI Dashboard embed component\r\n * \r\n * @export\r\n * @class Dashboard\r\n * @extends {embed.Embed}\r\n * @implements {IDashboardNode}\r\n * @implements {IFilterable}\r\n */\r\nexport class Dashboard extends embed.Embed implements IDashboardNode {\r\n static allowedEvents = [\"tileClicked\", \"error\"];\r\n static dashboardIdAttribute = 'powerbi-dashboard-id';\r\n static typeAttribute = 'powerbi-type';\r\n static type = \"Dashboard\";\r\n\r\n /**\r\n * Creates an instance of a Power BI Dashboard.\r\n * \r\n * @param {service.Service} service\r\n * @param {HTMLElement} element\r\n */\r\n constructor(service: service.Service, element: HTMLElement, config: embed.IEmbedConfiguration) {\r\n super(service, element, config);\r\n this.loadPath = \"/dashboard/load\";\r\n Array.prototype.push.apply(this.allowedEvents, Dashboard.allowedEvents);\r\n }\r\n\r\n /**\r\n * This adds backwards compatibility for older config which used the dashboardId query param to specify dashboard id.\r\n * E.g. https://powerbi-df.analysis-df.windows.net/dashboardEmbedHost?dashboardId=e9363c62-edb6-4eac-92d3-2199c5ca2a9e\r\n * \r\n * By extracting the id we can ensure id is always explicitly provided as part of the load configuration.\r\n * \r\n * @static\r\n * @param {string} url\r\n * @returns {string}\r\n */\r\n static findIdFromEmbedUrl(url: string): string {\r\n const dashboardIdRegEx = /dashboardId=\"?([^&]+)\"?/\r\n const dashboardIdMatch = url.match(dashboardIdRegEx);\r\n\r\n let dashboardId;\r\n if (dashboardIdMatch) {\r\n dashboardId = dashboardIdMatch[1];\r\n }\r\n\r\n return dashboardId;\r\n }\r\n\r\n /**\r\n * Get dashboard id from first available location: options, attribute, embed url.\r\n * \r\n * @returns {string}\r\n */\r\n getId(): string {\r\n const dashboardId = this.config.id || this.element.getAttribute(Dashboard.dashboardIdAttribute) || Dashboard.findIdFromEmbedUrl(this.config.embedUrl);\r\n\r\n if (typeof dashboardId !== 'string' || dashboardId.length === 0) {\r\n throw new Error(`Dashboard id is required, but it was not found. You must provide an id either as part of embed configuration or as attribute '${Dashboard.dashboardIdAttribute}'.`);\r\n }\r\n\r\n return dashboardId;\r\n }\r\n\r\n /**\r\n * Validate load configuration.\r\n */\r\n validate(config: models.IDashboardLoadConfiguration): models.IError[] {\r\n let error = models.validateDashboardLoad(config);\r\n return error ? error : this.ValidatePageView(config.pageView);\r\n }\r\n \r\n /**\r\n * Validate that pageView has a legal value: if page view is defined it must have one of the values defined in models.PageView\r\n */\r\n private ValidatePageView(pageView: models.PageView): models.IError[] {\r\n if (pageView && pageView !== \"fitToWidth\" && pageView !== \"oneColumn\" && pageView !== \"actualSize\") {\r\n return [{message: \"pageView must be one of the followings: fitToWidth, oneColumn, actualSize\"}];\r\n }\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/dashboard.ts","import * as models from 'powerbi-models';\r\nimport { Embed } from './embed';\r\n\r\n/**\r\n * The Power BI tile embed component\r\n * \r\n * @export\r\n * @class Tile\r\n * @extends {Embed}\r\n */\r\nexport class Tile extends Embed {\r\n static type = \"Tile\";\r\n\r\n /**\r\n * The ID of the tile\r\n * \r\n * @returns {string}\r\n */\r\n getId(): string {\r\n throw new Error('Not implemented. Embedding tiles is not supported yet.');\r\n }\r\n\r\n /**\r\n * Validate load configuration.\r\n */\r\n validate(config: any): models.IError[] {\r\n throw new Error('Not implemented. Embedding tiles is not supported yet.');\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/tile.ts","/**\r\n * TODO: Need to find better place for these factory functions or refactor how we handle dependency injection\r\n */\r\nimport { IHpmFactory, IWpmpFactory, IRouterFactory } from './service';\r\nimport config from './config';\r\nimport * as wpmp from 'window-post-message-proxy';\r\nimport * as hpm from 'http-post-message';\r\nimport * as router from 'powerbi-router';\r\n\r\nexport {\r\n IHpmFactory,\r\n IWpmpFactory,\r\n IRouterFactory\r\n};\r\n\r\nexport const hpmFactory: IHpmFactory = (wpmp, defaultTargetWindow, sdkVersion = config.version, sdkType = config.type) => {\r\n return new hpm.HttpPostMessage(wpmp, {\r\n 'x-sdk-type': sdkType,\r\n 'x-sdk-version': sdkVersion\r\n }, defaultTargetWindow);\r\n};\r\n\r\nexport const wpmpFactory: IWpmpFactory = (name?: string, logMessages?: boolean, eventSourceOverrideWindow?: Window) => {\r\n return new wpmp.WindowPostMessageProxy({\r\n processTrackingProperties: {\r\n addTrackingProperties: hpm.HttpPostMessage.addTrackingProperties,\r\n getTrackingProperties: hpm.HttpPostMessage.getTrackingProperties,\r\n },\r\n isErrorMessage: hpm.HttpPostMessage.isErrorMessage,\r\n name,\r\n logMessages,\r\n eventSourceOverrideWindow\r\n });\r\n};\r\n\r\nexport const routerFactory: IRouterFactory = (wpmp) => {\r\n return new router.Router(wpmp);\r\n};\n\n\n// WEBPACK FOOTER //\n// ./src/factories.ts","const config = {\r\n version: '2.2.3',\r\n type: 'js'\r\n};\r\n\r\nexport default config;\n\n\n// WEBPACK FOOTER //\n// ./src/config.ts","/*! window-post-message-proxy v0.2.4 | (c) 2016 Microsoft Corporation MIT */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"window-post-message-proxy\"] = factory();\n\telse\n\t\troot[\"window-post-message-proxy\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\tvar WindowPostMessageProxy = (function () {\n\t function WindowPostMessageProxy(options) {\n\t var _this = this;\n\t if (options === void 0) { options = {\n\t processTrackingProperties: {\n\t addTrackingProperties: WindowPostMessageProxy.defaultAddTrackingProperties,\n\t getTrackingProperties: WindowPostMessageProxy.defaultGetTrackingProperties\n\t },\n\t isErrorMessage: WindowPostMessageProxy.defaultIsErrorMessage,\n\t receiveWindow: window,\n\t name: WindowPostMessageProxy.createRandomString()\n\t }; }\n\t this.pendingRequestPromises = {};\n\t // save options with defaults\n\t this.addTrackingProperties = (options.processTrackingProperties && options.processTrackingProperties.addTrackingProperties) || WindowPostMessageProxy.defaultAddTrackingProperties;\n\t this.getTrackingProperties = (options.processTrackingProperties && options.processTrackingProperties.getTrackingProperties) || WindowPostMessageProxy.defaultGetTrackingProperties;\n\t this.isErrorMessage = options.isErrorMessage || WindowPostMessageProxy.defaultIsErrorMessage;\n\t this.receiveWindow = options.receiveWindow || window;\n\t this.name = options.name || WindowPostMessageProxy.createRandomString();\n\t this.logMessages = options.logMessages || false;\n\t this.eventSourceOverrideWindow = options.eventSourceOverrideWindow;\n\t this.suppressWarnings = options.suppressWarnings || false;\n\t if (this.logMessages) {\n\t console.log(\"new WindowPostMessageProxy created with name: \" + this.name + \" receiving on window: \" + this.receiveWindow.document.title);\n\t }\n\t // Initialize\n\t this.handlers = [];\n\t this.windowMessageHandler = function (event) { return _this.onMessageReceived(event); };\n\t this.start();\n\t }\n\t // Static\n\t WindowPostMessageProxy.defaultAddTrackingProperties = function (message, trackingProperties) {\n\t message[WindowPostMessageProxy.messagePropertyName] = trackingProperties;\n\t return message;\n\t };\n\t WindowPostMessageProxy.defaultGetTrackingProperties = function (message) {\n\t return message[WindowPostMessageProxy.messagePropertyName];\n\t };\n\t WindowPostMessageProxy.defaultIsErrorMessage = function (message) {\n\t return !!message.error;\n\t };\n\t /**\n\t * Utility to create a deferred object.\n\t */\n\t // TODO: Look to use RSVP library instead of doing this manually.\n\t // From what I searched RSVP would work better because it has .finally and .deferred; however, it doesn't have Typings information. \n\t WindowPostMessageProxy.createDeferred = function () {\n\t var deferred = {\n\t resolve: null,\n\t reject: null,\n\t promise: null\n\t };\n\t var promise = new Promise(function (resolve, reject) {\n\t deferred.resolve = resolve;\n\t deferred.reject = reject;\n\t });\n\t deferred.promise = promise;\n\t return deferred;\n\t };\n\t /**\n\t * Utility to generate random sequence of characters used as tracking id for promises.\n\t */\n\t WindowPostMessageProxy.createRandomString = function () {\n\t return (Math.random() + 1).toString(36).substring(7);\n\t };\n\t /**\n\t * Adds handler.\n\t * If the first handler whose test method returns true will handle the message and provide a response.\n\t */\n\t WindowPostMessageProxy.prototype.addHandler = function (handler) {\n\t this.handlers.push(handler);\n\t };\n\t /**\n\t * Removes handler.\n\t * The reference must match the original object that was provided when adding the handler.\n\t */\n\t WindowPostMessageProxy.prototype.removeHandler = function (handler) {\n\t var handlerIndex = this.handlers.indexOf(handler);\n\t if (handlerIndex === -1) {\n\t throw new Error(\"You attempted to remove a handler but no matching handler was found.\");\n\t }\n\t this.handlers.splice(handlerIndex, 1);\n\t };\n\t /**\n\t * Start listening to message events.\n\t */\n\t WindowPostMessageProxy.prototype.start = function () {\n\t this.receiveWindow.addEventListener('message', this.windowMessageHandler);\n\t };\n\t /**\n\t * Stops listening to message events.\n\t */\n\t WindowPostMessageProxy.prototype.stop = function () {\n\t this.receiveWindow.removeEventListener('message', this.windowMessageHandler);\n\t };\n\t /**\n\t * Post message to target window with tracking properties added and save deferred object referenced by tracking id.\n\t */\n\t WindowPostMessageProxy.prototype.postMessage = function (targetWindow, message) {\n\t // Add tracking properties to indicate message came from this proxy\n\t var trackingProperties = { id: WindowPostMessageProxy.createRandomString() };\n\t this.addTrackingProperties(message, trackingProperties);\n\t if (this.logMessages) {\n\t console.log(this.name + \" Posting message:\");\n\t console.log(JSON.stringify(message, null, ' '));\n\t }\n\t targetWindow.postMessage(message, \"*\");\n\t var deferred = WindowPostMessageProxy.createDeferred();\n\t this.pendingRequestPromises[trackingProperties.id] = deferred;\n\t return deferred.promise;\n\t };\n\t /**\n\t * Send response message to target window.\n\t * Response messages re-use tracking properties from a previous request message.\n\t */\n\t WindowPostMessageProxy.prototype.sendResponse = function (targetWindow, message, trackingProperties) {\n\t this.addTrackingProperties(message, trackingProperties);\n\t if (this.logMessages) {\n\t console.log(this.name + \" Sending response:\");\n\t console.log(JSON.stringify(message, null, ' '));\n\t }\n\t targetWindow.postMessage(message, \"*\");\n\t };\n\t /**\n\t * Message handler.\n\t */\n\t WindowPostMessageProxy.prototype.onMessageReceived = function (event) {\n\t var _this = this;\n\t if (this.logMessages) {\n\t console.log(this.name + \" Received message:\");\n\t console.log(\"type: \" + event.type);\n\t console.log(JSON.stringify(event.data, null, ' '));\n\t }\n\t var sendingWindow = this.eventSourceOverrideWindow || event.source;\n\t var message = event.data;\n\t if (typeof message !== \"object\") {\n\t if (!this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + this.name + \"): Received message that was not an object. Discarding message\");\n\t }\n\t return;\n\t }\n\t var trackingProperties;\n\t try {\n\t trackingProperties = this.getTrackingProperties(message);\n\t }\n\t catch (e) {\n\t if (!this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + this.name + \"): Error occurred when attempting to get tracking properties from incoming message:\", JSON.stringify(message, null, ' '), \"Error: \", e);\n\t }\n\t }\n\t var deferred;\n\t if (trackingProperties) {\n\t deferred = this.pendingRequestPromises[trackingProperties.id];\n\t }\n\t // If message does not have a known ID, treat it as a request\n\t // Otherwise, treat message as response\n\t if (!deferred) {\n\t var handled = this.handlers.some(function (handler) {\n\t var canMessageBeHandled = false;\n\t try {\n\t canMessageBeHandled = handler.test(message);\n\t }\n\t catch (e) {\n\t if (!_this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + _this.name + \"): Error occurred when handler was testing incoming message:\", JSON.stringify(message, null, ' '), \"Error: \", e);\n\t }\n\t }\n\t if (canMessageBeHandled) {\n\t var responseMessagePromise = void 0;\n\t try {\n\t responseMessagePromise = Promise.resolve(handler.handle(message));\n\t }\n\t catch (e) {\n\t if (!_this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + _this.name + \"): Error occurred when handler was processing incoming message:\", JSON.stringify(message, null, ' '), \"Error: \", e);\n\t }\n\t responseMessagePromise = Promise.resolve();\n\t }\n\t responseMessagePromise\n\t .then(function (responseMessage) {\n\t if (!responseMessage) {\n\t var warningMessage = \"Handler for message: \" + JSON.stringify(message, null, ' ') + \" did not return a response message. The default response message will be returned instead.\";\n\t if (!_this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + _this.name + \"): \" + warningMessage);\n\t }\n\t responseMessage = {\n\t warning: warningMessage\n\t };\n\t }\n\t _this.sendResponse(sendingWindow, responseMessage, trackingProperties);\n\t });\n\t return true;\n\t }\n\t });\n\t /**\n\t * TODO: Consider returning an error message if nothing handled the message.\n\t * In the case of the Report receiving messages all of them should be handled,\n\t * however, in the case of the SDK receiving messages it's likely it won't register handlers\n\t * for all events. Perhaps make this an option at construction time.\n\t */\n\t if (!handled && !this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + this.name + \") did not handle message. Handlers: \" + this.handlers.length + \" Message: \" + JSON.stringify(message, null, '') + \".\");\n\t }\n\t }\n\t else {\n\t /**\n\t * If error message reject promise,\n\t * Otherwise, resolve promise\n\t */\n\t var isErrorMessage = true;\n\t try {\n\t isErrorMessage = this.isErrorMessage(message);\n\t }\n\t catch (e) {\n\t console.warn(\"Proxy(\" + this.name + \") Error occurred when trying to determine if message is consider an error response. Message: \", JSON.stringify(message, null, ''), 'Error: ', e);\n\t }\n\t if (isErrorMessage) {\n\t deferred.reject(message);\n\t }\n\t else {\n\t deferred.resolve(message);\n\t }\n\t // TODO: Move to .finally clause up where promise is created for better maitenance like original proxy code.\n\t delete this.pendingRequestPromises[trackingProperties.id];\n\t }\n\t };\n\t WindowPostMessageProxy.messagePropertyName = \"windowPostMessageProxy\";\n\t return WindowPostMessageProxy;\n\t}());\n\texports.WindowPostMessageProxy = WindowPostMessageProxy;\n\n\n/***/ }\n/******/ ])\n});\n;\n//# sourceMappingURL=windowPostMessageProxy.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/window-post-message-proxy/dist/windowPostMessageProxy.js\n// module id = 11\n// module chunks = 0","/*! http-post-message v0.2.3 | (c) 2016 Microsoft Corporation MIT */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"http-post-message\"] = factory();\n\telse\n\t\troot[\"http-post-message\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\tvar HttpPostMessage = (function () {\n\t function HttpPostMessage(windowPostMessageProxy, defaultHeaders, defaultTargetWindow) {\n\t if (defaultHeaders === void 0) { defaultHeaders = {}; }\n\t this.defaultHeaders = defaultHeaders;\n\t this.defaultTargetWindow = defaultTargetWindow;\n\t this.windowPostMessageProxy = windowPostMessageProxy;\n\t }\n\t // TODO: See if it's possible to share tracking properties interface?\n\t // The responsibility of knowing how to configure windowPostMessageProxy for http should\n\t // live in this http class, but the configuration would need ITrackingProperties\n\t // interface which lives in WindowPostMessageProxy. Use type as workaround\n\t HttpPostMessage.addTrackingProperties = function (message, trackingProperties) {\n\t message.headers = message.headers || {};\n\t if (trackingProperties && trackingProperties.id) {\n\t message.headers.id = trackingProperties.id;\n\t }\n\t return message;\n\t };\n\t HttpPostMessage.getTrackingProperties = function (message) {\n\t return {\n\t id: message.headers && message.headers.id\n\t };\n\t };\n\t HttpPostMessage.isErrorMessage = function (message) {\n\t if (typeof (message && message.statusCode) !== 'number') {\n\t return false;\n\t }\n\t return !(200 <= message.statusCode && message.statusCode < 300);\n\t };\n\t HttpPostMessage.prototype.get = function (url, headers, targetWindow) {\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"GET\",\n\t url: url,\n\t headers: headers\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.post = function (url, body, headers, targetWindow) {\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"POST\",\n\t url: url,\n\t headers: headers,\n\t body: body\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.put = function (url, body, headers, targetWindow) {\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"PUT\",\n\t url: url,\n\t headers: headers,\n\t body: body\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.patch = function (url, body, headers, targetWindow) {\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"PATCH\",\n\t url: url,\n\t headers: headers,\n\t body: body\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.delete = function (url, body, headers, targetWindow) {\n\t if (body === void 0) { body = null; }\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"DELETE\",\n\t url: url,\n\t headers: headers,\n\t body: body\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.send = function (request, targetWindow) {\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t request.headers = this.assign({}, this.defaultHeaders, request.headers);\n\t if (!targetWindow) {\n\t throw new Error(\"target window is not provided. You must either provide the target window explicitly as argument to request, or specify default target window when constructing instance of this class.\");\n\t }\n\t return this.windowPostMessageProxy.postMessage(targetWindow, request);\n\t };\n\t /**\n\t * Object.assign() polyfill\n\t * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\n\t */\n\t HttpPostMessage.prototype.assign = function (target) {\n\t var sources = [];\n\t for (var _i = 1; _i < arguments.length; _i++) {\n\t sources[_i - 1] = arguments[_i];\n\t }\n\t if (target === undefined || target === null) {\n\t throw new TypeError('Cannot convert undefined or null to object');\n\t }\n\t var output = Object(target);\n\t sources.forEach(function (source) {\n\t if (source !== undefined && source !== null) {\n\t for (var nextKey in source) {\n\t if (Object.prototype.hasOwnProperty.call(source, nextKey)) {\n\t output[nextKey] = source[nextKey];\n\t }\n\t }\n\t }\n\t });\n\t return output;\n\t };\n\t return HttpPostMessage;\n\t}());\n\texports.HttpPostMessage = HttpPostMessage;\n\n\n/***/ }\n/******/ ])\n});\n;\n//# sourceMappingURL=httpPostMessage.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/http-post-message/dist/httpPostMessage.js\n// module id = 12\n// module chunks = 0","/*! powerbi-router v0.1.5 | (c) 2016 Microsoft Corporation MIT */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"powerbi-router\"] = factory();\n\telse\n\t\troot[\"powerbi-router\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar RouteRecognizer = __webpack_require__(1);\n\tvar Router = (function () {\n\t function Router(handlers) {\n\t this.handlers = handlers;\n\t /**\n\t * TODO: look at generating the router dynamically based on list of supported http methods\n\t * instead of hardcoding the creation of these and the methods.\n\t */\n\t this.getRouteRecognizer = new RouteRecognizer();\n\t this.patchRouteRecognizer = new RouteRecognizer();\n\t this.postRouteRecognizer = new RouteRecognizer();\n\t this.putRouteRecognizer = new RouteRecognizer();\n\t this.deleteRouteRecognizer = new RouteRecognizer();\n\t }\n\t Router.prototype.get = function (url, handler) {\n\t this.registerHandler(this.getRouteRecognizer, \"GET\", url, handler);\n\t return this;\n\t };\n\t Router.prototype.patch = function (url, handler) {\n\t this.registerHandler(this.patchRouteRecognizer, \"PATCH\", url, handler);\n\t return this;\n\t };\n\t Router.prototype.post = function (url, handler) {\n\t this.registerHandler(this.postRouteRecognizer, \"POST\", url, handler);\n\t return this;\n\t };\n\t Router.prototype.put = function (url, handler) {\n\t this.registerHandler(this.putRouteRecognizer, \"PUT\", url, handler);\n\t return this;\n\t };\n\t Router.prototype.delete = function (url, handler) {\n\t this.registerHandler(this.deleteRouteRecognizer, \"DELETE\", url, handler);\n\t return this;\n\t };\n\t /**\n\t * TODO: This method could use some refactoring. There is conflict of interest between keeping clean separation of test and handle method\n\t * Test method only returns boolean indicating if request can be handled, and handle method has opportunity to modify response and return promise of it.\n\t * In the case of the router with route-recognizer where handlers are associated with routes, this already guarantees that only one handler is selected and makes the test method feel complicated\n\t * Will leave as is an investigate cleaner ways at later time.\n\t */\n\t Router.prototype.registerHandler = function (routeRecognizer, method, url, handler) {\n\t var routeRecognizerHandler = function (request) {\n\t var response = new Response();\n\t return Promise.resolve(handler(request, response))\n\t .then(function (x) { return response; });\n\t };\n\t routeRecognizer.add([\n\t { path: url, handler: routeRecognizerHandler }\n\t ]);\n\t var internalHandler = {\n\t test: function (request) {\n\t if (request.method !== method) {\n\t return false;\n\t }\n\t var matchingRoutes = routeRecognizer.recognize(request.url);\n\t if (matchingRoutes === undefined) {\n\t return false;\n\t }\n\t /**\n\t * Copy parameters from recognized route to the request so they can be used within the handler function\n\t * This isn't ideal because it is side affect which modifies the request instead of strictly testing for true or false\n\t * but I don't see a better place to put this. If we move it between the call to test and the handle it becomes part of the window post message proxy\n\t * even though it's responsibility is related to routing.\n\t */\n\t var route = matchingRoutes[0];\n\t request.params = route.params;\n\t request.queryParams = matchingRoutes.queryParams;\n\t request.handler = route.handler;\n\t return true;\n\t },\n\t handle: function (request) {\n\t return request.handler(request);\n\t }\n\t };\n\t this.handlers.addHandler(internalHandler);\n\t };\n\t return Router;\n\t}());\n\texports.Router = Router;\n\tvar Response = (function () {\n\t function Response() {\n\t this.statusCode = 200;\n\t this.headers = {};\n\t this.body = null;\n\t }\n\t Response.prototype.send = function (statusCode, body) {\n\t this.statusCode = statusCode;\n\t this.body = body;\n\t };\n\t return Response;\n\t}());\n\texports.Response = Response;\n\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(module) {(function() {\n\t \"use strict\";\n\t function $$route$recognizer$dsl$$Target(path, matcher, delegate) {\n\t this.path = path;\n\t this.matcher = matcher;\n\t this.delegate = delegate;\n\t }\n\t\n\t $$route$recognizer$dsl$$Target.prototype = {\n\t to: function(target, callback) {\n\t var delegate = this.delegate;\n\t\n\t if (delegate && delegate.willAddRoute) {\n\t target = delegate.willAddRoute(this.matcher.target, target);\n\t }\n\t\n\t this.matcher.add(this.path, target);\n\t\n\t if (callback) {\n\t if (callback.length === 0) { throw new Error(\"You must have an argument in the function passed to `to`\"); }\n\t this.matcher.addChild(this.path, target, callback, this.delegate);\n\t }\n\t return this;\n\t }\n\t };\n\t\n\t function $$route$recognizer$dsl$$Matcher(target) {\n\t this.routes = {};\n\t this.children = {};\n\t this.target = target;\n\t }\n\t\n\t $$route$recognizer$dsl$$Matcher.prototype = {\n\t add: function(path, handler) {\n\t this.routes[path] = handler;\n\t },\n\t\n\t addChild: function(path, target, callback, delegate) {\n\t var matcher = new $$route$recognizer$dsl$$Matcher(target);\n\t this.children[path] = matcher;\n\t\n\t var match = $$route$recognizer$dsl$$generateMatch(path, matcher, delegate);\n\t\n\t if (delegate && delegate.contextEntered) {\n\t delegate.contextEntered(target, match);\n\t }\n\t\n\t callback(match);\n\t }\n\t };\n\t\n\t function $$route$recognizer$dsl$$generateMatch(startingPath, matcher, delegate) {\n\t return function(path, nestedCallback) {\n\t var fullPath = startingPath + path;\n\t\n\t if (nestedCallback) {\n\t nestedCallback($$route$recognizer$dsl$$generateMatch(fullPath, matcher, delegate));\n\t } else {\n\t return new $$route$recognizer$dsl$$Target(startingPath + path, matcher, delegate);\n\t }\n\t };\n\t }\n\t\n\t function $$route$recognizer$dsl$$addRoute(routeArray, path, handler) {\n\t var len = 0;\n\t for (var i=0; i z`. For instance, \"199\" is smaller\n\t // then \"200\", even though \"y\" and \"z\" (which are both 9) are larger than \"0\" (the value\n\t // of (`b` and `c`). This is because the leading symbol, \"2\", is larger than the other\n\t // leading symbol, \"1\".\n\t // The rule is that symbols to the left carry more weight than symbols to the right\n\t // when a number is written out as a string. In the above strings, the leading digit\n\t // represents how many 100's are in the number, and it carries more weight than the middle\n\t // number which represents how many 10's are in the number.\n\t // This system of number magnitude works well for route specificity, too. A route written as\n\t // `a/b/c` will be more specific than `x/y/z` as long as `a` is more specific than\n\t // `x`, irrespective of the other parts.\n\t // Because of this similarity, we assign each type of segment a number value written as a\n\t // string. We can find the specificity of compound routes by concatenating these strings\n\t // together, from left to right. After we have looped through all of the segments,\n\t // we convert the string to a number.\n\t specificity.val = '';\n\t\n\t for (var i=0; i 2 && key.slice(keyLength -2) === '[]') {\n\t isArray = true;\n\t key = key.slice(0, keyLength - 2);\n\t if(!queryParams[key]) {\n\t queryParams[key] = [];\n\t }\n\t }\n\t value = pair[1] ? $$route$recognizer$$decodeQueryParamPart(pair[1]) : '';\n\t }\n\t if (isArray) {\n\t queryParams[key].push(value);\n\t } else {\n\t queryParams[key] = value;\n\t }\n\t }\n\t return queryParams;\n\t },\n\t\n\t recognize: function(path) {\n\t var states = [ this.rootState ],\n\t pathLen, i, l, queryStart, queryParams = {},\n\t isSlashDropped = false;\n\t\n\t queryStart = path.indexOf('?');\n\t if (queryStart !== -1) {\n\t var queryString = path.substr(queryStart + 1, path.length);\n\t path = path.substr(0, queryStart);\n\t queryParams = this.parseQueryString(queryString);\n\t }\n\t\n\t path = decodeURI(path);\n\t\n\t if (path.charAt(0) !== \"/\") { path = \"/\" + path; }\n\t\n\t pathLen = path.length;\n\t if (pathLen > 1 && path.charAt(pathLen - 1) === \"/\") {\n\t path = path.substr(0, pathLen - 1);\n\t isSlashDropped = true;\n\t }\n\t\n\t for (i=0; i {\n type: string;\n id: string;\n name: string;\n value: T;\n}\n\nexport interface ICustomEvent extends CustomEvent {\n detail: T;\n}\n\nexport interface IEventHandler {\n (event: ICustomEvent): any;\n}\n\nexport interface IHpmFactory {\n (wpmp: wpmp.WindowPostMessageProxy, targetWindow?: Window, version?: string, type?: string, origin?: string): hpm.HttpPostMessage;\n}\n\nexport interface IWpmpFactory {\n (name?: string, logMessages?: boolean, eventSourceOverrideWindow?: Window): wpmp.WindowPostMessageProxy;\n}\n\nexport interface IRouterFactory {\n (wpmp: wpmp.WindowPostMessageProxy): router.Router;\n}\n\nexport interface IPowerBiElement extends HTMLElement {\n powerBiEmbed: embed.Embed;\n}\n\nexport interface IDebugOptions {\n logMessages?: boolean;\n wpmpName?: string;\n}\n\nexport interface IServiceConfiguration extends IDebugOptions {\n autoEmbedOnContentLoaded?: boolean;\n onError?: (error: any) => any;\n version?: string;\n type?: string;\n}\n\nexport interface IService {\n hpm: hpm.HttpPostMessage;\n}\n\n/**\n * The Power BI Service embed component, which is the entry point to embed all other Power BI components into your application\n * \n * @export\n * @class Service\n * @implements {IService}\n */\nexport class Service implements IService {\n\n /**\n * A list of components that this service can embed\n */\n private static components: (typeof Report | typeof Tile | typeof Dashboard)[] = [\n Tile,\n Report,\n Dashboard\n ];\n\n /**\n * The default configuration for the service\n */\n private static defaultConfig: IServiceConfiguration = {\n autoEmbedOnContentLoaded: false,\n onError: (...args) => console.log(args[0], args.slice(1))\n };\n\n /**\n * Gets or sets the access token as the global fallback token to use when a local token is not provided for a report or tile.\n * \n * @type {string}\n */\n accessToken: string;\n\n /**The Configuration object for the service*/\n private config: IServiceConfiguration;\n\n /** A list of Dashboard, Report and Tile components that have been embedded using this service instance. */\n private embeds: embed.Embed[];\n /** TODO: Look for way to make hpm private without sacraficing ease of maitenance. This should be private but in embed needs to call methods. */\n hpm: hpm.HttpPostMessage;\n /** TODO: Look for way to make wpmp private. This is only public to allow stopping the wpmp in tests */\n wpmp: wpmp.WindowPostMessageProxy;\n private router: router.Router;\n\n /**\n * Creates an instance of a Power BI Service.\n * \n * @param {IHpmFactory} hpmFactory The http post message factory used in the postMessage communication layer\n * @param {IWpmpFactory} wpmpFactory The window post message factory used in the postMessage communication layer\n * @param {IRouterFactory} routerFactory The router factory used in the postMessage communication layer\n * @param {IServiceConfiguration} [config={}]\n */\n constructor(hpmFactory: IHpmFactory, wpmpFactory: IWpmpFactory, routerFactory: IRouterFactory, config: IServiceConfiguration = {}) {\n this.wpmp = wpmpFactory(config.wpmpName, config.logMessages);\n this.hpm = hpmFactory(this.wpmp, null, config.version, config.type);\n this.router = routerFactory(this.wpmp);\n\n /**\n * Adds handler for report events.\n */\n this.router.post(`/reports/:uniqueId/events/:eventName`, (req, res) => {\n const event: IEvent = {\n type: 'report',\n id: req.params.uniqueId,\n name: req.params.eventName,\n value: req.body\n };\n\n this.handleEvent(event);\n });\n this.router.post(`/reports/:uniqueId/pages/:pageName/events/:eventName`, (req, res) => {\n const event: IEvent = {\n type: 'report',\n id: req.params.uniqueId,\n name: req.params.eventName,\n value: req.body\n };\n\n this.handleEvent(event);\n });\n\n this.router.post(`/dashboards/:uniqueId/events/:eventName`, (req, res) => {\n const event: IEvent = {\n type: 'dashboard',\n id: req.params.uniqueId,\n name: req.params.eventName,\n value: req.body\n };\n\n this.handleEvent(event);\n });\n\n this.embeds = [];\n\n // TODO: Change when Object.assign is available.\n this.config = utils.assign({}, Service.defaultConfig, config);\n\n if (this.config.autoEmbedOnContentLoaded) {\n this.enableAutoEmbed();\n }\n }\n\n /**\n * Creates new report\n * @param {HTMLElement} element\n * @param {embed.IEmbedConfiguration} [config={}]\n * @returns {embed.Embed}\n */\n createReport(element: HTMLElement, config: embed.IEmbedConfiguration): embed.Embed{\n config.type = 'create';\n let powerBiElement = element;\n const component = new create.Create(this, powerBiElement, config);\n powerBiElement.powerBiEmbed = component;\n this.embeds.push(component);\n\n return component;\n }\n\n /**\n * TODO: Add a description here\n * \n * @param {HTMLElement} [container]\n * @param {embed.IEmbedConfiguration} [config=undefined]\n * @returns {embed.Embed[]}\n */\n init(container?: HTMLElement, config: embed.IEmbedConfiguration = undefined): embed.Embed[] {\n container = (container && container instanceof HTMLElement) ? container : document.body;\n\n const elements = Array.prototype.slice.call(container.querySelectorAll(`[${embed.Embed.embedUrlAttribute}]`));\n return elements.map(element => this.embed(element, config));\n }\n\n /**\n * Given a configuration based on an HTML element,\n * if the component has already been created and attached to the element, reuses the component instance and existing iframe,\n * otherwise creates a new component instance.\n * \n * @param {HTMLElement} element\n * @param {embed.IEmbedConfiguration} [config={}]\n * @returns {embed.Embed}\n */\n embed(element: HTMLElement, config: embed.IEmbedConfiguration = {}): embed.Embed {\n let component: embed.Embed;\n let powerBiElement = element;\n\n if (powerBiElement.powerBiEmbed) {\n component = this.embedExisting(powerBiElement, config);\n }\n else {\n component = this.embedNew(powerBiElement, config);\n }\n\n return component;\n }\n\n /**\n * Given a configuration based on a Power BI element, saves the component instance that reference the element for later lookup.\n * \n * @private\n * @param {IPowerBiElement} element\n * @param {embed.IEmbedConfiguration} config\n * @returns {embed.Embed}\n */\n private embedNew(element: IPowerBiElement, config: embed.IEmbedConfiguration): embed.Embed {\n const componentType = config.type || element.getAttribute(embed.Embed.typeAttribute);\n if (!componentType) {\n throw new Error(`Attempted to embed using config ${JSON.stringify(config)} on element ${element.outerHTML}, but could not determine what type of component to embed. You must specify a type in the configuration or as an attribute such as '${embed.Embed.typeAttribute}=\"${Report.type.toLowerCase()}\"'.`);\n }\n\n // Saves the type as part of the configuration so that it can be referenced later at a known location.\n config.type = componentType;\n\n const Component = utils.find(component => componentType === component.type.toLowerCase(), Service.components);\n if (!Component) {\n throw new Error(`Attempted to embed component of type: ${componentType} but did not find any matching component. Please verify the type you specified is intended.`);\n }\n\n const component = new Component(this, element, config);\n element.powerBiEmbed = component;\n this.embeds.push(component);\n\n return component;\n }\n\n /**\n * Given an element that already contains an embed component, load with a new configuration.\n * \n * @private\n * @param {IPowerBiElement} element\n * @param {embed.IEmbedConfiguration} config\n * @returns {embed.Embed}\n */\n private embedExisting(element: IPowerBiElement, config: embed.IEmbedConfiguration): embed.Embed {\n const component = utils.find(x => x.element === element, this.embeds);\n if (!component) {\n throw new Error(`Attempted to embed using config ${JSON.stringify(config)} on element ${element.outerHTML} which already has embedded comopnent associated, but could not find the existing comopnent in the list of active components. This could indicate the embeds list is out of sync with the DOM, or the component is referencing the incorrect HTML element.`);\n }\n\n /**\n * TODO: Dynamic embed type switching could be supported but there is work needed to prepare the service state and DOM cleanup.\n * remove all event handlers from the DOM, then reset the element to initial state which removes iframe, and removes from list of embeds\n * then we can call the embedNew function which would allow setting the proper embedUrl and construction of object based on the new type.\n */\n if (typeof config.type === \"string\" && config.type !== component.config.type) {\n\n /**\n * When loading report after create we want to use existing Iframe ptimize load period\n */\n if(config.type === \"report\" && component.config.type === \"create\") {\n const report = new Report(this, element, config, element.powerBiEmbed.iframe);\n report.load(config);\n element.powerBiEmbed = report;\n this.embeds.pop();\n this.embeds.push(report);\n\n return report;\n }\n\n throw new Error(`Embedding on an existing element with a different type than the previous embed object is not supported. Attempted to embed using config ${JSON.stringify(config)} on element ${element.outerHTML}, but the existing element contains an embed of type: ${this.config.type} which does not match the new type: ${config.type}`);\n }\n\n component.load(config);\n\n return component;\n }\n\n /**\n * Adds an event handler for DOMContentLoaded, which searches the DOM for elements that have the 'powerbi-embed-url' attribute,\n * and automatically attempts to embed a powerbi component based on information from other powerbi-* attributes.\n *\n * Note: Only runs if `config.autoEmbedOnContentLoaded` is true when the service is created.\n * This handler is typically useful only for applications that are rendered on the server so that all required data is available when the handler is called.\n */\n enableAutoEmbed(): void {\n window.addEventListener('DOMContentLoaded', (event: Event) => this.init(document.body), false);\n }\n\n /**\n * Returns an instance of the component associated with the element.\n * \n * @param {HTMLElement} element\n * @returns {(Report | Tile)}\n */\n get(element: HTMLElement): Report | Tile | Dashboard {\n const powerBiElement = element;\n\n if (!powerBiElement.powerBiEmbed) {\n throw new Error(`You attempted to get an instance of powerbi component associated with element: ${element.outerHTML} but there was no associated instance.`);\n }\n\n return powerBiElement.powerBiEmbed;\n }\n\n /**\n * Finds an embed instance by the name or unique ID that is provided.\n * \n * @param {string} uniqueId\n * @returns {(Report | Tile)}\n */\n find(uniqueId: string): Report | Tile | Dashboard {\n return utils.find(x => x.config.uniqueId === uniqueId, this.embeds);\n }\n\n /**\n * Given an HTML element that has a component embedded within it, removes the component from the list of embedded components, removes the association between the element and the component, and removes the iframe.\n * \n * @param {HTMLElement} element\n * @returns {void}\n */\n reset(element: HTMLElement): void {\n const powerBiElement = element;\n\n if (!powerBiElement.powerBiEmbed) {\n return;\n }\n\n /** Removes the component from an internal list of components. */\n utils.remove(x => x === powerBiElement.powerBiEmbed, this.embeds);\n /** Deletes a property from the HTML element. */\n delete powerBiElement.powerBiEmbed;\n /** Removes the iframe from the element. */\n const iframe = element.querySelector('iframe');\n if (iframe) {\n iframe.remove();\n }\n }\n\n /**\n * Given an event object, finds the embed component with the matching type and ID, and invokes its handleEvent method with the event object.\n * \n * @private\n * @param {IEvent} event\n */\n private handleEvent(event: IEvent): void {\n const embed = utils.find(embed => {\n return (embed.config.type === event.type\n && embed.config.uniqueId === event.id);\n }, this.embeds);\n\n if (embed) {\n const value = event.value;\n\n if (event.name === 'pageChanged') {\n const pageKey = 'newPage';\n const page: models.IPage = value[pageKey];\n if (!page) {\n throw new Error(`Page model not found at 'event.value.${pageKey}'.`);\n }\n value[pageKey] = new Page(embed, page.name, page.displayName);\n }\n\n utils.raiseCustomEvent(embed.element, event.name, value);\n }\n }\n}\n\n\n// WEBPACK FOOTER //\n// ./src/service.ts","import * as utils from './util';\r\nimport * as service from './service';\r\nimport * as models from 'powerbi-models';\r\nimport * as hpm from 'http-post-message';\r\n\r\ndeclare global {\r\n interface Document {\r\n // Mozilla Fullscreen\r\n mozCancelFullScreen: Function;\r\n\r\n // Ms Fullscreen\r\n msExitFullscreen: Function;\r\n }\r\n\r\n interface HTMLIFrameElement {\r\n // Mozilla Fullscreen\r\n mozRequestFullScreen: Function;\r\n\r\n // Ms Fullscreen\r\n msRequestFullscreen: Function;\r\n }\r\n}\r\n\r\n// TODO: Re-use ILoadConfiguration interface to prevent duplicating properties.\r\n// Current issue is that they are optional when embedding since they can be specificed as attributes but they are required when loading.\r\n/**\r\n * Configuration settings for Power BI embed components\r\n * \r\n * @export\r\n * @interface IEmbedConfiguration\r\n */\r\nexport interface IEmbedConfiguration {\r\n type?: string;\r\n id?: string;\r\n uniqueId?: string;\r\n embedUrl?: string;\r\n accessToken?: string;\r\n settings?: models.ISettings;\r\n pageName?: string;\r\n filters?: models.IFilter[];\r\n pageView?: models.PageView;\r\n datasetId?: string;\r\n permissions?: models.Permissions;\r\n}\r\n\r\nexport interface IInternalEmbedConfiguration extends models.IReportLoadConfiguration {\r\n uniqueId: string;\r\n type: string;\r\n embedUrl: string;\r\n}\r\n\r\nexport interface IInternalEventHandler {\r\n test(event: service.IEvent): boolean;\r\n handle(event: service.ICustomEvent): void;\r\n}\r\n\r\n/**\r\n * Base class for all Power BI embed components\r\n * \r\n * @export\r\n * @abstract\r\n * @class Embed\r\n */\r\nexport abstract class Embed {\r\n static allowedEvents = [\"loaded\", \"saved\"];\r\n static accessTokenAttribute = 'powerbi-access-token';\r\n static embedUrlAttribute = 'powerbi-embed-url';\r\n static nameAttribute = 'powerbi-name';\r\n static typeAttribute = 'powerbi-type';\r\n static type: string;\r\n\r\n private static defaultSettings: models.ISettings = {\r\n filterPaneEnabled: true\r\n };\r\n\r\n allowedEvents = [];\r\n\r\n /**\r\n * Gets or sets the event handler registered for this embed component.\r\n * \r\n * @type {IInternalEventHandler[]}\r\n */\r\n eventHandlers: IInternalEventHandler[];\r\n\r\n /**\r\n * Gets or sets the Power BI embed service.\r\n * \r\n * @type {service.Service}\r\n */\r\n service: service.Service;\r\n\r\n /**\r\n * Gets or sets the HTML element that contains the Power BI embed component.\r\n * \r\n * @type {HTMLElement}\r\n */\r\n element: HTMLElement;\r\n\r\n /**\r\n * Gets or sets the HTML iframe element that renders the Power BI embed component.\r\n * \r\n * @type {HTMLIFrameElement}\r\n */\r\n iframe: HTMLIFrameElement;\r\n\r\n /**\r\n * Gets or sets the configuration settings for the Power BI embed component.\r\n * \r\n * @type {IInternalEmbedConfiguration}\r\n */\r\n config: IInternalEmbedConfiguration;\r\n\r\n /**\r\n * Gets or sets the configuration settings for creating report.\r\n * \r\n * @type {models.IReportCreateConfiguration}\r\n */\r\n createConfig: models.IReportCreateConfiguration;\r\n\r\n /**\r\n * Url used in the load request.\r\n */\r\n loadPath: string;\r\n\r\n /**\r\n * Creates an instance of Embed.\r\n * \r\n * Note: there is circular reference between embeds and the service, because\r\n * the service has a list of all embeds on the host page, and each embed has a reference to the service that created it.\r\n * \r\n * @param {service.Service} service\r\n * @param {HTMLElement} element\r\n * @param {IEmbedConfiguration} config\r\n */\r\n constructor(service: service.Service, element: HTMLElement, config: IEmbedConfiguration, iframe?: HTMLIFrameElement) {\r\n Array.prototype.push.apply(this.allowedEvents, Embed.allowedEvents);\r\n this.eventHandlers = [];\r\n this.service = service;\r\n this.element = element;\r\n this.iframe = iframe;\r\n\r\n // TODO: Change when Object.assign is available.\r\n const settings = utils.assign({}, Embed.defaultSettings, config.settings);\r\n this.config = utils.assign({ settings }, config);\r\n this.config.uniqueId = this.getUniqueId();\r\n\r\n if(config.type === 'create'){\r\n this.setEmbedForCreate(config);\r\n } else {\r\n this.setEmbedForLoad();\r\n }\r\n }\r\n\r\n /**\r\n * Sends createReport configuration data.\r\n * \r\n * ```javascript\r\n * createReport({\r\n * datasetId: '5dac7a4a-4452-46b3-99f6-a25915e0fe55',\r\n * accessToken: 'eyJ0eXA ... TaE2rTSbmg',\r\n * ```\r\n * \r\n * @param {models.IReportCreateConfiguration} config\r\n * @returns {Promise}\r\n */\r\n createReport(config: models.IReportCreateConfiguration): Promise {\r\n const errors = this.validate(config);\r\n if (errors) {\r\n throw errors;\r\n }\r\n \r\n return this.service.hpm.post(\"/report/create\", config, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n return response.body;\r\n },\r\n response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Saves Report.\r\n * \r\n * @returns {Promise}\r\n */\r\n save(): Promise {\r\n return this.service.hpm.post('/report/save', null, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n return response.body;\r\n })\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * SaveAs Report.\r\n * \r\n * @returns {Promise}\r\n */\r\n saveAs(saveAsParameters: models.ISaveAsParameters): Promise {\r\n return this.service.hpm.post('/report/saveAs', saveAsParameters, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n return response.body;\r\n })\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Sends load configuration data.\r\n * \r\n * ```javascript\r\n * report.load({\r\n * type: 'report',\r\n * id: '5dac7a4a-4452-46b3-99f6-a25915e0fe55',\r\n * accessToken: 'eyJ0eXA ... TaE2rTSbmg',\r\n * settings: {\r\n * navContentPaneEnabled: false\r\n * },\r\n * pageName: \"DefaultPage\",\r\n * filters: [\r\n * {\r\n * ... DefaultReportFilter ...\r\n * }\r\n * ]\r\n * })\r\n * .catch(error => { ... });\r\n * ```\r\n * \r\n * @param {models.ILoadConfiguration} config\r\n * @returns {Promise}\r\n */\r\n load(config: models.IReportLoadConfiguration | models.IDashboardLoadConfiguration): Promise {\r\n const errors = this.validate(config);\r\n if (errors) {\r\n throw errors;\r\n }\r\n\r\n return this.service.hpm.post(this.loadPath, config, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n utils.assign(this.config, config);\r\n return response.body;\r\n },\r\n response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Removes one or more event handlers from the list of handlers.\r\n * If a reference to the existing handle function is specified, remove the specific handler.\r\n * If the handler is not specified, remove all handlers for the event name specified.\r\n * \r\n * ```javascript\r\n * report.off('pageChanged')\r\n * \r\n * or \r\n * \r\n * const logHandler = function (event) {\r\n * console.log(event);\r\n * };\r\n * \r\n * report.off('pageChanged', logHandler);\r\n * ```\r\n * \r\n * @template T\r\n * @param {string} eventName\r\n * @param {service.IEventHandler} [handler]\r\n */\r\n off(eventName: string, handler?: service.IEventHandler): void {\r\n const fakeEvent: service.IEvent = { name: eventName, type: null, id: null, value: null };\r\n if (handler) {\r\n utils.remove(eventHandler => eventHandler.test(fakeEvent) && (eventHandler.handle === handler), this.eventHandlers);\r\n this.element.removeEventListener(eventName, handler);\r\n }\r\n else {\r\n const eventHandlersToRemove = this.eventHandlers\r\n .filter(eventHandler => eventHandler.test(fakeEvent));\r\n\r\n eventHandlersToRemove\r\n .forEach(eventHandlerToRemove => {\r\n utils.remove(eventHandler => eventHandler === eventHandlerToRemove, this.eventHandlers);\r\n this.element.removeEventListener(eventName, eventHandlerToRemove.handle);\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Adds an event handler for a specific event.\r\n * \r\n * ```javascript\r\n * report.on('pageChanged', (event) => {\r\n * console.log('PageChanged: ', event.page.name);\r\n * });\r\n * ```\r\n * \r\n * @template T\r\n * @param {string} eventName\r\n * @param {service.IEventHandler} handler\r\n */\r\n on(eventName: string, handler: service.IEventHandler): void {\r\n if (this.allowedEvents.indexOf(eventName) === -1) {\r\n throw new Error(`eventName is must be one of ${this.allowedEvents}. You passed: ${eventName}`);\r\n }\r\n\r\n this.eventHandlers.push({\r\n test: (event: service.IEvent) => event.name === eventName,\r\n handle: handler\r\n });\r\n\r\n this.element.addEventListener(eventName, handler)\r\n }\r\n\r\n /**\r\n * Reloads embed using existing configuration.\r\n * E.g. For reports this effectively clears all filters and makes the first page active which simulates resetting a report back to loaded state.\r\n * \r\n * ```javascript\r\n * report.reload();\r\n * ```\r\n */\r\n reload(): Promise {\r\n return this.load(this.config);\r\n }\r\n \r\n /**\r\n * Set accessToken.\r\n * \r\n * @returns {Promise}\r\n */\r\n setAccessToken(accessToken: string): Promise {\r\n return this.service.hpm.post('/report/token', accessToken, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n return response.body;\r\n })\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n \r\n /**\r\n * Gets an access token from the first available location: config, attribute, global.\r\n * \r\n * @private\r\n * @param {string} globalAccessToken\r\n * @returns {string}\r\n */\r\n private getAccessToken(globalAccessToken: string): string {\r\n const accessToken = this.config.accessToken || this.element.getAttribute(Embed.accessTokenAttribute) || globalAccessToken;\r\n\r\n if (!accessToken) {\r\n throw new Error(`No access token was found for element. You must specify an access token directly on the element using attribute '${Embed.accessTokenAttribute}' or specify a global token at: powerbi.accessToken.`);\r\n }\r\n\r\n return accessToken;\r\n }\r\n\r\n /**\r\n * Sets Embed for load\r\n * \r\n * @private\r\n * @param {}\r\n * @returns {void}\r\n */\r\n private setEmbedForLoad(): void {\r\n this.config.id = this.getId();\r\n this.config.accessToken = this.getAccessToken(this.service.accessToken);\r\n this.setIframe(true/*set EventListener to call load() on 'load' event*/);\r\n }\r\n \r\n /**\r\n * Sets Embed for create report\r\n * \r\n * @private\r\n * @param {IEmbedConfiguration} config\r\n * @returns {void}\r\n */\r\n private setEmbedForCreate(config: IEmbedConfiguration): void {\r\n this.createConfig = {\r\n datasetId: config.datasetId || this.getId(),\r\n accessToken: this.getAccessToken(this.service.accessToken)\r\n }\r\n\r\n this.setIframe(false/*set EventListener to call create() on 'load' event*/);\r\n }\r\n\r\n /**\r\n * Gets an embed url from the first available location: options, attribute.\r\n * \r\n * @private\r\n * @returns {string}\r\n */\r\n private getEmbedUrl(): string {\r\n const embedUrl = this.config.embedUrl || this.element.getAttribute(Embed.embedUrlAttribute);\r\n\r\n if (typeof embedUrl !== 'string' || embedUrl.length === 0) {\r\n throw new Error(`Embed Url is required, but it was not found. You must provide an embed url either as part of embed configuration or as attribute '${Embed.embedUrlAttribute}'.`);\r\n }\r\n\r\n return embedUrl;\r\n }\r\n\r\n /**\r\n * Gets a unique ID from the first available location: options, attribute.\r\n * If neither is provided generate a unique string.\r\n * \r\n * @private\r\n * @returns {string}\r\n */\r\n private getUniqueId(): string {\r\n return this.config.uniqueId || this.element.getAttribute(Embed.nameAttribute) || utils.createRandomString();\r\n }\r\n\r\n /**\r\n * Gets the report ID from the first available location: options, attribute.\r\n * \r\n * @abstract\r\n * @returns {string}\r\n */\r\n abstract getId(): string;\r\n\r\n /**\r\n * Requests the browser to render the component's iframe in fullscreen mode.\r\n */\r\n fullscreen(): void {\r\n const requestFullScreen = this.iframe.requestFullscreen || this.iframe.msRequestFullscreen || this.iframe.mozRequestFullScreen || this.iframe.webkitRequestFullscreen;\r\n requestFullScreen.call(this.iframe);\r\n }\r\n\r\n /**\r\n * Requests the browser to exit fullscreen mode.\r\n */\r\n exitFullscreen(): void {\r\n if (!this.isFullscreen(this.iframe)) {\r\n return;\r\n }\r\n\r\n const exitFullscreen = document.exitFullscreen || document.mozCancelFullScreen || document.webkitExitFullscreen || document.msExitFullscreen;\r\n exitFullscreen.call(document);\r\n }\r\n\r\n /**\r\n * Returns true if the iframe is rendered in fullscreen mode,\r\n * otherwise returns false.\r\n * \r\n * @private\r\n * @param {HTMLIFrameElement} iframe\r\n * @returns {boolean}\r\n */\r\n private isFullscreen(iframe: HTMLIFrameElement): boolean {\r\n const options = ['fullscreenElement', 'webkitFullscreenElement', 'mozFullscreenScreenElement', 'msFullscreenElement'];\r\n\r\n return options.some(option => document[option] === iframe);\r\n }\r\n \r\n /**\r\n * Validate load and create configuration.\r\n */\r\n abstract validate(config: models.IReportLoadConfiguration | models.IDashboardLoadConfiguration | models.IReportCreateConfiguration): models.IError[];\r\n\r\n /**\r\n * Sets Iframe for embed\r\n */\r\n private setIframe(isLoad: boolean): void {\r\n if(!this.iframe) {\r\n this.config.embedUrl = this.getEmbedUrl();\r\n const iframeHtml = ``;\r\n this.element.innerHTML = iframeHtml;\r\n this.iframe = this.element.childNodes[0];\r\n }\r\n\r\n if(isLoad){\r\n this.iframe.addEventListener('load', () => this.load(this.config), false);\r\n } else {\r\n this.iframe.addEventListener('load', () => this.createReport(this.createConfig), false);\r\n }\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/embed.ts","\r\n/**\r\n * Raises a custom event with event data on the specified HTML element.\r\n * \r\n * @export\r\n * @param {HTMLElement} element\r\n * @param {string} eventName\r\n * @param {*} eventData\r\n */\r\nexport function raiseCustomEvent(element: HTMLElement, eventName: string, eventData: any): void {\r\n let customEvent;\r\n if (typeof CustomEvent === 'function') {\r\n customEvent = new CustomEvent(eventName, {\r\n detail: eventData,\r\n bubbles: true,\r\n cancelable: true\r\n });\r\n } else {\r\n customEvent = document.createEvent('CustomEvent');\r\n customEvent.initCustomEvent(eventName, true, true, eventData);\r\n }\r\n\r\n element.dispatchEvent(customEvent);\r\n}\r\n\r\n/**\r\n * Finds the index of the first value in an array that matches the specified predicate.\r\n * \r\n * @export\r\n * @template T\r\n * @param {(x: T) => boolean} predicate\r\n * @param {T[]} xs\r\n * @returns {number}\r\n */\r\nexport function findIndex(predicate: (x: T) => boolean, xs: T[]): number {\r\n if (!Array.isArray(xs)) {\r\n throw new Error(`You attempted to call find with second parameter that was not an array. You passed: ${xs}`);\r\n }\r\n\r\n let index;\r\n xs.some((x, i) => {\r\n if (predicate(x)) {\r\n index = i;\r\n return true;\r\n }\r\n });\r\n\r\n return index;\r\n}\r\n\r\n/**\r\n * Finds the first value in an array that matches the specified predicate.\r\n * \r\n * @export\r\n * @template T\r\n * @param {(x: T) => boolean} predicate\r\n * @param {T[]} xs\r\n * @returns {T}\r\n */\r\nexport function find(predicate: (x: T) => boolean, xs: T[]): T {\r\n const index = findIndex(predicate, xs);\r\n return xs[index];\r\n}\r\n\r\nexport function remove(predicate: (x: T) => boolean, xs: T[]): void {\r\n const index = findIndex(predicate, xs);\r\n xs.splice(index, 1);\r\n}\r\n\r\n// See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\r\n// TODO: replace in favor of using polyfill\r\n/**\r\n * Copies the values of all enumerable properties from one or more source objects to a target object, and returns the target object.\r\n * \r\n * @export\r\n * @param {any} args\r\n * @returns\r\n */\r\nexport function assign(...args) {\r\n var target = args[0];\r\n\r\n 'use strict';\r\n if (target === undefined || target === null) {\r\n throw new TypeError('Cannot convert undefined or null to object');\r\n }\r\n\r\n var output = Object(target);\r\n for (var index = 1; index < arguments.length; index++) {\r\n var source = arguments[index];\r\n if (source !== undefined && source !== null) {\r\n for (var nextKey in source) {\r\n if (source.hasOwnProperty(nextKey)) {\r\n output[nextKey] = source[nextKey];\r\n }\r\n }\r\n }\r\n }\r\n return output;\r\n}\r\n\r\n/**\r\n * Generates a random 7 character string.\r\n * \r\n * @export\r\n * @returns {string}\r\n */\r\nexport function createRandomString(): string {\r\n return (Math.random() + 1).toString(36).substring(7);\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/util.ts","import * as service from './service';\nimport * as embed from './embed';\nimport * as models from 'powerbi-models';\nimport * as wpmp from 'window-post-message-proxy';\nimport * as hpm from 'http-post-message';\nimport * as utils from './util';\nimport { IFilterable } from './ifilterable';\nimport { IPageNode, Page } from './page';\n\n/**\n * A Report node within a report hierarchy\n * \n * @export\n * @interface IReportNode\n */\nexport interface IReportNode {\n iframe: HTMLIFrameElement;\n service: service.IService;\n config: embed.IInternalEmbedConfiguration\n}\n\n/**\n * The Power BI Report embed component\n * \n * @export\n * @class Report\n * @extends {embed.Embed}\n * @implements {IReportNode}\n * @implements {IFilterable}\n */\nexport class Report extends embed.Embed implements IReportNode, IFilterable {\n static allowedEvents = [\"rendered\", \"dataSelected\", \"filtersApplied\", \"pageChanged\", \"error\", \"saved\"];\n static reportIdAttribute = 'powerbi-report-id';\n static filterPaneEnabledAttribute = 'powerbi-settings-filter-pane-enabled';\n static navContentPaneEnabledAttribute = 'powerbi-settings-nav-content-pane-enabled';\n static typeAttribute = 'powerbi-type';\n static type = \"Report\";\n\n /**\n * Creates an instance of a Power BI Report.\n * \n * @param {service.Service} service\n * @param {HTMLElement} element\n * @param {embed.IEmbedConfiguration} config\n */\n constructor(service: service.Service, element: HTMLElement, config: embed.IEmbedConfiguration, iframe?: HTMLIFrameElement) {\n const filterPaneEnabled = (config.settings && config.settings.filterPaneEnabled) || !(element.getAttribute(Report.filterPaneEnabledAttribute) === \"false\");\n const navContentPaneEnabled = (config.settings && config.settings.navContentPaneEnabled) || !(element.getAttribute(Report.navContentPaneEnabledAttribute) === \"false\");\n const settings = utils.assign({\n filterPaneEnabled,\n navContentPaneEnabled\n }, config.settings);\n const configCopy = utils.assign({ settings }, config);\n\n super(service, element, configCopy, iframe);\n this.loadPath = \"/report/load\";\n Array.prototype.push.apply(this.allowedEvents, Report.allowedEvents);\n }\n\n /**\n * Adds backwards compatibility for the previous load configuration, which used the reportId query parameter to specify the report ID\n * (e.g. http://embedded.powerbi.com/appTokenReportEmbed?reportId=854846ed-2106-4dc2-bc58-eb77533bf2f1).\n * \n * By extracting the ID we can ensure that the ID is always explicitly provided as part of the load configuration.\n * \n * @static\n * @param {string} url\n * @returns {string}\n */\n static findIdFromEmbedUrl(url: string): string {\n const reportIdRegEx = /reportId=\"?([^&]+)\"?/\n const reportIdMatch = url.match(reportIdRegEx);\n\n let reportId;\n if (reportIdMatch) {\n reportId = reportIdMatch[1];\n }\n\n return reportId;\n }\n\n /**\n * Gets filters that are applied at the report level.\n * \n * ```javascript\n * // Get filters applied at report level\n * report.getFilters()\n * .then(filters => {\n * ...\n * });\n * ```\n * \n * @returns {Promise}\n */\n getFilters(): Promise {\n return this.service.hpm.get(`/report/filters`, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .then(response => response.body,\n response => {\n throw response.body;\n });\n }\n\n /**\n * Gets the report ID from the first available location: options, attribute, embed url.\n * \n * @returns {string}\n */\n getId(): string {\n const reportId = this.config.id || this.element.getAttribute(Report.reportIdAttribute) || Report.findIdFromEmbedUrl(this.config.embedUrl);\n\n if (typeof reportId !== 'string' || reportId.length === 0) {\n throw new Error(`Report id is required, but it was not found. You must provide an id either as part of embed configuration or as attribute '${Report.reportIdAttribute}'.`);\n }\n\n return reportId;\n }\n\n /**\n * Gets the list of pages within the report.\n * \n * ```javascript\n * report.getPages()\n * .then(pages => {\n * ...\n * });\n * ```\n * \n * @returns {Promise}\n */\n getPages(): Promise {\n return this.service.hpm.get('/report/pages', { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .then(response => {\n return response.body\n .map(page => {\n return new Page(this, page.name, page.displayName);\n });\n }, response => {\n throw response.body;\n });\n }\n\n /**\n * Creates an instance of a Page.\n * \n * Normally you would get Page objects by calling `report.getPages()`, but in the case\n * that the page name is known and you want to perform an action on a page without having to retrieve it\n * you can create it directly.\n * \n * Note: Because you are creating the page manually there is no guarantee that the page actually exists in the report, and subsequent requests could fail.\n * \n * ```javascript\n * const page = report.page('ReportSection1');\n * page.setActive();\n * ```\n * \n * @param {string} name\n * @param {string} [displayName]\n * @returns {Page}\n */\n page(name: string, displayName?: string): Page {\n return new Page(this, name, displayName);\n }\n\n /**\n * Prints the active page of the report by invoking `window.print()` on the embed iframe component.\n */\n print(): Promise {\n return this.service.hpm.post('/report/print', null, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .then(response => {\n return response.body;\n })\n .catch(response => {\n throw response.body;\n });\n }\n\n /**\n * Removes all filters at the report level.\n * \n * ```javascript\n * report.removeFilters();\n * ```\n * \n * @returns {Promise}\n */\n removeFilters(): Promise {\n return this.setFilters([]);\n }\n\n /**\n * Sets the active page of the report.\n * \n * ```javascript\n * report.setPage(\"page2\")\n * .catch(error => { ... });\n * ```\n * \n * @param {string} pageName\n * @returns {Promise}\n */\n setPage(pageName: string): Promise {\n const page: models.IPage = {\n name: pageName,\n displayName: null\n };\n\n return this.service.hpm.put('/report/pages/active', page, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .catch(response => {\n throw response.body;\n });\n }\n\n /**\n * Sets filters at the report level.\n * \n * ```javascript\n * const filters: [\n * ...\n * ];\n * \n * report.setFilters(filters)\n * .catch(errors => {\n * ...\n * });\n * ```\n * \n * @param {(models.IFilter[])} filters\n * @returns {Promise}\n */\n setFilters(filters: models.IFilter[]): Promise {\n return this.service.hpm.put(`/report/filters`, filters, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .catch(response => {\n throw response.body;\n });\n }\n\n /**\n * Updates visibility settings for the filter pane and the page navigation pane.\n * \n * ```javascript\n * const newSettings = {\n * navContentPaneEnabled: true,\n * filterPaneEnabled: false\n * };\n * \n * report.updateSettings(newSettings)\n * .catch(error => { ... });\n * ```\n * \n * @param {models.ISettings} settings\n * @returns {Promise}\n */\n updateSettings(settings: models.ISettings): Promise {\n return this.service.hpm.patch('/report/settings', settings, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .catch(response => {\n throw response.body;\n });\n }\n\n /**\n * Validate load configuration.\n */\n validate(config: models.IReportLoadConfiguration): models.IError[] {\n return models.validateReportLoad(config);\n }\n\n /**\n * Switch Report view mode.\n * \n * @returns {Promise}\n */\n switchMode(viewMode: string): Promise {\n let url = '/report/switchMode/' + viewMode;\n return this.service.hpm.post(url, null, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .then(response => {\n return response.body;\n })\n .catch(response => {\n throw response.body;\n });\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/report.ts","/*! powerbi-models v0.10.4 | (c) 2016 Microsoft Corporation MIT */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"powerbi-models\"] = factory();\n\telse\n\t\troot[\"powerbi-models\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __extends = (this && this.__extends) || function (d, b) {\r\n\t for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\r\n\t function __() { this.constructor = d; }\r\n\t d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n\t};\r\n\t/* tslint:disable:no-var-requires */\r\n\texports.advancedFilterSchema = __webpack_require__(1);\r\n\texports.filterSchema = __webpack_require__(2);\r\n\texports.loadSchema = __webpack_require__(3);\r\n\texports.dashboardLoadSchema = __webpack_require__(4);\r\n\texports.pageSchema = __webpack_require__(5);\r\n\texports.settingsSchema = __webpack_require__(6);\r\n\texports.basicFilterSchema = __webpack_require__(7);\r\n\texports.createReportSchema = __webpack_require__(8);\r\n\texports.saveAsParametersSchema = __webpack_require__(9);\r\n\t/* tslint:enable:no-var-requires */\r\n\tvar jsen = __webpack_require__(10);\r\n\tfunction normalizeError(error) {\r\n\t var message = error.message;\r\n\t if (!message) {\r\n\t message = error.path + \" is invalid. Not meeting \" + error.keyword + \" constraint\";\r\n\t }\r\n\t return {\r\n\t message: message\r\n\t };\r\n\t}\r\n\t/**\r\n\t * Takes in schema and returns function which can be used to validate the schema with better semantics around exposing errors\r\n\t */\r\n\tfunction validate(schema, options) {\r\n\t return function (x) {\r\n\t var validate = jsen(schema, options);\r\n\t var isValid = validate(x);\r\n\t if (isValid) {\r\n\t return undefined;\r\n\t }\r\n\t else {\r\n\t return validate.errors\r\n\t .map(normalizeError);\r\n\t }\r\n\t };\r\n\t}\r\n\texports.validateSettings = validate(exports.settingsSchema, {\r\n\t schemas: {\r\n\t basicFilter: exports.basicFilterSchema,\r\n\t advancedFilter: exports.advancedFilterSchema\r\n\t }\r\n\t});\r\n\texports.validateReportLoad = validate(exports.loadSchema, {\r\n\t schemas: {\r\n\t settings: exports.settingsSchema,\r\n\t basicFilter: exports.basicFilterSchema,\r\n\t advancedFilter: exports.advancedFilterSchema\r\n\t }\r\n\t});\r\n\texports.validateCreateReport = validate(exports.createReportSchema);\r\n\texports.validateDashboardLoad = validate(exports.dashboardLoadSchema);\r\n\texports.validatePage = validate(exports.pageSchema);\r\n\texports.validateFilter = validate(exports.filterSchema, {\r\n\t schemas: {\r\n\t basicFilter: exports.basicFilterSchema,\r\n\t advancedFilter: exports.advancedFilterSchema\r\n\t }\r\n\t});\r\n\t(function (FilterType) {\r\n\t FilterType[FilterType[\"Advanced\"] = 0] = \"Advanced\";\r\n\t FilterType[FilterType[\"Basic\"] = 1] = \"Basic\";\r\n\t FilterType[FilterType[\"Unknown\"] = 2] = \"Unknown\";\r\n\t})(exports.FilterType || (exports.FilterType = {}));\r\n\tvar FilterType = exports.FilterType;\r\n\tfunction isFilterKeyColumnsTarget(target) {\r\n\t return isColumn(target) && !!target.keys;\r\n\t}\r\n\texports.isFilterKeyColumnsTarget = isFilterKeyColumnsTarget;\r\n\tfunction isBasicFilterWithKeys(filter) {\r\n\t return getFilterType(filter) === FilterType.Basic && !!filter.keyValues;\r\n\t}\r\n\texports.isBasicFilterWithKeys = isBasicFilterWithKeys;\r\n\tfunction getFilterType(filter) {\r\n\t var basicFilter = filter;\r\n\t var advancedFilter = filter;\r\n\t if ((typeof basicFilter.operator === \"string\")\r\n\t && (Array.isArray(basicFilter.values))) {\r\n\t return FilterType.Basic;\r\n\t }\r\n\t else if ((typeof advancedFilter.logicalOperator === \"string\")\r\n\t && (Array.isArray(advancedFilter.conditions))) {\r\n\t return FilterType.Advanced;\r\n\t }\r\n\t else {\r\n\t return FilterType.Unknown;\r\n\t }\r\n\t}\r\n\texports.getFilterType = getFilterType;\r\n\tfunction isMeasure(arg) {\r\n\t return arg.table !== undefined && arg.measure !== undefined;\r\n\t}\r\n\texports.isMeasure = isMeasure;\r\n\tfunction isColumn(arg) {\r\n\t return arg.table !== undefined && arg.column !== undefined;\r\n\t}\r\n\texports.isColumn = isColumn;\r\n\tfunction isHierarchy(arg) {\r\n\t return arg.table !== undefined && arg.hierarchy !== undefined && arg.hierarchyLevel !== undefined;\r\n\t}\r\n\texports.isHierarchy = isHierarchy;\r\n\tvar Filter = (function () {\r\n\t function Filter(target) {\r\n\t this.target = target;\r\n\t }\r\n\t Filter.prototype.toJSON = function () {\r\n\t return {\r\n\t $schema: this.schemaUrl,\r\n\t target: this.target\r\n\t };\r\n\t };\r\n\t ;\r\n\t return Filter;\r\n\t}());\r\n\texports.Filter = Filter;\r\n\tvar BasicFilter = (function (_super) {\r\n\t __extends(BasicFilter, _super);\r\n\t function BasicFilter(target, operator) {\r\n\t var values = [];\r\n\t for (var _i = 2; _i < arguments.length; _i++) {\r\n\t values[_i - 2] = arguments[_i];\r\n\t }\r\n\t _super.call(this, target);\r\n\t this.operator = operator;\r\n\t this.schemaUrl = BasicFilter.schemaUrl;\r\n\t if (values.length === 0 && operator !== \"All\") {\r\n\t throw new Error(\"values must be a non-empty array unless your operator is \\\"All\\\".\");\r\n\t }\r\n\t /**\r\n\t * Accept values as array instead of as individual arguments\r\n\t * new BasicFilter('a', 'b', 1, 2);\r\n\t * new BasicFilter('a', 'b', [1,2]);\r\n\t */\r\n\t if (Array.isArray(values[0])) {\r\n\t this.values = values[0];\r\n\t }\r\n\t else {\r\n\t this.values = values;\r\n\t }\r\n\t }\r\n\t BasicFilter.prototype.toJSON = function () {\r\n\t var filter = _super.prototype.toJSON.call(this);\r\n\t filter.operator = this.operator;\r\n\t filter.values = this.values;\r\n\t return filter;\r\n\t };\r\n\t BasicFilter.schemaUrl = \"http://powerbi.com/product/schema#basic\";\r\n\t return BasicFilter;\r\n\t}(Filter));\r\n\texports.BasicFilter = BasicFilter;\r\n\tvar BasicFilterWithKeys = (function (_super) {\r\n\t __extends(BasicFilterWithKeys, _super);\r\n\t function BasicFilterWithKeys(target, operator, values, keyValues) {\r\n\t _super.call(this, target, operator, values);\r\n\t this.keyValues = keyValues;\r\n\t this.target = target;\r\n\t var numberOfKeys = target.keys ? target.keys.length : 0;\r\n\t if (numberOfKeys > 0 && !keyValues) {\r\n\t throw new Error(\"You shold pass the values to be filtered for each key. You passed: no values and \" + numberOfKeys + \" keys\");\r\n\t }\r\n\t if (numberOfKeys === 0 && keyValues && keyValues.length > 0) {\r\n\t throw new Error(\"You passed key values but your target object doesn't contain the keys to be filtered\");\r\n\t }\r\n\t for (var i = 0; i < this.keyValues.length; i++) {\r\n\t if (this.keyValues[i]) {\r\n\t var lengthOfArray = this.keyValues[i].length;\r\n\t if (lengthOfArray !== numberOfKeys) {\r\n\t throw new Error(\"Each tuple of key values should contain a value for each of the keys. You passed: \" + lengthOfArray + \" values and \" + numberOfKeys + \" keys\");\r\n\t }\r\n\t }\r\n\t }\r\n\t }\r\n\t BasicFilterWithKeys.prototype.toJSON = function () {\r\n\t var filter = _super.prototype.toJSON.call(this);\r\n\t filter.keyValues = this.keyValues;\r\n\t return filter;\r\n\t };\r\n\t return BasicFilterWithKeys;\r\n\t}(BasicFilter));\r\n\texports.BasicFilterWithKeys = BasicFilterWithKeys;\r\n\tvar AdvancedFilter = (function (_super) {\r\n\t __extends(AdvancedFilter, _super);\r\n\t function AdvancedFilter(target, logicalOperator) {\r\n\t var conditions = [];\r\n\t for (var _i = 2; _i < arguments.length; _i++) {\r\n\t conditions[_i - 2] = arguments[_i];\r\n\t }\r\n\t _super.call(this, target);\r\n\t this.schemaUrl = AdvancedFilter.schemaUrl;\r\n\t // Guard statements\r\n\t if (typeof logicalOperator !== \"string\" || logicalOperator.length === 0) {\r\n\t // TODO: It would be nicer to list out the possible logical operators.\r\n\t throw new Error(\"logicalOperator must be a valid operator, You passed: \" + logicalOperator);\r\n\t }\r\n\t this.logicalOperator = logicalOperator;\r\n\t var extractedConditions;\r\n\t /**\r\n\t * Accept conditions as array instead of as individual arguments\r\n\t * new AdvancedFilter('a', 'b', \"And\", { value: 1, operator: \"Equals\" }, { value: 2, operator: \"IsGreaterThan\" });\r\n\t * new AdvancedFilter('a', 'b', \"And\", [{ value: 1, operator: \"Equals\" }, { value: 2, operator: \"IsGreaterThan\" }]);\r\n\t */\r\n\t if (Array.isArray(conditions[0])) {\r\n\t extractedConditions = conditions[0];\r\n\t }\r\n\t else {\r\n\t extractedConditions = conditions;\r\n\t }\r\n\t if (extractedConditions.length === 0) {\r\n\t throw new Error(\"conditions must be a non-empty array. You passed: \" + conditions);\r\n\t }\r\n\t if (extractedConditions.length > 2) {\r\n\t throw new Error(\"AdvancedFilters may not have more than two conditions. You passed: \" + conditions.length);\r\n\t }\r\n\t if (extractedConditions.length === 1 && logicalOperator !== \"And\") {\r\n\t throw new Error(\"Logical Operator must be \\\"And\\\" when there is only one condition provided\");\r\n\t }\r\n\t this.conditions = extractedConditions;\r\n\t }\r\n\t AdvancedFilter.prototype.toJSON = function () {\r\n\t var filter = _super.prototype.toJSON.call(this);\r\n\t filter.logicalOperator = this.logicalOperator;\r\n\t filter.conditions = this.conditions;\r\n\t return filter;\r\n\t };\r\n\t AdvancedFilter.schemaUrl = \"http://powerbi.com/product/schema#advanced\";\r\n\t return AdvancedFilter;\r\n\t}(Filter));\r\n\texports.AdvancedFilter = AdvancedFilter;\r\n\t(function (Permissions) {\r\n\t Permissions[Permissions[\"Read\"] = 0] = \"Read\";\r\n\t Permissions[Permissions[\"ReadWrite\"] = 1] = \"ReadWrite\";\r\n\t Permissions[Permissions[\"Copy\"] = 2] = \"Copy\";\r\n\t Permissions[Permissions[\"Create\"] = 4] = \"Create\";\r\n\t Permissions[Permissions[\"All\"] = 7] = \"All\";\r\n\t})(exports.Permissions || (exports.Permissions = {}));\r\n\tvar Permissions = exports.Permissions;\r\n\t(function (ViewMode) {\r\n\t ViewMode[ViewMode[\"View\"] = 0] = \"View\";\r\n\t ViewMode[ViewMode[\"Edit\"] = 1] = \"Edit\";\r\n\t})(exports.ViewMode || (exports.ViewMode = {}));\r\n\tvar ViewMode = exports.ViewMode;\r\n\texports.validateSaveAsParameters = validate(exports.saveAsParametersSchema);\r\n\n\n/***/ },\n/* 1 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"target\": {\n\t\t\t\t\"oneOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\t\"table\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"column\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"required\": [\n\t\t\t\t\t\t\t\"table\",\n\t\t\t\t\t\t\t\"column\"\n\t\t\t\t\t\t]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\t\"table\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"hierarchy\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"hierarchyLevel\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"required\": [\n\t\t\t\t\t\t\t\"table\",\n\t\t\t\t\t\t\t\"hierarchy\",\n\t\t\t\t\t\t\t\"hierarchyLevel\"\n\t\t\t\t\t\t]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\t\"table\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"measure\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"required\": [\n\t\t\t\t\t\t\t\"table\",\n\t\t\t\t\t\t\t\"measure\"\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"logicalOperator\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"conditions\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\"value\": {\n\t\t\t\t\t\t\t\"type\": [\n\t\t\t\t\t\t\t\t\"string\",\n\t\t\t\t\t\t\t\t\"boolean\",\n\t\t\t\t\t\t\t\t\"number\"\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"operator\": {\n\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\"required\": [\n\t\t\t\t\t\t\"value\",\n\t\t\t\t\t\t\"operator\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"target\",\n\t\t\t\"logicalOperator\",\n\t\t\t\"conditions\"\n\t\t]\n\t};\n\n/***/ },\n/* 2 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"oneOf\": [\n\t\t\t{\n\t\t\t\t\"$ref\": \"#basicFilter\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"$ref\": \"#advancedFilter\"\n\t\t\t}\n\t\t],\n\t\t\"invalidMessage\": \"filter is invalid\"\n\t};\n\n/***/ },\n/* 3 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"accessToken\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"accessToken must be a string\",\n\t\t\t\t\t\"required\": \"accessToken is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"id\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"id must be a string\",\n\t\t\t\t\t\"required\": \"id is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"settings\": {\n\t\t\t\t\"$ref\": \"#settings\"\n\t\t\t},\n\t\t\t\"pageName\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"pageName must be a string\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"filters\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\"oneOf\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"$ref\": \"#basicFilter\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"$ref\": \"#advancedFilter\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t\"invalidMessage\": \"filters property is invalid\"\n\t\t\t},\n\t\t\t\"permissions\": {\n\t\t\t\t\"type\": \"number\",\n\t\t\t\t\"enum\": [\n\t\t\t\t\t0,\n\t\t\t\t\t1,\n\t\t\t\t\t2,\n\t\t\t\t\t3\n\t\t\t\t],\n\t\t\t\t\"default\": 0,\n\t\t\t\t\"invalidMessage\": \"permissions property is invalid\"\n\t\t\t},\n\t\t\t\"viewMode\": {\n\t\t\t\t\"type\": \"number\",\n\t\t\t\t\"enum\": [\n\t\t\t\t\t0,\n\t\t\t\t\t1\n\t\t\t\t],\n\t\t\t\t\"default\": 0,\n\t\t\t\t\"invalidMessage\": \"viewMode property is invalid\"\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"accessToken\",\n\t\t\t\"id\"\n\t\t]\n\t};\n\n/***/ },\n/* 4 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"accessToken\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"accessToken must be a string\",\n\t\t\t\t\t\"required\": \"accessToken is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"id\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"id must be a string\",\n\t\t\t\t\t\"required\": \"id is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"pageView\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"pageView must be a string with one of the following values: \\\"actualSize\\\", \\\"fitToWidth\\\", \\\"oneColumn\\\"\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"accessToken\",\n\t\t\t\"id\"\n\t\t]\n\t};\n\n/***/ },\n/* 5 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"name\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"name must be a string\",\n\t\t\t\t\t\"required\": \"name is required\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"name\"\n\t\t]\n\t};\n\n/***/ },\n/* 6 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"filterPaneEnabled\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"filterPaneEnabled must be a boolean\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"navContentPaneEnabled\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"navContentPaneEnabled must be a boolean\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"useCustomSaveAsDialog\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"useCustomSaveAsDialog must be a boolean\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n/***/ },\n/* 7 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"target\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"properties\": {\n\t\t\t\t\t\"table\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"column\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"hierarchy\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"hierarchyLevel\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"measure\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"required\": [\n\t\t\t\t\t\"table\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"operator\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"values\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"type\": [\n\t\t\t\t\t\t\"string\",\n\t\t\t\t\t\t\"boolean\",\n\t\t\t\t\t\t\"number\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"target\",\n\t\t\t\"operator\",\n\t\t\t\"values\"\n\t\t]\n\t};\n\n/***/ },\n/* 8 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"accessToken\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"accessToken must be a string\",\n\t\t\t\t\t\"required\": \"accessToken is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"datasetId\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"datasetId must be a string\",\n\t\t\t\t\t\"required\": \"datasetId is required\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"accessToken\",\n\t\t\t\"datasetId\"\n\t\t]\n\t};\n\n/***/ },\n/* 9 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"name\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"name must be a string\",\n\t\t\t\t\t\"required\": \"name is required\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"name\"\n\t\t]\n\t};\n\n/***/ },\n/* 10 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = __webpack_require__(11);\n\n/***/ },\n/* 11 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar REGEX_ESCAPE_EXPR = /[\\/]/g,\n\t STR_ESCAPE_EXPR = /(\")/gim,\n\t VALID_IDENTIFIER_EXPR = /^[a-z_$][0-9a-z]*$/gi,\n\t INVALID_SCHEMA = 'jsen: invalid schema object',\n\t browser = typeof window === 'object' && !!window.navigator, // jshint ignore: line\n\t regescape = new RegExp('/').source !== '/', // node v0.x does not properly escape '/'s in inline regex\n\t func = __webpack_require__(12),\n\t equal = __webpack_require__(13),\n\t unique = __webpack_require__(14),\n\t SchemaResolver = __webpack_require__(15),\n\t formats = __webpack_require__(24),\n\t ucs2length = __webpack_require__(25),\n\t types = {},\n\t keywords = {};\n\t\n\tfunction inlineRegex(regex) {\n\t regex = regex instanceof RegExp ? regex : new RegExp(regex);\n\t\n\t return regescape ?\n\t regex.toString() :\n\t '/' + regex.source.replace(REGEX_ESCAPE_EXPR, '\\\\$&') + '/';\n\t}\n\t\n\tfunction encodeStr(str) {\n\t return '\"' + str.replace(STR_ESCAPE_EXPR, '\\\\$1') + '\"';\n\t}\n\t\n\tfunction appendToPath(path, key) {\n\t VALID_IDENTIFIER_EXPR.lastIndex = 0;\n\t\n\t return VALID_IDENTIFIER_EXPR.test(key) ?\n\t path + '.' + key :\n\t path + '[' + encodeStr(key) + ']';\n\t}\n\t\n\tfunction type(obj) {\n\t if (obj === undefined) {\n\t return 'undefined';\n\t }\n\t\n\t var str = Object.prototype.toString.call(obj);\n\t return str.substr(8, str.length - 9).toLowerCase();\n\t}\n\t\n\tfunction isInteger(obj) {\n\t return (obj | 0) === obj; // jshint ignore: line\n\t}\n\t\n\ttypes['null'] = function (path) {\n\t return path + ' === null';\n\t};\n\t\n\ttypes.boolean = function (path) {\n\t return 'typeof ' + path + ' === \"boolean\"';\n\t};\n\t\n\ttypes.string = function (path) {\n\t return 'typeof ' + path + ' === \"string\"';\n\t};\n\t\n\ttypes.number = function (path) {\n\t return 'typeof ' + path + ' === \"number\"';\n\t};\n\t\n\ttypes.integer = function (path) {\n\t return 'typeof ' + path + ' === \"number\" && !(' + path + ' % 1)';\n\t};\n\t\n\ttypes.array = function (path) {\n\t return 'Array.isArray(' + path + ')';\n\t};\n\t\n\ttypes.object = function (path) {\n\t return 'typeof ' + path + ' === \"object\" && ' + path + ' !== null && !Array.isArray(' + path + ')';\n\t};\n\t\n\ttypes.date = function (path) {\n\t return path + ' instanceof Date';\n\t};\n\t\n\tkeywords.enum = function (context) {\n\t var arr = context.schema['enum'];\n\t\n\t context.code('if (!equalAny(' + context.path + ', ' + JSON.stringify(arr) + ')) {');\n\t context.error('enum');\n\t context.code('}');\n\t};\n\t\n\tkeywords.minimum = function (context) {\n\t if (typeof context.schema.minimum === 'number') {\n\t context.code('if (' + context.path + ' < ' + context.schema.minimum + ') {');\n\t context.error('minimum');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.exclusiveMinimum = function (context) {\n\t if (context.schema.exclusiveMinimum === true && typeof context.schema.minimum === 'number') {\n\t context.code('if (' + context.path + ' === ' + context.schema.minimum + ') {');\n\t context.error('exclusiveMinimum');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.maximum = function (context) {\n\t if (typeof context.schema.maximum === 'number') {\n\t context.code('if (' + context.path + ' > ' + context.schema.maximum + ') {');\n\t context.error('maximum');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.exclusiveMaximum = function (context) {\n\t if (context.schema.exclusiveMaximum === true && typeof context.schema.maximum === 'number') {\n\t context.code('if (' + context.path + ' === ' + context.schema.maximum + ') {');\n\t context.error('exclusiveMaximum');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.multipleOf = function (context) {\n\t if (typeof context.schema.multipleOf === 'number') {\n\t var mul = context.schema.multipleOf,\n\t decimals = mul.toString().length - mul.toFixed(0).length - 1,\n\t pow = decimals > 0 ? Math.pow(10, decimals) : 1,\n\t path = context.path;\n\t\n\t if (decimals > 0) {\n\t context.code('if (+(Math.round((' + path + ' * ' + pow + ') + \"e+\" + ' + decimals + ') + \"e-\" + ' + decimals + ') % ' + (mul * pow) + ' !== 0) {');\n\t } else {\n\t context.code('if (((' + path + ' * ' + pow + ') % ' + (mul * pow) + ') !== 0) {');\n\t }\n\t\n\t context.error('multipleOf');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.minLength = function (context) {\n\t if (isInteger(context.schema.minLength)) {\n\t context.code('if (ucs2length(' + context.path + ') < ' + context.schema.minLength + ') {');\n\t context.error('minLength');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.maxLength = function (context) {\n\t if (isInteger(context.schema.maxLength)) {\n\t context.code('if (ucs2length(' + context.path + ') > ' + context.schema.maxLength + ') {');\n\t context.error('maxLength');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.pattern = function (context) {\n\t var pattern = context.schema.pattern;\n\t\n\t if (typeof pattern === 'string' || pattern instanceof RegExp) {\n\t context.code('if (!(' + inlineRegex(pattern) + ').test(' + context.path + ')) {');\n\t context.error('pattern');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.format = function (context) {\n\t if (typeof context.schema.format !== 'string' || !formats[context.schema.format]) {\n\t return;\n\t }\n\t\n\t context.code('if (!(' + formats[context.schema.format] + ').test(' + context.path + ')) {');\n\t context.error('format');\n\t context.code('}');\n\t};\n\t\n\tkeywords.minItems = function (context) {\n\t if (isInteger(context.schema.minItems)) {\n\t context.code('if (' + context.path + '.length < ' + context.schema.minItems + ') {');\n\t context.error('minItems');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.maxItems = function (context) {\n\t if (isInteger(context.schema.maxItems)) {\n\t context.code('if (' + context.path + '.length > ' + context.schema.maxItems + ') {');\n\t context.error('maxItems');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.additionalItems = function (context) {\n\t if (context.schema.additionalItems === false && Array.isArray(context.schema.items)) {\n\t context.code('if (' + context.path + '.length > ' + context.schema.items.length + ') {');\n\t context.error('additionalItems');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.uniqueItems = function (context) {\n\t if (context.schema.uniqueItems) {\n\t context.code('if (unique(' + context.path + ').length !== ' + context.path + '.length) {');\n\t context.error('uniqueItems');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.items = function (context) {\n\t var index = context.declare(0),\n\t i = 0;\n\t\n\t if (type(context.schema.items) === 'object') {\n\t context.code('for (' + index + ' = 0; ' + index + ' < ' + context.path + '.length; ' + index + '++) {');\n\t\n\t context.descend(context.path + '[' + index + ']', context.schema.items);\n\t\n\t context.code('}');\n\t }\n\t else if (Array.isArray(context.schema.items)) {\n\t for (; i < context.schema.items.length; i++) {\n\t context.code('if (' + context.path + '.length - 1 >= ' + i + ') {');\n\t\n\t context.descend(context.path + '[' + i + ']', context.schema.items[i]);\n\t\n\t context.code('}');\n\t }\n\t\n\t if (type(context.schema.additionalItems) === 'object') {\n\t context.code('for (' + index + ' = ' + i + '; ' + index + ' < ' + context.path + '.length; ' + index + '++) {');\n\t\n\t context.descend(context.path + '[' + index + ']', context.schema.additionalItems);\n\t\n\t context.code('}');\n\t }\n\t }\n\t};\n\t\n\tkeywords.maxProperties = function (context) {\n\t if (isInteger(context.schema.maxProperties)) {\n\t context.code('if (Object.keys(' + context.path + ').length > ' + context.schema.maxProperties + ') {');\n\t context.error('maxProperties');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.minProperties = function (context) {\n\t if (isInteger(context.schema.minProperties)) {\n\t context.code('if (Object.keys(' + context.path + ').length < ' + context.schema.minProperties + ') {');\n\t context.error('minProperties');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.required = function (context) {\n\t if (!Array.isArray(context.schema.required)) {\n\t return;\n\t }\n\t\n\t for (var i = 0; i < context.schema.required.length; i++) {\n\t context.code('if (' + appendToPath(context.path, context.schema.required[i]) + ' === undefined) {');\n\t context.error('required', context.schema.required[i]);\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.properties = function (context) {\n\t var props = context.schema.properties,\n\t propKeys = type(props) === 'object' ? Object.keys(props) : [],\n\t required = Array.isArray(context.schema.required) ? context.schema.required : [],\n\t prop, i, nestedPath;\n\t\n\t if (!propKeys.length) {\n\t return;\n\t }\n\t\n\t for (i = 0; i < propKeys.length; i++) {\n\t prop = propKeys[i];\n\t nestedPath = appendToPath(context.path, prop);\n\t\n\t context.code('if (' + nestedPath + ' !== undefined) {');\n\t\n\t context.descend(nestedPath, props[prop]);\n\t\n\t context.code('}');\n\t\n\t if (required.indexOf(prop) > -1) {\n\t context.code('else {');\n\t context.error('required', prop);\n\t context.code('}');\n\t }\n\t }\n\t};\n\t\n\tkeywords.patternProperties = keywords.additionalProperties = function (context) {\n\t var propKeys = type(context.schema.properties) === 'object' ?\n\t Object.keys(context.schema.properties) : [],\n\t patProps = context.schema.patternProperties,\n\t patterns = type(patProps) === 'object' ? Object.keys(patProps) : [],\n\t addProps = context.schema.additionalProperties,\n\t addPropsCheck = addProps === false || type(addProps) === 'object',\n\t props, keys, key, n, found, pattern, i;\n\t\n\t if (!patterns.length && !addPropsCheck) {\n\t return;\n\t }\n\t\n\t keys = context.declare('[]');\n\t key = context.declare('\"\"');\n\t n = context.declare(0);\n\t\n\t if (addPropsCheck) {\n\t found = context.declare(false);\n\t }\n\t\n\t context.code(keys + ' = Object.keys(' + context.path + ')');\n\t\n\t context.code('for (' + n + ' = 0; ' + n + ' < ' + keys + '.length; ' + n + '++) {')\n\t (key + ' = ' + keys + '[' + n + ']')\n\t\n\t ('if (' + context.path + '[' + key + '] === undefined) {')\n\t ('continue')\n\t ('}');\n\t\n\t if (addPropsCheck) {\n\t context.code(found + ' = false');\n\t }\n\t\n\t // validate pattern properties\n\t for (i = 0; i < patterns.length; i++) {\n\t pattern = patterns[i];\n\t\n\t context.code('if ((' + inlineRegex(pattern) + ').test(' + key + ')) {');\n\t\n\t context.descend(context.path + '[' + key + ']', patProps[pattern]);\n\t\n\t if (addPropsCheck) {\n\t context.code(found + ' = true');\n\t }\n\t\n\t context.code('}');\n\t }\n\t\n\t // validate additional properties\n\t if (addPropsCheck) {\n\t if (propKeys.length) {\n\t props = context.declare(JSON.stringify(propKeys));\n\t\n\t // do not validate regular properties\n\t context.code('if (' + props + '.indexOf(' + key + ') > -1) {')\n\t ('continue')\n\t ('}');\n\t }\n\t\n\t context.code('if (!' + found + ') {');\n\t\n\t if (addProps === false) {\n\t // do not allow additional properties\n\t context.error('additionalProperties', undefined, key);\n\t }\n\t else {\n\t // validate additional properties\n\t context.descend(context.path + '[' + key + ']', addProps);\n\t }\n\t\n\t context.code('}');\n\t }\n\t\n\t context.code('}');\n\t};\n\t\n\tkeywords.dependencies = function (context) {\n\t if (type(context.schema.dependencies) !== 'object') {\n\t return;\n\t }\n\t\n\t var depKeys = Object.keys(context.schema.dependencies),\n\t len = depKeys.length,\n\t key, dep, i = 0, k = 0;\n\t\n\t for (; k < len; k++) {\n\t key = depKeys[k];\n\t dep = context.schema.dependencies[key];\n\t\n\t context.code('if (' + appendToPath(context.path, key) + ' !== undefined) {');\n\t\n\t if (type(dep) === 'object') {\n\t //schema dependency\n\t context.descend(context.path, dep);\n\t }\n\t else {\n\t // property dependency\n\t for (i; i < dep.length; i++) {\n\t context.code('if (' + appendToPath(context.path, dep[i]) + ' === undefined) {');\n\t context.error('dependencies', dep[i]);\n\t context.code('}');\n\t }\n\t }\n\t\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.allOf = function (context) {\n\t if (!Array.isArray(context.schema.allOf)) {\n\t return;\n\t }\n\t\n\t for (var i = 0; i < context.schema.allOf.length; i++) {\n\t context.descend(context.path, context.schema.allOf[i]);\n\t }\n\t};\n\t\n\tkeywords.anyOf = function (context) {\n\t if (!Array.isArray(context.schema.anyOf)) {\n\t return;\n\t }\n\t\n\t var greedy = context.greedy,\n\t errCount = context.declare(0),\n\t initialCount = context.declare(0),\n\t found = context.declare(false),\n\t i = 0;\n\t\n\t context.code(initialCount + ' = errors.length');\n\t\n\t for (; i < context.schema.anyOf.length; i++) {\n\t context.code('if (!' + found + ') {');\n\t\n\t context.code(errCount + ' = errors.length');\n\t\n\t context.greedy = true;\n\t\n\t context.descend(context.path, context.schema.anyOf[i]);\n\t\n\t context.code(found + ' = errors.length === ' + errCount)\n\t ('}');\n\t }\n\t\n\t context.greedy = greedy;\n\t\n\t context.code('if (!' + found + ') {');\n\t\n\t context.error('anyOf');\n\t\n\t context.code('} else {')\n\t ('errors.length = ' + initialCount)\n\t ('}');\n\t};\n\t\n\tkeywords.oneOf = function (context) {\n\t if (!Array.isArray(context.schema.oneOf)) {\n\t return;\n\t }\n\t\n\t var greedy = context.greedy,\n\t matching = context.declare(0),\n\t initialCount = context.declare(0),\n\t errCount = context.declare(0),\n\t i = 0;\n\t\n\t context.code(initialCount + ' = errors.length');\n\t context.code(matching + ' = 0');\n\t\n\t for (; i < context.schema.oneOf.length; i++) {\n\t context.code(errCount + ' = errors.length');\n\t\n\t context.greedy = true;\n\t\n\t context.descend(context.path, context.schema.oneOf[i]);\n\t\n\t context.code('if (errors.length === ' + errCount + ') {')\n\t (matching + '++')\n\t ('}');\n\t }\n\t\n\t context.greedy = greedy;\n\t\n\t context.code('if (' + matching + ' !== 1) {');\n\t\n\t context.error('oneOf');\n\t\n\t context.code('} else {')\n\t ('errors.length = ' + initialCount)\n\t ('}');\n\t};\n\t\n\tkeywords.not = function (context) {\n\t if (type(context.schema.not) !== 'object') {\n\t return;\n\t }\n\t\n\t var greedy = context.greedy,\n\t errCount = context.declare(0);\n\t\n\t context.code(errCount + ' = errors.length');\n\t\n\t context.greedy = true;\n\t\n\t context.descend(context.path, context.schema.not);\n\t\n\t context.greedy = greedy;\n\t\n\t context.code('if (errors.length === ' + errCount + ') {');\n\t\n\t context.error('not');\n\t\n\t context.code('} else {')\n\t ('errors.length = ' + errCount)\n\t ('}');\n\t};\n\t\n\tfunction decorateGenerator(type, keyword) {\n\t keywords[keyword].type = type;\n\t keywords[keyword].keyword = keyword;\n\t}\n\t\n\t['minimum', 'exclusiveMinimum', 'maximum', 'exclusiveMaximum', 'multipleOf']\n\t .forEach(decorateGenerator.bind(null, 'number'));\n\t\n\t['minLength', 'maxLength', 'pattern', 'format']\n\t .forEach(decorateGenerator.bind(null, 'string'));\n\t\n\t['minItems', 'maxItems', 'additionalItems', 'uniqueItems', 'items']\n\t .forEach(decorateGenerator.bind(null, 'array'));\n\t\n\t['maxProperties', 'minProperties', 'required', 'properties', 'patternProperties', 'additionalProperties', 'dependencies']\n\t .forEach(decorateGenerator.bind(null, 'object'));\n\t\n\t['enum', 'allOf', 'anyOf', 'oneOf', 'not']\n\t .forEach(decorateGenerator.bind(null, null));\n\t\n\tfunction groupKeywords(schema) {\n\t var keys = Object.keys(schema),\n\t propIndex = keys.indexOf('properties'),\n\t patIndex = keys.indexOf('patternProperties'),\n\t ret = {\n\t enum: Array.isArray(schema.enum) && schema.enum.length > 0,\n\t type: null,\n\t allType: [],\n\t perType: {}\n\t },\n\t key, gen, i;\n\t\n\t if (schema.type) {\n\t if (typeof schema.type === 'string') {\n\t ret.type = [schema.type];\n\t }\n\t else if (Array.isArray(schema.type) && schema.type.length) {\n\t ret.type = schema.type.slice(0);\n\t }\n\t }\n\t\n\t for (i = 0; i < keys.length; i++) {\n\t key = keys[i];\n\t\n\t if (key === 'enum' || key === 'type') {\n\t continue;\n\t }\n\t\n\t gen = keywords[key];\n\t\n\t if (!gen) {\n\t continue;\n\t }\n\t\n\t if (gen.type) {\n\t if (!ret.perType[gen.type]) {\n\t ret.perType[gen.type] = [];\n\t }\n\t\n\t if (!(propIndex > -1 && key === 'required') &&\n\t !(patIndex > -1 && key === 'additionalProperties')) {\n\t ret.perType[gen.type].push(key);\n\t }\n\t }\n\t else {\n\t ret.allType.push(key);\n\t }\n\t }\n\t\n\t return ret;\n\t}\n\t\n\tfunction getPathExpression(path, key) {\n\t var path_ = path.substr(4),\n\t len = path_.length,\n\t tokens = [],\n\t token = '',\n\t isvar = false,\n\t char, i;\n\t\n\t for (i = 0; i < len; i++) {\n\t char = path_[i];\n\t\n\t switch (char) {\n\t case '.':\n\t if (token) {\n\t token += char;\n\t }\n\t break;\n\t case '[':\n\t if (isNaN(+path_[i + 1])) {\n\t isvar = true;\n\t\n\t if (token) {\n\t tokens.push('\"' + token + '\"');\n\t token = '';\n\t }\n\t }\n\t else {\n\t isvar = false;\n\t\n\t if (token) {\n\t token += '.';\n\t }\n\t }\n\t break;\n\t case ']':\n\t tokens.push(isvar ? token : '\"' + token + '\"');\n\t token = '';\n\t break;\n\t default:\n\t token += char;\n\t }\n\t }\n\t\n\t if (token) {\n\t tokens.push('\"' + token + '\"');\n\t }\n\t\n\t if (key) {\n\t tokens.push('\"' + key + '\"');\n\t }\n\t\n\t if (tokens.length === 1 && isvar) {\n\t return '\"\" + ' + tokens[0] + ' + \"\"';\n\t }\n\t\n\t return tokens.join(' + \".\" + ') || '\"\"';\n\t}\n\t\n\tfunction clone(obj) {\n\t var cloned = obj,\n\t objType = type(obj),\n\t keys, len, key, i;\n\t\n\t if (objType === 'object') {\n\t cloned = {};\n\t keys = Object.keys(obj);\n\t\n\t for (i = 0, len = keys.length; i < len; i++) {\n\t key = keys[i];\n\t cloned[key] = clone(obj[key]);\n\t }\n\t }\n\t else if (objType === 'array') {\n\t cloned = [];\n\t\n\t for (i = 0, len = obj.length; i < len; i++) {\n\t cloned[i] = clone(obj[i]);\n\t }\n\t }\n\t else if (objType === 'regexp') {\n\t return new RegExp(obj);\n\t }\n\t else if (objType === 'date') {\n\t return new Date(obj.toJSON());\n\t }\n\t\n\t return cloned;\n\t}\n\t\n\tfunction equalAny(obj, options) {\n\t for (var i = 0, len = options.length; i < len; i++) {\n\t if (equal(obj, options[i])) {\n\t return true;\n\t }\n\t }\n\t\n\t return false;\n\t}\n\t\n\tfunction PropertyMarker() {\n\t this.objects = [];\n\t this.properties = [];\n\t}\n\t\n\tPropertyMarker.prototype.mark = function (obj, key) {\n\t var index = this.objects.indexOf(obj),\n\t prop;\n\t\n\t if (index < 0) {\n\t this.objects.push(obj);\n\t\n\t prop = {};\n\t prop[key] = 1;\n\t\n\t this.properties.push(prop);\n\t\n\t return;\n\t }\n\t\n\t prop = this.properties[index];\n\t\n\t prop[key] = prop[key] ? prop[key] + 1 : 1;\n\t};\n\t\n\tPropertyMarker.prototype.deleteDuplicates = function () {\n\t var props, keys, key, i, j;\n\t\n\t for (i = 0; i < this.properties.length; i++) {\n\t props = this.properties[i];\n\t keys = Object.keys(props);\n\t\n\t for (j = 0; j < keys.length; j++) {\n\t key = keys[j];\n\t\n\t if (props[key] > 1) {\n\t delete this.objects[i][key];\n\t }\n\t }\n\t }\n\t};\n\t\n\tPropertyMarker.prototype.dispose = function () {\n\t this.objects.length = 0;\n\t this.properties.length = 0;\n\t};\n\t\n\tfunction build(schema, def, additional, resolver, parentMarker) {\n\t var defType, defValue, key, i, propertyMarker, props, defProps;\n\t\n\t if (type(schema) !== 'object') {\n\t return def;\n\t }\n\t\n\t schema = resolver.resolve(schema);\n\t\n\t if (def === undefined && schema.hasOwnProperty('default')) {\n\t def = clone(schema['default']);\n\t }\n\t\n\t defType = type(def);\n\t\n\t if (defType === 'object' && type(schema.properties) === 'object') {\n\t props = Object.keys(schema.properties);\n\t\n\t for (i = 0; i < props.length; i++) {\n\t key = props[i];\n\t defValue = build(schema.properties[key], def[key], additional, resolver);\n\t\n\t if (defValue !== undefined) {\n\t def[key] = defValue;\n\t }\n\t }\n\t\n\t if (additional !== 'always') {\n\t defProps = Object.keys(def);\n\t\n\t for (i = 0; i < defProps.length; i++) {\n\t key = defProps[i];\n\t\n\t if (props.indexOf(key) < 0 &&\n\t (schema.additionalProperties === false ||\n\t (additional === false && !schema.additionalProperties))) {\n\t\n\t if (parentMarker) {\n\t parentMarker.mark(def, key);\n\t }\n\t else {\n\t delete def[key];\n\t }\n\t }\n\t }\n\t }\n\t }\n\t else if (defType === 'array' && schema.items) {\n\t if (type(schema.items) === 'array') {\n\t for (i = 0; i < schema.items.length; i++) {\n\t defValue = build(schema.items[i], def[i], additional, resolver);\n\t\n\t if (defValue !== undefined || i < def.length) {\n\t def[i] = defValue;\n\t }\n\t }\n\t }\n\t else if (def.length) {\n\t for (i = 0; i < def.length; i++) {\n\t def[i] = build(schema.items, def[i], additional, resolver);\n\t }\n\t }\n\t }\n\t else if (type(schema.allOf) === 'array' && schema.allOf.length) {\n\t propertyMarker = new PropertyMarker();\n\t\n\t for (i = 0; i < schema.allOf.length; i++) {\n\t def = build(schema.allOf[i], def, additional, resolver, propertyMarker);\n\t }\n\t\n\t propertyMarker.deleteDuplicates();\n\t propertyMarker.dispose();\n\t }\n\t\n\t return def;\n\t}\n\t\n\tfunction ValidationContext(options) {\n\t this.path = 'data';\n\t this.schema = options.schema;\n\t this.formats = options.formats;\n\t this.greedy = options.greedy;\n\t this.resolver = options.resolver;\n\t this.id = options.id;\n\t this.funcache = options.funcache || {};\n\t this.scope = options.scope || {\n\t equalAny: equalAny,\n\t unique: unique,\n\t ucs2length: ucs2length,\n\t refs: {}\n\t };\n\t}\n\t\n\tValidationContext.prototype.clone = function (schema) {\n\t var ctx = new ValidationContext({\n\t schema: schema,\n\t formats: this.formats,\n\t greedy: this.greedy,\n\t resolver: this.resolver,\n\t id: this.id,\n\t funcache: this.funcache,\n\t scope: this.scope\n\t });\n\t\n\t return ctx;\n\t};\n\t\n\tValidationContext.prototype.declare = function (def) {\n\t var variname = this.id();\n\t this.code.def(variname, def);\n\t return variname;\n\t};\n\t\n\tValidationContext.prototype.cache = function (cacheKey, schema) {\n\t var cached = this.funcache[cacheKey],\n\t context;\n\t\n\t if (!cached) {\n\t cached = this.funcache[cacheKey] = {\n\t key: this.id()\n\t };\n\t\n\t context = this.clone(schema);\n\t\n\t cached.func = context.compile(cached.key);\n\t\n\t this.scope.refs[cached.key] = cached.func;\n\t\n\t context.dispose();\n\t }\n\t\n\t return 'refs.' + cached.key;\n\t};\n\t\n\tValidationContext.prototype.error = function (keyword, key, additional) {\n\t var schema = this.schema,\n\t path = this.path,\n\t errorPath = path !== 'data' || key ?\n\t '(path ? path + \".\" : \"\") + ' + getPathExpression(path, key) + ',' :\n\t 'path,',\n\t res = key && schema.properties && schema.properties[key] ?\n\t this.resolver.resolve(schema.properties[key]) : null,\n\t message = res ? res.requiredMessage : schema.invalidMessage;\n\t\n\t if (!message) {\n\t message = (res && res.messages && res.messages[keyword]) ||\n\t (schema.messages && schema.messages[keyword]);\n\t }\n\t\n\t this.code('errors.push({');\n\t\n\t if (message) {\n\t this.code('message: ' + encodeStr(message) + ',');\n\t }\n\t\n\t if (additional) {\n\t this.code('additionalProperties: ' + additional + ',');\n\t }\n\t\n\t this.code('path: ' + errorPath)\n\t ('keyword: ' + encodeStr(keyword))\n\t ('})');\n\t\n\t if (!this.greedy) {\n\t this.code('return');\n\t }\n\t};\n\t\n\tValidationContext.prototype.refactor = function (path, schema, cacheKey) {\n\t var parentPathExp = path !== 'data' ?\n\t '(path ? path + \".\" : \"\") + ' + getPathExpression(path) :\n\t 'path',\n\t cachedRef = this.cache(cacheKey, schema),\n\t refErrors = this.declare();\n\t\n\t this.code(refErrors + ' = ' + cachedRef + '(' + path + ', ' + parentPathExp + ', errors)');\n\t\n\t if (!this.greedy) {\n\t this.code('if (errors.length) { return }');\n\t }\n\t};\n\t\n\tValidationContext.prototype.descend = function (path, schema) {\n\t var origPath = this.path,\n\t origSchema = this.schema;\n\t\n\t this.path = path;\n\t this.schema = schema;\n\t\n\t this.generate();\n\t\n\t this.path = origPath;\n\t this.schema = origSchema;\n\t};\n\t\n\tValidationContext.prototype.generate = function () {\n\t var path = this.path,\n\t schema = this.schema,\n\t context = this,\n\t scope = this.scope,\n\t encodedFormat,\n\t format,\n\t schemaKeys,\n\t typeKeys,\n\t typeIndex,\n\t validatedType,\n\t i;\n\t\n\t if (type(schema) !== 'object') {\n\t return;\n\t }\n\t\n\t if (schema.$ref !== undefined) {\n\t schema = this.resolver.resolve(schema);\n\t\n\t if (this.resolver.hasRef(schema)) {\n\t this.refactor(path, schema,\n\t this.resolver.getNormalizedRef(this.schema) || this.schema.$ref);\n\t\n\t return;\n\t }\n\t else {\n\t // substitute $ref schema with the resolved instance\n\t this.schema = schema;\n\t }\n\t }\n\t\n\t schemaKeys = groupKeywords(schema);\n\t\n\t if (schemaKeys.enum) {\n\t keywords.enum(context);\n\t\n\t return; // do not process the schema further\n\t }\n\t\n\t typeKeys = Object.keys(schemaKeys.perType);\n\t\n\t function generateForKeyword(keyword) {\n\t keywords[keyword](context); // jshint ignore: line\n\t }\n\t\n\t for (i = 0; i < typeKeys.length; i++) {\n\t validatedType = typeKeys[i];\n\t\n\t this.code((i ? 'else ' : '') + 'if (' + types[validatedType](path) + ') {');\n\t\n\t schemaKeys.perType[validatedType].forEach(generateForKeyword);\n\t\n\t this.code('}');\n\t\n\t if (schemaKeys.type) {\n\t typeIndex = schemaKeys.type.indexOf(validatedType);\n\t\n\t if (typeIndex > -1) {\n\t schemaKeys.type.splice(typeIndex, 1);\n\t }\n\t }\n\t }\n\t\n\t if (schemaKeys.type) { // we have types in the schema\n\t if (schemaKeys.type.length) { // case 1: we still have some left to check\n\t this.code((typeKeys.length ? 'else ' : '') + 'if (!(' + schemaKeys.type.map(function (type) {\n\t return types[type] ? types[type](path) : 'true';\n\t }).join(' || ') + ')) {');\n\t this.error('type');\n\t this.code('}');\n\t }\n\t else {\n\t this.code('else {'); // case 2: we don't have any left to check\n\t this.error('type');\n\t this.code('}');\n\t }\n\t }\n\t\n\t schemaKeys.allType.forEach(function (keyword) {\n\t keywords[keyword](context);\n\t });\n\t\n\t if (schema.format && this.formats) {\n\t format = this.formats[schema.format];\n\t\n\t if (format) {\n\t if (typeof format === 'string' || format instanceof RegExp) {\n\t this.code('if (!(' + inlineRegex(format) + ').test(' + path + ')) {');\n\t this.error('format');\n\t this.code('}');\n\t }\n\t else if (typeof format === 'function') {\n\t (scope.formats || (scope.formats = {}))[schema.format] = format;\n\t (scope.schemas || (scope.schemas = {}))[schema.format] = schema;\n\t\n\t encodedFormat = encodeStr(schema.format);\n\t\n\t this.code('if (!formats[' + encodedFormat + '](' + path + ', schemas[' + encodedFormat + '])) {');\n\t this.error('format');\n\t this.code('}');\n\t }\n\t }\n\t }\n\t};\n\t\n\tValidationContext.prototype.compile = function (id) {\n\t this.code = func('jsen_compiled' + (id ? '_' + id : ''), 'data', 'path', 'errors');\n\t this.generate();\n\t\n\t return this.code.compile(this.scope);\n\t};\n\t\n\tValidationContext.prototype.dispose = function () {\n\t for (var key in this) {\n\t this[key] = undefined;\n\t }\n\t};\n\t\n\tfunction jsen(schema, options) {\n\t if (type(schema) !== 'object') {\n\t throw new Error(INVALID_SCHEMA);\n\t }\n\t\n\t options = options || {};\n\t\n\t var counter = 0,\n\t id = function () { return 'i' + (counter++); },\n\t resolver = new SchemaResolver(schema, options.schemas, options.missing$Ref || false),\n\t context = new ValidationContext({\n\t schema: schema,\n\t resolver: resolver,\n\t id: id,\n\t schemas: options.schemas,\n\t formats: options.formats,\n\t greedy: options.greedy || false\n\t }),\n\t compiled = func('validate', 'data')\n\t ('validate.errors = []')\n\t ('gen(data, \"\", validate.errors)')\n\t ('return validate.errors.length === 0')\n\t .compile({ gen: context.compile() });\n\t\n\t context.dispose();\n\t context = null;\n\t\n\t compiled.errors = [];\n\t\n\t compiled.build = function (initial, options) {\n\t return build(\n\t schema,\n\t (options && options.copy === false ? initial : clone(initial)),\n\t options && options.additionalProperties,\n\t resolver);\n\t };\n\t\n\t return compiled;\n\t}\n\t\n\tjsen.browser = browser;\n\tjsen.clone = clone;\n\tjsen.equal = equal;\n\tjsen.unique = unique;\n\tjsen.ucs2length = ucs2length;\n\tjsen.SchemaResolver = SchemaResolver;\n\tjsen.resolve = SchemaResolver.resolvePointer;\n\t\n\tmodule.exports = jsen;\n\n\n/***/ },\n/* 12 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = function func() {\n\t var args = Array.apply(null, arguments),\n\t name = args.shift(),\n\t tab = ' ',\n\t lines = '',\n\t vars = '',\n\t ind = 1, // indentation\n\t bs = '{[', // block start\n\t be = '}]', // block end\n\t space = function () {\n\t var sp = tab, i = 0;\n\t while (i++ < ind - 1) { sp += tab; }\n\t return sp;\n\t },\n\t add = function (line) {\n\t lines += space() + line + '\\n';\n\t },\n\t builder = function (line) {\n\t var first = line[0],\n\t last = line[line.length - 1];\n\t\n\t if (be.indexOf(first) > -1 && bs.indexOf(last) > -1) {\n\t ind--;\n\t add(line);\n\t ind++;\n\t }\n\t else if (bs.indexOf(last) > -1) {\n\t add(line);\n\t ind++;\n\t }\n\t else if (be.indexOf(first) > -1) {\n\t ind--;\n\t add(line);\n\t }\n\t else {\n\t add(line);\n\t }\n\t\n\t return builder;\n\t };\n\t\n\t builder.def = function (id, def) {\n\t vars += (vars ? ',\\n' + tab + ' ' : '') + id + (def !== undefined ? ' = ' + def : '');\n\t return builder;\n\t };\n\t\n\t builder.toSource = function () {\n\t return 'function ' + name + '(' + args.join(', ') + ') {\\n' +\n\t tab + '\"use strict\"' + '\\n' +\n\t (vars ? tab + 'var ' + vars + ';\\n' : '') +\n\t lines + '}';\n\t };\n\t\n\t builder.compile = function (scope) {\n\t var src = 'return (' + builder.toSource() + ')',\n\t scp = scope || {},\n\t keys = Object.keys(scp),\n\t vals = keys.map(function (key) { return scp[key]; });\n\t\n\t return Function.apply(null, keys.concat(src)).apply(null, vals);\n\t };\n\t\n\t return builder;\n\t};\n\n/***/ },\n/* 13 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tfunction type(obj) {\n\t var str = Object.prototype.toString.call(obj);\n\t return str.substr(8, str.length - 9).toLowerCase();\n\t}\n\t\n\tfunction deepEqual(a, b) {\n\t var keysA = Object.keys(a).sort(),\n\t keysB = Object.keys(b).sort(),\n\t i, key;\n\t\n\t if (!equal(keysA, keysB)) {\n\t return false;\n\t }\n\t\n\t for (i = 0; i < keysA.length; i++) {\n\t key = keysA[i];\n\t\n\t if (!equal(a[key], b[key])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t}\n\t\n\tfunction equal(a, b) { // jshint ignore: line\n\t var typeA = typeof a,\n\t typeB = typeof b,\n\t i;\n\t\n\t // get detailed object type\n\t if (typeA === 'object') {\n\t typeA = type(a);\n\t }\n\t\n\t // get detailed object type\n\t if (typeB === 'object') {\n\t typeB = type(b);\n\t }\n\t\n\t if (typeA !== typeB) {\n\t return false;\n\t }\n\t\n\t if (typeA === 'object') {\n\t return deepEqual(a, b);\n\t }\n\t\n\t if (typeA === 'regexp') {\n\t return a.toString() === b.toString();\n\t }\n\t\n\t if (typeA === 'array') {\n\t if (a.length !== b.length) {\n\t return false;\n\t }\n\t\n\t for (i = 0; i < a.length; i++) {\n\t if (!equal(a[i], b[i])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t }\n\t\n\t return a === b;\n\t}\n\t\n\tmodule.exports = equal;\n\n/***/ },\n/* 14 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar equal = __webpack_require__(13);\n\t\n\tfunction findIndex(arr, value, comparator) {\n\t for (var i = 0, len = arr.length; i < len; i++) {\n\t if (comparator(arr[i], value)) {\n\t return i;\n\t }\n\t }\n\t\n\t return -1;\n\t}\n\t\n\tmodule.exports = function unique(arr) {\n\t return arr.filter(function uniqueOnly(value, index, self) {\n\t return findIndex(self, value, equal) === index;\n\t });\n\t};\n\t\n\tmodule.exports.findIndex = findIndex;\n\n/***/ },\n/* 15 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar url = __webpack_require__(16),\n\t metaschema = __webpack_require__(23),\n\t INVALID_SCHEMA_REFERENCE = 'jsen: invalid schema reference',\n\t DUPLICATE_SCHEMA_ID = 'jsen: duplicate schema id',\n\t CIRCULAR_SCHEMA_REFERENCE = 'jsen: circular schema reference';\n\t\n\tfunction get(obj, path) {\n\t if (!path.length) {\n\t return obj;\n\t }\n\t\n\t var key = path.shift(),\n\t val;\n\t\n\t if (obj && typeof obj === 'object' && obj.hasOwnProperty(key)) {\n\t val = obj[key];\n\t }\n\t\n\t if (path.length) {\n\t if (val && typeof val === 'object') {\n\t return get(val, path);\n\t }\n\t\n\t return undefined;\n\t }\n\t\n\t return val;\n\t}\n\t\n\tfunction refToObj(ref) {\n\t var index = ref.indexOf('#'),\n\t ret = {\n\t base: ref.substr(0, index),\n\t path: []\n\t };\n\t\n\t if (index < 0) {\n\t ret.base = ref;\n\t return ret;\n\t }\n\t\n\t ref = ref.substr(index + 1);\n\t\n\t if (!ref) {\n\t return ret;\n\t }\n\t\n\t ret.path = ref.split('/').map(function (segment) {\n\t // Reference: http://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-08#section-3\n\t return decodeURIComponent(segment)\n\t .replace(/~1/g, '/')\n\t .replace(/~0/g, '~');\n\t });\n\t\n\t if (ref[0] === '/') {\n\t ret.path.shift();\n\t }\n\t\n\t return ret;\n\t}\n\t\n\t// TODO: Can we prevent nested resolvers and combine schemas instead?\n\tfunction SchemaResolver(rootSchema, external, missing$Ref, baseId) { // jshint ignore: line\n\t this.rootSchema = rootSchema;\n\t this.resolvers = null;\n\t this.resolvedRootSchema = null;\n\t this.cache = {};\n\t this.idCache = {};\n\t this.refCache = { refs: [], schemas: [] };\n\t this.missing$Ref = missing$Ref;\n\t this.refStack = [];\n\t\n\t baseId = baseId || '';\n\t\n\t this._buildIdCache(rootSchema, baseId);\n\t\n\t // get updated base id after normalizing root schema id\n\t baseId = this.refCache.refs[this.refCache.schemas.indexOf(this.rootSchema)] || baseId;\n\t\n\t this._buildResolvers(external, baseId);\n\t}\n\t\n\tSchemaResolver.prototype._cacheId = function (id, schema, resolver) {\n\t if (this.idCache[id]) {\n\t throw new Error(DUPLICATE_SCHEMA_ID + ' ' + id);\n\t }\n\t\n\t this.idCache[id] = { resolver: resolver, schema: schema };\n\t};\n\t\n\tSchemaResolver.prototype._buildIdCache = function (schema, baseId) {\n\t var id = baseId,\n\t ref, keys, i;\n\t\n\t if (!schema || typeof schema !== 'object') {\n\t return;\n\t }\n\t\n\t if (typeof schema.id === 'string' && schema.id) {\n\t id = url.resolve(baseId, schema.id);\n\t\n\t this._cacheId(id, schema, this);\n\t }\n\t else if (schema === this.rootSchema && baseId) {\n\t this._cacheId(baseId, schema, this);\n\t }\n\t\n\t if (schema.$ref && typeof schema.$ref === 'string') {\n\t ref = url.resolve(id, schema.$ref);\n\t\n\t this.refCache.schemas.push(schema);\n\t this.refCache.refs.push(ref);\n\t }\n\t\n\t keys = Object.keys(schema);\n\t\n\t for (i = 0; i < keys.length; i++) {\n\t this._buildIdCache(schema[keys[i]], id);\n\t }\n\t};\n\t\n\tSchemaResolver.prototype._buildResolvers = function (schemas, baseId) {\n\t if (!schemas || typeof schemas !== 'object') {\n\t return;\n\t }\n\t\n\t var that = this,\n\t resolvers = {};\n\t\n\t Object.keys(schemas).forEach(function (key) {\n\t var id = url.resolve(baseId, key),\n\t resolver = new SchemaResolver(schemas[key], null, that.missing$Ref, id);\n\t\n\t that._cacheId(id, resolver.rootSchema, resolver);\n\t\n\t Object.keys(resolver.idCache).forEach(function (idKey) {\n\t that.idCache[idKey] = resolver.idCache[idKey];\n\t });\n\t\n\t resolvers[key] = resolver;\n\t });\n\t\n\t this.resolvers = resolvers;\n\t};\n\t\n\tSchemaResolver.prototype.getNormalizedRef = function (schema) {\n\t var index = this.refCache.schemas.indexOf(schema);\n\t return this.refCache.refs[index];\n\t};\n\t\n\tSchemaResolver.prototype._resolveRef = function (ref) {\n\t var err = new Error(INVALID_SCHEMA_REFERENCE + ' ' + ref),\n\t idCache = this.idCache,\n\t externalResolver, cached, descriptor, path, dest;\n\t\n\t if (!ref || typeof ref !== 'string') {\n\t throw err;\n\t }\n\t\n\t if (ref === metaschema.id) {\n\t dest = metaschema;\n\t }\n\t\n\t cached = idCache[ref];\n\t\n\t if (cached) {\n\t dest = cached.resolver.resolve(cached.schema);\n\t }\n\t\n\t if (dest === undefined) {\n\t descriptor = refToObj(ref);\n\t path = descriptor.path;\n\t\n\t if (descriptor.base) {\n\t cached = idCache[descriptor.base] || idCache[descriptor.base + '#'];\n\t\n\t if (cached) {\n\t dest = cached.resolver.resolve(get(cached.schema, path.slice(0)));\n\t }\n\t else {\n\t path.unshift(descriptor.base);\n\t }\n\t }\n\t }\n\t\n\t if (dest === undefined && this.resolvedRootSchema) {\n\t dest = get(this.resolvedRootSchema, path.slice(0));\n\t }\n\t\n\t if (dest === undefined) {\n\t dest = get(this.rootSchema, path.slice(0));\n\t }\n\t\n\t if (dest === undefined && path.length && this.resolvers) {\n\t externalResolver = get(this.resolvers, path);\n\t\n\t if (externalResolver) {\n\t dest = externalResolver.resolve(externalResolver.rootSchema);\n\t }\n\t }\n\t\n\t if (dest === undefined || typeof dest !== 'object') {\n\t if (this.missing$Ref) {\n\t dest = {};\n\t } else {\n\t throw err;\n\t }\n\t }\n\t\n\t if (this.cache[ref] === dest) {\n\t return dest;\n\t }\n\t\n\t this.cache[ref] = dest;\n\t\n\t if (dest.$ref !== undefined) {\n\t dest = this.resolve(dest);\n\t }\n\t\n\t return dest;\n\t};\n\t\n\tSchemaResolver.prototype.resolve = function (schema) {\n\t if (!schema || typeof schema !== 'object' || schema.$ref === undefined) {\n\t return schema;\n\t }\n\t\n\t var ref = this.getNormalizedRef(schema) || schema.$ref,\n\t resolved = this.cache[ref];\n\t\n\t if (resolved !== undefined) {\n\t return resolved;\n\t }\n\t\n\t if (this.refStack.indexOf(ref) > -1) {\n\t throw new Error(CIRCULAR_SCHEMA_REFERENCE + ' ' + ref);\n\t }\n\t\n\t this.refStack.push(ref);\n\t\n\t resolved = this._resolveRef(ref);\n\t\n\t this.refStack.pop();\n\t\n\t if (schema === this.rootSchema) {\n\t // cache the resolved root schema\n\t this.resolvedRootSchema = resolved;\n\t }\n\t\n\t return resolved;\n\t};\n\t\n\tSchemaResolver.prototype.hasRef = function (schema) {\n\t var keys = Object.keys(schema),\n\t len, key, i, hasChildRef;\n\t\n\t if (keys.indexOf('$ref') > -1) {\n\t return true;\n\t }\n\t\n\t for (i = 0, len = keys.length; i < len; i++) {\n\t key = keys[i];\n\t\n\t if (schema[key] && typeof schema[key] === 'object' && !Array.isArray(schema[key])) {\n\t hasChildRef = this.hasRef(schema[key]);\n\t\n\t if (hasChildRef) {\n\t return true;\n\t }\n\t }\n\t }\n\t\n\t return false;\n\t};\n\t\n\tSchemaResolver.resolvePointer = function (obj, pointer) {\n\t var descriptor = refToObj(pointer),\n\t path = descriptor.path;\n\t\n\t if (descriptor.base) {\n\t path = [descriptor.base].concat(path);\n\t }\n\t\n\t return get(obj, path);\n\t};\n\t\n\tmodule.exports = SchemaResolver;\n\n/***/ },\n/* 16 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t// Copyright Joyent, Inc. and other Node contributors.\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a\n\t// copy of this software and associated documentation files (the\n\t// \"Software\"), to deal in the Software without restriction, including\n\t// without limitation the rights to use, copy, modify, merge, publish,\n\t// distribute, sublicense, and/or sell copies of the Software, and to permit\n\t// persons to whom the Software is furnished to do so, subject to the\n\t// following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included\n\t// in all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n\t// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\t// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n\t// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n\t// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n\t// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n\t// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\t\n\t'use strict';\n\t\n\tvar punycode = __webpack_require__(17);\n\tvar util = __webpack_require__(19);\n\t\n\texports.parse = urlParse;\n\texports.resolve = urlResolve;\n\texports.resolveObject = urlResolveObject;\n\texports.format = urlFormat;\n\t\n\texports.Url = Url;\n\t\n\tfunction Url() {\n\t this.protocol = null;\n\t this.slashes = null;\n\t this.auth = null;\n\t this.host = null;\n\t this.port = null;\n\t this.hostname = null;\n\t this.hash = null;\n\t this.search = null;\n\t this.query = null;\n\t this.pathname = null;\n\t this.path = null;\n\t this.href = null;\n\t}\n\t\n\t// Reference: RFC 3986, RFC 1808, RFC 2396\n\t\n\t// define these here so at least they only have to be\n\t// compiled once on the first module load.\n\tvar protocolPattern = /^([a-z0-9.+-]+:)/i,\n\t portPattern = /:[0-9]*$/,\n\t\n\t // Special case for a simple path URL\n\t simplePathPattern = /^(\\/\\/?(?!\\/)[^\\?\\s]*)(\\?[^\\s]*)?$/,\n\t\n\t // RFC 2396: characters reserved for delimiting URLs.\n\t // We actually just auto-escape these.\n\t delims = ['<', '>', '\"', '`', ' ', '\\r', '\\n', '\\t'],\n\t\n\t // RFC 2396: characters not allowed for various reasons.\n\t unwise = ['{', '}', '|', '\\\\', '^', '`'].concat(delims),\n\t\n\t // Allowed by RFCs, but cause of XSS attacks. Always escape these.\n\t autoEscape = ['\\''].concat(unwise),\n\t // Characters that are never ever allowed in a hostname.\n\t // Note that any invalid chars are also handled, but these\n\t // are the ones that are *expected* to be seen, so we fast-path\n\t // them.\n\t nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape),\n\t hostEndingChars = ['/', '?', '#'],\n\t hostnameMaxLen = 255,\n\t hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,\n\t hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,\n\t // protocols that can allow \"unsafe\" and \"unwise\" chars.\n\t unsafeProtocol = {\n\t 'javascript': true,\n\t 'javascript:': true\n\t },\n\t // protocols that never have a hostname.\n\t hostlessProtocol = {\n\t 'javascript': true,\n\t 'javascript:': true\n\t },\n\t // protocols that always contain a // bit.\n\t slashedProtocol = {\n\t 'http': true,\n\t 'https': true,\n\t 'ftp': true,\n\t 'gopher': true,\n\t 'file': true,\n\t 'http:': true,\n\t 'https:': true,\n\t 'ftp:': true,\n\t 'gopher:': true,\n\t 'file:': true\n\t },\n\t querystring = __webpack_require__(20);\n\t\n\tfunction urlParse(url, parseQueryString, slashesDenoteHost) {\n\t if (url && util.isObject(url) && url instanceof Url) return url;\n\t\n\t var u = new Url;\n\t u.parse(url, parseQueryString, slashesDenoteHost);\n\t return u;\n\t}\n\t\n\tUrl.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {\n\t if (!util.isString(url)) {\n\t throw new TypeError(\"Parameter 'url' must be a string, not \" + typeof url);\n\t }\n\t\n\t // Copy chrome, IE, opera backslash-handling behavior.\n\t // Back slashes before the query string get converted to forward slashes\n\t // See: https://code.google.com/p/chromium/issues/detail?id=25916\n\t var queryIndex = url.indexOf('?'),\n\t splitter =\n\t (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#',\n\t uSplit = url.split(splitter),\n\t slashRegex = /\\\\/g;\n\t uSplit[0] = uSplit[0].replace(slashRegex, '/');\n\t url = uSplit.join(splitter);\n\t\n\t var rest = url;\n\t\n\t // trim before proceeding.\n\t // This is to support parse stuff like \" http://foo.com \\n\"\n\t rest = rest.trim();\n\t\n\t if (!slashesDenoteHost && url.split('#').length === 1) {\n\t // Try fast path regexp\n\t var simplePath = simplePathPattern.exec(rest);\n\t if (simplePath) {\n\t this.path = rest;\n\t this.href = rest;\n\t this.pathname = simplePath[1];\n\t if (simplePath[2]) {\n\t this.search = simplePath[2];\n\t if (parseQueryString) {\n\t this.query = querystring.parse(this.search.substr(1));\n\t } else {\n\t this.query = this.search.substr(1);\n\t }\n\t } else if (parseQueryString) {\n\t this.search = '';\n\t this.query = {};\n\t }\n\t return this;\n\t }\n\t }\n\t\n\t var proto = protocolPattern.exec(rest);\n\t if (proto) {\n\t proto = proto[0];\n\t var lowerProto = proto.toLowerCase();\n\t this.protocol = lowerProto;\n\t rest = rest.substr(proto.length);\n\t }\n\t\n\t // figure out if it's got a host\n\t // user@server is *always* interpreted as a hostname, and url\n\t // resolution will treat //foo/bar as host=foo,path=bar because that's\n\t // how the browser resolves relative URLs.\n\t if (slashesDenoteHost || proto || rest.match(/^\\/\\/[^@\\/]+@[^@\\/]+/)) {\n\t var slashes = rest.substr(0, 2) === '//';\n\t if (slashes && !(proto && hostlessProtocol[proto])) {\n\t rest = rest.substr(2);\n\t this.slashes = true;\n\t }\n\t }\n\t\n\t if (!hostlessProtocol[proto] &&\n\t (slashes || (proto && !slashedProtocol[proto]))) {\n\t\n\t // there's a hostname.\n\t // the first instance of /, ?, ;, or # ends the host.\n\t //\n\t // If there is an @ in the hostname, then non-host chars *are* allowed\n\t // to the left of the last @ sign, unless some host-ending character\n\t // comes *before* the @-sign.\n\t // URLs are obnoxious.\n\t //\n\t // ex:\n\t // http://a@b@c/ => user:a@b host:c\n\t // http://a@b?@c => user:a host:c path:/?@c\n\t\n\t // v0.12 TODO(isaacs): This is not quite how Chrome does things.\n\t // Review our test case against browsers more comprehensively.\n\t\n\t // find the first instance of any hostEndingChars\n\t var hostEnd = -1;\n\t for (var i = 0; i < hostEndingChars.length; i++) {\n\t var hec = rest.indexOf(hostEndingChars[i]);\n\t if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n\t hostEnd = hec;\n\t }\n\t\n\t // at this point, either we have an explicit point where the\n\t // auth portion cannot go past, or the last @ char is the decider.\n\t var auth, atSign;\n\t if (hostEnd === -1) {\n\t // atSign can be anywhere.\n\t atSign = rest.lastIndexOf('@');\n\t } else {\n\t // atSign must be in auth portion.\n\t // http://a@b/c@d => host:b auth:a path:/c@d\n\t atSign = rest.lastIndexOf('@', hostEnd);\n\t }\n\t\n\t // Now we have a portion which is definitely the auth.\n\t // Pull that off.\n\t if (atSign !== -1) {\n\t auth = rest.slice(0, atSign);\n\t rest = rest.slice(atSign + 1);\n\t this.auth = decodeURIComponent(auth);\n\t }\n\t\n\t // the host is the remaining to the left of the first non-host char\n\t hostEnd = -1;\n\t for (var i = 0; i < nonHostChars.length; i++) {\n\t var hec = rest.indexOf(nonHostChars[i]);\n\t if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n\t hostEnd = hec;\n\t }\n\t // if we still have not hit it, then the entire thing is a host.\n\t if (hostEnd === -1)\n\t hostEnd = rest.length;\n\t\n\t this.host = rest.slice(0, hostEnd);\n\t rest = rest.slice(hostEnd);\n\t\n\t // pull out port.\n\t this.parseHost();\n\t\n\t // we've indicated that there is a hostname,\n\t // so even if it's empty, it has to be present.\n\t this.hostname = this.hostname || '';\n\t\n\t // if hostname begins with [ and ends with ]\n\t // assume that it's an IPv6 address.\n\t var ipv6Hostname = this.hostname[0] === '[' &&\n\t this.hostname[this.hostname.length - 1] === ']';\n\t\n\t // validate a little.\n\t if (!ipv6Hostname) {\n\t var hostparts = this.hostname.split(/\\./);\n\t for (var i = 0, l = hostparts.length; i < l; i++) {\n\t var part = hostparts[i];\n\t if (!part) continue;\n\t if (!part.match(hostnamePartPattern)) {\n\t var newpart = '';\n\t for (var j = 0, k = part.length; j < k; j++) {\n\t if (part.charCodeAt(j) > 127) {\n\t // we replace non-ASCII char with a temporary placeholder\n\t // we need this to make sure size of hostname is not\n\t // broken by replacing non-ASCII by nothing\n\t newpart += 'x';\n\t } else {\n\t newpart += part[j];\n\t }\n\t }\n\t // we test again with ASCII char only\n\t if (!newpart.match(hostnamePartPattern)) {\n\t var validParts = hostparts.slice(0, i);\n\t var notHost = hostparts.slice(i + 1);\n\t var bit = part.match(hostnamePartStart);\n\t if (bit) {\n\t validParts.push(bit[1]);\n\t notHost.unshift(bit[2]);\n\t }\n\t if (notHost.length) {\n\t rest = '/' + notHost.join('.') + rest;\n\t }\n\t this.hostname = validParts.join('.');\n\t break;\n\t }\n\t }\n\t }\n\t }\n\t\n\t if (this.hostname.length > hostnameMaxLen) {\n\t this.hostname = '';\n\t } else {\n\t // hostnames are always lower case.\n\t this.hostname = this.hostname.toLowerCase();\n\t }\n\t\n\t if (!ipv6Hostname) {\n\t // IDNA Support: Returns a punycoded representation of \"domain\".\n\t // It only converts parts of the domain name that\n\t // have non-ASCII characters, i.e. it doesn't matter if\n\t // you call it with a domain that already is ASCII-only.\n\t this.hostname = punycode.toASCII(this.hostname);\n\t }\n\t\n\t var p = this.port ? ':' + this.port : '';\n\t var h = this.hostname || '';\n\t this.host = h + p;\n\t this.href += this.host;\n\t\n\t // strip [ and ] from the hostname\n\t // the host field still retains them, though\n\t if (ipv6Hostname) {\n\t this.hostname = this.hostname.substr(1, this.hostname.length - 2);\n\t if (rest[0] !== '/') {\n\t rest = '/' + rest;\n\t }\n\t }\n\t }\n\t\n\t // now rest is set to the post-host stuff.\n\t // chop off any delim chars.\n\t if (!unsafeProtocol[lowerProto]) {\n\t\n\t // First, make 100% sure that any \"autoEscape\" chars get\n\t // escaped, even if encodeURIComponent doesn't think they\n\t // need to be.\n\t for (var i = 0, l = autoEscape.length; i < l; i++) {\n\t var ae = autoEscape[i];\n\t if (rest.indexOf(ae) === -1)\n\t continue;\n\t var esc = encodeURIComponent(ae);\n\t if (esc === ae) {\n\t esc = escape(ae);\n\t }\n\t rest = rest.split(ae).join(esc);\n\t }\n\t }\n\t\n\t\n\t // chop off from the tail first.\n\t var hash = rest.indexOf('#');\n\t if (hash !== -1) {\n\t // got a fragment string.\n\t this.hash = rest.substr(hash);\n\t rest = rest.slice(0, hash);\n\t }\n\t var qm = rest.indexOf('?');\n\t if (qm !== -1) {\n\t this.search = rest.substr(qm);\n\t this.query = rest.substr(qm + 1);\n\t if (parseQueryString) {\n\t this.query = querystring.parse(this.query);\n\t }\n\t rest = rest.slice(0, qm);\n\t } else if (parseQueryString) {\n\t // no query string, but parseQueryString still requested\n\t this.search = '';\n\t this.query = {};\n\t }\n\t if (rest) this.pathname = rest;\n\t if (slashedProtocol[lowerProto] &&\n\t this.hostname && !this.pathname) {\n\t this.pathname = '/';\n\t }\n\t\n\t //to support http.request\n\t if (this.pathname || this.search) {\n\t var p = this.pathname || '';\n\t var s = this.search || '';\n\t this.path = p + s;\n\t }\n\t\n\t // finally, reconstruct the href based on what has been validated.\n\t this.href = this.format();\n\t return this;\n\t};\n\t\n\t// format a parsed object into a url string\n\tfunction urlFormat(obj) {\n\t // ensure it's an object, and not a string url.\n\t // If it's an obj, this is a no-op.\n\t // this way, you can call url_format() on strings\n\t // to clean up potentially wonky urls.\n\t if (util.isString(obj)) obj = urlParse(obj);\n\t if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n\t return obj.format();\n\t}\n\t\n\tUrl.prototype.format = function() {\n\t var auth = this.auth || '';\n\t if (auth) {\n\t auth = encodeURIComponent(auth);\n\t auth = auth.replace(/%3A/i, ':');\n\t auth += '@';\n\t }\n\t\n\t var protocol = this.protocol || '',\n\t pathname = this.pathname || '',\n\t hash = this.hash || '',\n\t host = false,\n\t query = '';\n\t\n\t if (this.host) {\n\t host = auth + this.host;\n\t } else if (this.hostname) {\n\t host = auth + (this.hostname.indexOf(':') === -1 ?\n\t this.hostname :\n\t '[' + this.hostname + ']');\n\t if (this.port) {\n\t host += ':' + this.port;\n\t }\n\t }\n\t\n\t if (this.query &&\n\t util.isObject(this.query) &&\n\t Object.keys(this.query).length) {\n\t query = querystring.stringify(this.query);\n\t }\n\t\n\t var search = this.search || (query && ('?' + query)) || '';\n\t\n\t if (protocol && protocol.substr(-1) !== ':') protocol += ':';\n\t\n\t // only the slashedProtocols get the //. Not mailto:, xmpp:, etc.\n\t // unless they had them to begin with.\n\t if (this.slashes ||\n\t (!protocol || slashedProtocol[protocol]) && host !== false) {\n\t host = '//' + (host || '');\n\t if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname;\n\t } else if (!host) {\n\t host = '';\n\t }\n\t\n\t if (hash && hash.charAt(0) !== '#') hash = '#' + hash;\n\t if (search && search.charAt(0) !== '?') search = '?' + search;\n\t\n\t pathname = pathname.replace(/[?#]/g, function(match) {\n\t return encodeURIComponent(match);\n\t });\n\t search = search.replace('#', '%23');\n\t\n\t return protocol + host + pathname + search + hash;\n\t};\n\t\n\tfunction urlResolve(source, relative) {\n\t return urlParse(source, false, true).resolve(relative);\n\t}\n\t\n\tUrl.prototype.resolve = function(relative) {\n\t return this.resolveObject(urlParse(relative, false, true)).format();\n\t};\n\t\n\tfunction urlResolveObject(source, relative) {\n\t if (!source) return relative;\n\t return urlParse(source, false, true).resolveObject(relative);\n\t}\n\t\n\tUrl.prototype.resolveObject = function(relative) {\n\t if (util.isString(relative)) {\n\t var rel = new Url();\n\t rel.parse(relative, false, true);\n\t relative = rel;\n\t }\n\t\n\t var result = new Url();\n\t var tkeys = Object.keys(this);\n\t for (var tk = 0; tk < tkeys.length; tk++) {\n\t var tkey = tkeys[tk];\n\t result[tkey] = this[tkey];\n\t }\n\t\n\t // hash is always overridden, no matter what.\n\t // even href=\"\" will remove it.\n\t result.hash = relative.hash;\n\t\n\t // if the relative url is empty, then there's nothing left to do here.\n\t if (relative.href === '') {\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t // hrefs like //foo/bar always cut to the protocol.\n\t if (relative.slashes && !relative.protocol) {\n\t // take everything except the protocol from relative\n\t var rkeys = Object.keys(relative);\n\t for (var rk = 0; rk < rkeys.length; rk++) {\n\t var rkey = rkeys[rk];\n\t if (rkey !== 'protocol')\n\t result[rkey] = relative[rkey];\n\t }\n\t\n\t //urlParse appends trailing / to urls like http://www.example.com\n\t if (slashedProtocol[result.protocol] &&\n\t result.hostname && !result.pathname) {\n\t result.path = result.pathname = '/';\n\t }\n\t\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t if (relative.protocol && relative.protocol !== result.protocol) {\n\t // if it's a known url protocol, then changing\n\t // the protocol does weird things\n\t // first, if it's not file:, then we MUST have a host,\n\t // and if there was a path\n\t // to begin with, then we MUST have a path.\n\t // if it is file:, then the host is dropped,\n\t // because that's known to be hostless.\n\t // anything else is assumed to be absolute.\n\t if (!slashedProtocol[relative.protocol]) {\n\t var keys = Object.keys(relative);\n\t for (var v = 0; v < keys.length; v++) {\n\t var k = keys[v];\n\t result[k] = relative[k];\n\t }\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t result.protocol = relative.protocol;\n\t if (!relative.host && !hostlessProtocol[relative.protocol]) {\n\t var relPath = (relative.pathname || '').split('/');\n\t while (relPath.length && !(relative.host = relPath.shift()));\n\t if (!relative.host) relative.host = '';\n\t if (!relative.hostname) relative.hostname = '';\n\t if (relPath[0] !== '') relPath.unshift('');\n\t if (relPath.length < 2) relPath.unshift('');\n\t result.pathname = relPath.join('/');\n\t } else {\n\t result.pathname = relative.pathname;\n\t }\n\t result.search = relative.search;\n\t result.query = relative.query;\n\t result.host = relative.host || '';\n\t result.auth = relative.auth;\n\t result.hostname = relative.hostname || relative.host;\n\t result.port = relative.port;\n\t // to support http.request\n\t if (result.pathname || result.search) {\n\t var p = result.pathname || '';\n\t var s = result.search || '';\n\t result.path = p + s;\n\t }\n\t result.slashes = result.slashes || relative.slashes;\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'),\n\t isRelAbs = (\n\t relative.host ||\n\t relative.pathname && relative.pathname.charAt(0) === '/'\n\t ),\n\t mustEndAbs = (isRelAbs || isSourceAbs ||\n\t (result.host && relative.pathname)),\n\t removeAllDots = mustEndAbs,\n\t srcPath = result.pathname && result.pathname.split('/') || [],\n\t relPath = relative.pathname && relative.pathname.split('/') || [],\n\t psychotic = result.protocol && !slashedProtocol[result.protocol];\n\t\n\t // if the url is a non-slashed url, then relative\n\t // links like ../.. should be able\n\t // to crawl up to the hostname, as well. This is strange.\n\t // result.protocol has already been set by now.\n\t // Later on, put the first path part into the host field.\n\t if (psychotic) {\n\t result.hostname = '';\n\t result.port = null;\n\t if (result.host) {\n\t if (srcPath[0] === '') srcPath[0] = result.host;\n\t else srcPath.unshift(result.host);\n\t }\n\t result.host = '';\n\t if (relative.protocol) {\n\t relative.hostname = null;\n\t relative.port = null;\n\t if (relative.host) {\n\t if (relPath[0] === '') relPath[0] = relative.host;\n\t else relPath.unshift(relative.host);\n\t }\n\t relative.host = null;\n\t }\n\t mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === '');\n\t }\n\t\n\t if (isRelAbs) {\n\t // it's absolute.\n\t result.host = (relative.host || relative.host === '') ?\n\t relative.host : result.host;\n\t result.hostname = (relative.hostname || relative.hostname === '') ?\n\t relative.hostname : result.hostname;\n\t result.search = relative.search;\n\t result.query = relative.query;\n\t srcPath = relPath;\n\t // fall through to the dot-handling below.\n\t } else if (relPath.length) {\n\t // it's relative\n\t // throw away the existing file, and take the new path instead.\n\t if (!srcPath) srcPath = [];\n\t srcPath.pop();\n\t srcPath = srcPath.concat(relPath);\n\t result.search = relative.search;\n\t result.query = relative.query;\n\t } else if (!util.isNullOrUndefined(relative.search)) {\n\t // just pull out the search.\n\t // like href='https://github.com/?foo'.\n\t // Put this after the other two cases because it simplifies the booleans\n\t if (psychotic) {\n\t result.hostname = result.host = srcPath.shift();\n\t //occationaly the auth can get stuck only in host\n\t //this especially happens in cases like\n\t //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n\t var authInHost = result.host && result.host.indexOf('@') > 0 ?\n\t result.host.split('@') : false;\n\t if (authInHost) {\n\t result.auth = authInHost.shift();\n\t result.host = result.hostname = authInHost.shift();\n\t }\n\t }\n\t result.search = relative.search;\n\t result.query = relative.query;\n\t //to support http.request\n\t if (!util.isNull(result.pathname) || !util.isNull(result.search)) {\n\t result.path = (result.pathname ? result.pathname : '') +\n\t (result.search ? result.search : '');\n\t }\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t if (!srcPath.length) {\n\t // no path at all. easy.\n\t // we've already handled the other stuff above.\n\t result.pathname = null;\n\t //to support http.request\n\t if (result.search) {\n\t result.path = '/' + result.search;\n\t } else {\n\t result.path = null;\n\t }\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t // if a url ENDs in . or .., then it must get a trailing slash.\n\t // however, if it ends in anything else non-slashy,\n\t // then it must NOT get a trailing slash.\n\t var last = srcPath.slice(-1)[0];\n\t var hasTrailingSlash = (\n\t (result.host || relative.host || srcPath.length > 1) &&\n\t (last === '.' || last === '..') || last === '');\n\t\n\t // strip single dots, resolve double dots to parent dir\n\t // if the path tries to go above the root, `up` ends up > 0\n\t var up = 0;\n\t for (var i = srcPath.length; i >= 0; i--) {\n\t last = srcPath[i];\n\t if (last === '.') {\n\t srcPath.splice(i, 1);\n\t } else if (last === '..') {\n\t srcPath.splice(i, 1);\n\t up++;\n\t } else if (up) {\n\t srcPath.splice(i, 1);\n\t up--;\n\t }\n\t }\n\t\n\t // if the path is allowed to go above the root, restore leading ..s\n\t if (!mustEndAbs && !removeAllDots) {\n\t for (; up--; up) {\n\t srcPath.unshift('..');\n\t }\n\t }\n\t\n\t if (mustEndAbs && srcPath[0] !== '' &&\n\t (!srcPath[0] || srcPath[0].charAt(0) !== '/')) {\n\t srcPath.unshift('');\n\t }\n\t\n\t if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) {\n\t srcPath.push('');\n\t }\n\t\n\t var isAbsolute = srcPath[0] === '' ||\n\t (srcPath[0] && srcPath[0].charAt(0) === '/');\n\t\n\t // put the host back\n\t if (psychotic) {\n\t result.hostname = result.host = isAbsolute ? '' :\n\t srcPath.length ? srcPath.shift() : '';\n\t //occationaly the auth can get stuck only in host\n\t //this especially happens in cases like\n\t //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n\t var authInHost = result.host && result.host.indexOf('@') > 0 ?\n\t result.host.split('@') : false;\n\t if (authInHost) {\n\t result.auth = authInHost.shift();\n\t result.host = result.hostname = authInHost.shift();\n\t }\n\t }\n\t\n\t mustEndAbs = mustEndAbs || (result.host && srcPath.length);\n\t\n\t if (mustEndAbs && !isAbsolute) {\n\t srcPath.unshift('');\n\t }\n\t\n\t if (!srcPath.length) {\n\t result.pathname = null;\n\t result.path = null;\n\t } else {\n\t result.pathname = srcPath.join('/');\n\t }\n\t\n\t //to support request.http\n\t if (!util.isNull(result.pathname) || !util.isNull(result.search)) {\n\t result.path = (result.pathname ? result.pathname : '') +\n\t (result.search ? result.search : '');\n\t }\n\t result.auth = relative.auth || result.auth;\n\t result.slashes = result.slashes || relative.slashes;\n\t result.href = result.format();\n\t return result;\n\t};\n\t\n\tUrl.prototype.parseHost = function() {\n\t var host = this.host;\n\t var port = portPattern.exec(host);\n\t if (port) {\n\t port = port[0];\n\t if (port !== ':') {\n\t this.port = port.substr(1);\n\t }\n\t host = host.substr(0, host.length - port.length);\n\t }\n\t if (host) this.hostname = host;\n\t};\n\n\n/***/ },\n/* 17 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(module, global) {/*! https://mths.be/punycode v1.3.2 by @mathias */\n\t;(function(root) {\n\t\n\t\t/** Detect free variables */\n\t\tvar freeExports = typeof exports == 'object' && exports &&\n\t\t\t!exports.nodeType && exports;\n\t\tvar freeModule = typeof module == 'object' && module &&\n\t\t\t!module.nodeType && module;\n\t\tvar freeGlobal = typeof global == 'object' && global;\n\t\tif (\n\t\t\tfreeGlobal.global === freeGlobal ||\n\t\t\tfreeGlobal.window === freeGlobal ||\n\t\t\tfreeGlobal.self === freeGlobal\n\t\t) {\n\t\t\troot = freeGlobal;\n\t\t}\n\t\n\t\t/**\n\t\t * The `punycode` object.\n\t\t * @name punycode\n\t\t * @type Object\n\t\t */\n\t\tvar punycode,\n\t\n\t\t/** Highest positive signed 32-bit float value */\n\t\tmaxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1\n\t\n\t\t/** Bootstring parameters */\n\t\tbase = 36,\n\t\ttMin = 1,\n\t\ttMax = 26,\n\t\tskew = 38,\n\t\tdamp = 700,\n\t\tinitialBias = 72,\n\t\tinitialN = 128, // 0x80\n\t\tdelimiter = '-', // '\\x2D'\n\t\n\t\t/** Regular expressions */\n\t\tregexPunycode = /^xn--/,\n\t\tregexNonASCII = /[^\\x20-\\x7E]/, // unprintable ASCII chars + non-ASCII chars\n\t\tregexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g, // RFC 3490 separators\n\t\n\t\t/** Error messages */\n\t\terrors = {\n\t\t\t'overflow': 'Overflow: input needs wider integers to process',\n\t\t\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t\t\t'invalid-input': 'Invalid input'\n\t\t},\n\t\n\t\t/** Convenience shortcuts */\n\t\tbaseMinusTMin = base - tMin,\n\t\tfloor = Math.floor,\n\t\tstringFromCharCode = String.fromCharCode,\n\t\n\t\t/** Temporary variable */\n\t\tkey;\n\t\n\t\t/*--------------------------------------------------------------------------*/\n\t\n\t\t/**\n\t\t * A generic error utility function.\n\t\t * @private\n\t\t * @param {String} type The error type.\n\t\t * @returns {Error} Throws a `RangeError` with the applicable error message.\n\t\t */\n\t\tfunction error(type) {\n\t\t\tthrow RangeError(errors[type]);\n\t\t}\n\t\n\t\t/**\n\t\t * A generic `Array#map` utility function.\n\t\t * @private\n\t\t * @param {Array} array The array to iterate over.\n\t\t * @param {Function} callback The function that gets called for every array\n\t\t * item.\n\t\t * @returns {Array} A new array of values returned by the callback function.\n\t\t */\n\t\tfunction map(array, fn) {\n\t\t\tvar length = array.length;\n\t\t\tvar result = [];\n\t\t\twhile (length--) {\n\t\t\t\tresult[length] = fn(array[length]);\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\n\t\t/**\n\t\t * A simple `Array#map`-like wrapper to work with domain name strings or email\n\t\t * addresses.\n\t\t * @private\n\t\t * @param {String} domain The domain name or email address.\n\t\t * @param {Function} callback The function that gets called for every\n\t\t * character.\n\t\t * @returns {Array} A new string of characters returned by the callback\n\t\t * function.\n\t\t */\n\t\tfunction mapDomain(string, fn) {\n\t\t\tvar parts = string.split('@');\n\t\t\tvar result = '';\n\t\t\tif (parts.length > 1) {\n\t\t\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t\t\t// the local part (i.e. everything up to `@`) intact.\n\t\t\t\tresult = parts[0] + '@';\n\t\t\t\tstring = parts[1];\n\t\t\t}\n\t\t\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\t\t\tstring = string.replace(regexSeparators, '\\x2E');\n\t\t\tvar labels = string.split('.');\n\t\t\tvar encoded = map(labels, fn).join('.');\n\t\t\treturn result + encoded;\n\t\t}\n\t\n\t\t/**\n\t\t * Creates an array containing the numeric code points of each Unicode\n\t\t * character in the string. While JavaScript uses UCS-2 internally,\n\t\t * this function will convert a pair of surrogate halves (each of which\n\t\t * UCS-2 exposes as separate characters) into a single code point,\n\t\t * matching UTF-16.\n\t\t * @see `punycode.ucs2.encode`\n\t\t * @see \n\t\t * @memberOf punycode.ucs2\n\t\t * @name decode\n\t\t * @param {String} string The Unicode input string (UCS-2).\n\t\t * @returns {Array} The new array of code points.\n\t\t */\n\t\tfunction ucs2decode(string) {\n\t\t\tvar output = [],\n\t\t\t counter = 0,\n\t\t\t length = string.length,\n\t\t\t value,\n\t\t\t extra;\n\t\t\twhile (counter < length) {\n\t\t\t\tvalue = string.charCodeAt(counter++);\n\t\t\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t\t\t// high surrogate, and there is a next character\n\t\t\t\t\textra = string.charCodeAt(counter++);\n\t\t\t\t\tif ((extra & 0xFC00) == 0xDC00) { // low surrogate\n\t\t\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// unmatched surrogate; only append this code unit, in case the next\n\t\t\t\t\t\t// code unit is the high surrogate of a surrogate pair\n\t\t\t\t\t\toutput.push(value);\n\t\t\t\t\t\tcounter--;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\toutput.push(value);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn output;\n\t\t}\n\t\n\t\t/**\n\t\t * Creates a string based on an array of numeric code points.\n\t\t * @see `punycode.ucs2.decode`\n\t\t * @memberOf punycode.ucs2\n\t\t * @name encode\n\t\t * @param {Array} codePoints The array of numeric code points.\n\t\t * @returns {String} The new Unicode string (UCS-2).\n\t\t */\n\t\tfunction ucs2encode(array) {\n\t\t\treturn map(array, function(value) {\n\t\t\t\tvar output = '';\n\t\t\t\tif (value > 0xFFFF) {\n\t\t\t\t\tvalue -= 0x10000;\n\t\t\t\t\toutput += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);\n\t\t\t\t\tvalue = 0xDC00 | value & 0x3FF;\n\t\t\t\t}\n\t\t\t\toutput += stringFromCharCode(value);\n\t\t\t\treturn output;\n\t\t\t}).join('');\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a basic code point into a digit/integer.\n\t\t * @see `digitToBasic()`\n\t\t * @private\n\t\t * @param {Number} codePoint The basic numeric code point value.\n\t\t * @returns {Number} The numeric value of a basic code point (for use in\n\t\t * representing integers) in the range `0` to `base - 1`, or `base` if\n\t\t * the code point does not represent a value.\n\t\t */\n\t\tfunction basicToDigit(codePoint) {\n\t\t\tif (codePoint - 48 < 10) {\n\t\t\t\treturn codePoint - 22;\n\t\t\t}\n\t\t\tif (codePoint - 65 < 26) {\n\t\t\t\treturn codePoint - 65;\n\t\t\t}\n\t\t\tif (codePoint - 97 < 26) {\n\t\t\t\treturn codePoint - 97;\n\t\t\t}\n\t\t\treturn base;\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a digit/integer into a basic code point.\n\t\t * @see `basicToDigit()`\n\t\t * @private\n\t\t * @param {Number} digit The numeric value of a basic code point.\n\t\t * @returns {Number} The basic code point whose value (when used for\n\t\t * representing integers) is `digit`, which needs to be in the range\n\t\t * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n\t\t * used; else, the lowercase form is used. The behavior is undefined\n\t\t * if `flag` is non-zero and `digit` has no uppercase form.\n\t\t */\n\t\tfunction digitToBasic(digit, flag) {\n\t\t\t// 0..25 map to ASCII a..z or A..Z\n\t\t\t// 26..35 map to ASCII 0..9\n\t\t\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n\t\t}\n\t\n\t\t/**\n\t\t * Bias adaptation function as per section 3.4 of RFC 3492.\n\t\t * http://tools.ietf.org/html/rfc3492#section-3.4\n\t\t * @private\n\t\t */\n\t\tfunction adapt(delta, numPoints, firstTime) {\n\t\t\tvar k = 0;\n\t\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\t\tdelta += floor(delta / numPoints);\n\t\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t\t}\n\t\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n\t\t * symbols.\n\t\t * @memberOf punycode\n\t\t * @param {String} input The Punycode string of ASCII-only symbols.\n\t\t * @returns {String} The resulting string of Unicode symbols.\n\t\t */\n\t\tfunction decode(input) {\n\t\t\t// Don't use UCS-2\n\t\t\tvar output = [],\n\t\t\t inputLength = input.length,\n\t\t\t out,\n\t\t\t i = 0,\n\t\t\t n = initialN,\n\t\t\t bias = initialBias,\n\t\t\t basic,\n\t\t\t j,\n\t\t\t index,\n\t\t\t oldi,\n\t\t\t w,\n\t\t\t k,\n\t\t\t digit,\n\t\t\t t,\n\t\t\t /** Cached calculation results */\n\t\t\t baseMinusT;\n\t\n\t\t\t// Handle the basic code points: let `basic` be the number of input code\n\t\t\t// points before the last delimiter, or `0` if there is none, then copy\n\t\t\t// the first basic code points to the output.\n\t\n\t\t\tbasic = input.lastIndexOf(delimiter);\n\t\t\tif (basic < 0) {\n\t\t\t\tbasic = 0;\n\t\t\t}\n\t\n\t\t\tfor (j = 0; j < basic; ++j) {\n\t\t\t\t// if it's not a basic code point\n\t\t\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\t\t\terror('not-basic');\n\t\t\t\t}\n\t\t\t\toutput.push(input.charCodeAt(j));\n\t\t\t}\n\t\n\t\t\t// Main decoding loop: start just after the last delimiter if any basic code\n\t\t\t// points were copied; start at the beginning otherwise.\n\t\n\t\t\tfor (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\t\n\t\t\t\t// `index` is the index of the next character to be consumed.\n\t\t\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t\t\t// which gets added to `i`. The overflow checking is easier\n\t\t\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t\t\t// value at the end to obtain `delta`.\n\t\t\t\tfor (oldi = i, w = 1, k = base; /* no condition */; k += base) {\n\t\n\t\t\t\t\tif (index >= inputLength) {\n\t\t\t\t\t\terror('invalid-input');\n\t\t\t\t\t}\n\t\n\t\t\t\t\tdigit = basicToDigit(input.charCodeAt(index++));\n\t\n\t\t\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\t\t\terror('overflow');\n\t\t\t\t\t}\n\t\n\t\t\t\t\ti += digit * w;\n\t\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\n\t\t\t\t\tif (digit < t) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tbaseMinusT = base - t;\n\t\t\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\t\t\terror('overflow');\n\t\t\t\t\t}\n\t\n\t\t\t\t\tw *= baseMinusT;\n\t\n\t\t\t\t}\n\t\n\t\t\t\tout = output.length + 1;\n\t\t\t\tbias = adapt(i - oldi, out, oldi == 0);\n\t\n\t\t\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t\t\t// incrementing `n` each time, so we'll fix that now:\n\t\t\t\tif (floor(i / out) > maxInt - n) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\t\n\t\t\t\tn += floor(i / out);\n\t\t\t\ti %= out;\n\t\n\t\t\t\t// Insert `n` at position `i` of the output\n\t\t\t\toutput.splice(i++, 0, n);\n\t\n\t\t\t}\n\t\n\t\t\treturn ucs2encode(output);\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a string of Unicode symbols (e.g. a domain name label) to a\n\t\t * Punycode string of ASCII-only symbols.\n\t\t * @memberOf punycode\n\t\t * @param {String} input The string of Unicode symbols.\n\t\t * @returns {String} The resulting Punycode string of ASCII-only symbols.\n\t\t */\n\t\tfunction encode(input) {\n\t\t\tvar n,\n\t\t\t delta,\n\t\t\t handledCPCount,\n\t\t\t basicLength,\n\t\t\t bias,\n\t\t\t j,\n\t\t\t m,\n\t\t\t q,\n\t\t\t k,\n\t\t\t t,\n\t\t\t currentValue,\n\t\t\t output = [],\n\t\t\t /** `inputLength` will hold the number of code points in `input`. */\n\t\t\t inputLength,\n\t\t\t /** Cached calculation results */\n\t\t\t handledCPCountPlusOne,\n\t\t\t baseMinusT,\n\t\t\t qMinusT;\n\t\n\t\t\t// Convert the input in UCS-2 to Unicode\n\t\t\tinput = ucs2decode(input);\n\t\n\t\t\t// Cache the length\n\t\t\tinputLength = input.length;\n\t\n\t\t\t// Initialize the state\n\t\t\tn = initialN;\n\t\t\tdelta = 0;\n\t\t\tbias = initialBias;\n\t\n\t\t\t// Handle the basic code points\n\t\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\t\tcurrentValue = input[j];\n\t\t\t\tif (currentValue < 0x80) {\n\t\t\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\thandledCPCount = basicLength = output.length;\n\t\n\t\t\t// `handledCPCount` is the number of code points that have been handled;\n\t\t\t// `basicLength` is the number of basic code points.\n\t\n\t\t\t// Finish the basic string - if it is not empty - with a delimiter\n\t\t\tif (basicLength) {\n\t\t\t\toutput.push(delimiter);\n\t\t\t}\n\t\n\t\t\t// Main encoding loop:\n\t\t\twhile (handledCPCount < inputLength) {\n\t\n\t\t\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t\t\t// larger one:\n\t\t\t\tfor (m = maxInt, j = 0; j < inputLength; ++j) {\n\t\t\t\t\tcurrentValue = input[j];\n\t\t\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\t\t\tm = currentValue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\t// Increase `delta` enough to advance the decoder's state to ,\n\t\t\t\t// but guard against overflow\n\t\t\t\thandledCPCountPlusOne = handledCPCount + 1;\n\t\t\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\t\n\t\t\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\t\t\tn = m;\n\t\n\t\t\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\t\t\tcurrentValue = input[j];\n\t\n\t\t\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\t\t\terror('overflow');\n\t\t\t\t\t}\n\t\n\t\t\t\t\tif (currentValue == n) {\n\t\t\t\t\t\t// Represent delta as a generalized variable-length integer\n\t\t\t\t\t\tfor (q = delta, k = base; /* no condition */; k += base) {\n\t\t\t\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tqMinusT = q - t;\n\t\t\t\t\t\t\tbaseMinusT = base - t;\n\t\t\t\t\t\t\toutput.push(\n\t\t\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\t\t\tdelta = 0;\n\t\t\t\t\t\t++handledCPCount;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\t++delta;\n\t\t\t\t++n;\n\t\n\t\t\t}\n\t\t\treturn output.join('');\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a Punycode string representing a domain name or an email address\n\t\t * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n\t\t * it doesn't matter if you call it on a string that has already been\n\t\t * converted to Unicode.\n\t\t * @memberOf punycode\n\t\t * @param {String} input The Punycoded domain name or email address to\n\t\t * convert to Unicode.\n\t\t * @returns {String} The Unicode representation of the given Punycode\n\t\t * string.\n\t\t */\n\t\tfunction toUnicode(input) {\n\t\t\treturn mapDomain(input, function(string) {\n\t\t\t\treturn regexPunycode.test(string)\n\t\t\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t\t\t: string;\n\t\t\t});\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a Unicode string representing a domain name or an email address to\n\t\t * Punycode. Only the non-ASCII parts of the domain name will be converted,\n\t\t * i.e. it doesn't matter if you call it with a domain that's already in\n\t\t * ASCII.\n\t\t * @memberOf punycode\n\t\t * @param {String} input The domain name or email address to convert, as a\n\t\t * Unicode string.\n\t\t * @returns {String} The Punycode representation of the given domain name or\n\t\t * email address.\n\t\t */\n\t\tfunction toASCII(input) {\n\t\t\treturn mapDomain(input, function(string) {\n\t\t\t\treturn regexNonASCII.test(string)\n\t\t\t\t\t? 'xn--' + encode(string)\n\t\t\t\t\t: string;\n\t\t\t});\n\t\t}\n\t\n\t\t/*--------------------------------------------------------------------------*/\n\t\n\t\t/** Define the public API */\n\t\tpunycode = {\n\t\t\t/**\n\t\t\t * A string representing the current Punycode.js version number.\n\t\t\t * @memberOf punycode\n\t\t\t * @type String\n\t\t\t */\n\t\t\t'version': '1.3.2',\n\t\t\t/**\n\t\t\t * An object of methods to convert from JavaScript's internal character\n\t\t\t * representation (UCS-2) to Unicode code points, and back.\n\t\t\t * @see \n\t\t\t * @memberOf punycode\n\t\t\t * @type Object\n\t\t\t */\n\t\t\t'ucs2': {\n\t\t\t\t'decode': ucs2decode,\n\t\t\t\t'encode': ucs2encode\n\t\t\t},\n\t\t\t'decode': decode,\n\t\t\t'encode': encode,\n\t\t\t'toASCII': toASCII,\n\t\t\t'toUnicode': toUnicode\n\t\t};\n\t\n\t\t/** Expose `punycode` */\n\t\t// Some AMD build optimizers, like r.js, check for specific condition patterns\n\t\t// like the following:\n\t\tif (\n\t\t\ttrue\n\t\t) {\n\t\t\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function() {\n\t\t\t\treturn punycode;\n\t\t\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t\t} else if (freeExports && freeModule) {\n\t\t\tif (module.exports == freeExports) { // in Node.js or RingoJS v0.8.0+\n\t\t\t\tfreeModule.exports = punycode;\n\t\t\t} else { // in Narwhal or RingoJS v0.7.0-\n\t\t\t\tfor (key in punycode) {\n\t\t\t\t\tpunycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]);\n\t\t\t\t}\n\t\t\t}\n\t\t} else { // in Rhino or a web browser\n\t\t\troot.punycode = punycode;\n\t\t}\n\t\n\t}(this));\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(18)(module), (function() { return this; }())))\n\n/***/ },\n/* 18 */\n/***/ function(module, exports) {\n\n\tmodule.exports = function(module) {\r\n\t\tif(!module.webpackPolyfill) {\r\n\t\t\tmodule.deprecate = function() {};\r\n\t\t\tmodule.paths = [];\r\n\t\t\t// module.parent = undefined by default\r\n\t\t\tmodule.children = [];\r\n\t\t\tmodule.webpackPolyfill = 1;\r\n\t\t}\r\n\t\treturn module;\r\n\t}\r\n\n\n/***/ },\n/* 19 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = {\n\t isString: function(arg) {\n\t return typeof(arg) === 'string';\n\t },\n\t isObject: function(arg) {\n\t return typeof(arg) === 'object' && arg !== null;\n\t },\n\t isNull: function(arg) {\n\t return arg === null;\n\t },\n\t isNullOrUndefined: function(arg) {\n\t return arg == null;\n\t }\n\t};\n\n\n/***/ },\n/* 20 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\texports.decode = exports.parse = __webpack_require__(21);\n\texports.encode = exports.stringify = __webpack_require__(22);\n\n\n/***/ },\n/* 21 */\n/***/ function(module, exports) {\n\n\t// Copyright Joyent, Inc. and other Node contributors.\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a\n\t// copy of this software and associated documentation files (the\n\t// \"Software\"), to deal in the Software without restriction, including\n\t// without limitation the rights to use, copy, modify, merge, publish,\n\t// distribute, sublicense, and/or sell copies of the Software, and to permit\n\t// persons to whom the Software is furnished to do so, subject to the\n\t// following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included\n\t// in all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n\t// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\t// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n\t// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n\t// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n\t// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n\t// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\t\n\t'use strict';\n\t\n\t// If obj.hasOwnProperty has been overridden, then calling\n\t// obj.hasOwnProperty(prop) will break.\n\t// See: https://github.com/joyent/node/issues/1707\n\tfunction hasOwnProperty(obj, prop) {\n\t return Object.prototype.hasOwnProperty.call(obj, prop);\n\t}\n\t\n\tmodule.exports = function(qs, sep, eq, options) {\n\t sep = sep || '&';\n\t eq = eq || '=';\n\t var obj = {};\n\t\n\t if (typeof qs !== 'string' || qs.length === 0) {\n\t return obj;\n\t }\n\t\n\t var regexp = /\\+/g;\n\t qs = qs.split(sep);\n\t\n\t var maxKeys = 1000;\n\t if (options && typeof options.maxKeys === 'number') {\n\t maxKeys = options.maxKeys;\n\t }\n\t\n\t var len = qs.length;\n\t // maxKeys <= 0 means that we should not limit keys count\n\t if (maxKeys > 0 && len > maxKeys) {\n\t len = maxKeys;\n\t }\n\t\n\t for (var i = 0; i < len; ++i) {\n\t var x = qs[i].replace(regexp, '%20'),\n\t idx = x.indexOf(eq),\n\t kstr, vstr, k, v;\n\t\n\t if (idx >= 0) {\n\t kstr = x.substr(0, idx);\n\t vstr = x.substr(idx + 1);\n\t } else {\n\t kstr = x;\n\t vstr = '';\n\t }\n\t\n\t k = decodeURIComponent(kstr);\n\t v = decodeURIComponent(vstr);\n\t\n\t if (!hasOwnProperty(obj, k)) {\n\t obj[k] = v;\n\t } else if (Array.isArray(obj[k])) {\n\t obj[k].push(v);\n\t } else {\n\t obj[k] = [obj[k], v];\n\t }\n\t }\n\t\n\t return obj;\n\t};\n\n\n/***/ },\n/* 22 */\n/***/ function(module, exports) {\n\n\t// Copyright Joyent, Inc. and other Node contributors.\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a\n\t// copy of this software and associated documentation files (the\n\t// \"Software\"), to deal in the Software without restriction, including\n\t// without limitation the rights to use, copy, modify, merge, publish,\n\t// distribute, sublicense, and/or sell copies of the Software, and to permit\n\t// persons to whom the Software is furnished to do so, subject to the\n\t// following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included\n\t// in all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n\t// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\t// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n\t// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n\t// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n\t// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n\t// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\t\n\t'use strict';\n\t\n\tvar stringifyPrimitive = function(v) {\n\t switch (typeof v) {\n\t case 'string':\n\t return v;\n\t\n\t case 'boolean':\n\t return v ? 'true' : 'false';\n\t\n\t case 'number':\n\t return isFinite(v) ? v : '';\n\t\n\t default:\n\t return '';\n\t }\n\t};\n\t\n\tmodule.exports = function(obj, sep, eq, name) {\n\t sep = sep || '&';\n\t eq = eq || '=';\n\t if (obj === null) {\n\t obj = undefined;\n\t }\n\t\n\t if (typeof obj === 'object') {\n\t return Object.keys(obj).map(function(k) {\n\t var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;\n\t if (Array.isArray(obj[k])) {\n\t return obj[k].map(function(v) {\n\t return ks + encodeURIComponent(stringifyPrimitive(v));\n\t }).join(sep);\n\t } else {\n\t return ks + encodeURIComponent(stringifyPrimitive(obj[k]));\n\t }\n\t }).join(sep);\n\t\n\t }\n\t\n\t if (!name) return '';\n\t return encodeURIComponent(stringifyPrimitive(name)) + eq +\n\t encodeURIComponent(stringifyPrimitive(obj));\n\t};\n\n\n/***/ },\n/* 23 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"id\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"description\": \"Core schema meta-schema\",\n\t\t\"definitions\": {\n\t\t\t\"schemaArray\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"minItems\": 1,\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"positiveInteger\": {\n\t\t\t\t\"type\": \"integer\",\n\t\t\t\t\"minimum\": 0\n\t\t\t},\n\t\t\t\"positiveIntegerDefault0\": {\n\t\t\t\t\"allOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#/definitions/positiveInteger\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"default\": 0\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"simpleTypes\": {\n\t\t\t\t\"enum\": [\n\t\t\t\t\t\"array\",\n\t\t\t\t\t\"boolean\",\n\t\t\t\t\t\"integer\",\n\t\t\t\t\t\"null\",\n\t\t\t\t\t\"number\",\n\t\t\t\t\t\"object\",\n\t\t\t\t\t\"string\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"stringArray\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t},\n\t\t\t\t\"minItems\": 1,\n\t\t\t\t\"uniqueItems\": true\n\t\t\t}\n\t\t},\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"id\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"uri\"\n\t\t\t},\n\t\t\t\"$schema\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"uri\"\n\t\t\t},\n\t\t\t\"title\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"description\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"default\": {},\n\t\t\t\"multipleOf\": {\n\t\t\t\t\"type\": \"number\",\n\t\t\t\t\"minimum\": 0,\n\t\t\t\t\"exclusiveMinimum\": true\n\t\t\t},\n\t\t\t\"maximum\": {\n\t\t\t\t\"type\": \"number\"\n\t\t\t},\n\t\t\t\"exclusiveMaximum\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"minimum\": {\n\t\t\t\t\"type\": \"number\"\n\t\t\t},\n\t\t\t\"exclusiveMinimum\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"maxLength\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveInteger\"\n\t\t\t},\n\t\t\t\"minLength\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveIntegerDefault0\"\n\t\t\t},\n\t\t\t\"pattern\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"regex\"\n\t\t\t},\n\t\t\t\"additionalItems\": {\n\t\t\t\t\"anyOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"boolean\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"items\": {\n\t\t\t\t\"anyOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#/definitions/schemaArray\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"maxItems\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveInteger\"\n\t\t\t},\n\t\t\t\"minItems\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveIntegerDefault0\"\n\t\t\t},\n\t\t\t\"uniqueItems\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"maxProperties\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveInteger\"\n\t\t\t},\n\t\t\t\"minProperties\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveIntegerDefault0\"\n\t\t\t},\n\t\t\t\"required\": {\n\t\t\t\t\"$ref\": \"#/definitions/stringArray\"\n\t\t\t},\n\t\t\t\"additionalProperties\": {\n\t\t\t\t\"anyOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"boolean\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"definitions\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": {\n\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t},\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"properties\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": {\n\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t},\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"patternProperties\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": {\n\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t},\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"dependencies\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": {\n\t\t\t\t\t\"anyOf\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"$ref\": \"#/definitions/stringArray\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"enum\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"minItems\": 1,\n\t\t\t\t\"uniqueItems\": true\n\t\t\t},\n\t\t\t\"type\": {\n\t\t\t\t\"anyOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#/definitions/simpleTypes\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"array\",\n\t\t\t\t\t\t\"items\": {\n\t\t\t\t\t\t\t\"$ref\": \"#/definitions/simpleTypes\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"minItems\": 1,\n\t\t\t\t\t\t\"uniqueItems\": true\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"allOf\": {\n\t\t\t\t\"$ref\": \"#/definitions/schemaArray\"\n\t\t\t},\n\t\t\t\"anyOf\": {\n\t\t\t\t\"$ref\": \"#/definitions/schemaArray\"\n\t\t\t},\n\t\t\t\"oneOf\": {\n\t\t\t\t\"$ref\": \"#/definitions/schemaArray\"\n\t\t\t},\n\t\t\t\"not\": {\n\t\t\t\t\"$ref\": \"#\"\n\t\t\t}\n\t\t},\n\t\t\"dependencies\": {\n\t\t\t\"exclusiveMaximum\": [\n\t\t\t\t\"maximum\"\n\t\t\t],\n\t\t\t\"exclusiveMinimum\": [\n\t\t\t\t\"minimum\"\n\t\t\t]\n\t\t},\n\t\t\"default\": {}\n\t};\n\n/***/ },\n/* 24 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tvar formats = {};\n\t\n\t// reference: http://dansnetwork.com/javascript-iso8601rfc3339-date-parser/\n\tformats['date-time'] = /(\\d\\d\\d\\d)(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))/;\n\t// reference: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js#L7\n\tformats.uri = /^([a-zA-Z][a-zA-Z0-9+-.]*:){0,1}\\/\\/[^\\s]*$/;\n\t// reference: http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363\n\t// http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'willful violation')\n\tformats.email = /^[a-zA-Z0-9.!#$%&'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n\t// reference: https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html\n\tformats.ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;\n\t// reference: http://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses\n\tformats.ipv6 = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|[fF][eE]80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::([fF]{4}(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;\n\t// reference: http://stackoverflow.com/questions/106179/regular-expression-to-match-dns-hostname-or-ip-address#answer-3824105\n\tformats.hostname = /^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])(\\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]))*$/;\n\t\n\tmodule.exports = formats;\n\n/***/ },\n/* 25 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\t// Reference: https://github.com/bestiejs/punycode.js/blob/master/punycode.js#L101`\n\t// Info: https://mathiasbynens.be/notes/javascript-unicode\n\tfunction ucs2length(string) {\n\t var ucs2len = 0,\n\t counter = 0,\n\t length = string.length,\n\t value, extra;\n\t\n\t while (counter < length) {\n\t ucs2len++;\n\t value = string.charCodeAt(counter++);\n\t\n\t if (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t // It's a high surrogate, and there is a next character.\n\t extra = string.charCodeAt(counter++);\n\t\n\t if ((extra & 0xFC00) !== 0xDC00) { /* Low surrogate. */ // jshint ignore: line\n\t counter--;\n\t }\n\t }\n\t }\n\t\n\t return ucs2len;\n\t}\n\t\n\tmodule.exports = ucs2length;\n\n/***/ }\n/******/ ])\n});\n;\n//# sourceMappingURL=models.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/powerbi-models/dist/models.js\n// module id = 5\n// module chunks = 0","import { IFilterable } from './ifilterable';\r\nimport { IReportNode } from './report';\r\nimport * as models from 'powerbi-models';\r\n\r\n/**\r\n * A Page node within a report hierarchy\r\n * \r\n * @export\r\n * @interface IPageNode\r\n */\r\nexport interface IPageNode {\r\n report: IReportNode;\r\n name: string;\r\n}\r\n\r\n/**\r\n * A Power BI report page\r\n * \r\n * @export\r\n * @class Page\r\n * @implements {IPageNode}\r\n * @implements {IFilterable}\r\n */\r\nexport class Page implements IPageNode, IFilterable {\r\n /**\r\n * The parent Power BI report that this page is a member of\r\n * \r\n * @type {IReportNode}\r\n */\r\n report: IReportNode;\r\n /**\r\n * The report page name\r\n * \r\n * @type {string}\r\n */\r\n name: string;\r\n\r\n /**\r\n * The user defined display name of the report page, which is undefined if the page is created manually\r\n * \r\n * @type {string}\r\n */\r\n displayName: string;\r\n\r\n /**\r\n * Creates an instance of a Power BI report page.\r\n * \r\n * @param {IReportNode} report\r\n * @param {string} name\r\n * @param {string} [displayName]\r\n */\r\n constructor(report: IReportNode, name: string, displayName?: string) {\r\n this.report = report;\r\n this.name = name;\r\n this.displayName = displayName;\r\n }\r\n\r\n /**\r\n * Gets all page level filters within the report.\r\n * \r\n * ```javascript\r\n * page.getFilters()\r\n * .then(pages => { ... });\r\n * ```\r\n * \r\n * @returns {(Promise)}\r\n */\r\n getFilters(): Promise {\r\n return this.report.service.hpm.get(`/report/pages/${this.name}/filters`, { uid: this.report.config.uniqueId }, this.report.iframe.contentWindow)\r\n .then(response => response.body,\r\n response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Removes all filters from this page of the report.\r\n * \r\n * ```javascript\r\n * page.removeFilters();\r\n * ```\r\n * \r\n * @returns {Promise}\r\n */\r\n removeFilters(): Promise {\r\n return this.setFilters([]);\r\n }\r\n\r\n /**\r\n * Makes the current page the active page of the report.\r\n * \r\n * ```javascripot\r\n * page.setActive();\r\n * ```\r\n * \r\n * @returns {Promise}\r\n */\r\n setActive(): Promise {\r\n const page: models.IPage = {\r\n name: this.name,\r\n displayName: null\r\n };\r\n\r\n return this.report.service.hpm.put('/report/pages/active', page, { uid: this.report.config.uniqueId }, this.report.iframe.contentWindow)\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Sets all filters on the current page.\r\n * \r\n * ```javascript\r\n * page.setFilters(filters);\r\n * .catch(errors => { ... });\r\n * ```\r\n * \r\n * @param {(models.IFilter[])} filters\r\n * @returns {Promise}\r\n */\r\n setFilters(filters: models.IFilter[]): Promise {\r\n return this.report.service.hpm.put(`/report/pages/${this.name}/filters`, filters, { uid: this.report.config.uniqueId }, this.report.iframe.contentWindow)\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/page.ts","import * as service from './service';\r\nimport * as embed from './embed';\r\nimport * as models from 'powerbi-models';\r\nimport * as wpmp from 'window-post-message-proxy';\r\nimport * as hpm from 'http-post-message';\r\nimport * as utils from './util';\r\n\r\n/**\r\n * A Dashboard node within a dashboard hierarchy\r\n * \r\n * @export\r\n * @interface IDashboardNode\r\n */\r\nexport interface IDashboardNode {\r\n iframe: HTMLIFrameElement;\r\n service: service.IService;\r\n config: embed.IInternalEmbedConfiguration\r\n}\r\n\r\n/**\r\n * A Power BI Dashboard embed component\r\n * \r\n * @export\r\n * @class Dashboard\r\n * @extends {embed.Embed}\r\n * @implements {IDashboardNode}\r\n * @implements {IFilterable}\r\n */\r\nexport class Dashboard extends embed.Embed implements IDashboardNode {\r\n static allowedEvents = [\"tileClicked\", \"error\"];\r\n static dashboardIdAttribute = 'powerbi-dashboard-id';\r\n static typeAttribute = 'powerbi-type';\r\n static type = \"Dashboard\";\r\n\r\n /**\r\n * Creates an instance of a Power BI Dashboard.\r\n * \r\n * @param {service.Service} service\r\n * @param {HTMLElement} element\r\n */\r\n constructor(service: service.Service, element: HTMLElement, config: embed.IEmbedConfiguration) {\r\n super(service, element, config);\r\n this.loadPath = \"/dashboard/load\";\r\n Array.prototype.push.apply(this.allowedEvents, Dashboard.allowedEvents);\r\n }\r\n\r\n /**\r\n * This adds backwards compatibility for older config which used the dashboardId query param to specify dashboard id.\r\n * E.g. https://powerbi-df.analysis-df.windows.net/dashboardEmbedHost?dashboardId=e9363c62-edb6-4eac-92d3-2199c5ca2a9e\r\n * \r\n * By extracting the id we can ensure id is always explicitly provided as part of the load configuration.\r\n * \r\n * @static\r\n * @param {string} url\r\n * @returns {string}\r\n */\r\n static findIdFromEmbedUrl(url: string): string {\r\n const dashboardIdRegEx = /dashboardId=\"?([^&]+)\"?/\r\n const dashboardIdMatch = url.match(dashboardIdRegEx);\r\n\r\n let dashboardId;\r\n if (dashboardIdMatch) {\r\n dashboardId = dashboardIdMatch[1];\r\n }\r\n\r\n return dashboardId;\r\n }\r\n\r\n /**\r\n * Get dashboard id from first available location: options, attribute, embed url.\r\n * \r\n * @returns {string}\r\n */\r\n getId(): string {\r\n const dashboardId = this.config.id || this.element.getAttribute(Dashboard.dashboardIdAttribute) || Dashboard.findIdFromEmbedUrl(this.config.embedUrl);\r\n\r\n if (typeof dashboardId !== 'string' || dashboardId.length === 0) {\r\n throw new Error(`Dashboard id is required, but it was not found. You must provide an id either as part of embed configuration or as attribute '${Dashboard.dashboardIdAttribute}'.`);\r\n }\r\n\r\n return dashboardId;\r\n }\r\n\r\n /**\r\n * Validate load configuration.\r\n */\r\n validate(config: models.IDashboardLoadConfiguration): models.IError[] {\r\n let error = models.validateDashboardLoad(config);\r\n return error ? error : this.ValidatePageView(config.pageView);\r\n }\r\n \r\n /**\r\n * Validate that pageView has a legal value: if page view is defined it must have one of the values defined in models.PageView\r\n */\r\n private ValidatePageView(pageView: models.PageView): models.IError[] {\r\n if (pageView && pageView !== \"fitToWidth\" && pageView !== \"oneColumn\" && pageView !== \"actualSize\") {\r\n return [{message: \"pageView must be one of the followings: fitToWidth, oneColumn, actualSize\"}];\r\n }\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/dashboard.ts","import * as models from 'powerbi-models';\r\nimport { Embed } from './embed';\r\n\r\n/**\r\n * The Power BI tile embed component\r\n * \r\n * @export\r\n * @class Tile\r\n * @extends {Embed}\r\n */\r\nexport class Tile extends Embed {\r\n static type = \"Tile\";\r\n\r\n /**\r\n * The ID of the tile\r\n * \r\n * @returns {string}\r\n */\r\n getId(): string {\r\n throw new Error('Not implemented. Embedding tiles is not supported yet.');\r\n }\r\n\r\n /**\r\n * Validate load configuration.\r\n */\r\n validate(config: any): models.IError[] {\r\n throw new Error('Not implemented. Embedding tiles is not supported yet.');\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/tile.ts","import * as service from './service';\r\nimport * as models from 'powerbi-models';\r\nimport * as embed from './embed';\r\n\r\nexport class Create extends embed.Embed {\r\n\r\n constructor(service: service.Service, element: HTMLElement, config: embed.IEmbedConfiguration) {\r\n super(service, element, config);\r\n }\r\n\r\n /**\r\n * Gets the dataset ID from the first available location: createConfig or embed url.\r\n * \r\n * @returns {string}\r\n */\r\n getId(): string {\r\n const datasetId = this.createConfig.datasetId || Create.findIdFromEmbedUrl(this.config.embedUrl);\r\n\r\n if (typeof datasetId !== 'string' || datasetId.length === 0) {\r\n throw new Error(`Dataset id is required, but it was not found. You must provide an id either as part of embed configuration'.`);\r\n }\r\n\r\n return datasetId;\r\n }\r\n\r\n /**\r\n * Validate create report configuration.\r\n */\r\n validate(config: models.IReportCreateConfiguration): models.IError[] {\r\n return models.validateCreateReport(config);\r\n }\r\n\r\n /**\r\n * Adds the ability to get datasetId from url. \r\n * (e.g. http://embedded.powerbi.com/appTokenReportEmbed?datasetId=854846ed-2106-4dc2-bc58-eb77533bf2f1).\r\n * \r\n * By extracting the ID we can ensure that the ID is always explicitly provided as part of the create configuration.\r\n * \r\n * @static\r\n * @param {string} url\r\n * @returns {string}\r\n */\r\n static findIdFromEmbedUrl(url: string): string {\r\n const datasetIdRegEx = /datasetId=\"?([^&]+)\"?/\r\n const datasetIdMatch = url.match(datasetIdRegEx);\r\n\r\n let datasetId;\r\n if (datasetIdMatch) {\r\n datasetId = datasetIdMatch[1];\r\n }\r\n\r\n return datasetId;\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/create.ts","/**\r\n * TODO: Need to find better place for these factory functions or refactor how we handle dependency injection\r\n */\r\nimport { IHpmFactory, IWpmpFactory, IRouterFactory } from './service';\r\nimport config from './config';\r\nimport * as wpmp from 'window-post-message-proxy';\r\nimport * as hpm from 'http-post-message';\r\nimport * as router from 'powerbi-router';\r\n\r\nexport {\r\n IHpmFactory,\r\n IWpmpFactory,\r\n IRouterFactory\r\n};\r\n\r\nexport const hpmFactory: IHpmFactory = (wpmp, defaultTargetWindow, sdkVersion = config.version, sdkType = config.type) => {\r\n return new hpm.HttpPostMessage(wpmp, {\r\n 'x-sdk-type': sdkType,\r\n 'x-sdk-version': sdkVersion\r\n }, defaultTargetWindow);\r\n};\r\n\r\nexport const wpmpFactory: IWpmpFactory = (name?: string, logMessages?: boolean, eventSourceOverrideWindow?: Window) => {\r\n return new wpmp.WindowPostMessageProxy({\r\n processTrackingProperties: {\r\n addTrackingProperties: hpm.HttpPostMessage.addTrackingProperties,\r\n getTrackingProperties: hpm.HttpPostMessage.getTrackingProperties,\r\n },\r\n isErrorMessage: hpm.HttpPostMessage.isErrorMessage,\r\n name,\r\n logMessages,\r\n eventSourceOverrideWindow\r\n });\r\n};\r\n\r\nexport const routerFactory: IRouterFactory = (wpmp) => {\r\n return new router.Router(wpmp);\r\n};\n\n\n// WEBPACK FOOTER //\n// ./src/factories.ts","const config = {\r\n version: '2.2.3',\r\n type: 'js'\r\n};\r\n\r\nexport default config;\n\n\n// WEBPACK FOOTER //\n// ./src/config.ts","/*! window-post-message-proxy v0.2.4 | (c) 2016 Microsoft Corporation MIT */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"window-post-message-proxy\"] = factory();\n\telse\n\t\troot[\"window-post-message-proxy\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\tvar WindowPostMessageProxy = (function () {\n\t function WindowPostMessageProxy(options) {\n\t var _this = this;\n\t if (options === void 0) { options = {\n\t processTrackingProperties: {\n\t addTrackingProperties: WindowPostMessageProxy.defaultAddTrackingProperties,\n\t getTrackingProperties: WindowPostMessageProxy.defaultGetTrackingProperties\n\t },\n\t isErrorMessage: WindowPostMessageProxy.defaultIsErrorMessage,\n\t receiveWindow: window,\n\t name: WindowPostMessageProxy.createRandomString()\n\t }; }\n\t this.pendingRequestPromises = {};\n\t // save options with defaults\n\t this.addTrackingProperties = (options.processTrackingProperties && options.processTrackingProperties.addTrackingProperties) || WindowPostMessageProxy.defaultAddTrackingProperties;\n\t this.getTrackingProperties = (options.processTrackingProperties && options.processTrackingProperties.getTrackingProperties) || WindowPostMessageProxy.defaultGetTrackingProperties;\n\t this.isErrorMessage = options.isErrorMessage || WindowPostMessageProxy.defaultIsErrorMessage;\n\t this.receiveWindow = options.receiveWindow || window;\n\t this.name = options.name || WindowPostMessageProxy.createRandomString();\n\t this.logMessages = options.logMessages || false;\n\t this.eventSourceOverrideWindow = options.eventSourceOverrideWindow;\n\t this.suppressWarnings = options.suppressWarnings || false;\n\t if (this.logMessages) {\n\t console.log(\"new WindowPostMessageProxy created with name: \" + this.name + \" receiving on window: \" + this.receiveWindow.document.title);\n\t }\n\t // Initialize\n\t this.handlers = [];\n\t this.windowMessageHandler = function (event) { return _this.onMessageReceived(event); };\n\t this.start();\n\t }\n\t // Static\n\t WindowPostMessageProxy.defaultAddTrackingProperties = function (message, trackingProperties) {\n\t message[WindowPostMessageProxy.messagePropertyName] = trackingProperties;\n\t return message;\n\t };\n\t WindowPostMessageProxy.defaultGetTrackingProperties = function (message) {\n\t return message[WindowPostMessageProxy.messagePropertyName];\n\t };\n\t WindowPostMessageProxy.defaultIsErrorMessage = function (message) {\n\t return !!message.error;\n\t };\n\t /**\n\t * Utility to create a deferred object.\n\t */\n\t // TODO: Look to use RSVP library instead of doing this manually.\n\t // From what I searched RSVP would work better because it has .finally and .deferred; however, it doesn't have Typings information. \n\t WindowPostMessageProxy.createDeferred = function () {\n\t var deferred = {\n\t resolve: null,\n\t reject: null,\n\t promise: null\n\t };\n\t var promise = new Promise(function (resolve, reject) {\n\t deferred.resolve = resolve;\n\t deferred.reject = reject;\n\t });\n\t deferred.promise = promise;\n\t return deferred;\n\t };\n\t /**\n\t * Utility to generate random sequence of characters used as tracking id for promises.\n\t */\n\t WindowPostMessageProxy.createRandomString = function () {\n\t return (Math.random() + 1).toString(36).substring(7);\n\t };\n\t /**\n\t * Adds handler.\n\t * If the first handler whose test method returns true will handle the message and provide a response.\n\t */\n\t WindowPostMessageProxy.prototype.addHandler = function (handler) {\n\t this.handlers.push(handler);\n\t };\n\t /**\n\t * Removes handler.\n\t * The reference must match the original object that was provided when adding the handler.\n\t */\n\t WindowPostMessageProxy.prototype.removeHandler = function (handler) {\n\t var handlerIndex = this.handlers.indexOf(handler);\n\t if (handlerIndex === -1) {\n\t throw new Error(\"You attempted to remove a handler but no matching handler was found.\");\n\t }\n\t this.handlers.splice(handlerIndex, 1);\n\t };\n\t /**\n\t * Start listening to message events.\n\t */\n\t WindowPostMessageProxy.prototype.start = function () {\n\t this.receiveWindow.addEventListener('message', this.windowMessageHandler);\n\t };\n\t /**\n\t * Stops listening to message events.\n\t */\n\t WindowPostMessageProxy.prototype.stop = function () {\n\t this.receiveWindow.removeEventListener('message', this.windowMessageHandler);\n\t };\n\t /**\n\t * Post message to target window with tracking properties added and save deferred object referenced by tracking id.\n\t */\n\t WindowPostMessageProxy.prototype.postMessage = function (targetWindow, message) {\n\t // Add tracking properties to indicate message came from this proxy\n\t var trackingProperties = { id: WindowPostMessageProxy.createRandomString() };\n\t this.addTrackingProperties(message, trackingProperties);\n\t if (this.logMessages) {\n\t console.log(this.name + \" Posting message:\");\n\t console.log(JSON.stringify(message, null, ' '));\n\t }\n\t targetWindow.postMessage(message, \"*\");\n\t var deferred = WindowPostMessageProxy.createDeferred();\n\t this.pendingRequestPromises[trackingProperties.id] = deferred;\n\t return deferred.promise;\n\t };\n\t /**\n\t * Send response message to target window.\n\t * Response messages re-use tracking properties from a previous request message.\n\t */\n\t WindowPostMessageProxy.prototype.sendResponse = function (targetWindow, message, trackingProperties) {\n\t this.addTrackingProperties(message, trackingProperties);\n\t if (this.logMessages) {\n\t console.log(this.name + \" Sending response:\");\n\t console.log(JSON.stringify(message, null, ' '));\n\t }\n\t targetWindow.postMessage(message, \"*\");\n\t };\n\t /**\n\t * Message handler.\n\t */\n\t WindowPostMessageProxy.prototype.onMessageReceived = function (event) {\n\t var _this = this;\n\t if (this.logMessages) {\n\t console.log(this.name + \" Received message:\");\n\t console.log(\"type: \" + event.type);\n\t console.log(JSON.stringify(event.data, null, ' '));\n\t }\n\t var sendingWindow = this.eventSourceOverrideWindow || event.source;\n\t var message = event.data;\n\t if (typeof message !== \"object\") {\n\t if (!this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + this.name + \"): Received message that was not an object. Discarding message\");\n\t }\n\t return;\n\t }\n\t var trackingProperties;\n\t try {\n\t trackingProperties = this.getTrackingProperties(message);\n\t }\n\t catch (e) {\n\t if (!this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + this.name + \"): Error occurred when attempting to get tracking properties from incoming message:\", JSON.stringify(message, null, ' '), \"Error: \", e);\n\t }\n\t }\n\t var deferred;\n\t if (trackingProperties) {\n\t deferred = this.pendingRequestPromises[trackingProperties.id];\n\t }\n\t // If message does not have a known ID, treat it as a request\n\t // Otherwise, treat message as response\n\t if (!deferred) {\n\t var handled = this.handlers.some(function (handler) {\n\t var canMessageBeHandled = false;\n\t try {\n\t canMessageBeHandled = handler.test(message);\n\t }\n\t catch (e) {\n\t if (!_this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + _this.name + \"): Error occurred when handler was testing incoming message:\", JSON.stringify(message, null, ' '), \"Error: \", e);\n\t }\n\t }\n\t if (canMessageBeHandled) {\n\t var responseMessagePromise = void 0;\n\t try {\n\t responseMessagePromise = Promise.resolve(handler.handle(message));\n\t }\n\t catch (e) {\n\t if (!_this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + _this.name + \"): Error occurred when handler was processing incoming message:\", JSON.stringify(message, null, ' '), \"Error: \", e);\n\t }\n\t responseMessagePromise = Promise.resolve();\n\t }\n\t responseMessagePromise\n\t .then(function (responseMessage) {\n\t if (!responseMessage) {\n\t var warningMessage = \"Handler for message: \" + JSON.stringify(message, null, ' ') + \" did not return a response message. The default response message will be returned instead.\";\n\t if (!_this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + _this.name + \"): \" + warningMessage);\n\t }\n\t responseMessage = {\n\t warning: warningMessage\n\t };\n\t }\n\t _this.sendResponse(sendingWindow, responseMessage, trackingProperties);\n\t });\n\t return true;\n\t }\n\t });\n\t /**\n\t * TODO: Consider returning an error message if nothing handled the message.\n\t * In the case of the Report receiving messages all of them should be handled,\n\t * however, in the case of the SDK receiving messages it's likely it won't register handlers\n\t * for all events. Perhaps make this an option at construction time.\n\t */\n\t if (!handled && !this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + this.name + \") did not handle message. Handlers: \" + this.handlers.length + \" Message: \" + JSON.stringify(message, null, '') + \".\");\n\t }\n\t }\n\t else {\n\t /**\n\t * If error message reject promise,\n\t * Otherwise, resolve promise\n\t */\n\t var isErrorMessage = true;\n\t try {\n\t isErrorMessage = this.isErrorMessage(message);\n\t }\n\t catch (e) {\n\t console.warn(\"Proxy(\" + this.name + \") Error occurred when trying to determine if message is consider an error response. Message: \", JSON.stringify(message, null, ''), 'Error: ', e);\n\t }\n\t if (isErrorMessage) {\n\t deferred.reject(message);\n\t }\n\t else {\n\t deferred.resolve(message);\n\t }\n\t // TODO: Move to .finally clause up where promise is created for better maitenance like original proxy code.\n\t delete this.pendingRequestPromises[trackingProperties.id];\n\t }\n\t };\n\t WindowPostMessageProxy.messagePropertyName = \"windowPostMessageProxy\";\n\t return WindowPostMessageProxy;\n\t}());\n\texports.WindowPostMessageProxy = WindowPostMessageProxy;\n\n\n/***/ }\n/******/ ])\n});\n;\n//# sourceMappingURL=windowPostMessageProxy.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/window-post-message-proxy/dist/windowPostMessageProxy.js\n// module id = 12\n// module chunks = 0","/*! http-post-message v0.2.3 | (c) 2016 Microsoft Corporation MIT */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"http-post-message\"] = factory();\n\telse\n\t\troot[\"http-post-message\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\tvar HttpPostMessage = (function () {\n\t function HttpPostMessage(windowPostMessageProxy, defaultHeaders, defaultTargetWindow) {\n\t if (defaultHeaders === void 0) { defaultHeaders = {}; }\n\t this.defaultHeaders = defaultHeaders;\n\t this.defaultTargetWindow = defaultTargetWindow;\n\t this.windowPostMessageProxy = windowPostMessageProxy;\n\t }\n\t // TODO: See if it's possible to share tracking properties interface?\n\t // The responsibility of knowing how to configure windowPostMessageProxy for http should\n\t // live in this http class, but the configuration would need ITrackingProperties\n\t // interface which lives in WindowPostMessageProxy. Use type as workaround\n\t HttpPostMessage.addTrackingProperties = function (message, trackingProperties) {\n\t message.headers = message.headers || {};\n\t if (trackingProperties && trackingProperties.id) {\n\t message.headers.id = trackingProperties.id;\n\t }\n\t return message;\n\t };\n\t HttpPostMessage.getTrackingProperties = function (message) {\n\t return {\n\t id: message.headers && message.headers.id\n\t };\n\t };\n\t HttpPostMessage.isErrorMessage = function (message) {\n\t if (typeof (message && message.statusCode) !== 'number') {\n\t return false;\n\t }\n\t return !(200 <= message.statusCode && message.statusCode < 300);\n\t };\n\t HttpPostMessage.prototype.get = function (url, headers, targetWindow) {\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"GET\",\n\t url: url,\n\t headers: headers\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.post = function (url, body, headers, targetWindow) {\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"POST\",\n\t url: url,\n\t headers: headers,\n\t body: body\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.put = function (url, body, headers, targetWindow) {\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"PUT\",\n\t url: url,\n\t headers: headers,\n\t body: body\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.patch = function (url, body, headers, targetWindow) {\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"PATCH\",\n\t url: url,\n\t headers: headers,\n\t body: body\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.delete = function (url, body, headers, targetWindow) {\n\t if (body === void 0) { body = null; }\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"DELETE\",\n\t url: url,\n\t headers: headers,\n\t body: body\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.send = function (request, targetWindow) {\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t request.headers = this.assign({}, this.defaultHeaders, request.headers);\n\t if (!targetWindow) {\n\t throw new Error(\"target window is not provided. You must either provide the target window explicitly as argument to request, or specify default target window when constructing instance of this class.\");\n\t }\n\t return this.windowPostMessageProxy.postMessage(targetWindow, request);\n\t };\n\t /**\n\t * Object.assign() polyfill\n\t * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\n\t */\n\t HttpPostMessage.prototype.assign = function (target) {\n\t var sources = [];\n\t for (var _i = 1; _i < arguments.length; _i++) {\n\t sources[_i - 1] = arguments[_i];\n\t }\n\t if (target === undefined || target === null) {\n\t throw new TypeError('Cannot convert undefined or null to object');\n\t }\n\t var output = Object(target);\n\t sources.forEach(function (source) {\n\t if (source !== undefined && source !== null) {\n\t for (var nextKey in source) {\n\t if (Object.prototype.hasOwnProperty.call(source, nextKey)) {\n\t output[nextKey] = source[nextKey];\n\t }\n\t }\n\t }\n\t });\n\t return output;\n\t };\n\t return HttpPostMessage;\n\t}());\n\texports.HttpPostMessage = HttpPostMessage;\n\n\n/***/ }\n/******/ ])\n});\n;\n//# sourceMappingURL=httpPostMessage.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/http-post-message/dist/httpPostMessage.js\n// module id = 13\n// module chunks = 0","/*! powerbi-router v0.1.5 | (c) 2016 Microsoft Corporation MIT */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"powerbi-router\"] = factory();\n\telse\n\t\troot[\"powerbi-router\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar RouteRecognizer = __webpack_require__(1);\n\tvar Router = (function () {\n\t function Router(handlers) {\n\t this.handlers = handlers;\n\t /**\n\t * TODO: look at generating the router dynamically based on list of supported http methods\n\t * instead of hardcoding the creation of these and the methods.\n\t */\n\t this.getRouteRecognizer = new RouteRecognizer();\n\t this.patchRouteRecognizer = new RouteRecognizer();\n\t this.postRouteRecognizer = new RouteRecognizer();\n\t this.putRouteRecognizer = new RouteRecognizer();\n\t this.deleteRouteRecognizer = new RouteRecognizer();\n\t }\n\t Router.prototype.get = function (url, handler) {\n\t this.registerHandler(this.getRouteRecognizer, \"GET\", url, handler);\n\t return this;\n\t };\n\t Router.prototype.patch = function (url, handler) {\n\t this.registerHandler(this.patchRouteRecognizer, \"PATCH\", url, handler);\n\t return this;\n\t };\n\t Router.prototype.post = function (url, handler) {\n\t this.registerHandler(this.postRouteRecognizer, \"POST\", url, handler);\n\t return this;\n\t };\n\t Router.prototype.put = function (url, handler) {\n\t this.registerHandler(this.putRouteRecognizer, \"PUT\", url, handler);\n\t return this;\n\t };\n\t Router.prototype.delete = function (url, handler) {\n\t this.registerHandler(this.deleteRouteRecognizer, \"DELETE\", url, handler);\n\t return this;\n\t };\n\t /**\n\t * TODO: This method could use some refactoring. There is conflict of interest between keeping clean separation of test and handle method\n\t * Test method only returns boolean indicating if request can be handled, and handle method has opportunity to modify response and return promise of it.\n\t * In the case of the router with route-recognizer where handlers are associated with routes, this already guarantees that only one handler is selected and makes the test method feel complicated\n\t * Will leave as is an investigate cleaner ways at later time.\n\t */\n\t Router.prototype.registerHandler = function (routeRecognizer, method, url, handler) {\n\t var routeRecognizerHandler = function (request) {\n\t var response = new Response();\n\t return Promise.resolve(handler(request, response))\n\t .then(function (x) { return response; });\n\t };\n\t routeRecognizer.add([\n\t { path: url, handler: routeRecognizerHandler }\n\t ]);\n\t var internalHandler = {\n\t test: function (request) {\n\t if (request.method !== method) {\n\t return false;\n\t }\n\t var matchingRoutes = routeRecognizer.recognize(request.url);\n\t if (matchingRoutes === undefined) {\n\t return false;\n\t }\n\t /**\n\t * Copy parameters from recognized route to the request so they can be used within the handler function\n\t * This isn't ideal because it is side affect which modifies the request instead of strictly testing for true or false\n\t * but I don't see a better place to put this. If we move it between the call to test and the handle it becomes part of the window post message proxy\n\t * even though it's responsibility is related to routing.\n\t */\n\t var route = matchingRoutes[0];\n\t request.params = route.params;\n\t request.queryParams = matchingRoutes.queryParams;\n\t request.handler = route.handler;\n\t return true;\n\t },\n\t handle: function (request) {\n\t return request.handler(request);\n\t }\n\t };\n\t this.handlers.addHandler(internalHandler);\n\t };\n\t return Router;\n\t}());\n\texports.Router = Router;\n\tvar Response = (function () {\n\t function Response() {\n\t this.statusCode = 200;\n\t this.headers = {};\n\t this.body = null;\n\t }\n\t Response.prototype.send = function (statusCode, body) {\n\t this.statusCode = statusCode;\n\t this.body = body;\n\t };\n\t return Response;\n\t}());\n\texports.Response = Response;\n\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(module) {(function() {\n\t \"use strict\";\n\t function $$route$recognizer$dsl$$Target(path, matcher, delegate) {\n\t this.path = path;\n\t this.matcher = matcher;\n\t this.delegate = delegate;\n\t }\n\t\n\t $$route$recognizer$dsl$$Target.prototype = {\n\t to: function(target, callback) {\n\t var delegate = this.delegate;\n\t\n\t if (delegate && delegate.willAddRoute) {\n\t target = delegate.willAddRoute(this.matcher.target, target);\n\t }\n\t\n\t this.matcher.add(this.path, target);\n\t\n\t if (callback) {\n\t if (callback.length === 0) { throw new Error(\"You must have an argument in the function passed to `to`\"); }\n\t this.matcher.addChild(this.path, target, callback, this.delegate);\n\t }\n\t return this;\n\t }\n\t };\n\t\n\t function $$route$recognizer$dsl$$Matcher(target) {\n\t this.routes = {};\n\t this.children = {};\n\t this.target = target;\n\t }\n\t\n\t $$route$recognizer$dsl$$Matcher.prototype = {\n\t add: function(path, handler) {\n\t this.routes[path] = handler;\n\t },\n\t\n\t addChild: function(path, target, callback, delegate) {\n\t var matcher = new $$route$recognizer$dsl$$Matcher(target);\n\t this.children[path] = matcher;\n\t\n\t var match = $$route$recognizer$dsl$$generateMatch(path, matcher, delegate);\n\t\n\t if (delegate && delegate.contextEntered) {\n\t delegate.contextEntered(target, match);\n\t }\n\t\n\t callback(match);\n\t }\n\t };\n\t\n\t function $$route$recognizer$dsl$$generateMatch(startingPath, matcher, delegate) {\n\t return function(path, nestedCallback) {\n\t var fullPath = startingPath + path;\n\t\n\t if (nestedCallback) {\n\t nestedCallback($$route$recognizer$dsl$$generateMatch(fullPath, matcher, delegate));\n\t } else {\n\t return new $$route$recognizer$dsl$$Target(startingPath + path, matcher, delegate);\n\t }\n\t };\n\t }\n\t\n\t function $$route$recognizer$dsl$$addRoute(routeArray, path, handler) {\n\t var len = 0;\n\t for (var i=0; i z`. For instance, \"199\" is smaller\n\t // then \"200\", even though \"y\" and \"z\" (which are both 9) are larger than \"0\" (the value\n\t // of (`b` and `c`). This is because the leading symbol, \"2\", is larger than the other\n\t // leading symbol, \"1\".\n\t // The rule is that symbols to the left carry more weight than symbols to the right\n\t // when a number is written out as a string. In the above strings, the leading digit\n\t // represents how many 100's are in the number, and it carries more weight than the middle\n\t // number which represents how many 10's are in the number.\n\t // This system of number magnitude works well for route specificity, too. A route written as\n\t // `a/b/c` will be more specific than `x/y/z` as long as `a` is more specific than\n\t // `x`, irrespective of the other parts.\n\t // Because of this similarity, we assign each type of segment a number value written as a\n\t // string. We can find the specificity of compound routes by concatenating these strings\n\t // together, from left to right. After we have looped through all of the segments,\n\t // we convert the string to a number.\n\t specificity.val = '';\n\t\n\t for (var i=0; i 2 && key.slice(keyLength -2) === '[]') {\n\t isArray = true;\n\t key = key.slice(0, keyLength - 2);\n\t if(!queryParams[key]) {\n\t queryParams[key] = [];\n\t }\n\t }\n\t value = pair[1] ? $$route$recognizer$$decodeQueryParamPart(pair[1]) : '';\n\t }\n\t if (isArray) {\n\t queryParams[key].push(value);\n\t } else {\n\t queryParams[key] = value;\n\t }\n\t }\n\t return queryParams;\n\t },\n\t\n\t recognize: function(path) {\n\t var states = [ this.rootState ],\n\t pathLen, i, l, queryStart, queryParams = {},\n\t isSlashDropped = false;\n\t\n\t queryStart = path.indexOf('?');\n\t if (queryStart !== -1) {\n\t var queryString = path.substr(queryStart + 1, path.length);\n\t path = path.substr(0, queryStart);\n\t queryParams = this.parseQueryString(queryString);\n\t }\n\t\n\t path = decodeURI(path);\n\t\n\t if (path.charAt(0) !== \"/\") { path = \"/\" + path; }\n\t\n\t pathLen = path.length;\n\t if (pathLen > 1 && path.charAt(pathLen - 1) === \"/\") {\n\t path = path.substr(0, pathLen - 1);\n\t isSlashDropped = true;\n\t }\n\t\n\t for (i=0; i';this.element.innerHTML=a,this.iframe=this.element.childNodes[0],this.iframe.addEventListener("load",function(){return o.load(o.config)},!1)}return e.prototype.load=function(e){var t=this,r=this.validate(e);if(r)throw r;return this.service.hpm.post(this.loadPath,e,{uid:this.config.uniqueId},this.iframe.contentWindow).then(function(r){return n.assign(t.config,e),r.body},function(e){throw e.body})},e.prototype.off=function(e,t){var r=this,i={name:e,type:null,id:null,value:null};if(t)n.remove(function(e){return e.test(i)&&e.handle===t},this.eventHandlers),this.element.removeEventListener(e,t);else{var o=this.eventHandlers.filter(function(e){return e.test(i)});o.forEach(function(t){n.remove(function(e){return e===t},r.eventHandlers),r.element.removeEventListener(e,t.handle)})}},e.prototype.on=function(e,t){if(this.allowedEvents.indexOf(e)===-1)throw new Error("eventName is must be one of "+this.allowedEvents+". You passed: "+e);this.eventHandlers.push({test:function(t){return t.name===e},handle:t}),this.element.addEventListener(e,t)},e.prototype.reload=function(){return this.load(this.config)},e.prototype.getAccessToken=function(t){var r=this.config.accessToken||this.element.getAttribute(e.accessTokenAttribute)||t;if(!r)throw new Error("No access token was found for element. You must specify an access token directly on the element using attribute '"+e.accessTokenAttribute+"' or specify a global token at: powerbi.accessToken.");return r},e.prototype.getEmbedUrl=function(){var t=this.config.embedUrl||this.element.getAttribute(e.embedUrlAttribute);if("string"!=typeof t||0===t.length)throw new Error("Embed Url is required, but it was not found. You must provide an embed url either as part of embed configuration or as attribute '"+e.embedUrlAttribute+"'.");return t},e.prototype.getUniqueId=function(){return this.config.uniqueId||this.element.getAttribute(e.nameAttribute)||n.createRandomString()},e.prototype.fullscreen=function(){var e=this.iframe.requestFullscreen||this.iframe.msRequestFullscreen||this.iframe.mozRequestFullScreen||this.iframe.webkitRequestFullscreen;e.call(this.iframe)},e.prototype.exitFullscreen=function(){if(this.isFullscreen(this.iframe)){var e=document.exitFullscreen||document.mozCancelFullScreen||document.webkitExitFullscreen||document.msExitFullscreen;e.call(document)}},e.prototype.isFullscreen=function(e){var t=["fullscreenElement","webkitFullscreenElement","mozFullscreenScreenElement","msFullscreenElement"];return t.some(function(t){return document[t]===e})},e.allowedEvents=["loaded"],e.accessTokenAttribute="powerbi-access-token",e.embedUrlAttribute="powerbi-embed-url",e.nameAttribute="powerbi-name",e.typeAttribute="powerbi-type",e.defaultSettings={filterPaneEnabled:!0},e}();t.Embed=i},function(e,t){function r(e,t,r){var n;"function"==typeof CustomEvent?n=new CustomEvent(t,{detail:r,bubbles:!0,cancelable:!0}):(n=document.createEvent("CustomEvent"),n.initCustomEvent(t,!0,!0,r)),e.dispatchEvent(n)}function n(e,t){if(!Array.isArray(t))throw new Error("You attempted to call find with second parameter that was not an array. You passed: "+t);var r;return t.some(function(t,n){if(e(t))return r=n,!0}),r}function i(e,t){var r=n(e,t);return t[r]}function o(e,t){var r=n(e,t);t.splice(r,1)}function s(){for(var e=[],t=0;t2)throw new Error("AdvancedFilters may not have more than two conditions. You passed: "+i.length);if(1===s.length&&"And"!==n)throw new Error('Logical Operator must be "And" when there is only one condition provided');this.conditions=s}return h(t,e),t.prototype.toJSON=function(){var t=e.prototype.toJSON.call(this);return t.logicalOperator=this.logicalOperator,t.conditions=this.conditions,t},t.schemaUrl="http://powerbi.com/product/schema#advanced",t}(d);t.AdvancedFilter=l},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{target:{oneOf:[{type:"object",properties:{table:{type:"string"},column:{type:"string"}},required:["table","column"]},{type:"object",properties:{table:{type:"string"},hierarchy:{type:"string"},hierarchyLevel:{type:"string"}},required:["table","hierarchy","hierarchyLevel"]},{type:"object",properties:{table:{type:"string"},measure:{type:"string"}},required:["table","measure"]}]},logicalOperator:{type:"string"},conditions:{type:"array",items:{type:"object",properties:{value:{type:["string","boolean","number"]},operator:{type:"string"}},required:["value","operator"]}}},required:["target","logicalOperator","conditions"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",oneOf:[{$ref:"#basicFilter"},{$ref:"#advancedFilter"}],invalidMessage:"filter is invalid"}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{accessToken:{type:"string",messages:{type:"accessToken must be a string",required:"accessToken is required"}},id:{type:"string",messages:{type:"id must be a string",required:"id is required"}},settings:{$ref:"#settings"},pageName:{type:"string",messages:{type:"pageName must be a string"}},filters:{type:"array",items:{type:"object",oneOf:[{$ref:"#basicFilter"},{$ref:"#advancedFilter"}]},invalidMessage:"filters property is invalid"}},required:["accessToken","id"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{accessToken:{type:"string",messages:{type:"accessToken must be a string",required:"accessToken is required"}},id:{type:"string",messages:{type:"id must be a string",required:"id is required"}},pageView:{type:"string",messages:{type:'pageView must be a string with one of the following values: "actualSize", "fitToWidth", "oneColumn"'}}},required:["accessToken","id"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{name:{type:"string",messages:{type:"name must be a string",required:"name is required"}}},required:["name"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{filterPaneEnabled:{type:"boolean",messages:{type:"filterPaneEnabled must be a boolean"}},navContentPaneEnabled:{type:"boolean",messages:{type:"navContentPaneEnabled must be a boolean"}}}}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{target:{type:"object",properties:{table:{type:"string"},column:{type:"string"},hierarchy:{type:"string"},hierarchyLevel:{type:"string"},measure:{type:"string"}},required:["table"]},operator:{type:"string"},values:{type:"array",items:{type:["string","boolean","number"]}}},required:["target","operator","values"]}},function(e,t,r){e.exports=r(9)},function(e,t,r){"use strict";function n(e){return e=e instanceof RegExp?e:new RegExp(e),A?e.toString():"/"+e.source.replace(v,"\\$&")+"/"}function i(e){return'"'+e.replace(y,"\\$1")+'"'}function o(e,t){return b.lastIndex=0,b.test(t)?e+"."+t:e+"["+i(t)+"]"}function s(e){if(void 0===e)return"undefined";var t=Object.prototype.toString.call(e);return t.substr(8,t.length-9).toLowerCase()}function a(e){return(0|e)===e}function c(e,t){q[t].type=e,q[t].keyword=t}function h(e){var t,r,n,i=Object.keys(e),o=i.indexOf("properties"),s=i.indexOf("patternProperties"),a={"enum":Array.isArray(e["enum"])&&e["enum"].length>0,type:null,allType:[],perType:{}};for(e.type&&("string"==typeof e.type?a.type=[e.type]:Array.isArray(e.type)&&e.type.length&&(a.type=e.type.slice(0))),n=0;n-1&&"required"===t||s>-1&&"additionalProperties"===t||a.perType[r.type].push(t)):a.allType.push(t)));return a}function u(e,t){var r,n,i=e.substr(4),o=i.length,s=[],a="",c=!1;for(n=0;n "+e.schema.maximum+") {"),e.error("maximum"),e.code("}"))},q.exclusiveMaximum=function(e){e.schema.exclusiveMaximum===!0&&"number"==typeof e.schema.maximum&&(e.code("if ("+e.path+" === "+e.schema.maximum+") {"),e.error("exclusiveMaximum"),e.code("}"))},q.multipleOf=function(e){if("number"==typeof e.schema.multipleOf){var t=e.schema.multipleOf,r=t.toString().length-t.toFixed(0).length-1,n=r>0?Math.pow(10,r):1,i=e.path;r>0?e.code("if (+(Math.round(("+i+" * "+n+') + "e+" + '+r+') + "e-" + '+r+") % "+t*n+" !== 0) {"):e.code("if ((("+i+" * "+n+") % "+t*n+") !== 0) {"),e.error("multipleOf"),e.code("}")}},q.minLength=function(e){a(e.schema.minLength)&&(e.code("if (ucs2length("+e.path+") < "+e.schema.minLength+") {"),e.error("minLength"),e.code("}"))},q.maxLength=function(e){a(e.schema.maxLength)&&(e.code("if (ucs2length("+e.path+") > "+e.schema.maxLength+") {"),e.error("maxLength"),e.code("}"))},q.pattern=function(e){var t=e.schema.pattern;("string"==typeof t||t instanceof RegExp)&&(e.code("if (!("+n(t)+").test("+e.path+")) {"),e.error("pattern"),e.code("}"))},q.format=function(e){"string"==typeof e.schema.format&&S[e.schema.format]&&(e.code("if (!("+S[e.schema.format]+").test("+e.path+")) {"),e.error("format"),e.code("}"))},q.minItems=function(e){a(e.schema.minItems)&&(e.code("if ("+e.path+".length < "+e.schema.minItems+") {"),e.error("minItems"),e.code("}"))},q.maxItems=function(e){a(e.schema.maxItems)&&(e.code("if ("+e.path+".length > "+e.schema.maxItems+") {"),e.error("maxItems"),e.code("}"))},q.additionalItems=function(e){e.schema.additionalItems===!1&&Array.isArray(e.schema.items)&&(e.code("if ("+e.path+".length > "+e.schema.items.length+") {"),e.error("additionalItems"),e.code("}"))},q.uniqueItems=function(e){e.schema.uniqueItems&&(e.code("if (unique("+e.path+").length !== "+e.path+".length) {"),e.error("uniqueItems"),e.code("}"))},q.items=function(e){var t=e.declare(0),r=0;if("object"===s(e.schema.items))e.code("for ("+t+" = 0; "+t+" < "+e.path+".length; "+t+"++) {"),e.descend(e.path+"["+t+"]",e.schema.items),e.code("}");else if(Array.isArray(e.schema.items)){for(;r= "+r+") {"),e.descend(e.path+"["+r+"]",e.schema.items[r]),e.code("}");"object"===s(e.schema.additionalItems)&&(e.code("for ("+t+" = "+r+"; "+t+" < "+e.path+".length; "+t+"++) {"),e.descend(e.path+"["+t+"]",e.schema.additionalItems),e.code("}"))}},q.maxProperties=function(e){a(e.schema.maxProperties)&&(e.code("if (Object.keys("+e.path+").length > "+e.schema.maxProperties+") {"),e.error("maxProperties"),e.code("}"))},q.minProperties=function(e){a(e.schema.minProperties)&&(e.code("if (Object.keys("+e.path+").length < "+e.schema.minProperties+") {"),e.error("minProperties"),e.code("}"))},q.required=function(e){if(Array.isArray(e.schema.required))for(var t=0;t-1&&(e.code("else {"),e.error("required",t),e.code("}"))},q.patternProperties=q.additionalProperties=function(e){var t,r,i,o,a,c,h,u="object"===s(e.schema.properties)?Object.keys(e.schema.properties):[],p=e.schema.patternProperties,d="object"===s(p)?Object.keys(p):[],f=e.schema.additionalProperties,l=f===!1||"object"===s(f);if(d.length||l){for(r=e.declare("[]"),i=e.declare('""'),o=e.declare(0),l&&(a=e.declare(!1)),e.code(r+" = Object.keys("+e.path+")"),e.code("for ("+o+" = 0; "+o+" < "+r+".length; "+o+"++) {")(i+" = "+r+"["+o+"]")("if ("+e.path+"["+i+"] === undefined) {")("continue")("}"),l&&e.code(a+" = false"),h=0;h -1) {")("continue")("}")),e.code("if (!"+a+") {"),f===!1?e.error("additionalProperties",void 0,i):e.descend(e.path+"["+i+"]",f),e.code("}")),e.code("}")}},q.dependencies=function(e){if("object"===s(e.schema.dependencies))for(var t,r,n=Object.keys(e.schema.dependencies),i=n.length,a=0,c=0;c1&&delete this.objects[n][r]},f.prototype.dispose=function(){this.objects.length=0,this.properties.length=0},m.prototype.clone=function(e){var t=new m({schema:e,formats:this.formats,greedy:this.greedy,resolver:this.resolver,id:this.id,funcache:this.funcache,scope:this.scope});return t},m.prototype.declare=function(e){var t=this.id();return this.code.def(t,e),t},m.prototype.cache=function(e,t){var r,n=this.funcache[e];return n||(n=this.funcache[e]={key:this.id()},r=this.clone(t),n.func=r.compile(n.key),this.scope.refs[n.key]=n.func,r.dispose()),"refs."+n.key},m.prototype.error=function(e,t,r){var n=this.schema,o=this.path,s="data"!==o||t?'(path ? path + "." : "") + '+u(o,t)+",":"path,",a=t&&n.properties&&n.properties[t]?this.resolver.resolve(n.properties[t]):null,c=a?a.requiredMessage:n.invalidMessage;c||(c=a&&a.messages&&a.messages[e]||n.messages&&n.messages[e]),this.code("errors.push({"),c&&this.code("message: "+i(c)+","),r&&this.code("additionalProperties: "+r+","),this.code("path: "+s)("keyword: "+i(e))("})"),this.greedy||this.code("return")},m.prototype.refactor=function(e,t,r){var n="data"!==e?'(path ? path + "." : "") + '+u(e):"path",i=this.cache(r,t),o=this.declare();this.code(o+" = "+i+"("+e+", "+n+", errors)"),this.greedy||this.code("if (errors.length) { return }")},m.prototype.descend=function(e,t){var r=this.path,n=this.schema;this.path=e,this.schema=t,this.generate(),this.path=r,this.schema=n},m.prototype.generate=function(){function e(e){q[e](l)}var t,r,o,a,c,u,p,d=this.path,f=this.schema,l=this,m=this.scope;if("object"===s(f)){if(void 0!==f.$ref){if(f=this.resolver.resolve(f),this.resolver.hasRef(f))return void this.refactor(d,f,this.resolver.getNormalizedRef(this.schema)||this.schema.$ref);this.schema=f}if(o=h(f),o["enum"])return void q["enum"](l);for(a=Object.keys(o.perType),p=0;p-1&&o.type.splice(c,1));o.type&&(o.type.length?(this.code((a.length?"else ":"")+"if (!("+o.type.map(function(e){return C[e]?C[e](d):"true"}).join(" || ")+")) {"),this.error("type"),this.code("}")):(this.code("else {"),this.error("type"),this.code("}"))),o.allType.forEach(function(e){q[e](l)}),f.format&&this.formats&&(r=this.formats[f.format],r&&("string"==typeof r||r instanceof RegExp?(this.code("if (!("+n(r)+").test("+d+")) {"),this.error("format"),this.code("}")):"function"==typeof r&&((m.formats||(m.formats={}))[f.format]=r,(m.schemas||(m.schemas={}))[f.format]=f,t=i(f.format),this.code("if (!formats["+t+"]("+d+", schemas["+t+"])) {"),this.error("format"),this.code("}"))))}},m.prototype.compile=function(e){return this.code=E("jsen_compiled"+(e?"_"+e:""),"data","path","errors"),this.generate(),this.code.compile(this.scope)},m.prototype.dispose=function(){for(var e in this)this[e]=void 0},g.browser=x,g.clone=p,g.equal=O,g.unique=P,g.ucs2length=I,g.SchemaResolver=j,g.resolve=j.resolvePointer,e.exports=g},function(e,t){"use strict";e.exports=function(){var e=Array.apply(null,arguments),t=e.shift(),r=" ",n="",i="",o=1,s="{[",a="}]",c=function(){for(var e=r,t=0;t++-1&&s.indexOf(r)>-1?(o--,h(e),o++):s.indexOf(r)>-1?(h(e),o++):a.indexOf(t)>-1?(o--,h(e)):h(e),u};return u.def=function(e,t){return i+=(i?",\n"+r+" ":"")+e+(void 0!==t?" = "+t:""),u},u.toSource=function(){return"function "+t+"("+e.join(", ")+") {\n"+r+'"use strict"\n'+(i?r+"var "+i+";\n":"")+n+"}"},u.compile=function(e){var t="return ("+u.toSource()+")",r=e||{},n=Object.keys(r),i=n.map(function(e){return r[e]});return Function.apply(null,n.concat(t)).apply(null,i)},u}},function(e,t){"use strict";function r(e){var t=Object.prototype.toString.call(e);return t.substr(8,t.length-9).toLowerCase()}function n(e,t){var r,n,o=Object.keys(e).sort(),s=Object.keys(t).sort();if(!i(o,s))return!1;for(r=0;r-1)throw new Error(u+" "+t);return this.refStack.push(t),r=this._resolveRef(t),this.refStack.pop(),e===this.rootSchema&&(this.resolvedRootSchema=r),r},o.prototype.hasRef=function(e){var t,r,n,i,o=Object.keys(e);if(o.indexOf("$ref")>-1)return!0;for(n=0,t=o.length;n';this.element.innerHTML=r,this.iframe=this.element.childNodes[0]}e?this.iframe.addEventListener("load",function(){return t.load(t.config)},!1):this.iframe.addEventListener("load",function(){return t.createReport(t.createConfig)},!1)},e.allowedEvents=["loaded","saved"],e.accessTokenAttribute="powerbi-access-token",e.embedUrlAttribute="powerbi-embed-url",e.nameAttribute="powerbi-name",e.typeAttribute="powerbi-type",e.defaultSettings={filterPaneEnabled:!0},e}();t.Embed=i},function(e,t){function r(e,t,r){var n;"function"==typeof CustomEvent?n=new CustomEvent(t,{detail:r,bubbles:!0,cancelable:!0}):(n=document.createEvent("CustomEvent"),n.initCustomEvent(t,!0,!0,r)),e.dispatchEvent(n)}function n(e,t){if(!Array.isArray(t))throw new Error("You attempted to call find with second parameter that was not an array. You passed: "+t);var r;return t.some(function(t,n){if(e(t))return r=n,!0}),r}function i(e,t){var r=n(e,t);return t[r]}function o(e,t){var r=n(e,t);t.splice(r,1)}function s(){for(var e=[],t=0;t0&&!i)throw new Error("You shold pass the values to be filtered for each key. You passed: no values and "+o+" keys");if(0===o&&i&&i.length>0)throw new Error("You passed key values but your target object doesn't contain the keys to be filtered");for(var s=0;s2)throw new Error("AdvancedFilters may not have more than two conditions. You passed: "+i.length);if(1===s.length&&"And"!==n)throw new Error('Logical Operator must be "And" when there is only one condition provided');this.conditions=s}return d(t,e),t.prototype.toJSON=function(){var t=e.prototype.toJSON.call(this);return t.logicalOperator=this.logicalOperator,t.conditions=this.conditions,t},t.schemaUrl="http://powerbi.com/product/schema#advanced",t}(l);t.AdvancedFilter=y,function(e){e[e.Read=0]="Read",e[e.ReadWrite=1]="ReadWrite",e[e.Copy=2]="Copy",e[e.Create=4]="Create",e[e.All=7]="All"}(t.Permissions||(t.Permissions={}));t.Permissions;!function(e){e[e.View=0]="View",e[e.Edit=1]="Edit"}(t.ViewMode||(t.ViewMode={}));t.ViewMode;t.validateSaveAsParameters=i(t.saveAsParametersSchema)},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{target:{oneOf:[{type:"object",properties:{table:{type:"string"},column:{type:"string"}},required:["table","column"]},{type:"object",properties:{table:{type:"string"},hierarchy:{type:"string"},hierarchyLevel:{type:"string"}},required:["table","hierarchy","hierarchyLevel"]},{type:"object",properties:{table:{type:"string"},measure:{type:"string"}},required:["table","measure"]}]},logicalOperator:{type:"string"},conditions:{type:"array",items:{type:"object",properties:{value:{type:["string","boolean","number"]},operator:{type:"string"}},required:["value","operator"]}}},required:["target","logicalOperator","conditions"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",oneOf:[{$ref:"#basicFilter"},{$ref:"#advancedFilter"}],invalidMessage:"filter is invalid"}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{accessToken:{type:"string",messages:{type:"accessToken must be a string",required:"accessToken is required"}},id:{type:"string",messages:{type:"id must be a string",required:"id is required"}},settings:{$ref:"#settings"},pageName:{type:"string",messages:{type:"pageName must be a string"}},filters:{type:"array",items:{type:"object",oneOf:[{$ref:"#basicFilter"},{$ref:"#advancedFilter"}]},invalidMessage:"filters property is invalid"},permissions:{type:"number","enum":[0,1,2,3],"default":0,invalidMessage:"permissions property is invalid"},viewMode:{type:"number","enum":[0,1],"default":0,invalidMessage:"viewMode property is invalid"}},required:["accessToken","id"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{accessToken:{type:"string",messages:{type:"accessToken must be a string",required:"accessToken is required"}},id:{type:"string",messages:{type:"id must be a string",required:"id is required"}},pageView:{type:"string",messages:{type:'pageView must be a string with one of the following values: "actualSize", "fitToWidth", "oneColumn"'}}},required:["accessToken","id"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{name:{type:"string",messages:{type:"name must be a string",required:"name is required"}}},required:["name"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{filterPaneEnabled:{type:"boolean",messages:{type:"filterPaneEnabled must be a boolean"}},navContentPaneEnabled:{type:"boolean",messages:{type:"navContentPaneEnabled must be a boolean"}},useCustomSaveAsDialog:{type:"boolean",messages:{type:"useCustomSaveAsDialog must be a boolean"}}}}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{target:{type:"object",properties:{table:{type:"string"},column:{type:"string"},hierarchy:{type:"string"},hierarchyLevel:{type:"string"},measure:{type:"string"}},required:["table"]},operator:{type:"string"},values:{type:"array",items:{type:["string","boolean","number"]}}},required:["target","operator","values"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{accessToken:{type:"string",messages:{type:"accessToken must be a string",required:"accessToken is required"}},datasetId:{type:"string",messages:{type:"datasetId must be a string",required:"datasetId is required"}}},required:["accessToken","datasetId"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{name:{type:"string",messages:{type:"name must be a string",required:"name is required"}}},required:["name"]}},function(e,t,r){e.exports=r(11)},function(e,t,r){"use strict";function n(e){return e=e instanceof RegExp?e:new RegExp(e),A?e.toString():"/"+e.source.replace(y,"\\$&")+"/"}function i(e){return'"'+e.replace(v,"\\$1")+'"'}function o(e,t){return b.lastIndex=0,b.test(t)?e+"."+t:e+"["+i(t)+"]"}function s(e){if(void 0===e)return"undefined";var t=Object.prototype.toString.call(e);return t.substr(8,t.length-9).toLowerCase()}function a(e){return(0|e)===e}function c(e,t){C[t].type=e,C[t].keyword=t}function h(e){var t,r,n,i=Object.keys(e),o=i.indexOf("properties"),s=i.indexOf("patternProperties"),a={"enum":Array.isArray(e["enum"])&&e["enum"].length>0,type:null,allType:[],perType:{}};for(e.type&&("string"==typeof e.type?a.type=[e.type]:Array.isArray(e.type)&&e.type.length&&(a.type=e.type.slice(0))),n=0;n-1&&"required"===t||s>-1&&"additionalProperties"===t||a.perType[r.type].push(t)):a.allType.push(t)));return a}function u(e,t){var r,n,i=e.substr(4),o=i.length,s=[],a="",c=!1;for(n=0;n "+e.schema.maximum+") {"),e.error("maximum"),e.code("}"))},C.exclusiveMaximum=function(e){e.schema.exclusiveMaximum===!0&&"number"==typeof e.schema.maximum&&(e.code("if ("+e.path+" === "+e.schema.maximum+") {"),e.error("exclusiveMaximum"),e.code("}"))},C.multipleOf=function(e){if("number"==typeof e.schema.multipleOf){var t=e.schema.multipleOf,r=t.toString().length-t.toFixed(0).length-1,n=r>0?Math.pow(10,r):1,i=e.path;r>0?e.code("if (+(Math.round(("+i+" * "+n+') + "e+" + '+r+') + "e-" + '+r+") % "+t*n+" !== 0) {"):e.code("if ((("+i+" * "+n+") % "+t*n+") !== 0) {"),e.error("multipleOf"),e.code("}")}},C.minLength=function(e){a(e.schema.minLength)&&(e.code("if (ucs2length("+e.path+") < "+e.schema.minLength+") {"),e.error("minLength"),e.code("}"))},C.maxLength=function(e){a(e.schema.maxLength)&&(e.code("if (ucs2length("+e.path+") > "+e.schema.maxLength+") {"),e.error("maxLength"),e.code("}"))},C.pattern=function(e){var t=e.schema.pattern;("string"==typeof t||t instanceof RegExp)&&(e.code("if (!("+n(t)+").test("+e.path+")) {"),e.error("pattern"),e.code("}"))},C.format=function(e){"string"==typeof e.schema.format&&I[e.schema.format]&&(e.code("if (!("+I[e.schema.format]+").test("+e.path+")) {"),e.error("format"),e.code("}"))},C.minItems=function(e){a(e.schema.minItems)&&(e.code("if ("+e.path+".length < "+e.schema.minItems+") {"),e.error("minItems"),e.code("}"))},C.maxItems=function(e){a(e.schema.maxItems)&&(e.code("if ("+e.path+".length > "+e.schema.maxItems+") {"),e.error("maxItems"),e.code("}"))},C.additionalItems=function(e){e.schema.additionalItems===!1&&Array.isArray(e.schema.items)&&(e.code("if ("+e.path+".length > "+e.schema.items.length+") {"),e.error("additionalItems"),e.code("}"))},C.uniqueItems=function(e){e.schema.uniqueItems&&(e.code("if (unique("+e.path+").length !== "+e.path+".length) {"),e.error("uniqueItems"),e.code("}"))},C.items=function(e){var t=e.declare(0),r=0;if("object"===s(e.schema.items))e.code("for ("+t+" = 0; "+t+" < "+e.path+".length; "+t+"++) {"),e.descend(e.path+"["+t+"]",e.schema.items),e.code("}");else if(Array.isArray(e.schema.items)){for(;r= "+r+") {"),e.descend(e.path+"["+r+"]",e.schema.items[r]),e.code("}");"object"===s(e.schema.additionalItems)&&(e.code("for ("+t+" = "+r+"; "+t+" < "+e.path+".length; "+t+"++) {"),e.descend(e.path+"["+t+"]",e.schema.additionalItems),e.code("}"))}},C.maxProperties=function(e){a(e.schema.maxProperties)&&(e.code("if (Object.keys("+e.path+").length > "+e.schema.maxProperties+") {"),e.error("maxProperties"),e.code("}"))},C.minProperties=function(e){a(e.schema.minProperties)&&(e.code("if (Object.keys("+e.path+").length < "+e.schema.minProperties+") {"),e.error("minProperties"),e.code("}"))},C.required=function(e){if(Array.isArray(e.schema.required))for(var t=0;t-1&&(e.code("else {"),e.error("required",t),e.code("}"))},C.patternProperties=C.additionalProperties=function(e){var t,r,i,o,a,c,h,u="object"===s(e.schema.properties)?Object.keys(e.schema.properties):[],d=e.schema.patternProperties,p="object"===s(d)?Object.keys(d):[],f=e.schema.additionalProperties,l=f===!1||"object"===s(f);if(p.length||l){for(r=e.declare("[]"),i=e.declare('""'),o=e.declare(0),l&&(a=e.declare(!1)),e.code(r+" = Object.keys("+e.path+")"),e.code("for ("+o+" = 0; "+o+" < "+r+".length; "+o+"++) {")(i+" = "+r+"["+o+"]")("if ("+e.path+"["+i+"] === undefined) {")("continue")("}"),l&&e.code(a+" = false"),h=0;h -1) {")("continue")("}")),e.code("if (!"+a+") {"),f===!1?e.error("additionalProperties",void 0,i):e.descend(e.path+"["+i+"]",f),e.code("}")),e.code("}")}},C.dependencies=function(e){if("object"===s(e.schema.dependencies))for(var t,r,n=Object.keys(e.schema.dependencies),i=n.length,a=0,c=0;c1&&delete this.objects[n][r]},f.prototype.dispose=function(){this.objects.length=0,this.properties.length=0},m.prototype.clone=function(e){var t=new m({schema:e,formats:this.formats,greedy:this.greedy,resolver:this.resolver,id:this.id,funcache:this.funcache,scope:this.scope});return t},m.prototype.declare=function(e){var t=this.id();return this.code.def(t,e),t},m.prototype.cache=function(e,t){var r,n=this.funcache[e];return n||(n=this.funcache[e]={key:this.id()},r=this.clone(t),n.func=r.compile(n.key),this.scope.refs[n.key]=n.func,r.dispose()),"refs."+n.key},m.prototype.error=function(e,t,r){var n=this.schema,o=this.path,s="data"!==o||t?'(path ? path + "." : "") + '+u(o,t)+",":"path,",a=t&&n.properties&&n.properties[t]?this.resolver.resolve(n.properties[t]):null,c=a?a.requiredMessage:n.invalidMessage;c||(c=a&&a.messages&&a.messages[e]||n.messages&&n.messages[e]),this.code("errors.push({"),c&&this.code("message: "+i(c)+","),r&&this.code("additionalProperties: "+r+","),this.code("path: "+s)("keyword: "+i(e))("})"),this.greedy||this.code("return")},m.prototype.refactor=function(e,t,r){var n="data"!==e?'(path ? path + "." : "") + '+u(e):"path",i=this.cache(r,t),o=this.declare();this.code(o+" = "+i+"("+e+", "+n+", errors)"),this.greedy||this.code("if (errors.length) { return }")},m.prototype.descend=function(e,t){var r=this.path,n=this.schema;this.path=e,this.schema=t,this.generate(),this.path=r,this.schema=n},m.prototype.generate=function(){function e(e){C[e](l)}var t,r,o,a,c,u,d,p=this.path,f=this.schema,l=this,m=this.scope;if("object"===s(f)){if(void 0!==f.$ref){if(f=this.resolver.resolve(f),this.resolver.hasRef(f))return void this.refactor(p,f,this.resolver.getNormalizedRef(this.schema)||this.schema.$ref);this.schema=f}if(o=h(f),o["enum"])return void C["enum"](l);for(a=Object.keys(o.perType),d=0;d-1&&o.type.splice(c,1));o.type&&(o.type.length?(this.code((a.length?"else ":"")+"if (!("+o.type.map(function(e){return k[e]?k[e](p):"true"}).join(" || ")+")) {"),this.error("type"),this.code("}")):(this.code("else {"),this.error("type"),this.code("}"))),o.allType.forEach(function(e){C[e](l)}),f.format&&this.formats&&(r=this.formats[f.format],r&&("string"==typeof r||r instanceof RegExp?(this.code("if (!("+n(r)+").test("+p+")) {"),this.error("format"),this.code("}")):"function"==typeof r&&((m.formats||(m.formats={}))[f.format]=r,(m.schemas||(m.schemas={}))[f.format]=f,t=i(f.format),this.code("if (!formats["+t+"]("+p+", schemas["+t+"])) {"),this.error("format"),this.code("}"))))}},m.prototype.compile=function(e){return this.code=E("jsen_compiled"+(e?"_"+e:""),"data","path","errors"),this.generate(),this.code.compile(this.scope)},m.prototype.dispose=function(){for(var e in this)this[e]=void 0},g.browser=x,g.clone=d,g.equal=O,g.unique=P,g.ucs2length=S,g.SchemaResolver=j,g.resolve=j.resolvePointer,e.exports=g},function(e,t){"use strict";e.exports=function(){var e=Array.apply(null,arguments),t=e.shift(),r=" ",n="",i="",o=1,s="{[",a="}]",c=function(){for(var e=r,t=0;t++-1&&s.indexOf(r)>-1?(o--,h(e),o++):s.indexOf(r)>-1?(h(e),o++):a.indexOf(t)>-1?(o--,h(e)):h(e),u};return u.def=function(e,t){return i+=(i?",\n"+r+" ":"")+e+(void 0!==t?" = "+t:""),u},u.toSource=function(){return"function "+t+"("+e.join(", ")+") {\n"+r+'"use strict"\n'+(i?r+"var "+i+";\n":"")+n+"}"},u.compile=function(e){var t="return ("+u.toSource()+")",r=e||{},n=Object.keys(r),i=n.map(function(e){return r[e]});return Function.apply(null,n.concat(t)).apply(null,i)},u}},function(e,t){"use strict";function r(e){var t=Object.prototype.toString.call(e);return t.substr(8,t.length-9).toLowerCase()}function n(e,t){var r,n,o=Object.keys(e).sort(),s=Object.keys(t).sort();if(!i(o,s))return!1;for(r=0;r-1)throw new Error(u+" "+t);return this.refStack.push(t),r=this._resolveRef(t),this.refStack.pop(),e===this.rootSchema&&(this.resolvedRootSchema=r),r},o.prototype.hasRef=function(e){var t,r,n,i,o=Object.keys(e);if(o.indexOf("$ref")>-1)return!0;for(n=0,t=o.length;n",'"',"`"," ","\r","\n","\t"],g=["{","}","|","\\","^","`"].concat(m),v=["'"].concat(g),y=["%","/","?",";","#"].concat(v),b=["/","?","#"],w=255,x=/^[a-z0-9A-Z_-]{0,63}$/,A=/^([a-z0-9A-Z_-]{0,63})(.*)$/,E={javascript:!0,"javascript:":!0},O={javascript:!0,"javascript:":!0},P={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},j=r(17);n.prototype.parse=function(e,t,r){if(!c(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var n=e;n=n.trim();var i=f.exec(n);if(i){i=i[0];var o=i.toLowerCase();this.protocol=o,n=n.substr(i.length)}if(r||i||n.match(/^\/\/[^@\/]+@[^@\/]+/)){var s="//"===n.substr(0,2);!s||i&&O[i]||(n=n.substr(2),this.slashes=!0)}if(!O[i]&&(s||i&&!P[i])){for(var a=-1,h=0;h127?"x":I[q];if(!C.match(x)){var R=g.slice(0,h),T=g.slice(h+1),F=I.match(A);F&&(R.push(F[1]),T.unshift(F[2])),T.length&&(n="/"+T.join(".")+n),this.hostname=R.join(".");break}}}if(this.hostname.length>w?this.hostname="":this.hostname=this.hostname.toLowerCase(),!m){for(var M=this.hostname.split("."),$=[],h=0;h0)&&r.host.split("@");g&&(r.auth=g.shift(),r.host=r.hostname=g.shift())}return r.search=e.search,r.query=e.query,u(r.pathname)&&u(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!l.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var v=l.slice(-1)[0],y=(r.host||e.host)&&("."===v||".."===v)||""===v,b=0,w=l.length;w>=0;w--)v=l[w],"."==v?l.splice(w,1):".."===v?(l.splice(w,1),b++):b&&(l.splice(w,1),b--);if(!d&&!f)for(;b--;b)l.unshift("..");!d||""===l[0]||l[0]&&"/"===l[0].charAt(0)||l.unshift(""),y&&"/"!==l.join("/").substr(-1)&&l.push("");var x=""===l[0]||l[0]&&"/"===l[0].charAt(0);if(m){r.hostname=r.host=x?"":l.length?l.shift():"";var g=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@");g&&(r.auth=g.shift(),r.host=r.hostname=g.shift())}return d=d||r.host&&l.length,d&&!x&&l.unshift(""),l.length?r.pathname=l.join("/"):(r.pathname=null,r.path=null),u(r.pathname)&&u(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},n.prototype.parseHost=function(){var e=this.host,t=l.exec(e);t&&(t=t[0],":"!==t&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,r){var n;(function(e,i){!function(o){function s(e){throw RangeError(R[e])}function a(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function c(e,t){var r=e.split("@"),n="";r.length>1&&(n=r[0]+"@",e=r[1]),e=e.replace(k,".");var i=e.split("."),o=a(i,t).join(".");return n+o}function h(e){for(var t,r,n=[],i=0,o=e.length;i=55296&&t<=56319&&i65535&&(e-=65536,t+=M(e>>>10&1023|55296),e=56320|1023&e),t+=M(e)}).join("")}function p(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:x}function d(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function f(e,t,r){var n=0;for(e=r?F(e/P):e>>1,e+=F(e/t);e>T*E>>1;n+=x)e=F(e/T);return F(n+(T+1)*e/(e+O))}function l(e){var t,r,n,i,o,a,c,h,d,l,m=[],g=e.length,v=0,y=S,b=j;for(r=e.lastIndexOf(I),r<0&&(r=0),n=0;n=128&&s("not-basic"),m.push(e.charCodeAt(n));for(i=r>0?r+1:0;i=g&&s("invalid-input"),h=p(e.charCodeAt(i++)),(h>=x||h>F((w-v)/a))&&s("overflow"),v+=h*a,d=c<=b?A:c>=b+E?E:c-b,!(hF(w/l)&&s("overflow"),a*=l;t=m.length+1,b=f(v-o,t,0==o),F(v/t)>w-y&&s("overflow"),y+=F(v/t),v%=t,m.splice(v++,0,y)}return u(m)}function m(e){var t,r,n,i,o,a,c,u,p,l,m,g,v,y,b,O=[];for(e=h(e),g=e.length,t=S,r=0,o=j,a=0;a=t&&mF((w-r)/v)&&s("overflow"),r+=(c-t)*v,t=c,a=0;aw&&s("overflow"),m==t){for(u=r,p=x;l=p<=o?A:p>=o+E?E:p-o,!(u= 0x80 (not a basic code point)","invalid-input":"Invalid input"},T=x-A,F=Math.floor,M=String.fromCharCode;b={version:"1.3.2",ucs2:{decode:h,encode:u},decode:l,encode:m,toASCII:v,toUnicode:g},n=function(){return b}.call(t,r,t,e),!(void 0!==n&&(e.exports=n))}(this)}).call(t,r(16)(e),function(){return this}())},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],e.webpackPolyfill=1),e}},function(e,t,r){"use strict";t.decode=t.parse=r(18),t.encode=t.stringify=r(19)},function(e,t){ +"use strict";function n(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function i(e,t,r){if(e&&h.isObject(e)&&e instanceof n)return e;var i=new n;return i.parse(e,t,r),i}function o(e){return h.isString(e)&&(e=i(e)),e instanceof n?e.format():n.prototype.format.call(e)}function s(e,t){return i(e,!1,!0).resolve(t)}function a(e,t){return e?i(e,!1,!0).resolveObject(t):t}var c=r(17),h=r(19);t.parse=i,t.resolve=s,t.resolveObject=a,t.format=o,t.Url=n;var u=/^([a-z0-9.+-]+:)/i,d=/:[0-9]*$/,p=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,f=["<",">",'"',"`"," ","\r","\n","\t"],l=["{","}","|","\\","^","`"].concat(f),m=["'"].concat(l),g=["%","/","?",";","#"].concat(m),y=["/","?","#"],v=255,b=/^[+a-z0-9A-Z_-]{0,63}$/,w=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,x={javascript:!0,"javascript:":!0},A={javascript:!0,"javascript:":!0},E={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},O=r(20);n.prototype.parse=function(e,t,r){if(!h.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var n=e.indexOf("?"),i=n!==-1&&n127?"x":F[$];if(!M.match(b)){var U=R.slice(0,I),L=R.slice(I+1),W=F.match(w);W&&(U.push(W[1]),L.unshift(W[2])),L.length&&(a="/"+L.join(".")+a),this.hostname=U.join(".");break}}}this.hostname.length>v?this.hostname="":this.hostname=this.hostname.toLowerCase(),q||(this.hostname=c.toASCII(this.hostname));var z=this.port?":"+this.port:"",H=this.hostname||"";this.host=H+z,this.href+=this.host,q&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==a[0]&&(a="/"+a))}if(!x[l])for(var I=0,T=m.length;I0)&&r.host.split("@");P&&(r.auth=P.shift(),r.host=r.hostname=P.shift())}return r.search=e.search,r.query=e.query,h.isNull(r.pathname)&&h.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!x.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var j=x.slice(-1)[0],I=(r.host||e.host||x.length>1)&&("."===j||".."===j)||""===j,S=0,k=x.length;k>=0;k--)j=x[k],"."===j?x.splice(k,1):".."===j?(x.splice(k,1),S++):S&&(x.splice(k,1),S--);if(!b&&!w)for(;S--;S)x.unshift("..");!b||""===x[0]||x[0]&&"/"===x[0].charAt(0)||x.unshift(""),I&&"/"!==x.join("/").substr(-1)&&x.push("");var C=""===x[0]||x[0]&&"/"===x[0].charAt(0);if(O){r.hostname=r.host=C?"":x.length?x.shift():"";var P=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@");P&&(r.auth=P.shift(),r.host=r.hostname=P.shift())}return b=b||r.host&&x.length,b&&!C&&x.unshift(""),x.length?r.pathname=x.join("/"):(r.pathname=null,r.path=null),h.isNull(r.pathname)&&h.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},n.prototype.parseHost=function(){var e=this.host,t=d.exec(e);t&&(t=t[0],":"!==t&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,r){var n;(function(e,i){!function(o){function s(e){throw RangeError(R[e])}function a(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function c(e,t){var r=e.split("@"),n="";r.length>1&&(n=r[0]+"@",e=r[1]),e=e.replace(q,".");var i=e.split("."),o=a(i,t).join(".");return n+o}function h(e){for(var t,r,n=[],i=0,o=e.length;i=55296&&t<=56319&&i65535&&(e-=65536,t+=M(e>>>10&1023|55296),e=56320|1023&e),t+=M(e)}).join("")}function d(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:x}function p(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function f(e,t,r){var n=0;for(e=r?F(e/P):e>>1,e+=F(e/t);e>T*E>>1;n+=x)e=F(e/T);return F(n+(T+1)*e/(e+O))}function l(e){var t,r,n,i,o,a,c,h,p,l,m=[],g=e.length,y=0,v=I,b=j;for(r=e.lastIndexOf(S),r<0&&(r=0),n=0;n=128&&s("not-basic"),m.push(e.charCodeAt(n));for(i=r>0?r+1:0;i=g&&s("invalid-input"),h=d(e.charCodeAt(i++)),(h>=x||h>F((w-y)/a))&&s("overflow"),y+=h*a,p=c<=b?A:c>=b+E?E:c-b,!(hF(w/l)&&s("overflow"),a*=l;t=m.length+1,b=f(y-o,t,0==o),F(y/t)>w-v&&s("overflow"),v+=F(y/t),y%=t,m.splice(y++,0,v)}return u(m)}function m(e){var t,r,n,i,o,a,c,u,d,l,m,g,y,v,b,O=[];for(e=h(e),g=e.length,t=I,r=0,o=j,a=0;a=t&&mF((w-r)/y)&&s("overflow"),r+=(c-t)*y,t=c,a=0;aw&&s("overflow"),m==t){for(u=r,d=x;l=d<=o?A:d>=o+E?E:d-o,!(u= 0x80 (not a basic code point)","invalid-input":"Invalid input"},T=x-A,F=Math.floor,M=String.fromCharCode;b={version:"1.3.2",ucs2:{decode:h,encode:u},decode:l,encode:m,toASCII:y,toUnicode:g},n=function(){return b}.call(t,r,t,e),!(void 0!==n&&(e.exports=n))}(this)}).call(t,r(18)(e),function(){return this}())},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],e.webpackPolyfill=1),e}},function(e,t){"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,t,r){"use strict";t.decode=t.parse=r(21),t.encode=t.stringify=r(22)},function(e,t){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -42,7 +42,7 @@ var d=r(15);t.parse=i,t.resolve=s,t.resolveObject=a,t.format=o,t.Url=n;var f=/^( // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. -"use strict";function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,n,i){t=t||"&",n=n||"=";var o={};if("string"!=typeof e||0===e.length)return o;var s=/\+/g;e=e.split(t);var a=1e3;i&&"number"==typeof i.maxKeys&&(a=i.maxKeys);var c=e.length;a>0&&c>a&&(c=a);for(var h=0;h=0?(u=l.substr(0,m),p=l.substr(m+1)):(u=l,p=""),d=decodeURIComponent(u),f=decodeURIComponent(p),r(o,d)?Array.isArray(o[d])?o[d].push(f):o[d]=[o[d],f]:o[d]=f}return o}},function(e,t){ +"use strict";function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,n,i){t=t||"&",n=n||"=";var o={};if("string"!=typeof e||0===e.length)return o;var s=/\+/g;e=e.split(t);var a=1e3;i&&"number"==typeof i.maxKeys&&(a=i.maxKeys);var c=e.length;a>0&&c>a&&(c=a);for(var h=0;h=0?(u=l.substr(0,m),d=l.substr(m+1)):(u=l,d=""),p=decodeURIComponent(u),f=decodeURIComponent(d),r(o,p)?Array.isArray(o[p])?o[p].push(f):o[p]=[o[p],f]:o[p]=f}return o}},function(e,t){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -63,7 +63,7 @@ var d=r(15);t.parse=i,t.resolve=s,t.resolveObject=a,t.format=o,t.Url=n;var f=/^( // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. -"use strict";var r=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,n,i){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map(function(i){var o=encodeURIComponent(r(i))+n;return Array.isArray(e[i])?e[i].map(function(e){return o+encodeURIComponent(r(e))}).join(t):o+encodeURIComponent(r(e[i]))}).join(t):i?encodeURIComponent(r(i))+n+encodeURIComponent(r(e)):""}},function(e,t){e.exports={id:"http://json-schema.org/draft-04/schema#",$schema:"http://json-schema.org/draft-04/schema#",description:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},positiveInteger:{type:"integer",minimum:0},positiveIntegerDefault0:{allOf:[{$ref:"#/definitions/positiveInteger"},{"default":0}]},simpleTypes:{"enum":["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0}},type:"object",properties:{id:{type:"string",format:"uri"},$schema:{type:"string",format:"uri"},title:{type:"string"},description:{type:"string"},"default":{},multipleOf:{type:"number",minimum:0,exclusiveMinimum:!0},maximum:{type:"number"},exclusiveMaximum:{type:"boolean","default":!1},minimum:{type:"number"},exclusiveMinimum:{type:"boolean","default":!1},maxLength:{$ref:"#/definitions/positiveInteger"},minLength:{$ref:"#/definitions/positiveIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{anyOf:[{type:"boolean"},{$ref:"#"}],"default":{}},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],"default":{}},maxItems:{$ref:"#/definitions/positiveInteger"},minItems:{$ref:"#/definitions/positiveIntegerDefault0"},uniqueItems:{type:"boolean","default":!1},maxProperties:{$ref:"#/definitions/positiveInteger"},minProperties:{$ref:"#/definitions/positiveIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{anyOf:[{type:"boolean"},{$ref:"#"}],"default":{}},definitions:{type:"object",additionalProperties:{$ref:"#"},"default":{}},properties:{type:"object",additionalProperties:{$ref:"#"},"default":{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},"default":{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},"enum":{type:"array",minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},dependencies:{exclusiveMaximum:["maximum"],exclusiveMinimum:["minimum"]},"default":{}}},function(e,t){"use strict";var r={};r["date-time"]=/(\d\d\d\d)(-)?(\d\d)(-)?(\d\d)(T)?(\d\d)(:)?(\d\d)(:)?(\d\d)(\.\d+)?(Z|([+-])(\d\d)(:)?(\d\d))/,r.uri=/^([a-zA-Z][a-zA-Z0-9+-.]*:){0,1}\/\/[^\s]*$/,r.email=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,r.ipv4=/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,r.ipv6=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|[fF][eE]80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::([fF]{4}(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,r.hostname=/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]))*$/,e.exports=r},function(e,t){"use strict";function r(e){for(var t,r,n=0,i=0,o=e.length;i=55296&&t<=56319&&i=55296&&t<=56319&&i2&&"[]"===s.slice(a-2)&&(c=!0,s=s.slice(0,a-2),r[s]||(r[s]=[])),i=o[1]?w(o[1]):""),c?r[s].push(i):r[s]=i}return r},recognize:function(e){var t,r,n,i=[this.rootState],o={},s=!1;if(n=e.indexOf("?"),n!==-1){var a=e.substr(n+1,e.length);e=e.substr(0,n),o=this.parseQueryString(a)}for(e=decodeURI(e),"/"!==e.charAt(0)&&(e="/"+e),t=e.length,t>1&&"/"===e.charAt(t-1)&&(e=e.substr(0,t-1),s=!0),r=0;r2&&"[]"===s.slice(a-2)&&(c=!0,s=s.slice(0,a-2),r[s]||(r[s]=[])),i=o[1]?w(o[1]):""),c?r[s].push(i):r[s]=i}return r},recognize:function(e){var t,r,n,i=[this.rootState],o={},s=!1;if(n=e.indexOf("?"),n!==-1){var a=e.substr(n+1,e.length);e=e.substr(0,n),o=this.parseQueryString(a)}for(e=decodeURI(e),"/"!==e.charAt(0)&&(e="/"+e),t=e.length,t>1&&"/"===e.charAt(t-1)&&(e=e.substr(0,t-1),s=!0),r=0;r} + */ + switchMode(viewMode: string): Promise; } diff --git a/dist/service.d.ts b/dist/service.d.ts index fa49258f..9c8cdf0e 100644 --- a/dist/service.d.ts +++ b/dist/service.d.ts @@ -83,6 +83,13 @@ export declare class Service implements IService { * @param {IServiceConfiguration} [config={}] */ constructor(hpmFactory: IHpmFactory, wpmpFactory: IWpmpFactory, routerFactory: IRouterFactory, config?: IServiceConfiguration); + /** + * Creates new report + * @param {HTMLElement} element + * @param {embed.IEmbedConfiguration} [config={}] + * @returns {embed.Embed} + */ + createReport(element: HTMLElement, config: embed.IEmbedConfiguration): embed.Embed; /** * TODO: Add a description here * diff --git a/src/create.ts b/src/create.ts new file mode 100644 index 00000000..59a58fde --- /dev/null +++ b/src/create.ts @@ -0,0 +1,54 @@ +import * as service from './service'; +import * as models from 'powerbi-models'; +import * as embed from './embed'; + +export class Create extends embed.Embed { + + constructor(service: service.Service, element: HTMLElement, config: embed.IEmbedConfiguration) { + super(service, element, config); + } + + /** + * Gets the dataset ID from the first available location: createConfig or embed url. + * + * @returns {string} + */ + getId(): string { + const datasetId = this.createConfig.datasetId || Create.findIdFromEmbedUrl(this.config.embedUrl); + + if (typeof datasetId !== 'string' || datasetId.length === 0) { + throw new Error(`Dataset id is required, but it was not found. You must provide an id either as part of embed configuration'.`); + } + + return datasetId; + } + + /** + * Validate create report configuration. + */ + validate(config: models.IReportCreateConfiguration): models.IError[] { + return models.validateCreateReport(config); + } + + /** + * Adds the ability to get datasetId from url. + * (e.g. http://embedded.powerbi.com/appTokenReportEmbed?datasetId=854846ed-2106-4dc2-bc58-eb77533bf2f1). + * + * By extracting the ID we can ensure that the ID is always explicitly provided as part of the create configuration. + * + * @static + * @param {string} url + * @returns {string} + */ + static findIdFromEmbedUrl(url: string): string { + const datasetIdRegEx = /datasetId="?([^&]+)"?/ + const datasetIdMatch = url.match(datasetIdRegEx); + + let datasetId; + if (datasetIdMatch) { + datasetId = datasetIdMatch[1]; + } + + return datasetId; + } +} \ No newline at end of file diff --git a/src/embed.ts b/src/embed.ts index 16251118..b4935275 100644 --- a/src/embed.ts +++ b/src/embed.ts @@ -39,6 +39,8 @@ export interface IEmbedConfiguration { pageName?: string; filters?: models.IFilter[]; pageView?: models.PageView; + datasetId?: string; + permissions?: models.Permissions; } export interface IInternalEmbedConfiguration extends models.IReportLoadConfiguration { @@ -60,7 +62,7 @@ export interface IInternalEventHandler { * @class Embed */ export abstract class Embed { - static allowedEvents = ["loaded"]; + static allowedEvents = ["loaded", "saved"]; static accessTokenAttribute = 'powerbi-access-token'; static embedUrlAttribute = 'powerbi-embed-url'; static nameAttribute = 'powerbi-name'; @@ -108,6 +110,13 @@ export abstract class Embed { */ config: IInternalEmbedConfiguration; + /** + * Gets or sets the configuration settings for creating report. + * + * @type {models.IReportCreateConfiguration} + */ + createConfig: models.IReportCreateConfiguration; + /** * Url used in the load request. */ @@ -123,25 +132,80 @@ export abstract class Embed { * @param {HTMLElement} element * @param {IEmbedConfiguration} config */ - constructor(service: service.Service, element: HTMLElement, config: IEmbedConfiguration) { + constructor(service: service.Service, element: HTMLElement, config: IEmbedConfiguration, iframe?: HTMLIFrameElement) { Array.prototype.push.apply(this.allowedEvents, Embed.allowedEvents); this.eventHandlers = []; this.service = service; this.element = element; + this.iframe = iframe; // TODO: Change when Object.assign is available. const settings = utils.assign({}, Embed.defaultSettings, config.settings); this.config = utils.assign({ settings }, config); - this.config.accessToken = this.getAccessToken(service.accessToken); - this.config.embedUrl = this.getEmbedUrl(); - this.config.id = this.getId(); this.config.uniqueId = this.getUniqueId(); - const iframeHtml = ``; + if(config.type === 'create'){ + this.setEmbedForCreate(config); + } else { + this.setEmbedForLoad(); + } + } - this.element.innerHTML = iframeHtml; - this.iframe = this.element.childNodes[0]; - this.iframe.addEventListener('load', () => this.load(this.config), false); + /** + * Sends createReport configuration data. + * + * ```javascript + * createReport({ + * datasetId: '5dac7a4a-4452-46b3-99f6-a25915e0fe55', + * accessToken: 'eyJ0eXA ... TaE2rTSbmg', + * ``` + * + * @param {models.IReportCreateConfiguration} config + * @returns {Promise} + */ + createReport(config: models.IReportCreateConfiguration): Promise { + const errors = this.validate(config); + if (errors) { + throw errors; + } + + return this.service.hpm.post("/report/create", config, { uid: this.config.uniqueId }, this.iframe.contentWindow) + .then(response => { + return response.body; + }, + response => { + throw response.body; + }); + } + + /** + * Saves Report. + * + * @returns {Promise} + */ + save(): Promise { + return this.service.hpm.post('/report/save', null, { uid: this.config.uniqueId }, this.iframe.contentWindow) + .then(response => { + return response.body; + }) + .catch(response => { + throw response.body; + }); + } + + /** + * SaveAs Report. + * + * @returns {Promise} + */ + saveAs(saveAsParameters: models.ISaveAsParameters): Promise { + return this.service.hpm.post('/report/saveAs', saveAsParameters, { uid: this.config.uniqueId }, this.iframe.contentWindow) + .then(response => { + return response.body; + }) + .catch(response => { + throw response.body; + }); } /** @@ -260,7 +324,22 @@ export abstract class Embed { reload(): Promise { return this.load(this.config); } - + + /** + * Set accessToken. + * + * @returns {Promise} + */ + setAccessToken(accessToken: string): Promise { + return this.service.hpm.post('/report/token', accessToken, { uid: this.config.uniqueId }, this.iframe.contentWindow) + .then(response => { + return response.body; + }) + .catch(response => { + throw response.body; + }); + } + /** * Gets an access token from the first available location: config, attribute, global. * @@ -278,6 +357,35 @@ export abstract class Embed { return accessToken; } + /** + * Sets Embed for load + * + * @private + * @param {} + * @returns {void} + */ + private setEmbedForLoad(): void { + this.config.id = this.getId(); + this.config.accessToken = this.getAccessToken(this.service.accessToken); + this.setIframe(true/*set EventListener to call load() on 'load' event*/); + } + + /** + * Sets Embed for create report + * + * @private + * @param {IEmbedConfiguration} config + * @returns {void} + */ + private setEmbedForCreate(config: IEmbedConfiguration): void { + this.createConfig = { + datasetId: config.datasetId || this.getId(), + accessToken: this.getAccessToken(this.service.accessToken) + } + + this.setIframe(false/*set EventListener to call create() on 'load' event*/); + } + /** * Gets an embed url from the first available location: options, attribute. * @@ -348,7 +456,25 @@ export abstract class Embed { } /** - * Validate load configuration. + * Validate load and create configuration. + */ + abstract validate(config: models.IReportLoadConfiguration | models.IDashboardLoadConfiguration | models.IReportCreateConfiguration): models.IError[]; + + /** + * Sets Iframe for embed */ - abstract validate(config: models.IReportLoadConfiguration | models.IDashboardLoadConfiguration): models.IError[]; + private setIframe(isLoad: boolean): void { + if(!this.iframe) { + this.config.embedUrl = this.getEmbedUrl(); + const iframeHtml = ``; + this.element.innerHTML = iframeHtml; + this.iframe = this.element.childNodes[0]; + } + + if(isLoad){ + this.iframe.addEventListener('load', () => this.load(this.config), false); + } else { + this.iframe.addEventListener('load', () => this.createReport(this.createConfig), false); + } + } } \ No newline at end of file diff --git a/src/report.ts b/src/report.ts index 043d1030..89ed8912 100644 --- a/src/report.ts +++ b/src/report.ts @@ -29,7 +29,7 @@ export interface IReportNode { * @implements {IFilterable} */ export class Report extends embed.Embed implements IReportNode, IFilterable { - static allowedEvents = ["rendered", "dataSelected", "filtersApplied", "pageChanged", "error"]; + static allowedEvents = ["rendered", "dataSelected", "filtersApplied", "pageChanged", "error", "saved"]; static reportIdAttribute = 'powerbi-report-id'; static filterPaneEnabledAttribute = 'powerbi-settings-filter-pane-enabled'; static navContentPaneEnabledAttribute = 'powerbi-settings-nav-content-pane-enabled'; @@ -43,7 +43,7 @@ export class Report extends embed.Embed implements IReportNode, IFilterable { * @param {HTMLElement} element * @param {embed.IEmbedConfiguration} config */ - constructor(service: service.Service, element: HTMLElement, config: embed.IEmbedConfiguration) { + constructor(service: service.Service, element: HTMLElement, config: embed.IEmbedConfiguration, iframe?: HTMLIFrameElement) { const filterPaneEnabled = (config.settings && config.settings.filterPaneEnabled) || !(element.getAttribute(Report.filterPaneEnabledAttribute) === "false"); const navContentPaneEnabled = (config.settings && config.settings.navContentPaneEnabled) || !(element.getAttribute(Report.navContentPaneEnabledAttribute) === "false"); const settings = utils.assign({ @@ -52,7 +52,7 @@ export class Report extends embed.Embed implements IReportNode, IFilterable { }, config.settings); const configCopy = utils.assign({ settings }, config); - super(service, element, configCopy); + super(service, element, configCopy, iframe); this.loadPath = "/report/load"; Array.prototype.push.apply(this.allowedEvents, Report.allowedEvents); } @@ -263,4 +263,20 @@ export class Report extends embed.Embed implements IReportNode, IFilterable { validate(config: models.IReportLoadConfiguration): models.IError[] { return models.validateReportLoad(config); } + + /** + * Switch Report view mode. + * + * @returns {Promise} + */ + switchMode(viewMode: string): Promise { + let url = '/report/switchMode/' + viewMode; + return this.service.hpm.post(url, null, { uid: this.config.uniqueId }, this.iframe.contentWindow) + .then(response => { + return response.body; + }) + .catch(response => { + throw response.body; + }); + } } diff --git a/src/service.ts b/src/service.ts index de4d7c69..102d93eb 100644 --- a/src/service.ts +++ b/src/service.ts @@ -8,6 +8,7 @@ import * as wpmp from 'window-post-message-proxy'; import * as hpm from 'http-post-message'; import * as router from 'powerbi-router'; import * as models from 'powerbi-models'; +import * as create from './create'; export interface IEvent { type: string; @@ -158,6 +159,22 @@ export class Service implements IService { } } + /** + * Creates new report + * @param {HTMLElement} element + * @param {embed.IEmbedConfiguration} [config={}] + * @returns {embed.Embed} + */ + createReport(element: HTMLElement, config: embed.IEmbedConfiguration): embed.Embed{ + config.type = 'create'; + let powerBiElement = element; + const component = new create.Create(this, powerBiElement, config); + powerBiElement.powerBiEmbed = component; + this.embeds.push(component); + + return component; + } + /** * TODO: Add a description here * @@ -244,6 +261,20 @@ export class Service implements IService { * then we can call the embedNew function which would allow setting the proper embedUrl and construction of object based on the new type. */ if (typeof config.type === "string" && config.type !== component.config.type) { + + /** + * When loading report after create we want to use existing Iframe to optimize load period + */ + if(config.type === "report" && component.config.type === "create") { + const report = new Report(this, element, config, element.powerBiEmbed.iframe); + report.load(config); + element.powerBiEmbed = report; + this.embeds.pop(); + this.embeds.push(report); + + return report; + } + throw new Error(`Embedding on an existing element with a different type than the previous embed object is not supported. Attempted to embed using config ${JSON.stringify(config)} on element ${element.outerHTML}, but the existing element contains an embed of type: ${this.config.type} which does not match the new type: ${config.type}`); } From e5466c7c2a29b1612fe943f5be838ced867fe10e Mon Sep 17 00:00:00 2001 From: Omri Armstrong Date: Wed, 25 Jan 2017 15:20:38 +0200 Subject: [PATCH 02/11] CR fixes --- demo/code-demo/scripts/codesamples.js | 146 ++++++++++++++++---- demo/code-demo/scripts/step_embed.js | 4 + demo/code-demo/settings_create.html | 34 ++--- demo/code-demo/settings_embed.html | 3 + demo/code-demo/settings_interact.html | 1 + demo/code-demo/style/style.css | 10 ++ dist/embed.d.ts | 19 ++- dist/powerbi.js | 185 +++++++++++++------------- dist/powerbi.js.map | 2 +- dist/powerbi.min.js | 6 +- dist/report.d.ts | 2 +- src/create.ts | 2 +- src/embed.ts | 61 ++++----- src/report.ts | 4 +- src/service.ts | 7 +- 15 files changed, 296 insertions(+), 190 deletions(-) diff --git a/demo/code-demo/scripts/codesamples.js b/demo/code-demo/scripts/codesamples.js index 5bd894af..048551b9 100644 --- a/demo/code-demo/scripts/codesamples.js +++ b/demo/code-demo/scripts/codesamples.js @@ -16,6 +16,10 @@ function _Embed_BasicEmbed() { // Read report Id from textbox var txtEmbedReportId = $('#txtEmbedReportId').val(); + // Get viewMode + var checkd = $('#viewMode:checked').val(); + var viewMode = checkd ? 1 : 0; + // Embed configuration used to describe the what and how to embed. // This object is used when calling powerbi.embed. // This also includes settings and options such as filters. @@ -26,6 +30,7 @@ function _Embed_BasicEmbed() { embedUrl: txtEmbedUrl, id: txtEmbedReportId, permissions: 3/*All*/, + viewMode: viewMode, settings: { filterPaneEnabled: true, navContentPaneEnabled: true @@ -114,8 +119,12 @@ function _Embed_Create() { // ---- Report Operations ---------------------------------------------------- function _Report_GetId() { + + // Grab the reference to the div HTML element that will host the report. + var reportContainer = $('#reportContainer')[0]; + // Get a reference to the embedded report. - report = powerbi.embeds[0]; + report = powerbi.get(reportContainer); // Retrieve the report id. var reportId = report.getId(); @@ -130,8 +139,11 @@ function _Report_UpdateSettings() { filterPaneEnabled: false }; + // Grab the reference to the div HTML element that will host the report. + var reportContainer = $('#reportContainer')[0]; + // Get a reference to the embedded report. - report = powerbi.embeds[0]; + report = powerbi.get(reportContainer); // Update the settings by passing in the new settings you have configured. report.updateSettings(newSettings) @@ -144,8 +156,11 @@ function _Report_UpdateSettings() { } function _Report_GetPages() { + // Grab the reference to the div HTML element that will host the report. + var reportContainer = $('#reportContainer')[0]; + // Get a reference to the embedded report. - report = powerbi.embeds[0]; + report = powerbi.get(reportContainer); // Retrieve the page collection and loop through to collect the // page name and display name of each page and display the value. @@ -162,8 +177,11 @@ function _Report_GetPages() { } function _Report_SetPage() { + // Grab the reference to the div HTML element that will host the report. + var reportContainer = $('#reportContainer')[0]; + // Get a reference to the embedded report. - report = powerbi.embeds[0]; + report = powerbi.get(reportContainer); // setPage will change the selected view to the page you indicate. // This is the actual page name not the display name. @@ -187,8 +205,11 @@ function _Report_SetPage() { } function _Report_GetFilters() { + // Grab the reference to the div HTML element that will host the report. + var reportContainer = $('#reportContainer')[0]; + // Get a reference to the embedded report. - report = powerbi.embeds[0]; + report = powerbi.get(reportContainer); // Get the filters applied to the report. report.getFilters() @@ -213,8 +234,11 @@ function _Report_SetFilters() { values: ["Lindseys"] }; + // Grab the reference to the div HTML element that will host the report. + var reportContainer = $('#reportContainer')[0]; + // Get a reference to the embedded report. - report = powerbi.embeds[0]; + report = powerbi.get(reportContainer); // Set the filter for the report. // Pay attention that setFilters receives an array. @@ -228,8 +252,11 @@ function _Report_SetFilters() { } function _Report_RemoveFilters() { + // Grab the reference to the div HTML element that will host the report. + var reportContainer = $('#reportContainer')[0]; + // Get a reference to the embedded report. - report = powerbi.embeds[0]; + report = powerbi.get(reportContainer); // Remove the filters currently applied to the report. report.removeFilters() @@ -242,8 +269,11 @@ function _Report_RemoveFilters() { } function _Report_PrintCurrentReport() { + // Grab the reference to the div HTML element that will host the report. + var reportContainer = $('#reportContainer')[0]; + // Get a reference to the embedded report. - report = powerbi.embeds[0]; + report = powerbi.get(reportContainer); // Trigger the print dialog for your browser. report.print() @@ -256,8 +286,11 @@ function _Report_PrintCurrentReport() { } function _Report_Reload() { + // Grab the reference to the div HTML element that will host the report. + var reportContainer = $('#reportContainer')[0]; + // Get a reference to the embedded report. - report = powerbi.embeds[0]; + report = powerbi.get(reportContainer); // Reload the displayed report report.reload() @@ -270,40 +303,55 @@ function _Report_Reload() { } function _Report_FullScreen() { + // Grab the reference to the div HTML element that will host the report. + var reportContainer = $('#reportContainer')[0]; + // Get a reference to the embedded report. - report = powerbi.embeds[0]; + report = powerbi.get(reportContainer); // Displays the report in full screen mode. report.fullscreen(); } function _Report_ExitFullScreen() { + // Grab the reference to the div HTML element that will host the report. + var reportContainer = $('#reportContainer')[0]; + // Get a reference to the embedded report. - report = powerbi.embeds[0]; + report = powerbi.get(reportContainer); // Exits full screen mode. report.exitFullscreen(); } function _Report_switchModeEdit() { + // Grab the reference to the div HTML element that will host the report. + var reportContainer = $('#reportContainer')[0]; + // Get a reference to the embedded report. - report = powerbi.embeds[0]; + report = powerbi.get(reportContainer); // Switch to edit mode. report.switchMode("edit"); } function _Report_switchModeView() { + // Grab the reference to the div HTML element that will host the report. + var reportContainer = $('#reportContainer')[0]; + // Get a reference to the embedded report. - report = powerbi.embeds[0]; + report = powerbi.get(reportContainer); // Switch to view mode. report.switchMode("view"); } function _Report_save() { - // Get a reference to report. - report = powerbi.embeds[0]; + // Grab the reference to the div HTML element that will host the report. + var reportContainer = $('#reportContainer')[0]; + + // Get a reference to the embedded report. + report = powerbi.get(reportContainer); // Save report report.save(); @@ -315,14 +363,19 @@ function _Report_save() { report.on("saved", function() { var reportObjectId = event.detail.reportObjectId; var isSaveAs = event.detail.saveAs; + var name = event.detail.reportName; + Log.logText("Report name " + name); Log.logText("Save Report Completed, reportObjectId: " + reportObjectId); Log.logText("Is saveAs: " + isSaveAs.toString()); }); } function _Report_saveAs() { - // Get a reference to report. - report = powerbi.embeds[0]; + // Grab the reference to the div HTML element that will host the report. + var reportContainer = $('#reportContainer')[0]; + + // Get a reference to the embedded report. + report = powerbi.get(reportContainer); var saveAsParameters = { name: "newReport" @@ -346,8 +399,11 @@ function _Report_saveAs() { } function _Report_setAccessToken() { - // Get a reference to report. - report = powerbi.embeds[0]; + // Grab the reference to the div HTML element that will host the report. + var reportContainer = $('#reportContainer')[0]; + + // Get a reference to the embedded report. + report = powerbi.get(reportContainer); // New AccessToken var newAccessToken = "newAccessToken"; @@ -364,8 +420,11 @@ function _Report_setAccessToken() { // ---- Page Operations ---------------------------------------------------- function _Page_SetActive() { + // Grab the reference to the div HTML element that will host the report. + var reportContainer = $('#reportContainer')[0]; + // Get a reference to the embedded report. - report = powerbi.embeds[0]; + report = powerbi.get(reportContainer); // Retrieve the page collection, and then set the second page to be active. report.getPages() @@ -380,8 +439,11 @@ function _Page_SetActive() { } function _Page_GetFilters() { + // Grab the reference to the div HTML element that will host the report. + var reportContainer = $('#reportContainer')[0]; + // Get a reference to the embedded report. - report = powerbi.embeds[0]; + report = powerbi.get(reportContainer); // Retrieve the page collection and get the filters for the first page. report.getPages() @@ -400,8 +462,11 @@ function _Page_GetFilters() { } function _Page_SetFilters() { + // Grab the reference to the div HTML element that will host the report. + var reportContainer = $('#reportContainer')[0]; + // Get a reference to the embedded report. - report = powerbi.embeds[0]; + report = powerbi.get(reportContainer); // Build the filter you want to use. For more information, see Constructing // Filters in https://github.com/Microsoft/PowerBI-JavaScript/wiki/Filters. @@ -433,8 +498,11 @@ function _Page_SetFilters() { } function _Page_RemoveFilters() { + // Grab the reference to the div HTML element that will host the report. + var reportContainer = $('#reportContainer')[0]; + // Get a reference to the embedded report. - report = powerbi.embeds[0]; + report = powerbi.get(reportContainer); // Retrieve the page collection and remove the filters for the first page. report.getPages() @@ -455,8 +523,11 @@ function _Page_RemoveFilters() { // ---- Event Listener ---------------------------------------------------- function _Events_PageChanged() { + // Grab the reference to the div HTML element that will host the report. + var reportContainer = $('#reportContainer')[0]; + // Get a reference to the embedded report. - report = powerbi.embeds[0]; + report = powerbi.get(reportContainer); // Report.off removes a given event listener if it exists. report.off("pageChanged"); @@ -474,8 +545,11 @@ function _Events_PageChanged() { } function _Events_DataSelected() { + // Grab the reference to the div HTML element that will host the report. + var reportContainer = $('#reportContainer')[0]; + // Get a reference to the embedded report. - report = powerbi.embeds[0]; + report = powerbi.get(reportContainer); // Report.off removes a given event listener if it exists. report.off("dataSelected"); @@ -490,4 +564,26 @@ function _Events_DataSelected() { // For example, a bar in a bar chart. You should see an entry in the Log window. Log.logText("Select data to see events in Log window."); +} + +function _Events_SaveAsTriggered() { + // Grab the reference to the div HTML element that will host the report. + var reportContainer = $('#reportContainer')[0]; + + // Get a reference to the embedded report. + report = powerbi.get(reportContainer); + + // Report.off removes a given event listener if it exists. + report.off("saveAsTriggered"); + + // Report.on will add an event listener. + report.on("saveAsTriggered", function(event) { + var eventType = event.type; + Log.logText("Event Triggered: " + eventType); + }); + + // Select Run and change to a different page. + // You should see an entry in the Log window. + + Log.logText("Run SaveAs to see events in Log window."); } \ No newline at end of file diff --git a/demo/code-demo/scripts/step_embed.js b/demo/code-demo/scripts/step_embed.js index c3134d8f..c4aa7e50 100644 --- a/demo/code-demo/scripts/step_embed.js +++ b/demo/code-demo/scripts/step_embed.js @@ -71,6 +71,10 @@ function Events_DataSelected() { SetCode(_Events_DataSelected); } +function Events_SaveAsTriggered() { + SetCode(_Events_SaveAsTriggered); +} + // ---- Edit and Save Operations ---------------------------------------------------- function Report_switchModeEdit() { diff --git a/demo/code-demo/settings_create.html b/demo/code-demo/settings_create.html index 0b3485b1..b62f884f 100644 --- a/demo/code-demo/settings_create.html +++ b/demo/code-demo/settings_create.html @@ -11,21 +11,21 @@ -
    -

    Create Report

    - Fill in the fields below to get the code to create your report. -
    -
    -
    - Embed App Token -
    -
    -
    - Embed URL -
    -
    -
    - Dataset Id -
    -
    +
    +

    Create Report

    + Fill in the fields below to get the code to create your report. +
    +
    +
    + Embed App Token +
    +
    +
    + Embed URL +
    +
    +
    + Dataset Id +
    +
    \ No newline at end of file diff --git a/demo/code-demo/settings_embed.html b/demo/code-demo/settings_embed.html index 6d0bf232..71d43474 100644 --- a/demo/code-demo/settings_embed.html +++ b/demo/code-demo/settings_embed.html @@ -28,4 +28,7 @@

    Embed Report

    Report Id
    +
    + +
    \ No newline at end of file diff --git a/demo/code-demo/settings_interact.html b/demo/code-demo/settings_interact.html index 0e056a6c..704c0a50 100644 --- a/demo/code-demo/settings_interact.html +++ b/demo/code-demo/settings_interact.html @@ -52,6 +52,7 @@
    • Page Changed
    • Data Selected
    • +
    • SaveAs Triggered
    diff --git a/demo/code-demo/style/style.css b/demo/code-demo/style/style.css index 473441c2..fc4b4b86 100644 --- a/demo/code-demo/style/style.css +++ b/demo/code-demo/style/style.css @@ -498,14 +498,14 @@ a { } .tabContainer { - margin-bottom: 5px; - padding-left: 0; + margin-bottom: 5px; + padding-left: 0; } .nav-tabs { - border-bottom: 0px; + border-bottom: 0px; } .checkbox.input { - width: auto; + width: auto; } \ No newline at end of file diff --git a/dist/powerbi.js b/dist/powerbi.js index 254c0c59..0cd7d4c4 100644 --- a/dist/powerbi.js +++ b/dist/powerbi.js @@ -317,8 +317,7 @@ return /******/ (function(modules) { // webpackBootstrap */ Service.prototype.handleEvent = function (event) { var embed = utils.find(function (embed) { - return (embed.config.type === event.type - && embed.config.uniqueId === event.id); + return (embed.config.uniqueId === event.id); }, this.embeds); if (embed) { var value = event.value; @@ -1059,7 +1058,7 @@ return /******/ (function(modules) { // webpackBootstrap throw response.body; }); }; - Report.allowedEvents = ["rendered", "dataSelected", "filtersApplied", "pageChanged", "error", "saved", "saveAsTriggered"]; + Report.allowedEvents = ["dataSelected", "filtersApplied", "pageChanged", "error"]; Report.reportIdAttribute = 'powerbi-report-id'; Report.filterPaneEnabledAttribute = 'powerbi-settings-filter-pane-enabled'; Report.navContentPaneEnabledAttribute = 'powerbi-settings-nav-content-pane-enabled'; @@ -5206,7 +5205,7 @@ return /******/ (function(modules) { // webpackBootstrap * @returns {string} */ Create.prototype.getId = function () { - var datasetId = this.createConfig.datasetId || Create.findIdFromEmbedUrl(this.config.embedUrl); + var datasetId = (this.createConfig && this.createConfig.datasetId) ? this.createConfig.datasetId : Create.findIdFromEmbedUrl(this.config.embedUrl); if (typeof datasetId !== 'string' || datasetId.length === 0) { throw new Error('Dataset id is required, but it was not found. You must provide an id either as part of embed configuration.'); } diff --git a/dist/powerbi.js.map b/dist/powerbi.js.map index a6f01b67..081c78fb 100644 --- a/dist/powerbi.js.map +++ b/dist/powerbi.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 882f812721ab072aa991","webpack:///./src/powerbi.ts","webpack:///./src/service.ts","webpack:///./src/embed.ts","webpack:///./src/util.ts","webpack:///./src/report.ts","webpack:///./~/powerbi-models/dist/models.js","webpack:///./src/page.ts","webpack:///./src/create.ts","webpack:///./src/dashboard.ts","webpack:///./src/tile.ts","webpack:///./src/factories.ts","webpack:///./src/config.ts","webpack:///./~/window-post-message-proxy/dist/windowPostMessageProxy.js","webpack:///./~/http-post-message/dist/httpPostMessage.js","webpack:///./~/powerbi-router/dist/router.js"],"names":[],"mappings":"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;aACZ,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;SACvB,CAAC,CAAC;cACD,KAAK,CAAC,kBAAQ;aACb,MAAM,QAAQ,CAAC,IAAI,CAAC;SACtB,CAAC,CAAC,CAAC;KACP,CAAC;KAzPM,oBAAa,GAAG,CAAC,UAAU,EAAE,cAAc,EAAE,gBAAgB,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,EAAE,iBAAiB,CAAC,CAAC;KACnH,wBAAiB,GAAG,mBAAmB,CAAC;KACxC,iCAA0B,GAAG,sCAAsC,CAAC;KACpE,qCAA8B,GAAG,2CAA2C,CAAC;KAC7E,oBAAa,GAAG,cAAc,CAAC;KAC/B,WAAI,GAAG,QAAQ,CAAC;KAqPzB,aAAC;AAAD,EAAC,CA3P2B,KAAK,CAAC,KAAK,GA2PtC;AA3PY,eAAM,SA2PlB;;;;;;;ACzRD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD,qCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;AACA,qBAAoB,sBAAsB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA,GAAE,gDAAgD;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA,0BAAyB,uBAAuB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAwB,2BAA2B;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA,0BAAyB,uBAAuB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAiD,+BAA+B,GAAG,sCAAsC;AACzH,mDAAkD,+BAA+B,GAAG,sCAAsC;AAC1H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE,kDAAkD;AACpD;AACA;AACA;AACA;AACA,GAAE,4CAA4C;AAC9C;AACA;;;AAGA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAQ;AACR;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;AACA,SAAQ;AACR;AACA;AACA,SAAQ;AACR;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;AACA,SAAQ;AACR;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA,MAAK;AACL;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA,OAAM;AACN;AACA;AACA,OAAM;AACN;AACA;AACA,OAAM;AACN;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;;AAEA,QAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAe;AACf;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,+BAA8B;AAC9B;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,uFAAsF;AACtF;AACA,qBAAoB;AACpB;;AAEA;AACA;AACA,oFAAmF;AACnF;AACA,yBAAwB;AACxB;AACA;;AAEA;AACA;AACA,sFAAqF;AACrF;AACA,yBAAwB;AACxB;AACA;;AAEA;AACA;AACA,oFAAmF;AACnF;AACA,yBAAwB;AACxB;AACA;;AAEA;AACA;AACA,sFAAqF;AACrF;AACA,yBAAwB;AACxB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,8JAA6J;AAC7J,WAAU;AACV,6FAA4F;AAC5F;;AAEA;AACA,yBAAwB;AACxB;AACA;;AAEA;AACA;AACA,kGAAiG;AACjG;AACA,yBAAwB;AACxB;AACA;;AAEA;AACA;AACA,kGAAiG;AACjG;AACA,yBAAwB;AACxB;AACA;;AAEA;AACA;;AAEA;AACA,yFAAwF;AACxF;AACA,yBAAwB;AACxB;AACA;;AAEA;AACA;AACA;AACA;;AAEA,+FAA8F;AAC9F;AACA,qBAAoB;AACpB;;AAEA;AACA;AACA,4FAA2F;AAC3F;AACA,yBAAwB;AACxB;AACA;;AAEA;AACA;AACA,4FAA2F;AAC3F;AACA,yBAAwB;AACxB;AACA;;AAEA;AACA;AACA,gGAA+F;AAC/F;AACA,yBAAwB;AACxB;AACA;;AAEA;AACA;AACA,kGAAiG;AACjG;AACA,yBAAwB;AACxB;AACA;;AAEA;AACA;AACA;;AAEA;AACA,+CAA8C,6CAA6C,mBAAmB;;AAE9G;;AAEA,yBAAwB;AACxB;AACA;AACA,gBAAe,iCAAiC;AAChD,+EAA8E;;AAE9E;;AAEA,6BAA4B;AAC5B;;AAEA;AACA,2DAA0D,6CAA6C,mBAAmB;;AAE1H;;AAEA,6BAA4B;AAC5B;AACA;AACA;;AAEA;AACA;AACA,8GAA6G;AAC7G;AACA,yBAAwB;AACxB;AACA;;AAEA;AACA;AACA,8GAA6G;AAC7G;AACA,yBAAwB;AACxB;AACA;;AAEA;AACA;AACA;AACA;;AAEA,qBAAoB,oCAAoC;AACxD,2GAA0G;AAC1G;AACA,yBAAwB;AACxB;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,iBAAgB,qBAAqB;AACrC;AACA;;AAEA,+DAA8D;;AAE9D;;AAEA,yBAAwB;;AAExB;AACA,kCAAiC;AACjC;AACA,6BAA4B;AAC5B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,uCAAsC,iCAAiC,eAAe;AACtF;;AAEA,kEAAiE;AACjE;AACA,aAAY;;AAEZ;AACA;AACA;;AAEA;AACA,iBAAgB,qBAAqB;AACrC;;AAEA,+EAA8E;;AAE9E;;AAEA;AACA;AACA;;AAEA,yBAAwB;AACxB;;AAEA;AACA;AACA;AACA;;AAEA;AACA,0EAAyE;AACzE;AACA,iBAAgB;AAChB;;AAEA,6CAA4C;;AAE5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,yBAAwB;AACxB;;AAEA,qBAAoB;AACpB;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,YAAW,SAAS;AACpB;AACA;;AAEA,oFAAmF;;AAEnF;AACA;AACA;AACA;AACA;AACA;AACA,qBAAoB,gBAAgB;AACpC,+FAA8F;AAC9F;AACA,iCAAgC;AAChC;AACA;;AAEA,yBAAwB;AACxB;AACA;;AAEA;AACA;AACA;AACA;;AAEA,qBAAoB,iCAAiC;AACrD;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,YAAW,iCAAiC;AAC5C,6CAA4C;;AAE5C;;AAEA;;AAEA;;AAEA;AACA,aAAY;AACZ;;AAEA;;AAEA,yCAAwC;;AAExC;;AAEA,qBAAoB,OAAO;AAC3B;AACA,SAAQ;AACR;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,YAAW,iCAAiC;AAC5C;;AAEA;;AAEA;;AAEA,iEAAgE;AAChE;AACA,aAAY;AACZ;;AAEA;;AAEA,iDAAgD;;AAEhD;;AAEA,qBAAoB,OAAO;AAC3B;AACA,SAAQ;AACR;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,6DAA4D;;AAE5D;;AAEA,qBAAoB,OAAO;AAC3B;AACA,SAAQ;AACR;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAgB,iBAAiB;AACjC;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAgB,SAAS;AACzB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,wCAAuC,SAAS;AAChD;AACA;AACA;AACA;AACA;AACA;;AAEA,uCAAsC,SAAS;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,2CAA0C,SAAS;AACnD;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA,iBAAgB,4BAA4B;AAC5C;AACA;;AAEA,qBAAoB,iBAAiB;AACrC;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA,qBAAoB,kBAAkB;AACtC;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,yBAAwB,qBAAqB;AAC7C;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAwB,yBAAyB;AACjD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAwB,gBAAgB;AACxC;AACA;AACA;AACA;AACA;AACA;;AAEA,qBAAoB,yBAAyB;AAC7C;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;;AAEN;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,8BAA6B;;AAE7B;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,SAAQ;;AAER;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,yCAAwC,SAAS;AACjD;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA,iBAAgB;AAChB;;AAEA;;AAEA;AACA,qCAAoC;AACpC;;AAEA,iBAAgB,qBAAqB;AACrC;;AAEA,mFAAkF;;AAElF;;AAEA,sBAAqB;;AAErB;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,4BAA2B;AAC3B,uCAAsC;AACtC;AACA;AACA,eAAc,sBAAsB;AACpC;AACA,0BAAyB;AACzB;AACA;AACA,+BAA8B,GAAG;AACjC;AACA,0BAAyB;AACzB;AACA;;AAEA;AACA;AACA,OAAM;;AAEN;AACA;;AAEA;AACA;AACA,qFAAoF;AACpF;AACA,8BAA6B;AAC7B;AACA;AACA,uDAAsD;AACtD,uDAAsD;;AAEtD;;AAEA,iHAAgH;AAChH;AACA,8BAA6B;AAC7B;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,4BAA2B,0BAA0B,EAAE;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA;AACA;AACA,wBAAuB,yBAAyB;;AAEhD;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;AAGA,QAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAgB;AAChB,iBAAgB;AAChB;AACA;AACA,qCAAoC,WAAW;AAC/C;AACA,WAAU;AACV;AACA;AACA,WAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,kEAAiE;AACjE;AACA,8CAA6C;AAC7C,wBAAuB;AACvB;;AAEA;AACA;AACA,+BAA8B;AAC9B;AACA,8CAA6C,iBAAiB,EAAE;;AAEhE;AACA;;AAEA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,iBAAgB,kBAAkB;AAClC;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,wBAAuB;AACvB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,qBAAoB,cAAc;AAClC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA,QAAO;AACP;AACA;;AAEA;;AAEA;;AAEA;AACA,uCAAsC,SAAS;AAC/C;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,OAAM;AACN;;AAEA;;AAEA,QAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAM;;AAEN;AACA;AACA;;AAEA;AACA;;AAEA;AACA,sEAAqE;AACrE;AACA;AACA;AACA;AACA;AACA,uBAAsB;AACtB;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,0BAAyB;AACzB;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,iBAAgB,iBAAiB;AACjC;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,WAAU;;AAEV;AACA,OAAM;;AAEN;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,oCAAmC,SAAS;AAC5C;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,kBAAiB,KAAK;;AAEtB;AACA;AACA;AACA;AACA;AACA;AACA,uCAAsC;AACtC;AACA;AACA,6CAA4C,KAAK;AACjD,4CAA2C,KAAK;AAChD;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;AACN;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA,SAAQ;AACR;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,sCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,qBAAoB,4BAA4B;AAChD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,qBAAoB,yBAAyB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,6CAA4C,OAAO;AACnD;AACA;AACA;AACA;AACA,4CAA2C,OAAO;AAClD;AACA;AACA;AACA;AACA;AACA,eAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,4CAA2C,OAAO;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAI;AACJ;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,oBAAmB,mBAAmB;AACtC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,sBAAqB,mBAAmB;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAsB,iBAAiB;AACvC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,gCAA+B,QAAQ;AACvC;AACA;AACA;AACA,OAAM;AACN;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA,YAAW,MAAM;AACjB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAI;AACJ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA,QAAO;AACP;AACA;;AAEA,oCAAmC,sDAAsD;AACzF,GAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,cAAa,OAAO;AACpB,gBAAe,MAAM;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAa,MAAM;AACnB,cAAa,SAAS;AACtB;AACA,gBAAe,MAAM;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB,cAAa,SAAS;AACtB;AACA,gBAAe,MAAM;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB,gBAAe,MAAM;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAsC;AACtC;AACA,OAAM;AACN,8BAA6B;AAC7B;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAa,MAAM;AACnB,gBAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;;AAEA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB,gBAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB,gBAAe,OAAO;AACtB;AACA;AACA,WAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAgC,mCAAmC;AACnE;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB,gBAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,eAAc,WAAW;AACzB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,0BAAyB;;AAEzB,2CAA0C,qBAAqB;;AAE/D;AACA;AACA;AACA;AACA;AACA,oCAAmC,oBAAoB;;AAEvD;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB,gBAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,eAAc,iBAAiB;AAC/B;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,4BAA2B,iBAAiB;AAC5C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,gBAAe,iBAAiB;AAChC;;AAEA;AACA;AACA;;AAEA;AACA;AACA,gCAA+B,oBAAoB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB;AACA,gBAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB;AACA,gBAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ,IAAG;AACH,wCAAuC;AACvC;AACA,KAAI,OAAO;AACX;AACA;AACA;AACA;AACA,IAAG,OAAO;AACV;AACA;;AAEA,GAAE;;AAEF,8BAA6B,6DAA6D,aAAa,EAAE;;AAEzG,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA,QAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;;;AAGA,QAAO;AACP;AACA;;AAEA;;AAEA;AACA;;;AAGA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,mBAAkB,SAAS;AAC3B;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,OAAM;AACN;AACA,OAAM;AACN;AACA;AACA;;AAEA;AACA;;;AAGA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV,SAAQ;AACR;AACA;AACA,OAAM;;AAEN;;AAEA;AACA;AACA;AACA;;;AAGA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ,iBAAgB;AAChB;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA,MAAK;AACL;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA,MAAK;AACL;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA,MAAK;AACL;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,6CAA4C,IAAI;AAChD;AACA;AACA,+CAA8C,EAAE,gCAAgC,KAAK,6CAA6C,KAAK;AACvI;AACA,kEAAiE,EAAE;AACnE;AACA,iCAAgC,IAAI,GAAG,IAAI,YAAY,IAAI,cAAc,IAAI,GAAG,IAAI,eAAe,IAAI,GAAG,IAAI,aAAa,IAAI,cAAc,IAAI,GAAG,IAAI,cAAc,IAAI,EAAE,IAAI,cAAc,IAAI,GAAG,IAAI,cAAc,IAAI,EAAE,IAAI,cAAc,IAAI,GAAG,IAAI,cAAc,IAAI,EAAE,IAAI,cAAc,IAAI,GAAG,IAAI,cAAc,IAAI,EAAE,IAAI,aAAa,IAAI,gBAAgB,IAAI,EAAE,IAAI,kBAAkB,IAAI,EAAE,IAAI,6BAA6B,IAAI,EAAE,IAAI,aAAa,GAAG,SAAS,EAAE,IAAI,IAAI,EAAE,IAAI,GAAG,IAAI,oBAAoB,IAAI,OAAO,IAAI,UAAU,IAAI,mBAAmB,IAAI,OAAO,IAAI,oBAAoB,IAAI,GAAG,IAAI,qBAAqB,IAAI,OAAO,IAAI,UAAU,IAAI,mBAAmB,IAAI,OAAO,IAAI;AACvqB;AACA,4DAA2D,KAAK,oDAAoD,KAAK;;AAEzH;;AAEA,QAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,gDAA+C;AAC/C;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA,EAAC;AACD;AACA,mC;;;;;;AC/5HA;;;;;;;IAOG;AACH;KAqBE;;;;;;QAMG;KACH,cAAY,MAAmB,EAAE,IAAY,EAAE,WAAoB;SACjE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;SACrB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;SACjB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;KACjC,CAAC;KAED;;;;;;;;;QASG;KACH,yBAAU,GAAV;SACE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAmB,mBAAiB,IAAI,CAAC,IAAI,aAAU,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC;cAC/J,IAAI,CAAC,kBAAQ,IAAI,eAAQ,CAAC,IAAI,EAAb,CAAa,EAC/B,kBAAQ;aACN,MAAM,QAAQ,CAAC,IAAI,CAAC;SACtB,CAAC,CAAC,CAAC;KACP,CAAC;KAED;;;;;;;;QAQG;KACH,4BAAa,GAAb;SACE,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;KAC7B,CAAC;KAED;;;;;;;;QAQG;KACH,wBAAS,GAAT;SACE,IAAM,IAAI,GAAiB;aACzB,IAAI,EAAE,IAAI,CAAC,IAAI;aACf,WAAW,EAAE,IAAI;UAClB,CAAC;SAEF,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAkB,sBAAsB,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC;cACtJ,KAAK,CAAC,kBAAQ;aACb,MAAM,QAAQ,CAAC,IAAI,CAAC;SACtB,CAAC,CAAC,CAAC;KACP,CAAC;KAED;;;;;;;;;;QAUG;KACH,yBAAU,GAAV,UAAW,OAAyB;SAClC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAkB,mBAAiB,IAAI,CAAC,IAAI,aAAU,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC;cACvK,KAAK,CAAC,kBAAQ;aACb,MAAM,QAAQ,CAAC,IAAI,CAAC;SACtB,CAAC,CAAC,CAAC;KACP,CAAC;KACH,WAAC;AAAD,EAAC;AAvGY,aAAI,OAuGhB;;;;;;;;;;;;AC7HD,KAAY,MAAM,uBAAM,CAAgB,CAAC;AACzC,KAAY,KAAK,uBAAM,CAAS,CAAC;AAEjC;KAA4B,0BAAW;KAErC,gBAAY,OAAwB,EAAE,OAAoB,EAAE,MAAiC;SAC3F,kBAAM,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;KAClC,CAAC;KAED;;;;QAIG;KACH,sBAAK,GAAL;SACE,IAAM,SAAS,GAAG,IAAI,CAAC,YAAY,CAAC,SAAS,IAAI,MAAM,CAAC,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;SAEjG,EAAE,CAAC,CAAC,OAAO,SAAS,KAAK,QAAQ,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC;aAC5D,MAAM,IAAI,KAAK,CAAC,6GAA6G,CAAC,CAAC;SACjI,CAAC;SAED,MAAM,CAAC,SAAS,CAAC;KACnB,CAAC;KAED;;QAEG;KACH,yBAAQ,GAAR,UAAS,MAAyC;SAChD,MAAM,CAAC,MAAM,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC;KAC7C,CAAC;KAED;;;;;;;;;QASG;KACI,yBAAkB,GAAzB,UAA0B,GAAW;SACnC,IAAM,cAAc,GAAG,uBAAuB;SAC9C,IAAM,cAAc,GAAG,GAAG,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;SAEjD,IAAI,SAAS,CAAC;SACd,EAAE,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC;aACnB,SAAS,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC;SAChC,CAAC;SAED,MAAM,CAAC,SAAS,CAAC;KACnB,CAAC;KACH,aAAC;AAAD,EAAC,CAjD2B,KAAK,CAAC,KAAK,GAiDtC;AAjDY,eAAM,SAiDlB;;;;;;;;;;;;ACpDD,KAAY,KAAK,uBAAM,CAAS,CAAC;AACjC,KAAY,MAAM,uBAAM,CAAgB,CAAC;AAiBzC;;;;;;;;IAQG;AACH;KAA+B,6BAAW;KAMtC;;;;;QAKG;KACH,mBAAY,OAAwB,EAAE,OAAoB,EAAE,MAAiC;SACzF,kBAAM,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;SAChC,IAAI,CAAC,QAAQ,GAAG,iBAAiB,CAAC;SAClC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC,aAAa,CAAC,CAAC;KAC5E,CAAC;KAED;;;;;;;;;QASG;KACI,4BAAkB,GAAzB,UAA0B,GAAW;SACjC,IAAM,gBAAgB,GAAG,yBAAyB;SAClD,IAAM,gBAAgB,GAAG,GAAG,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;SAErD,IAAI,WAAW,CAAC;SAChB,EAAE,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC;aACnB,WAAW,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;SACtC,CAAC;SAED,MAAM,CAAC,WAAW,CAAC;KACvB,CAAC;KAED;;;;QAIG;KACH,yBAAK,GAAL;SACI,IAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,SAAS,CAAC,oBAAoB,CAAC,IAAI,SAAS,CAAC,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;SAEtJ,EAAE,CAAC,CAAC,OAAO,WAAW,KAAK,QAAQ,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC;aAC9D,MAAM,IAAI,KAAK,CAAC,mIAAiI,SAAS,CAAC,oBAAoB,OAAI,CAAC,CAAC;SACzL,CAAC;SAED,MAAM,CAAC,WAAW,CAAC;KACvB,CAAC;KAED;;QAEG;KACH,4BAAQ,GAAR,UAAS,MAA0C;SACjD,IAAI,KAAK,GAAG,MAAM,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;SACjD,MAAM,CAAC,KAAK,GAAG,KAAK,GAAG,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;KAChE,CAAC;KAED;;QAEG;KACK,oCAAgB,GAAxB,UAAyB,QAAyB;SAChD,EAAE,CAAC,CAAC,QAAQ,IAAI,QAAQ,KAAK,YAAY,IAAI,QAAQ,KAAK,WAAW,IAAI,QAAQ,KAAK,YAAY,CAAC,CAAC,CAAC;aACnG,MAAM,CAAC,CAAC,EAAC,OAAO,EAAE,2EAA2E,EAAC,CAAC,CAAC;SAClG,CAAC;KACH,CAAC;KArEM,uBAAa,GAAG,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;KACzC,8BAAoB,GAAG,sBAAsB,CAAC;KAC9C,uBAAa,GAAG,cAAc,CAAC;KAC/B,cAAI,GAAG,WAAW,CAAC;KAmE9B,gBAAC;AAAD,EAAC,CAvE8B,KAAK,CAAC,KAAK,GAuEzC;AAvEY,kBAAS,YAuErB;;;;;;;;;;;;AClGD,mCAAsB,CAAS,CAAC;AAEhC;;;;;;IAMG;AACH;KAA0B,wBAAK;KAA/B;SAA0B,8BAAK;KAkB/B,CAAC;KAfC;;;;QAIG;KACH,oBAAK,GAAL;SACE,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;KAC5E,CAAC;KAED;;QAEG;KACH,uBAAQ,GAAR,UAAS,MAAW;SAClB,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;KAC5E,CAAC;KAhBM,SAAI,GAAG,MAAM,CAAC;KAiBvB,WAAC;AAAD,EAAC,CAlByB,aAAK,GAkB9B;AAlBY,aAAI,OAkBhB;;;;;;;ACxBD,oCAAmB,EAAU,CAAC;AAC9B,KAAY,IAAI,uBAAM,EAA2B,CAAC;AAClD,KAAY,GAAG,uBAAM,EAAmB,CAAC;AACzC,KAAY,MAAM,uBAAM,EAAgB,CAAC;AAQ5B,mBAAU,GAAgB,UAAC,IAAI,EAAE,mBAAmB,EAAE,UAA2B,EAAE,OAAqB;KAAlD,0BAA2B,GAA3B,aAAa,gBAAM,CAAC,OAAO;KAAE,uBAAqB,GAArB,UAAU,gBAAM,CAAC,IAAI;KACnH,MAAM,CAAC,IAAI,GAAG,CAAC,eAAe,CAAC,IAAI,EAAE;SACnC,YAAY,EAAE,OAAO;SACrB,eAAe,EAAE,UAAU;MAC5B,EAAE,mBAAmB,CAAC,CAAC;AAC1B,EAAC,CAAC;AAEW,oBAAW,GAAiB,UAAC,IAAa,EAAE,WAAqB,EAAE,yBAAkC;KAChH,MAAM,CAAC,IAAI,IAAI,CAAC,sBAAsB,CAAC;SACrC,yBAAyB,EAAE;aACzB,qBAAqB,EAAE,GAAG,CAAC,eAAe,CAAC,qBAAqB;aAChE,qBAAqB,EAAE,GAAG,CAAC,eAAe,CAAC,qBAAqB;UACjE;SACD,cAAc,EAAE,GAAG,CAAC,eAAe,CAAC,cAAc;SAClD,UAAI;SACJ,wBAAW;SACX,oDAAyB;MAC1B,CAAC,CAAC;AACL,EAAC,CAAC;AAEW,sBAAa,GAAmB,UAAC,IAAI;KAChD,MAAM,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AACjC,EAAC,CAAC;;;;;;;ACrCF,KAAM,MAAM,GAAG;KACb,OAAO,EAAE,OAAO;KAChB,IAAI,EAAE,IAAI;EACX,CAAC;AAEF;mBAAe,MAAM,CAAC;;;;;;;ACLtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD,qCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,mCAAkC;AAClC;AACA;AACA;AACA,eAAc;AACd;AACA;AACA;AACA,YAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAuD,uCAAuC;AAC9F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2FAA0F;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAsB;AACtB;AACA;AACA,eAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;;;AAGA;AACA;AACA,EAAC;AACD;AACA,mD;;;;;;ACtSA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD,qCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,0CAAyC,qBAAqB;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAkC,cAAc;AAChD,wCAAuC,yCAAyC;AAChF;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA,mCAAkC,cAAc;AAChD,wCAAuC,yCAAyC;AAChF;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA,mCAAkC,cAAc;AAChD,wCAAuC,yCAAyC;AAChF;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA,mCAAkC,cAAc;AAChD,wCAAuC,yCAAyC;AAChF;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA,gCAA+B,aAAa;AAC5C,mCAAkC,cAAc;AAChD,wCAAuC,yCAAyC;AAChF;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA,wCAAuC,yCAAyC;AAChF,0CAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAAyB,uBAAuB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA;AACA,GAAE;AACF;;;AAGA;AACA;AACA,EAAC;AACD;AACA,4C;;;;;;AClLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD,qCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAqC,iBAAiB,EAAE;AACxD;AACA;AACA,eAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;;;AAGA,QAAO;AACP;AACA;;AAEA,oCAAmC,8CAA8C;AACjF;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,wCAAuC,6EAA6E;AACpH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAQ;;AAER;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,WAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;AACA,qBAAoB,qBAAqB;AACzC;AACA;;AAEA;AACA,qBAAoB;AACpB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAY;AACZ;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA,iCAAgC,+BAA+B;AAC/D,gBAAe,iBAAiB;AAChC,SAAQ;AACR;;AAEA;AACA;AACA,8BAA6B,KAAK;AAClC;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,0DAAyD,sBAAsB;AAC/E;AACA;AACA;;AAEA,uBAAsB,iBAAiB;AACvC;AACA,6CAA4C,yDAAyD;AACrG;;AAEA;AACA,SAAQ;;AAER;AACA;AACA,SAAQ;;AAER;AACA;AACA;AACA;;AAEA,yDAAwD,kBAAkB;AAC1E;AACA;AACA,mCAAkC,yDAAyD;AAC3F,SAAQ;;AAER;AACA;AACA,SAAQ;;AAER;AACA;AACA;AACA;;AAEA,sDAAqD,kBAAkB;AACvE;AACA;AACA,mCAAkC,wDAAwD;AAC1F,SAAQ;;AAER;AACA;AACA,SAAQ;;AAER;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAQ;AACR,2BAA0B,WAAW,EAAE;AACvC,8BAA6B,WAAW;AACxC;;AAEA;AACA;AACA;AACA,sCAAqC,yBAAyB;;AAE9D;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,qBAAoB,mBAAmB;AACvC;;AAEA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA;AACA,WAAU;AACV;AACA;AACA,WAAU;AACV;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,uBAAsB,qBAAqB;AAC3C;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAQ;;AAER;AACA;;AAEA;AACA;AACA,2CAA0C,cAAc;;AAExD;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAQ;;AAER;AACA;AACA;AACA;;AAEA;;AAEA,uBAAsB,qBAAqB;AAC3C;;AAEA;;AAEA;AACA,6CAA4C,sBAAsB;AAClE,aAAY;AACZ,6CAA4C,sBAAsB;AAClE;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAQ;AACR;;AAEA;AACA;;AAEA,sCAAqC,KAAK;AAC1C;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;;AAEN;AACA;AACA;AACA;;AAEA;;AAEA,qBAAoB,mBAAmB;AACvC;;AAEA,uBAAsB,gBAAgB;AACtC;AACA;;AAEA,uBAAsB;AACtB;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAQ,eAAe;AACvB;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,8BAA6B;AAC7B;;AAEA;;AAEA,uBAAsB,iBAAiB;AACvC;;AAEA;;AAEA;;AAEA,yBAAwB,mBAAmB;AAC3C;;AAEA,0EAAyE,UAAU;;AAEnF;;AAEA;AACA,+CAA8C,0DAA0D;AACxG;;AAEA;AACA;AACA;AACA;AACA,2BAA0B;AAC1B;AACA;;AAEA;AACA,6CAA4C,0DAA0D;AACtG;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAQ;;AAER;AACA;;AAEA,uBAAsB,oDAAoD;;AAE1E;;AAEA,uBAAsB,yBAAyB;AAC/C;AACA;;AAEA;AACA,SAAQ;;AAER;AACA;AACA,SAAQ;;AAER;AACA;AACA,uBAAsB,oDAAoD;;AAE1E;;AAEA,uBAAsB,mBAAmB;AACzC;;AAEA,wEAAuE,UAAU;;AAEjF;AACA;AACA;;AAEA,yCAAwC,uBAAuB;;AAE/D;AACA;AACA;;AAEA;AACA,SAAQ;;AAER;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAwB,iBAAiB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA4B,kBAAkB;AAC9C;AACA;AACA;AACA,aAAY;AACZ;AACA;AACA;AACA;;AAEA,mCAAkC,WAAW;;AAE7C;AACA,SAAQ;;AAER;AACA;AACA,sBAAqB,kBAAkB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAY;AACZ;AACA;AACA;AACA;AACA,SAAQ;;AAER;AACA;AACA,yDAAwD;AACxD;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,uCAAsC,mBAAmB;;AAEzD;AACA;AACA;AACA;AACA;;AAEA,mBAAkB,eAAe;AACjC;AACA,iCAAgC,OAAO;AACvC;;AAEA;AACA,mBAAkB,iBAAiB;AACnC,qCAAoC,2BAA2B;AAC/D;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA,sDAAqD,oCAAoC,EAAE;AAC3F,OAAM;AACN;AACA,OAAM;AACN;AACA;AACA,GAAE;;AAEF;AACA,8BAA6B;;AAE7B,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA,QAAO;AACP;AACA;;AAEA,+BAA8B,mDAAmD;;;AAGjF;AACA;AACA,EAAC;AACD;AACA,mC","file":"powerbi.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"powerbi-client\"] = factory();\n\telse\n\t\troot[\"powerbi-client\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 882f812721ab072aa991","import * as service from './service';\r\nimport * as factories from './factories';\r\nimport * as models from 'powerbi-models';\r\nimport { IFilterable } from './ifilterable';\r\n\r\nexport {\r\n IFilterable,\r\n service,\r\n factories,\r\n models\r\n};\r\nexport {\r\n Report\r\n} from './report';\r\nexport {\r\n Tile\r\n} from './tile';\r\nexport {\r\n IEmbedConfiguration,\r\n Embed\r\n} from './embed';\r\nexport {\r\n Page\r\n} from './page';\r\n\r\ndeclare var powerbi: service.Service;\r\ndeclare global {\r\n interface Window {\r\n powerbi: service.Service;\r\n }\r\n}\r\n\r\n/**\r\n * Makes Power BI available to the global object for use in applications that don't have module loading support.\r\n *\r\n * Note: create an instance of the class with the default configuration for normal usage, or save the class so that you can create an instance of the service.\r\n */\r\nvar powerbi = new service.Service(factories.hpmFactory, factories.wpmpFactory, factories.routerFactory);\r\nwindow.powerbi = powerbi;\n\n\n// WEBPACK FOOTER //\n// ./src/powerbi.ts","import * as embed from './embed';\nimport { Report } from './report';\nimport { Create } from './create';\nimport { Dashboard } from './dashboard';\nimport { Tile } from './tile';\nimport { Page } from './page';\nimport * as utils from './util';\nimport * as wpmp from 'window-post-message-proxy';\nimport * as hpm from 'http-post-message';\nimport * as router from 'powerbi-router';\nimport * as models from 'powerbi-models';\n\nexport interface IEvent {\n type: string;\n id: string;\n name: string;\n value: T;\n}\n\nexport interface ICustomEvent extends CustomEvent {\n detail: T;\n}\n\nexport interface IEventHandler {\n (event: ICustomEvent): any;\n}\n\nexport interface IHpmFactory {\n (wpmp: wpmp.WindowPostMessageProxy, targetWindow?: Window, version?: string, type?: string, origin?: string): hpm.HttpPostMessage;\n}\n\nexport interface IWpmpFactory {\n (name?: string, logMessages?: boolean, eventSourceOverrideWindow?: Window): wpmp.WindowPostMessageProxy;\n}\n\nexport interface IRouterFactory {\n (wpmp: wpmp.WindowPostMessageProxy): router.Router;\n}\n\nexport interface IPowerBiElement extends HTMLElement {\n powerBiEmbed: embed.Embed;\n}\n\nexport interface IDebugOptions {\n logMessages?: boolean;\n wpmpName?: string;\n}\n\nexport interface IServiceConfiguration extends IDebugOptions {\n autoEmbedOnContentLoaded?: boolean;\n onError?: (error: any) => any;\n version?: string;\n type?: string;\n}\n\nexport interface IService {\n hpm: hpm.HttpPostMessage;\n}\n\n/**\n * The Power BI Service embed component, which is the entry point to embed all other Power BI components into your application\n * \n * @export\n * @class Service\n * @implements {IService}\n */\nexport class Service implements IService {\n\n /**\n * A list of components that this service can embed\n */\n private static components: (typeof Report | typeof Tile | typeof Dashboard)[] = [\n Tile,\n Report,\n Dashboard\n ];\n\n /**\n * The default configuration for the service\n */\n private static defaultConfig: IServiceConfiguration = {\n autoEmbedOnContentLoaded: false,\n onError: (...args) => console.log(args[0], args.slice(1))\n };\n\n /**\n * Gets or sets the access token as the global fallback token to use when a local token is not provided for a report or tile.\n * \n * @type {string}\n */\n accessToken: string;\n\n /**The Configuration object for the service*/\n private config: IServiceConfiguration;\n\n /** A list of Dashboard, Report and Tile components that have been embedded using this service instance. */\n private embeds: embed.Embed[];\n /** TODO: Look for way to make hpm private without sacraficing ease of maitenance. This should be private but in embed needs to call methods. */\n hpm: hpm.HttpPostMessage;\n /** TODO: Look for way to make wpmp private. This is only public to allow stopping the wpmp in tests */\n wpmp: wpmp.WindowPostMessageProxy;\n private router: router.Router;\n\n /**\n * Creates an instance of a Power BI Service.\n * \n * @param {IHpmFactory} hpmFactory The http post message factory used in the postMessage communication layer\n * @param {IWpmpFactory} wpmpFactory The window post message factory used in the postMessage communication layer\n * @param {IRouterFactory} routerFactory The router factory used in the postMessage communication layer\n * @param {IServiceConfiguration} [config={}]\n */\n constructor(hpmFactory: IHpmFactory, wpmpFactory: IWpmpFactory, routerFactory: IRouterFactory, config: IServiceConfiguration = {}) {\n this.wpmp = wpmpFactory(config.wpmpName, config.logMessages);\n this.hpm = hpmFactory(this.wpmp, null, config.version, config.type);\n this.router = routerFactory(this.wpmp);\n\n /**\n * Adds handler for report events.\n */\n this.router.post(`/reports/:uniqueId/events/:eventName`, (req, res) => {\n const event: IEvent = {\n type: 'report',\n id: req.params.uniqueId,\n name: req.params.eventName,\n value: req.body\n };\n\n this.handleEvent(event);\n });\n this.router.post(`/reports/:uniqueId/pages/:pageName/events/:eventName`, (req, res) => {\n const event: IEvent = {\n type: 'report',\n id: req.params.uniqueId,\n name: req.params.eventName,\n value: req.body\n };\n\n this.handleEvent(event);\n });\n\n this.router.post(`/dashboards/:uniqueId/events/:eventName`, (req, res) => {\n const event: IEvent = {\n type: 'dashboard',\n id: req.params.uniqueId,\n name: req.params.eventName,\n value: req.body\n };\n\n this.handleEvent(event);\n });\n\n this.embeds = [];\n\n // TODO: Change when Object.assign is available.\n this.config = utils.assign({}, Service.defaultConfig, config);\n\n if (this.config.autoEmbedOnContentLoaded) {\n this.enableAutoEmbed();\n }\n }\n\n /**\n * Creates new report\n * @param {HTMLElement} element\n * @param {embed.IEmbedConfiguration} [config={}]\n * @returns {embed.Embed}\n */\n createReport(element: HTMLElement, config: embed.IEmbedConfiguration): embed.Embed {\n config.type = 'create';\n let powerBiElement = element;\n const component = new Create(this, powerBiElement, config);\n powerBiElement.powerBiEmbed = component;\n this.embeds.push(component);\n\n return component;\n }\n\n /**\n * TODO: Add a description here\n * \n * @param {HTMLElement} [container]\n * @param {embed.IEmbedConfiguration} [config=undefined]\n * @returns {embed.Embed[]}\n */\n init(container?: HTMLElement, config: embed.IEmbedConfiguration = undefined): embed.Embed[] {\n container = (container && container instanceof HTMLElement) ? container : document.body;\n\n const elements = Array.prototype.slice.call(container.querySelectorAll(`[${embed.Embed.embedUrlAttribute}]`));\n return elements.map(element => this.embed(element, config));\n }\n\n /**\n * Given a configuration based on an HTML element,\n * if the component has already been created and attached to the element, reuses the component instance and existing iframe,\n * otherwise creates a new component instance.\n * \n * @param {HTMLElement} element\n * @param {embed.IEmbedConfiguration} [config={}]\n * @returns {embed.Embed}\n */\n embed(element: HTMLElement, config: embed.IEmbedConfiguration = {}): embed.Embed {\n let component: embed.Embed;\n let powerBiElement = element;\n\n if (powerBiElement.powerBiEmbed) {\n component = this.embedExisting(powerBiElement, config);\n }\n else {\n component = this.embedNew(powerBiElement, config);\n }\n\n return component;\n }\n\n /**\n * Given a configuration based on a Power BI element, saves the component instance that reference the element for later lookup.\n * \n * @private\n * @param {IPowerBiElement} element\n * @param {embed.IEmbedConfiguration} config\n * @returns {embed.Embed}\n */\n private embedNew(element: IPowerBiElement, config: embed.IEmbedConfiguration): embed.Embed {\n const componentType = config.type || element.getAttribute(embed.Embed.typeAttribute);\n if (!componentType) {\n throw new Error(`Attempted to embed using config ${JSON.stringify(config)} on element ${element.outerHTML}, but could not determine what type of component to embed. You must specify a type in the configuration or as an attribute such as '${embed.Embed.typeAttribute}=\"${Report.type.toLowerCase()}\"'.`);\n }\n\n // Saves the type as part of the configuration so that it can be referenced later at a known location.\n config.type = componentType;\n\n const Component = utils.find(component => componentType === component.type.toLowerCase(), Service.components);\n if (!Component) {\n throw new Error(`Attempted to embed component of type: ${componentType} but did not find any matching component. Please verify the type you specified is intended.`);\n }\n\n const component = new Component(this, element, config);\n element.powerBiEmbed = component;\n this.embeds.push(component);\n\n return component;\n }\n\n /**\n * Given an element that already contains an embed component, load with a new configuration.\n * \n * @private\n * @param {IPowerBiElement} element\n * @param {embed.IEmbedConfiguration} config\n * @returns {embed.Embed}\n */\n private embedExisting(element: IPowerBiElement, config: embed.IEmbedConfiguration): embed.Embed {\n const component = utils.find(x => x.element === element, this.embeds);\n if (!component) {\n throw new Error(`Attempted to embed using config ${JSON.stringify(config)} on element ${element.outerHTML} which already has embedded comopnent associated, but could not find the existing comopnent in the list of active components. This could indicate the embeds list is out of sync with the DOM, or the component is referencing the incorrect HTML element.`);\n }\n\n /**\n * TODO: Dynamic embed type switching could be supported but there is work needed to prepare the service state and DOM cleanup.\n * remove all event handlers from the DOM, then reset the element to initial state which removes iframe, and removes from list of embeds\n * then we can call the embedNew function which would allow setting the proper embedUrl and construction of object based on the new type.\n */\n if (typeof config.type === \"string\" && config.type !== component.config.type) {\n\n /**\n * When loading report after create we want to use existing Iframe to optimize load period\n */\n if(config.type === \"report\" && component.config.type === \"create\") {\n const report = new Report(this, element, config, element.powerBiEmbed.iframe);\n report.load(config);\n element.powerBiEmbed = report;\n this.embeds.push(report);\n\n return report;\n }\n\n throw new Error(`Embedding on an existing element with a different type than the previous embed object is not supported. Attempted to embed using config ${JSON.stringify(config)} on element ${element.outerHTML}, but the existing element contains an embed of type: ${this.config.type} which does not match the new type: ${config.type}`);\n }\n\n component.load(config);\n\n return component;\n }\n\n /**\n * Adds an event handler for DOMContentLoaded, which searches the DOM for elements that have the 'powerbi-embed-url' attribute,\n * and automatically attempts to embed a powerbi component based on information from other powerbi-* attributes.\n *\n * Note: Only runs if `config.autoEmbedOnContentLoaded` is true when the service is created.\n * This handler is typically useful only for applications that are rendered on the server so that all required data is available when the handler is called.\n */\n enableAutoEmbed(): void {\n window.addEventListener('DOMContentLoaded', (event: Event) => this.init(document.body), false);\n }\n\n /**\n * Returns an instance of the component associated with the element.\n * \n * @param {HTMLElement} element\n * @returns {(Report | Tile)}\n */\n get(element: HTMLElement): Report | Tile | Dashboard {\n const powerBiElement = element;\n\n if (!powerBiElement.powerBiEmbed) {\n throw new Error(`You attempted to get an instance of powerbi component associated with element: ${element.outerHTML} but there was no associated instance.`);\n }\n\n return powerBiElement.powerBiEmbed;\n }\n\n /**\n * Finds an embed instance by the name or unique ID that is provided.\n * \n * @param {string} uniqueId\n * @returns {(Report | Tile)}\n */\n find(uniqueId: string): Report | Tile | Dashboard {\n return utils.find(x => x.config.uniqueId === uniqueId, this.embeds);\n }\n\n /**\n * Given an HTML element that has a component embedded within it, removes the component from the list of embedded components, removes the association between the element and the component, and removes the iframe.\n * \n * @param {HTMLElement} element\n * @returns {void}\n */\n reset(element: HTMLElement): void {\n const powerBiElement = element;\n\n if (!powerBiElement.powerBiEmbed) {\n return;\n }\n\n /** Removes the component from an internal list of components. */\n utils.remove(x => x === powerBiElement.powerBiEmbed, this.embeds);\n /** Deletes a property from the HTML element. */\n delete powerBiElement.powerBiEmbed;\n /** Removes the iframe from the element. */\n const iframe = element.querySelector('iframe');\n if (iframe) {\n iframe.remove();\n }\n }\n\n /**\n * Given an event object, finds the embed component with the matching type and ID, and invokes its handleEvent method with the event object.\n * \n * @private\n * @param {IEvent} event\n */\n private handleEvent(event: IEvent): void {\n const embed = utils.find(embed => {\n return (embed.config.type === event.type\n && embed.config.uniqueId === event.id);\n }, this.embeds);\n\n if (embed) {\n const value = event.value;\n\n if (event.name === 'pageChanged') {\n const pageKey = 'newPage';\n const page: models.IPage = value[pageKey];\n if (!page) {\n throw new Error(`Page model not found at 'event.value.${pageKey}'.`);\n }\n value[pageKey] = new Page(embed, page.name, page.displayName);\n }\n\n utils.raiseCustomEvent(embed.element, event.name, value);\n }\n }\n}\n\n\n// WEBPACK FOOTER //\n// ./src/service.ts","import * as utils from './util';\r\nimport * as service from './service';\r\nimport * as models from 'powerbi-models';\r\nimport * as hpm from 'http-post-message';\r\n\r\ndeclare global {\r\n interface Document {\r\n // Mozilla Fullscreen\r\n mozCancelFullScreen: Function;\r\n\r\n // Ms Fullscreen\r\n msExitFullscreen: Function;\r\n }\r\n\r\n interface HTMLIFrameElement {\r\n // Mozilla Fullscreen\r\n mozRequestFullScreen: Function;\r\n\r\n // Ms Fullscreen\r\n msRequestFullscreen: Function;\r\n }\r\n}\r\n\r\n// TODO: Re-use ILoadConfiguration interface to prevent duplicating properties.\r\n// Current issue is that they are optional when embedding since they can be specificed as attributes but they are required when loading.\r\n/**\r\n * Configuration settings for Power BI embed components\r\n * \r\n * @export\r\n * @interface IEmbedConfiguration\r\n */\r\nexport interface IEmbedConfiguration {\r\n type?: string;\r\n id?: string;\r\n uniqueId?: string;\r\n embedUrl?: string;\r\n accessToken?: string;\r\n settings?: models.ISettings;\r\n pageName?: string;\r\n filters?: models.IFilter[];\r\n pageView?: models.PageView;\r\n datasetId?: string;\r\n permissions?: models.Permissions;\r\n viewMode?: models.ViewMode;\r\n}\r\n\r\nexport interface IInternalEmbedConfiguration extends models.IReportLoadConfiguration {\r\n uniqueId: string;\r\n type: string;\r\n embedUrl: string;\r\n}\r\n\r\nexport interface IInternalEventHandler {\r\n test(event: service.IEvent): boolean;\r\n handle(event: service.ICustomEvent): void;\r\n}\r\n\r\n/**\r\n * Base class for all Power BI embed components\r\n * \r\n * @export\r\n * @abstract\r\n * @class Embed\r\n */\r\nexport abstract class Embed {\r\n static allowedEvents = [\"loaded\", \"saved\", \"rendered\", \"saveAsTriggered\"];\r\n static accessTokenAttribute = 'powerbi-access-token';\r\n static embedUrlAttribute = 'powerbi-embed-url';\r\n static nameAttribute = 'powerbi-name';\r\n static typeAttribute = 'powerbi-type';\r\n static type: string;\r\n\r\n private static defaultSettings: models.ISettings = {\r\n filterPaneEnabled: true\r\n };\r\n\r\n allowedEvents = [];\r\n\r\n /**\r\n * Gets or sets the event handler registered for this embed component.\r\n * \r\n * @type {IInternalEventHandler[]}\r\n */\r\n eventHandlers: IInternalEventHandler[];\r\n\r\n /**\r\n * Gets or sets the Power BI embed service.\r\n * \r\n * @type {service.Service}\r\n */\r\n service: service.Service;\r\n\r\n /**\r\n * Gets or sets the HTML element that contains the Power BI embed component.\r\n * \r\n * @type {HTMLElement}\r\n */\r\n element: HTMLElement;\r\n\r\n /**\r\n * Gets or sets the HTML iframe element that renders the Power BI embed component.\r\n * \r\n * @type {HTMLIFrameElement}\r\n */\r\n iframe: HTMLIFrameElement;\r\n\r\n /**\r\n * Gets or sets the configuration settings for the Power BI embed component.\r\n * \r\n * @type {IInternalEmbedConfiguration}\r\n */\r\n config: IInternalEmbedConfiguration;\r\n\r\n /**\r\n * Gets or sets the configuration settings for creating report.\r\n * \r\n * @type {models.IReportCreateConfiguration}\r\n */\r\n createConfig: models.IReportCreateConfiguration;\r\n\r\n /**\r\n * Url used in the load request.\r\n */\r\n loadPath: string;\r\n\r\n /**\r\n * Type of embed\r\n */\r\n embeType: string;\r\n\r\n /**\r\n * Creates an instance of Embed.\r\n * \r\n * Note: there is circular reference between embeds and the service, because\r\n * the service has a list of all embeds on the host page, and each embed has a reference to the service that created it.\r\n * \r\n * @param {service.Service} service\r\n * @param {HTMLElement} element\r\n * @param {IEmbedConfiguration} config\r\n */\r\n constructor(service: service.Service, element: HTMLElement, config: IEmbedConfiguration, iframe?: HTMLIFrameElement) {\r\n Array.prototype.push.apply(this.allowedEvents, Embed.allowedEvents);\r\n this.eventHandlers = [];\r\n this.service = service;\r\n this.element = element;\r\n this.iframe = iframe;\r\n this.embeType = config.type.toLowerCase();\r\n\r\n this.populateConfig(config);\r\n \r\n if(this.embeType === 'create'){\r\n this.setIframe(false/*set EventListener to call create() on 'load' event*/);\r\n } else {\r\n this.setIframe(true/*set EventListener to call load() on 'load' event*/);\r\n }\r\n }\r\n\r\n /**\r\n * Sends createReport configuration data.\r\n * \r\n * ```javascript\r\n * createReport({\r\n * datasetId: '5dac7a4a-4452-46b3-99f6-a25915e0fe55',\r\n * accessToken: 'eyJ0eXA ... TaE2rTSbmg',\r\n * ```\r\n * \r\n * @param {models.IReportCreateConfiguration} config\r\n * @returns {Promise}\r\n */\r\n createReport(config: models.IReportCreateConfiguration): Promise {\r\n const errors = this.validate(config);\r\n if (errors) {\r\n throw errors;\r\n }\r\n \r\n return this.service.hpm.post(\"/report/create\", config, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n return response.body;\r\n },\r\n response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Saves Report.\r\n * \r\n * @returns {Promise}\r\n */\r\n save(): Promise {\r\n return this.service.hpm.post('/report/save', null, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n return response.body;\r\n })\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * SaveAs Report.\r\n * \r\n * @returns {Promise}\r\n */\r\n saveAs(saveAsParameters: models.ISaveAsParameters): Promise {\r\n return this.service.hpm.post('/report/saveAs', saveAsParameters, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n return response.body;\r\n })\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Sends load configuration data.\r\n * \r\n * ```javascript\r\n * report.load({\r\n * type: 'report',\r\n * id: '5dac7a4a-4452-46b3-99f6-a25915e0fe55',\r\n * accessToken: 'eyJ0eXA ... TaE2rTSbmg',\r\n * settings: {\r\n * navContentPaneEnabled: false\r\n * },\r\n * pageName: \"DefaultPage\",\r\n * filters: [\r\n * {\r\n * ... DefaultReportFilter ...\r\n * }\r\n * ]\r\n * })\r\n * .catch(error => { ... });\r\n * ```\r\n * \r\n * @param {models.ILoadConfiguration} config\r\n * @returns {Promise}\r\n */\r\n load(config: models.IReportLoadConfiguration | models.IDashboardLoadConfiguration): Promise {\r\n const errors = this.validate(config);\r\n if (errors) {\r\n throw errors;\r\n }\r\n\r\n return this.service.hpm.post(this.loadPath, config, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n utils.assign(this.config, config);\r\n return response.body;\r\n },\r\n response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Removes one or more event handlers from the list of handlers.\r\n * If a reference to the existing handle function is specified, remove the specific handler.\r\n * If the handler is not specified, remove all handlers for the event name specified.\r\n * \r\n * ```javascript\r\n * report.off('pageChanged')\r\n * \r\n * or \r\n * \r\n * const logHandler = function (event) {\r\n * console.log(event);\r\n * };\r\n * \r\n * report.off('pageChanged', logHandler);\r\n * ```\r\n * \r\n * @template T\r\n * @param {string} eventName\r\n * @param {service.IEventHandler} [handler]\r\n */\r\n off(eventName: string, handler?: service.IEventHandler): void {\r\n const fakeEvent: service.IEvent = { name: eventName, type: null, id: null, value: null };\r\n if (handler) {\r\n utils.remove(eventHandler => eventHandler.test(fakeEvent) && (eventHandler.handle === handler), this.eventHandlers);\r\n this.element.removeEventListener(eventName, handler);\r\n }\r\n else {\r\n const eventHandlersToRemove = this.eventHandlers\r\n .filter(eventHandler => eventHandler.test(fakeEvent));\r\n\r\n eventHandlersToRemove\r\n .forEach(eventHandlerToRemove => {\r\n utils.remove(eventHandler => eventHandler === eventHandlerToRemove, this.eventHandlers);\r\n this.element.removeEventListener(eventName, eventHandlerToRemove.handle);\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Adds an event handler for a specific event.\r\n * \r\n * ```javascript\r\n * report.on('pageChanged', (event) => {\r\n * console.log('PageChanged: ', event.page.name);\r\n * });\r\n * ```\r\n * \r\n * @template T\r\n * @param {string} eventName\r\n * @param {service.IEventHandler} handler\r\n */\r\n on(eventName: string, handler: service.IEventHandler): void {\r\n if (this.allowedEvents.indexOf(eventName) === -1) {\r\n throw new Error(`eventName is must be one of ${this.allowedEvents}. You passed: ${eventName}`);\r\n }\r\n\r\n this.eventHandlers.push({\r\n test: (event: service.IEvent) => event.name === eventName,\r\n handle: handler\r\n });\r\n\r\n this.element.addEventListener(eventName, handler)\r\n }\r\n\r\n /**\r\n * Reloads embed using existing configuration.\r\n * E.g. For reports this effectively clears all filters and makes the first page active which simulates resetting a report back to loaded state.\r\n * \r\n * ```javascript\r\n * report.reload();\r\n * ```\r\n */\r\n reload(): Promise {\r\n return this.load(this.config);\r\n }\r\n \r\n /**\r\n * Set accessToken.\r\n * \r\n * @returns {Promise}\r\n */\r\n setAccessToken(accessToken: string): Promise {\r\n return this.service.hpm.post('/report/token', accessToken, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n return response.body;\r\n })\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n \r\n /**\r\n * Gets an access token from the first available location: config, attribute, global.\r\n * \r\n * @private\r\n * @param {string} globalAccessToken\r\n * @returns {string}\r\n */\r\n private getAccessToken(globalAccessToken: string): string {\r\n const accessToken = this.config.accessToken || this.element.getAttribute(Embed.accessTokenAttribute) || globalAccessToken;\r\n\r\n if (!accessToken) {\r\n throw new Error(`No access token was found for element. You must specify an access token directly on the element using attribute '${Embed.accessTokenAttribute}' or specify a global token at: powerbi.accessToken.`);\r\n }\r\n\r\n return accessToken;\r\n }\r\n\r\n /**\r\n * Populate config for create and load\r\n * \r\n * @private\r\n * @param {IEmbedConfiguration}\r\n * @returns {void}\r\n */\r\n private populateConfig(config: IEmbedConfiguration): void {\r\n // TODO: Change when Object.assign is available.\r\n const settings = utils.assign({}, Embed.defaultSettings, config.settings);\r\n this.config = utils.assign({ settings }, config);\r\n this.config.uniqueId = this.getUniqueId();\r\n this.config.embedUrl = this.getEmbedUrl();\r\n\r\n if(this.embeType === 'create') {\r\n this.createConfig = {\r\n datasetId: config.datasetId || this.getId(),\r\n accessToken: this.getAccessToken(this.service.accessToken),\r\n settings: settings\r\n }\r\n } else {\r\n this.config.id = this.getId();\r\n this.config.accessToken = this.getAccessToken(this.service.accessToken);\r\n } \r\n }\r\n\r\n\r\n /**\r\n * Gets an embed url from the first available location: options, attribute.\r\n * \r\n * @private\r\n * @returns {string}\r\n */\r\n private getEmbedUrl(): string {\r\n const embedUrl = this.config.embedUrl || this.element.getAttribute(Embed.embedUrlAttribute);\r\n\r\n if (typeof embedUrl !== 'string' || embedUrl.length === 0) {\r\n throw new Error(`Embed Url is required, but it was not found. You must provide an embed url either as part of embed configuration or as attribute '${Embed.embedUrlAttribute}'.`);\r\n }\r\n\r\n return embedUrl;\r\n }\r\n\r\n /**\r\n * Gets a unique ID from the first available location: options, attribute.\r\n * If neither is provided generate a unique string.\r\n * \r\n * @private\r\n * @returns {string}\r\n */\r\n private getUniqueId(): string {\r\n return this.config.uniqueId || this.element.getAttribute(Embed.nameAttribute) || utils.createRandomString();\r\n }\r\n\r\n /**\r\n * Gets the report ID from the first available location: options, attribute.\r\n * \r\n * @abstract\r\n * @returns {string}\r\n */\r\n abstract getId(): string;\r\n\r\n /**\r\n * Requests the browser to render the component's iframe in fullscreen mode.\r\n */\r\n fullscreen(): void {\r\n const requestFullScreen = this.iframe.requestFullscreen || this.iframe.msRequestFullscreen || this.iframe.mozRequestFullScreen || this.iframe.webkitRequestFullscreen;\r\n requestFullScreen.call(this.iframe);\r\n }\r\n\r\n /**\r\n * Requests the browser to exit fullscreen mode.\r\n */\r\n exitFullscreen(): void {\r\n if (!this.isFullscreen(this.iframe)) {\r\n return;\r\n }\r\n\r\n const exitFullscreen = document.exitFullscreen || document.mozCancelFullScreen || document.webkitExitFullscreen || document.msExitFullscreen;\r\n exitFullscreen.call(document);\r\n }\r\n\r\n /**\r\n * Returns true if the iframe is rendered in fullscreen mode,\r\n * otherwise returns false.\r\n * \r\n * @private\r\n * @param {HTMLIFrameElement} iframe\r\n * @returns {boolean}\r\n */\r\n private isFullscreen(iframe: HTMLIFrameElement): boolean {\r\n const options = ['fullscreenElement', 'webkitFullscreenElement', 'mozFullscreenScreenElement', 'msFullscreenElement'];\r\n\r\n return options.some(option => document[option] === iframe);\r\n }\r\n \r\n /**\r\n * Validate load and create configuration.\r\n */\r\n abstract validate(config: models.IReportLoadConfiguration | models.IDashboardLoadConfiguration | models.IReportCreateConfiguration): models.IError[];\r\n\r\n /**\r\n * Sets Iframe for embed\r\n */\r\n private setIframe(isLoad: boolean): void {\r\n if(!this.iframe) {\r\n const iframeHtml = ``;\r\n this.element.innerHTML = iframeHtml;\r\n this.iframe = this.element.childNodes[0];\r\n }\r\n\r\n if(isLoad){\r\n this.iframe.addEventListener('load', () => this.load(this.config), false);\r\n } else {\r\n this.iframe.addEventListener('load', () => this.createReport(this.createConfig), false);\r\n }\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/embed.ts","\r\n/**\r\n * Raises a custom event with event data on the specified HTML element.\r\n * \r\n * @export\r\n * @param {HTMLElement} element\r\n * @param {string} eventName\r\n * @param {*} eventData\r\n */\r\nexport function raiseCustomEvent(element: HTMLElement, eventName: string, eventData: any): void {\r\n let customEvent;\r\n if (typeof CustomEvent === 'function') {\r\n customEvent = new CustomEvent(eventName, {\r\n detail: eventData,\r\n bubbles: true,\r\n cancelable: true\r\n });\r\n } else {\r\n customEvent = document.createEvent('CustomEvent');\r\n customEvent.initCustomEvent(eventName, true, true, eventData);\r\n }\r\n\r\n element.dispatchEvent(customEvent);\r\n}\r\n\r\n/**\r\n * Finds the index of the first value in an array that matches the specified predicate.\r\n * \r\n * @export\r\n * @template T\r\n * @param {(x: T) => boolean} predicate\r\n * @param {T[]} xs\r\n * @returns {number}\r\n */\r\nexport function findIndex(predicate: (x: T) => boolean, xs: T[]): number {\r\n if (!Array.isArray(xs)) {\r\n throw new Error(`You attempted to call find with second parameter that was not an array. You passed: ${xs}`);\r\n }\r\n\r\n let index;\r\n xs.some((x, i) => {\r\n if (predicate(x)) {\r\n index = i;\r\n return true;\r\n }\r\n });\r\n\r\n return index;\r\n}\r\n\r\n/**\r\n * Finds the first value in an array that matches the specified predicate.\r\n * \r\n * @export\r\n * @template T\r\n * @param {(x: T) => boolean} predicate\r\n * @param {T[]} xs\r\n * @returns {T}\r\n */\r\nexport function find(predicate: (x: T) => boolean, xs: T[]): T {\r\n const index = findIndex(predicate, xs);\r\n return xs[index];\r\n}\r\n\r\nexport function remove(predicate: (x: T) => boolean, xs: T[]): void {\r\n const index = findIndex(predicate, xs);\r\n xs.splice(index, 1);\r\n}\r\n\r\n// See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\r\n// TODO: replace in favor of using polyfill\r\n/**\r\n * Copies the values of all enumerable properties from one or more source objects to a target object, and returns the target object.\r\n * \r\n * @export\r\n * @param {any} args\r\n * @returns\r\n */\r\nexport function assign(...args) {\r\n var target = args[0];\r\n\r\n 'use strict';\r\n if (target === undefined || target === null) {\r\n throw new TypeError('Cannot convert undefined or null to object');\r\n }\r\n\r\n var output = Object(target);\r\n for (var index = 1; index < arguments.length; index++) {\r\n var source = arguments[index];\r\n if (source !== undefined && source !== null) {\r\n for (var nextKey in source) {\r\n if (source.hasOwnProperty(nextKey)) {\r\n output[nextKey] = source[nextKey];\r\n }\r\n }\r\n }\r\n }\r\n return output;\r\n}\r\n\r\n/**\r\n * Generates a random 7 character string.\r\n * \r\n * @export\r\n * @returns {string}\r\n */\r\nexport function createRandomString(): string {\r\n return (Math.random() + 1).toString(36).substring(7);\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/util.ts","import * as service from './service';\nimport * as embed from './embed';\nimport * as models from 'powerbi-models';\nimport * as wpmp from 'window-post-message-proxy';\nimport * as hpm from 'http-post-message';\nimport * as utils from './util';\nimport { IFilterable } from './ifilterable';\nimport { IPageNode, Page } from './page';\n\n/**\n * A Report node within a report hierarchy\n * \n * @export\n * @interface IReportNode\n */\nexport interface IReportNode {\n iframe: HTMLIFrameElement;\n service: service.IService;\n config: embed.IInternalEmbedConfiguration\n}\n\n/**\n * The Power BI Report embed component\n * \n * @export\n * @class Report\n * @extends {embed.Embed}\n * @implements {IReportNode}\n * @implements {IFilterable}\n */\nexport class Report extends embed.Embed implements IReportNode, IFilterable {\n static allowedEvents = [\"rendered\", \"dataSelected\", \"filtersApplied\", \"pageChanged\", \"error\", \"saved\", \"saveAsTriggered\"];\n static reportIdAttribute = 'powerbi-report-id';\n static filterPaneEnabledAttribute = 'powerbi-settings-filter-pane-enabled';\n static navContentPaneEnabledAttribute = 'powerbi-settings-nav-content-pane-enabled';\n static typeAttribute = 'powerbi-type';\n static type = \"Report\";\n\n /**\n * Creates an instance of a Power BI Report.\n * \n * @param {service.Service} service\n * @param {HTMLElement} element\n * @param {embed.IEmbedConfiguration} config\n */\n constructor(service: service.Service, element: HTMLElement, config: embed.IEmbedConfiguration, iframe?: HTMLIFrameElement) {\n const filterPaneEnabled = (config.settings && config.settings.filterPaneEnabled) || !(element.getAttribute(Report.filterPaneEnabledAttribute) === \"false\");\n const navContentPaneEnabled = (config.settings && config.settings.navContentPaneEnabled) || !(element.getAttribute(Report.navContentPaneEnabledAttribute) === \"false\");\n const settings = utils.assign({\n filterPaneEnabled,\n navContentPaneEnabled\n }, config.settings);\n const configCopy = utils.assign({ settings }, config);\n\n super(service, element, configCopy, iframe);\n this.loadPath = \"/report/load\";\n Array.prototype.push.apply(this.allowedEvents, Report.allowedEvents);\n }\n\n /**\n * Adds backwards compatibility for the previous load configuration, which used the reportId query parameter to specify the report ID\n * (e.g. http://embedded.powerbi.com/appTokenReportEmbed?reportId=854846ed-2106-4dc2-bc58-eb77533bf2f1).\n * \n * By extracting the ID we can ensure that the ID is always explicitly provided as part of the load configuration.\n * \n * @static\n * @param {string} url\n * @returns {string}\n */\n static findIdFromEmbedUrl(url: string): string {\n const reportIdRegEx = /reportId=\"?([^&]+)\"?/\n const reportIdMatch = url.match(reportIdRegEx);\n\n let reportId;\n if (reportIdMatch) {\n reportId = reportIdMatch[1];\n }\n\n return reportId;\n }\n\n /**\n * Gets filters that are applied at the report level.\n * \n * ```javascript\n * // Get filters applied at report level\n * report.getFilters()\n * .then(filters => {\n * ...\n * });\n * ```\n * \n * @returns {Promise}\n */\n getFilters(): Promise {\n return this.service.hpm.get(`/report/filters`, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .then(response => response.body,\n response => {\n throw response.body;\n });\n }\n\n /**\n * Gets the report ID from the first available location: options, attribute, embed url.\n * \n * @returns {string}\n */\n getId(): string {\n const reportId = this.config.id || this.element.getAttribute(Report.reportIdAttribute) || Report.findIdFromEmbedUrl(this.config.embedUrl);\n\n if (typeof reportId !== 'string' || reportId.length === 0) {\n throw new Error(`Report id is required, but it was not found. You must provide an id either as part of embed configuration or as attribute '${Report.reportIdAttribute}'.`);\n }\n\n return reportId;\n }\n\n /**\n * Gets the list of pages within the report.\n * \n * ```javascript\n * report.getPages()\n * .then(pages => {\n * ...\n * });\n * ```\n * \n * @returns {Promise}\n */\n getPages(): Promise {\n return this.service.hpm.get('/report/pages', { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .then(response => {\n return response.body\n .map(page => {\n return new Page(this, page.name, page.displayName);\n });\n }, response => {\n throw response.body;\n });\n }\n\n /**\n * Creates an instance of a Page.\n * \n * Normally you would get Page objects by calling `report.getPages()`, but in the case\n * that the page name is known and you want to perform an action on a page without having to retrieve it\n * you can create it directly.\n * \n * Note: Because you are creating the page manually there is no guarantee that the page actually exists in the report, and subsequent requests could fail.\n * \n * ```javascript\n * const page = report.page('ReportSection1');\n * page.setActive();\n * ```\n * \n * @param {string} name\n * @param {string} [displayName]\n * @returns {Page}\n */\n page(name: string, displayName?: string): Page {\n return new Page(this, name, displayName);\n }\n\n /**\n * Prints the active page of the report by invoking `window.print()` on the embed iframe component.\n */\n print(): Promise {\n return this.service.hpm.post('/report/print', null, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .then(response => {\n return response.body;\n })\n .catch(response => {\n throw response.body;\n });\n }\n\n /**\n * Removes all filters at the report level.\n * \n * ```javascript\n * report.removeFilters();\n * ```\n * \n * @returns {Promise}\n */\n removeFilters(): Promise {\n return this.setFilters([]);\n }\n\n /**\n * Sets the active page of the report.\n * \n * ```javascript\n * report.setPage(\"page2\")\n * .catch(error => { ... });\n * ```\n * \n * @param {string} pageName\n * @returns {Promise}\n */\n setPage(pageName: string): Promise {\n const page: models.IPage = {\n name: pageName,\n displayName: null\n };\n\n return this.service.hpm.put('/report/pages/active', page, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .catch(response => {\n throw response.body;\n });\n }\n\n /**\n * Sets filters at the report level.\n * \n * ```javascript\n * const filters: [\n * ...\n * ];\n * \n * report.setFilters(filters)\n * .catch(errors => {\n * ...\n * });\n * ```\n * \n * @param {(models.IFilter[])} filters\n * @returns {Promise}\n */\n setFilters(filters: models.IFilter[]): Promise {\n return this.service.hpm.put(`/report/filters`, filters, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .catch(response => {\n throw response.body;\n });\n }\n\n /**\n * Updates visibility settings for the filter pane and the page navigation pane.\n * \n * ```javascript\n * const newSettings = {\n * navContentPaneEnabled: true,\n * filterPaneEnabled: false\n * };\n * \n * report.updateSettings(newSettings)\n * .catch(error => { ... });\n * ```\n * \n * @param {models.ISettings} settings\n * @returns {Promise}\n */\n updateSettings(settings: models.ISettings): Promise {\n return this.service.hpm.patch('/report/settings', settings, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .catch(response => {\n throw response.body;\n });\n }\n\n /**\n * Validate load configuration.\n */\n validate(config: models.IReportLoadConfiguration): models.IError[] {\n return models.validateReportLoad(config);\n }\n\n /**\n * Switch Report view mode.\n * \n * @returns {Promise}\n */\n switchMode(viewMode: models.ViewMode): Promise {\n let url = '/report/switchMode/' + viewMode;\n return this.service.hpm.post(url, null, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .then(response => {\n return response.body;\n })\n .catch(response => {\n throw response.body;\n });\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/report.ts","/*! powerbi-models v0.10.4 | (c) 2016 Microsoft Corporation MIT */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"powerbi-models\"] = factory();\n\telse\n\t\troot[\"powerbi-models\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __extends = (this && this.__extends) || function (d, b) {\r\n\t for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\r\n\t function __() { this.constructor = d; }\r\n\t d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n\t};\r\n\t/* tslint:disable:no-var-requires */\r\n\texports.advancedFilterSchema = __webpack_require__(1);\r\n\texports.filterSchema = __webpack_require__(2);\r\n\texports.loadSchema = __webpack_require__(3);\r\n\texports.dashboardLoadSchema = __webpack_require__(4);\r\n\texports.pageSchema = __webpack_require__(5);\r\n\texports.settingsSchema = __webpack_require__(6);\r\n\texports.basicFilterSchema = __webpack_require__(7);\r\n\texports.createReportSchema = __webpack_require__(8);\r\n\texports.saveAsParametersSchema = __webpack_require__(9);\r\n\t/* tslint:enable:no-var-requires */\r\n\tvar jsen = __webpack_require__(10);\r\n\tfunction normalizeError(error) {\r\n\t var message = error.message;\r\n\t if (!message) {\r\n\t message = error.path + \" is invalid. Not meeting \" + error.keyword + \" constraint\";\r\n\t }\r\n\t return {\r\n\t message: message\r\n\t };\r\n\t}\r\n\t/**\r\n\t * Takes in schema and returns function which can be used to validate the schema with better semantics around exposing errors\r\n\t */\r\n\tfunction validate(schema, options) {\r\n\t return function (x) {\r\n\t var validate = jsen(schema, options);\r\n\t var isValid = validate(x);\r\n\t if (isValid) {\r\n\t return undefined;\r\n\t }\r\n\t else {\r\n\t return validate.errors\r\n\t .map(normalizeError);\r\n\t }\r\n\t };\r\n\t}\r\n\texports.validateSettings = validate(exports.settingsSchema, {\r\n\t schemas: {\r\n\t basicFilter: exports.basicFilterSchema,\r\n\t advancedFilter: exports.advancedFilterSchema\r\n\t }\r\n\t});\r\n\texports.validateReportLoad = validate(exports.loadSchema, {\r\n\t schemas: {\r\n\t settings: exports.settingsSchema,\r\n\t basicFilter: exports.basicFilterSchema,\r\n\t advancedFilter: exports.advancedFilterSchema\r\n\t }\r\n\t});\r\n\texports.validateCreateReport = validate(exports.createReportSchema);\r\n\texports.validateDashboardLoad = validate(exports.dashboardLoadSchema);\r\n\texports.validatePage = validate(exports.pageSchema);\r\n\texports.validateFilter = validate(exports.filterSchema, {\r\n\t schemas: {\r\n\t basicFilter: exports.basicFilterSchema,\r\n\t advancedFilter: exports.advancedFilterSchema\r\n\t }\r\n\t});\r\n\t(function (FilterType) {\r\n\t FilterType[FilterType[\"Advanced\"] = 0] = \"Advanced\";\r\n\t FilterType[FilterType[\"Basic\"] = 1] = \"Basic\";\r\n\t FilterType[FilterType[\"Unknown\"] = 2] = \"Unknown\";\r\n\t})(exports.FilterType || (exports.FilterType = {}));\r\n\tvar FilterType = exports.FilterType;\r\n\tfunction isFilterKeyColumnsTarget(target) {\r\n\t return isColumn(target) && !!target.keys;\r\n\t}\r\n\texports.isFilterKeyColumnsTarget = isFilterKeyColumnsTarget;\r\n\tfunction isBasicFilterWithKeys(filter) {\r\n\t return getFilterType(filter) === FilterType.Basic && !!filter.keyValues;\r\n\t}\r\n\texports.isBasicFilterWithKeys = isBasicFilterWithKeys;\r\n\tfunction getFilterType(filter) {\r\n\t var basicFilter = filter;\r\n\t var advancedFilter = filter;\r\n\t if ((typeof basicFilter.operator === \"string\")\r\n\t && (Array.isArray(basicFilter.values))) {\r\n\t return FilterType.Basic;\r\n\t }\r\n\t else if ((typeof advancedFilter.logicalOperator === \"string\")\r\n\t && (Array.isArray(advancedFilter.conditions))) {\r\n\t return FilterType.Advanced;\r\n\t }\r\n\t else {\r\n\t return FilterType.Unknown;\r\n\t }\r\n\t}\r\n\texports.getFilterType = getFilterType;\r\n\tfunction isMeasure(arg) {\r\n\t return arg.table !== undefined && arg.measure !== undefined;\r\n\t}\r\n\texports.isMeasure = isMeasure;\r\n\tfunction isColumn(arg) {\r\n\t return arg.table !== undefined && arg.column !== undefined;\r\n\t}\r\n\texports.isColumn = isColumn;\r\n\tfunction isHierarchy(arg) {\r\n\t return arg.table !== undefined && arg.hierarchy !== undefined && arg.hierarchyLevel !== undefined;\r\n\t}\r\n\texports.isHierarchy = isHierarchy;\r\n\tvar Filter = (function () {\r\n\t function Filter(target) {\r\n\t this.target = target;\r\n\t }\r\n\t Filter.prototype.toJSON = function () {\r\n\t return {\r\n\t $schema: this.schemaUrl,\r\n\t target: this.target\r\n\t };\r\n\t };\r\n\t ;\r\n\t return Filter;\r\n\t}());\r\n\texports.Filter = Filter;\r\n\tvar BasicFilter = (function (_super) {\r\n\t __extends(BasicFilter, _super);\r\n\t function BasicFilter(target, operator) {\r\n\t var values = [];\r\n\t for (var _i = 2; _i < arguments.length; _i++) {\r\n\t values[_i - 2] = arguments[_i];\r\n\t }\r\n\t _super.call(this, target);\r\n\t this.operator = operator;\r\n\t this.schemaUrl = BasicFilter.schemaUrl;\r\n\t if (values.length === 0 && operator !== \"All\") {\r\n\t throw new Error(\"values must be a non-empty array unless your operator is \\\"All\\\".\");\r\n\t }\r\n\t /**\r\n\t * Accept values as array instead of as individual arguments\r\n\t * new BasicFilter('a', 'b', 1, 2);\r\n\t * new BasicFilter('a', 'b', [1,2]);\r\n\t */\r\n\t if (Array.isArray(values[0])) {\r\n\t this.values = values[0];\r\n\t }\r\n\t else {\r\n\t this.values = values;\r\n\t }\r\n\t }\r\n\t BasicFilter.prototype.toJSON = function () {\r\n\t var filter = _super.prototype.toJSON.call(this);\r\n\t filter.operator = this.operator;\r\n\t filter.values = this.values;\r\n\t return filter;\r\n\t };\r\n\t BasicFilter.schemaUrl = \"http://powerbi.com/product/schema#basic\";\r\n\t return BasicFilter;\r\n\t}(Filter));\r\n\texports.BasicFilter = BasicFilter;\r\n\tvar BasicFilterWithKeys = (function (_super) {\r\n\t __extends(BasicFilterWithKeys, _super);\r\n\t function BasicFilterWithKeys(target, operator, values, keyValues) {\r\n\t _super.call(this, target, operator, values);\r\n\t this.keyValues = keyValues;\r\n\t this.target = target;\r\n\t var numberOfKeys = target.keys ? target.keys.length : 0;\r\n\t if (numberOfKeys > 0 && !keyValues) {\r\n\t throw new Error(\"You shold pass the values to be filtered for each key. You passed: no values and \" + numberOfKeys + \" keys\");\r\n\t }\r\n\t if (numberOfKeys === 0 && keyValues && keyValues.length > 0) {\r\n\t throw new Error(\"You passed key values but your target object doesn't contain the keys to be filtered\");\r\n\t }\r\n\t for (var i = 0; i < this.keyValues.length; i++) {\r\n\t if (this.keyValues[i]) {\r\n\t var lengthOfArray = this.keyValues[i].length;\r\n\t if (lengthOfArray !== numberOfKeys) {\r\n\t throw new Error(\"Each tuple of key values should contain a value for each of the keys. You passed: \" + lengthOfArray + \" values and \" + numberOfKeys + \" keys\");\r\n\t }\r\n\t }\r\n\t }\r\n\t }\r\n\t BasicFilterWithKeys.prototype.toJSON = function () {\r\n\t var filter = _super.prototype.toJSON.call(this);\r\n\t filter.keyValues = this.keyValues;\r\n\t return filter;\r\n\t };\r\n\t return BasicFilterWithKeys;\r\n\t}(BasicFilter));\r\n\texports.BasicFilterWithKeys = BasicFilterWithKeys;\r\n\tvar AdvancedFilter = (function (_super) {\r\n\t __extends(AdvancedFilter, _super);\r\n\t function AdvancedFilter(target, logicalOperator) {\r\n\t var conditions = [];\r\n\t for (var _i = 2; _i < arguments.length; _i++) {\r\n\t conditions[_i - 2] = arguments[_i];\r\n\t }\r\n\t _super.call(this, target);\r\n\t this.schemaUrl = AdvancedFilter.schemaUrl;\r\n\t // Guard statements\r\n\t if (typeof logicalOperator !== \"string\" || logicalOperator.length === 0) {\r\n\t // TODO: It would be nicer to list out the possible logical operators.\r\n\t throw new Error(\"logicalOperator must be a valid operator, You passed: \" + logicalOperator);\r\n\t }\r\n\t this.logicalOperator = logicalOperator;\r\n\t var extractedConditions;\r\n\t /**\r\n\t * Accept conditions as array instead of as individual arguments\r\n\t * new AdvancedFilter('a', 'b', \"And\", { value: 1, operator: \"Equals\" }, { value: 2, operator: \"IsGreaterThan\" });\r\n\t * new AdvancedFilter('a', 'b', \"And\", [{ value: 1, operator: \"Equals\" }, { value: 2, operator: \"IsGreaterThan\" }]);\r\n\t */\r\n\t if (Array.isArray(conditions[0])) {\r\n\t extractedConditions = conditions[0];\r\n\t }\r\n\t else {\r\n\t extractedConditions = conditions;\r\n\t }\r\n\t if (extractedConditions.length === 0) {\r\n\t throw new Error(\"conditions must be a non-empty array. You passed: \" + conditions);\r\n\t }\r\n\t if (extractedConditions.length > 2) {\r\n\t throw new Error(\"AdvancedFilters may not have more than two conditions. You passed: \" + conditions.length);\r\n\t }\r\n\t if (extractedConditions.length === 1 && logicalOperator !== \"And\") {\r\n\t throw new Error(\"Logical Operator must be \\\"And\\\" when there is only one condition provided\");\r\n\t }\r\n\t this.conditions = extractedConditions;\r\n\t }\r\n\t AdvancedFilter.prototype.toJSON = function () {\r\n\t var filter = _super.prototype.toJSON.call(this);\r\n\t filter.logicalOperator = this.logicalOperator;\r\n\t filter.conditions = this.conditions;\r\n\t return filter;\r\n\t };\r\n\t AdvancedFilter.schemaUrl = \"http://powerbi.com/product/schema#advanced\";\r\n\t return AdvancedFilter;\r\n\t}(Filter));\r\n\texports.AdvancedFilter = AdvancedFilter;\r\n\t(function (Permissions) {\r\n\t Permissions[Permissions[\"Read\"] = 0] = \"Read\";\r\n\t Permissions[Permissions[\"ReadWrite\"] = 1] = \"ReadWrite\";\r\n\t Permissions[Permissions[\"Copy\"] = 2] = \"Copy\";\r\n\t Permissions[Permissions[\"Create\"] = 4] = \"Create\";\r\n\t Permissions[Permissions[\"All\"] = 7] = \"All\";\r\n\t})(exports.Permissions || (exports.Permissions = {}));\r\n\tvar Permissions = exports.Permissions;\r\n\t(function (ViewMode) {\r\n\t ViewMode[ViewMode[\"View\"] = 0] = \"View\";\r\n\t ViewMode[ViewMode[\"Edit\"] = 1] = \"Edit\";\r\n\t})(exports.ViewMode || (exports.ViewMode = {}));\r\n\tvar ViewMode = exports.ViewMode;\r\n\texports.validateSaveAsParameters = validate(exports.saveAsParametersSchema);\r\n\n\n/***/ },\n/* 1 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"target\": {\n\t\t\t\t\"oneOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\t\"table\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"column\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"required\": [\n\t\t\t\t\t\t\t\"table\",\n\t\t\t\t\t\t\t\"column\"\n\t\t\t\t\t\t]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\t\"table\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"hierarchy\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"hierarchyLevel\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"required\": [\n\t\t\t\t\t\t\t\"table\",\n\t\t\t\t\t\t\t\"hierarchy\",\n\t\t\t\t\t\t\t\"hierarchyLevel\"\n\t\t\t\t\t\t]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\t\"table\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"measure\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"required\": [\n\t\t\t\t\t\t\t\"table\",\n\t\t\t\t\t\t\t\"measure\"\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"logicalOperator\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"conditions\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\"value\": {\n\t\t\t\t\t\t\t\"type\": [\n\t\t\t\t\t\t\t\t\"string\",\n\t\t\t\t\t\t\t\t\"boolean\",\n\t\t\t\t\t\t\t\t\"number\"\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"operator\": {\n\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\"required\": [\n\t\t\t\t\t\t\"value\",\n\t\t\t\t\t\t\"operator\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"target\",\n\t\t\t\"logicalOperator\",\n\t\t\t\"conditions\"\n\t\t]\n\t};\n\n/***/ },\n/* 2 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"oneOf\": [\n\t\t\t{\n\t\t\t\t\"$ref\": \"#basicFilter\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"$ref\": \"#advancedFilter\"\n\t\t\t}\n\t\t],\n\t\t\"invalidMessage\": \"filter is invalid\"\n\t};\n\n/***/ },\n/* 3 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"accessToken\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"accessToken must be a string\",\n\t\t\t\t\t\"required\": \"accessToken is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"id\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"id must be a string\",\n\t\t\t\t\t\"required\": \"id is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"settings\": {\n\t\t\t\t\"$ref\": \"#settings\"\n\t\t\t},\n\t\t\t\"pageName\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"pageName must be a string\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"filters\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\"oneOf\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"$ref\": \"#basicFilter\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"$ref\": \"#advancedFilter\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t\"invalidMessage\": \"filters property is invalid\"\n\t\t\t},\n\t\t\t\"permissions\": {\n\t\t\t\t\"type\": \"number\",\n\t\t\t\t\"enum\": [\n\t\t\t\t\t0,\n\t\t\t\t\t1,\n\t\t\t\t\t2,\n\t\t\t\t\t3\n\t\t\t\t],\n\t\t\t\t\"default\": 0,\n\t\t\t\t\"invalidMessage\": \"permissions property is invalid\"\n\t\t\t},\n\t\t\t\"viewMode\": {\n\t\t\t\t\"type\": \"number\",\n\t\t\t\t\"enum\": [\n\t\t\t\t\t0,\n\t\t\t\t\t1\n\t\t\t\t],\n\t\t\t\t\"default\": 0,\n\t\t\t\t\"invalidMessage\": \"viewMode property is invalid\"\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"accessToken\",\n\t\t\t\"id\"\n\t\t]\n\t};\n\n/***/ },\n/* 4 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"accessToken\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"accessToken must be a string\",\n\t\t\t\t\t\"required\": \"accessToken is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"id\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"id must be a string\",\n\t\t\t\t\t\"required\": \"id is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"pageView\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"pageView must be a string with one of the following values: \\\"actualSize\\\", \\\"fitToWidth\\\", \\\"oneColumn\\\"\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"accessToken\",\n\t\t\t\"id\"\n\t\t]\n\t};\n\n/***/ },\n/* 5 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"name\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"name must be a string\",\n\t\t\t\t\t\"required\": \"name is required\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"name\"\n\t\t]\n\t};\n\n/***/ },\n/* 6 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"filterPaneEnabled\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"filterPaneEnabled must be a boolean\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"navContentPaneEnabled\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"navContentPaneEnabled must be a boolean\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"useCustomSaveAsDialog\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"useCustomSaveAsDialog must be a boolean\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n/***/ },\n/* 7 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"target\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"properties\": {\n\t\t\t\t\t\"table\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"column\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"hierarchy\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"hierarchyLevel\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"measure\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"required\": [\n\t\t\t\t\t\"table\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"operator\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"values\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"type\": [\n\t\t\t\t\t\t\"string\",\n\t\t\t\t\t\t\"boolean\",\n\t\t\t\t\t\t\"number\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"target\",\n\t\t\t\"operator\",\n\t\t\t\"values\"\n\t\t]\n\t};\n\n/***/ },\n/* 8 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"accessToken\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"accessToken must be a string\",\n\t\t\t\t\t\"required\": \"accessToken is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"datasetId\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"datasetId must be a string\",\n\t\t\t\t\t\"required\": \"datasetId is required\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"accessToken\",\n\t\t\t\"datasetId\"\n\t\t]\n\t};\n\n/***/ },\n/* 9 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"name\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"name must be a string\",\n\t\t\t\t\t\"required\": \"name is required\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"name\"\n\t\t]\n\t};\n\n/***/ },\n/* 10 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = __webpack_require__(11);\n\n/***/ },\n/* 11 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar REGEX_ESCAPE_EXPR = /[\\/]/g,\n\t STR_ESCAPE_EXPR = /(\")/gim,\n\t VALID_IDENTIFIER_EXPR = /^[a-z_$][0-9a-z]*$/gi,\n\t INVALID_SCHEMA = 'jsen: invalid schema object',\n\t browser = typeof window === 'object' && !!window.navigator, // jshint ignore: line\n\t regescape = new RegExp('/').source !== '/', // node v0.x does not properly escape '/'s in inline regex\n\t func = __webpack_require__(12),\n\t equal = __webpack_require__(13),\n\t unique = __webpack_require__(14),\n\t SchemaResolver = __webpack_require__(15),\n\t formats = __webpack_require__(24),\n\t ucs2length = __webpack_require__(25),\n\t types = {},\n\t keywords = {};\n\t\n\tfunction inlineRegex(regex) {\n\t regex = regex instanceof RegExp ? regex : new RegExp(regex);\n\t\n\t return regescape ?\n\t regex.toString() :\n\t '/' + regex.source.replace(REGEX_ESCAPE_EXPR, '\\\\$&') + '/';\n\t}\n\t\n\tfunction encodeStr(str) {\n\t return '\"' + str.replace(STR_ESCAPE_EXPR, '\\\\$1') + '\"';\n\t}\n\t\n\tfunction appendToPath(path, key) {\n\t VALID_IDENTIFIER_EXPR.lastIndex = 0;\n\t\n\t return VALID_IDENTIFIER_EXPR.test(key) ?\n\t path + '.' + key :\n\t path + '[' + encodeStr(key) + ']';\n\t}\n\t\n\tfunction type(obj) {\n\t if (obj === undefined) {\n\t return 'undefined';\n\t }\n\t\n\t var str = Object.prototype.toString.call(obj);\n\t return str.substr(8, str.length - 9).toLowerCase();\n\t}\n\t\n\tfunction isInteger(obj) {\n\t return (obj | 0) === obj; // jshint ignore: line\n\t}\n\t\n\ttypes['null'] = function (path) {\n\t return path + ' === null';\n\t};\n\t\n\ttypes.boolean = function (path) {\n\t return 'typeof ' + path + ' === \"boolean\"';\n\t};\n\t\n\ttypes.string = function (path) {\n\t return 'typeof ' + path + ' === \"string\"';\n\t};\n\t\n\ttypes.number = function (path) {\n\t return 'typeof ' + path + ' === \"number\"';\n\t};\n\t\n\ttypes.integer = function (path) {\n\t return 'typeof ' + path + ' === \"number\" && !(' + path + ' % 1)';\n\t};\n\t\n\ttypes.array = function (path) {\n\t return 'Array.isArray(' + path + ')';\n\t};\n\t\n\ttypes.object = function (path) {\n\t return 'typeof ' + path + ' === \"object\" && ' + path + ' !== null && !Array.isArray(' + path + ')';\n\t};\n\t\n\ttypes.date = function (path) {\n\t return path + ' instanceof Date';\n\t};\n\t\n\tkeywords.enum = function (context) {\n\t var arr = context.schema['enum'];\n\t\n\t context.code('if (!equalAny(' + context.path + ', ' + JSON.stringify(arr) + ')) {');\n\t context.error('enum');\n\t context.code('}');\n\t};\n\t\n\tkeywords.minimum = function (context) {\n\t if (typeof context.schema.minimum === 'number') {\n\t context.code('if (' + context.path + ' < ' + context.schema.minimum + ') {');\n\t context.error('minimum');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.exclusiveMinimum = function (context) {\n\t if (context.schema.exclusiveMinimum === true && typeof context.schema.minimum === 'number') {\n\t context.code('if (' + context.path + ' === ' + context.schema.minimum + ') {');\n\t context.error('exclusiveMinimum');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.maximum = function (context) {\n\t if (typeof context.schema.maximum === 'number') {\n\t context.code('if (' + context.path + ' > ' + context.schema.maximum + ') {');\n\t context.error('maximum');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.exclusiveMaximum = function (context) {\n\t if (context.schema.exclusiveMaximum === true && typeof context.schema.maximum === 'number') {\n\t context.code('if (' + context.path + ' === ' + context.schema.maximum + ') {');\n\t context.error('exclusiveMaximum');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.multipleOf = function (context) {\n\t if (typeof context.schema.multipleOf === 'number') {\n\t var mul = context.schema.multipleOf,\n\t decimals = mul.toString().length - mul.toFixed(0).length - 1,\n\t pow = decimals > 0 ? Math.pow(10, decimals) : 1,\n\t path = context.path;\n\t\n\t if (decimals > 0) {\n\t context.code('if (+(Math.round((' + path + ' * ' + pow + ') + \"e+\" + ' + decimals + ') + \"e-\" + ' + decimals + ') % ' + (mul * pow) + ' !== 0) {');\n\t } else {\n\t context.code('if (((' + path + ' * ' + pow + ') % ' + (mul * pow) + ') !== 0) {');\n\t }\n\t\n\t context.error('multipleOf');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.minLength = function (context) {\n\t if (isInteger(context.schema.minLength)) {\n\t context.code('if (ucs2length(' + context.path + ') < ' + context.schema.minLength + ') {');\n\t context.error('minLength');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.maxLength = function (context) {\n\t if (isInteger(context.schema.maxLength)) {\n\t context.code('if (ucs2length(' + context.path + ') > ' + context.schema.maxLength + ') {');\n\t context.error('maxLength');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.pattern = function (context) {\n\t var pattern = context.schema.pattern;\n\t\n\t if (typeof pattern === 'string' || pattern instanceof RegExp) {\n\t context.code('if (!(' + inlineRegex(pattern) + ').test(' + context.path + ')) {');\n\t context.error('pattern');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.format = function (context) {\n\t if (typeof context.schema.format !== 'string' || !formats[context.schema.format]) {\n\t return;\n\t }\n\t\n\t context.code('if (!(' + formats[context.schema.format] + ').test(' + context.path + ')) {');\n\t context.error('format');\n\t context.code('}');\n\t};\n\t\n\tkeywords.minItems = function (context) {\n\t if (isInteger(context.schema.minItems)) {\n\t context.code('if (' + context.path + '.length < ' + context.schema.minItems + ') {');\n\t context.error('minItems');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.maxItems = function (context) {\n\t if (isInteger(context.schema.maxItems)) {\n\t context.code('if (' + context.path + '.length > ' + context.schema.maxItems + ') {');\n\t context.error('maxItems');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.additionalItems = function (context) {\n\t if (context.schema.additionalItems === false && Array.isArray(context.schema.items)) {\n\t context.code('if (' + context.path + '.length > ' + context.schema.items.length + ') {');\n\t context.error('additionalItems');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.uniqueItems = function (context) {\n\t if (context.schema.uniqueItems) {\n\t context.code('if (unique(' + context.path + ').length !== ' + context.path + '.length) {');\n\t context.error('uniqueItems');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.items = function (context) {\n\t var index = context.declare(0),\n\t i = 0;\n\t\n\t if (type(context.schema.items) === 'object') {\n\t context.code('for (' + index + ' = 0; ' + index + ' < ' + context.path + '.length; ' + index + '++) {');\n\t\n\t context.descend(context.path + '[' + index + ']', context.schema.items);\n\t\n\t context.code('}');\n\t }\n\t else if (Array.isArray(context.schema.items)) {\n\t for (; i < context.schema.items.length; i++) {\n\t context.code('if (' + context.path + '.length - 1 >= ' + i + ') {');\n\t\n\t context.descend(context.path + '[' + i + ']', context.schema.items[i]);\n\t\n\t context.code('}');\n\t }\n\t\n\t if (type(context.schema.additionalItems) === 'object') {\n\t context.code('for (' + index + ' = ' + i + '; ' + index + ' < ' + context.path + '.length; ' + index + '++) {');\n\t\n\t context.descend(context.path + '[' + index + ']', context.schema.additionalItems);\n\t\n\t context.code('}');\n\t }\n\t }\n\t};\n\t\n\tkeywords.maxProperties = function (context) {\n\t if (isInteger(context.schema.maxProperties)) {\n\t context.code('if (Object.keys(' + context.path + ').length > ' + context.schema.maxProperties + ') {');\n\t context.error('maxProperties');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.minProperties = function (context) {\n\t if (isInteger(context.schema.minProperties)) {\n\t context.code('if (Object.keys(' + context.path + ').length < ' + context.schema.minProperties + ') {');\n\t context.error('minProperties');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.required = function (context) {\n\t if (!Array.isArray(context.schema.required)) {\n\t return;\n\t }\n\t\n\t for (var i = 0; i < context.schema.required.length; i++) {\n\t context.code('if (' + appendToPath(context.path, context.schema.required[i]) + ' === undefined) {');\n\t context.error('required', context.schema.required[i]);\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.properties = function (context) {\n\t var props = context.schema.properties,\n\t propKeys = type(props) === 'object' ? Object.keys(props) : [],\n\t required = Array.isArray(context.schema.required) ? context.schema.required : [],\n\t prop, i, nestedPath;\n\t\n\t if (!propKeys.length) {\n\t return;\n\t }\n\t\n\t for (i = 0; i < propKeys.length; i++) {\n\t prop = propKeys[i];\n\t nestedPath = appendToPath(context.path, prop);\n\t\n\t context.code('if (' + nestedPath + ' !== undefined) {');\n\t\n\t context.descend(nestedPath, props[prop]);\n\t\n\t context.code('}');\n\t\n\t if (required.indexOf(prop) > -1) {\n\t context.code('else {');\n\t context.error('required', prop);\n\t context.code('}');\n\t }\n\t }\n\t};\n\t\n\tkeywords.patternProperties = keywords.additionalProperties = function (context) {\n\t var propKeys = type(context.schema.properties) === 'object' ?\n\t Object.keys(context.schema.properties) : [],\n\t patProps = context.schema.patternProperties,\n\t patterns = type(patProps) === 'object' ? Object.keys(patProps) : [],\n\t addProps = context.schema.additionalProperties,\n\t addPropsCheck = addProps === false || type(addProps) === 'object',\n\t props, keys, key, n, found, pattern, i;\n\t\n\t if (!patterns.length && !addPropsCheck) {\n\t return;\n\t }\n\t\n\t keys = context.declare('[]');\n\t key = context.declare('\"\"');\n\t n = context.declare(0);\n\t\n\t if (addPropsCheck) {\n\t found = context.declare(false);\n\t }\n\t\n\t context.code(keys + ' = Object.keys(' + context.path + ')');\n\t\n\t context.code('for (' + n + ' = 0; ' + n + ' < ' + keys + '.length; ' + n + '++) {')\n\t (key + ' = ' + keys + '[' + n + ']')\n\t\n\t ('if (' + context.path + '[' + key + '] === undefined) {')\n\t ('continue')\n\t ('}');\n\t\n\t if (addPropsCheck) {\n\t context.code(found + ' = false');\n\t }\n\t\n\t // validate pattern properties\n\t for (i = 0; i < patterns.length; i++) {\n\t pattern = patterns[i];\n\t\n\t context.code('if ((' + inlineRegex(pattern) + ').test(' + key + ')) {');\n\t\n\t context.descend(context.path + '[' + key + ']', patProps[pattern]);\n\t\n\t if (addPropsCheck) {\n\t context.code(found + ' = true');\n\t }\n\t\n\t context.code('}');\n\t }\n\t\n\t // validate additional properties\n\t if (addPropsCheck) {\n\t if (propKeys.length) {\n\t props = context.declare(JSON.stringify(propKeys));\n\t\n\t // do not validate regular properties\n\t context.code('if (' + props + '.indexOf(' + key + ') > -1) {')\n\t ('continue')\n\t ('}');\n\t }\n\t\n\t context.code('if (!' + found + ') {');\n\t\n\t if (addProps === false) {\n\t // do not allow additional properties\n\t context.error('additionalProperties', undefined, key);\n\t }\n\t else {\n\t // validate additional properties\n\t context.descend(context.path + '[' + key + ']', addProps);\n\t }\n\t\n\t context.code('}');\n\t }\n\t\n\t context.code('}');\n\t};\n\t\n\tkeywords.dependencies = function (context) {\n\t if (type(context.schema.dependencies) !== 'object') {\n\t return;\n\t }\n\t\n\t var depKeys = Object.keys(context.schema.dependencies),\n\t len = depKeys.length,\n\t key, dep, i = 0, k = 0;\n\t\n\t for (; k < len; k++) {\n\t key = depKeys[k];\n\t dep = context.schema.dependencies[key];\n\t\n\t context.code('if (' + appendToPath(context.path, key) + ' !== undefined) {');\n\t\n\t if (type(dep) === 'object') {\n\t //schema dependency\n\t context.descend(context.path, dep);\n\t }\n\t else {\n\t // property dependency\n\t for (i; i < dep.length; i++) {\n\t context.code('if (' + appendToPath(context.path, dep[i]) + ' === undefined) {');\n\t context.error('dependencies', dep[i]);\n\t context.code('}');\n\t }\n\t }\n\t\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.allOf = function (context) {\n\t if (!Array.isArray(context.schema.allOf)) {\n\t return;\n\t }\n\t\n\t for (var i = 0; i < context.schema.allOf.length; i++) {\n\t context.descend(context.path, context.schema.allOf[i]);\n\t }\n\t};\n\t\n\tkeywords.anyOf = function (context) {\n\t if (!Array.isArray(context.schema.anyOf)) {\n\t return;\n\t }\n\t\n\t var greedy = context.greedy,\n\t errCount = context.declare(0),\n\t initialCount = context.declare(0),\n\t found = context.declare(false),\n\t i = 0;\n\t\n\t context.code(initialCount + ' = errors.length');\n\t\n\t for (; i < context.schema.anyOf.length; i++) {\n\t context.code('if (!' + found + ') {');\n\t\n\t context.code(errCount + ' = errors.length');\n\t\n\t context.greedy = true;\n\t\n\t context.descend(context.path, context.schema.anyOf[i]);\n\t\n\t context.code(found + ' = errors.length === ' + errCount)\n\t ('}');\n\t }\n\t\n\t context.greedy = greedy;\n\t\n\t context.code('if (!' + found + ') {');\n\t\n\t context.error('anyOf');\n\t\n\t context.code('} else {')\n\t ('errors.length = ' + initialCount)\n\t ('}');\n\t};\n\t\n\tkeywords.oneOf = function (context) {\n\t if (!Array.isArray(context.schema.oneOf)) {\n\t return;\n\t }\n\t\n\t var greedy = context.greedy,\n\t matching = context.declare(0),\n\t initialCount = context.declare(0),\n\t errCount = context.declare(0),\n\t i = 0;\n\t\n\t context.code(initialCount + ' = errors.length');\n\t context.code(matching + ' = 0');\n\t\n\t for (; i < context.schema.oneOf.length; i++) {\n\t context.code(errCount + ' = errors.length');\n\t\n\t context.greedy = true;\n\t\n\t context.descend(context.path, context.schema.oneOf[i]);\n\t\n\t context.code('if (errors.length === ' + errCount + ') {')\n\t (matching + '++')\n\t ('}');\n\t }\n\t\n\t context.greedy = greedy;\n\t\n\t context.code('if (' + matching + ' !== 1) {');\n\t\n\t context.error('oneOf');\n\t\n\t context.code('} else {')\n\t ('errors.length = ' + initialCount)\n\t ('}');\n\t};\n\t\n\tkeywords.not = function (context) {\n\t if (type(context.schema.not) !== 'object') {\n\t return;\n\t }\n\t\n\t var greedy = context.greedy,\n\t errCount = context.declare(0);\n\t\n\t context.code(errCount + ' = errors.length');\n\t\n\t context.greedy = true;\n\t\n\t context.descend(context.path, context.schema.not);\n\t\n\t context.greedy = greedy;\n\t\n\t context.code('if (errors.length === ' + errCount + ') {');\n\t\n\t context.error('not');\n\t\n\t context.code('} else {')\n\t ('errors.length = ' + errCount)\n\t ('}');\n\t};\n\t\n\tfunction decorateGenerator(type, keyword) {\n\t keywords[keyword].type = type;\n\t keywords[keyword].keyword = keyword;\n\t}\n\t\n\t['minimum', 'exclusiveMinimum', 'maximum', 'exclusiveMaximum', 'multipleOf']\n\t .forEach(decorateGenerator.bind(null, 'number'));\n\t\n\t['minLength', 'maxLength', 'pattern', 'format']\n\t .forEach(decorateGenerator.bind(null, 'string'));\n\t\n\t['minItems', 'maxItems', 'additionalItems', 'uniqueItems', 'items']\n\t .forEach(decorateGenerator.bind(null, 'array'));\n\t\n\t['maxProperties', 'minProperties', 'required', 'properties', 'patternProperties', 'additionalProperties', 'dependencies']\n\t .forEach(decorateGenerator.bind(null, 'object'));\n\t\n\t['enum', 'allOf', 'anyOf', 'oneOf', 'not']\n\t .forEach(decorateGenerator.bind(null, null));\n\t\n\tfunction groupKeywords(schema) {\n\t var keys = Object.keys(schema),\n\t propIndex = keys.indexOf('properties'),\n\t patIndex = keys.indexOf('patternProperties'),\n\t ret = {\n\t enum: Array.isArray(schema.enum) && schema.enum.length > 0,\n\t type: null,\n\t allType: [],\n\t perType: {}\n\t },\n\t key, gen, i;\n\t\n\t if (schema.type) {\n\t if (typeof schema.type === 'string') {\n\t ret.type = [schema.type];\n\t }\n\t else if (Array.isArray(schema.type) && schema.type.length) {\n\t ret.type = schema.type.slice(0);\n\t }\n\t }\n\t\n\t for (i = 0; i < keys.length; i++) {\n\t key = keys[i];\n\t\n\t if (key === 'enum' || key === 'type') {\n\t continue;\n\t }\n\t\n\t gen = keywords[key];\n\t\n\t if (!gen) {\n\t continue;\n\t }\n\t\n\t if (gen.type) {\n\t if (!ret.perType[gen.type]) {\n\t ret.perType[gen.type] = [];\n\t }\n\t\n\t if (!(propIndex > -1 && key === 'required') &&\n\t !(patIndex > -1 && key === 'additionalProperties')) {\n\t ret.perType[gen.type].push(key);\n\t }\n\t }\n\t else {\n\t ret.allType.push(key);\n\t }\n\t }\n\t\n\t return ret;\n\t}\n\t\n\tfunction getPathExpression(path, key) {\n\t var path_ = path.substr(4),\n\t len = path_.length,\n\t tokens = [],\n\t token = '',\n\t isvar = false,\n\t char, i;\n\t\n\t for (i = 0; i < len; i++) {\n\t char = path_[i];\n\t\n\t switch (char) {\n\t case '.':\n\t if (token) {\n\t token += char;\n\t }\n\t break;\n\t case '[':\n\t if (isNaN(+path_[i + 1])) {\n\t isvar = true;\n\t\n\t if (token) {\n\t tokens.push('\"' + token + '\"');\n\t token = '';\n\t }\n\t }\n\t else {\n\t isvar = false;\n\t\n\t if (token) {\n\t token += '.';\n\t }\n\t }\n\t break;\n\t case ']':\n\t tokens.push(isvar ? token : '\"' + token + '\"');\n\t token = '';\n\t break;\n\t default:\n\t token += char;\n\t }\n\t }\n\t\n\t if (token) {\n\t tokens.push('\"' + token + '\"');\n\t }\n\t\n\t if (key) {\n\t tokens.push('\"' + key + '\"');\n\t }\n\t\n\t if (tokens.length === 1 && isvar) {\n\t return '\"\" + ' + tokens[0] + ' + \"\"';\n\t }\n\t\n\t return tokens.join(' + \".\" + ') || '\"\"';\n\t}\n\t\n\tfunction clone(obj) {\n\t var cloned = obj,\n\t objType = type(obj),\n\t keys, len, key, i;\n\t\n\t if (objType === 'object') {\n\t cloned = {};\n\t keys = Object.keys(obj);\n\t\n\t for (i = 0, len = keys.length; i < len; i++) {\n\t key = keys[i];\n\t cloned[key] = clone(obj[key]);\n\t }\n\t }\n\t else if (objType === 'array') {\n\t cloned = [];\n\t\n\t for (i = 0, len = obj.length; i < len; i++) {\n\t cloned[i] = clone(obj[i]);\n\t }\n\t }\n\t else if (objType === 'regexp') {\n\t return new RegExp(obj);\n\t }\n\t else if (objType === 'date') {\n\t return new Date(obj.toJSON());\n\t }\n\t\n\t return cloned;\n\t}\n\t\n\tfunction equalAny(obj, options) {\n\t for (var i = 0, len = options.length; i < len; i++) {\n\t if (equal(obj, options[i])) {\n\t return true;\n\t }\n\t }\n\t\n\t return false;\n\t}\n\t\n\tfunction PropertyMarker() {\n\t this.objects = [];\n\t this.properties = [];\n\t}\n\t\n\tPropertyMarker.prototype.mark = function (obj, key) {\n\t var index = this.objects.indexOf(obj),\n\t prop;\n\t\n\t if (index < 0) {\n\t this.objects.push(obj);\n\t\n\t prop = {};\n\t prop[key] = 1;\n\t\n\t this.properties.push(prop);\n\t\n\t return;\n\t }\n\t\n\t prop = this.properties[index];\n\t\n\t prop[key] = prop[key] ? prop[key] + 1 : 1;\n\t};\n\t\n\tPropertyMarker.prototype.deleteDuplicates = function () {\n\t var props, keys, key, i, j;\n\t\n\t for (i = 0; i < this.properties.length; i++) {\n\t props = this.properties[i];\n\t keys = Object.keys(props);\n\t\n\t for (j = 0; j < keys.length; j++) {\n\t key = keys[j];\n\t\n\t if (props[key] > 1) {\n\t delete this.objects[i][key];\n\t }\n\t }\n\t }\n\t};\n\t\n\tPropertyMarker.prototype.dispose = function () {\n\t this.objects.length = 0;\n\t this.properties.length = 0;\n\t};\n\t\n\tfunction build(schema, def, additional, resolver, parentMarker) {\n\t var defType, defValue, key, i, propertyMarker, props, defProps;\n\t\n\t if (type(schema) !== 'object') {\n\t return def;\n\t }\n\t\n\t schema = resolver.resolve(schema);\n\t\n\t if (def === undefined && schema.hasOwnProperty('default')) {\n\t def = clone(schema['default']);\n\t }\n\t\n\t defType = type(def);\n\t\n\t if (defType === 'object' && type(schema.properties) === 'object') {\n\t props = Object.keys(schema.properties);\n\t\n\t for (i = 0; i < props.length; i++) {\n\t key = props[i];\n\t defValue = build(schema.properties[key], def[key], additional, resolver);\n\t\n\t if (defValue !== undefined) {\n\t def[key] = defValue;\n\t }\n\t }\n\t\n\t if (additional !== 'always') {\n\t defProps = Object.keys(def);\n\t\n\t for (i = 0; i < defProps.length; i++) {\n\t key = defProps[i];\n\t\n\t if (props.indexOf(key) < 0 &&\n\t (schema.additionalProperties === false ||\n\t (additional === false && !schema.additionalProperties))) {\n\t\n\t if (parentMarker) {\n\t parentMarker.mark(def, key);\n\t }\n\t else {\n\t delete def[key];\n\t }\n\t }\n\t }\n\t }\n\t }\n\t else if (defType === 'array' && schema.items) {\n\t if (type(schema.items) === 'array') {\n\t for (i = 0; i < schema.items.length; i++) {\n\t defValue = build(schema.items[i], def[i], additional, resolver);\n\t\n\t if (defValue !== undefined || i < def.length) {\n\t def[i] = defValue;\n\t }\n\t }\n\t }\n\t else if (def.length) {\n\t for (i = 0; i < def.length; i++) {\n\t def[i] = build(schema.items, def[i], additional, resolver);\n\t }\n\t }\n\t }\n\t else if (type(schema.allOf) === 'array' && schema.allOf.length) {\n\t propertyMarker = new PropertyMarker();\n\t\n\t for (i = 0; i < schema.allOf.length; i++) {\n\t def = build(schema.allOf[i], def, additional, resolver, propertyMarker);\n\t }\n\t\n\t propertyMarker.deleteDuplicates();\n\t propertyMarker.dispose();\n\t }\n\t\n\t return def;\n\t}\n\t\n\tfunction ValidationContext(options) {\n\t this.path = 'data';\n\t this.schema = options.schema;\n\t this.formats = options.formats;\n\t this.greedy = options.greedy;\n\t this.resolver = options.resolver;\n\t this.id = options.id;\n\t this.funcache = options.funcache || {};\n\t this.scope = options.scope || {\n\t equalAny: equalAny,\n\t unique: unique,\n\t ucs2length: ucs2length,\n\t refs: {}\n\t };\n\t}\n\t\n\tValidationContext.prototype.clone = function (schema) {\n\t var ctx = new ValidationContext({\n\t schema: schema,\n\t formats: this.formats,\n\t greedy: this.greedy,\n\t resolver: this.resolver,\n\t id: this.id,\n\t funcache: this.funcache,\n\t scope: this.scope\n\t });\n\t\n\t return ctx;\n\t};\n\t\n\tValidationContext.prototype.declare = function (def) {\n\t var variname = this.id();\n\t this.code.def(variname, def);\n\t return variname;\n\t};\n\t\n\tValidationContext.prototype.cache = function (cacheKey, schema) {\n\t var cached = this.funcache[cacheKey],\n\t context;\n\t\n\t if (!cached) {\n\t cached = this.funcache[cacheKey] = {\n\t key: this.id()\n\t };\n\t\n\t context = this.clone(schema);\n\t\n\t cached.func = context.compile(cached.key);\n\t\n\t this.scope.refs[cached.key] = cached.func;\n\t\n\t context.dispose();\n\t }\n\t\n\t return 'refs.' + cached.key;\n\t};\n\t\n\tValidationContext.prototype.error = function (keyword, key, additional) {\n\t var schema = this.schema,\n\t path = this.path,\n\t errorPath = path !== 'data' || key ?\n\t '(path ? path + \".\" : \"\") + ' + getPathExpression(path, key) + ',' :\n\t 'path,',\n\t res = key && schema.properties && schema.properties[key] ?\n\t this.resolver.resolve(schema.properties[key]) : null,\n\t message = res ? res.requiredMessage : schema.invalidMessage;\n\t\n\t if (!message) {\n\t message = (res && res.messages && res.messages[keyword]) ||\n\t (schema.messages && schema.messages[keyword]);\n\t }\n\t\n\t this.code('errors.push({');\n\t\n\t if (message) {\n\t this.code('message: ' + encodeStr(message) + ',');\n\t }\n\t\n\t if (additional) {\n\t this.code('additionalProperties: ' + additional + ',');\n\t }\n\t\n\t this.code('path: ' + errorPath)\n\t ('keyword: ' + encodeStr(keyword))\n\t ('})');\n\t\n\t if (!this.greedy) {\n\t this.code('return');\n\t }\n\t};\n\t\n\tValidationContext.prototype.refactor = function (path, schema, cacheKey) {\n\t var parentPathExp = path !== 'data' ?\n\t '(path ? path + \".\" : \"\") + ' + getPathExpression(path) :\n\t 'path',\n\t cachedRef = this.cache(cacheKey, schema),\n\t refErrors = this.declare();\n\t\n\t this.code(refErrors + ' = ' + cachedRef + '(' + path + ', ' + parentPathExp + ', errors)');\n\t\n\t if (!this.greedy) {\n\t this.code('if (errors.length) { return }');\n\t }\n\t};\n\t\n\tValidationContext.prototype.descend = function (path, schema) {\n\t var origPath = this.path,\n\t origSchema = this.schema;\n\t\n\t this.path = path;\n\t this.schema = schema;\n\t\n\t this.generate();\n\t\n\t this.path = origPath;\n\t this.schema = origSchema;\n\t};\n\t\n\tValidationContext.prototype.generate = function () {\n\t var path = this.path,\n\t schema = this.schema,\n\t context = this,\n\t scope = this.scope,\n\t encodedFormat,\n\t format,\n\t schemaKeys,\n\t typeKeys,\n\t typeIndex,\n\t validatedType,\n\t i;\n\t\n\t if (type(schema) !== 'object') {\n\t return;\n\t }\n\t\n\t if (schema.$ref !== undefined) {\n\t schema = this.resolver.resolve(schema);\n\t\n\t if (this.resolver.hasRef(schema)) {\n\t this.refactor(path, schema,\n\t this.resolver.getNormalizedRef(this.schema) || this.schema.$ref);\n\t\n\t return;\n\t }\n\t else {\n\t // substitute $ref schema with the resolved instance\n\t this.schema = schema;\n\t }\n\t }\n\t\n\t schemaKeys = groupKeywords(schema);\n\t\n\t if (schemaKeys.enum) {\n\t keywords.enum(context);\n\t\n\t return; // do not process the schema further\n\t }\n\t\n\t typeKeys = Object.keys(schemaKeys.perType);\n\t\n\t function generateForKeyword(keyword) {\n\t keywords[keyword](context); // jshint ignore: line\n\t }\n\t\n\t for (i = 0; i < typeKeys.length; i++) {\n\t validatedType = typeKeys[i];\n\t\n\t this.code((i ? 'else ' : '') + 'if (' + types[validatedType](path) + ') {');\n\t\n\t schemaKeys.perType[validatedType].forEach(generateForKeyword);\n\t\n\t this.code('}');\n\t\n\t if (schemaKeys.type) {\n\t typeIndex = schemaKeys.type.indexOf(validatedType);\n\t\n\t if (typeIndex > -1) {\n\t schemaKeys.type.splice(typeIndex, 1);\n\t }\n\t }\n\t }\n\t\n\t if (schemaKeys.type) { // we have types in the schema\n\t if (schemaKeys.type.length) { // case 1: we still have some left to check\n\t this.code((typeKeys.length ? 'else ' : '') + 'if (!(' + schemaKeys.type.map(function (type) {\n\t return types[type] ? types[type](path) : 'true';\n\t }).join(' || ') + ')) {');\n\t this.error('type');\n\t this.code('}');\n\t }\n\t else {\n\t this.code('else {'); // case 2: we don't have any left to check\n\t this.error('type');\n\t this.code('}');\n\t }\n\t }\n\t\n\t schemaKeys.allType.forEach(function (keyword) {\n\t keywords[keyword](context);\n\t });\n\t\n\t if (schema.format && this.formats) {\n\t format = this.formats[schema.format];\n\t\n\t if (format) {\n\t if (typeof format === 'string' || format instanceof RegExp) {\n\t this.code('if (!(' + inlineRegex(format) + ').test(' + path + ')) {');\n\t this.error('format');\n\t this.code('}');\n\t }\n\t else if (typeof format === 'function') {\n\t (scope.formats || (scope.formats = {}))[schema.format] = format;\n\t (scope.schemas || (scope.schemas = {}))[schema.format] = schema;\n\t\n\t encodedFormat = encodeStr(schema.format);\n\t\n\t this.code('if (!formats[' + encodedFormat + '](' + path + ', schemas[' + encodedFormat + '])) {');\n\t this.error('format');\n\t this.code('}');\n\t }\n\t }\n\t }\n\t};\n\t\n\tValidationContext.prototype.compile = function (id) {\n\t this.code = func('jsen_compiled' + (id ? '_' + id : ''), 'data', 'path', 'errors');\n\t this.generate();\n\t\n\t return this.code.compile(this.scope);\n\t};\n\t\n\tValidationContext.prototype.dispose = function () {\n\t for (var key in this) {\n\t this[key] = undefined;\n\t }\n\t};\n\t\n\tfunction jsen(schema, options) {\n\t if (type(schema) !== 'object') {\n\t throw new Error(INVALID_SCHEMA);\n\t }\n\t\n\t options = options || {};\n\t\n\t var counter = 0,\n\t id = function () { return 'i' + (counter++); },\n\t resolver = new SchemaResolver(schema, options.schemas, options.missing$Ref || false),\n\t context = new ValidationContext({\n\t schema: schema,\n\t resolver: resolver,\n\t id: id,\n\t schemas: options.schemas,\n\t formats: options.formats,\n\t greedy: options.greedy || false\n\t }),\n\t compiled = func('validate', 'data')\n\t ('validate.errors = []')\n\t ('gen(data, \"\", validate.errors)')\n\t ('return validate.errors.length === 0')\n\t .compile({ gen: context.compile() });\n\t\n\t context.dispose();\n\t context = null;\n\t\n\t compiled.errors = [];\n\t\n\t compiled.build = function (initial, options) {\n\t return build(\n\t schema,\n\t (options && options.copy === false ? initial : clone(initial)),\n\t options && options.additionalProperties,\n\t resolver);\n\t };\n\t\n\t return compiled;\n\t}\n\t\n\tjsen.browser = browser;\n\tjsen.clone = clone;\n\tjsen.equal = equal;\n\tjsen.unique = unique;\n\tjsen.ucs2length = ucs2length;\n\tjsen.SchemaResolver = SchemaResolver;\n\tjsen.resolve = SchemaResolver.resolvePointer;\n\t\n\tmodule.exports = jsen;\n\n\n/***/ },\n/* 12 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = function func() {\n\t var args = Array.apply(null, arguments),\n\t name = args.shift(),\n\t tab = ' ',\n\t lines = '',\n\t vars = '',\n\t ind = 1, // indentation\n\t bs = '{[', // block start\n\t be = '}]', // block end\n\t space = function () {\n\t var sp = tab, i = 0;\n\t while (i++ < ind - 1) { sp += tab; }\n\t return sp;\n\t },\n\t add = function (line) {\n\t lines += space() + line + '\\n';\n\t },\n\t builder = function (line) {\n\t var first = line[0],\n\t last = line[line.length - 1];\n\t\n\t if (be.indexOf(first) > -1 && bs.indexOf(last) > -1) {\n\t ind--;\n\t add(line);\n\t ind++;\n\t }\n\t else if (bs.indexOf(last) > -1) {\n\t add(line);\n\t ind++;\n\t }\n\t else if (be.indexOf(first) > -1) {\n\t ind--;\n\t add(line);\n\t }\n\t else {\n\t add(line);\n\t }\n\t\n\t return builder;\n\t };\n\t\n\t builder.def = function (id, def) {\n\t vars += (vars ? ',\\n' + tab + ' ' : '') + id + (def !== undefined ? ' = ' + def : '');\n\t return builder;\n\t };\n\t\n\t builder.toSource = function () {\n\t return 'function ' + name + '(' + args.join(', ') + ') {\\n' +\n\t tab + '\"use strict\"' + '\\n' +\n\t (vars ? tab + 'var ' + vars + ';\\n' : '') +\n\t lines + '}';\n\t };\n\t\n\t builder.compile = function (scope) {\n\t var src = 'return (' + builder.toSource() + ')',\n\t scp = scope || {},\n\t keys = Object.keys(scp),\n\t vals = keys.map(function (key) { return scp[key]; });\n\t\n\t return Function.apply(null, keys.concat(src)).apply(null, vals);\n\t };\n\t\n\t return builder;\n\t};\n\n/***/ },\n/* 13 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tfunction type(obj) {\n\t var str = Object.prototype.toString.call(obj);\n\t return str.substr(8, str.length - 9).toLowerCase();\n\t}\n\t\n\tfunction deepEqual(a, b) {\n\t var keysA = Object.keys(a).sort(),\n\t keysB = Object.keys(b).sort(),\n\t i, key;\n\t\n\t if (!equal(keysA, keysB)) {\n\t return false;\n\t }\n\t\n\t for (i = 0; i < keysA.length; i++) {\n\t key = keysA[i];\n\t\n\t if (!equal(a[key], b[key])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t}\n\t\n\tfunction equal(a, b) { // jshint ignore: line\n\t var typeA = typeof a,\n\t typeB = typeof b,\n\t i;\n\t\n\t // get detailed object type\n\t if (typeA === 'object') {\n\t typeA = type(a);\n\t }\n\t\n\t // get detailed object type\n\t if (typeB === 'object') {\n\t typeB = type(b);\n\t }\n\t\n\t if (typeA !== typeB) {\n\t return false;\n\t }\n\t\n\t if (typeA === 'object') {\n\t return deepEqual(a, b);\n\t }\n\t\n\t if (typeA === 'regexp') {\n\t return a.toString() === b.toString();\n\t }\n\t\n\t if (typeA === 'array') {\n\t if (a.length !== b.length) {\n\t return false;\n\t }\n\t\n\t for (i = 0; i < a.length; i++) {\n\t if (!equal(a[i], b[i])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t }\n\t\n\t return a === b;\n\t}\n\t\n\tmodule.exports = equal;\n\n/***/ },\n/* 14 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar equal = __webpack_require__(13);\n\t\n\tfunction findIndex(arr, value, comparator) {\n\t for (var i = 0, len = arr.length; i < len; i++) {\n\t if (comparator(arr[i], value)) {\n\t return i;\n\t }\n\t }\n\t\n\t return -1;\n\t}\n\t\n\tmodule.exports = function unique(arr) {\n\t return arr.filter(function uniqueOnly(value, index, self) {\n\t return findIndex(self, value, equal) === index;\n\t });\n\t};\n\t\n\tmodule.exports.findIndex = findIndex;\n\n/***/ },\n/* 15 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar url = __webpack_require__(16),\n\t metaschema = __webpack_require__(23),\n\t INVALID_SCHEMA_REFERENCE = 'jsen: invalid schema reference',\n\t DUPLICATE_SCHEMA_ID = 'jsen: duplicate schema id',\n\t CIRCULAR_SCHEMA_REFERENCE = 'jsen: circular schema reference';\n\t\n\tfunction get(obj, path) {\n\t if (!path.length) {\n\t return obj;\n\t }\n\t\n\t var key = path.shift(),\n\t val;\n\t\n\t if (obj && typeof obj === 'object' && obj.hasOwnProperty(key)) {\n\t val = obj[key];\n\t }\n\t\n\t if (path.length) {\n\t if (val && typeof val === 'object') {\n\t return get(val, path);\n\t }\n\t\n\t return undefined;\n\t }\n\t\n\t return val;\n\t}\n\t\n\tfunction refToObj(ref) {\n\t var index = ref.indexOf('#'),\n\t ret = {\n\t base: ref.substr(0, index),\n\t path: []\n\t };\n\t\n\t if (index < 0) {\n\t ret.base = ref;\n\t return ret;\n\t }\n\t\n\t ref = ref.substr(index + 1);\n\t\n\t if (!ref) {\n\t return ret;\n\t }\n\t\n\t ret.path = ref.split('/').map(function (segment) {\n\t // Reference: http://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-08#section-3\n\t return decodeURIComponent(segment)\n\t .replace(/~1/g, '/')\n\t .replace(/~0/g, '~');\n\t });\n\t\n\t if (ref[0] === '/') {\n\t ret.path.shift();\n\t }\n\t\n\t return ret;\n\t}\n\t\n\t// TODO: Can we prevent nested resolvers and combine schemas instead?\n\tfunction SchemaResolver(rootSchema, external, missing$Ref, baseId) { // jshint ignore: line\n\t this.rootSchema = rootSchema;\n\t this.resolvers = null;\n\t this.resolvedRootSchema = null;\n\t this.cache = {};\n\t this.idCache = {};\n\t this.refCache = { refs: [], schemas: [] };\n\t this.missing$Ref = missing$Ref;\n\t this.refStack = [];\n\t\n\t baseId = baseId || '';\n\t\n\t this._buildIdCache(rootSchema, baseId);\n\t\n\t // get updated base id after normalizing root schema id\n\t baseId = this.refCache.refs[this.refCache.schemas.indexOf(this.rootSchema)] || baseId;\n\t\n\t this._buildResolvers(external, baseId);\n\t}\n\t\n\tSchemaResolver.prototype._cacheId = function (id, schema, resolver) {\n\t if (this.idCache[id]) {\n\t throw new Error(DUPLICATE_SCHEMA_ID + ' ' + id);\n\t }\n\t\n\t this.idCache[id] = { resolver: resolver, schema: schema };\n\t};\n\t\n\tSchemaResolver.prototype._buildIdCache = function (schema, baseId) {\n\t var id = baseId,\n\t ref, keys, i;\n\t\n\t if (!schema || typeof schema !== 'object') {\n\t return;\n\t }\n\t\n\t if (typeof schema.id === 'string' && schema.id) {\n\t id = url.resolve(baseId, schema.id);\n\t\n\t this._cacheId(id, schema, this);\n\t }\n\t else if (schema === this.rootSchema && baseId) {\n\t this._cacheId(baseId, schema, this);\n\t }\n\t\n\t if (schema.$ref && typeof schema.$ref === 'string') {\n\t ref = url.resolve(id, schema.$ref);\n\t\n\t this.refCache.schemas.push(schema);\n\t this.refCache.refs.push(ref);\n\t }\n\t\n\t keys = Object.keys(schema);\n\t\n\t for (i = 0; i < keys.length; i++) {\n\t this._buildIdCache(schema[keys[i]], id);\n\t }\n\t};\n\t\n\tSchemaResolver.prototype._buildResolvers = function (schemas, baseId) {\n\t if (!schemas || typeof schemas !== 'object') {\n\t return;\n\t }\n\t\n\t var that = this,\n\t resolvers = {};\n\t\n\t Object.keys(schemas).forEach(function (key) {\n\t var id = url.resolve(baseId, key),\n\t resolver = new SchemaResolver(schemas[key], null, that.missing$Ref, id);\n\t\n\t that._cacheId(id, resolver.rootSchema, resolver);\n\t\n\t Object.keys(resolver.idCache).forEach(function (idKey) {\n\t that.idCache[idKey] = resolver.idCache[idKey];\n\t });\n\t\n\t resolvers[key] = resolver;\n\t });\n\t\n\t this.resolvers = resolvers;\n\t};\n\t\n\tSchemaResolver.prototype.getNormalizedRef = function (schema) {\n\t var index = this.refCache.schemas.indexOf(schema);\n\t return this.refCache.refs[index];\n\t};\n\t\n\tSchemaResolver.prototype._resolveRef = function (ref) {\n\t var err = new Error(INVALID_SCHEMA_REFERENCE + ' ' + ref),\n\t idCache = this.idCache,\n\t externalResolver, cached, descriptor, path, dest;\n\t\n\t if (!ref || typeof ref !== 'string') {\n\t throw err;\n\t }\n\t\n\t if (ref === metaschema.id) {\n\t dest = metaschema;\n\t }\n\t\n\t cached = idCache[ref];\n\t\n\t if (cached) {\n\t dest = cached.resolver.resolve(cached.schema);\n\t }\n\t\n\t if (dest === undefined) {\n\t descriptor = refToObj(ref);\n\t path = descriptor.path;\n\t\n\t if (descriptor.base) {\n\t cached = idCache[descriptor.base] || idCache[descriptor.base + '#'];\n\t\n\t if (cached) {\n\t dest = cached.resolver.resolve(get(cached.schema, path.slice(0)));\n\t }\n\t else {\n\t path.unshift(descriptor.base);\n\t }\n\t }\n\t }\n\t\n\t if (dest === undefined && this.resolvedRootSchema) {\n\t dest = get(this.resolvedRootSchema, path.slice(0));\n\t }\n\t\n\t if (dest === undefined) {\n\t dest = get(this.rootSchema, path.slice(0));\n\t }\n\t\n\t if (dest === undefined && path.length && this.resolvers) {\n\t externalResolver = get(this.resolvers, path);\n\t\n\t if (externalResolver) {\n\t dest = externalResolver.resolve(externalResolver.rootSchema);\n\t }\n\t }\n\t\n\t if (dest === undefined || typeof dest !== 'object') {\n\t if (this.missing$Ref) {\n\t dest = {};\n\t } else {\n\t throw err;\n\t }\n\t }\n\t\n\t if (this.cache[ref] === dest) {\n\t return dest;\n\t }\n\t\n\t this.cache[ref] = dest;\n\t\n\t if (dest.$ref !== undefined) {\n\t dest = this.resolve(dest);\n\t }\n\t\n\t return dest;\n\t};\n\t\n\tSchemaResolver.prototype.resolve = function (schema) {\n\t if (!schema || typeof schema !== 'object' || schema.$ref === undefined) {\n\t return schema;\n\t }\n\t\n\t var ref = this.getNormalizedRef(schema) || schema.$ref,\n\t resolved = this.cache[ref];\n\t\n\t if (resolved !== undefined) {\n\t return resolved;\n\t }\n\t\n\t if (this.refStack.indexOf(ref) > -1) {\n\t throw new Error(CIRCULAR_SCHEMA_REFERENCE + ' ' + ref);\n\t }\n\t\n\t this.refStack.push(ref);\n\t\n\t resolved = this._resolveRef(ref);\n\t\n\t this.refStack.pop();\n\t\n\t if (schema === this.rootSchema) {\n\t // cache the resolved root schema\n\t this.resolvedRootSchema = resolved;\n\t }\n\t\n\t return resolved;\n\t};\n\t\n\tSchemaResolver.prototype.hasRef = function (schema) {\n\t var keys = Object.keys(schema),\n\t len, key, i, hasChildRef;\n\t\n\t if (keys.indexOf('$ref') > -1) {\n\t return true;\n\t }\n\t\n\t for (i = 0, len = keys.length; i < len; i++) {\n\t key = keys[i];\n\t\n\t if (schema[key] && typeof schema[key] === 'object' && !Array.isArray(schema[key])) {\n\t hasChildRef = this.hasRef(schema[key]);\n\t\n\t if (hasChildRef) {\n\t return true;\n\t }\n\t }\n\t }\n\t\n\t return false;\n\t};\n\t\n\tSchemaResolver.resolvePointer = function (obj, pointer) {\n\t var descriptor = refToObj(pointer),\n\t path = descriptor.path;\n\t\n\t if (descriptor.base) {\n\t path = [descriptor.base].concat(path);\n\t }\n\t\n\t return get(obj, path);\n\t};\n\t\n\tmodule.exports = SchemaResolver;\n\n/***/ },\n/* 16 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t// Copyright Joyent, Inc. and other Node contributors.\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a\n\t// copy of this software and associated documentation files (the\n\t// \"Software\"), to deal in the Software without restriction, including\n\t// without limitation the rights to use, copy, modify, merge, publish,\n\t// distribute, sublicense, and/or sell copies of the Software, and to permit\n\t// persons to whom the Software is furnished to do so, subject to the\n\t// following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included\n\t// in all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n\t// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\t// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n\t// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n\t// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n\t// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n\t// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\t\n\t'use strict';\n\t\n\tvar punycode = __webpack_require__(17);\n\tvar util = __webpack_require__(19);\n\t\n\texports.parse = urlParse;\n\texports.resolve = urlResolve;\n\texports.resolveObject = urlResolveObject;\n\texports.format = urlFormat;\n\t\n\texports.Url = Url;\n\t\n\tfunction Url() {\n\t this.protocol = null;\n\t this.slashes = null;\n\t this.auth = null;\n\t this.host = null;\n\t this.port = null;\n\t this.hostname = null;\n\t this.hash = null;\n\t this.search = null;\n\t this.query = null;\n\t this.pathname = null;\n\t this.path = null;\n\t this.href = null;\n\t}\n\t\n\t// Reference: RFC 3986, RFC 1808, RFC 2396\n\t\n\t// define these here so at least they only have to be\n\t// compiled once on the first module load.\n\tvar protocolPattern = /^([a-z0-9.+-]+:)/i,\n\t portPattern = /:[0-9]*$/,\n\t\n\t // Special case for a simple path URL\n\t simplePathPattern = /^(\\/\\/?(?!\\/)[^\\?\\s]*)(\\?[^\\s]*)?$/,\n\t\n\t // RFC 2396: characters reserved for delimiting URLs.\n\t // We actually just auto-escape these.\n\t delims = ['<', '>', '\"', '`', ' ', '\\r', '\\n', '\\t'],\n\t\n\t // RFC 2396: characters not allowed for various reasons.\n\t unwise = ['{', '}', '|', '\\\\', '^', '`'].concat(delims),\n\t\n\t // Allowed by RFCs, but cause of XSS attacks. Always escape these.\n\t autoEscape = ['\\''].concat(unwise),\n\t // Characters that are never ever allowed in a hostname.\n\t // Note that any invalid chars are also handled, but these\n\t // are the ones that are *expected* to be seen, so we fast-path\n\t // them.\n\t nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape),\n\t hostEndingChars = ['/', '?', '#'],\n\t hostnameMaxLen = 255,\n\t hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,\n\t hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,\n\t // protocols that can allow \"unsafe\" and \"unwise\" chars.\n\t unsafeProtocol = {\n\t 'javascript': true,\n\t 'javascript:': true\n\t },\n\t // protocols that never have a hostname.\n\t hostlessProtocol = {\n\t 'javascript': true,\n\t 'javascript:': true\n\t },\n\t // protocols that always contain a // bit.\n\t slashedProtocol = {\n\t 'http': true,\n\t 'https': true,\n\t 'ftp': true,\n\t 'gopher': true,\n\t 'file': true,\n\t 'http:': true,\n\t 'https:': true,\n\t 'ftp:': true,\n\t 'gopher:': true,\n\t 'file:': true\n\t },\n\t querystring = __webpack_require__(20);\n\t\n\tfunction urlParse(url, parseQueryString, slashesDenoteHost) {\n\t if (url && util.isObject(url) && url instanceof Url) return url;\n\t\n\t var u = new Url;\n\t u.parse(url, parseQueryString, slashesDenoteHost);\n\t return u;\n\t}\n\t\n\tUrl.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {\n\t if (!util.isString(url)) {\n\t throw new TypeError(\"Parameter 'url' must be a string, not \" + typeof url);\n\t }\n\t\n\t // Copy chrome, IE, opera backslash-handling behavior.\n\t // Back slashes before the query string get converted to forward slashes\n\t // See: https://code.google.com/p/chromium/issues/detail?id=25916\n\t var queryIndex = url.indexOf('?'),\n\t splitter =\n\t (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#',\n\t uSplit = url.split(splitter),\n\t slashRegex = /\\\\/g;\n\t uSplit[0] = uSplit[0].replace(slashRegex, '/');\n\t url = uSplit.join(splitter);\n\t\n\t var rest = url;\n\t\n\t // trim before proceeding.\n\t // This is to support parse stuff like \" http://foo.com \\n\"\n\t rest = rest.trim();\n\t\n\t if (!slashesDenoteHost && url.split('#').length === 1) {\n\t // Try fast path regexp\n\t var simplePath = simplePathPattern.exec(rest);\n\t if (simplePath) {\n\t this.path = rest;\n\t this.href = rest;\n\t this.pathname = simplePath[1];\n\t if (simplePath[2]) {\n\t this.search = simplePath[2];\n\t if (parseQueryString) {\n\t this.query = querystring.parse(this.search.substr(1));\n\t } else {\n\t this.query = this.search.substr(1);\n\t }\n\t } else if (parseQueryString) {\n\t this.search = '';\n\t this.query = {};\n\t }\n\t return this;\n\t }\n\t }\n\t\n\t var proto = protocolPattern.exec(rest);\n\t if (proto) {\n\t proto = proto[0];\n\t var lowerProto = proto.toLowerCase();\n\t this.protocol = lowerProto;\n\t rest = rest.substr(proto.length);\n\t }\n\t\n\t // figure out if it's got a host\n\t // user@server is *always* interpreted as a hostname, and url\n\t // resolution will treat //foo/bar as host=foo,path=bar because that's\n\t // how the browser resolves relative URLs.\n\t if (slashesDenoteHost || proto || rest.match(/^\\/\\/[^@\\/]+@[^@\\/]+/)) {\n\t var slashes = rest.substr(0, 2) === '//';\n\t if (slashes && !(proto && hostlessProtocol[proto])) {\n\t rest = rest.substr(2);\n\t this.slashes = true;\n\t }\n\t }\n\t\n\t if (!hostlessProtocol[proto] &&\n\t (slashes || (proto && !slashedProtocol[proto]))) {\n\t\n\t // there's a hostname.\n\t // the first instance of /, ?, ;, or # ends the host.\n\t //\n\t // If there is an @ in the hostname, then non-host chars *are* allowed\n\t // to the left of the last @ sign, unless some host-ending character\n\t // comes *before* the @-sign.\n\t // URLs are obnoxious.\n\t //\n\t // ex:\n\t // http://a@b@c/ => user:a@b host:c\n\t // http://a@b?@c => user:a host:c path:/?@c\n\t\n\t // v0.12 TODO(isaacs): This is not quite how Chrome does things.\n\t // Review our test case against browsers more comprehensively.\n\t\n\t // find the first instance of any hostEndingChars\n\t var hostEnd = -1;\n\t for (var i = 0; i < hostEndingChars.length; i++) {\n\t var hec = rest.indexOf(hostEndingChars[i]);\n\t if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n\t hostEnd = hec;\n\t }\n\t\n\t // at this point, either we have an explicit point where the\n\t // auth portion cannot go past, or the last @ char is the decider.\n\t var auth, atSign;\n\t if (hostEnd === -1) {\n\t // atSign can be anywhere.\n\t atSign = rest.lastIndexOf('@');\n\t } else {\n\t // atSign must be in auth portion.\n\t // http://a@b/c@d => host:b auth:a path:/c@d\n\t atSign = rest.lastIndexOf('@', hostEnd);\n\t }\n\t\n\t // Now we have a portion which is definitely the auth.\n\t // Pull that off.\n\t if (atSign !== -1) {\n\t auth = rest.slice(0, atSign);\n\t rest = rest.slice(atSign + 1);\n\t this.auth = decodeURIComponent(auth);\n\t }\n\t\n\t // the host is the remaining to the left of the first non-host char\n\t hostEnd = -1;\n\t for (var i = 0; i < nonHostChars.length; i++) {\n\t var hec = rest.indexOf(nonHostChars[i]);\n\t if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n\t hostEnd = hec;\n\t }\n\t // if we still have not hit it, then the entire thing is a host.\n\t if (hostEnd === -1)\n\t hostEnd = rest.length;\n\t\n\t this.host = rest.slice(0, hostEnd);\n\t rest = rest.slice(hostEnd);\n\t\n\t // pull out port.\n\t this.parseHost();\n\t\n\t // we've indicated that there is a hostname,\n\t // so even if it's empty, it has to be present.\n\t this.hostname = this.hostname || '';\n\t\n\t // if hostname begins with [ and ends with ]\n\t // assume that it's an IPv6 address.\n\t var ipv6Hostname = this.hostname[0] === '[' &&\n\t this.hostname[this.hostname.length - 1] === ']';\n\t\n\t // validate a little.\n\t if (!ipv6Hostname) {\n\t var hostparts = this.hostname.split(/\\./);\n\t for (var i = 0, l = hostparts.length; i < l; i++) {\n\t var part = hostparts[i];\n\t if (!part) continue;\n\t if (!part.match(hostnamePartPattern)) {\n\t var newpart = '';\n\t for (var j = 0, k = part.length; j < k; j++) {\n\t if (part.charCodeAt(j) > 127) {\n\t // we replace non-ASCII char with a temporary placeholder\n\t // we need this to make sure size of hostname is not\n\t // broken by replacing non-ASCII by nothing\n\t newpart += 'x';\n\t } else {\n\t newpart += part[j];\n\t }\n\t }\n\t // we test again with ASCII char only\n\t if (!newpart.match(hostnamePartPattern)) {\n\t var validParts = hostparts.slice(0, i);\n\t var notHost = hostparts.slice(i + 1);\n\t var bit = part.match(hostnamePartStart);\n\t if (bit) {\n\t validParts.push(bit[1]);\n\t notHost.unshift(bit[2]);\n\t }\n\t if (notHost.length) {\n\t rest = '/' + notHost.join('.') + rest;\n\t }\n\t this.hostname = validParts.join('.');\n\t break;\n\t }\n\t }\n\t }\n\t }\n\t\n\t if (this.hostname.length > hostnameMaxLen) {\n\t this.hostname = '';\n\t } else {\n\t // hostnames are always lower case.\n\t this.hostname = this.hostname.toLowerCase();\n\t }\n\t\n\t if (!ipv6Hostname) {\n\t // IDNA Support: Returns a punycoded representation of \"domain\".\n\t // It only converts parts of the domain name that\n\t // have non-ASCII characters, i.e. it doesn't matter if\n\t // you call it with a domain that already is ASCII-only.\n\t this.hostname = punycode.toASCII(this.hostname);\n\t }\n\t\n\t var p = this.port ? ':' + this.port : '';\n\t var h = this.hostname || '';\n\t this.host = h + p;\n\t this.href += this.host;\n\t\n\t // strip [ and ] from the hostname\n\t // the host field still retains them, though\n\t if (ipv6Hostname) {\n\t this.hostname = this.hostname.substr(1, this.hostname.length - 2);\n\t if (rest[0] !== '/') {\n\t rest = '/' + rest;\n\t }\n\t }\n\t }\n\t\n\t // now rest is set to the post-host stuff.\n\t // chop off any delim chars.\n\t if (!unsafeProtocol[lowerProto]) {\n\t\n\t // First, make 100% sure that any \"autoEscape\" chars get\n\t // escaped, even if encodeURIComponent doesn't think they\n\t // need to be.\n\t for (var i = 0, l = autoEscape.length; i < l; i++) {\n\t var ae = autoEscape[i];\n\t if (rest.indexOf(ae) === -1)\n\t continue;\n\t var esc = encodeURIComponent(ae);\n\t if (esc === ae) {\n\t esc = escape(ae);\n\t }\n\t rest = rest.split(ae).join(esc);\n\t }\n\t }\n\t\n\t\n\t // chop off from the tail first.\n\t var hash = rest.indexOf('#');\n\t if (hash !== -1) {\n\t // got a fragment string.\n\t this.hash = rest.substr(hash);\n\t rest = rest.slice(0, hash);\n\t }\n\t var qm = rest.indexOf('?');\n\t if (qm !== -1) {\n\t this.search = rest.substr(qm);\n\t this.query = rest.substr(qm + 1);\n\t if (parseQueryString) {\n\t this.query = querystring.parse(this.query);\n\t }\n\t rest = rest.slice(0, qm);\n\t } else if (parseQueryString) {\n\t // no query string, but parseQueryString still requested\n\t this.search = '';\n\t this.query = {};\n\t }\n\t if (rest) this.pathname = rest;\n\t if (slashedProtocol[lowerProto] &&\n\t this.hostname && !this.pathname) {\n\t this.pathname = '/';\n\t }\n\t\n\t //to support http.request\n\t if (this.pathname || this.search) {\n\t var p = this.pathname || '';\n\t var s = this.search || '';\n\t this.path = p + s;\n\t }\n\t\n\t // finally, reconstruct the href based on what has been validated.\n\t this.href = this.format();\n\t return this;\n\t};\n\t\n\t// format a parsed object into a url string\n\tfunction urlFormat(obj) {\n\t // ensure it's an object, and not a string url.\n\t // If it's an obj, this is a no-op.\n\t // this way, you can call url_format() on strings\n\t // to clean up potentially wonky urls.\n\t if (util.isString(obj)) obj = urlParse(obj);\n\t if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n\t return obj.format();\n\t}\n\t\n\tUrl.prototype.format = function() {\n\t var auth = this.auth || '';\n\t if (auth) {\n\t auth = encodeURIComponent(auth);\n\t auth = auth.replace(/%3A/i, ':');\n\t auth += '@';\n\t }\n\t\n\t var protocol = this.protocol || '',\n\t pathname = this.pathname || '',\n\t hash = this.hash || '',\n\t host = false,\n\t query = '';\n\t\n\t if (this.host) {\n\t host = auth + this.host;\n\t } else if (this.hostname) {\n\t host = auth + (this.hostname.indexOf(':') === -1 ?\n\t this.hostname :\n\t '[' + this.hostname + ']');\n\t if (this.port) {\n\t host += ':' + this.port;\n\t }\n\t }\n\t\n\t if (this.query &&\n\t util.isObject(this.query) &&\n\t Object.keys(this.query).length) {\n\t query = querystring.stringify(this.query);\n\t }\n\t\n\t var search = this.search || (query && ('?' + query)) || '';\n\t\n\t if (protocol && protocol.substr(-1) !== ':') protocol += ':';\n\t\n\t // only the slashedProtocols get the //. Not mailto:, xmpp:, etc.\n\t // unless they had them to begin with.\n\t if (this.slashes ||\n\t (!protocol || slashedProtocol[protocol]) && host !== false) {\n\t host = '//' + (host || '');\n\t if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname;\n\t } else if (!host) {\n\t host = '';\n\t }\n\t\n\t if (hash && hash.charAt(0) !== '#') hash = '#' + hash;\n\t if (search && search.charAt(0) !== '?') search = '?' + search;\n\t\n\t pathname = pathname.replace(/[?#]/g, function(match) {\n\t return encodeURIComponent(match);\n\t });\n\t search = search.replace('#', '%23');\n\t\n\t return protocol + host + pathname + search + hash;\n\t};\n\t\n\tfunction urlResolve(source, relative) {\n\t return urlParse(source, false, true).resolve(relative);\n\t}\n\t\n\tUrl.prototype.resolve = function(relative) {\n\t return this.resolveObject(urlParse(relative, false, true)).format();\n\t};\n\t\n\tfunction urlResolveObject(source, relative) {\n\t if (!source) return relative;\n\t return urlParse(source, false, true).resolveObject(relative);\n\t}\n\t\n\tUrl.prototype.resolveObject = function(relative) {\n\t if (util.isString(relative)) {\n\t var rel = new Url();\n\t rel.parse(relative, false, true);\n\t relative = rel;\n\t }\n\t\n\t var result = new Url();\n\t var tkeys = Object.keys(this);\n\t for (var tk = 0; tk < tkeys.length; tk++) {\n\t var tkey = tkeys[tk];\n\t result[tkey] = this[tkey];\n\t }\n\t\n\t // hash is always overridden, no matter what.\n\t // even href=\"\" will remove it.\n\t result.hash = relative.hash;\n\t\n\t // if the relative url is empty, then there's nothing left to do here.\n\t if (relative.href === '') {\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t // hrefs like //foo/bar always cut to the protocol.\n\t if (relative.slashes && !relative.protocol) {\n\t // take everything except the protocol from relative\n\t var rkeys = Object.keys(relative);\n\t for (var rk = 0; rk < rkeys.length; rk++) {\n\t var rkey = rkeys[rk];\n\t if (rkey !== 'protocol')\n\t result[rkey] = relative[rkey];\n\t }\n\t\n\t //urlParse appends trailing / to urls like http://www.example.com\n\t if (slashedProtocol[result.protocol] &&\n\t result.hostname && !result.pathname) {\n\t result.path = result.pathname = '/';\n\t }\n\t\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t if (relative.protocol && relative.protocol !== result.protocol) {\n\t // if it's a known url protocol, then changing\n\t // the protocol does weird things\n\t // first, if it's not file:, then we MUST have a host,\n\t // and if there was a path\n\t // to begin with, then we MUST have a path.\n\t // if it is file:, then the host is dropped,\n\t // because that's known to be hostless.\n\t // anything else is assumed to be absolute.\n\t if (!slashedProtocol[relative.protocol]) {\n\t var keys = Object.keys(relative);\n\t for (var v = 0; v < keys.length; v++) {\n\t var k = keys[v];\n\t result[k] = relative[k];\n\t }\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t result.protocol = relative.protocol;\n\t if (!relative.host && !hostlessProtocol[relative.protocol]) {\n\t var relPath = (relative.pathname || '').split('/');\n\t while (relPath.length && !(relative.host = relPath.shift()));\n\t if (!relative.host) relative.host = '';\n\t if (!relative.hostname) relative.hostname = '';\n\t if (relPath[0] !== '') relPath.unshift('');\n\t if (relPath.length < 2) relPath.unshift('');\n\t result.pathname = relPath.join('/');\n\t } else {\n\t result.pathname = relative.pathname;\n\t }\n\t result.search = relative.search;\n\t result.query = relative.query;\n\t result.host = relative.host || '';\n\t result.auth = relative.auth;\n\t result.hostname = relative.hostname || relative.host;\n\t result.port = relative.port;\n\t // to support http.request\n\t if (result.pathname || result.search) {\n\t var p = result.pathname || '';\n\t var s = result.search || '';\n\t result.path = p + s;\n\t }\n\t result.slashes = result.slashes || relative.slashes;\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'),\n\t isRelAbs = (\n\t relative.host ||\n\t relative.pathname && relative.pathname.charAt(0) === '/'\n\t ),\n\t mustEndAbs = (isRelAbs || isSourceAbs ||\n\t (result.host && relative.pathname)),\n\t removeAllDots = mustEndAbs,\n\t srcPath = result.pathname && result.pathname.split('/') || [],\n\t relPath = relative.pathname && relative.pathname.split('/') || [],\n\t psychotic = result.protocol && !slashedProtocol[result.protocol];\n\t\n\t // if the url is a non-slashed url, then relative\n\t // links like ../.. should be able\n\t // to crawl up to the hostname, as well. This is strange.\n\t // result.protocol has already been set by now.\n\t // Later on, put the first path part into the host field.\n\t if (psychotic) {\n\t result.hostname = '';\n\t result.port = null;\n\t if (result.host) {\n\t if (srcPath[0] === '') srcPath[0] = result.host;\n\t else srcPath.unshift(result.host);\n\t }\n\t result.host = '';\n\t if (relative.protocol) {\n\t relative.hostname = null;\n\t relative.port = null;\n\t if (relative.host) {\n\t if (relPath[0] === '') relPath[0] = relative.host;\n\t else relPath.unshift(relative.host);\n\t }\n\t relative.host = null;\n\t }\n\t mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === '');\n\t }\n\t\n\t if (isRelAbs) {\n\t // it's absolute.\n\t result.host = (relative.host || relative.host === '') ?\n\t relative.host : result.host;\n\t result.hostname = (relative.hostname || relative.hostname === '') ?\n\t relative.hostname : result.hostname;\n\t result.search = relative.search;\n\t result.query = relative.query;\n\t srcPath = relPath;\n\t // fall through to the dot-handling below.\n\t } else if (relPath.length) {\n\t // it's relative\n\t // throw away the existing file, and take the new path instead.\n\t if (!srcPath) srcPath = [];\n\t srcPath.pop();\n\t srcPath = srcPath.concat(relPath);\n\t result.search = relative.search;\n\t result.query = relative.query;\n\t } else if (!util.isNullOrUndefined(relative.search)) {\n\t // just pull out the search.\n\t // like href='https://github.com/?foo'.\n\t // Put this after the other two cases because it simplifies the booleans\n\t if (psychotic) {\n\t result.hostname = result.host = srcPath.shift();\n\t //occationaly the auth can get stuck only in host\n\t //this especially happens in cases like\n\t //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n\t var authInHost = result.host && result.host.indexOf('@') > 0 ?\n\t result.host.split('@') : false;\n\t if (authInHost) {\n\t result.auth = authInHost.shift();\n\t result.host = result.hostname = authInHost.shift();\n\t }\n\t }\n\t result.search = relative.search;\n\t result.query = relative.query;\n\t //to support http.request\n\t if (!util.isNull(result.pathname) || !util.isNull(result.search)) {\n\t result.path = (result.pathname ? result.pathname : '') +\n\t (result.search ? result.search : '');\n\t }\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t if (!srcPath.length) {\n\t // no path at all. easy.\n\t // we've already handled the other stuff above.\n\t result.pathname = null;\n\t //to support http.request\n\t if (result.search) {\n\t result.path = '/' + result.search;\n\t } else {\n\t result.path = null;\n\t }\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t // if a url ENDs in . or .., then it must get a trailing slash.\n\t // however, if it ends in anything else non-slashy,\n\t // then it must NOT get a trailing slash.\n\t var last = srcPath.slice(-1)[0];\n\t var hasTrailingSlash = (\n\t (result.host || relative.host || srcPath.length > 1) &&\n\t (last === '.' || last === '..') || last === '');\n\t\n\t // strip single dots, resolve double dots to parent dir\n\t // if the path tries to go above the root, `up` ends up > 0\n\t var up = 0;\n\t for (var i = srcPath.length; i >= 0; i--) {\n\t last = srcPath[i];\n\t if (last === '.') {\n\t srcPath.splice(i, 1);\n\t } else if (last === '..') {\n\t srcPath.splice(i, 1);\n\t up++;\n\t } else if (up) {\n\t srcPath.splice(i, 1);\n\t up--;\n\t }\n\t }\n\t\n\t // if the path is allowed to go above the root, restore leading ..s\n\t if (!mustEndAbs && !removeAllDots) {\n\t for (; up--; up) {\n\t srcPath.unshift('..');\n\t }\n\t }\n\t\n\t if (mustEndAbs && srcPath[0] !== '' &&\n\t (!srcPath[0] || srcPath[0].charAt(0) !== '/')) {\n\t srcPath.unshift('');\n\t }\n\t\n\t if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) {\n\t srcPath.push('');\n\t }\n\t\n\t var isAbsolute = srcPath[0] === '' ||\n\t (srcPath[0] && srcPath[0].charAt(0) === '/');\n\t\n\t // put the host back\n\t if (psychotic) {\n\t result.hostname = result.host = isAbsolute ? '' :\n\t srcPath.length ? srcPath.shift() : '';\n\t //occationaly the auth can get stuck only in host\n\t //this especially happens in cases like\n\t //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n\t var authInHost = result.host && result.host.indexOf('@') > 0 ?\n\t result.host.split('@') : false;\n\t if (authInHost) {\n\t result.auth = authInHost.shift();\n\t result.host = result.hostname = authInHost.shift();\n\t }\n\t }\n\t\n\t mustEndAbs = mustEndAbs || (result.host && srcPath.length);\n\t\n\t if (mustEndAbs && !isAbsolute) {\n\t srcPath.unshift('');\n\t }\n\t\n\t if (!srcPath.length) {\n\t result.pathname = null;\n\t result.path = null;\n\t } else {\n\t result.pathname = srcPath.join('/');\n\t }\n\t\n\t //to support request.http\n\t if (!util.isNull(result.pathname) || !util.isNull(result.search)) {\n\t result.path = (result.pathname ? result.pathname : '') +\n\t (result.search ? result.search : '');\n\t }\n\t result.auth = relative.auth || result.auth;\n\t result.slashes = result.slashes || relative.slashes;\n\t result.href = result.format();\n\t return result;\n\t};\n\t\n\tUrl.prototype.parseHost = function() {\n\t var host = this.host;\n\t var port = portPattern.exec(host);\n\t if (port) {\n\t port = port[0];\n\t if (port !== ':') {\n\t this.port = port.substr(1);\n\t }\n\t host = host.substr(0, host.length - port.length);\n\t }\n\t if (host) this.hostname = host;\n\t};\n\n\n/***/ },\n/* 17 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(module, global) {/*! https://mths.be/punycode v1.3.2 by @mathias */\n\t;(function(root) {\n\t\n\t\t/** Detect free variables */\n\t\tvar freeExports = typeof exports == 'object' && exports &&\n\t\t\t!exports.nodeType && exports;\n\t\tvar freeModule = typeof module == 'object' && module &&\n\t\t\t!module.nodeType && module;\n\t\tvar freeGlobal = typeof global == 'object' && global;\n\t\tif (\n\t\t\tfreeGlobal.global === freeGlobal ||\n\t\t\tfreeGlobal.window === freeGlobal ||\n\t\t\tfreeGlobal.self === freeGlobal\n\t\t) {\n\t\t\troot = freeGlobal;\n\t\t}\n\t\n\t\t/**\n\t\t * The `punycode` object.\n\t\t * @name punycode\n\t\t * @type Object\n\t\t */\n\t\tvar punycode,\n\t\n\t\t/** Highest positive signed 32-bit float value */\n\t\tmaxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1\n\t\n\t\t/** Bootstring parameters */\n\t\tbase = 36,\n\t\ttMin = 1,\n\t\ttMax = 26,\n\t\tskew = 38,\n\t\tdamp = 700,\n\t\tinitialBias = 72,\n\t\tinitialN = 128, // 0x80\n\t\tdelimiter = '-', // '\\x2D'\n\t\n\t\t/** Regular expressions */\n\t\tregexPunycode = /^xn--/,\n\t\tregexNonASCII = /[^\\x20-\\x7E]/, // unprintable ASCII chars + non-ASCII chars\n\t\tregexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g, // RFC 3490 separators\n\t\n\t\t/** Error messages */\n\t\terrors = {\n\t\t\t'overflow': 'Overflow: input needs wider integers to process',\n\t\t\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t\t\t'invalid-input': 'Invalid input'\n\t\t},\n\t\n\t\t/** Convenience shortcuts */\n\t\tbaseMinusTMin = base - tMin,\n\t\tfloor = Math.floor,\n\t\tstringFromCharCode = String.fromCharCode,\n\t\n\t\t/** Temporary variable */\n\t\tkey;\n\t\n\t\t/*--------------------------------------------------------------------------*/\n\t\n\t\t/**\n\t\t * A generic error utility function.\n\t\t * @private\n\t\t * @param {String} type The error type.\n\t\t * @returns {Error} Throws a `RangeError` with the applicable error message.\n\t\t */\n\t\tfunction error(type) {\n\t\t\tthrow RangeError(errors[type]);\n\t\t}\n\t\n\t\t/**\n\t\t * A generic `Array#map` utility function.\n\t\t * @private\n\t\t * @param {Array} array The array to iterate over.\n\t\t * @param {Function} callback The function that gets called for every array\n\t\t * item.\n\t\t * @returns {Array} A new array of values returned by the callback function.\n\t\t */\n\t\tfunction map(array, fn) {\n\t\t\tvar length = array.length;\n\t\t\tvar result = [];\n\t\t\twhile (length--) {\n\t\t\t\tresult[length] = fn(array[length]);\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\n\t\t/**\n\t\t * A simple `Array#map`-like wrapper to work with domain name strings or email\n\t\t * addresses.\n\t\t * @private\n\t\t * @param {String} domain The domain name or email address.\n\t\t * @param {Function} callback The function that gets called for every\n\t\t * character.\n\t\t * @returns {Array} A new string of characters returned by the callback\n\t\t * function.\n\t\t */\n\t\tfunction mapDomain(string, fn) {\n\t\t\tvar parts = string.split('@');\n\t\t\tvar result = '';\n\t\t\tif (parts.length > 1) {\n\t\t\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t\t\t// the local part (i.e. everything up to `@`) intact.\n\t\t\t\tresult = parts[0] + '@';\n\t\t\t\tstring = parts[1];\n\t\t\t}\n\t\t\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\t\t\tstring = string.replace(regexSeparators, '\\x2E');\n\t\t\tvar labels = string.split('.');\n\t\t\tvar encoded = map(labels, fn).join('.');\n\t\t\treturn result + encoded;\n\t\t}\n\t\n\t\t/**\n\t\t * Creates an array containing the numeric code points of each Unicode\n\t\t * character in the string. While JavaScript uses UCS-2 internally,\n\t\t * this function will convert a pair of surrogate halves (each of which\n\t\t * UCS-2 exposes as separate characters) into a single code point,\n\t\t * matching UTF-16.\n\t\t * @see `punycode.ucs2.encode`\n\t\t * @see \n\t\t * @memberOf punycode.ucs2\n\t\t * @name decode\n\t\t * @param {String} string The Unicode input string (UCS-2).\n\t\t * @returns {Array} The new array of code points.\n\t\t */\n\t\tfunction ucs2decode(string) {\n\t\t\tvar output = [],\n\t\t\t counter = 0,\n\t\t\t length = string.length,\n\t\t\t value,\n\t\t\t extra;\n\t\t\twhile (counter < length) {\n\t\t\t\tvalue = string.charCodeAt(counter++);\n\t\t\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t\t\t// high surrogate, and there is a next character\n\t\t\t\t\textra = string.charCodeAt(counter++);\n\t\t\t\t\tif ((extra & 0xFC00) == 0xDC00) { // low surrogate\n\t\t\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// unmatched surrogate; only append this code unit, in case the next\n\t\t\t\t\t\t// code unit is the high surrogate of a surrogate pair\n\t\t\t\t\t\toutput.push(value);\n\t\t\t\t\t\tcounter--;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\toutput.push(value);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn output;\n\t\t}\n\t\n\t\t/**\n\t\t * Creates a string based on an array of numeric code points.\n\t\t * @see `punycode.ucs2.decode`\n\t\t * @memberOf punycode.ucs2\n\t\t * @name encode\n\t\t * @param {Array} codePoints The array of numeric code points.\n\t\t * @returns {String} The new Unicode string (UCS-2).\n\t\t */\n\t\tfunction ucs2encode(array) {\n\t\t\treturn map(array, function(value) {\n\t\t\t\tvar output = '';\n\t\t\t\tif (value > 0xFFFF) {\n\t\t\t\t\tvalue -= 0x10000;\n\t\t\t\t\toutput += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);\n\t\t\t\t\tvalue = 0xDC00 | value & 0x3FF;\n\t\t\t\t}\n\t\t\t\toutput += stringFromCharCode(value);\n\t\t\t\treturn output;\n\t\t\t}).join('');\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a basic code point into a digit/integer.\n\t\t * @see `digitToBasic()`\n\t\t * @private\n\t\t * @param {Number} codePoint The basic numeric code point value.\n\t\t * @returns {Number} The numeric value of a basic code point (for use in\n\t\t * representing integers) in the range `0` to `base - 1`, or `base` if\n\t\t * the code point does not represent a value.\n\t\t */\n\t\tfunction basicToDigit(codePoint) {\n\t\t\tif (codePoint - 48 < 10) {\n\t\t\t\treturn codePoint - 22;\n\t\t\t}\n\t\t\tif (codePoint - 65 < 26) {\n\t\t\t\treturn codePoint - 65;\n\t\t\t}\n\t\t\tif (codePoint - 97 < 26) {\n\t\t\t\treturn codePoint - 97;\n\t\t\t}\n\t\t\treturn base;\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a digit/integer into a basic code point.\n\t\t * @see `basicToDigit()`\n\t\t * @private\n\t\t * @param {Number} digit The numeric value of a basic code point.\n\t\t * @returns {Number} The basic code point whose value (when used for\n\t\t * representing integers) is `digit`, which needs to be in the range\n\t\t * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n\t\t * used; else, the lowercase form is used. The behavior is undefined\n\t\t * if `flag` is non-zero and `digit` has no uppercase form.\n\t\t */\n\t\tfunction digitToBasic(digit, flag) {\n\t\t\t// 0..25 map to ASCII a..z or A..Z\n\t\t\t// 26..35 map to ASCII 0..9\n\t\t\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n\t\t}\n\t\n\t\t/**\n\t\t * Bias adaptation function as per section 3.4 of RFC 3492.\n\t\t * http://tools.ietf.org/html/rfc3492#section-3.4\n\t\t * @private\n\t\t */\n\t\tfunction adapt(delta, numPoints, firstTime) {\n\t\t\tvar k = 0;\n\t\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\t\tdelta += floor(delta / numPoints);\n\t\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t\t}\n\t\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n\t\t * symbols.\n\t\t * @memberOf punycode\n\t\t * @param {String} input The Punycode string of ASCII-only symbols.\n\t\t * @returns {String} The resulting string of Unicode symbols.\n\t\t */\n\t\tfunction decode(input) {\n\t\t\t// Don't use UCS-2\n\t\t\tvar output = [],\n\t\t\t inputLength = input.length,\n\t\t\t out,\n\t\t\t i = 0,\n\t\t\t n = initialN,\n\t\t\t bias = initialBias,\n\t\t\t basic,\n\t\t\t j,\n\t\t\t index,\n\t\t\t oldi,\n\t\t\t w,\n\t\t\t k,\n\t\t\t digit,\n\t\t\t t,\n\t\t\t /** Cached calculation results */\n\t\t\t baseMinusT;\n\t\n\t\t\t// Handle the basic code points: let `basic` be the number of input code\n\t\t\t// points before the last delimiter, or `0` if there is none, then copy\n\t\t\t// the first basic code points to the output.\n\t\n\t\t\tbasic = input.lastIndexOf(delimiter);\n\t\t\tif (basic < 0) {\n\t\t\t\tbasic = 0;\n\t\t\t}\n\t\n\t\t\tfor (j = 0; j < basic; ++j) {\n\t\t\t\t// if it's not a basic code point\n\t\t\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\t\t\terror('not-basic');\n\t\t\t\t}\n\t\t\t\toutput.push(input.charCodeAt(j));\n\t\t\t}\n\t\n\t\t\t// Main decoding loop: start just after the last delimiter if any basic code\n\t\t\t// points were copied; start at the beginning otherwise.\n\t\n\t\t\tfor (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\t\n\t\t\t\t// `index` is the index of the next character to be consumed.\n\t\t\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t\t\t// which gets added to `i`. The overflow checking is easier\n\t\t\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t\t\t// value at the end to obtain `delta`.\n\t\t\t\tfor (oldi = i, w = 1, k = base; /* no condition */; k += base) {\n\t\n\t\t\t\t\tif (index >= inputLength) {\n\t\t\t\t\t\terror('invalid-input');\n\t\t\t\t\t}\n\t\n\t\t\t\t\tdigit = basicToDigit(input.charCodeAt(index++));\n\t\n\t\t\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\t\t\terror('overflow');\n\t\t\t\t\t}\n\t\n\t\t\t\t\ti += digit * w;\n\t\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\n\t\t\t\t\tif (digit < t) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tbaseMinusT = base - t;\n\t\t\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\t\t\terror('overflow');\n\t\t\t\t\t}\n\t\n\t\t\t\t\tw *= baseMinusT;\n\t\n\t\t\t\t}\n\t\n\t\t\t\tout = output.length + 1;\n\t\t\t\tbias = adapt(i - oldi, out, oldi == 0);\n\t\n\t\t\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t\t\t// incrementing `n` each time, so we'll fix that now:\n\t\t\t\tif (floor(i / out) > maxInt - n) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\t\n\t\t\t\tn += floor(i / out);\n\t\t\t\ti %= out;\n\t\n\t\t\t\t// Insert `n` at position `i` of the output\n\t\t\t\toutput.splice(i++, 0, n);\n\t\n\t\t\t}\n\t\n\t\t\treturn ucs2encode(output);\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a string of Unicode symbols (e.g. a domain name label) to a\n\t\t * Punycode string of ASCII-only symbols.\n\t\t * @memberOf punycode\n\t\t * @param {String} input The string of Unicode symbols.\n\t\t * @returns {String} The resulting Punycode string of ASCII-only symbols.\n\t\t */\n\t\tfunction encode(input) {\n\t\t\tvar n,\n\t\t\t delta,\n\t\t\t handledCPCount,\n\t\t\t basicLength,\n\t\t\t bias,\n\t\t\t j,\n\t\t\t m,\n\t\t\t q,\n\t\t\t k,\n\t\t\t t,\n\t\t\t currentValue,\n\t\t\t output = [],\n\t\t\t /** `inputLength` will hold the number of code points in `input`. */\n\t\t\t inputLength,\n\t\t\t /** Cached calculation results */\n\t\t\t handledCPCountPlusOne,\n\t\t\t baseMinusT,\n\t\t\t qMinusT;\n\t\n\t\t\t// Convert the input in UCS-2 to Unicode\n\t\t\tinput = ucs2decode(input);\n\t\n\t\t\t// Cache the length\n\t\t\tinputLength = input.length;\n\t\n\t\t\t// Initialize the state\n\t\t\tn = initialN;\n\t\t\tdelta = 0;\n\t\t\tbias = initialBias;\n\t\n\t\t\t// Handle the basic code points\n\t\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\t\tcurrentValue = input[j];\n\t\t\t\tif (currentValue < 0x80) {\n\t\t\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\thandledCPCount = basicLength = output.length;\n\t\n\t\t\t// `handledCPCount` is the number of code points that have been handled;\n\t\t\t// `basicLength` is the number of basic code points.\n\t\n\t\t\t// Finish the basic string - if it is not empty - with a delimiter\n\t\t\tif (basicLength) {\n\t\t\t\toutput.push(delimiter);\n\t\t\t}\n\t\n\t\t\t// Main encoding loop:\n\t\t\twhile (handledCPCount < inputLength) {\n\t\n\t\t\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t\t\t// larger one:\n\t\t\t\tfor (m = maxInt, j = 0; j < inputLength; ++j) {\n\t\t\t\t\tcurrentValue = input[j];\n\t\t\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\t\t\tm = currentValue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\t// Increase `delta` enough to advance the decoder's state to ,\n\t\t\t\t// but guard against overflow\n\t\t\t\thandledCPCountPlusOne = handledCPCount + 1;\n\t\t\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\t\n\t\t\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\t\t\tn = m;\n\t\n\t\t\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\t\t\tcurrentValue = input[j];\n\t\n\t\t\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\t\t\terror('overflow');\n\t\t\t\t\t}\n\t\n\t\t\t\t\tif (currentValue == n) {\n\t\t\t\t\t\t// Represent delta as a generalized variable-length integer\n\t\t\t\t\t\tfor (q = delta, k = base; /* no condition */; k += base) {\n\t\t\t\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tqMinusT = q - t;\n\t\t\t\t\t\t\tbaseMinusT = base - t;\n\t\t\t\t\t\t\toutput.push(\n\t\t\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\t\t\tdelta = 0;\n\t\t\t\t\t\t++handledCPCount;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\t++delta;\n\t\t\t\t++n;\n\t\n\t\t\t}\n\t\t\treturn output.join('');\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a Punycode string representing a domain name or an email address\n\t\t * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n\t\t * it doesn't matter if you call it on a string that has already been\n\t\t * converted to Unicode.\n\t\t * @memberOf punycode\n\t\t * @param {String} input The Punycoded domain name or email address to\n\t\t * convert to Unicode.\n\t\t * @returns {String} The Unicode representation of the given Punycode\n\t\t * string.\n\t\t */\n\t\tfunction toUnicode(input) {\n\t\t\treturn mapDomain(input, function(string) {\n\t\t\t\treturn regexPunycode.test(string)\n\t\t\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t\t\t: string;\n\t\t\t});\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a Unicode string representing a domain name or an email address to\n\t\t * Punycode. Only the non-ASCII parts of the domain name will be converted,\n\t\t * i.e. it doesn't matter if you call it with a domain that's already in\n\t\t * ASCII.\n\t\t * @memberOf punycode\n\t\t * @param {String} input The domain name or email address to convert, as a\n\t\t * Unicode string.\n\t\t * @returns {String} The Punycode representation of the given domain name or\n\t\t * email address.\n\t\t */\n\t\tfunction toASCII(input) {\n\t\t\treturn mapDomain(input, function(string) {\n\t\t\t\treturn regexNonASCII.test(string)\n\t\t\t\t\t? 'xn--' + encode(string)\n\t\t\t\t\t: string;\n\t\t\t});\n\t\t}\n\t\n\t\t/*--------------------------------------------------------------------------*/\n\t\n\t\t/** Define the public API */\n\t\tpunycode = {\n\t\t\t/**\n\t\t\t * A string representing the current Punycode.js version number.\n\t\t\t * @memberOf punycode\n\t\t\t * @type String\n\t\t\t */\n\t\t\t'version': '1.3.2',\n\t\t\t/**\n\t\t\t * An object of methods to convert from JavaScript's internal character\n\t\t\t * representation (UCS-2) to Unicode code points, and back.\n\t\t\t * @see \n\t\t\t * @memberOf punycode\n\t\t\t * @type Object\n\t\t\t */\n\t\t\t'ucs2': {\n\t\t\t\t'decode': ucs2decode,\n\t\t\t\t'encode': ucs2encode\n\t\t\t},\n\t\t\t'decode': decode,\n\t\t\t'encode': encode,\n\t\t\t'toASCII': toASCII,\n\t\t\t'toUnicode': toUnicode\n\t\t};\n\t\n\t\t/** Expose `punycode` */\n\t\t// Some AMD build optimizers, like r.js, check for specific condition patterns\n\t\t// like the following:\n\t\tif (\n\t\t\ttrue\n\t\t) {\n\t\t\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function() {\n\t\t\t\treturn punycode;\n\t\t\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t\t} else if (freeExports && freeModule) {\n\t\t\tif (module.exports == freeExports) { // in Node.js or RingoJS v0.8.0+\n\t\t\t\tfreeModule.exports = punycode;\n\t\t\t} else { // in Narwhal or RingoJS v0.7.0-\n\t\t\t\tfor (key in punycode) {\n\t\t\t\t\tpunycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]);\n\t\t\t\t}\n\t\t\t}\n\t\t} else { // in Rhino or a web browser\n\t\t\troot.punycode = punycode;\n\t\t}\n\t\n\t}(this));\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(18)(module), (function() { return this; }())))\n\n/***/ },\n/* 18 */\n/***/ function(module, exports) {\n\n\tmodule.exports = function(module) {\r\n\t\tif(!module.webpackPolyfill) {\r\n\t\t\tmodule.deprecate = function() {};\r\n\t\t\tmodule.paths = [];\r\n\t\t\t// module.parent = undefined by default\r\n\t\t\tmodule.children = [];\r\n\t\t\tmodule.webpackPolyfill = 1;\r\n\t\t}\r\n\t\treturn module;\r\n\t}\r\n\n\n/***/ },\n/* 19 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = {\n\t isString: function(arg) {\n\t return typeof(arg) === 'string';\n\t },\n\t isObject: function(arg) {\n\t return typeof(arg) === 'object' && arg !== null;\n\t },\n\t isNull: function(arg) {\n\t return arg === null;\n\t },\n\t isNullOrUndefined: function(arg) {\n\t return arg == null;\n\t }\n\t};\n\n\n/***/ },\n/* 20 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\texports.decode = exports.parse = __webpack_require__(21);\n\texports.encode = exports.stringify = __webpack_require__(22);\n\n\n/***/ },\n/* 21 */\n/***/ function(module, exports) {\n\n\t// Copyright Joyent, Inc. and other Node contributors.\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a\n\t// copy of this software and associated documentation files (the\n\t// \"Software\"), to deal in the Software without restriction, including\n\t// without limitation the rights to use, copy, modify, merge, publish,\n\t// distribute, sublicense, and/or sell copies of the Software, and to permit\n\t// persons to whom the Software is furnished to do so, subject to the\n\t// following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included\n\t// in all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n\t// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\t// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n\t// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n\t// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n\t// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n\t// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\t\n\t'use strict';\n\t\n\t// If obj.hasOwnProperty has been overridden, then calling\n\t// obj.hasOwnProperty(prop) will break.\n\t// See: https://github.com/joyent/node/issues/1707\n\tfunction hasOwnProperty(obj, prop) {\n\t return Object.prototype.hasOwnProperty.call(obj, prop);\n\t}\n\t\n\tmodule.exports = function(qs, sep, eq, options) {\n\t sep = sep || '&';\n\t eq = eq || '=';\n\t var obj = {};\n\t\n\t if (typeof qs !== 'string' || qs.length === 0) {\n\t return obj;\n\t }\n\t\n\t var regexp = /\\+/g;\n\t qs = qs.split(sep);\n\t\n\t var maxKeys = 1000;\n\t if (options && typeof options.maxKeys === 'number') {\n\t maxKeys = options.maxKeys;\n\t }\n\t\n\t var len = qs.length;\n\t // maxKeys <= 0 means that we should not limit keys count\n\t if (maxKeys > 0 && len > maxKeys) {\n\t len = maxKeys;\n\t }\n\t\n\t for (var i = 0; i < len; ++i) {\n\t var x = qs[i].replace(regexp, '%20'),\n\t idx = x.indexOf(eq),\n\t kstr, vstr, k, v;\n\t\n\t if (idx >= 0) {\n\t kstr = x.substr(0, idx);\n\t vstr = x.substr(idx + 1);\n\t } else {\n\t kstr = x;\n\t vstr = '';\n\t }\n\t\n\t k = decodeURIComponent(kstr);\n\t v = decodeURIComponent(vstr);\n\t\n\t if (!hasOwnProperty(obj, k)) {\n\t obj[k] = v;\n\t } else if (Array.isArray(obj[k])) {\n\t obj[k].push(v);\n\t } else {\n\t obj[k] = [obj[k], v];\n\t }\n\t }\n\t\n\t return obj;\n\t};\n\n\n/***/ },\n/* 22 */\n/***/ function(module, exports) {\n\n\t// Copyright Joyent, Inc. and other Node contributors.\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a\n\t// copy of this software and associated documentation files (the\n\t// \"Software\"), to deal in the Software without restriction, including\n\t// without limitation the rights to use, copy, modify, merge, publish,\n\t// distribute, sublicense, and/or sell copies of the Software, and to permit\n\t// persons to whom the Software is furnished to do so, subject to the\n\t// following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included\n\t// in all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n\t// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\t// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n\t// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n\t// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n\t// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n\t// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\t\n\t'use strict';\n\t\n\tvar stringifyPrimitive = function(v) {\n\t switch (typeof v) {\n\t case 'string':\n\t return v;\n\t\n\t case 'boolean':\n\t return v ? 'true' : 'false';\n\t\n\t case 'number':\n\t return isFinite(v) ? v : '';\n\t\n\t default:\n\t return '';\n\t }\n\t};\n\t\n\tmodule.exports = function(obj, sep, eq, name) {\n\t sep = sep || '&';\n\t eq = eq || '=';\n\t if (obj === null) {\n\t obj = undefined;\n\t }\n\t\n\t if (typeof obj === 'object') {\n\t return Object.keys(obj).map(function(k) {\n\t var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;\n\t if (Array.isArray(obj[k])) {\n\t return obj[k].map(function(v) {\n\t return ks + encodeURIComponent(stringifyPrimitive(v));\n\t }).join(sep);\n\t } else {\n\t return ks + encodeURIComponent(stringifyPrimitive(obj[k]));\n\t }\n\t }).join(sep);\n\t\n\t }\n\t\n\t if (!name) return '';\n\t return encodeURIComponent(stringifyPrimitive(name)) + eq +\n\t encodeURIComponent(stringifyPrimitive(obj));\n\t};\n\n\n/***/ },\n/* 23 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"id\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"description\": \"Core schema meta-schema\",\n\t\t\"definitions\": {\n\t\t\t\"schemaArray\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"minItems\": 1,\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"positiveInteger\": {\n\t\t\t\t\"type\": \"integer\",\n\t\t\t\t\"minimum\": 0\n\t\t\t},\n\t\t\t\"positiveIntegerDefault0\": {\n\t\t\t\t\"allOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#/definitions/positiveInteger\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"default\": 0\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"simpleTypes\": {\n\t\t\t\t\"enum\": [\n\t\t\t\t\t\"array\",\n\t\t\t\t\t\"boolean\",\n\t\t\t\t\t\"integer\",\n\t\t\t\t\t\"null\",\n\t\t\t\t\t\"number\",\n\t\t\t\t\t\"object\",\n\t\t\t\t\t\"string\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"stringArray\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t},\n\t\t\t\t\"minItems\": 1,\n\t\t\t\t\"uniqueItems\": true\n\t\t\t}\n\t\t},\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"id\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"uri\"\n\t\t\t},\n\t\t\t\"$schema\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"uri\"\n\t\t\t},\n\t\t\t\"title\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"description\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"default\": {},\n\t\t\t\"multipleOf\": {\n\t\t\t\t\"type\": \"number\",\n\t\t\t\t\"minimum\": 0,\n\t\t\t\t\"exclusiveMinimum\": true\n\t\t\t},\n\t\t\t\"maximum\": {\n\t\t\t\t\"type\": \"number\"\n\t\t\t},\n\t\t\t\"exclusiveMaximum\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"minimum\": {\n\t\t\t\t\"type\": \"number\"\n\t\t\t},\n\t\t\t\"exclusiveMinimum\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"maxLength\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveInteger\"\n\t\t\t},\n\t\t\t\"minLength\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveIntegerDefault0\"\n\t\t\t},\n\t\t\t\"pattern\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"regex\"\n\t\t\t},\n\t\t\t\"additionalItems\": {\n\t\t\t\t\"anyOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"boolean\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"items\": {\n\t\t\t\t\"anyOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#/definitions/schemaArray\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"maxItems\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveInteger\"\n\t\t\t},\n\t\t\t\"minItems\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveIntegerDefault0\"\n\t\t\t},\n\t\t\t\"uniqueItems\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"maxProperties\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveInteger\"\n\t\t\t},\n\t\t\t\"minProperties\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveIntegerDefault0\"\n\t\t\t},\n\t\t\t\"required\": {\n\t\t\t\t\"$ref\": \"#/definitions/stringArray\"\n\t\t\t},\n\t\t\t\"additionalProperties\": {\n\t\t\t\t\"anyOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"boolean\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"definitions\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": {\n\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t},\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"properties\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": {\n\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t},\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"patternProperties\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": {\n\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t},\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"dependencies\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": {\n\t\t\t\t\t\"anyOf\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"$ref\": \"#/definitions/stringArray\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"enum\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"minItems\": 1,\n\t\t\t\t\"uniqueItems\": true\n\t\t\t},\n\t\t\t\"type\": {\n\t\t\t\t\"anyOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#/definitions/simpleTypes\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"array\",\n\t\t\t\t\t\t\"items\": {\n\t\t\t\t\t\t\t\"$ref\": \"#/definitions/simpleTypes\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"minItems\": 1,\n\t\t\t\t\t\t\"uniqueItems\": true\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"allOf\": {\n\t\t\t\t\"$ref\": \"#/definitions/schemaArray\"\n\t\t\t},\n\t\t\t\"anyOf\": {\n\t\t\t\t\"$ref\": \"#/definitions/schemaArray\"\n\t\t\t},\n\t\t\t\"oneOf\": {\n\t\t\t\t\"$ref\": \"#/definitions/schemaArray\"\n\t\t\t},\n\t\t\t\"not\": {\n\t\t\t\t\"$ref\": \"#\"\n\t\t\t}\n\t\t},\n\t\t\"dependencies\": {\n\t\t\t\"exclusiveMaximum\": [\n\t\t\t\t\"maximum\"\n\t\t\t],\n\t\t\t\"exclusiveMinimum\": [\n\t\t\t\t\"minimum\"\n\t\t\t]\n\t\t},\n\t\t\"default\": {}\n\t};\n\n/***/ },\n/* 24 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tvar formats = {};\n\t\n\t// reference: http://dansnetwork.com/javascript-iso8601rfc3339-date-parser/\n\tformats['date-time'] = /(\\d\\d\\d\\d)(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))/;\n\t// reference: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js#L7\n\tformats.uri = /^([a-zA-Z][a-zA-Z0-9+-.]*:){0,1}\\/\\/[^\\s]*$/;\n\t// reference: http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363\n\t// http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'willful violation')\n\tformats.email = /^[a-zA-Z0-9.!#$%&'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n\t// reference: https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html\n\tformats.ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;\n\t// reference: http://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses\n\tformats.ipv6 = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|[fF][eE]80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::([fF]{4}(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;\n\t// reference: http://stackoverflow.com/questions/106179/regular-expression-to-match-dns-hostname-or-ip-address#answer-3824105\n\tformats.hostname = /^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])(\\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]))*$/;\n\t\n\tmodule.exports = formats;\n\n/***/ },\n/* 25 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\t// Reference: https://github.com/bestiejs/punycode.js/blob/master/punycode.js#L101`\n\t// Info: https://mathiasbynens.be/notes/javascript-unicode\n\tfunction ucs2length(string) {\n\t var ucs2len = 0,\n\t counter = 0,\n\t length = string.length,\n\t value, extra;\n\t\n\t while (counter < length) {\n\t ucs2len++;\n\t value = string.charCodeAt(counter++);\n\t\n\t if (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t // It's a high surrogate, and there is a next character.\n\t extra = string.charCodeAt(counter++);\n\t\n\t if ((extra & 0xFC00) !== 0xDC00) { /* Low surrogate. */ // jshint ignore: line\n\t counter--;\n\t }\n\t }\n\t }\n\t\n\t return ucs2len;\n\t}\n\t\n\tmodule.exports = ucs2length;\n\n/***/ }\n/******/ ])\n});\n;\n//# sourceMappingURL=models.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/powerbi-models/dist/models.js\n// module id = 5\n// module chunks = 0","import { IFilterable } from './ifilterable';\r\nimport { IReportNode } from './report';\r\nimport * as models from 'powerbi-models';\r\n\r\n/**\r\n * A Page node within a report hierarchy\r\n * \r\n * @export\r\n * @interface IPageNode\r\n */\r\nexport interface IPageNode {\r\n report: IReportNode;\r\n name: string;\r\n}\r\n\r\n/**\r\n * A Power BI report page\r\n * \r\n * @export\r\n * @class Page\r\n * @implements {IPageNode}\r\n * @implements {IFilterable}\r\n */\r\nexport class Page implements IPageNode, IFilterable {\r\n /**\r\n * The parent Power BI report that this page is a member of\r\n * \r\n * @type {IReportNode}\r\n */\r\n report: IReportNode;\r\n /**\r\n * The report page name\r\n * \r\n * @type {string}\r\n */\r\n name: string;\r\n\r\n /**\r\n * The user defined display name of the report page, which is undefined if the page is created manually\r\n * \r\n * @type {string}\r\n */\r\n displayName: string;\r\n\r\n /**\r\n * Creates an instance of a Power BI report page.\r\n * \r\n * @param {IReportNode} report\r\n * @param {string} name\r\n * @param {string} [displayName]\r\n */\r\n constructor(report: IReportNode, name: string, displayName?: string) {\r\n this.report = report;\r\n this.name = name;\r\n this.displayName = displayName;\r\n }\r\n\r\n /**\r\n * Gets all page level filters within the report.\r\n * \r\n * ```javascript\r\n * page.getFilters()\r\n * .then(pages => { ... });\r\n * ```\r\n * \r\n * @returns {(Promise)}\r\n */\r\n getFilters(): Promise {\r\n return this.report.service.hpm.get(`/report/pages/${this.name}/filters`, { uid: this.report.config.uniqueId }, this.report.iframe.contentWindow)\r\n .then(response => response.body,\r\n response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Removes all filters from this page of the report.\r\n * \r\n * ```javascript\r\n * page.removeFilters();\r\n * ```\r\n * \r\n * @returns {Promise}\r\n */\r\n removeFilters(): Promise {\r\n return this.setFilters([]);\r\n }\r\n\r\n /**\r\n * Makes the current page the active page of the report.\r\n * \r\n * ```javascripot\r\n * page.setActive();\r\n * ```\r\n * \r\n * @returns {Promise}\r\n */\r\n setActive(): Promise {\r\n const page: models.IPage = {\r\n name: this.name,\r\n displayName: null\r\n };\r\n\r\n return this.report.service.hpm.put('/report/pages/active', page, { uid: this.report.config.uniqueId }, this.report.iframe.contentWindow)\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Sets all filters on the current page.\r\n * \r\n * ```javascript\r\n * page.setFilters(filters);\r\n * .catch(errors => { ... });\r\n * ```\r\n * \r\n * @param {(models.IFilter[])} filters\r\n * @returns {Promise}\r\n */\r\n setFilters(filters: models.IFilter[]): Promise {\r\n return this.report.service.hpm.put(`/report/pages/${this.name}/filters`, filters, { uid: this.report.config.uniqueId }, this.report.iframe.contentWindow)\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/page.ts","import * as service from './service';\r\nimport * as models from 'powerbi-models';\r\nimport * as embed from './embed';\r\n\r\nexport class Create extends embed.Embed {\r\n\r\n constructor(service: service.Service, element: HTMLElement, config: embed.IEmbedConfiguration) {\r\n super(service, element, config);\r\n }\r\n\r\n /**\r\n * Gets the dataset ID from the first available location: createConfig or embed url.\r\n * \r\n * @returns {string}\r\n */\r\n getId(): string {\r\n const datasetId = this.createConfig.datasetId || Create.findIdFromEmbedUrl(this.config.embedUrl);\r\n\r\n if (typeof datasetId !== 'string' || datasetId.length === 0) {\r\n throw new Error('Dataset id is required, but it was not found. You must provide an id either as part of embed configuration.');\r\n }\r\n\r\n return datasetId;\r\n }\r\n\r\n /**\r\n * Validate create report configuration.\r\n */\r\n validate(config: models.IReportCreateConfiguration): models.IError[] {\r\n return models.validateCreateReport(config);\r\n }\r\n\r\n /**\r\n * Adds the ability to get datasetId from url. \r\n * (e.g. http://embedded.powerbi.com/appTokenReportEmbed?datasetId=854846ed-2106-4dc2-bc58-eb77533bf2f1).\r\n * \r\n * By extracting the ID we can ensure that the ID is always explicitly provided as part of the create configuration.\r\n * \r\n * @static\r\n * @param {string} url\r\n * @returns {string}\r\n */\r\n static findIdFromEmbedUrl(url: string): string {\r\n const datasetIdRegEx = /datasetId=\"?([^&]+)\"?/\r\n const datasetIdMatch = url.match(datasetIdRegEx);\r\n\r\n let datasetId;\r\n if (datasetIdMatch) {\r\n datasetId = datasetIdMatch[1];\r\n }\r\n\r\n return datasetId;\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/create.ts","import * as service from './service';\r\nimport * as embed from './embed';\r\nimport * as models from 'powerbi-models';\r\nimport * as wpmp from 'window-post-message-proxy';\r\nimport * as hpm from 'http-post-message';\r\nimport * as utils from './util';\r\n\r\n/**\r\n * A Dashboard node within a dashboard hierarchy\r\n * \r\n * @export\r\n * @interface IDashboardNode\r\n */\r\nexport interface IDashboardNode {\r\n iframe: HTMLIFrameElement;\r\n service: service.IService;\r\n config: embed.IInternalEmbedConfiguration\r\n}\r\n\r\n/**\r\n * A Power BI Dashboard embed component\r\n * \r\n * @export\r\n * @class Dashboard\r\n * @extends {embed.Embed}\r\n * @implements {IDashboardNode}\r\n * @implements {IFilterable}\r\n */\r\nexport class Dashboard extends embed.Embed implements IDashboardNode {\r\n static allowedEvents = [\"tileClicked\", \"error\"];\r\n static dashboardIdAttribute = 'powerbi-dashboard-id';\r\n static typeAttribute = 'powerbi-type';\r\n static type = \"Dashboard\";\r\n\r\n /**\r\n * Creates an instance of a Power BI Dashboard.\r\n * \r\n * @param {service.Service} service\r\n * @param {HTMLElement} element\r\n */\r\n constructor(service: service.Service, element: HTMLElement, config: embed.IEmbedConfiguration) {\r\n super(service, element, config);\r\n this.loadPath = \"/dashboard/load\";\r\n Array.prototype.push.apply(this.allowedEvents, Dashboard.allowedEvents);\r\n }\r\n\r\n /**\r\n * This adds backwards compatibility for older config which used the dashboardId query param to specify dashboard id.\r\n * E.g. https://powerbi-df.analysis-df.windows.net/dashboardEmbedHost?dashboardId=e9363c62-edb6-4eac-92d3-2199c5ca2a9e\r\n * \r\n * By extracting the id we can ensure id is always explicitly provided as part of the load configuration.\r\n * \r\n * @static\r\n * @param {string} url\r\n * @returns {string}\r\n */\r\n static findIdFromEmbedUrl(url: string): string {\r\n const dashboardIdRegEx = /dashboardId=\"?([^&]+)\"?/\r\n const dashboardIdMatch = url.match(dashboardIdRegEx);\r\n\r\n let dashboardId;\r\n if (dashboardIdMatch) {\r\n dashboardId = dashboardIdMatch[1];\r\n }\r\n\r\n return dashboardId;\r\n }\r\n\r\n /**\r\n * Get dashboard id from first available location: options, attribute, embed url.\r\n * \r\n * @returns {string}\r\n */\r\n getId(): string {\r\n const dashboardId = this.config.id || this.element.getAttribute(Dashboard.dashboardIdAttribute) || Dashboard.findIdFromEmbedUrl(this.config.embedUrl);\r\n\r\n if (typeof dashboardId !== 'string' || dashboardId.length === 0) {\r\n throw new Error(`Dashboard id is required, but it was not found. You must provide an id either as part of embed configuration or as attribute '${Dashboard.dashboardIdAttribute}'.`);\r\n }\r\n\r\n return dashboardId;\r\n }\r\n\r\n /**\r\n * Validate load configuration.\r\n */\r\n validate(config: models.IDashboardLoadConfiguration): models.IError[] {\r\n let error = models.validateDashboardLoad(config);\r\n return error ? error : this.ValidatePageView(config.pageView);\r\n }\r\n \r\n /**\r\n * Validate that pageView has a legal value: if page view is defined it must have one of the values defined in models.PageView\r\n */\r\n private ValidatePageView(pageView: models.PageView): models.IError[] {\r\n if (pageView && pageView !== \"fitToWidth\" && pageView !== \"oneColumn\" && pageView !== \"actualSize\") {\r\n return [{message: \"pageView must be one of the followings: fitToWidth, oneColumn, actualSize\"}];\r\n }\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/dashboard.ts","import * as models from 'powerbi-models';\r\nimport { Embed } from './embed';\r\n\r\n/**\r\n * The Power BI tile embed component\r\n * \r\n * @export\r\n * @class Tile\r\n * @extends {Embed}\r\n */\r\nexport class Tile extends Embed {\r\n static type = \"Tile\";\r\n\r\n /**\r\n * The ID of the tile\r\n * \r\n * @returns {string}\r\n */\r\n getId(): string {\r\n throw new Error('Not implemented. Embedding tiles is not supported yet.');\r\n }\r\n\r\n /**\r\n * Validate load configuration.\r\n */\r\n validate(config: any): models.IError[] {\r\n throw new Error('Not implemented. Embedding tiles is not supported yet.');\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/tile.ts","/**\r\n * TODO: Need to find better place for these factory functions or refactor how we handle dependency injection\r\n */\r\nimport { IHpmFactory, IWpmpFactory, IRouterFactory } from './service';\r\nimport config from './config';\r\nimport * as wpmp from 'window-post-message-proxy';\r\nimport * as hpm from 'http-post-message';\r\nimport * as router from 'powerbi-router';\r\n\r\nexport {\r\n IHpmFactory,\r\n IWpmpFactory,\r\n IRouterFactory\r\n};\r\n\r\nexport const hpmFactory: IHpmFactory = (wpmp, defaultTargetWindow, sdkVersion = config.version, sdkType = config.type) => {\r\n return new hpm.HttpPostMessage(wpmp, {\r\n 'x-sdk-type': sdkType,\r\n 'x-sdk-version': sdkVersion\r\n }, defaultTargetWindow);\r\n};\r\n\r\nexport const wpmpFactory: IWpmpFactory = (name?: string, logMessages?: boolean, eventSourceOverrideWindow?: Window) => {\r\n return new wpmp.WindowPostMessageProxy({\r\n processTrackingProperties: {\r\n addTrackingProperties: hpm.HttpPostMessage.addTrackingProperties,\r\n getTrackingProperties: hpm.HttpPostMessage.getTrackingProperties,\r\n },\r\n isErrorMessage: hpm.HttpPostMessage.isErrorMessage,\r\n name,\r\n logMessages,\r\n eventSourceOverrideWindow\r\n });\r\n};\r\n\r\nexport const routerFactory: IRouterFactory = (wpmp) => {\r\n return new router.Router(wpmp);\r\n};\n\n\n// WEBPACK FOOTER //\n// ./src/factories.ts","const config = {\r\n version: '2.2.3',\r\n type: 'js'\r\n};\r\n\r\nexport default config;\n\n\n// WEBPACK FOOTER //\n// ./src/config.ts","/*! window-post-message-proxy v0.2.4 | (c) 2016 Microsoft Corporation MIT */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"window-post-message-proxy\"] = factory();\n\telse\n\t\troot[\"window-post-message-proxy\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\tvar WindowPostMessageProxy = (function () {\n\t function WindowPostMessageProxy(options) {\n\t var _this = this;\n\t if (options === void 0) { options = {\n\t processTrackingProperties: {\n\t addTrackingProperties: WindowPostMessageProxy.defaultAddTrackingProperties,\n\t getTrackingProperties: WindowPostMessageProxy.defaultGetTrackingProperties\n\t },\n\t isErrorMessage: WindowPostMessageProxy.defaultIsErrorMessage,\n\t receiveWindow: window,\n\t name: WindowPostMessageProxy.createRandomString()\n\t }; }\n\t this.pendingRequestPromises = {};\n\t // save options with defaults\n\t this.addTrackingProperties = (options.processTrackingProperties && options.processTrackingProperties.addTrackingProperties) || WindowPostMessageProxy.defaultAddTrackingProperties;\n\t this.getTrackingProperties = (options.processTrackingProperties && options.processTrackingProperties.getTrackingProperties) || WindowPostMessageProxy.defaultGetTrackingProperties;\n\t this.isErrorMessage = options.isErrorMessage || WindowPostMessageProxy.defaultIsErrorMessage;\n\t this.receiveWindow = options.receiveWindow || window;\n\t this.name = options.name || WindowPostMessageProxy.createRandomString();\n\t this.logMessages = options.logMessages || false;\n\t this.eventSourceOverrideWindow = options.eventSourceOverrideWindow;\n\t this.suppressWarnings = options.suppressWarnings || false;\n\t if (this.logMessages) {\n\t console.log(\"new WindowPostMessageProxy created with name: \" + this.name + \" receiving on window: \" + this.receiveWindow.document.title);\n\t }\n\t // Initialize\n\t this.handlers = [];\n\t this.windowMessageHandler = function (event) { return _this.onMessageReceived(event); };\n\t this.start();\n\t }\n\t // Static\n\t WindowPostMessageProxy.defaultAddTrackingProperties = function (message, trackingProperties) {\n\t message[WindowPostMessageProxy.messagePropertyName] = trackingProperties;\n\t return message;\n\t };\n\t WindowPostMessageProxy.defaultGetTrackingProperties = function (message) {\n\t return message[WindowPostMessageProxy.messagePropertyName];\n\t };\n\t WindowPostMessageProxy.defaultIsErrorMessage = function (message) {\n\t return !!message.error;\n\t };\n\t /**\n\t * Utility to create a deferred object.\n\t */\n\t // TODO: Look to use RSVP library instead of doing this manually.\n\t // From what I searched RSVP would work better because it has .finally and .deferred; however, it doesn't have Typings information. \n\t WindowPostMessageProxy.createDeferred = function () {\n\t var deferred = {\n\t resolve: null,\n\t reject: null,\n\t promise: null\n\t };\n\t var promise = new Promise(function (resolve, reject) {\n\t deferred.resolve = resolve;\n\t deferred.reject = reject;\n\t });\n\t deferred.promise = promise;\n\t return deferred;\n\t };\n\t /**\n\t * Utility to generate random sequence of characters used as tracking id for promises.\n\t */\n\t WindowPostMessageProxy.createRandomString = function () {\n\t return (Math.random() + 1).toString(36).substring(7);\n\t };\n\t /**\n\t * Adds handler.\n\t * If the first handler whose test method returns true will handle the message and provide a response.\n\t */\n\t WindowPostMessageProxy.prototype.addHandler = function (handler) {\n\t this.handlers.push(handler);\n\t };\n\t /**\n\t * Removes handler.\n\t * The reference must match the original object that was provided when adding the handler.\n\t */\n\t WindowPostMessageProxy.prototype.removeHandler = function (handler) {\n\t var handlerIndex = this.handlers.indexOf(handler);\n\t if (handlerIndex === -1) {\n\t throw new Error(\"You attempted to remove a handler but no matching handler was found.\");\n\t }\n\t this.handlers.splice(handlerIndex, 1);\n\t };\n\t /**\n\t * Start listening to message events.\n\t */\n\t WindowPostMessageProxy.prototype.start = function () {\n\t this.receiveWindow.addEventListener('message', this.windowMessageHandler);\n\t };\n\t /**\n\t * Stops listening to message events.\n\t */\n\t WindowPostMessageProxy.prototype.stop = function () {\n\t this.receiveWindow.removeEventListener('message', this.windowMessageHandler);\n\t };\n\t /**\n\t * Post message to target window with tracking properties added and save deferred object referenced by tracking id.\n\t */\n\t WindowPostMessageProxy.prototype.postMessage = function (targetWindow, message) {\n\t // Add tracking properties to indicate message came from this proxy\n\t var trackingProperties = { id: WindowPostMessageProxy.createRandomString() };\n\t this.addTrackingProperties(message, trackingProperties);\n\t if (this.logMessages) {\n\t console.log(this.name + \" Posting message:\");\n\t console.log(JSON.stringify(message, null, ' '));\n\t }\n\t targetWindow.postMessage(message, \"*\");\n\t var deferred = WindowPostMessageProxy.createDeferred();\n\t this.pendingRequestPromises[trackingProperties.id] = deferred;\n\t return deferred.promise;\n\t };\n\t /**\n\t * Send response message to target window.\n\t * Response messages re-use tracking properties from a previous request message.\n\t */\n\t WindowPostMessageProxy.prototype.sendResponse = function (targetWindow, message, trackingProperties) {\n\t this.addTrackingProperties(message, trackingProperties);\n\t if (this.logMessages) {\n\t console.log(this.name + \" Sending response:\");\n\t console.log(JSON.stringify(message, null, ' '));\n\t }\n\t targetWindow.postMessage(message, \"*\");\n\t };\n\t /**\n\t * Message handler.\n\t */\n\t WindowPostMessageProxy.prototype.onMessageReceived = function (event) {\n\t var _this = this;\n\t if (this.logMessages) {\n\t console.log(this.name + \" Received message:\");\n\t console.log(\"type: \" + event.type);\n\t console.log(JSON.stringify(event.data, null, ' '));\n\t }\n\t var sendingWindow = this.eventSourceOverrideWindow || event.source;\n\t var message = event.data;\n\t if (typeof message !== \"object\") {\n\t if (!this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + this.name + \"): Received message that was not an object. Discarding message\");\n\t }\n\t return;\n\t }\n\t var trackingProperties;\n\t try {\n\t trackingProperties = this.getTrackingProperties(message);\n\t }\n\t catch (e) {\n\t if (!this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + this.name + \"): Error occurred when attempting to get tracking properties from incoming message:\", JSON.stringify(message, null, ' '), \"Error: \", e);\n\t }\n\t }\n\t var deferred;\n\t if (trackingProperties) {\n\t deferred = this.pendingRequestPromises[trackingProperties.id];\n\t }\n\t // If message does not have a known ID, treat it as a request\n\t // Otherwise, treat message as response\n\t if (!deferred) {\n\t var handled = this.handlers.some(function (handler) {\n\t var canMessageBeHandled = false;\n\t try {\n\t canMessageBeHandled = handler.test(message);\n\t }\n\t catch (e) {\n\t if (!_this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + _this.name + \"): Error occurred when handler was testing incoming message:\", JSON.stringify(message, null, ' '), \"Error: \", e);\n\t }\n\t }\n\t if (canMessageBeHandled) {\n\t var responseMessagePromise = void 0;\n\t try {\n\t responseMessagePromise = Promise.resolve(handler.handle(message));\n\t }\n\t catch (e) {\n\t if (!_this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + _this.name + \"): Error occurred when handler was processing incoming message:\", JSON.stringify(message, null, ' '), \"Error: \", e);\n\t }\n\t responseMessagePromise = Promise.resolve();\n\t }\n\t responseMessagePromise\n\t .then(function (responseMessage) {\n\t if (!responseMessage) {\n\t var warningMessage = \"Handler for message: \" + JSON.stringify(message, null, ' ') + \" did not return a response message. The default response message will be returned instead.\";\n\t if (!_this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + _this.name + \"): \" + warningMessage);\n\t }\n\t responseMessage = {\n\t warning: warningMessage\n\t };\n\t }\n\t _this.sendResponse(sendingWindow, responseMessage, trackingProperties);\n\t });\n\t return true;\n\t }\n\t });\n\t /**\n\t * TODO: Consider returning an error message if nothing handled the message.\n\t * In the case of the Report receiving messages all of them should be handled,\n\t * however, in the case of the SDK receiving messages it's likely it won't register handlers\n\t * for all events. Perhaps make this an option at construction time.\n\t */\n\t if (!handled && !this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + this.name + \") did not handle message. Handlers: \" + this.handlers.length + \" Message: \" + JSON.stringify(message, null, '') + \".\");\n\t }\n\t }\n\t else {\n\t /**\n\t * If error message reject promise,\n\t * Otherwise, resolve promise\n\t */\n\t var isErrorMessage = true;\n\t try {\n\t isErrorMessage = this.isErrorMessage(message);\n\t }\n\t catch (e) {\n\t console.warn(\"Proxy(\" + this.name + \") Error occurred when trying to determine if message is consider an error response. Message: \", JSON.stringify(message, null, ''), 'Error: ', e);\n\t }\n\t if (isErrorMessage) {\n\t deferred.reject(message);\n\t }\n\t else {\n\t deferred.resolve(message);\n\t }\n\t // TODO: Move to .finally clause up where promise is created for better maitenance like original proxy code.\n\t delete this.pendingRequestPromises[trackingProperties.id];\n\t }\n\t };\n\t WindowPostMessageProxy.messagePropertyName = \"windowPostMessageProxy\";\n\t return WindowPostMessageProxy;\n\t}());\n\texports.WindowPostMessageProxy = WindowPostMessageProxy;\n\n\n/***/ }\n/******/ ])\n});\n;\n//# sourceMappingURL=windowPostMessageProxy.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/window-post-message-proxy/dist/windowPostMessageProxy.js\n// module id = 12\n// module chunks = 0","/*! http-post-message v0.2.3 | (c) 2016 Microsoft Corporation MIT */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"http-post-message\"] = factory();\n\telse\n\t\troot[\"http-post-message\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\tvar HttpPostMessage = (function () {\n\t function HttpPostMessage(windowPostMessageProxy, defaultHeaders, defaultTargetWindow) {\n\t if (defaultHeaders === void 0) { defaultHeaders = {}; }\n\t this.defaultHeaders = defaultHeaders;\n\t this.defaultTargetWindow = defaultTargetWindow;\n\t this.windowPostMessageProxy = windowPostMessageProxy;\n\t }\n\t // TODO: See if it's possible to share tracking properties interface?\n\t // The responsibility of knowing how to configure windowPostMessageProxy for http should\n\t // live in this http class, but the configuration would need ITrackingProperties\n\t // interface which lives in WindowPostMessageProxy. Use type as workaround\n\t HttpPostMessage.addTrackingProperties = function (message, trackingProperties) {\n\t message.headers = message.headers || {};\n\t if (trackingProperties && trackingProperties.id) {\n\t message.headers.id = trackingProperties.id;\n\t }\n\t return message;\n\t };\n\t HttpPostMessage.getTrackingProperties = function (message) {\n\t return {\n\t id: message.headers && message.headers.id\n\t };\n\t };\n\t HttpPostMessage.isErrorMessage = function (message) {\n\t if (typeof (message && message.statusCode) !== 'number') {\n\t return false;\n\t }\n\t return !(200 <= message.statusCode && message.statusCode < 300);\n\t };\n\t HttpPostMessage.prototype.get = function (url, headers, targetWindow) {\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"GET\",\n\t url: url,\n\t headers: headers\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.post = function (url, body, headers, targetWindow) {\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"POST\",\n\t url: url,\n\t headers: headers,\n\t body: body\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.put = function (url, body, headers, targetWindow) {\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"PUT\",\n\t url: url,\n\t headers: headers,\n\t body: body\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.patch = function (url, body, headers, targetWindow) {\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"PATCH\",\n\t url: url,\n\t headers: headers,\n\t body: body\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.delete = function (url, body, headers, targetWindow) {\n\t if (body === void 0) { body = null; }\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"DELETE\",\n\t url: url,\n\t headers: headers,\n\t body: body\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.send = function (request, targetWindow) {\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t request.headers = this.assign({}, this.defaultHeaders, request.headers);\n\t if (!targetWindow) {\n\t throw new Error(\"target window is not provided. You must either provide the target window explicitly as argument to request, or specify default target window when constructing instance of this class.\");\n\t }\n\t return this.windowPostMessageProxy.postMessage(targetWindow, request);\n\t };\n\t /**\n\t * Object.assign() polyfill\n\t * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\n\t */\n\t HttpPostMessage.prototype.assign = function (target) {\n\t var sources = [];\n\t for (var _i = 1; _i < arguments.length; _i++) {\n\t sources[_i - 1] = arguments[_i];\n\t }\n\t if (target === undefined || target === null) {\n\t throw new TypeError('Cannot convert undefined or null to object');\n\t }\n\t var output = Object(target);\n\t sources.forEach(function (source) {\n\t if (source !== undefined && source !== null) {\n\t for (var nextKey in source) {\n\t if (Object.prototype.hasOwnProperty.call(source, nextKey)) {\n\t output[nextKey] = source[nextKey];\n\t }\n\t }\n\t }\n\t });\n\t return output;\n\t };\n\t return HttpPostMessage;\n\t}());\n\texports.HttpPostMessage = HttpPostMessage;\n\n\n/***/ }\n/******/ ])\n});\n;\n//# sourceMappingURL=httpPostMessage.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/http-post-message/dist/httpPostMessage.js\n// module id = 13\n// module chunks = 0","/*! powerbi-router v0.1.5 | (c) 2016 Microsoft Corporation MIT */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"powerbi-router\"] = factory();\n\telse\n\t\troot[\"powerbi-router\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar RouteRecognizer = __webpack_require__(1);\n\tvar Router = (function () {\n\t function Router(handlers) {\n\t this.handlers = handlers;\n\t /**\n\t * TODO: look at generating the router dynamically based on list of supported http methods\n\t * instead of hardcoding the creation of these and the methods.\n\t */\n\t this.getRouteRecognizer = new RouteRecognizer();\n\t this.patchRouteRecognizer = new RouteRecognizer();\n\t this.postRouteRecognizer = new RouteRecognizer();\n\t this.putRouteRecognizer = new RouteRecognizer();\n\t this.deleteRouteRecognizer = new RouteRecognizer();\n\t }\n\t Router.prototype.get = function (url, handler) {\n\t this.registerHandler(this.getRouteRecognizer, \"GET\", url, handler);\n\t return this;\n\t };\n\t Router.prototype.patch = function (url, handler) {\n\t this.registerHandler(this.patchRouteRecognizer, \"PATCH\", url, handler);\n\t return this;\n\t };\n\t Router.prototype.post = function (url, handler) {\n\t this.registerHandler(this.postRouteRecognizer, \"POST\", url, handler);\n\t return this;\n\t };\n\t Router.prototype.put = function (url, handler) {\n\t this.registerHandler(this.putRouteRecognizer, \"PUT\", url, handler);\n\t return this;\n\t };\n\t Router.prototype.delete = function (url, handler) {\n\t this.registerHandler(this.deleteRouteRecognizer, \"DELETE\", url, handler);\n\t return this;\n\t };\n\t /**\n\t * TODO: This method could use some refactoring. There is conflict of interest between keeping clean separation of test and handle method\n\t * Test method only returns boolean indicating if request can be handled, and handle method has opportunity to modify response and return promise of it.\n\t * In the case of the router with route-recognizer where handlers are associated with routes, this already guarantees that only one handler is selected and makes the test method feel complicated\n\t * Will leave as is an investigate cleaner ways at later time.\n\t */\n\t Router.prototype.registerHandler = function (routeRecognizer, method, url, handler) {\n\t var routeRecognizerHandler = function (request) {\n\t var response = new Response();\n\t return Promise.resolve(handler(request, response))\n\t .then(function (x) { return response; });\n\t };\n\t routeRecognizer.add([\n\t { path: url, handler: routeRecognizerHandler }\n\t ]);\n\t var internalHandler = {\n\t test: function (request) {\n\t if (request.method !== method) {\n\t return false;\n\t }\n\t var matchingRoutes = routeRecognizer.recognize(request.url);\n\t if (matchingRoutes === undefined) {\n\t return false;\n\t }\n\t /**\n\t * Copy parameters from recognized route to the request so they can be used within the handler function\n\t * This isn't ideal because it is side affect which modifies the request instead of strictly testing for true or false\n\t * but I don't see a better place to put this. If we move it between the call to test and the handle it becomes part of the window post message proxy\n\t * even though it's responsibility is related to routing.\n\t */\n\t var route = matchingRoutes[0];\n\t request.params = route.params;\n\t request.queryParams = matchingRoutes.queryParams;\n\t request.handler = route.handler;\n\t return true;\n\t },\n\t handle: function (request) {\n\t return request.handler(request);\n\t }\n\t };\n\t this.handlers.addHandler(internalHandler);\n\t };\n\t return Router;\n\t}());\n\texports.Router = Router;\n\tvar Response = (function () {\n\t function Response() {\n\t this.statusCode = 200;\n\t this.headers = {};\n\t this.body = null;\n\t }\n\t Response.prototype.send = function (statusCode, body) {\n\t this.statusCode = statusCode;\n\t this.body = body;\n\t };\n\t return Response;\n\t}());\n\texports.Response = Response;\n\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(module) {(function() {\n\t \"use strict\";\n\t function $$route$recognizer$dsl$$Target(path, matcher, delegate) {\n\t this.path = path;\n\t this.matcher = matcher;\n\t this.delegate = delegate;\n\t }\n\t\n\t $$route$recognizer$dsl$$Target.prototype = {\n\t to: function(target, callback) {\n\t var delegate = this.delegate;\n\t\n\t if (delegate && delegate.willAddRoute) {\n\t target = delegate.willAddRoute(this.matcher.target, target);\n\t }\n\t\n\t this.matcher.add(this.path, target);\n\t\n\t if (callback) {\n\t if (callback.length === 0) { throw new Error(\"You must have an argument in the function passed to `to`\"); }\n\t this.matcher.addChild(this.path, target, callback, this.delegate);\n\t }\n\t return this;\n\t }\n\t };\n\t\n\t function $$route$recognizer$dsl$$Matcher(target) {\n\t this.routes = {};\n\t this.children = {};\n\t this.target = target;\n\t }\n\t\n\t $$route$recognizer$dsl$$Matcher.prototype = {\n\t add: function(path, handler) {\n\t this.routes[path] = handler;\n\t },\n\t\n\t addChild: function(path, target, callback, delegate) {\n\t var matcher = new $$route$recognizer$dsl$$Matcher(target);\n\t this.children[path] = matcher;\n\t\n\t var match = $$route$recognizer$dsl$$generateMatch(path, matcher, delegate);\n\t\n\t if (delegate && delegate.contextEntered) {\n\t delegate.contextEntered(target, match);\n\t }\n\t\n\t callback(match);\n\t }\n\t };\n\t\n\t function $$route$recognizer$dsl$$generateMatch(startingPath, matcher, delegate) {\n\t return function(path, nestedCallback) {\n\t var fullPath = startingPath + path;\n\t\n\t if (nestedCallback) {\n\t nestedCallback($$route$recognizer$dsl$$generateMatch(fullPath, matcher, delegate));\n\t } else {\n\t return new $$route$recognizer$dsl$$Target(startingPath + path, matcher, delegate);\n\t }\n\t };\n\t }\n\t\n\t function $$route$recognizer$dsl$$addRoute(routeArray, path, handler) {\n\t var len = 0;\n\t for (var i=0; i z`. For instance, \"199\" is smaller\n\t // then \"200\", even though \"y\" and \"z\" (which are both 9) are larger than \"0\" (the value\n\t // of (`b` and `c`). This is because the leading symbol, \"2\", is larger than the other\n\t // leading symbol, \"1\".\n\t // The rule is that symbols to the left carry more weight than symbols to the right\n\t // when a number is written out as a string. In the above strings, the leading digit\n\t // represents how many 100's are in the number, and it carries more weight than the middle\n\t // number which represents how many 10's are in the number.\n\t // This system of number magnitude works well for route specificity, too. A route written as\n\t // `a/b/c` will be more specific than `x/y/z` as long as `a` is more specific than\n\t // `x`, irrespective of the other parts.\n\t // Because of this similarity, we assign each type of segment a number value written as a\n\t // string. We can find the specificity of compound routes by concatenating these strings\n\t // together, from left to right. After we have looped through all of the segments,\n\t // we convert the string to a number.\n\t specificity.val = '';\n\t\n\t for (var i=0; i 2 && key.slice(keyLength -2) === '[]') {\n\t isArray = true;\n\t key = key.slice(0, keyLength - 2);\n\t if(!queryParams[key]) {\n\t queryParams[key] = [];\n\t }\n\t }\n\t value = pair[1] ? $$route$recognizer$$decodeQueryParamPart(pair[1]) : '';\n\t }\n\t if (isArray) {\n\t queryParams[key].push(value);\n\t } else {\n\t queryParams[key] = value;\n\t }\n\t }\n\t return queryParams;\n\t },\n\t\n\t recognize: function(path) {\n\t var states = [ this.rootState ],\n\t pathLen, i, l, queryStart, queryParams = {},\n\t isSlashDropped = false;\n\t\n\t queryStart = path.indexOf('?');\n\t if (queryStart !== -1) {\n\t var queryString = path.substr(queryStart + 1, path.length);\n\t path = path.substr(0, queryStart);\n\t queryParams = this.parseQueryString(queryString);\n\t }\n\t\n\t path = decodeURI(path);\n\t\n\t if (path.charAt(0) !== \"/\") { path = \"/\" + path; }\n\t\n\t pathLen = path.length;\n\t if (pathLen > 1 && path.charAt(pathLen - 1) === \"/\") {\n\t path = path.substr(0, pathLen - 1);\n\t isSlashDropped = true;\n\t }\n\t\n\t for (i=0; i {\n type: string;\n id: string;\n name: string;\n value: T;\n}\n\nexport interface ICustomEvent extends CustomEvent {\n detail: T;\n}\n\nexport interface IEventHandler {\n (event: ICustomEvent): any;\n}\n\nexport interface IHpmFactory {\n (wpmp: wpmp.WindowPostMessageProxy, targetWindow?: Window, version?: string, type?: string, origin?: string): hpm.HttpPostMessage;\n}\n\nexport interface IWpmpFactory {\n (name?: string, logMessages?: boolean, eventSourceOverrideWindow?: Window): wpmp.WindowPostMessageProxy;\n}\n\nexport interface IRouterFactory {\n (wpmp: wpmp.WindowPostMessageProxy): router.Router;\n}\n\nexport interface IPowerBiElement extends HTMLElement {\n powerBiEmbed: embed.Embed;\n}\n\nexport interface IDebugOptions {\n logMessages?: boolean;\n wpmpName?: string;\n}\n\nexport interface IServiceConfiguration extends IDebugOptions {\n autoEmbedOnContentLoaded?: boolean;\n onError?: (error: any) => any;\n version?: string;\n type?: string;\n}\n\nexport interface IService {\n hpm: hpm.HttpPostMessage;\n}\n\n/**\n * The Power BI Service embed component, which is the entry point to embed all other Power BI components into your application\n * \n * @export\n * @class Service\n * @implements {IService}\n */\nexport class Service implements IService {\n\n /**\n * A list of components that this service can embed\n */\n private static components: (typeof Report | typeof Tile | typeof Dashboard)[] = [\n Tile,\n Report,\n Dashboard\n ];\n\n /**\n * The default configuration for the service\n */\n private static defaultConfig: IServiceConfiguration = {\n autoEmbedOnContentLoaded: false,\n onError: (...args) => console.log(args[0], args.slice(1))\n };\n\n /**\n * Gets or sets the access token as the global fallback token to use when a local token is not provided for a report or tile.\n * \n * @type {string}\n */\n accessToken: string;\n\n /**The Configuration object for the service*/\n private config: IServiceConfiguration;\n\n /** A list of Dashboard, Report and Tile components that have been embedded using this service instance. */\n private embeds: embed.Embed[];\n /** TODO: Look for way to make hpm private without sacraficing ease of maitenance. This should be private but in embed needs to call methods. */\n hpm: hpm.HttpPostMessage;\n /** TODO: Look for way to make wpmp private. This is only public to allow stopping the wpmp in tests */\n wpmp: wpmp.WindowPostMessageProxy;\n private router: router.Router;\n\n /**\n * Creates an instance of a Power BI Service.\n * \n * @param {IHpmFactory} hpmFactory The http post message factory used in the postMessage communication layer\n * @param {IWpmpFactory} wpmpFactory The window post message factory used in the postMessage communication layer\n * @param {IRouterFactory} routerFactory The router factory used in the postMessage communication layer\n * @param {IServiceConfiguration} [config={}]\n */\n constructor(hpmFactory: IHpmFactory, wpmpFactory: IWpmpFactory, routerFactory: IRouterFactory, config: IServiceConfiguration = {}) {\n this.wpmp = wpmpFactory(config.wpmpName, config.logMessages);\n this.hpm = hpmFactory(this.wpmp, null, config.version, config.type);\n this.router = routerFactory(this.wpmp);\n\n /**\n * Adds handler for report events.\n */\n this.router.post(`/reports/:uniqueId/events/:eventName`, (req, res) => {\n const event: IEvent = {\n type: 'report',\n id: req.params.uniqueId,\n name: req.params.eventName,\n value: req.body\n };\n\n this.handleEvent(event);\n });\n this.router.post(`/reports/:uniqueId/pages/:pageName/events/:eventName`, (req, res) => {\n const event: IEvent = {\n type: 'report',\n id: req.params.uniqueId,\n name: req.params.eventName,\n value: req.body\n };\n\n this.handleEvent(event);\n });\n\n this.router.post(`/dashboards/:uniqueId/events/:eventName`, (req, res) => {\n const event: IEvent = {\n type: 'dashboard',\n id: req.params.uniqueId,\n name: req.params.eventName,\n value: req.body\n };\n\n this.handleEvent(event);\n });\n\n this.embeds = [];\n\n // TODO: Change when Object.assign is available.\n this.config = utils.assign({}, Service.defaultConfig, config);\n\n if (this.config.autoEmbedOnContentLoaded) {\n this.enableAutoEmbed();\n }\n }\n\n /**\n * Creates new report\n * @param {HTMLElement} element\n * @param {embed.IEmbedConfiguration} [config={}]\n * @returns {embed.Embed}\n */\n createReport(element: HTMLElement, config: embed.IEmbedConfiguration): embed.Embed {\n config.type = 'create';\n let powerBiElement = element;\n const component = new Create(this, powerBiElement, config);\n powerBiElement.powerBiEmbed = component;\n this.embeds.push(component);\n\n return component;\n }\n\n /**\n * TODO: Add a description here\n * \n * @param {HTMLElement} [container]\n * @param {embed.IEmbedConfiguration} [config=undefined]\n * @returns {embed.Embed[]}\n */\n init(container?: HTMLElement, config: embed.IEmbedConfiguration = undefined): embed.Embed[] {\n container = (container && container instanceof HTMLElement) ? container : document.body;\n\n const elements = Array.prototype.slice.call(container.querySelectorAll(`[${embed.Embed.embedUrlAttribute}]`));\n return elements.map(element => this.embed(element, config));\n }\n\n /**\n * Given a configuration based on an HTML element,\n * if the component has already been created and attached to the element, reuses the component instance and existing iframe,\n * otherwise creates a new component instance.\n * \n * @param {HTMLElement} element\n * @param {embed.IEmbedConfiguration} [config={}]\n * @returns {embed.Embed}\n */\n embed(element: HTMLElement, config: embed.IEmbedConfiguration = {}): embed.Embed {\n let component: embed.Embed;\n let powerBiElement = element;\n\n if (powerBiElement.powerBiEmbed) {\n component = this.embedExisting(powerBiElement, config);\n }\n else {\n component = this.embedNew(powerBiElement, config);\n }\n\n return component;\n }\n\n /**\n * Given a configuration based on a Power BI element, saves the component instance that reference the element for later lookup.\n * \n * @private\n * @param {IPowerBiElement} element\n * @param {embed.IEmbedConfiguration} config\n * @returns {embed.Embed}\n */\n private embedNew(element: IPowerBiElement, config: embed.IEmbedConfiguration): embed.Embed {\n const componentType = config.type || element.getAttribute(embed.Embed.typeAttribute);\n if (!componentType) {\n throw new Error(`Attempted to embed using config ${JSON.stringify(config)} on element ${element.outerHTML}, but could not determine what type of component to embed. You must specify a type in the configuration or as an attribute such as '${embed.Embed.typeAttribute}=\"${Report.type.toLowerCase()}\"'.`);\n }\n\n // Saves the type as part of the configuration so that it can be referenced later at a known location.\n config.type = componentType;\n\n const Component = utils.find(component => componentType === component.type.toLowerCase(), Service.components);\n if (!Component) {\n throw new Error(`Attempted to embed component of type: ${componentType} but did not find any matching component. Please verify the type you specified is intended.`);\n }\n\n const component = new Component(this, element, config);\n element.powerBiEmbed = component;\n this.embeds.push(component);\n\n return component;\n }\n\n /**\n * Given an element that already contains an embed component, load with a new configuration.\n * \n * @private\n * @param {IPowerBiElement} element\n * @param {embed.IEmbedConfiguration} config\n * @returns {embed.Embed}\n */\n private embedExisting(element: IPowerBiElement, config: embed.IEmbedConfiguration): embed.Embed {\n const component = utils.find(x => x.element === element, this.embeds);\n if (!component) {\n throw new Error(`Attempted to embed using config ${JSON.stringify(config)} on element ${element.outerHTML} which already has embedded comopnent associated, but could not find the existing comopnent in the list of active components. This could indicate the embeds list is out of sync with the DOM, or the component is referencing the incorrect HTML element.`);\n }\n\n /**\n * TODO: Dynamic embed type switching could be supported but there is work needed to prepare the service state and DOM cleanup.\n * remove all event handlers from the DOM, then reset the element to initial state which removes iframe, and removes from list of embeds\n * then we can call the embedNew function which would allow setting the proper embedUrl and construction of object based on the new type.\n */\n if (typeof config.type === \"string\" && config.type !== component.config.type) {\n\n /**\n * When loading report after create we want to use existing Iframe to optimize load period\n */\n if(config.type === \"report\" && component.config.type === \"create\") {\n const report = new Report(this, element, config, element.powerBiEmbed.iframe);\n report.load(config);\n element.powerBiEmbed = report;\n this.embeds.push(report);\n\n return report;\n }\n\n throw new Error(`Embedding on an existing element with a different type than the previous embed object is not supported. Attempted to embed using config ${JSON.stringify(config)} on element ${element.outerHTML}, but the existing element contains an embed of type: ${this.config.type} which does not match the new type: ${config.type}`);\n }\n\n component.load(config);\n\n return component;\n }\n\n /**\n * Adds an event handler for DOMContentLoaded, which searches the DOM for elements that have the 'powerbi-embed-url' attribute,\n * and automatically attempts to embed a powerbi component based on information from other powerbi-* attributes.\n *\n * Note: Only runs if `config.autoEmbedOnContentLoaded` is true when the service is created.\n * This handler is typically useful only for applications that are rendered on the server so that all required data is available when the handler is called.\n */\n enableAutoEmbed(): void {\n window.addEventListener('DOMContentLoaded', (event: Event) => this.init(document.body), false);\n }\n\n /**\n * Returns an instance of the component associated with the element.\n * \n * @param {HTMLElement} element\n * @returns {(Report | Tile)}\n */\n get(element: HTMLElement): Report | Tile | Dashboard {\n const powerBiElement = element;\n\n if (!powerBiElement.powerBiEmbed) {\n throw new Error(`You attempted to get an instance of powerbi component associated with element: ${element.outerHTML} but there was no associated instance.`);\n }\n\n return powerBiElement.powerBiEmbed;\n }\n\n /**\n * Finds an embed instance by the name or unique ID that is provided.\n * \n * @param {string} uniqueId\n * @returns {(Report | Tile)}\n */\n find(uniqueId: string): Report | Tile | Dashboard {\n return utils.find(x => x.config.uniqueId === uniqueId, this.embeds);\n }\n\n /**\n * Given an HTML element that has a component embedded within it, removes the component from the list of embedded components, removes the association between the element and the component, and removes the iframe.\n * \n * @param {HTMLElement} element\n * @returns {void}\n */\n reset(element: HTMLElement): void {\n const powerBiElement = element;\n\n if (!powerBiElement.powerBiEmbed) {\n return;\n }\n\n /** Removes the component from an internal list of components. */\n utils.remove(x => x === powerBiElement.powerBiEmbed, this.embeds);\n /** Deletes a property from the HTML element. */\n delete powerBiElement.powerBiEmbed;\n /** Removes the iframe from the element. */\n const iframe = element.querySelector('iframe');\n if (iframe) {\n iframe.remove();\n }\n }\n\n /**\n * Given an event object, finds the embed component with the matching type and ID, and invokes its handleEvent method with the event object.\n * \n * @private\n * @param {IEvent} event\n */\n private handleEvent(event: IEvent): void {\n const embed = utils.find(embed => {\n return (embed.config.uniqueId === event.id);\n }, this.embeds);\n\n if (embed) {\n const value = event.value;\n\n if (event.name === 'pageChanged') {\n const pageKey = 'newPage';\n const page: models.IPage = value[pageKey];\n if (!page) {\n throw new Error(`Page model not found at 'event.value.${pageKey}'.`);\n }\n value[pageKey] = new Page(embed, page.name, page.displayName);\n }\n\n utils.raiseCustomEvent(embed.element, event.name, value);\n }\n }\n}\n\n\n// WEBPACK FOOTER //\n// ./src/service.ts","import * as utils from './util';\r\nimport * as service from './service';\r\nimport * as models from 'powerbi-models';\r\nimport * as hpm from 'http-post-message';\r\n\r\ndeclare global {\r\n interface Document {\r\n // Mozilla Fullscreen\r\n mozCancelFullScreen: Function;\r\n\r\n // Ms Fullscreen\r\n msExitFullscreen: Function;\r\n }\r\n\r\n interface HTMLIFrameElement {\r\n // Mozilla Fullscreen\r\n mozRequestFullScreen: Function;\r\n\r\n // Ms Fullscreen\r\n msRequestFullscreen: Function;\r\n }\r\n}\r\n\r\n// TODO: Re-use ILoadConfiguration interface to prevent duplicating properties.\r\n// Current issue is that they are optional when embedding since they can be specificed as attributes but they are required when loading.\r\n/**\r\n * Configuration settings for Power BI embed components\r\n * \r\n * @export\r\n * @interface IEmbedConfiguration\r\n */\r\nexport interface IEmbedConfiguration {\r\n type?: string;\r\n id?: string;\r\n uniqueId?: string;\r\n embedUrl?: string;\r\n accessToken?: string;\r\n settings?: models.ISettings;\r\n pageName?: string;\r\n filters?: models.IFilter[];\r\n pageView?: models.PageView;\r\n datasetId?: string;\r\n permissions?: models.Permissions;\r\n viewMode?: models.ViewMode;\r\n}\r\n\r\nexport interface IInternalEmbedConfiguration extends models.IReportLoadConfiguration {\r\n uniqueId: string;\r\n type: string;\r\n embedUrl: string;\r\n}\r\n\r\nexport interface IInternalEventHandler {\r\n test(event: service.IEvent): boolean;\r\n handle(event: service.ICustomEvent): void;\r\n}\r\n\r\n/**\r\n * Base class for all Power BI embed components\r\n * \r\n * @export\r\n * @abstract\r\n * @class Embed\r\n */\r\nexport abstract class Embed {\r\n static allowedEvents = [\"loaded\", \"saved\", \"rendered\", \"saveAsTriggered\"];\r\n static accessTokenAttribute = 'powerbi-access-token';\r\n static embedUrlAttribute = 'powerbi-embed-url';\r\n static nameAttribute = 'powerbi-name';\r\n static typeAttribute = 'powerbi-type';\r\n static type: string;\r\n\r\n private static defaultSettings: models.ISettings = {\r\n filterPaneEnabled: true\r\n };\r\n\r\n allowedEvents = [];\r\n\r\n /**\r\n * Gets or sets the event handler registered for this embed component.\r\n * \r\n * @type {IInternalEventHandler[]}\r\n */\r\n eventHandlers: IInternalEventHandler[];\r\n\r\n /**\r\n * Gets or sets the Power BI embed service.\r\n * \r\n * @type {service.Service}\r\n */\r\n service: service.Service;\r\n\r\n /**\r\n * Gets or sets the HTML element that contains the Power BI embed component.\r\n * \r\n * @type {HTMLElement}\r\n */\r\n element: HTMLElement;\r\n\r\n /**\r\n * Gets or sets the HTML iframe element that renders the Power BI embed component.\r\n * \r\n * @type {HTMLIFrameElement}\r\n */\r\n iframe: HTMLIFrameElement;\r\n\r\n /**\r\n * Gets or sets the configuration settings for the Power BI embed component.\r\n * \r\n * @type {IInternalEmbedConfiguration}\r\n */\r\n config: IInternalEmbedConfiguration;\r\n\r\n /**\r\n * Gets or sets the configuration settings for creating report.\r\n * \r\n * @type {models.IReportCreateConfiguration}\r\n */\r\n createConfig: models.IReportCreateConfiguration;\r\n\r\n /**\r\n * Url used in the load request.\r\n */\r\n loadPath: string;\r\n\r\n /**\r\n * Type of embed\r\n */\r\n embeType: string;\r\n\r\n /**\r\n * Creates an instance of Embed.\r\n * \r\n * Note: there is circular reference between embeds and the service, because\r\n * the service has a list of all embeds on the host page, and each embed has a reference to the service that created it.\r\n * \r\n * @param {service.Service} service\r\n * @param {HTMLElement} element\r\n * @param {IEmbedConfiguration} config\r\n */\r\n constructor(service: service.Service, element: HTMLElement, config: IEmbedConfiguration, iframe?: HTMLIFrameElement) {\r\n Array.prototype.push.apply(this.allowedEvents, Embed.allowedEvents);\r\n this.eventHandlers = [];\r\n this.service = service;\r\n this.element = element;\r\n this.iframe = iframe;\r\n this.embeType = config.type.toLowerCase();\r\n\r\n this.populateConfig(config);\r\n \r\n if(this.embeType === 'create'){\r\n this.setIframe(false/*set EventListener to call create() on 'load' event*/);\r\n } else {\r\n this.setIframe(true/*set EventListener to call load() on 'load' event*/);\r\n }\r\n }\r\n\r\n /**\r\n * Sends createReport configuration data.\r\n * \r\n * ```javascript\r\n * createReport({\r\n * datasetId: '5dac7a4a-4452-46b3-99f6-a25915e0fe55',\r\n * accessToken: 'eyJ0eXA ... TaE2rTSbmg',\r\n * ```\r\n * \r\n * @param {models.IReportCreateConfiguration} config\r\n * @returns {Promise}\r\n */\r\n createReport(config: models.IReportCreateConfiguration): Promise {\r\n const errors = this.validate(config);\r\n if (errors) {\r\n throw errors;\r\n }\r\n \r\n return this.service.hpm.post(\"/report/create\", config, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n return response.body;\r\n },\r\n response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Saves Report.\r\n * \r\n * @returns {Promise}\r\n */\r\n save(): Promise {\r\n return this.service.hpm.post('/report/save', null, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n return response.body;\r\n })\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * SaveAs Report.\r\n * \r\n * @returns {Promise}\r\n */\r\n saveAs(saveAsParameters: models.ISaveAsParameters): Promise {\r\n return this.service.hpm.post('/report/saveAs', saveAsParameters, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n return response.body;\r\n })\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Sends load configuration data.\r\n * \r\n * ```javascript\r\n * report.load({\r\n * type: 'report',\r\n * id: '5dac7a4a-4452-46b3-99f6-a25915e0fe55',\r\n * accessToken: 'eyJ0eXA ... TaE2rTSbmg',\r\n * settings: {\r\n * navContentPaneEnabled: false\r\n * },\r\n * pageName: \"DefaultPage\",\r\n * filters: [\r\n * {\r\n * ... DefaultReportFilter ...\r\n * }\r\n * ]\r\n * })\r\n * .catch(error => { ... });\r\n * ```\r\n * \r\n * @param {models.ILoadConfiguration} config\r\n * @returns {Promise}\r\n */\r\n load(config: models.IReportLoadConfiguration | models.IDashboardLoadConfiguration): Promise {\r\n const errors = this.validate(config);\r\n if (errors) {\r\n throw errors;\r\n }\r\n\r\n return this.service.hpm.post(this.loadPath, config, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n utils.assign(this.config, config);\r\n return response.body;\r\n },\r\n response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Removes one or more event handlers from the list of handlers.\r\n * If a reference to the existing handle function is specified, remove the specific handler.\r\n * If the handler is not specified, remove all handlers for the event name specified.\r\n * \r\n * ```javascript\r\n * report.off('pageChanged')\r\n * \r\n * or \r\n * \r\n * const logHandler = function (event) {\r\n * console.log(event);\r\n * };\r\n * \r\n * report.off('pageChanged', logHandler);\r\n * ```\r\n * \r\n * @template T\r\n * @param {string} eventName\r\n * @param {service.IEventHandler} [handler]\r\n */\r\n off(eventName: string, handler?: service.IEventHandler): void {\r\n const fakeEvent: service.IEvent = { name: eventName, type: null, id: null, value: null };\r\n if (handler) {\r\n utils.remove(eventHandler => eventHandler.test(fakeEvent) && (eventHandler.handle === handler), this.eventHandlers);\r\n this.element.removeEventListener(eventName, handler);\r\n }\r\n else {\r\n const eventHandlersToRemove = this.eventHandlers\r\n .filter(eventHandler => eventHandler.test(fakeEvent));\r\n\r\n eventHandlersToRemove\r\n .forEach(eventHandlerToRemove => {\r\n utils.remove(eventHandler => eventHandler === eventHandlerToRemove, this.eventHandlers);\r\n this.element.removeEventListener(eventName, eventHandlerToRemove.handle);\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Adds an event handler for a specific event.\r\n * \r\n * ```javascript\r\n * report.on('pageChanged', (event) => {\r\n * console.log('PageChanged: ', event.page.name);\r\n * });\r\n * ```\r\n * \r\n * @template T\r\n * @param {string} eventName\r\n * @param {service.IEventHandler} handler\r\n */\r\n on(eventName: string, handler: service.IEventHandler): void {\r\n if (this.allowedEvents.indexOf(eventName) === -1) {\r\n throw new Error(`eventName is must be one of ${this.allowedEvents}. You passed: ${eventName}`);\r\n }\r\n\r\n this.eventHandlers.push({\r\n test: (event: service.IEvent) => event.name === eventName,\r\n handle: handler\r\n });\r\n\r\n this.element.addEventListener(eventName, handler)\r\n }\r\n\r\n /**\r\n * Reloads embed using existing configuration.\r\n * E.g. For reports this effectively clears all filters and makes the first page active which simulates resetting a report back to loaded state.\r\n * \r\n * ```javascript\r\n * report.reload();\r\n * ```\r\n */\r\n reload(): Promise {\r\n return this.load(this.config);\r\n }\r\n \r\n /**\r\n * Set accessToken.\r\n * \r\n * @returns {Promise}\r\n */\r\n setAccessToken(accessToken: string): Promise {\r\n return this.service.hpm.post('/report/token', accessToken, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n return response.body;\r\n })\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n \r\n /**\r\n * Gets an access token from the first available location: config, attribute, global.\r\n * \r\n * @private\r\n * @param {string} globalAccessToken\r\n * @returns {string}\r\n */\r\n private getAccessToken(globalAccessToken: string): string {\r\n const accessToken = this.config.accessToken || this.element.getAttribute(Embed.accessTokenAttribute) || globalAccessToken;\r\n\r\n if (!accessToken) {\r\n throw new Error(`No access token was found for element. You must specify an access token directly on the element using attribute '${Embed.accessTokenAttribute}' or specify a global token at: powerbi.accessToken.`);\r\n }\r\n\r\n return accessToken;\r\n }\r\n\r\n /**\r\n * Populate config for create and load\r\n * \r\n * @private\r\n * @param {IEmbedConfiguration}\r\n * @returns {void}\r\n */\r\n private populateConfig(config: IEmbedConfiguration): void {\r\n // TODO: Change when Object.assign is available.\r\n const settings = utils.assign({}, Embed.defaultSettings, config.settings);\r\n this.config = utils.assign({ settings }, config);\r\n this.config.uniqueId = this.getUniqueId();\r\n this.config.embedUrl = this.getEmbedUrl();\r\n\r\n if(this.embeType === 'create') {\r\n this.createConfig = {\r\n datasetId: config.datasetId || this.getId(),\r\n accessToken: this.getAccessToken(this.service.accessToken),\r\n settings: settings\r\n }\r\n } else {\r\n this.config.id = this.getId();\r\n this.config.accessToken = this.getAccessToken(this.service.accessToken);\r\n } \r\n }\r\n\r\n\r\n /**\r\n * Gets an embed url from the first available location: options, attribute.\r\n * \r\n * @private\r\n * @returns {string}\r\n */\r\n private getEmbedUrl(): string {\r\n const embedUrl = this.config.embedUrl || this.element.getAttribute(Embed.embedUrlAttribute);\r\n\r\n if (typeof embedUrl !== 'string' || embedUrl.length === 0) {\r\n throw new Error(`Embed Url is required, but it was not found. You must provide an embed url either as part of embed configuration or as attribute '${Embed.embedUrlAttribute}'.`);\r\n }\r\n\r\n return embedUrl;\r\n }\r\n\r\n /**\r\n * Gets a unique ID from the first available location: options, attribute.\r\n * If neither is provided generate a unique string.\r\n * \r\n * @private\r\n * @returns {string}\r\n */\r\n private getUniqueId(): string {\r\n return this.config.uniqueId || this.element.getAttribute(Embed.nameAttribute) || utils.createRandomString();\r\n }\r\n\r\n /**\r\n * Gets the report ID from the first available location: options, attribute.\r\n * \r\n * @abstract\r\n * @returns {string}\r\n */\r\n abstract getId(): string;\r\n\r\n /**\r\n * Requests the browser to render the component's iframe in fullscreen mode.\r\n */\r\n fullscreen(): void {\r\n const requestFullScreen = this.iframe.requestFullscreen || this.iframe.msRequestFullscreen || this.iframe.mozRequestFullScreen || this.iframe.webkitRequestFullscreen;\r\n requestFullScreen.call(this.iframe);\r\n }\r\n\r\n /**\r\n * Requests the browser to exit fullscreen mode.\r\n */\r\n exitFullscreen(): void {\r\n if (!this.isFullscreen(this.iframe)) {\r\n return;\r\n }\r\n\r\n const exitFullscreen = document.exitFullscreen || document.mozCancelFullScreen || document.webkitExitFullscreen || document.msExitFullscreen;\r\n exitFullscreen.call(document);\r\n }\r\n\r\n /**\r\n * Returns true if the iframe is rendered in fullscreen mode,\r\n * otherwise returns false.\r\n * \r\n * @private\r\n * @param {HTMLIFrameElement} iframe\r\n * @returns {boolean}\r\n */\r\n private isFullscreen(iframe: HTMLIFrameElement): boolean {\r\n const options = ['fullscreenElement', 'webkitFullscreenElement', 'mozFullscreenScreenElement', 'msFullscreenElement'];\r\n\r\n return options.some(option => document[option] === iframe);\r\n }\r\n \r\n /**\r\n * Validate load and create configuration.\r\n */\r\n abstract validate(config: models.IReportLoadConfiguration | models.IDashboardLoadConfiguration | models.IReportCreateConfiguration): models.IError[];\r\n\r\n /**\r\n * Sets Iframe for embed\r\n */\r\n private setIframe(isLoad: boolean): void {\r\n if(!this.iframe) {\r\n const iframeHtml = ``;\r\n this.element.innerHTML = iframeHtml;\r\n this.iframe = this.element.childNodes[0];\r\n }\r\n\r\n if(isLoad){\r\n this.iframe.addEventListener('load', () => this.load(this.config), false);\r\n } else {\r\n this.iframe.addEventListener('load', () => this.createReport(this.createConfig), false);\r\n }\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/embed.ts","\r\n/**\r\n * Raises a custom event with event data on the specified HTML element.\r\n * \r\n * @export\r\n * @param {HTMLElement} element\r\n * @param {string} eventName\r\n * @param {*} eventData\r\n */\r\nexport function raiseCustomEvent(element: HTMLElement, eventName: string, eventData: any): void {\r\n let customEvent;\r\n if (typeof CustomEvent === 'function') {\r\n customEvent = new CustomEvent(eventName, {\r\n detail: eventData,\r\n bubbles: true,\r\n cancelable: true\r\n });\r\n } else {\r\n customEvent = document.createEvent('CustomEvent');\r\n customEvent.initCustomEvent(eventName, true, true, eventData);\r\n }\r\n\r\n element.dispatchEvent(customEvent);\r\n}\r\n\r\n/**\r\n * Finds the index of the first value in an array that matches the specified predicate.\r\n * \r\n * @export\r\n * @template T\r\n * @param {(x: T) => boolean} predicate\r\n * @param {T[]} xs\r\n * @returns {number}\r\n */\r\nexport function findIndex(predicate: (x: T) => boolean, xs: T[]): number {\r\n if (!Array.isArray(xs)) {\r\n throw new Error(`You attempted to call find with second parameter that was not an array. You passed: ${xs}`);\r\n }\r\n\r\n let index;\r\n xs.some((x, i) => {\r\n if (predicate(x)) {\r\n index = i;\r\n return true;\r\n }\r\n });\r\n\r\n return index;\r\n}\r\n\r\n/**\r\n * Finds the first value in an array that matches the specified predicate.\r\n * \r\n * @export\r\n * @template T\r\n * @param {(x: T) => boolean} predicate\r\n * @param {T[]} xs\r\n * @returns {T}\r\n */\r\nexport function find(predicate: (x: T) => boolean, xs: T[]): T {\r\n const index = findIndex(predicate, xs);\r\n return xs[index];\r\n}\r\n\r\nexport function remove(predicate: (x: T) => boolean, xs: T[]): void {\r\n const index = findIndex(predicate, xs);\r\n xs.splice(index, 1);\r\n}\r\n\r\n// See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\r\n// TODO: replace in favor of using polyfill\r\n/**\r\n * Copies the values of all enumerable properties from one or more source objects to a target object, and returns the target object.\r\n * \r\n * @export\r\n * @param {any} args\r\n * @returns\r\n */\r\nexport function assign(...args) {\r\n var target = args[0];\r\n\r\n 'use strict';\r\n if (target === undefined || target === null) {\r\n throw new TypeError('Cannot convert undefined or null to object');\r\n }\r\n\r\n var output = Object(target);\r\n for (var index = 1; index < arguments.length; index++) {\r\n var source = arguments[index];\r\n if (source !== undefined && source !== null) {\r\n for (var nextKey in source) {\r\n if (source.hasOwnProperty(nextKey)) {\r\n output[nextKey] = source[nextKey];\r\n }\r\n }\r\n }\r\n }\r\n return output;\r\n}\r\n\r\n/**\r\n * Generates a random 7 character string.\r\n * \r\n * @export\r\n * @returns {string}\r\n */\r\nexport function createRandomString(): string {\r\n return (Math.random() + 1).toString(36).substring(7);\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/util.ts","import * as service from './service';\nimport * as embed from './embed';\nimport * as models from 'powerbi-models';\nimport * as wpmp from 'window-post-message-proxy';\nimport * as hpm from 'http-post-message';\nimport * as utils from './util';\nimport { IFilterable } from './ifilterable';\nimport { IPageNode, Page } from './page';\n\n/**\n * A Report node within a report hierarchy\n * \n * @export\n * @interface IReportNode\n */\nexport interface IReportNode {\n iframe: HTMLIFrameElement;\n service: service.IService;\n config: embed.IInternalEmbedConfiguration\n}\n\n/**\n * The Power BI Report embed component\n * \n * @export\n * @class Report\n * @extends {embed.Embed}\n * @implements {IReportNode}\n * @implements {IFilterable}\n */\nexport class Report extends embed.Embed implements IReportNode, IFilterable {\n static allowedEvents = [\"dataSelected\", \"filtersApplied\", \"pageChanged\", \"error\"];\n static reportIdAttribute = 'powerbi-report-id';\n static filterPaneEnabledAttribute = 'powerbi-settings-filter-pane-enabled';\n static navContentPaneEnabledAttribute = 'powerbi-settings-nav-content-pane-enabled';\n static typeAttribute = 'powerbi-type';\n static type = \"Report\";\n\n /**\n * Creates an instance of a Power BI Report.\n * \n * @param {service.Service} service\n * @param {HTMLElement} element\n * @param {embed.IEmbedConfiguration} config\n */\n constructor(service: service.Service, element: HTMLElement, config: embed.IEmbedConfiguration, iframe?: HTMLIFrameElement) {\n const filterPaneEnabled = (config.settings && config.settings.filterPaneEnabled) || !(element.getAttribute(Report.filterPaneEnabledAttribute) === \"false\");\n const navContentPaneEnabled = (config.settings && config.settings.navContentPaneEnabled) || !(element.getAttribute(Report.navContentPaneEnabledAttribute) === \"false\");\n const settings = utils.assign({\n filterPaneEnabled,\n navContentPaneEnabled\n }, config.settings);\n const configCopy = utils.assign({ settings }, config);\n\n super(service, element, configCopy, iframe);\n this.loadPath = \"/report/load\";\n Array.prototype.push.apply(this.allowedEvents, Report.allowedEvents);\n }\n\n /**\n * Adds backwards compatibility for the previous load configuration, which used the reportId query parameter to specify the report ID\n * (e.g. http://embedded.powerbi.com/appTokenReportEmbed?reportId=854846ed-2106-4dc2-bc58-eb77533bf2f1).\n * \n * By extracting the ID we can ensure that the ID is always explicitly provided as part of the load configuration.\n * \n * @static\n * @param {string} url\n * @returns {string}\n */\n static findIdFromEmbedUrl(url: string): string {\n const reportIdRegEx = /reportId=\"?([^&]+)\"?/\n const reportIdMatch = url.match(reportIdRegEx);\n\n let reportId;\n if (reportIdMatch) {\n reportId = reportIdMatch[1];\n }\n\n return reportId;\n }\n\n /**\n * Gets filters that are applied at the report level.\n * \n * ```javascript\n * // Get filters applied at report level\n * report.getFilters()\n * .then(filters => {\n * ...\n * });\n * ```\n * \n * @returns {Promise}\n */\n getFilters(): Promise {\n return this.service.hpm.get(`/report/filters`, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .then(response => response.body,\n response => {\n throw response.body;\n });\n }\n\n /**\n * Gets the report ID from the first available location: options, attribute, embed url.\n * \n * @returns {string}\n */\n getId(): string {\n const reportId = this.config.id || this.element.getAttribute(Report.reportIdAttribute) || Report.findIdFromEmbedUrl(this.config.embedUrl);\n\n if (typeof reportId !== 'string' || reportId.length === 0) {\n throw new Error(`Report id is required, but it was not found. You must provide an id either as part of embed configuration or as attribute '${Report.reportIdAttribute}'.`);\n }\n\n return reportId;\n }\n\n /**\n * Gets the list of pages within the report.\n * \n * ```javascript\n * report.getPages()\n * .then(pages => {\n * ...\n * });\n * ```\n * \n * @returns {Promise}\n */\n getPages(): Promise {\n return this.service.hpm.get('/report/pages', { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .then(response => {\n return response.body\n .map(page => {\n return new Page(this, page.name, page.displayName);\n });\n }, response => {\n throw response.body;\n });\n }\n\n /**\n * Creates an instance of a Page.\n * \n * Normally you would get Page objects by calling `report.getPages()`, but in the case\n * that the page name is known and you want to perform an action on a page without having to retrieve it\n * you can create it directly.\n * \n * Note: Because you are creating the page manually there is no guarantee that the page actually exists in the report, and subsequent requests could fail.\n * \n * ```javascript\n * const page = report.page('ReportSection1');\n * page.setActive();\n * ```\n * \n * @param {string} name\n * @param {string} [displayName]\n * @returns {Page}\n */\n page(name: string, displayName?: string): Page {\n return new Page(this, name, displayName);\n }\n\n /**\n * Prints the active page of the report by invoking `window.print()` on the embed iframe component.\n */\n print(): Promise {\n return this.service.hpm.post('/report/print', null, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .then(response => {\n return response.body;\n })\n .catch(response => {\n throw response.body;\n });\n }\n\n /**\n * Removes all filters at the report level.\n * \n * ```javascript\n * report.removeFilters();\n * ```\n * \n * @returns {Promise}\n */\n removeFilters(): Promise {\n return this.setFilters([]);\n }\n\n /**\n * Sets the active page of the report.\n * \n * ```javascript\n * report.setPage(\"page2\")\n * .catch(error => { ... });\n * ```\n * \n * @param {string} pageName\n * @returns {Promise}\n */\n setPage(pageName: string): Promise {\n const page: models.IPage = {\n name: pageName,\n displayName: null\n };\n\n return this.service.hpm.put('/report/pages/active', page, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .catch(response => {\n throw response.body;\n });\n }\n\n /**\n * Sets filters at the report level.\n * \n * ```javascript\n * const filters: [\n * ...\n * ];\n * \n * report.setFilters(filters)\n * .catch(errors => {\n * ...\n * });\n * ```\n * \n * @param {(models.IFilter[])} filters\n * @returns {Promise}\n */\n setFilters(filters: models.IFilter[]): Promise {\n return this.service.hpm.put(`/report/filters`, filters, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .catch(response => {\n throw response.body;\n });\n }\n\n /**\n * Updates visibility settings for the filter pane and the page navigation pane.\n * \n * ```javascript\n * const newSettings = {\n * navContentPaneEnabled: true,\n * filterPaneEnabled: false\n * };\n * \n * report.updateSettings(newSettings)\n * .catch(error => { ... });\n * ```\n * \n * @param {models.ISettings} settings\n * @returns {Promise}\n */\n updateSettings(settings: models.ISettings): Promise {\n return this.service.hpm.patch('/report/settings', settings, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .catch(response => {\n throw response.body;\n });\n }\n\n /**\n * Validate load configuration.\n */\n validate(config: models.IReportLoadConfiguration): models.IError[] {\n return models.validateReportLoad(config);\n }\n\n /**\n * Switch Report view mode.\n * \n * @returns {Promise}\n */\n switchMode(viewMode: models.ViewMode): Promise {\n let url = '/report/switchMode/' + viewMode;\n return this.service.hpm.post(url, null, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .then(response => {\n return response.body;\n })\n .catch(response => {\n throw response.body;\n });\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/report.ts","/*! powerbi-models v0.10.4 | (c) 2016 Microsoft Corporation MIT */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"powerbi-models\"] = factory();\n\telse\n\t\troot[\"powerbi-models\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __extends = (this && this.__extends) || function (d, b) {\r\n\t for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\r\n\t function __() { this.constructor = d; }\r\n\t d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n\t};\r\n\t/* tslint:disable:no-var-requires */\r\n\texports.advancedFilterSchema = __webpack_require__(1);\r\n\texports.filterSchema = __webpack_require__(2);\r\n\texports.loadSchema = __webpack_require__(3);\r\n\texports.dashboardLoadSchema = __webpack_require__(4);\r\n\texports.pageSchema = __webpack_require__(5);\r\n\texports.settingsSchema = __webpack_require__(6);\r\n\texports.basicFilterSchema = __webpack_require__(7);\r\n\texports.createReportSchema = __webpack_require__(8);\r\n\texports.saveAsParametersSchema = __webpack_require__(9);\r\n\t/* tslint:enable:no-var-requires */\r\n\tvar jsen = __webpack_require__(10);\r\n\tfunction normalizeError(error) {\r\n\t var message = error.message;\r\n\t if (!message) {\r\n\t message = error.path + \" is invalid. Not meeting \" + error.keyword + \" constraint\";\r\n\t }\r\n\t return {\r\n\t message: message\r\n\t };\r\n\t}\r\n\t/**\r\n\t * Takes in schema and returns function which can be used to validate the schema with better semantics around exposing errors\r\n\t */\r\n\tfunction validate(schema, options) {\r\n\t return function (x) {\r\n\t var validate = jsen(schema, options);\r\n\t var isValid = validate(x);\r\n\t if (isValid) {\r\n\t return undefined;\r\n\t }\r\n\t else {\r\n\t return validate.errors\r\n\t .map(normalizeError);\r\n\t }\r\n\t };\r\n\t}\r\n\texports.validateSettings = validate(exports.settingsSchema, {\r\n\t schemas: {\r\n\t basicFilter: exports.basicFilterSchema,\r\n\t advancedFilter: exports.advancedFilterSchema\r\n\t }\r\n\t});\r\n\texports.validateReportLoad = validate(exports.loadSchema, {\r\n\t schemas: {\r\n\t settings: exports.settingsSchema,\r\n\t basicFilter: exports.basicFilterSchema,\r\n\t advancedFilter: exports.advancedFilterSchema\r\n\t }\r\n\t});\r\n\texports.validateCreateReport = validate(exports.createReportSchema);\r\n\texports.validateDashboardLoad = validate(exports.dashboardLoadSchema);\r\n\texports.validatePage = validate(exports.pageSchema);\r\n\texports.validateFilter = validate(exports.filterSchema, {\r\n\t schemas: {\r\n\t basicFilter: exports.basicFilterSchema,\r\n\t advancedFilter: exports.advancedFilterSchema\r\n\t }\r\n\t});\r\n\t(function (FilterType) {\r\n\t FilterType[FilterType[\"Advanced\"] = 0] = \"Advanced\";\r\n\t FilterType[FilterType[\"Basic\"] = 1] = \"Basic\";\r\n\t FilterType[FilterType[\"Unknown\"] = 2] = \"Unknown\";\r\n\t})(exports.FilterType || (exports.FilterType = {}));\r\n\tvar FilterType = exports.FilterType;\r\n\tfunction isFilterKeyColumnsTarget(target) {\r\n\t return isColumn(target) && !!target.keys;\r\n\t}\r\n\texports.isFilterKeyColumnsTarget = isFilterKeyColumnsTarget;\r\n\tfunction isBasicFilterWithKeys(filter) {\r\n\t return getFilterType(filter) === FilterType.Basic && !!filter.keyValues;\r\n\t}\r\n\texports.isBasicFilterWithKeys = isBasicFilterWithKeys;\r\n\tfunction getFilterType(filter) {\r\n\t var basicFilter = filter;\r\n\t var advancedFilter = filter;\r\n\t if ((typeof basicFilter.operator === \"string\")\r\n\t && (Array.isArray(basicFilter.values))) {\r\n\t return FilterType.Basic;\r\n\t }\r\n\t else if ((typeof advancedFilter.logicalOperator === \"string\")\r\n\t && (Array.isArray(advancedFilter.conditions))) {\r\n\t return FilterType.Advanced;\r\n\t }\r\n\t else {\r\n\t return FilterType.Unknown;\r\n\t }\r\n\t}\r\n\texports.getFilterType = getFilterType;\r\n\tfunction isMeasure(arg) {\r\n\t return arg.table !== undefined && arg.measure !== undefined;\r\n\t}\r\n\texports.isMeasure = isMeasure;\r\n\tfunction isColumn(arg) {\r\n\t return arg.table !== undefined && arg.column !== undefined;\r\n\t}\r\n\texports.isColumn = isColumn;\r\n\tfunction isHierarchy(arg) {\r\n\t return arg.table !== undefined && arg.hierarchy !== undefined && arg.hierarchyLevel !== undefined;\r\n\t}\r\n\texports.isHierarchy = isHierarchy;\r\n\tvar Filter = (function () {\r\n\t function Filter(target) {\r\n\t this.target = target;\r\n\t }\r\n\t Filter.prototype.toJSON = function () {\r\n\t return {\r\n\t $schema: this.schemaUrl,\r\n\t target: this.target\r\n\t };\r\n\t };\r\n\t ;\r\n\t return Filter;\r\n\t}());\r\n\texports.Filter = Filter;\r\n\tvar BasicFilter = (function (_super) {\r\n\t __extends(BasicFilter, _super);\r\n\t function BasicFilter(target, operator) {\r\n\t var values = [];\r\n\t for (var _i = 2; _i < arguments.length; _i++) {\r\n\t values[_i - 2] = arguments[_i];\r\n\t }\r\n\t _super.call(this, target);\r\n\t this.operator = operator;\r\n\t this.schemaUrl = BasicFilter.schemaUrl;\r\n\t if (values.length === 0 && operator !== \"All\") {\r\n\t throw new Error(\"values must be a non-empty array unless your operator is \\\"All\\\".\");\r\n\t }\r\n\t /**\r\n\t * Accept values as array instead of as individual arguments\r\n\t * new BasicFilter('a', 'b', 1, 2);\r\n\t * new BasicFilter('a', 'b', [1,2]);\r\n\t */\r\n\t if (Array.isArray(values[0])) {\r\n\t this.values = values[0];\r\n\t }\r\n\t else {\r\n\t this.values = values;\r\n\t }\r\n\t }\r\n\t BasicFilter.prototype.toJSON = function () {\r\n\t var filter = _super.prototype.toJSON.call(this);\r\n\t filter.operator = this.operator;\r\n\t filter.values = this.values;\r\n\t return filter;\r\n\t };\r\n\t BasicFilter.schemaUrl = \"http://powerbi.com/product/schema#basic\";\r\n\t return BasicFilter;\r\n\t}(Filter));\r\n\texports.BasicFilter = BasicFilter;\r\n\tvar BasicFilterWithKeys = (function (_super) {\r\n\t __extends(BasicFilterWithKeys, _super);\r\n\t function BasicFilterWithKeys(target, operator, values, keyValues) {\r\n\t _super.call(this, target, operator, values);\r\n\t this.keyValues = keyValues;\r\n\t this.target = target;\r\n\t var numberOfKeys = target.keys ? target.keys.length : 0;\r\n\t if (numberOfKeys > 0 && !keyValues) {\r\n\t throw new Error(\"You shold pass the values to be filtered for each key. You passed: no values and \" + numberOfKeys + \" keys\");\r\n\t }\r\n\t if (numberOfKeys === 0 && keyValues && keyValues.length > 0) {\r\n\t throw new Error(\"You passed key values but your target object doesn't contain the keys to be filtered\");\r\n\t }\r\n\t for (var i = 0; i < this.keyValues.length; i++) {\r\n\t if (this.keyValues[i]) {\r\n\t var lengthOfArray = this.keyValues[i].length;\r\n\t if (lengthOfArray !== numberOfKeys) {\r\n\t throw new Error(\"Each tuple of key values should contain a value for each of the keys. You passed: \" + lengthOfArray + \" values and \" + numberOfKeys + \" keys\");\r\n\t }\r\n\t }\r\n\t }\r\n\t }\r\n\t BasicFilterWithKeys.prototype.toJSON = function () {\r\n\t var filter = _super.prototype.toJSON.call(this);\r\n\t filter.keyValues = this.keyValues;\r\n\t return filter;\r\n\t };\r\n\t return BasicFilterWithKeys;\r\n\t}(BasicFilter));\r\n\texports.BasicFilterWithKeys = BasicFilterWithKeys;\r\n\tvar AdvancedFilter = (function (_super) {\r\n\t __extends(AdvancedFilter, _super);\r\n\t function AdvancedFilter(target, logicalOperator) {\r\n\t var conditions = [];\r\n\t for (var _i = 2; _i < arguments.length; _i++) {\r\n\t conditions[_i - 2] = arguments[_i];\r\n\t }\r\n\t _super.call(this, target);\r\n\t this.schemaUrl = AdvancedFilter.schemaUrl;\r\n\t // Guard statements\r\n\t if (typeof logicalOperator !== \"string\" || logicalOperator.length === 0) {\r\n\t // TODO: It would be nicer to list out the possible logical operators.\r\n\t throw new Error(\"logicalOperator must be a valid operator, You passed: \" + logicalOperator);\r\n\t }\r\n\t this.logicalOperator = logicalOperator;\r\n\t var extractedConditions;\r\n\t /**\r\n\t * Accept conditions as array instead of as individual arguments\r\n\t * new AdvancedFilter('a', 'b', \"And\", { value: 1, operator: \"Equals\" }, { value: 2, operator: \"IsGreaterThan\" });\r\n\t * new AdvancedFilter('a', 'b', \"And\", [{ value: 1, operator: \"Equals\" }, { value: 2, operator: \"IsGreaterThan\" }]);\r\n\t */\r\n\t if (Array.isArray(conditions[0])) {\r\n\t extractedConditions = conditions[0];\r\n\t }\r\n\t else {\r\n\t extractedConditions = conditions;\r\n\t }\r\n\t if (extractedConditions.length === 0) {\r\n\t throw new Error(\"conditions must be a non-empty array. You passed: \" + conditions);\r\n\t }\r\n\t if (extractedConditions.length > 2) {\r\n\t throw new Error(\"AdvancedFilters may not have more than two conditions. You passed: \" + conditions.length);\r\n\t }\r\n\t if (extractedConditions.length === 1 && logicalOperator !== \"And\") {\r\n\t throw new Error(\"Logical Operator must be \\\"And\\\" when there is only one condition provided\");\r\n\t }\r\n\t this.conditions = extractedConditions;\r\n\t }\r\n\t AdvancedFilter.prototype.toJSON = function () {\r\n\t var filter = _super.prototype.toJSON.call(this);\r\n\t filter.logicalOperator = this.logicalOperator;\r\n\t filter.conditions = this.conditions;\r\n\t return filter;\r\n\t };\r\n\t AdvancedFilter.schemaUrl = \"http://powerbi.com/product/schema#advanced\";\r\n\t return AdvancedFilter;\r\n\t}(Filter));\r\n\texports.AdvancedFilter = AdvancedFilter;\r\n\t(function (Permissions) {\r\n\t Permissions[Permissions[\"Read\"] = 0] = \"Read\";\r\n\t Permissions[Permissions[\"ReadWrite\"] = 1] = \"ReadWrite\";\r\n\t Permissions[Permissions[\"Copy\"] = 2] = \"Copy\";\r\n\t Permissions[Permissions[\"Create\"] = 4] = \"Create\";\r\n\t Permissions[Permissions[\"All\"] = 7] = \"All\";\r\n\t})(exports.Permissions || (exports.Permissions = {}));\r\n\tvar Permissions = exports.Permissions;\r\n\t(function (ViewMode) {\r\n\t ViewMode[ViewMode[\"View\"] = 0] = \"View\";\r\n\t ViewMode[ViewMode[\"Edit\"] = 1] = \"Edit\";\r\n\t})(exports.ViewMode || (exports.ViewMode = {}));\r\n\tvar ViewMode = exports.ViewMode;\r\n\texports.validateSaveAsParameters = validate(exports.saveAsParametersSchema);\r\n\n\n/***/ },\n/* 1 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"target\": {\n\t\t\t\t\"oneOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\t\"table\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"column\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"required\": [\n\t\t\t\t\t\t\t\"table\",\n\t\t\t\t\t\t\t\"column\"\n\t\t\t\t\t\t]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\t\"table\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"hierarchy\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"hierarchyLevel\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"required\": [\n\t\t\t\t\t\t\t\"table\",\n\t\t\t\t\t\t\t\"hierarchy\",\n\t\t\t\t\t\t\t\"hierarchyLevel\"\n\t\t\t\t\t\t]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\t\"table\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"measure\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"required\": [\n\t\t\t\t\t\t\t\"table\",\n\t\t\t\t\t\t\t\"measure\"\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"logicalOperator\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"conditions\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\"value\": {\n\t\t\t\t\t\t\t\"type\": [\n\t\t\t\t\t\t\t\t\"string\",\n\t\t\t\t\t\t\t\t\"boolean\",\n\t\t\t\t\t\t\t\t\"number\"\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"operator\": {\n\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\"required\": [\n\t\t\t\t\t\t\"value\",\n\t\t\t\t\t\t\"operator\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"target\",\n\t\t\t\"logicalOperator\",\n\t\t\t\"conditions\"\n\t\t]\n\t};\n\n/***/ },\n/* 2 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"oneOf\": [\n\t\t\t{\n\t\t\t\t\"$ref\": \"#basicFilter\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"$ref\": \"#advancedFilter\"\n\t\t\t}\n\t\t],\n\t\t\"invalidMessage\": \"filter is invalid\"\n\t};\n\n/***/ },\n/* 3 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"accessToken\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"accessToken must be a string\",\n\t\t\t\t\t\"required\": \"accessToken is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"id\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"id must be a string\",\n\t\t\t\t\t\"required\": \"id is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"settings\": {\n\t\t\t\t\"$ref\": \"#settings\"\n\t\t\t},\n\t\t\t\"pageName\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"pageName must be a string\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"filters\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\"oneOf\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"$ref\": \"#basicFilter\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"$ref\": \"#advancedFilter\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t\"invalidMessage\": \"filters property is invalid\"\n\t\t\t},\n\t\t\t\"permissions\": {\n\t\t\t\t\"type\": \"number\",\n\t\t\t\t\"enum\": [\n\t\t\t\t\t0,\n\t\t\t\t\t1,\n\t\t\t\t\t2,\n\t\t\t\t\t3\n\t\t\t\t],\n\t\t\t\t\"default\": 0,\n\t\t\t\t\"invalidMessage\": \"permissions property is invalid\"\n\t\t\t},\n\t\t\t\"viewMode\": {\n\t\t\t\t\"type\": \"number\",\n\t\t\t\t\"enum\": [\n\t\t\t\t\t0,\n\t\t\t\t\t1\n\t\t\t\t],\n\t\t\t\t\"default\": 0,\n\t\t\t\t\"invalidMessage\": \"viewMode property is invalid\"\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"accessToken\",\n\t\t\t\"id\"\n\t\t]\n\t};\n\n/***/ },\n/* 4 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"accessToken\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"accessToken must be a string\",\n\t\t\t\t\t\"required\": \"accessToken is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"id\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"id must be a string\",\n\t\t\t\t\t\"required\": \"id is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"pageView\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"pageView must be a string with one of the following values: \\\"actualSize\\\", \\\"fitToWidth\\\", \\\"oneColumn\\\"\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"accessToken\",\n\t\t\t\"id\"\n\t\t]\n\t};\n\n/***/ },\n/* 5 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"name\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"name must be a string\",\n\t\t\t\t\t\"required\": \"name is required\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"name\"\n\t\t]\n\t};\n\n/***/ },\n/* 6 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"filterPaneEnabled\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"filterPaneEnabled must be a boolean\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"navContentPaneEnabled\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"navContentPaneEnabled must be a boolean\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"useCustomSaveAsDialog\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"useCustomSaveAsDialog must be a boolean\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n/***/ },\n/* 7 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"target\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"properties\": {\n\t\t\t\t\t\"table\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"column\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"hierarchy\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"hierarchyLevel\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"measure\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"required\": [\n\t\t\t\t\t\"table\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"operator\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"values\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"type\": [\n\t\t\t\t\t\t\"string\",\n\t\t\t\t\t\t\"boolean\",\n\t\t\t\t\t\t\"number\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"target\",\n\t\t\t\"operator\",\n\t\t\t\"values\"\n\t\t]\n\t};\n\n/***/ },\n/* 8 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"accessToken\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"accessToken must be a string\",\n\t\t\t\t\t\"required\": \"accessToken is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"datasetId\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"datasetId must be a string\",\n\t\t\t\t\t\"required\": \"datasetId is required\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"accessToken\",\n\t\t\t\"datasetId\"\n\t\t]\n\t};\n\n/***/ },\n/* 9 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"name\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"name must be a string\",\n\t\t\t\t\t\"required\": \"name is required\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"name\"\n\t\t]\n\t};\n\n/***/ },\n/* 10 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = __webpack_require__(11);\n\n/***/ },\n/* 11 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar REGEX_ESCAPE_EXPR = /[\\/]/g,\n\t STR_ESCAPE_EXPR = /(\")/gim,\n\t VALID_IDENTIFIER_EXPR = /^[a-z_$][0-9a-z]*$/gi,\n\t INVALID_SCHEMA = 'jsen: invalid schema object',\n\t browser = typeof window === 'object' && !!window.navigator, // jshint ignore: line\n\t regescape = new RegExp('/').source !== '/', // node v0.x does not properly escape '/'s in inline regex\n\t func = __webpack_require__(12),\n\t equal = __webpack_require__(13),\n\t unique = __webpack_require__(14),\n\t SchemaResolver = __webpack_require__(15),\n\t formats = __webpack_require__(24),\n\t ucs2length = __webpack_require__(25),\n\t types = {},\n\t keywords = {};\n\t\n\tfunction inlineRegex(regex) {\n\t regex = regex instanceof RegExp ? regex : new RegExp(regex);\n\t\n\t return regescape ?\n\t regex.toString() :\n\t '/' + regex.source.replace(REGEX_ESCAPE_EXPR, '\\\\$&') + '/';\n\t}\n\t\n\tfunction encodeStr(str) {\n\t return '\"' + str.replace(STR_ESCAPE_EXPR, '\\\\$1') + '\"';\n\t}\n\t\n\tfunction appendToPath(path, key) {\n\t VALID_IDENTIFIER_EXPR.lastIndex = 0;\n\t\n\t return VALID_IDENTIFIER_EXPR.test(key) ?\n\t path + '.' + key :\n\t path + '[' + encodeStr(key) + ']';\n\t}\n\t\n\tfunction type(obj) {\n\t if (obj === undefined) {\n\t return 'undefined';\n\t }\n\t\n\t var str = Object.prototype.toString.call(obj);\n\t return str.substr(8, str.length - 9).toLowerCase();\n\t}\n\t\n\tfunction isInteger(obj) {\n\t return (obj | 0) === obj; // jshint ignore: line\n\t}\n\t\n\ttypes['null'] = function (path) {\n\t return path + ' === null';\n\t};\n\t\n\ttypes.boolean = function (path) {\n\t return 'typeof ' + path + ' === \"boolean\"';\n\t};\n\t\n\ttypes.string = function (path) {\n\t return 'typeof ' + path + ' === \"string\"';\n\t};\n\t\n\ttypes.number = function (path) {\n\t return 'typeof ' + path + ' === \"number\"';\n\t};\n\t\n\ttypes.integer = function (path) {\n\t return 'typeof ' + path + ' === \"number\" && !(' + path + ' % 1)';\n\t};\n\t\n\ttypes.array = function (path) {\n\t return 'Array.isArray(' + path + ')';\n\t};\n\t\n\ttypes.object = function (path) {\n\t return 'typeof ' + path + ' === \"object\" && ' + path + ' !== null && !Array.isArray(' + path + ')';\n\t};\n\t\n\ttypes.date = function (path) {\n\t return path + ' instanceof Date';\n\t};\n\t\n\tkeywords.enum = function (context) {\n\t var arr = context.schema['enum'];\n\t\n\t context.code('if (!equalAny(' + context.path + ', ' + JSON.stringify(arr) + ')) {');\n\t context.error('enum');\n\t context.code('}');\n\t};\n\t\n\tkeywords.minimum = function (context) {\n\t if (typeof context.schema.minimum === 'number') {\n\t context.code('if (' + context.path + ' < ' + context.schema.minimum + ') {');\n\t context.error('minimum');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.exclusiveMinimum = function (context) {\n\t if (context.schema.exclusiveMinimum === true && typeof context.schema.minimum === 'number') {\n\t context.code('if (' + context.path + ' === ' + context.schema.minimum + ') {');\n\t context.error('exclusiveMinimum');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.maximum = function (context) {\n\t if (typeof context.schema.maximum === 'number') {\n\t context.code('if (' + context.path + ' > ' + context.schema.maximum + ') {');\n\t context.error('maximum');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.exclusiveMaximum = function (context) {\n\t if (context.schema.exclusiveMaximum === true && typeof context.schema.maximum === 'number') {\n\t context.code('if (' + context.path + ' === ' + context.schema.maximum + ') {');\n\t context.error('exclusiveMaximum');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.multipleOf = function (context) {\n\t if (typeof context.schema.multipleOf === 'number') {\n\t var mul = context.schema.multipleOf,\n\t decimals = mul.toString().length - mul.toFixed(0).length - 1,\n\t pow = decimals > 0 ? Math.pow(10, decimals) : 1,\n\t path = context.path;\n\t\n\t if (decimals > 0) {\n\t context.code('if (+(Math.round((' + path + ' * ' + pow + ') + \"e+\" + ' + decimals + ') + \"e-\" + ' + decimals + ') % ' + (mul * pow) + ' !== 0) {');\n\t } else {\n\t context.code('if (((' + path + ' * ' + pow + ') % ' + (mul * pow) + ') !== 0) {');\n\t }\n\t\n\t context.error('multipleOf');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.minLength = function (context) {\n\t if (isInteger(context.schema.minLength)) {\n\t context.code('if (ucs2length(' + context.path + ') < ' + context.schema.minLength + ') {');\n\t context.error('minLength');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.maxLength = function (context) {\n\t if (isInteger(context.schema.maxLength)) {\n\t context.code('if (ucs2length(' + context.path + ') > ' + context.schema.maxLength + ') {');\n\t context.error('maxLength');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.pattern = function (context) {\n\t var pattern = context.schema.pattern;\n\t\n\t if (typeof pattern === 'string' || pattern instanceof RegExp) {\n\t context.code('if (!(' + inlineRegex(pattern) + ').test(' + context.path + ')) {');\n\t context.error('pattern');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.format = function (context) {\n\t if (typeof context.schema.format !== 'string' || !formats[context.schema.format]) {\n\t return;\n\t }\n\t\n\t context.code('if (!(' + formats[context.schema.format] + ').test(' + context.path + ')) {');\n\t context.error('format');\n\t context.code('}');\n\t};\n\t\n\tkeywords.minItems = function (context) {\n\t if (isInteger(context.schema.minItems)) {\n\t context.code('if (' + context.path + '.length < ' + context.schema.minItems + ') {');\n\t context.error('minItems');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.maxItems = function (context) {\n\t if (isInteger(context.schema.maxItems)) {\n\t context.code('if (' + context.path + '.length > ' + context.schema.maxItems + ') {');\n\t context.error('maxItems');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.additionalItems = function (context) {\n\t if (context.schema.additionalItems === false && Array.isArray(context.schema.items)) {\n\t context.code('if (' + context.path + '.length > ' + context.schema.items.length + ') {');\n\t context.error('additionalItems');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.uniqueItems = function (context) {\n\t if (context.schema.uniqueItems) {\n\t context.code('if (unique(' + context.path + ').length !== ' + context.path + '.length) {');\n\t context.error('uniqueItems');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.items = function (context) {\n\t var index = context.declare(0),\n\t i = 0;\n\t\n\t if (type(context.schema.items) === 'object') {\n\t context.code('for (' + index + ' = 0; ' + index + ' < ' + context.path + '.length; ' + index + '++) {');\n\t\n\t context.descend(context.path + '[' + index + ']', context.schema.items);\n\t\n\t context.code('}');\n\t }\n\t else if (Array.isArray(context.schema.items)) {\n\t for (; i < context.schema.items.length; i++) {\n\t context.code('if (' + context.path + '.length - 1 >= ' + i + ') {');\n\t\n\t context.descend(context.path + '[' + i + ']', context.schema.items[i]);\n\t\n\t context.code('}');\n\t }\n\t\n\t if (type(context.schema.additionalItems) === 'object') {\n\t context.code('for (' + index + ' = ' + i + '; ' + index + ' < ' + context.path + '.length; ' + index + '++) {');\n\t\n\t context.descend(context.path + '[' + index + ']', context.schema.additionalItems);\n\t\n\t context.code('}');\n\t }\n\t }\n\t};\n\t\n\tkeywords.maxProperties = function (context) {\n\t if (isInteger(context.schema.maxProperties)) {\n\t context.code('if (Object.keys(' + context.path + ').length > ' + context.schema.maxProperties + ') {');\n\t context.error('maxProperties');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.minProperties = function (context) {\n\t if (isInteger(context.schema.minProperties)) {\n\t context.code('if (Object.keys(' + context.path + ').length < ' + context.schema.minProperties + ') {');\n\t context.error('minProperties');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.required = function (context) {\n\t if (!Array.isArray(context.schema.required)) {\n\t return;\n\t }\n\t\n\t for (var i = 0; i < context.schema.required.length; i++) {\n\t context.code('if (' + appendToPath(context.path, context.schema.required[i]) + ' === undefined) {');\n\t context.error('required', context.schema.required[i]);\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.properties = function (context) {\n\t var props = context.schema.properties,\n\t propKeys = type(props) === 'object' ? Object.keys(props) : [],\n\t required = Array.isArray(context.schema.required) ? context.schema.required : [],\n\t prop, i, nestedPath;\n\t\n\t if (!propKeys.length) {\n\t return;\n\t }\n\t\n\t for (i = 0; i < propKeys.length; i++) {\n\t prop = propKeys[i];\n\t nestedPath = appendToPath(context.path, prop);\n\t\n\t context.code('if (' + nestedPath + ' !== undefined) {');\n\t\n\t context.descend(nestedPath, props[prop]);\n\t\n\t context.code('}');\n\t\n\t if (required.indexOf(prop) > -1) {\n\t context.code('else {');\n\t context.error('required', prop);\n\t context.code('}');\n\t }\n\t }\n\t};\n\t\n\tkeywords.patternProperties = keywords.additionalProperties = function (context) {\n\t var propKeys = type(context.schema.properties) === 'object' ?\n\t Object.keys(context.schema.properties) : [],\n\t patProps = context.schema.patternProperties,\n\t patterns = type(patProps) === 'object' ? Object.keys(patProps) : [],\n\t addProps = context.schema.additionalProperties,\n\t addPropsCheck = addProps === false || type(addProps) === 'object',\n\t props, keys, key, n, found, pattern, i;\n\t\n\t if (!patterns.length && !addPropsCheck) {\n\t return;\n\t }\n\t\n\t keys = context.declare('[]');\n\t key = context.declare('\"\"');\n\t n = context.declare(0);\n\t\n\t if (addPropsCheck) {\n\t found = context.declare(false);\n\t }\n\t\n\t context.code(keys + ' = Object.keys(' + context.path + ')');\n\t\n\t context.code('for (' + n + ' = 0; ' + n + ' < ' + keys + '.length; ' + n + '++) {')\n\t (key + ' = ' + keys + '[' + n + ']')\n\t\n\t ('if (' + context.path + '[' + key + '] === undefined) {')\n\t ('continue')\n\t ('}');\n\t\n\t if (addPropsCheck) {\n\t context.code(found + ' = false');\n\t }\n\t\n\t // validate pattern properties\n\t for (i = 0; i < patterns.length; i++) {\n\t pattern = patterns[i];\n\t\n\t context.code('if ((' + inlineRegex(pattern) + ').test(' + key + ')) {');\n\t\n\t context.descend(context.path + '[' + key + ']', patProps[pattern]);\n\t\n\t if (addPropsCheck) {\n\t context.code(found + ' = true');\n\t }\n\t\n\t context.code('}');\n\t }\n\t\n\t // validate additional properties\n\t if (addPropsCheck) {\n\t if (propKeys.length) {\n\t props = context.declare(JSON.stringify(propKeys));\n\t\n\t // do not validate regular properties\n\t context.code('if (' + props + '.indexOf(' + key + ') > -1) {')\n\t ('continue')\n\t ('}');\n\t }\n\t\n\t context.code('if (!' + found + ') {');\n\t\n\t if (addProps === false) {\n\t // do not allow additional properties\n\t context.error('additionalProperties', undefined, key);\n\t }\n\t else {\n\t // validate additional properties\n\t context.descend(context.path + '[' + key + ']', addProps);\n\t }\n\t\n\t context.code('}');\n\t }\n\t\n\t context.code('}');\n\t};\n\t\n\tkeywords.dependencies = function (context) {\n\t if (type(context.schema.dependencies) !== 'object') {\n\t return;\n\t }\n\t\n\t var depKeys = Object.keys(context.schema.dependencies),\n\t len = depKeys.length,\n\t key, dep, i = 0, k = 0;\n\t\n\t for (; k < len; k++) {\n\t key = depKeys[k];\n\t dep = context.schema.dependencies[key];\n\t\n\t context.code('if (' + appendToPath(context.path, key) + ' !== undefined) {');\n\t\n\t if (type(dep) === 'object') {\n\t //schema dependency\n\t context.descend(context.path, dep);\n\t }\n\t else {\n\t // property dependency\n\t for (i; i < dep.length; i++) {\n\t context.code('if (' + appendToPath(context.path, dep[i]) + ' === undefined) {');\n\t context.error('dependencies', dep[i]);\n\t context.code('}');\n\t }\n\t }\n\t\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.allOf = function (context) {\n\t if (!Array.isArray(context.schema.allOf)) {\n\t return;\n\t }\n\t\n\t for (var i = 0; i < context.schema.allOf.length; i++) {\n\t context.descend(context.path, context.schema.allOf[i]);\n\t }\n\t};\n\t\n\tkeywords.anyOf = function (context) {\n\t if (!Array.isArray(context.schema.anyOf)) {\n\t return;\n\t }\n\t\n\t var greedy = context.greedy,\n\t errCount = context.declare(0),\n\t initialCount = context.declare(0),\n\t found = context.declare(false),\n\t i = 0;\n\t\n\t context.code(initialCount + ' = errors.length');\n\t\n\t for (; i < context.schema.anyOf.length; i++) {\n\t context.code('if (!' + found + ') {');\n\t\n\t context.code(errCount + ' = errors.length');\n\t\n\t context.greedy = true;\n\t\n\t context.descend(context.path, context.schema.anyOf[i]);\n\t\n\t context.code(found + ' = errors.length === ' + errCount)\n\t ('}');\n\t }\n\t\n\t context.greedy = greedy;\n\t\n\t context.code('if (!' + found + ') {');\n\t\n\t context.error('anyOf');\n\t\n\t context.code('} else {')\n\t ('errors.length = ' + initialCount)\n\t ('}');\n\t};\n\t\n\tkeywords.oneOf = function (context) {\n\t if (!Array.isArray(context.schema.oneOf)) {\n\t return;\n\t }\n\t\n\t var greedy = context.greedy,\n\t matching = context.declare(0),\n\t initialCount = context.declare(0),\n\t errCount = context.declare(0),\n\t i = 0;\n\t\n\t context.code(initialCount + ' = errors.length');\n\t context.code(matching + ' = 0');\n\t\n\t for (; i < context.schema.oneOf.length; i++) {\n\t context.code(errCount + ' = errors.length');\n\t\n\t context.greedy = true;\n\t\n\t context.descend(context.path, context.schema.oneOf[i]);\n\t\n\t context.code('if (errors.length === ' + errCount + ') {')\n\t (matching + '++')\n\t ('}');\n\t }\n\t\n\t context.greedy = greedy;\n\t\n\t context.code('if (' + matching + ' !== 1) {');\n\t\n\t context.error('oneOf');\n\t\n\t context.code('} else {')\n\t ('errors.length = ' + initialCount)\n\t ('}');\n\t};\n\t\n\tkeywords.not = function (context) {\n\t if (type(context.schema.not) !== 'object') {\n\t return;\n\t }\n\t\n\t var greedy = context.greedy,\n\t errCount = context.declare(0);\n\t\n\t context.code(errCount + ' = errors.length');\n\t\n\t context.greedy = true;\n\t\n\t context.descend(context.path, context.schema.not);\n\t\n\t context.greedy = greedy;\n\t\n\t context.code('if (errors.length === ' + errCount + ') {');\n\t\n\t context.error('not');\n\t\n\t context.code('} else {')\n\t ('errors.length = ' + errCount)\n\t ('}');\n\t};\n\t\n\tfunction decorateGenerator(type, keyword) {\n\t keywords[keyword].type = type;\n\t keywords[keyword].keyword = keyword;\n\t}\n\t\n\t['minimum', 'exclusiveMinimum', 'maximum', 'exclusiveMaximum', 'multipleOf']\n\t .forEach(decorateGenerator.bind(null, 'number'));\n\t\n\t['minLength', 'maxLength', 'pattern', 'format']\n\t .forEach(decorateGenerator.bind(null, 'string'));\n\t\n\t['minItems', 'maxItems', 'additionalItems', 'uniqueItems', 'items']\n\t .forEach(decorateGenerator.bind(null, 'array'));\n\t\n\t['maxProperties', 'minProperties', 'required', 'properties', 'patternProperties', 'additionalProperties', 'dependencies']\n\t .forEach(decorateGenerator.bind(null, 'object'));\n\t\n\t['enum', 'allOf', 'anyOf', 'oneOf', 'not']\n\t .forEach(decorateGenerator.bind(null, null));\n\t\n\tfunction groupKeywords(schema) {\n\t var keys = Object.keys(schema),\n\t propIndex = keys.indexOf('properties'),\n\t patIndex = keys.indexOf('patternProperties'),\n\t ret = {\n\t enum: Array.isArray(schema.enum) && schema.enum.length > 0,\n\t type: null,\n\t allType: [],\n\t perType: {}\n\t },\n\t key, gen, i;\n\t\n\t if (schema.type) {\n\t if (typeof schema.type === 'string') {\n\t ret.type = [schema.type];\n\t }\n\t else if (Array.isArray(schema.type) && schema.type.length) {\n\t ret.type = schema.type.slice(0);\n\t }\n\t }\n\t\n\t for (i = 0; i < keys.length; i++) {\n\t key = keys[i];\n\t\n\t if (key === 'enum' || key === 'type') {\n\t continue;\n\t }\n\t\n\t gen = keywords[key];\n\t\n\t if (!gen) {\n\t continue;\n\t }\n\t\n\t if (gen.type) {\n\t if (!ret.perType[gen.type]) {\n\t ret.perType[gen.type] = [];\n\t }\n\t\n\t if (!(propIndex > -1 && key === 'required') &&\n\t !(patIndex > -1 && key === 'additionalProperties')) {\n\t ret.perType[gen.type].push(key);\n\t }\n\t }\n\t else {\n\t ret.allType.push(key);\n\t }\n\t }\n\t\n\t return ret;\n\t}\n\t\n\tfunction getPathExpression(path, key) {\n\t var path_ = path.substr(4),\n\t len = path_.length,\n\t tokens = [],\n\t token = '',\n\t isvar = false,\n\t char, i;\n\t\n\t for (i = 0; i < len; i++) {\n\t char = path_[i];\n\t\n\t switch (char) {\n\t case '.':\n\t if (token) {\n\t token += char;\n\t }\n\t break;\n\t case '[':\n\t if (isNaN(+path_[i + 1])) {\n\t isvar = true;\n\t\n\t if (token) {\n\t tokens.push('\"' + token + '\"');\n\t token = '';\n\t }\n\t }\n\t else {\n\t isvar = false;\n\t\n\t if (token) {\n\t token += '.';\n\t }\n\t }\n\t break;\n\t case ']':\n\t tokens.push(isvar ? token : '\"' + token + '\"');\n\t token = '';\n\t break;\n\t default:\n\t token += char;\n\t }\n\t }\n\t\n\t if (token) {\n\t tokens.push('\"' + token + '\"');\n\t }\n\t\n\t if (key) {\n\t tokens.push('\"' + key + '\"');\n\t }\n\t\n\t if (tokens.length === 1 && isvar) {\n\t return '\"\" + ' + tokens[0] + ' + \"\"';\n\t }\n\t\n\t return tokens.join(' + \".\" + ') || '\"\"';\n\t}\n\t\n\tfunction clone(obj) {\n\t var cloned = obj,\n\t objType = type(obj),\n\t keys, len, key, i;\n\t\n\t if (objType === 'object') {\n\t cloned = {};\n\t keys = Object.keys(obj);\n\t\n\t for (i = 0, len = keys.length; i < len; i++) {\n\t key = keys[i];\n\t cloned[key] = clone(obj[key]);\n\t }\n\t }\n\t else if (objType === 'array') {\n\t cloned = [];\n\t\n\t for (i = 0, len = obj.length; i < len; i++) {\n\t cloned[i] = clone(obj[i]);\n\t }\n\t }\n\t else if (objType === 'regexp') {\n\t return new RegExp(obj);\n\t }\n\t else if (objType === 'date') {\n\t return new Date(obj.toJSON());\n\t }\n\t\n\t return cloned;\n\t}\n\t\n\tfunction equalAny(obj, options) {\n\t for (var i = 0, len = options.length; i < len; i++) {\n\t if (equal(obj, options[i])) {\n\t return true;\n\t }\n\t }\n\t\n\t return false;\n\t}\n\t\n\tfunction PropertyMarker() {\n\t this.objects = [];\n\t this.properties = [];\n\t}\n\t\n\tPropertyMarker.prototype.mark = function (obj, key) {\n\t var index = this.objects.indexOf(obj),\n\t prop;\n\t\n\t if (index < 0) {\n\t this.objects.push(obj);\n\t\n\t prop = {};\n\t prop[key] = 1;\n\t\n\t this.properties.push(prop);\n\t\n\t return;\n\t }\n\t\n\t prop = this.properties[index];\n\t\n\t prop[key] = prop[key] ? prop[key] + 1 : 1;\n\t};\n\t\n\tPropertyMarker.prototype.deleteDuplicates = function () {\n\t var props, keys, key, i, j;\n\t\n\t for (i = 0; i < this.properties.length; i++) {\n\t props = this.properties[i];\n\t keys = Object.keys(props);\n\t\n\t for (j = 0; j < keys.length; j++) {\n\t key = keys[j];\n\t\n\t if (props[key] > 1) {\n\t delete this.objects[i][key];\n\t }\n\t }\n\t }\n\t};\n\t\n\tPropertyMarker.prototype.dispose = function () {\n\t this.objects.length = 0;\n\t this.properties.length = 0;\n\t};\n\t\n\tfunction build(schema, def, additional, resolver, parentMarker) {\n\t var defType, defValue, key, i, propertyMarker, props, defProps;\n\t\n\t if (type(schema) !== 'object') {\n\t return def;\n\t }\n\t\n\t schema = resolver.resolve(schema);\n\t\n\t if (def === undefined && schema.hasOwnProperty('default')) {\n\t def = clone(schema['default']);\n\t }\n\t\n\t defType = type(def);\n\t\n\t if (defType === 'object' && type(schema.properties) === 'object') {\n\t props = Object.keys(schema.properties);\n\t\n\t for (i = 0; i < props.length; i++) {\n\t key = props[i];\n\t defValue = build(schema.properties[key], def[key], additional, resolver);\n\t\n\t if (defValue !== undefined) {\n\t def[key] = defValue;\n\t }\n\t }\n\t\n\t if (additional !== 'always') {\n\t defProps = Object.keys(def);\n\t\n\t for (i = 0; i < defProps.length; i++) {\n\t key = defProps[i];\n\t\n\t if (props.indexOf(key) < 0 &&\n\t (schema.additionalProperties === false ||\n\t (additional === false && !schema.additionalProperties))) {\n\t\n\t if (parentMarker) {\n\t parentMarker.mark(def, key);\n\t }\n\t else {\n\t delete def[key];\n\t }\n\t }\n\t }\n\t }\n\t }\n\t else if (defType === 'array' && schema.items) {\n\t if (type(schema.items) === 'array') {\n\t for (i = 0; i < schema.items.length; i++) {\n\t defValue = build(schema.items[i], def[i], additional, resolver);\n\t\n\t if (defValue !== undefined || i < def.length) {\n\t def[i] = defValue;\n\t }\n\t }\n\t }\n\t else if (def.length) {\n\t for (i = 0; i < def.length; i++) {\n\t def[i] = build(schema.items, def[i], additional, resolver);\n\t }\n\t }\n\t }\n\t else if (type(schema.allOf) === 'array' && schema.allOf.length) {\n\t propertyMarker = new PropertyMarker();\n\t\n\t for (i = 0; i < schema.allOf.length; i++) {\n\t def = build(schema.allOf[i], def, additional, resolver, propertyMarker);\n\t }\n\t\n\t propertyMarker.deleteDuplicates();\n\t propertyMarker.dispose();\n\t }\n\t\n\t return def;\n\t}\n\t\n\tfunction ValidationContext(options) {\n\t this.path = 'data';\n\t this.schema = options.schema;\n\t this.formats = options.formats;\n\t this.greedy = options.greedy;\n\t this.resolver = options.resolver;\n\t this.id = options.id;\n\t this.funcache = options.funcache || {};\n\t this.scope = options.scope || {\n\t equalAny: equalAny,\n\t unique: unique,\n\t ucs2length: ucs2length,\n\t refs: {}\n\t };\n\t}\n\t\n\tValidationContext.prototype.clone = function (schema) {\n\t var ctx = new ValidationContext({\n\t schema: schema,\n\t formats: this.formats,\n\t greedy: this.greedy,\n\t resolver: this.resolver,\n\t id: this.id,\n\t funcache: this.funcache,\n\t scope: this.scope\n\t });\n\t\n\t return ctx;\n\t};\n\t\n\tValidationContext.prototype.declare = function (def) {\n\t var variname = this.id();\n\t this.code.def(variname, def);\n\t return variname;\n\t};\n\t\n\tValidationContext.prototype.cache = function (cacheKey, schema) {\n\t var cached = this.funcache[cacheKey],\n\t context;\n\t\n\t if (!cached) {\n\t cached = this.funcache[cacheKey] = {\n\t key: this.id()\n\t };\n\t\n\t context = this.clone(schema);\n\t\n\t cached.func = context.compile(cached.key);\n\t\n\t this.scope.refs[cached.key] = cached.func;\n\t\n\t context.dispose();\n\t }\n\t\n\t return 'refs.' + cached.key;\n\t};\n\t\n\tValidationContext.prototype.error = function (keyword, key, additional) {\n\t var schema = this.schema,\n\t path = this.path,\n\t errorPath = path !== 'data' || key ?\n\t '(path ? path + \".\" : \"\") + ' + getPathExpression(path, key) + ',' :\n\t 'path,',\n\t res = key && schema.properties && schema.properties[key] ?\n\t this.resolver.resolve(schema.properties[key]) : null,\n\t message = res ? res.requiredMessage : schema.invalidMessage;\n\t\n\t if (!message) {\n\t message = (res && res.messages && res.messages[keyword]) ||\n\t (schema.messages && schema.messages[keyword]);\n\t }\n\t\n\t this.code('errors.push({');\n\t\n\t if (message) {\n\t this.code('message: ' + encodeStr(message) + ',');\n\t }\n\t\n\t if (additional) {\n\t this.code('additionalProperties: ' + additional + ',');\n\t }\n\t\n\t this.code('path: ' + errorPath)\n\t ('keyword: ' + encodeStr(keyword))\n\t ('})');\n\t\n\t if (!this.greedy) {\n\t this.code('return');\n\t }\n\t};\n\t\n\tValidationContext.prototype.refactor = function (path, schema, cacheKey) {\n\t var parentPathExp = path !== 'data' ?\n\t '(path ? path + \".\" : \"\") + ' + getPathExpression(path) :\n\t 'path',\n\t cachedRef = this.cache(cacheKey, schema),\n\t refErrors = this.declare();\n\t\n\t this.code(refErrors + ' = ' + cachedRef + '(' + path + ', ' + parentPathExp + ', errors)');\n\t\n\t if (!this.greedy) {\n\t this.code('if (errors.length) { return }');\n\t }\n\t};\n\t\n\tValidationContext.prototype.descend = function (path, schema) {\n\t var origPath = this.path,\n\t origSchema = this.schema;\n\t\n\t this.path = path;\n\t this.schema = schema;\n\t\n\t this.generate();\n\t\n\t this.path = origPath;\n\t this.schema = origSchema;\n\t};\n\t\n\tValidationContext.prototype.generate = function () {\n\t var path = this.path,\n\t schema = this.schema,\n\t context = this,\n\t scope = this.scope,\n\t encodedFormat,\n\t format,\n\t schemaKeys,\n\t typeKeys,\n\t typeIndex,\n\t validatedType,\n\t i;\n\t\n\t if (type(schema) !== 'object') {\n\t return;\n\t }\n\t\n\t if (schema.$ref !== undefined) {\n\t schema = this.resolver.resolve(schema);\n\t\n\t if (this.resolver.hasRef(schema)) {\n\t this.refactor(path, schema,\n\t this.resolver.getNormalizedRef(this.schema) || this.schema.$ref);\n\t\n\t return;\n\t }\n\t else {\n\t // substitute $ref schema with the resolved instance\n\t this.schema = schema;\n\t }\n\t }\n\t\n\t schemaKeys = groupKeywords(schema);\n\t\n\t if (schemaKeys.enum) {\n\t keywords.enum(context);\n\t\n\t return; // do not process the schema further\n\t }\n\t\n\t typeKeys = Object.keys(schemaKeys.perType);\n\t\n\t function generateForKeyword(keyword) {\n\t keywords[keyword](context); // jshint ignore: line\n\t }\n\t\n\t for (i = 0; i < typeKeys.length; i++) {\n\t validatedType = typeKeys[i];\n\t\n\t this.code((i ? 'else ' : '') + 'if (' + types[validatedType](path) + ') {');\n\t\n\t schemaKeys.perType[validatedType].forEach(generateForKeyword);\n\t\n\t this.code('}');\n\t\n\t if (schemaKeys.type) {\n\t typeIndex = schemaKeys.type.indexOf(validatedType);\n\t\n\t if (typeIndex > -1) {\n\t schemaKeys.type.splice(typeIndex, 1);\n\t }\n\t }\n\t }\n\t\n\t if (schemaKeys.type) { // we have types in the schema\n\t if (schemaKeys.type.length) { // case 1: we still have some left to check\n\t this.code((typeKeys.length ? 'else ' : '') + 'if (!(' + schemaKeys.type.map(function (type) {\n\t return types[type] ? types[type](path) : 'true';\n\t }).join(' || ') + ')) {');\n\t this.error('type');\n\t this.code('}');\n\t }\n\t else {\n\t this.code('else {'); // case 2: we don't have any left to check\n\t this.error('type');\n\t this.code('}');\n\t }\n\t }\n\t\n\t schemaKeys.allType.forEach(function (keyword) {\n\t keywords[keyword](context);\n\t });\n\t\n\t if (schema.format && this.formats) {\n\t format = this.formats[schema.format];\n\t\n\t if (format) {\n\t if (typeof format === 'string' || format instanceof RegExp) {\n\t this.code('if (!(' + inlineRegex(format) + ').test(' + path + ')) {');\n\t this.error('format');\n\t this.code('}');\n\t }\n\t else if (typeof format === 'function') {\n\t (scope.formats || (scope.formats = {}))[schema.format] = format;\n\t (scope.schemas || (scope.schemas = {}))[schema.format] = schema;\n\t\n\t encodedFormat = encodeStr(schema.format);\n\t\n\t this.code('if (!formats[' + encodedFormat + '](' + path + ', schemas[' + encodedFormat + '])) {');\n\t this.error('format');\n\t this.code('}');\n\t }\n\t }\n\t }\n\t};\n\t\n\tValidationContext.prototype.compile = function (id) {\n\t this.code = func('jsen_compiled' + (id ? '_' + id : ''), 'data', 'path', 'errors');\n\t this.generate();\n\t\n\t return this.code.compile(this.scope);\n\t};\n\t\n\tValidationContext.prototype.dispose = function () {\n\t for (var key in this) {\n\t this[key] = undefined;\n\t }\n\t};\n\t\n\tfunction jsen(schema, options) {\n\t if (type(schema) !== 'object') {\n\t throw new Error(INVALID_SCHEMA);\n\t }\n\t\n\t options = options || {};\n\t\n\t var counter = 0,\n\t id = function () { return 'i' + (counter++); },\n\t resolver = new SchemaResolver(schema, options.schemas, options.missing$Ref || false),\n\t context = new ValidationContext({\n\t schema: schema,\n\t resolver: resolver,\n\t id: id,\n\t schemas: options.schemas,\n\t formats: options.formats,\n\t greedy: options.greedy || false\n\t }),\n\t compiled = func('validate', 'data')\n\t ('validate.errors = []')\n\t ('gen(data, \"\", validate.errors)')\n\t ('return validate.errors.length === 0')\n\t .compile({ gen: context.compile() });\n\t\n\t context.dispose();\n\t context = null;\n\t\n\t compiled.errors = [];\n\t\n\t compiled.build = function (initial, options) {\n\t return build(\n\t schema,\n\t (options && options.copy === false ? initial : clone(initial)),\n\t options && options.additionalProperties,\n\t resolver);\n\t };\n\t\n\t return compiled;\n\t}\n\t\n\tjsen.browser = browser;\n\tjsen.clone = clone;\n\tjsen.equal = equal;\n\tjsen.unique = unique;\n\tjsen.ucs2length = ucs2length;\n\tjsen.SchemaResolver = SchemaResolver;\n\tjsen.resolve = SchemaResolver.resolvePointer;\n\t\n\tmodule.exports = jsen;\n\n\n/***/ },\n/* 12 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = function func() {\n\t var args = Array.apply(null, arguments),\n\t name = args.shift(),\n\t tab = ' ',\n\t lines = '',\n\t vars = '',\n\t ind = 1, // indentation\n\t bs = '{[', // block start\n\t be = '}]', // block end\n\t space = function () {\n\t var sp = tab, i = 0;\n\t while (i++ < ind - 1) { sp += tab; }\n\t return sp;\n\t },\n\t add = function (line) {\n\t lines += space() + line + '\\n';\n\t },\n\t builder = function (line) {\n\t var first = line[0],\n\t last = line[line.length - 1];\n\t\n\t if (be.indexOf(first) > -1 && bs.indexOf(last) > -1) {\n\t ind--;\n\t add(line);\n\t ind++;\n\t }\n\t else if (bs.indexOf(last) > -1) {\n\t add(line);\n\t ind++;\n\t }\n\t else if (be.indexOf(first) > -1) {\n\t ind--;\n\t add(line);\n\t }\n\t else {\n\t add(line);\n\t }\n\t\n\t return builder;\n\t };\n\t\n\t builder.def = function (id, def) {\n\t vars += (vars ? ',\\n' + tab + ' ' : '') + id + (def !== undefined ? ' = ' + def : '');\n\t return builder;\n\t };\n\t\n\t builder.toSource = function () {\n\t return 'function ' + name + '(' + args.join(', ') + ') {\\n' +\n\t tab + '\"use strict\"' + '\\n' +\n\t (vars ? tab + 'var ' + vars + ';\\n' : '') +\n\t lines + '}';\n\t };\n\t\n\t builder.compile = function (scope) {\n\t var src = 'return (' + builder.toSource() + ')',\n\t scp = scope || {},\n\t keys = Object.keys(scp),\n\t vals = keys.map(function (key) { return scp[key]; });\n\t\n\t return Function.apply(null, keys.concat(src)).apply(null, vals);\n\t };\n\t\n\t return builder;\n\t};\n\n/***/ },\n/* 13 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tfunction type(obj) {\n\t var str = Object.prototype.toString.call(obj);\n\t return str.substr(8, str.length - 9).toLowerCase();\n\t}\n\t\n\tfunction deepEqual(a, b) {\n\t var keysA = Object.keys(a).sort(),\n\t keysB = Object.keys(b).sort(),\n\t i, key;\n\t\n\t if (!equal(keysA, keysB)) {\n\t return false;\n\t }\n\t\n\t for (i = 0; i < keysA.length; i++) {\n\t key = keysA[i];\n\t\n\t if (!equal(a[key], b[key])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t}\n\t\n\tfunction equal(a, b) { // jshint ignore: line\n\t var typeA = typeof a,\n\t typeB = typeof b,\n\t i;\n\t\n\t // get detailed object type\n\t if (typeA === 'object') {\n\t typeA = type(a);\n\t }\n\t\n\t // get detailed object type\n\t if (typeB === 'object') {\n\t typeB = type(b);\n\t }\n\t\n\t if (typeA !== typeB) {\n\t return false;\n\t }\n\t\n\t if (typeA === 'object') {\n\t return deepEqual(a, b);\n\t }\n\t\n\t if (typeA === 'regexp') {\n\t return a.toString() === b.toString();\n\t }\n\t\n\t if (typeA === 'array') {\n\t if (a.length !== b.length) {\n\t return false;\n\t }\n\t\n\t for (i = 0; i < a.length; i++) {\n\t if (!equal(a[i], b[i])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t }\n\t\n\t return a === b;\n\t}\n\t\n\tmodule.exports = equal;\n\n/***/ },\n/* 14 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar equal = __webpack_require__(13);\n\t\n\tfunction findIndex(arr, value, comparator) {\n\t for (var i = 0, len = arr.length; i < len; i++) {\n\t if (comparator(arr[i], value)) {\n\t return i;\n\t }\n\t }\n\t\n\t return -1;\n\t}\n\t\n\tmodule.exports = function unique(arr) {\n\t return arr.filter(function uniqueOnly(value, index, self) {\n\t return findIndex(self, value, equal) === index;\n\t });\n\t};\n\t\n\tmodule.exports.findIndex = findIndex;\n\n/***/ },\n/* 15 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar url = __webpack_require__(16),\n\t metaschema = __webpack_require__(23),\n\t INVALID_SCHEMA_REFERENCE = 'jsen: invalid schema reference',\n\t DUPLICATE_SCHEMA_ID = 'jsen: duplicate schema id',\n\t CIRCULAR_SCHEMA_REFERENCE = 'jsen: circular schema reference';\n\t\n\tfunction get(obj, path) {\n\t if (!path.length) {\n\t return obj;\n\t }\n\t\n\t var key = path.shift(),\n\t val;\n\t\n\t if (obj && typeof obj === 'object' && obj.hasOwnProperty(key)) {\n\t val = obj[key];\n\t }\n\t\n\t if (path.length) {\n\t if (val && typeof val === 'object') {\n\t return get(val, path);\n\t }\n\t\n\t return undefined;\n\t }\n\t\n\t return val;\n\t}\n\t\n\tfunction refToObj(ref) {\n\t var index = ref.indexOf('#'),\n\t ret = {\n\t base: ref.substr(0, index),\n\t path: []\n\t };\n\t\n\t if (index < 0) {\n\t ret.base = ref;\n\t return ret;\n\t }\n\t\n\t ref = ref.substr(index + 1);\n\t\n\t if (!ref) {\n\t return ret;\n\t }\n\t\n\t ret.path = ref.split('/').map(function (segment) {\n\t // Reference: http://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-08#section-3\n\t return decodeURIComponent(segment)\n\t .replace(/~1/g, '/')\n\t .replace(/~0/g, '~');\n\t });\n\t\n\t if (ref[0] === '/') {\n\t ret.path.shift();\n\t }\n\t\n\t return ret;\n\t}\n\t\n\t// TODO: Can we prevent nested resolvers and combine schemas instead?\n\tfunction SchemaResolver(rootSchema, external, missing$Ref, baseId) { // jshint ignore: line\n\t this.rootSchema = rootSchema;\n\t this.resolvers = null;\n\t this.resolvedRootSchema = null;\n\t this.cache = {};\n\t this.idCache = {};\n\t this.refCache = { refs: [], schemas: [] };\n\t this.missing$Ref = missing$Ref;\n\t this.refStack = [];\n\t\n\t baseId = baseId || '';\n\t\n\t this._buildIdCache(rootSchema, baseId);\n\t\n\t // get updated base id after normalizing root schema id\n\t baseId = this.refCache.refs[this.refCache.schemas.indexOf(this.rootSchema)] || baseId;\n\t\n\t this._buildResolvers(external, baseId);\n\t}\n\t\n\tSchemaResolver.prototype._cacheId = function (id, schema, resolver) {\n\t if (this.idCache[id]) {\n\t throw new Error(DUPLICATE_SCHEMA_ID + ' ' + id);\n\t }\n\t\n\t this.idCache[id] = { resolver: resolver, schema: schema };\n\t};\n\t\n\tSchemaResolver.prototype._buildIdCache = function (schema, baseId) {\n\t var id = baseId,\n\t ref, keys, i;\n\t\n\t if (!schema || typeof schema !== 'object') {\n\t return;\n\t }\n\t\n\t if (typeof schema.id === 'string' && schema.id) {\n\t id = url.resolve(baseId, schema.id);\n\t\n\t this._cacheId(id, schema, this);\n\t }\n\t else if (schema === this.rootSchema && baseId) {\n\t this._cacheId(baseId, schema, this);\n\t }\n\t\n\t if (schema.$ref && typeof schema.$ref === 'string') {\n\t ref = url.resolve(id, schema.$ref);\n\t\n\t this.refCache.schemas.push(schema);\n\t this.refCache.refs.push(ref);\n\t }\n\t\n\t keys = Object.keys(schema);\n\t\n\t for (i = 0; i < keys.length; i++) {\n\t this._buildIdCache(schema[keys[i]], id);\n\t }\n\t};\n\t\n\tSchemaResolver.prototype._buildResolvers = function (schemas, baseId) {\n\t if (!schemas || typeof schemas !== 'object') {\n\t return;\n\t }\n\t\n\t var that = this,\n\t resolvers = {};\n\t\n\t Object.keys(schemas).forEach(function (key) {\n\t var id = url.resolve(baseId, key),\n\t resolver = new SchemaResolver(schemas[key], null, that.missing$Ref, id);\n\t\n\t that._cacheId(id, resolver.rootSchema, resolver);\n\t\n\t Object.keys(resolver.idCache).forEach(function (idKey) {\n\t that.idCache[idKey] = resolver.idCache[idKey];\n\t });\n\t\n\t resolvers[key] = resolver;\n\t });\n\t\n\t this.resolvers = resolvers;\n\t};\n\t\n\tSchemaResolver.prototype.getNormalizedRef = function (schema) {\n\t var index = this.refCache.schemas.indexOf(schema);\n\t return this.refCache.refs[index];\n\t};\n\t\n\tSchemaResolver.prototype._resolveRef = function (ref) {\n\t var err = new Error(INVALID_SCHEMA_REFERENCE + ' ' + ref),\n\t idCache = this.idCache,\n\t externalResolver, cached, descriptor, path, dest;\n\t\n\t if (!ref || typeof ref !== 'string') {\n\t throw err;\n\t }\n\t\n\t if (ref === metaschema.id) {\n\t dest = metaschema;\n\t }\n\t\n\t cached = idCache[ref];\n\t\n\t if (cached) {\n\t dest = cached.resolver.resolve(cached.schema);\n\t }\n\t\n\t if (dest === undefined) {\n\t descriptor = refToObj(ref);\n\t path = descriptor.path;\n\t\n\t if (descriptor.base) {\n\t cached = idCache[descriptor.base] || idCache[descriptor.base + '#'];\n\t\n\t if (cached) {\n\t dest = cached.resolver.resolve(get(cached.schema, path.slice(0)));\n\t }\n\t else {\n\t path.unshift(descriptor.base);\n\t }\n\t }\n\t }\n\t\n\t if (dest === undefined && this.resolvedRootSchema) {\n\t dest = get(this.resolvedRootSchema, path.slice(0));\n\t }\n\t\n\t if (dest === undefined) {\n\t dest = get(this.rootSchema, path.slice(0));\n\t }\n\t\n\t if (dest === undefined && path.length && this.resolvers) {\n\t externalResolver = get(this.resolvers, path);\n\t\n\t if (externalResolver) {\n\t dest = externalResolver.resolve(externalResolver.rootSchema);\n\t }\n\t }\n\t\n\t if (dest === undefined || typeof dest !== 'object') {\n\t if (this.missing$Ref) {\n\t dest = {};\n\t } else {\n\t throw err;\n\t }\n\t }\n\t\n\t if (this.cache[ref] === dest) {\n\t return dest;\n\t }\n\t\n\t this.cache[ref] = dest;\n\t\n\t if (dest.$ref !== undefined) {\n\t dest = this.resolve(dest);\n\t }\n\t\n\t return dest;\n\t};\n\t\n\tSchemaResolver.prototype.resolve = function (schema) {\n\t if (!schema || typeof schema !== 'object' || schema.$ref === undefined) {\n\t return schema;\n\t }\n\t\n\t var ref = this.getNormalizedRef(schema) || schema.$ref,\n\t resolved = this.cache[ref];\n\t\n\t if (resolved !== undefined) {\n\t return resolved;\n\t }\n\t\n\t if (this.refStack.indexOf(ref) > -1) {\n\t throw new Error(CIRCULAR_SCHEMA_REFERENCE + ' ' + ref);\n\t }\n\t\n\t this.refStack.push(ref);\n\t\n\t resolved = this._resolveRef(ref);\n\t\n\t this.refStack.pop();\n\t\n\t if (schema === this.rootSchema) {\n\t // cache the resolved root schema\n\t this.resolvedRootSchema = resolved;\n\t }\n\t\n\t return resolved;\n\t};\n\t\n\tSchemaResolver.prototype.hasRef = function (schema) {\n\t var keys = Object.keys(schema),\n\t len, key, i, hasChildRef;\n\t\n\t if (keys.indexOf('$ref') > -1) {\n\t return true;\n\t }\n\t\n\t for (i = 0, len = keys.length; i < len; i++) {\n\t key = keys[i];\n\t\n\t if (schema[key] && typeof schema[key] === 'object' && !Array.isArray(schema[key])) {\n\t hasChildRef = this.hasRef(schema[key]);\n\t\n\t if (hasChildRef) {\n\t return true;\n\t }\n\t }\n\t }\n\t\n\t return false;\n\t};\n\t\n\tSchemaResolver.resolvePointer = function (obj, pointer) {\n\t var descriptor = refToObj(pointer),\n\t path = descriptor.path;\n\t\n\t if (descriptor.base) {\n\t path = [descriptor.base].concat(path);\n\t }\n\t\n\t return get(obj, path);\n\t};\n\t\n\tmodule.exports = SchemaResolver;\n\n/***/ },\n/* 16 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t// Copyright Joyent, Inc. and other Node contributors.\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a\n\t// copy of this software and associated documentation files (the\n\t// \"Software\"), to deal in the Software without restriction, including\n\t// without limitation the rights to use, copy, modify, merge, publish,\n\t// distribute, sublicense, and/or sell copies of the Software, and to permit\n\t// persons to whom the Software is furnished to do so, subject to the\n\t// following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included\n\t// in all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n\t// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\t// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n\t// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n\t// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n\t// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n\t// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\t\n\t'use strict';\n\t\n\tvar punycode = __webpack_require__(17);\n\tvar util = __webpack_require__(19);\n\t\n\texports.parse = urlParse;\n\texports.resolve = urlResolve;\n\texports.resolveObject = urlResolveObject;\n\texports.format = urlFormat;\n\t\n\texports.Url = Url;\n\t\n\tfunction Url() {\n\t this.protocol = null;\n\t this.slashes = null;\n\t this.auth = null;\n\t this.host = null;\n\t this.port = null;\n\t this.hostname = null;\n\t this.hash = null;\n\t this.search = null;\n\t this.query = null;\n\t this.pathname = null;\n\t this.path = null;\n\t this.href = null;\n\t}\n\t\n\t// Reference: RFC 3986, RFC 1808, RFC 2396\n\t\n\t// define these here so at least they only have to be\n\t// compiled once on the first module load.\n\tvar protocolPattern = /^([a-z0-9.+-]+:)/i,\n\t portPattern = /:[0-9]*$/,\n\t\n\t // Special case for a simple path URL\n\t simplePathPattern = /^(\\/\\/?(?!\\/)[^\\?\\s]*)(\\?[^\\s]*)?$/,\n\t\n\t // RFC 2396: characters reserved for delimiting URLs.\n\t // We actually just auto-escape these.\n\t delims = ['<', '>', '\"', '`', ' ', '\\r', '\\n', '\\t'],\n\t\n\t // RFC 2396: characters not allowed for various reasons.\n\t unwise = ['{', '}', '|', '\\\\', '^', '`'].concat(delims),\n\t\n\t // Allowed by RFCs, but cause of XSS attacks. Always escape these.\n\t autoEscape = ['\\''].concat(unwise),\n\t // Characters that are never ever allowed in a hostname.\n\t // Note that any invalid chars are also handled, but these\n\t // are the ones that are *expected* to be seen, so we fast-path\n\t // them.\n\t nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape),\n\t hostEndingChars = ['/', '?', '#'],\n\t hostnameMaxLen = 255,\n\t hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,\n\t hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,\n\t // protocols that can allow \"unsafe\" and \"unwise\" chars.\n\t unsafeProtocol = {\n\t 'javascript': true,\n\t 'javascript:': true\n\t },\n\t // protocols that never have a hostname.\n\t hostlessProtocol = {\n\t 'javascript': true,\n\t 'javascript:': true\n\t },\n\t // protocols that always contain a // bit.\n\t slashedProtocol = {\n\t 'http': true,\n\t 'https': true,\n\t 'ftp': true,\n\t 'gopher': true,\n\t 'file': true,\n\t 'http:': true,\n\t 'https:': true,\n\t 'ftp:': true,\n\t 'gopher:': true,\n\t 'file:': true\n\t },\n\t querystring = __webpack_require__(20);\n\t\n\tfunction urlParse(url, parseQueryString, slashesDenoteHost) {\n\t if (url && util.isObject(url) && url instanceof Url) return url;\n\t\n\t var u = new Url;\n\t u.parse(url, parseQueryString, slashesDenoteHost);\n\t return u;\n\t}\n\t\n\tUrl.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {\n\t if (!util.isString(url)) {\n\t throw new TypeError(\"Parameter 'url' must be a string, not \" + typeof url);\n\t }\n\t\n\t // Copy chrome, IE, opera backslash-handling behavior.\n\t // Back slashes before the query string get converted to forward slashes\n\t // See: https://code.google.com/p/chromium/issues/detail?id=25916\n\t var queryIndex = url.indexOf('?'),\n\t splitter =\n\t (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#',\n\t uSplit = url.split(splitter),\n\t slashRegex = /\\\\/g;\n\t uSplit[0] = uSplit[0].replace(slashRegex, '/');\n\t url = uSplit.join(splitter);\n\t\n\t var rest = url;\n\t\n\t // trim before proceeding.\n\t // This is to support parse stuff like \" http://foo.com \\n\"\n\t rest = rest.trim();\n\t\n\t if (!slashesDenoteHost && url.split('#').length === 1) {\n\t // Try fast path regexp\n\t var simplePath = simplePathPattern.exec(rest);\n\t if (simplePath) {\n\t this.path = rest;\n\t this.href = rest;\n\t this.pathname = simplePath[1];\n\t if (simplePath[2]) {\n\t this.search = simplePath[2];\n\t if (parseQueryString) {\n\t this.query = querystring.parse(this.search.substr(1));\n\t } else {\n\t this.query = this.search.substr(1);\n\t }\n\t } else if (parseQueryString) {\n\t this.search = '';\n\t this.query = {};\n\t }\n\t return this;\n\t }\n\t }\n\t\n\t var proto = protocolPattern.exec(rest);\n\t if (proto) {\n\t proto = proto[0];\n\t var lowerProto = proto.toLowerCase();\n\t this.protocol = lowerProto;\n\t rest = rest.substr(proto.length);\n\t }\n\t\n\t // figure out if it's got a host\n\t // user@server is *always* interpreted as a hostname, and url\n\t // resolution will treat //foo/bar as host=foo,path=bar because that's\n\t // how the browser resolves relative URLs.\n\t if (slashesDenoteHost || proto || rest.match(/^\\/\\/[^@\\/]+@[^@\\/]+/)) {\n\t var slashes = rest.substr(0, 2) === '//';\n\t if (slashes && !(proto && hostlessProtocol[proto])) {\n\t rest = rest.substr(2);\n\t this.slashes = true;\n\t }\n\t }\n\t\n\t if (!hostlessProtocol[proto] &&\n\t (slashes || (proto && !slashedProtocol[proto]))) {\n\t\n\t // there's a hostname.\n\t // the first instance of /, ?, ;, or # ends the host.\n\t //\n\t // If there is an @ in the hostname, then non-host chars *are* allowed\n\t // to the left of the last @ sign, unless some host-ending character\n\t // comes *before* the @-sign.\n\t // URLs are obnoxious.\n\t //\n\t // ex:\n\t // http://a@b@c/ => user:a@b host:c\n\t // http://a@b?@c => user:a host:c path:/?@c\n\t\n\t // v0.12 TODO(isaacs): This is not quite how Chrome does things.\n\t // Review our test case against browsers more comprehensively.\n\t\n\t // find the first instance of any hostEndingChars\n\t var hostEnd = -1;\n\t for (var i = 0; i < hostEndingChars.length; i++) {\n\t var hec = rest.indexOf(hostEndingChars[i]);\n\t if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n\t hostEnd = hec;\n\t }\n\t\n\t // at this point, either we have an explicit point where the\n\t // auth portion cannot go past, or the last @ char is the decider.\n\t var auth, atSign;\n\t if (hostEnd === -1) {\n\t // atSign can be anywhere.\n\t atSign = rest.lastIndexOf('@');\n\t } else {\n\t // atSign must be in auth portion.\n\t // http://a@b/c@d => host:b auth:a path:/c@d\n\t atSign = rest.lastIndexOf('@', hostEnd);\n\t }\n\t\n\t // Now we have a portion which is definitely the auth.\n\t // Pull that off.\n\t if (atSign !== -1) {\n\t auth = rest.slice(0, atSign);\n\t rest = rest.slice(atSign + 1);\n\t this.auth = decodeURIComponent(auth);\n\t }\n\t\n\t // the host is the remaining to the left of the first non-host char\n\t hostEnd = -1;\n\t for (var i = 0; i < nonHostChars.length; i++) {\n\t var hec = rest.indexOf(nonHostChars[i]);\n\t if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n\t hostEnd = hec;\n\t }\n\t // if we still have not hit it, then the entire thing is a host.\n\t if (hostEnd === -1)\n\t hostEnd = rest.length;\n\t\n\t this.host = rest.slice(0, hostEnd);\n\t rest = rest.slice(hostEnd);\n\t\n\t // pull out port.\n\t this.parseHost();\n\t\n\t // we've indicated that there is a hostname,\n\t // so even if it's empty, it has to be present.\n\t this.hostname = this.hostname || '';\n\t\n\t // if hostname begins with [ and ends with ]\n\t // assume that it's an IPv6 address.\n\t var ipv6Hostname = this.hostname[0] === '[' &&\n\t this.hostname[this.hostname.length - 1] === ']';\n\t\n\t // validate a little.\n\t if (!ipv6Hostname) {\n\t var hostparts = this.hostname.split(/\\./);\n\t for (var i = 0, l = hostparts.length; i < l; i++) {\n\t var part = hostparts[i];\n\t if (!part) continue;\n\t if (!part.match(hostnamePartPattern)) {\n\t var newpart = '';\n\t for (var j = 0, k = part.length; j < k; j++) {\n\t if (part.charCodeAt(j) > 127) {\n\t // we replace non-ASCII char with a temporary placeholder\n\t // we need this to make sure size of hostname is not\n\t // broken by replacing non-ASCII by nothing\n\t newpart += 'x';\n\t } else {\n\t newpart += part[j];\n\t }\n\t }\n\t // we test again with ASCII char only\n\t if (!newpart.match(hostnamePartPattern)) {\n\t var validParts = hostparts.slice(0, i);\n\t var notHost = hostparts.slice(i + 1);\n\t var bit = part.match(hostnamePartStart);\n\t if (bit) {\n\t validParts.push(bit[1]);\n\t notHost.unshift(bit[2]);\n\t }\n\t if (notHost.length) {\n\t rest = '/' + notHost.join('.') + rest;\n\t }\n\t this.hostname = validParts.join('.');\n\t break;\n\t }\n\t }\n\t }\n\t }\n\t\n\t if (this.hostname.length > hostnameMaxLen) {\n\t this.hostname = '';\n\t } else {\n\t // hostnames are always lower case.\n\t this.hostname = this.hostname.toLowerCase();\n\t }\n\t\n\t if (!ipv6Hostname) {\n\t // IDNA Support: Returns a punycoded representation of \"domain\".\n\t // It only converts parts of the domain name that\n\t // have non-ASCII characters, i.e. it doesn't matter if\n\t // you call it with a domain that already is ASCII-only.\n\t this.hostname = punycode.toASCII(this.hostname);\n\t }\n\t\n\t var p = this.port ? ':' + this.port : '';\n\t var h = this.hostname || '';\n\t this.host = h + p;\n\t this.href += this.host;\n\t\n\t // strip [ and ] from the hostname\n\t // the host field still retains them, though\n\t if (ipv6Hostname) {\n\t this.hostname = this.hostname.substr(1, this.hostname.length - 2);\n\t if (rest[0] !== '/') {\n\t rest = '/' + rest;\n\t }\n\t }\n\t }\n\t\n\t // now rest is set to the post-host stuff.\n\t // chop off any delim chars.\n\t if (!unsafeProtocol[lowerProto]) {\n\t\n\t // First, make 100% sure that any \"autoEscape\" chars get\n\t // escaped, even if encodeURIComponent doesn't think they\n\t // need to be.\n\t for (var i = 0, l = autoEscape.length; i < l; i++) {\n\t var ae = autoEscape[i];\n\t if (rest.indexOf(ae) === -1)\n\t continue;\n\t var esc = encodeURIComponent(ae);\n\t if (esc === ae) {\n\t esc = escape(ae);\n\t }\n\t rest = rest.split(ae).join(esc);\n\t }\n\t }\n\t\n\t\n\t // chop off from the tail first.\n\t var hash = rest.indexOf('#');\n\t if (hash !== -1) {\n\t // got a fragment string.\n\t this.hash = rest.substr(hash);\n\t rest = rest.slice(0, hash);\n\t }\n\t var qm = rest.indexOf('?');\n\t if (qm !== -1) {\n\t this.search = rest.substr(qm);\n\t this.query = rest.substr(qm + 1);\n\t if (parseQueryString) {\n\t this.query = querystring.parse(this.query);\n\t }\n\t rest = rest.slice(0, qm);\n\t } else if (parseQueryString) {\n\t // no query string, but parseQueryString still requested\n\t this.search = '';\n\t this.query = {};\n\t }\n\t if (rest) this.pathname = rest;\n\t if (slashedProtocol[lowerProto] &&\n\t this.hostname && !this.pathname) {\n\t this.pathname = '/';\n\t }\n\t\n\t //to support http.request\n\t if (this.pathname || this.search) {\n\t var p = this.pathname || '';\n\t var s = this.search || '';\n\t this.path = p + s;\n\t }\n\t\n\t // finally, reconstruct the href based on what has been validated.\n\t this.href = this.format();\n\t return this;\n\t};\n\t\n\t// format a parsed object into a url string\n\tfunction urlFormat(obj) {\n\t // ensure it's an object, and not a string url.\n\t // If it's an obj, this is a no-op.\n\t // this way, you can call url_format() on strings\n\t // to clean up potentially wonky urls.\n\t if (util.isString(obj)) obj = urlParse(obj);\n\t if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n\t return obj.format();\n\t}\n\t\n\tUrl.prototype.format = function() {\n\t var auth = this.auth || '';\n\t if (auth) {\n\t auth = encodeURIComponent(auth);\n\t auth = auth.replace(/%3A/i, ':');\n\t auth += '@';\n\t }\n\t\n\t var protocol = this.protocol || '',\n\t pathname = this.pathname || '',\n\t hash = this.hash || '',\n\t host = false,\n\t query = '';\n\t\n\t if (this.host) {\n\t host = auth + this.host;\n\t } else if (this.hostname) {\n\t host = auth + (this.hostname.indexOf(':') === -1 ?\n\t this.hostname :\n\t '[' + this.hostname + ']');\n\t if (this.port) {\n\t host += ':' + this.port;\n\t }\n\t }\n\t\n\t if (this.query &&\n\t util.isObject(this.query) &&\n\t Object.keys(this.query).length) {\n\t query = querystring.stringify(this.query);\n\t }\n\t\n\t var search = this.search || (query && ('?' + query)) || '';\n\t\n\t if (protocol && protocol.substr(-1) !== ':') protocol += ':';\n\t\n\t // only the slashedProtocols get the //. Not mailto:, xmpp:, etc.\n\t // unless they had them to begin with.\n\t if (this.slashes ||\n\t (!protocol || slashedProtocol[protocol]) && host !== false) {\n\t host = '//' + (host || '');\n\t if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname;\n\t } else if (!host) {\n\t host = '';\n\t }\n\t\n\t if (hash && hash.charAt(0) !== '#') hash = '#' + hash;\n\t if (search && search.charAt(0) !== '?') search = '?' + search;\n\t\n\t pathname = pathname.replace(/[?#]/g, function(match) {\n\t return encodeURIComponent(match);\n\t });\n\t search = search.replace('#', '%23');\n\t\n\t return protocol + host + pathname + search + hash;\n\t};\n\t\n\tfunction urlResolve(source, relative) {\n\t return urlParse(source, false, true).resolve(relative);\n\t}\n\t\n\tUrl.prototype.resolve = function(relative) {\n\t return this.resolveObject(urlParse(relative, false, true)).format();\n\t};\n\t\n\tfunction urlResolveObject(source, relative) {\n\t if (!source) return relative;\n\t return urlParse(source, false, true).resolveObject(relative);\n\t}\n\t\n\tUrl.prototype.resolveObject = function(relative) {\n\t if (util.isString(relative)) {\n\t var rel = new Url();\n\t rel.parse(relative, false, true);\n\t relative = rel;\n\t }\n\t\n\t var result = new Url();\n\t var tkeys = Object.keys(this);\n\t for (var tk = 0; tk < tkeys.length; tk++) {\n\t var tkey = tkeys[tk];\n\t result[tkey] = this[tkey];\n\t }\n\t\n\t // hash is always overridden, no matter what.\n\t // even href=\"\" will remove it.\n\t result.hash = relative.hash;\n\t\n\t // if the relative url is empty, then there's nothing left to do here.\n\t if (relative.href === '') {\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t // hrefs like //foo/bar always cut to the protocol.\n\t if (relative.slashes && !relative.protocol) {\n\t // take everything except the protocol from relative\n\t var rkeys = Object.keys(relative);\n\t for (var rk = 0; rk < rkeys.length; rk++) {\n\t var rkey = rkeys[rk];\n\t if (rkey !== 'protocol')\n\t result[rkey] = relative[rkey];\n\t }\n\t\n\t //urlParse appends trailing / to urls like http://www.example.com\n\t if (slashedProtocol[result.protocol] &&\n\t result.hostname && !result.pathname) {\n\t result.path = result.pathname = '/';\n\t }\n\t\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t if (relative.protocol && relative.protocol !== result.protocol) {\n\t // if it's a known url protocol, then changing\n\t // the protocol does weird things\n\t // first, if it's not file:, then we MUST have a host,\n\t // and if there was a path\n\t // to begin with, then we MUST have a path.\n\t // if it is file:, then the host is dropped,\n\t // because that's known to be hostless.\n\t // anything else is assumed to be absolute.\n\t if (!slashedProtocol[relative.protocol]) {\n\t var keys = Object.keys(relative);\n\t for (var v = 0; v < keys.length; v++) {\n\t var k = keys[v];\n\t result[k] = relative[k];\n\t }\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t result.protocol = relative.protocol;\n\t if (!relative.host && !hostlessProtocol[relative.protocol]) {\n\t var relPath = (relative.pathname || '').split('/');\n\t while (relPath.length && !(relative.host = relPath.shift()));\n\t if (!relative.host) relative.host = '';\n\t if (!relative.hostname) relative.hostname = '';\n\t if (relPath[0] !== '') relPath.unshift('');\n\t if (relPath.length < 2) relPath.unshift('');\n\t result.pathname = relPath.join('/');\n\t } else {\n\t result.pathname = relative.pathname;\n\t }\n\t result.search = relative.search;\n\t result.query = relative.query;\n\t result.host = relative.host || '';\n\t result.auth = relative.auth;\n\t result.hostname = relative.hostname || relative.host;\n\t result.port = relative.port;\n\t // to support http.request\n\t if (result.pathname || result.search) {\n\t var p = result.pathname || '';\n\t var s = result.search || '';\n\t result.path = p + s;\n\t }\n\t result.slashes = result.slashes || relative.slashes;\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'),\n\t isRelAbs = (\n\t relative.host ||\n\t relative.pathname && relative.pathname.charAt(0) === '/'\n\t ),\n\t mustEndAbs = (isRelAbs || isSourceAbs ||\n\t (result.host && relative.pathname)),\n\t removeAllDots = mustEndAbs,\n\t srcPath = result.pathname && result.pathname.split('/') || [],\n\t relPath = relative.pathname && relative.pathname.split('/') || [],\n\t psychotic = result.protocol && !slashedProtocol[result.protocol];\n\t\n\t // if the url is a non-slashed url, then relative\n\t // links like ../.. should be able\n\t // to crawl up to the hostname, as well. This is strange.\n\t // result.protocol has already been set by now.\n\t // Later on, put the first path part into the host field.\n\t if (psychotic) {\n\t result.hostname = '';\n\t result.port = null;\n\t if (result.host) {\n\t if (srcPath[0] === '') srcPath[0] = result.host;\n\t else srcPath.unshift(result.host);\n\t }\n\t result.host = '';\n\t if (relative.protocol) {\n\t relative.hostname = null;\n\t relative.port = null;\n\t if (relative.host) {\n\t if (relPath[0] === '') relPath[0] = relative.host;\n\t else relPath.unshift(relative.host);\n\t }\n\t relative.host = null;\n\t }\n\t mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === '');\n\t }\n\t\n\t if (isRelAbs) {\n\t // it's absolute.\n\t result.host = (relative.host || relative.host === '') ?\n\t relative.host : result.host;\n\t result.hostname = (relative.hostname || relative.hostname === '') ?\n\t relative.hostname : result.hostname;\n\t result.search = relative.search;\n\t result.query = relative.query;\n\t srcPath = relPath;\n\t // fall through to the dot-handling below.\n\t } else if (relPath.length) {\n\t // it's relative\n\t // throw away the existing file, and take the new path instead.\n\t if (!srcPath) srcPath = [];\n\t srcPath.pop();\n\t srcPath = srcPath.concat(relPath);\n\t result.search = relative.search;\n\t result.query = relative.query;\n\t } else if (!util.isNullOrUndefined(relative.search)) {\n\t // just pull out the search.\n\t // like href='https://github.com/?foo'.\n\t // Put this after the other two cases because it simplifies the booleans\n\t if (psychotic) {\n\t result.hostname = result.host = srcPath.shift();\n\t //occationaly the auth can get stuck only in host\n\t //this especially happens in cases like\n\t //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n\t var authInHost = result.host && result.host.indexOf('@') > 0 ?\n\t result.host.split('@') : false;\n\t if (authInHost) {\n\t result.auth = authInHost.shift();\n\t result.host = result.hostname = authInHost.shift();\n\t }\n\t }\n\t result.search = relative.search;\n\t result.query = relative.query;\n\t //to support http.request\n\t if (!util.isNull(result.pathname) || !util.isNull(result.search)) {\n\t result.path = (result.pathname ? result.pathname : '') +\n\t (result.search ? result.search : '');\n\t }\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t if (!srcPath.length) {\n\t // no path at all. easy.\n\t // we've already handled the other stuff above.\n\t result.pathname = null;\n\t //to support http.request\n\t if (result.search) {\n\t result.path = '/' + result.search;\n\t } else {\n\t result.path = null;\n\t }\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t // if a url ENDs in . or .., then it must get a trailing slash.\n\t // however, if it ends in anything else non-slashy,\n\t // then it must NOT get a trailing slash.\n\t var last = srcPath.slice(-1)[0];\n\t var hasTrailingSlash = (\n\t (result.host || relative.host || srcPath.length > 1) &&\n\t (last === '.' || last === '..') || last === '');\n\t\n\t // strip single dots, resolve double dots to parent dir\n\t // if the path tries to go above the root, `up` ends up > 0\n\t var up = 0;\n\t for (var i = srcPath.length; i >= 0; i--) {\n\t last = srcPath[i];\n\t if (last === '.') {\n\t srcPath.splice(i, 1);\n\t } else if (last === '..') {\n\t srcPath.splice(i, 1);\n\t up++;\n\t } else if (up) {\n\t srcPath.splice(i, 1);\n\t up--;\n\t }\n\t }\n\t\n\t // if the path is allowed to go above the root, restore leading ..s\n\t if (!mustEndAbs && !removeAllDots) {\n\t for (; up--; up) {\n\t srcPath.unshift('..');\n\t }\n\t }\n\t\n\t if (mustEndAbs && srcPath[0] !== '' &&\n\t (!srcPath[0] || srcPath[0].charAt(0) !== '/')) {\n\t srcPath.unshift('');\n\t }\n\t\n\t if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) {\n\t srcPath.push('');\n\t }\n\t\n\t var isAbsolute = srcPath[0] === '' ||\n\t (srcPath[0] && srcPath[0].charAt(0) === '/');\n\t\n\t // put the host back\n\t if (psychotic) {\n\t result.hostname = result.host = isAbsolute ? '' :\n\t srcPath.length ? srcPath.shift() : '';\n\t //occationaly the auth can get stuck only in host\n\t //this especially happens in cases like\n\t //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n\t var authInHost = result.host && result.host.indexOf('@') > 0 ?\n\t result.host.split('@') : false;\n\t if (authInHost) {\n\t result.auth = authInHost.shift();\n\t result.host = result.hostname = authInHost.shift();\n\t }\n\t }\n\t\n\t mustEndAbs = mustEndAbs || (result.host && srcPath.length);\n\t\n\t if (mustEndAbs && !isAbsolute) {\n\t srcPath.unshift('');\n\t }\n\t\n\t if (!srcPath.length) {\n\t result.pathname = null;\n\t result.path = null;\n\t } else {\n\t result.pathname = srcPath.join('/');\n\t }\n\t\n\t //to support request.http\n\t if (!util.isNull(result.pathname) || !util.isNull(result.search)) {\n\t result.path = (result.pathname ? result.pathname : '') +\n\t (result.search ? result.search : '');\n\t }\n\t result.auth = relative.auth || result.auth;\n\t result.slashes = result.slashes || relative.slashes;\n\t result.href = result.format();\n\t return result;\n\t};\n\t\n\tUrl.prototype.parseHost = function() {\n\t var host = this.host;\n\t var port = portPattern.exec(host);\n\t if (port) {\n\t port = port[0];\n\t if (port !== ':') {\n\t this.port = port.substr(1);\n\t }\n\t host = host.substr(0, host.length - port.length);\n\t }\n\t if (host) this.hostname = host;\n\t};\n\n\n/***/ },\n/* 17 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(module, global) {/*! https://mths.be/punycode v1.3.2 by @mathias */\n\t;(function(root) {\n\t\n\t\t/** Detect free variables */\n\t\tvar freeExports = typeof exports == 'object' && exports &&\n\t\t\t!exports.nodeType && exports;\n\t\tvar freeModule = typeof module == 'object' && module &&\n\t\t\t!module.nodeType && module;\n\t\tvar freeGlobal = typeof global == 'object' && global;\n\t\tif (\n\t\t\tfreeGlobal.global === freeGlobal ||\n\t\t\tfreeGlobal.window === freeGlobal ||\n\t\t\tfreeGlobal.self === freeGlobal\n\t\t) {\n\t\t\troot = freeGlobal;\n\t\t}\n\t\n\t\t/**\n\t\t * The `punycode` object.\n\t\t * @name punycode\n\t\t * @type Object\n\t\t */\n\t\tvar punycode,\n\t\n\t\t/** Highest positive signed 32-bit float value */\n\t\tmaxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1\n\t\n\t\t/** Bootstring parameters */\n\t\tbase = 36,\n\t\ttMin = 1,\n\t\ttMax = 26,\n\t\tskew = 38,\n\t\tdamp = 700,\n\t\tinitialBias = 72,\n\t\tinitialN = 128, // 0x80\n\t\tdelimiter = '-', // '\\x2D'\n\t\n\t\t/** Regular expressions */\n\t\tregexPunycode = /^xn--/,\n\t\tregexNonASCII = /[^\\x20-\\x7E]/, // unprintable ASCII chars + non-ASCII chars\n\t\tregexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g, // RFC 3490 separators\n\t\n\t\t/** Error messages */\n\t\terrors = {\n\t\t\t'overflow': 'Overflow: input needs wider integers to process',\n\t\t\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t\t\t'invalid-input': 'Invalid input'\n\t\t},\n\t\n\t\t/** Convenience shortcuts */\n\t\tbaseMinusTMin = base - tMin,\n\t\tfloor = Math.floor,\n\t\tstringFromCharCode = String.fromCharCode,\n\t\n\t\t/** Temporary variable */\n\t\tkey;\n\t\n\t\t/*--------------------------------------------------------------------------*/\n\t\n\t\t/**\n\t\t * A generic error utility function.\n\t\t * @private\n\t\t * @param {String} type The error type.\n\t\t * @returns {Error} Throws a `RangeError` with the applicable error message.\n\t\t */\n\t\tfunction error(type) {\n\t\t\tthrow RangeError(errors[type]);\n\t\t}\n\t\n\t\t/**\n\t\t * A generic `Array#map` utility function.\n\t\t * @private\n\t\t * @param {Array} array The array to iterate over.\n\t\t * @param {Function} callback The function that gets called for every array\n\t\t * item.\n\t\t * @returns {Array} A new array of values returned by the callback function.\n\t\t */\n\t\tfunction map(array, fn) {\n\t\t\tvar length = array.length;\n\t\t\tvar result = [];\n\t\t\twhile (length--) {\n\t\t\t\tresult[length] = fn(array[length]);\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\n\t\t/**\n\t\t * A simple `Array#map`-like wrapper to work with domain name strings or email\n\t\t * addresses.\n\t\t * @private\n\t\t * @param {String} domain The domain name or email address.\n\t\t * @param {Function} callback The function that gets called for every\n\t\t * character.\n\t\t * @returns {Array} A new string of characters returned by the callback\n\t\t * function.\n\t\t */\n\t\tfunction mapDomain(string, fn) {\n\t\t\tvar parts = string.split('@');\n\t\t\tvar result = '';\n\t\t\tif (parts.length > 1) {\n\t\t\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t\t\t// the local part (i.e. everything up to `@`) intact.\n\t\t\t\tresult = parts[0] + '@';\n\t\t\t\tstring = parts[1];\n\t\t\t}\n\t\t\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\t\t\tstring = string.replace(regexSeparators, '\\x2E');\n\t\t\tvar labels = string.split('.');\n\t\t\tvar encoded = map(labels, fn).join('.');\n\t\t\treturn result + encoded;\n\t\t}\n\t\n\t\t/**\n\t\t * Creates an array containing the numeric code points of each Unicode\n\t\t * character in the string. While JavaScript uses UCS-2 internally,\n\t\t * this function will convert a pair of surrogate halves (each of which\n\t\t * UCS-2 exposes as separate characters) into a single code point,\n\t\t * matching UTF-16.\n\t\t * @see `punycode.ucs2.encode`\n\t\t * @see \n\t\t * @memberOf punycode.ucs2\n\t\t * @name decode\n\t\t * @param {String} string The Unicode input string (UCS-2).\n\t\t * @returns {Array} The new array of code points.\n\t\t */\n\t\tfunction ucs2decode(string) {\n\t\t\tvar output = [],\n\t\t\t counter = 0,\n\t\t\t length = string.length,\n\t\t\t value,\n\t\t\t extra;\n\t\t\twhile (counter < length) {\n\t\t\t\tvalue = string.charCodeAt(counter++);\n\t\t\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t\t\t// high surrogate, and there is a next character\n\t\t\t\t\textra = string.charCodeAt(counter++);\n\t\t\t\t\tif ((extra & 0xFC00) == 0xDC00) { // low surrogate\n\t\t\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// unmatched surrogate; only append this code unit, in case the next\n\t\t\t\t\t\t// code unit is the high surrogate of a surrogate pair\n\t\t\t\t\t\toutput.push(value);\n\t\t\t\t\t\tcounter--;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\toutput.push(value);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn output;\n\t\t}\n\t\n\t\t/**\n\t\t * Creates a string based on an array of numeric code points.\n\t\t * @see `punycode.ucs2.decode`\n\t\t * @memberOf punycode.ucs2\n\t\t * @name encode\n\t\t * @param {Array} codePoints The array of numeric code points.\n\t\t * @returns {String} The new Unicode string (UCS-2).\n\t\t */\n\t\tfunction ucs2encode(array) {\n\t\t\treturn map(array, function(value) {\n\t\t\t\tvar output = '';\n\t\t\t\tif (value > 0xFFFF) {\n\t\t\t\t\tvalue -= 0x10000;\n\t\t\t\t\toutput += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);\n\t\t\t\t\tvalue = 0xDC00 | value & 0x3FF;\n\t\t\t\t}\n\t\t\t\toutput += stringFromCharCode(value);\n\t\t\t\treturn output;\n\t\t\t}).join('');\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a basic code point into a digit/integer.\n\t\t * @see `digitToBasic()`\n\t\t * @private\n\t\t * @param {Number} codePoint The basic numeric code point value.\n\t\t * @returns {Number} The numeric value of a basic code point (for use in\n\t\t * representing integers) in the range `0` to `base - 1`, or `base` if\n\t\t * the code point does not represent a value.\n\t\t */\n\t\tfunction basicToDigit(codePoint) {\n\t\t\tif (codePoint - 48 < 10) {\n\t\t\t\treturn codePoint - 22;\n\t\t\t}\n\t\t\tif (codePoint - 65 < 26) {\n\t\t\t\treturn codePoint - 65;\n\t\t\t}\n\t\t\tif (codePoint - 97 < 26) {\n\t\t\t\treturn codePoint - 97;\n\t\t\t}\n\t\t\treturn base;\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a digit/integer into a basic code point.\n\t\t * @see `basicToDigit()`\n\t\t * @private\n\t\t * @param {Number} digit The numeric value of a basic code point.\n\t\t * @returns {Number} The basic code point whose value (when used for\n\t\t * representing integers) is `digit`, which needs to be in the range\n\t\t * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n\t\t * used; else, the lowercase form is used. The behavior is undefined\n\t\t * if `flag` is non-zero and `digit` has no uppercase form.\n\t\t */\n\t\tfunction digitToBasic(digit, flag) {\n\t\t\t// 0..25 map to ASCII a..z or A..Z\n\t\t\t// 26..35 map to ASCII 0..9\n\t\t\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n\t\t}\n\t\n\t\t/**\n\t\t * Bias adaptation function as per section 3.4 of RFC 3492.\n\t\t * http://tools.ietf.org/html/rfc3492#section-3.4\n\t\t * @private\n\t\t */\n\t\tfunction adapt(delta, numPoints, firstTime) {\n\t\t\tvar k = 0;\n\t\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\t\tdelta += floor(delta / numPoints);\n\t\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t\t}\n\t\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n\t\t * symbols.\n\t\t * @memberOf punycode\n\t\t * @param {String} input The Punycode string of ASCII-only symbols.\n\t\t * @returns {String} The resulting string of Unicode symbols.\n\t\t */\n\t\tfunction decode(input) {\n\t\t\t// Don't use UCS-2\n\t\t\tvar output = [],\n\t\t\t inputLength = input.length,\n\t\t\t out,\n\t\t\t i = 0,\n\t\t\t n = initialN,\n\t\t\t bias = initialBias,\n\t\t\t basic,\n\t\t\t j,\n\t\t\t index,\n\t\t\t oldi,\n\t\t\t w,\n\t\t\t k,\n\t\t\t digit,\n\t\t\t t,\n\t\t\t /** Cached calculation results */\n\t\t\t baseMinusT;\n\t\n\t\t\t// Handle the basic code points: let `basic` be the number of input code\n\t\t\t// points before the last delimiter, or `0` if there is none, then copy\n\t\t\t// the first basic code points to the output.\n\t\n\t\t\tbasic = input.lastIndexOf(delimiter);\n\t\t\tif (basic < 0) {\n\t\t\t\tbasic = 0;\n\t\t\t}\n\t\n\t\t\tfor (j = 0; j < basic; ++j) {\n\t\t\t\t// if it's not a basic code point\n\t\t\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\t\t\terror('not-basic');\n\t\t\t\t}\n\t\t\t\toutput.push(input.charCodeAt(j));\n\t\t\t}\n\t\n\t\t\t// Main decoding loop: start just after the last delimiter if any basic code\n\t\t\t// points were copied; start at the beginning otherwise.\n\t\n\t\t\tfor (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\t\n\t\t\t\t// `index` is the index of the next character to be consumed.\n\t\t\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t\t\t// which gets added to `i`. The overflow checking is easier\n\t\t\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t\t\t// value at the end to obtain `delta`.\n\t\t\t\tfor (oldi = i, w = 1, k = base; /* no condition */; k += base) {\n\t\n\t\t\t\t\tif (index >= inputLength) {\n\t\t\t\t\t\terror('invalid-input');\n\t\t\t\t\t}\n\t\n\t\t\t\t\tdigit = basicToDigit(input.charCodeAt(index++));\n\t\n\t\t\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\t\t\terror('overflow');\n\t\t\t\t\t}\n\t\n\t\t\t\t\ti += digit * w;\n\t\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\n\t\t\t\t\tif (digit < t) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tbaseMinusT = base - t;\n\t\t\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\t\t\terror('overflow');\n\t\t\t\t\t}\n\t\n\t\t\t\t\tw *= baseMinusT;\n\t\n\t\t\t\t}\n\t\n\t\t\t\tout = output.length + 1;\n\t\t\t\tbias = adapt(i - oldi, out, oldi == 0);\n\t\n\t\t\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t\t\t// incrementing `n` each time, so we'll fix that now:\n\t\t\t\tif (floor(i / out) > maxInt - n) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\t\n\t\t\t\tn += floor(i / out);\n\t\t\t\ti %= out;\n\t\n\t\t\t\t// Insert `n` at position `i` of the output\n\t\t\t\toutput.splice(i++, 0, n);\n\t\n\t\t\t}\n\t\n\t\t\treturn ucs2encode(output);\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a string of Unicode symbols (e.g. a domain name label) to a\n\t\t * Punycode string of ASCII-only symbols.\n\t\t * @memberOf punycode\n\t\t * @param {String} input The string of Unicode symbols.\n\t\t * @returns {String} The resulting Punycode string of ASCII-only symbols.\n\t\t */\n\t\tfunction encode(input) {\n\t\t\tvar n,\n\t\t\t delta,\n\t\t\t handledCPCount,\n\t\t\t basicLength,\n\t\t\t bias,\n\t\t\t j,\n\t\t\t m,\n\t\t\t q,\n\t\t\t k,\n\t\t\t t,\n\t\t\t currentValue,\n\t\t\t output = [],\n\t\t\t /** `inputLength` will hold the number of code points in `input`. */\n\t\t\t inputLength,\n\t\t\t /** Cached calculation results */\n\t\t\t handledCPCountPlusOne,\n\t\t\t baseMinusT,\n\t\t\t qMinusT;\n\t\n\t\t\t// Convert the input in UCS-2 to Unicode\n\t\t\tinput = ucs2decode(input);\n\t\n\t\t\t// Cache the length\n\t\t\tinputLength = input.length;\n\t\n\t\t\t// Initialize the state\n\t\t\tn = initialN;\n\t\t\tdelta = 0;\n\t\t\tbias = initialBias;\n\t\n\t\t\t// Handle the basic code points\n\t\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\t\tcurrentValue = input[j];\n\t\t\t\tif (currentValue < 0x80) {\n\t\t\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\thandledCPCount = basicLength = output.length;\n\t\n\t\t\t// `handledCPCount` is the number of code points that have been handled;\n\t\t\t// `basicLength` is the number of basic code points.\n\t\n\t\t\t// Finish the basic string - if it is not empty - with a delimiter\n\t\t\tif (basicLength) {\n\t\t\t\toutput.push(delimiter);\n\t\t\t}\n\t\n\t\t\t// Main encoding loop:\n\t\t\twhile (handledCPCount < inputLength) {\n\t\n\t\t\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t\t\t// larger one:\n\t\t\t\tfor (m = maxInt, j = 0; j < inputLength; ++j) {\n\t\t\t\t\tcurrentValue = input[j];\n\t\t\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\t\t\tm = currentValue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\t// Increase `delta` enough to advance the decoder's state to ,\n\t\t\t\t// but guard against overflow\n\t\t\t\thandledCPCountPlusOne = handledCPCount + 1;\n\t\t\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\t\n\t\t\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\t\t\tn = m;\n\t\n\t\t\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\t\t\tcurrentValue = input[j];\n\t\n\t\t\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\t\t\terror('overflow');\n\t\t\t\t\t}\n\t\n\t\t\t\t\tif (currentValue == n) {\n\t\t\t\t\t\t// Represent delta as a generalized variable-length integer\n\t\t\t\t\t\tfor (q = delta, k = base; /* no condition */; k += base) {\n\t\t\t\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tqMinusT = q - t;\n\t\t\t\t\t\t\tbaseMinusT = base - t;\n\t\t\t\t\t\t\toutput.push(\n\t\t\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\t\t\tdelta = 0;\n\t\t\t\t\t\t++handledCPCount;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\t++delta;\n\t\t\t\t++n;\n\t\n\t\t\t}\n\t\t\treturn output.join('');\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a Punycode string representing a domain name or an email address\n\t\t * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n\t\t * it doesn't matter if you call it on a string that has already been\n\t\t * converted to Unicode.\n\t\t * @memberOf punycode\n\t\t * @param {String} input The Punycoded domain name or email address to\n\t\t * convert to Unicode.\n\t\t * @returns {String} The Unicode representation of the given Punycode\n\t\t * string.\n\t\t */\n\t\tfunction toUnicode(input) {\n\t\t\treturn mapDomain(input, function(string) {\n\t\t\t\treturn regexPunycode.test(string)\n\t\t\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t\t\t: string;\n\t\t\t});\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a Unicode string representing a domain name or an email address to\n\t\t * Punycode. Only the non-ASCII parts of the domain name will be converted,\n\t\t * i.e. it doesn't matter if you call it with a domain that's already in\n\t\t * ASCII.\n\t\t * @memberOf punycode\n\t\t * @param {String} input The domain name or email address to convert, as a\n\t\t * Unicode string.\n\t\t * @returns {String} The Punycode representation of the given domain name or\n\t\t * email address.\n\t\t */\n\t\tfunction toASCII(input) {\n\t\t\treturn mapDomain(input, function(string) {\n\t\t\t\treturn regexNonASCII.test(string)\n\t\t\t\t\t? 'xn--' + encode(string)\n\t\t\t\t\t: string;\n\t\t\t});\n\t\t}\n\t\n\t\t/*--------------------------------------------------------------------------*/\n\t\n\t\t/** Define the public API */\n\t\tpunycode = {\n\t\t\t/**\n\t\t\t * A string representing the current Punycode.js version number.\n\t\t\t * @memberOf punycode\n\t\t\t * @type String\n\t\t\t */\n\t\t\t'version': '1.3.2',\n\t\t\t/**\n\t\t\t * An object of methods to convert from JavaScript's internal character\n\t\t\t * representation (UCS-2) to Unicode code points, and back.\n\t\t\t * @see \n\t\t\t * @memberOf punycode\n\t\t\t * @type Object\n\t\t\t */\n\t\t\t'ucs2': {\n\t\t\t\t'decode': ucs2decode,\n\t\t\t\t'encode': ucs2encode\n\t\t\t},\n\t\t\t'decode': decode,\n\t\t\t'encode': encode,\n\t\t\t'toASCII': toASCII,\n\t\t\t'toUnicode': toUnicode\n\t\t};\n\t\n\t\t/** Expose `punycode` */\n\t\t// Some AMD build optimizers, like r.js, check for specific condition patterns\n\t\t// like the following:\n\t\tif (\n\t\t\ttrue\n\t\t) {\n\t\t\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function() {\n\t\t\t\treturn punycode;\n\t\t\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t\t} else if (freeExports && freeModule) {\n\t\t\tif (module.exports == freeExports) { // in Node.js or RingoJS v0.8.0+\n\t\t\t\tfreeModule.exports = punycode;\n\t\t\t} else { // in Narwhal or RingoJS v0.7.0-\n\t\t\t\tfor (key in punycode) {\n\t\t\t\t\tpunycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]);\n\t\t\t\t}\n\t\t\t}\n\t\t} else { // in Rhino or a web browser\n\t\t\troot.punycode = punycode;\n\t\t}\n\t\n\t}(this));\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(18)(module), (function() { return this; }())))\n\n/***/ },\n/* 18 */\n/***/ function(module, exports) {\n\n\tmodule.exports = function(module) {\r\n\t\tif(!module.webpackPolyfill) {\r\n\t\t\tmodule.deprecate = function() {};\r\n\t\t\tmodule.paths = [];\r\n\t\t\t// module.parent = undefined by default\r\n\t\t\tmodule.children = [];\r\n\t\t\tmodule.webpackPolyfill = 1;\r\n\t\t}\r\n\t\treturn module;\r\n\t}\r\n\n\n/***/ },\n/* 19 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = {\n\t isString: function(arg) {\n\t return typeof(arg) === 'string';\n\t },\n\t isObject: function(arg) {\n\t return typeof(arg) === 'object' && arg !== null;\n\t },\n\t isNull: function(arg) {\n\t return arg === null;\n\t },\n\t isNullOrUndefined: function(arg) {\n\t return arg == null;\n\t }\n\t};\n\n\n/***/ },\n/* 20 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\texports.decode = exports.parse = __webpack_require__(21);\n\texports.encode = exports.stringify = __webpack_require__(22);\n\n\n/***/ },\n/* 21 */\n/***/ function(module, exports) {\n\n\t// Copyright Joyent, Inc. and other Node contributors.\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a\n\t// copy of this software and associated documentation files (the\n\t// \"Software\"), to deal in the Software without restriction, including\n\t// without limitation the rights to use, copy, modify, merge, publish,\n\t// distribute, sublicense, and/or sell copies of the Software, and to permit\n\t// persons to whom the Software is furnished to do so, subject to the\n\t// following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included\n\t// in all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n\t// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\t// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n\t// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n\t// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n\t// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n\t// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\t\n\t'use strict';\n\t\n\t// If obj.hasOwnProperty has been overridden, then calling\n\t// obj.hasOwnProperty(prop) will break.\n\t// See: https://github.com/joyent/node/issues/1707\n\tfunction hasOwnProperty(obj, prop) {\n\t return Object.prototype.hasOwnProperty.call(obj, prop);\n\t}\n\t\n\tmodule.exports = function(qs, sep, eq, options) {\n\t sep = sep || '&';\n\t eq = eq || '=';\n\t var obj = {};\n\t\n\t if (typeof qs !== 'string' || qs.length === 0) {\n\t return obj;\n\t }\n\t\n\t var regexp = /\\+/g;\n\t qs = qs.split(sep);\n\t\n\t var maxKeys = 1000;\n\t if (options && typeof options.maxKeys === 'number') {\n\t maxKeys = options.maxKeys;\n\t }\n\t\n\t var len = qs.length;\n\t // maxKeys <= 0 means that we should not limit keys count\n\t if (maxKeys > 0 && len > maxKeys) {\n\t len = maxKeys;\n\t }\n\t\n\t for (var i = 0; i < len; ++i) {\n\t var x = qs[i].replace(regexp, '%20'),\n\t idx = x.indexOf(eq),\n\t kstr, vstr, k, v;\n\t\n\t if (idx >= 0) {\n\t kstr = x.substr(0, idx);\n\t vstr = x.substr(idx + 1);\n\t } else {\n\t kstr = x;\n\t vstr = '';\n\t }\n\t\n\t k = decodeURIComponent(kstr);\n\t v = decodeURIComponent(vstr);\n\t\n\t if (!hasOwnProperty(obj, k)) {\n\t obj[k] = v;\n\t } else if (Array.isArray(obj[k])) {\n\t obj[k].push(v);\n\t } else {\n\t obj[k] = [obj[k], v];\n\t }\n\t }\n\t\n\t return obj;\n\t};\n\n\n/***/ },\n/* 22 */\n/***/ function(module, exports) {\n\n\t// Copyright Joyent, Inc. and other Node contributors.\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a\n\t// copy of this software and associated documentation files (the\n\t// \"Software\"), to deal in the Software without restriction, including\n\t// without limitation the rights to use, copy, modify, merge, publish,\n\t// distribute, sublicense, and/or sell copies of the Software, and to permit\n\t// persons to whom the Software is furnished to do so, subject to the\n\t// following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included\n\t// in all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n\t// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\t// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n\t// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n\t// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n\t// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n\t// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\t\n\t'use strict';\n\t\n\tvar stringifyPrimitive = function(v) {\n\t switch (typeof v) {\n\t case 'string':\n\t return v;\n\t\n\t case 'boolean':\n\t return v ? 'true' : 'false';\n\t\n\t case 'number':\n\t return isFinite(v) ? v : '';\n\t\n\t default:\n\t return '';\n\t }\n\t};\n\t\n\tmodule.exports = function(obj, sep, eq, name) {\n\t sep = sep || '&';\n\t eq = eq || '=';\n\t if (obj === null) {\n\t obj = undefined;\n\t }\n\t\n\t if (typeof obj === 'object') {\n\t return Object.keys(obj).map(function(k) {\n\t var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;\n\t if (Array.isArray(obj[k])) {\n\t return obj[k].map(function(v) {\n\t return ks + encodeURIComponent(stringifyPrimitive(v));\n\t }).join(sep);\n\t } else {\n\t return ks + encodeURIComponent(stringifyPrimitive(obj[k]));\n\t }\n\t }).join(sep);\n\t\n\t }\n\t\n\t if (!name) return '';\n\t return encodeURIComponent(stringifyPrimitive(name)) + eq +\n\t encodeURIComponent(stringifyPrimitive(obj));\n\t};\n\n\n/***/ },\n/* 23 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"id\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"description\": \"Core schema meta-schema\",\n\t\t\"definitions\": {\n\t\t\t\"schemaArray\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"minItems\": 1,\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"positiveInteger\": {\n\t\t\t\t\"type\": \"integer\",\n\t\t\t\t\"minimum\": 0\n\t\t\t},\n\t\t\t\"positiveIntegerDefault0\": {\n\t\t\t\t\"allOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#/definitions/positiveInteger\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"default\": 0\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"simpleTypes\": {\n\t\t\t\t\"enum\": [\n\t\t\t\t\t\"array\",\n\t\t\t\t\t\"boolean\",\n\t\t\t\t\t\"integer\",\n\t\t\t\t\t\"null\",\n\t\t\t\t\t\"number\",\n\t\t\t\t\t\"object\",\n\t\t\t\t\t\"string\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"stringArray\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t},\n\t\t\t\t\"minItems\": 1,\n\t\t\t\t\"uniqueItems\": true\n\t\t\t}\n\t\t},\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"id\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"uri\"\n\t\t\t},\n\t\t\t\"$schema\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"uri\"\n\t\t\t},\n\t\t\t\"title\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"description\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"default\": {},\n\t\t\t\"multipleOf\": {\n\t\t\t\t\"type\": \"number\",\n\t\t\t\t\"minimum\": 0,\n\t\t\t\t\"exclusiveMinimum\": true\n\t\t\t},\n\t\t\t\"maximum\": {\n\t\t\t\t\"type\": \"number\"\n\t\t\t},\n\t\t\t\"exclusiveMaximum\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"minimum\": {\n\t\t\t\t\"type\": \"number\"\n\t\t\t},\n\t\t\t\"exclusiveMinimum\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"maxLength\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveInteger\"\n\t\t\t},\n\t\t\t\"minLength\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveIntegerDefault0\"\n\t\t\t},\n\t\t\t\"pattern\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"regex\"\n\t\t\t},\n\t\t\t\"additionalItems\": {\n\t\t\t\t\"anyOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"boolean\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"items\": {\n\t\t\t\t\"anyOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#/definitions/schemaArray\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"maxItems\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveInteger\"\n\t\t\t},\n\t\t\t\"minItems\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveIntegerDefault0\"\n\t\t\t},\n\t\t\t\"uniqueItems\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"maxProperties\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveInteger\"\n\t\t\t},\n\t\t\t\"minProperties\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveIntegerDefault0\"\n\t\t\t},\n\t\t\t\"required\": {\n\t\t\t\t\"$ref\": \"#/definitions/stringArray\"\n\t\t\t},\n\t\t\t\"additionalProperties\": {\n\t\t\t\t\"anyOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"boolean\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"definitions\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": {\n\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t},\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"properties\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": {\n\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t},\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"patternProperties\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": {\n\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t},\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"dependencies\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": {\n\t\t\t\t\t\"anyOf\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"$ref\": \"#/definitions/stringArray\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"enum\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"minItems\": 1,\n\t\t\t\t\"uniqueItems\": true\n\t\t\t},\n\t\t\t\"type\": {\n\t\t\t\t\"anyOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#/definitions/simpleTypes\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"array\",\n\t\t\t\t\t\t\"items\": {\n\t\t\t\t\t\t\t\"$ref\": \"#/definitions/simpleTypes\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"minItems\": 1,\n\t\t\t\t\t\t\"uniqueItems\": true\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"allOf\": {\n\t\t\t\t\"$ref\": \"#/definitions/schemaArray\"\n\t\t\t},\n\t\t\t\"anyOf\": {\n\t\t\t\t\"$ref\": \"#/definitions/schemaArray\"\n\t\t\t},\n\t\t\t\"oneOf\": {\n\t\t\t\t\"$ref\": \"#/definitions/schemaArray\"\n\t\t\t},\n\t\t\t\"not\": {\n\t\t\t\t\"$ref\": \"#\"\n\t\t\t}\n\t\t},\n\t\t\"dependencies\": {\n\t\t\t\"exclusiveMaximum\": [\n\t\t\t\t\"maximum\"\n\t\t\t],\n\t\t\t\"exclusiveMinimum\": [\n\t\t\t\t\"minimum\"\n\t\t\t]\n\t\t},\n\t\t\"default\": {}\n\t};\n\n/***/ },\n/* 24 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tvar formats = {};\n\t\n\t// reference: http://dansnetwork.com/javascript-iso8601rfc3339-date-parser/\n\tformats['date-time'] = /(\\d\\d\\d\\d)(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))/;\n\t// reference: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js#L7\n\tformats.uri = /^([a-zA-Z][a-zA-Z0-9+-.]*:){0,1}\\/\\/[^\\s]*$/;\n\t// reference: http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363\n\t// http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'willful violation')\n\tformats.email = /^[a-zA-Z0-9.!#$%&'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n\t// reference: https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html\n\tformats.ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;\n\t// reference: http://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses\n\tformats.ipv6 = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|[fF][eE]80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::([fF]{4}(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;\n\t// reference: http://stackoverflow.com/questions/106179/regular-expression-to-match-dns-hostname-or-ip-address#answer-3824105\n\tformats.hostname = /^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])(\\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]))*$/;\n\t\n\tmodule.exports = formats;\n\n/***/ },\n/* 25 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\t// Reference: https://github.com/bestiejs/punycode.js/blob/master/punycode.js#L101`\n\t// Info: https://mathiasbynens.be/notes/javascript-unicode\n\tfunction ucs2length(string) {\n\t var ucs2len = 0,\n\t counter = 0,\n\t length = string.length,\n\t value, extra;\n\t\n\t while (counter < length) {\n\t ucs2len++;\n\t value = string.charCodeAt(counter++);\n\t\n\t if (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t // It's a high surrogate, and there is a next character.\n\t extra = string.charCodeAt(counter++);\n\t\n\t if ((extra & 0xFC00) !== 0xDC00) { /* Low surrogate. */ // jshint ignore: line\n\t counter--;\n\t }\n\t }\n\t }\n\t\n\t return ucs2len;\n\t}\n\t\n\tmodule.exports = ucs2length;\n\n/***/ }\n/******/ ])\n});\n;\n//# sourceMappingURL=models.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/powerbi-models/dist/models.js\n// module id = 5\n// module chunks = 0","import { IFilterable } from './ifilterable';\r\nimport { IReportNode } from './report';\r\nimport * as models from 'powerbi-models';\r\n\r\n/**\r\n * A Page node within a report hierarchy\r\n * \r\n * @export\r\n * @interface IPageNode\r\n */\r\nexport interface IPageNode {\r\n report: IReportNode;\r\n name: string;\r\n}\r\n\r\n/**\r\n * A Power BI report page\r\n * \r\n * @export\r\n * @class Page\r\n * @implements {IPageNode}\r\n * @implements {IFilterable}\r\n */\r\nexport class Page implements IPageNode, IFilterable {\r\n /**\r\n * The parent Power BI report that this page is a member of\r\n * \r\n * @type {IReportNode}\r\n */\r\n report: IReportNode;\r\n /**\r\n * The report page name\r\n * \r\n * @type {string}\r\n */\r\n name: string;\r\n\r\n /**\r\n * The user defined display name of the report page, which is undefined if the page is created manually\r\n * \r\n * @type {string}\r\n */\r\n displayName: string;\r\n\r\n /**\r\n * Creates an instance of a Power BI report page.\r\n * \r\n * @param {IReportNode} report\r\n * @param {string} name\r\n * @param {string} [displayName]\r\n */\r\n constructor(report: IReportNode, name: string, displayName?: string) {\r\n this.report = report;\r\n this.name = name;\r\n this.displayName = displayName;\r\n }\r\n\r\n /**\r\n * Gets all page level filters within the report.\r\n * \r\n * ```javascript\r\n * page.getFilters()\r\n * .then(pages => { ... });\r\n * ```\r\n * \r\n * @returns {(Promise)}\r\n */\r\n getFilters(): Promise {\r\n return this.report.service.hpm.get(`/report/pages/${this.name}/filters`, { uid: this.report.config.uniqueId }, this.report.iframe.contentWindow)\r\n .then(response => response.body,\r\n response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Removes all filters from this page of the report.\r\n * \r\n * ```javascript\r\n * page.removeFilters();\r\n * ```\r\n * \r\n * @returns {Promise}\r\n */\r\n removeFilters(): Promise {\r\n return this.setFilters([]);\r\n }\r\n\r\n /**\r\n * Makes the current page the active page of the report.\r\n * \r\n * ```javascripot\r\n * page.setActive();\r\n * ```\r\n * \r\n * @returns {Promise}\r\n */\r\n setActive(): Promise {\r\n const page: models.IPage = {\r\n name: this.name,\r\n displayName: null\r\n };\r\n\r\n return this.report.service.hpm.put('/report/pages/active', page, { uid: this.report.config.uniqueId }, this.report.iframe.contentWindow)\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Sets all filters on the current page.\r\n * \r\n * ```javascript\r\n * page.setFilters(filters);\r\n * .catch(errors => { ... });\r\n * ```\r\n * \r\n * @param {(models.IFilter[])} filters\r\n * @returns {Promise}\r\n */\r\n setFilters(filters: models.IFilter[]): Promise {\r\n return this.report.service.hpm.put(`/report/pages/${this.name}/filters`, filters, { uid: this.report.config.uniqueId }, this.report.iframe.contentWindow)\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/page.ts","import * as service from './service';\r\nimport * as models from 'powerbi-models';\r\nimport * as embed from './embed';\r\n\r\nexport class Create extends embed.Embed {\r\n\r\n constructor(service: service.Service, element: HTMLElement, config: embed.IEmbedConfiguration) {\r\n super(service, element, config);\r\n }\r\n\r\n /**\r\n * Gets the dataset ID from the first available location: createConfig or embed url.\r\n * \r\n * @returns {string}\r\n */\r\n getId(): string {\r\n const datasetId = (this.createConfig && this.createConfig.datasetId) ? this.createConfig.datasetId : Create.findIdFromEmbedUrl(this.config.embedUrl);\r\n\r\n if (typeof datasetId !== 'string' || datasetId.length === 0) {\r\n throw new Error('Dataset id is required, but it was not found. You must provide an id either as part of embed configuration.');\r\n }\r\n\r\n return datasetId;\r\n }\r\n\r\n /**\r\n * Validate create report configuration.\r\n */\r\n validate(config: models.IReportCreateConfiguration): models.IError[] {\r\n return models.validateCreateReport(config);\r\n }\r\n\r\n /**\r\n * Adds the ability to get datasetId from url. \r\n * (e.g. http://embedded.powerbi.com/appTokenReportEmbed?datasetId=854846ed-2106-4dc2-bc58-eb77533bf2f1).\r\n * \r\n * By extracting the ID we can ensure that the ID is always explicitly provided as part of the create configuration.\r\n * \r\n * @static\r\n * @param {string} url\r\n * @returns {string}\r\n */\r\n static findIdFromEmbedUrl(url: string): string {\r\n const datasetIdRegEx = /datasetId=\"?([^&]+)\"?/\r\n const datasetIdMatch = url.match(datasetIdRegEx);\r\n\r\n let datasetId;\r\n if (datasetIdMatch) {\r\n datasetId = datasetIdMatch[1];\r\n }\r\n\r\n return datasetId;\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/create.ts","import * as service from './service';\r\nimport * as embed from './embed';\r\nimport * as models from 'powerbi-models';\r\nimport * as wpmp from 'window-post-message-proxy';\r\nimport * as hpm from 'http-post-message';\r\nimport * as utils from './util';\r\n\r\n/**\r\n * A Dashboard node within a dashboard hierarchy\r\n * \r\n * @export\r\n * @interface IDashboardNode\r\n */\r\nexport interface IDashboardNode {\r\n iframe: HTMLIFrameElement;\r\n service: service.IService;\r\n config: embed.IInternalEmbedConfiguration\r\n}\r\n\r\n/**\r\n * A Power BI Dashboard embed component\r\n * \r\n * @export\r\n * @class Dashboard\r\n * @extends {embed.Embed}\r\n * @implements {IDashboardNode}\r\n * @implements {IFilterable}\r\n */\r\nexport class Dashboard extends embed.Embed implements IDashboardNode {\r\n static allowedEvents = [\"tileClicked\", \"error\"];\r\n static dashboardIdAttribute = 'powerbi-dashboard-id';\r\n static typeAttribute = 'powerbi-type';\r\n static type = \"Dashboard\";\r\n\r\n /**\r\n * Creates an instance of a Power BI Dashboard.\r\n * \r\n * @param {service.Service} service\r\n * @param {HTMLElement} element\r\n */\r\n constructor(service: service.Service, element: HTMLElement, config: embed.IEmbedConfiguration) {\r\n super(service, element, config);\r\n this.loadPath = \"/dashboard/load\";\r\n Array.prototype.push.apply(this.allowedEvents, Dashboard.allowedEvents);\r\n }\r\n\r\n /**\r\n * This adds backwards compatibility for older config which used the dashboardId query param to specify dashboard id.\r\n * E.g. https://powerbi-df.analysis-df.windows.net/dashboardEmbedHost?dashboardId=e9363c62-edb6-4eac-92d3-2199c5ca2a9e\r\n * \r\n * By extracting the id we can ensure id is always explicitly provided as part of the load configuration.\r\n * \r\n * @static\r\n * @param {string} url\r\n * @returns {string}\r\n */\r\n static findIdFromEmbedUrl(url: string): string {\r\n const dashboardIdRegEx = /dashboardId=\"?([^&]+)\"?/\r\n const dashboardIdMatch = url.match(dashboardIdRegEx);\r\n\r\n let dashboardId;\r\n if (dashboardIdMatch) {\r\n dashboardId = dashboardIdMatch[1];\r\n }\r\n\r\n return dashboardId;\r\n }\r\n\r\n /**\r\n * Get dashboard id from first available location: options, attribute, embed url.\r\n * \r\n * @returns {string}\r\n */\r\n getId(): string {\r\n const dashboardId = this.config.id || this.element.getAttribute(Dashboard.dashboardIdAttribute) || Dashboard.findIdFromEmbedUrl(this.config.embedUrl);\r\n\r\n if (typeof dashboardId !== 'string' || dashboardId.length === 0) {\r\n throw new Error(`Dashboard id is required, but it was not found. You must provide an id either as part of embed configuration or as attribute '${Dashboard.dashboardIdAttribute}'.`);\r\n }\r\n\r\n return dashboardId;\r\n }\r\n\r\n /**\r\n * Validate load configuration.\r\n */\r\n validate(config: models.IDashboardLoadConfiguration): models.IError[] {\r\n let error = models.validateDashboardLoad(config);\r\n return error ? error : this.ValidatePageView(config.pageView);\r\n }\r\n \r\n /**\r\n * Validate that pageView has a legal value: if page view is defined it must have one of the values defined in models.PageView\r\n */\r\n private ValidatePageView(pageView: models.PageView): models.IError[] {\r\n if (pageView && pageView !== \"fitToWidth\" && pageView !== \"oneColumn\" && pageView !== \"actualSize\") {\r\n return [{message: \"pageView must be one of the followings: fitToWidth, oneColumn, actualSize\"}];\r\n }\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/dashboard.ts","import * as models from 'powerbi-models';\r\nimport { Embed } from './embed';\r\n\r\n/**\r\n * The Power BI tile embed component\r\n * \r\n * @export\r\n * @class Tile\r\n * @extends {Embed}\r\n */\r\nexport class Tile extends Embed {\r\n static type = \"Tile\";\r\n\r\n /**\r\n * The ID of the tile\r\n * \r\n * @returns {string}\r\n */\r\n getId(): string {\r\n throw new Error('Not implemented. Embedding tiles is not supported yet.');\r\n }\r\n\r\n /**\r\n * Validate load configuration.\r\n */\r\n validate(config: any): models.IError[] {\r\n throw new Error('Not implemented. Embedding tiles is not supported yet.');\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/tile.ts","/**\r\n * TODO: Need to find better place for these factory functions or refactor how we handle dependency injection\r\n */\r\nimport { IHpmFactory, IWpmpFactory, IRouterFactory } from './service';\r\nimport config from './config';\r\nimport * as wpmp from 'window-post-message-proxy';\r\nimport * as hpm from 'http-post-message';\r\nimport * as router from 'powerbi-router';\r\n\r\nexport {\r\n IHpmFactory,\r\n IWpmpFactory,\r\n IRouterFactory\r\n};\r\n\r\nexport const hpmFactory: IHpmFactory = (wpmp, defaultTargetWindow, sdkVersion = config.version, sdkType = config.type) => {\r\n return new hpm.HttpPostMessage(wpmp, {\r\n 'x-sdk-type': sdkType,\r\n 'x-sdk-version': sdkVersion\r\n }, defaultTargetWindow);\r\n};\r\n\r\nexport const wpmpFactory: IWpmpFactory = (name?: string, logMessages?: boolean, eventSourceOverrideWindow?: Window) => {\r\n return new wpmp.WindowPostMessageProxy({\r\n processTrackingProperties: {\r\n addTrackingProperties: hpm.HttpPostMessage.addTrackingProperties,\r\n getTrackingProperties: hpm.HttpPostMessage.getTrackingProperties,\r\n },\r\n isErrorMessage: hpm.HttpPostMessage.isErrorMessage,\r\n name,\r\n logMessages,\r\n eventSourceOverrideWindow\r\n });\r\n};\r\n\r\nexport const routerFactory: IRouterFactory = (wpmp) => {\r\n return new router.Router(wpmp);\r\n};\n\n\n// WEBPACK FOOTER //\n// ./src/factories.ts","const config = {\r\n version: '2.2.3',\r\n type: 'js'\r\n};\r\n\r\nexport default config;\n\n\n// WEBPACK FOOTER //\n// ./src/config.ts","/*! window-post-message-proxy v0.2.4 | (c) 2016 Microsoft Corporation MIT */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"window-post-message-proxy\"] = factory();\n\telse\n\t\troot[\"window-post-message-proxy\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\tvar WindowPostMessageProxy = (function () {\n\t function WindowPostMessageProxy(options) {\n\t var _this = this;\n\t if (options === void 0) { options = {\n\t processTrackingProperties: {\n\t addTrackingProperties: WindowPostMessageProxy.defaultAddTrackingProperties,\n\t getTrackingProperties: WindowPostMessageProxy.defaultGetTrackingProperties\n\t },\n\t isErrorMessage: WindowPostMessageProxy.defaultIsErrorMessage,\n\t receiveWindow: window,\n\t name: WindowPostMessageProxy.createRandomString()\n\t }; }\n\t this.pendingRequestPromises = {};\n\t // save options with defaults\n\t this.addTrackingProperties = (options.processTrackingProperties && options.processTrackingProperties.addTrackingProperties) || WindowPostMessageProxy.defaultAddTrackingProperties;\n\t this.getTrackingProperties = (options.processTrackingProperties && options.processTrackingProperties.getTrackingProperties) || WindowPostMessageProxy.defaultGetTrackingProperties;\n\t this.isErrorMessage = options.isErrorMessage || WindowPostMessageProxy.defaultIsErrorMessage;\n\t this.receiveWindow = options.receiveWindow || window;\n\t this.name = options.name || WindowPostMessageProxy.createRandomString();\n\t this.logMessages = options.logMessages || false;\n\t this.eventSourceOverrideWindow = options.eventSourceOverrideWindow;\n\t this.suppressWarnings = options.suppressWarnings || false;\n\t if (this.logMessages) {\n\t console.log(\"new WindowPostMessageProxy created with name: \" + this.name + \" receiving on window: \" + this.receiveWindow.document.title);\n\t }\n\t // Initialize\n\t this.handlers = [];\n\t this.windowMessageHandler = function (event) { return _this.onMessageReceived(event); };\n\t this.start();\n\t }\n\t // Static\n\t WindowPostMessageProxy.defaultAddTrackingProperties = function (message, trackingProperties) {\n\t message[WindowPostMessageProxy.messagePropertyName] = trackingProperties;\n\t return message;\n\t };\n\t WindowPostMessageProxy.defaultGetTrackingProperties = function (message) {\n\t return message[WindowPostMessageProxy.messagePropertyName];\n\t };\n\t WindowPostMessageProxy.defaultIsErrorMessage = function (message) {\n\t return !!message.error;\n\t };\n\t /**\n\t * Utility to create a deferred object.\n\t */\n\t // TODO: Look to use RSVP library instead of doing this manually.\n\t // From what I searched RSVP would work better because it has .finally and .deferred; however, it doesn't have Typings information. \n\t WindowPostMessageProxy.createDeferred = function () {\n\t var deferred = {\n\t resolve: null,\n\t reject: null,\n\t promise: null\n\t };\n\t var promise = new Promise(function (resolve, reject) {\n\t deferred.resolve = resolve;\n\t deferred.reject = reject;\n\t });\n\t deferred.promise = promise;\n\t return deferred;\n\t };\n\t /**\n\t * Utility to generate random sequence of characters used as tracking id for promises.\n\t */\n\t WindowPostMessageProxy.createRandomString = function () {\n\t return (Math.random() + 1).toString(36).substring(7);\n\t };\n\t /**\n\t * Adds handler.\n\t * If the first handler whose test method returns true will handle the message and provide a response.\n\t */\n\t WindowPostMessageProxy.prototype.addHandler = function (handler) {\n\t this.handlers.push(handler);\n\t };\n\t /**\n\t * Removes handler.\n\t * The reference must match the original object that was provided when adding the handler.\n\t */\n\t WindowPostMessageProxy.prototype.removeHandler = function (handler) {\n\t var handlerIndex = this.handlers.indexOf(handler);\n\t if (handlerIndex === -1) {\n\t throw new Error(\"You attempted to remove a handler but no matching handler was found.\");\n\t }\n\t this.handlers.splice(handlerIndex, 1);\n\t };\n\t /**\n\t * Start listening to message events.\n\t */\n\t WindowPostMessageProxy.prototype.start = function () {\n\t this.receiveWindow.addEventListener('message', this.windowMessageHandler);\n\t };\n\t /**\n\t * Stops listening to message events.\n\t */\n\t WindowPostMessageProxy.prototype.stop = function () {\n\t this.receiveWindow.removeEventListener('message', this.windowMessageHandler);\n\t };\n\t /**\n\t * Post message to target window with tracking properties added and save deferred object referenced by tracking id.\n\t */\n\t WindowPostMessageProxy.prototype.postMessage = function (targetWindow, message) {\n\t // Add tracking properties to indicate message came from this proxy\n\t var trackingProperties = { id: WindowPostMessageProxy.createRandomString() };\n\t this.addTrackingProperties(message, trackingProperties);\n\t if (this.logMessages) {\n\t console.log(this.name + \" Posting message:\");\n\t console.log(JSON.stringify(message, null, ' '));\n\t }\n\t targetWindow.postMessage(message, \"*\");\n\t var deferred = WindowPostMessageProxy.createDeferred();\n\t this.pendingRequestPromises[trackingProperties.id] = deferred;\n\t return deferred.promise;\n\t };\n\t /**\n\t * Send response message to target window.\n\t * Response messages re-use tracking properties from a previous request message.\n\t */\n\t WindowPostMessageProxy.prototype.sendResponse = function (targetWindow, message, trackingProperties) {\n\t this.addTrackingProperties(message, trackingProperties);\n\t if (this.logMessages) {\n\t console.log(this.name + \" Sending response:\");\n\t console.log(JSON.stringify(message, null, ' '));\n\t }\n\t targetWindow.postMessage(message, \"*\");\n\t };\n\t /**\n\t * Message handler.\n\t */\n\t WindowPostMessageProxy.prototype.onMessageReceived = function (event) {\n\t var _this = this;\n\t if (this.logMessages) {\n\t console.log(this.name + \" Received message:\");\n\t console.log(\"type: \" + event.type);\n\t console.log(JSON.stringify(event.data, null, ' '));\n\t }\n\t var sendingWindow = this.eventSourceOverrideWindow || event.source;\n\t var message = event.data;\n\t if (typeof message !== \"object\") {\n\t if (!this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + this.name + \"): Received message that was not an object. Discarding message\");\n\t }\n\t return;\n\t }\n\t var trackingProperties;\n\t try {\n\t trackingProperties = this.getTrackingProperties(message);\n\t }\n\t catch (e) {\n\t if (!this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + this.name + \"): Error occurred when attempting to get tracking properties from incoming message:\", JSON.stringify(message, null, ' '), \"Error: \", e);\n\t }\n\t }\n\t var deferred;\n\t if (trackingProperties) {\n\t deferred = this.pendingRequestPromises[trackingProperties.id];\n\t }\n\t // If message does not have a known ID, treat it as a request\n\t // Otherwise, treat message as response\n\t if (!deferred) {\n\t var handled = this.handlers.some(function (handler) {\n\t var canMessageBeHandled = false;\n\t try {\n\t canMessageBeHandled = handler.test(message);\n\t }\n\t catch (e) {\n\t if (!_this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + _this.name + \"): Error occurred when handler was testing incoming message:\", JSON.stringify(message, null, ' '), \"Error: \", e);\n\t }\n\t }\n\t if (canMessageBeHandled) {\n\t var responseMessagePromise = void 0;\n\t try {\n\t responseMessagePromise = Promise.resolve(handler.handle(message));\n\t }\n\t catch (e) {\n\t if (!_this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + _this.name + \"): Error occurred when handler was processing incoming message:\", JSON.stringify(message, null, ' '), \"Error: \", e);\n\t }\n\t responseMessagePromise = Promise.resolve();\n\t }\n\t responseMessagePromise\n\t .then(function (responseMessage) {\n\t if (!responseMessage) {\n\t var warningMessage = \"Handler for message: \" + JSON.stringify(message, null, ' ') + \" did not return a response message. The default response message will be returned instead.\";\n\t if (!_this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + _this.name + \"): \" + warningMessage);\n\t }\n\t responseMessage = {\n\t warning: warningMessage\n\t };\n\t }\n\t _this.sendResponse(sendingWindow, responseMessage, trackingProperties);\n\t });\n\t return true;\n\t }\n\t });\n\t /**\n\t * TODO: Consider returning an error message if nothing handled the message.\n\t * In the case of the Report receiving messages all of them should be handled,\n\t * however, in the case of the SDK receiving messages it's likely it won't register handlers\n\t * for all events. Perhaps make this an option at construction time.\n\t */\n\t if (!handled && !this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + this.name + \") did not handle message. Handlers: \" + this.handlers.length + \" Message: \" + JSON.stringify(message, null, '') + \".\");\n\t }\n\t }\n\t else {\n\t /**\n\t * If error message reject promise,\n\t * Otherwise, resolve promise\n\t */\n\t var isErrorMessage = true;\n\t try {\n\t isErrorMessage = this.isErrorMessage(message);\n\t }\n\t catch (e) {\n\t console.warn(\"Proxy(\" + this.name + \") Error occurred when trying to determine if message is consider an error response. Message: \", JSON.stringify(message, null, ''), 'Error: ', e);\n\t }\n\t if (isErrorMessage) {\n\t deferred.reject(message);\n\t }\n\t else {\n\t deferred.resolve(message);\n\t }\n\t // TODO: Move to .finally clause up where promise is created for better maitenance like original proxy code.\n\t delete this.pendingRequestPromises[trackingProperties.id];\n\t }\n\t };\n\t WindowPostMessageProxy.messagePropertyName = \"windowPostMessageProxy\";\n\t return WindowPostMessageProxy;\n\t}());\n\texports.WindowPostMessageProxy = WindowPostMessageProxy;\n\n\n/***/ }\n/******/ ])\n});\n;\n//# sourceMappingURL=windowPostMessageProxy.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/window-post-message-proxy/dist/windowPostMessageProxy.js\n// module id = 12\n// module chunks = 0","/*! http-post-message v0.2.3 | (c) 2016 Microsoft Corporation MIT */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"http-post-message\"] = factory();\n\telse\n\t\troot[\"http-post-message\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\tvar HttpPostMessage = (function () {\n\t function HttpPostMessage(windowPostMessageProxy, defaultHeaders, defaultTargetWindow) {\n\t if (defaultHeaders === void 0) { defaultHeaders = {}; }\n\t this.defaultHeaders = defaultHeaders;\n\t this.defaultTargetWindow = defaultTargetWindow;\n\t this.windowPostMessageProxy = windowPostMessageProxy;\n\t }\n\t // TODO: See if it's possible to share tracking properties interface?\n\t // The responsibility of knowing how to configure windowPostMessageProxy for http should\n\t // live in this http class, but the configuration would need ITrackingProperties\n\t // interface which lives in WindowPostMessageProxy. Use type as workaround\n\t HttpPostMessage.addTrackingProperties = function (message, trackingProperties) {\n\t message.headers = message.headers || {};\n\t if (trackingProperties && trackingProperties.id) {\n\t message.headers.id = trackingProperties.id;\n\t }\n\t return message;\n\t };\n\t HttpPostMessage.getTrackingProperties = function (message) {\n\t return {\n\t id: message.headers && message.headers.id\n\t };\n\t };\n\t HttpPostMessage.isErrorMessage = function (message) {\n\t if (typeof (message && message.statusCode) !== 'number') {\n\t return false;\n\t }\n\t return !(200 <= message.statusCode && message.statusCode < 300);\n\t };\n\t HttpPostMessage.prototype.get = function (url, headers, targetWindow) {\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"GET\",\n\t url: url,\n\t headers: headers\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.post = function (url, body, headers, targetWindow) {\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"POST\",\n\t url: url,\n\t headers: headers,\n\t body: body\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.put = function (url, body, headers, targetWindow) {\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"PUT\",\n\t url: url,\n\t headers: headers,\n\t body: body\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.patch = function (url, body, headers, targetWindow) {\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"PATCH\",\n\t url: url,\n\t headers: headers,\n\t body: body\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.delete = function (url, body, headers, targetWindow) {\n\t if (body === void 0) { body = null; }\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"DELETE\",\n\t url: url,\n\t headers: headers,\n\t body: body\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.send = function (request, targetWindow) {\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t request.headers = this.assign({}, this.defaultHeaders, request.headers);\n\t if (!targetWindow) {\n\t throw new Error(\"target window is not provided. You must either provide the target window explicitly as argument to request, or specify default target window when constructing instance of this class.\");\n\t }\n\t return this.windowPostMessageProxy.postMessage(targetWindow, request);\n\t };\n\t /**\n\t * Object.assign() polyfill\n\t * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\n\t */\n\t HttpPostMessage.prototype.assign = function (target) {\n\t var sources = [];\n\t for (var _i = 1; _i < arguments.length; _i++) {\n\t sources[_i - 1] = arguments[_i];\n\t }\n\t if (target === undefined || target === null) {\n\t throw new TypeError('Cannot convert undefined or null to object');\n\t }\n\t var output = Object(target);\n\t sources.forEach(function (source) {\n\t if (source !== undefined && source !== null) {\n\t for (var nextKey in source) {\n\t if (Object.prototype.hasOwnProperty.call(source, nextKey)) {\n\t output[nextKey] = source[nextKey];\n\t }\n\t }\n\t }\n\t });\n\t return output;\n\t };\n\t return HttpPostMessage;\n\t}());\n\texports.HttpPostMessage = HttpPostMessage;\n\n\n/***/ }\n/******/ ])\n});\n;\n//# sourceMappingURL=httpPostMessage.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/http-post-message/dist/httpPostMessage.js\n// module id = 13\n// module chunks = 0","/*! powerbi-router v0.1.5 | (c) 2016 Microsoft Corporation MIT */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"powerbi-router\"] = factory();\n\telse\n\t\troot[\"powerbi-router\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar RouteRecognizer = __webpack_require__(1);\n\tvar Router = (function () {\n\t function Router(handlers) {\n\t this.handlers = handlers;\n\t /**\n\t * TODO: look at generating the router dynamically based on list of supported http methods\n\t * instead of hardcoding the creation of these and the methods.\n\t */\n\t this.getRouteRecognizer = new RouteRecognizer();\n\t this.patchRouteRecognizer = new RouteRecognizer();\n\t this.postRouteRecognizer = new RouteRecognizer();\n\t this.putRouteRecognizer = new RouteRecognizer();\n\t this.deleteRouteRecognizer = new RouteRecognizer();\n\t }\n\t Router.prototype.get = function (url, handler) {\n\t this.registerHandler(this.getRouteRecognizer, \"GET\", url, handler);\n\t return this;\n\t };\n\t Router.prototype.patch = function (url, handler) {\n\t this.registerHandler(this.patchRouteRecognizer, \"PATCH\", url, handler);\n\t return this;\n\t };\n\t Router.prototype.post = function (url, handler) {\n\t this.registerHandler(this.postRouteRecognizer, \"POST\", url, handler);\n\t return this;\n\t };\n\t Router.prototype.put = function (url, handler) {\n\t this.registerHandler(this.putRouteRecognizer, \"PUT\", url, handler);\n\t return this;\n\t };\n\t Router.prototype.delete = function (url, handler) {\n\t this.registerHandler(this.deleteRouteRecognizer, \"DELETE\", url, handler);\n\t return this;\n\t };\n\t /**\n\t * TODO: This method could use some refactoring. There is conflict of interest between keeping clean separation of test and handle method\n\t * Test method only returns boolean indicating if request can be handled, and handle method has opportunity to modify response and return promise of it.\n\t * In the case of the router with route-recognizer where handlers are associated with routes, this already guarantees that only one handler is selected and makes the test method feel complicated\n\t * Will leave as is an investigate cleaner ways at later time.\n\t */\n\t Router.prototype.registerHandler = function (routeRecognizer, method, url, handler) {\n\t var routeRecognizerHandler = function (request) {\n\t var response = new Response();\n\t return Promise.resolve(handler(request, response))\n\t .then(function (x) { return response; });\n\t };\n\t routeRecognizer.add([\n\t { path: url, handler: routeRecognizerHandler }\n\t ]);\n\t var internalHandler = {\n\t test: function (request) {\n\t if (request.method !== method) {\n\t return false;\n\t }\n\t var matchingRoutes = routeRecognizer.recognize(request.url);\n\t if (matchingRoutes === undefined) {\n\t return false;\n\t }\n\t /**\n\t * Copy parameters from recognized route to the request so they can be used within the handler function\n\t * This isn't ideal because it is side affect which modifies the request instead of strictly testing for true or false\n\t * but I don't see a better place to put this. If we move it between the call to test and the handle it becomes part of the window post message proxy\n\t * even though it's responsibility is related to routing.\n\t */\n\t var route = matchingRoutes[0];\n\t request.params = route.params;\n\t request.queryParams = matchingRoutes.queryParams;\n\t request.handler = route.handler;\n\t return true;\n\t },\n\t handle: function (request) {\n\t return request.handler(request);\n\t }\n\t };\n\t this.handlers.addHandler(internalHandler);\n\t };\n\t return Router;\n\t}());\n\texports.Router = Router;\n\tvar Response = (function () {\n\t function Response() {\n\t this.statusCode = 200;\n\t this.headers = {};\n\t this.body = null;\n\t }\n\t Response.prototype.send = function (statusCode, body) {\n\t this.statusCode = statusCode;\n\t this.body = body;\n\t };\n\t return Response;\n\t}());\n\texports.Response = Response;\n\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(module) {(function() {\n\t \"use strict\";\n\t function $$route$recognizer$dsl$$Target(path, matcher, delegate) {\n\t this.path = path;\n\t this.matcher = matcher;\n\t this.delegate = delegate;\n\t }\n\t\n\t $$route$recognizer$dsl$$Target.prototype = {\n\t to: function(target, callback) {\n\t var delegate = this.delegate;\n\t\n\t if (delegate && delegate.willAddRoute) {\n\t target = delegate.willAddRoute(this.matcher.target, target);\n\t }\n\t\n\t this.matcher.add(this.path, target);\n\t\n\t if (callback) {\n\t if (callback.length === 0) { throw new Error(\"You must have an argument in the function passed to `to`\"); }\n\t this.matcher.addChild(this.path, target, callback, this.delegate);\n\t }\n\t return this;\n\t }\n\t };\n\t\n\t function $$route$recognizer$dsl$$Matcher(target) {\n\t this.routes = {};\n\t this.children = {};\n\t this.target = target;\n\t }\n\t\n\t $$route$recognizer$dsl$$Matcher.prototype = {\n\t add: function(path, handler) {\n\t this.routes[path] = handler;\n\t },\n\t\n\t addChild: function(path, target, callback, delegate) {\n\t var matcher = new $$route$recognizer$dsl$$Matcher(target);\n\t this.children[path] = matcher;\n\t\n\t var match = $$route$recognizer$dsl$$generateMatch(path, matcher, delegate);\n\t\n\t if (delegate && delegate.contextEntered) {\n\t delegate.contextEntered(target, match);\n\t }\n\t\n\t callback(match);\n\t }\n\t };\n\t\n\t function $$route$recognizer$dsl$$generateMatch(startingPath, matcher, delegate) {\n\t return function(path, nestedCallback) {\n\t var fullPath = startingPath + path;\n\t\n\t if (nestedCallback) {\n\t nestedCallback($$route$recognizer$dsl$$generateMatch(fullPath, matcher, delegate));\n\t } else {\n\t return new $$route$recognizer$dsl$$Target(startingPath + path, matcher, delegate);\n\t }\n\t };\n\t }\n\t\n\t function $$route$recognizer$dsl$$addRoute(routeArray, path, handler) {\n\t var len = 0;\n\t for (var i=0; i z`. For instance, \"199\" is smaller\n\t // then \"200\", even though \"y\" and \"z\" (which are both 9) are larger than \"0\" (the value\n\t // of (`b` and `c`). This is because the leading symbol, \"2\", is larger than the other\n\t // leading symbol, \"1\".\n\t // The rule is that symbols to the left carry more weight than symbols to the right\n\t // when a number is written out as a string. In the above strings, the leading digit\n\t // represents how many 100's are in the number, and it carries more weight than the middle\n\t // number which represents how many 10's are in the number.\n\t // This system of number magnitude works well for route specificity, too. A route written as\n\t // `a/b/c` will be more specific than `x/y/z` as long as `a` is more specific than\n\t // `x`, irrespective of the other parts.\n\t // Because of this similarity, we assign each type of segment a number value written as a\n\t // string. We can find the specificity of compound routes by concatenating these strings\n\t // together, from left to right. After we have looped through all of the segments,\n\t // we convert the string to a number.\n\t specificity.val = '';\n\t\n\t for (var i=0; i 2 && key.slice(keyLength -2) === '[]') {\n\t isArray = true;\n\t key = key.slice(0, keyLength - 2);\n\t if(!queryParams[key]) {\n\t queryParams[key] = [];\n\t }\n\t }\n\t value = pair[1] ? $$route$recognizer$$decodeQueryParamPart(pair[1]) : '';\n\t }\n\t if (isArray) {\n\t queryParams[key].push(value);\n\t } else {\n\t queryParams[key] = value;\n\t }\n\t }\n\t return queryParams;\n\t },\n\t\n\t recognize: function(path) {\n\t var states = [ this.rootState ],\n\t pathLen, i, l, queryStart, queryParams = {},\n\t isSlashDropped = false;\n\t\n\t queryStart = path.indexOf('?');\n\t if (queryStart !== -1) {\n\t var queryString = path.substr(queryStart + 1, path.length);\n\t path = path.substr(0, queryStart);\n\t queryParams = this.parseQueryString(queryString);\n\t }\n\t\n\t path = decodeURI(path);\n\t\n\t if (path.charAt(0) !== \"/\") { path = \"/\" + path; }\n\t\n\t pathLen = path.length;\n\t if (pathLen > 1 && path.charAt(pathLen - 1) === \"/\") {\n\t path = path.substr(0, pathLen - 1);\n\t isSlashDropped = true;\n\t }\n\t\n\t for (i=0; i';this.element.innerHTML=r,this.iframe=this.element.childNodes[0]}e?this.iframe.addEventListener("load",function(){return t.load(t.config)},!1):this.iframe.addEventListener("load",function(){return t.createReport(t.createConfig)},!1)},e.allowedEvents=["loaded","saved","rendered","saveAsTriggered"],e.accessTokenAttribute="powerbi-access-token",e.embedUrlAttribute="powerbi-embed-url",e.nameAttribute="powerbi-name",e.typeAttribute="powerbi-type",e.defaultSettings={filterPaneEnabled:!0},e}();t.Embed=i},function(e,t){function r(e,t,r){var n;"function"==typeof CustomEvent?n=new CustomEvent(t,{detail:r,bubbles:!0,cancelable:!0}):(n=document.createEvent("CustomEvent"),n.initCustomEvent(t,!0,!0,r)),e.dispatchEvent(n)}function n(e,t){if(!Array.isArray(t))throw new Error("You attempted to call find with second parameter that was not an array. You passed: "+t);var r;return t.some(function(t,n){if(e(t))return r=n,!0}),r}function i(e,t){var r=n(e,t);return t[r]}function o(e,t){var r=n(e,t);t.splice(r,1)}function s(){for(var e=[],t=0;t0&&!i)throw new Error("You shold pass the values to be filtered for each key. You passed: no values and "+o+" keys");if(0===o&&i&&i.length>0)throw new Error("You passed key values but your target object doesn't contain the keys to be filtered");for(var s=0;s2)throw new Error("AdvancedFilters may not have more than two conditions. You passed: "+i.length);if(1===s.length&&"And"!==n)throw new Error('Logical Operator must be "And" when there is only one condition provided');this.conditions=s}return d(t,e),t.prototype.toJSON=function(){var t=e.prototype.toJSON.call(this);return t.logicalOperator=this.logicalOperator,t.conditions=this.conditions,t},t.schemaUrl="http://powerbi.com/product/schema#advanced",t}(l);t.AdvancedFilter=y,function(e){e[e.Read=0]="Read",e[e.ReadWrite=1]="ReadWrite",e[e.Copy=2]="Copy",e[e.Create=4]="Create",e[e.All=7]="All"}(t.Permissions||(t.Permissions={}));t.Permissions;!function(e){e[e.View=0]="View",e[e.Edit=1]="Edit"}(t.ViewMode||(t.ViewMode={}));t.ViewMode;t.validateSaveAsParameters=i(t.saveAsParametersSchema)},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{target:{oneOf:[{type:"object",properties:{table:{type:"string"},column:{type:"string"}},required:["table","column"]},{type:"object",properties:{table:{type:"string"},hierarchy:{type:"string"},hierarchyLevel:{type:"string"}},required:["table","hierarchy","hierarchyLevel"]},{type:"object",properties:{table:{type:"string"},measure:{type:"string"}},required:["table","measure"]}]},logicalOperator:{type:"string"},conditions:{type:"array",items:{type:"object",properties:{value:{type:["string","boolean","number"]},operator:{type:"string"}},required:["value","operator"]}}},required:["target","logicalOperator","conditions"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",oneOf:[{$ref:"#basicFilter"},{$ref:"#advancedFilter"}],invalidMessage:"filter is invalid"}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{accessToken:{type:"string",messages:{type:"accessToken must be a string",required:"accessToken is required"}},id:{type:"string",messages:{type:"id must be a string",required:"id is required"}},settings:{$ref:"#settings"},pageName:{type:"string",messages:{type:"pageName must be a string"}},filters:{type:"array",items:{type:"object",oneOf:[{$ref:"#basicFilter"},{$ref:"#advancedFilter"}]},invalidMessage:"filters property is invalid"},permissions:{type:"number","enum":[0,1,2,3],"default":0,invalidMessage:"permissions property is invalid"},viewMode:{type:"number","enum":[0,1],"default":0,invalidMessage:"viewMode property is invalid"}},required:["accessToken","id"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{accessToken:{type:"string",messages:{type:"accessToken must be a string",required:"accessToken is required"}},id:{type:"string",messages:{type:"id must be a string",required:"id is required"}},pageView:{type:"string",messages:{type:'pageView must be a string with one of the following values: "actualSize", "fitToWidth", "oneColumn"'}}},required:["accessToken","id"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{name:{type:"string",messages:{type:"name must be a string",required:"name is required"}}},required:["name"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{filterPaneEnabled:{type:"boolean",messages:{type:"filterPaneEnabled must be a boolean"}},navContentPaneEnabled:{type:"boolean",messages:{type:"navContentPaneEnabled must be a boolean"}},useCustomSaveAsDialog:{type:"boolean",messages:{type:"useCustomSaveAsDialog must be a boolean"}}}}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{target:{type:"object",properties:{table:{type:"string"},column:{type:"string"},hierarchy:{type:"string"},hierarchyLevel:{type:"string"},measure:{type:"string"}},required:["table"]},operator:{type:"string"},values:{type:"array",items:{type:["string","boolean","number"]}}},required:["target","operator","values"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{accessToken:{type:"string",messages:{type:"accessToken must be a string",required:"accessToken is required"}},datasetId:{type:"string",messages:{type:"datasetId must be a string",required:"datasetId is required"}}},required:["accessToken","datasetId"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{name:{type:"string",messages:{type:"name must be a string",required:"name is required"}}},required:["name"]}},function(e,t,r){e.exports=r(11)},function(e,t,r){"use strict";function n(e){return e=e instanceof RegExp?e:new RegExp(e),A?e.toString():"/"+e.source.replace(y,"\\$&")+"/"}function i(e){return'"'+e.replace(v,"\\$1")+'"'}function o(e,t){return b.lastIndex=0,b.test(t)?e+"."+t:e+"["+i(t)+"]"}function s(e){if(void 0===e)return"undefined";var t=Object.prototype.toString.call(e);return t.substr(8,t.length-9).toLowerCase()}function a(e){return(0|e)===e}function c(e,t){C[t].type=e,C[t].keyword=t}function h(e){var t,r,n,i=Object.keys(e),o=i.indexOf("properties"),s=i.indexOf("patternProperties"),a={"enum":Array.isArray(e["enum"])&&e["enum"].length>0,type:null,allType:[],perType:{}};for(e.type&&("string"==typeof e.type?a.type=[e.type]:Array.isArray(e.type)&&e.type.length&&(a.type=e.type.slice(0))),n=0;n-1&&"required"===t||s>-1&&"additionalProperties"===t||a.perType[r.type].push(t)):a.allType.push(t)));return a}function u(e,t){var r,n,i=e.substr(4),o=i.length,s=[],a="",c=!1;for(n=0;n "+e.schema.maximum+") {"),e.error("maximum"),e.code("}"))},C.exclusiveMaximum=function(e){e.schema.exclusiveMaximum===!0&&"number"==typeof e.schema.maximum&&(e.code("if ("+e.path+" === "+e.schema.maximum+") {"),e.error("exclusiveMaximum"),e.code("}"))},C.multipleOf=function(e){if("number"==typeof e.schema.multipleOf){var t=e.schema.multipleOf,r=t.toString().length-t.toFixed(0).length-1,n=r>0?Math.pow(10,r):1,i=e.path;r>0?e.code("if (+(Math.round(("+i+" * "+n+') + "e+" + '+r+') + "e-" + '+r+") % "+t*n+" !== 0) {"):e.code("if ((("+i+" * "+n+") % "+t*n+") !== 0) {"),e.error("multipleOf"),e.code("}")}},C.minLength=function(e){a(e.schema.minLength)&&(e.code("if (ucs2length("+e.path+") < "+e.schema.minLength+") {"),e.error("minLength"),e.code("}"))},C.maxLength=function(e){a(e.schema.maxLength)&&(e.code("if (ucs2length("+e.path+") > "+e.schema.maxLength+") {"),e.error("maxLength"),e.code("}"))},C.pattern=function(e){var t=e.schema.pattern;("string"==typeof t||t instanceof RegExp)&&(e.code("if (!("+n(t)+").test("+e.path+")) {"),e.error("pattern"),e.code("}"))},C.format=function(e){"string"==typeof e.schema.format&&I[e.schema.format]&&(e.code("if (!("+I[e.schema.format]+").test("+e.path+")) {"),e.error("format"),e.code("}"))},C.minItems=function(e){a(e.schema.minItems)&&(e.code("if ("+e.path+".length < "+e.schema.minItems+") {"),e.error("minItems"),e.code("}"))},C.maxItems=function(e){a(e.schema.maxItems)&&(e.code("if ("+e.path+".length > "+e.schema.maxItems+") {"),e.error("maxItems"),e.code("}"))},C.additionalItems=function(e){e.schema.additionalItems===!1&&Array.isArray(e.schema.items)&&(e.code("if ("+e.path+".length > "+e.schema.items.length+") {"),e.error("additionalItems"),e.code("}"))},C.uniqueItems=function(e){e.schema.uniqueItems&&(e.code("if (unique("+e.path+").length !== "+e.path+".length) {"),e.error("uniqueItems"),e.code("}"))},C.items=function(e){var t=e.declare(0),r=0;if("object"===s(e.schema.items))e.code("for ("+t+" = 0; "+t+" < "+e.path+".length; "+t+"++) {"),e.descend(e.path+"["+t+"]",e.schema.items),e.code("}");else if(Array.isArray(e.schema.items)){for(;r= "+r+") {"),e.descend(e.path+"["+r+"]",e.schema.items[r]),e.code("}");"object"===s(e.schema.additionalItems)&&(e.code("for ("+t+" = "+r+"; "+t+" < "+e.path+".length; "+t+"++) {"),e.descend(e.path+"["+t+"]",e.schema.additionalItems),e.code("}"))}},C.maxProperties=function(e){a(e.schema.maxProperties)&&(e.code("if (Object.keys("+e.path+").length > "+e.schema.maxProperties+") {"),e.error("maxProperties"),e.code("}"))},C.minProperties=function(e){a(e.schema.minProperties)&&(e.code("if (Object.keys("+e.path+").length < "+e.schema.minProperties+") {"),e.error("minProperties"),e.code("}"))},C.required=function(e){if(Array.isArray(e.schema.required))for(var t=0;t-1&&(e.code("else {"),e.error("required",t),e.code("}"))},C.patternProperties=C.additionalProperties=function(e){var t,r,i,o,a,c,h,u="object"===s(e.schema.properties)?Object.keys(e.schema.properties):[],d=e.schema.patternProperties,p="object"===s(d)?Object.keys(d):[],f=e.schema.additionalProperties,l=f===!1||"object"===s(f);if(p.length||l){for(r=e.declare("[]"),i=e.declare('""'),o=e.declare(0),l&&(a=e.declare(!1)),e.code(r+" = Object.keys("+e.path+")"),e.code("for ("+o+" = 0; "+o+" < "+r+".length; "+o+"++) {")(i+" = "+r+"["+o+"]")("if ("+e.path+"["+i+"] === undefined) {")("continue")("}"),l&&e.code(a+" = false"),h=0;h -1) {")("continue")("}")),e.code("if (!"+a+") {"),f===!1?e.error("additionalProperties",void 0,i):e.descend(e.path+"["+i+"]",f),e.code("}")),e.code("}")}},C.dependencies=function(e){if("object"===s(e.schema.dependencies))for(var t,r,n=Object.keys(e.schema.dependencies),i=n.length,a=0,c=0;c1&&delete this.objects[n][r]},f.prototype.dispose=function(){this.objects.length=0,this.properties.length=0},m.prototype.clone=function(e){var t=new m({schema:e,formats:this.formats,greedy:this.greedy,resolver:this.resolver,id:this.id,funcache:this.funcache,scope:this.scope});return t},m.prototype.declare=function(e){var t=this.id();return this.code.def(t,e),t},m.prototype.cache=function(e,t){var r,n=this.funcache[e];return n||(n=this.funcache[e]={key:this.id()},r=this.clone(t),n.func=r.compile(n.key),this.scope.refs[n.key]=n.func,r.dispose()),"refs."+n.key},m.prototype.error=function(e,t,r){var n=this.schema,o=this.path,s="data"!==o||t?'(path ? path + "." : "") + '+u(o,t)+",":"path,",a=t&&n.properties&&n.properties[t]?this.resolver.resolve(n.properties[t]):null,c=a?a.requiredMessage:n.invalidMessage;c||(c=a&&a.messages&&a.messages[e]||n.messages&&n.messages[e]),this.code("errors.push({"),c&&this.code("message: "+i(c)+","),r&&this.code("additionalProperties: "+r+","),this.code("path: "+s)("keyword: "+i(e))("})"),this.greedy||this.code("return")},m.prototype.refactor=function(e,t,r){var n="data"!==e?'(path ? path + "." : "") + '+u(e):"path",i=this.cache(r,t),o=this.declare();this.code(o+" = "+i+"("+e+", "+n+", errors)"),this.greedy||this.code("if (errors.length) { return }")},m.prototype.descend=function(e,t){var r=this.path,n=this.schema;this.path=e,this.schema=t,this.generate(),this.path=r,this.schema=n},m.prototype.generate=function(){function e(e){C[e](l)}var t,r,o,a,c,u,d,p=this.path,f=this.schema,l=this,m=this.scope;if("object"===s(f)){if(void 0!==f.$ref){if(f=this.resolver.resolve(f),this.resolver.hasRef(f))return void this.refactor(p,f,this.resolver.getNormalizedRef(this.schema)||this.schema.$ref);this.schema=f}if(o=h(f),o["enum"])return void C["enum"](l);for(a=Object.keys(o.perType),d=0;d-1&&o.type.splice(c,1));o.type&&(o.type.length?(this.code((a.length?"else ":"")+"if (!("+o.type.map(function(e){return k[e]?k[e](p):"true"}).join(" || ")+")) {"),this.error("type"),this.code("}")):(this.code("else {"),this.error("type"),this.code("}"))),o.allType.forEach(function(e){C[e](l)}),f.format&&this.formats&&(r=this.formats[f.format],r&&("string"==typeof r||r instanceof RegExp?(this.code("if (!("+n(r)+").test("+p+")) {"),this.error("format"),this.code("}")):"function"==typeof r&&((m.formats||(m.formats={}))[f.format]=r,(m.schemas||(m.schemas={}))[f.format]=f,t=i(f.format),this.code("if (!formats["+t+"]("+p+", schemas["+t+"])) {"),this.error("format"),this.code("}"))))}},m.prototype.compile=function(e){return this.code=E("jsen_compiled"+(e?"_"+e:""),"data","path","errors"),this.generate(),this.code.compile(this.scope)},m.prototype.dispose=function(){for(var e in this)this[e]=void 0},g.browser=x,g.clone=d,g.equal=O,g.unique=P,g.ucs2length=S,g.SchemaResolver=j,g.resolve=j.resolvePointer,e.exports=g},function(e,t){"use strict";e.exports=function(){var e=Array.apply(null,arguments),t=e.shift(),r=" ",n="",i="",o=1,s="{[",a="}]",c=function(){for(var e=r,t=0;t++-1&&s.indexOf(r)>-1?(o--,h(e),o++):s.indexOf(r)>-1?(h(e),o++):a.indexOf(t)>-1?(o--,h(e)):h(e),u};return u.def=function(e,t){return i+=(i?",\n"+r+" ":"")+e+(void 0!==t?" = "+t:""),u},u.toSource=function(){return"function "+t+"("+e.join(", ")+") {\n"+r+'"use strict"\n'+(i?r+"var "+i+";\n":"")+n+"}"},u.compile=function(e){var t="return ("+u.toSource()+")",r=e||{},n=Object.keys(r),i=n.map(function(e){return r[e]});return Function.apply(null,n.concat(t)).apply(null,i)},u}},function(e,t){"use strict";function r(e){var t=Object.prototype.toString.call(e);return t.substr(8,t.length-9).toLowerCase()}function n(e,t){var r,n,o=Object.keys(e).sort(),s=Object.keys(t).sort();if(!i(o,s))return!1;for(r=0;r-1)throw new Error(u+" "+t);return this.refStack.push(t),r=this._resolveRef(t),this.refStack.pop(),e===this.rootSchema&&(this.resolvedRootSchema=r),r},o.prototype.hasRef=function(e){var t,r,n,i,o=Object.keys(e);if(o.indexOf("$ref")>-1)return!0;for(n=0,t=o.length;n';this.element.innerHTML=r,this.iframe=this.element.childNodes[0]}e?this.iframe.addEventListener("load",function(){return t.load(t.config)},!1):this.iframe.addEventListener("load",function(){return t.createReport(t.createConfig)},!1)},e.allowedEvents=["loaded","saved","rendered","saveAsTriggered"],e.accessTokenAttribute="powerbi-access-token",e.embedUrlAttribute="powerbi-embed-url",e.nameAttribute="powerbi-name",e.typeAttribute="powerbi-type",e.defaultSettings={filterPaneEnabled:!0},e}();t.Embed=i},function(e,t){function r(e,t,r){var n;"function"==typeof CustomEvent?n=new CustomEvent(t,{detail:r,bubbles:!0,cancelable:!0}):(n=document.createEvent("CustomEvent"),n.initCustomEvent(t,!0,!0,r)),e.dispatchEvent(n)}function n(e,t){if(!Array.isArray(t))throw new Error("You attempted to call find with second parameter that was not an array. You passed: "+t);var r;return t.some(function(t,n){if(e(t))return r=n,!0}),r}function i(e,t){var r=n(e,t);return t[r]}function o(e,t){var r=n(e,t);t.splice(r,1)}function s(){for(var e=[],t=0;t0&&!i)throw new Error("You shold pass the values to be filtered for each key. You passed: no values and "+o+" keys");if(0===o&&i&&i.length>0)throw new Error("You passed key values but your target object doesn't contain the keys to be filtered");for(var s=0;s2)throw new Error("AdvancedFilters may not have more than two conditions. You passed: "+i.length);if(1===s.length&&"And"!==n)throw new Error('Logical Operator must be "And" when there is only one condition provided');this.conditions=s}return d(t,e),t.prototype.toJSON=function(){var t=e.prototype.toJSON.call(this);return t.logicalOperator=this.logicalOperator,t.conditions=this.conditions,t},t.schemaUrl="http://powerbi.com/product/schema#advanced",t}(l);t.AdvancedFilter=y,function(e){e[e.Read=0]="Read",e[e.ReadWrite=1]="ReadWrite",e[e.Copy=2]="Copy",e[e.Create=4]="Create",e[e.All=7]="All"}(t.Permissions||(t.Permissions={}));t.Permissions;!function(e){e[e.View=0]="View",e[e.Edit=1]="Edit"}(t.ViewMode||(t.ViewMode={}));t.ViewMode;t.validateSaveAsParameters=i(t.saveAsParametersSchema)},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{target:{oneOf:[{type:"object",properties:{table:{type:"string"},column:{type:"string"}},required:["table","column"]},{type:"object",properties:{table:{type:"string"},hierarchy:{type:"string"},hierarchyLevel:{type:"string"}},required:["table","hierarchy","hierarchyLevel"]},{type:"object",properties:{table:{type:"string"},measure:{type:"string"}},required:["table","measure"]}]},logicalOperator:{type:"string"},conditions:{type:"array",items:{type:"object",properties:{value:{type:["string","boolean","number"]},operator:{type:"string"}},required:["value","operator"]}}},required:["target","logicalOperator","conditions"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",oneOf:[{$ref:"#basicFilter"},{$ref:"#advancedFilter"}],invalidMessage:"filter is invalid"}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{accessToken:{type:"string",messages:{type:"accessToken must be a string",required:"accessToken is required"}},id:{type:"string",messages:{type:"id must be a string",required:"id is required"}},settings:{$ref:"#settings"},pageName:{type:"string",messages:{type:"pageName must be a string"}},filters:{type:"array",items:{type:"object",oneOf:[{$ref:"#basicFilter"},{$ref:"#advancedFilter"}]},invalidMessage:"filters property is invalid"},permissions:{type:"number","enum":[0,1,2,3],"default":0,invalidMessage:"permissions property is invalid"},viewMode:{type:"number","enum":[0,1],"default":0,invalidMessage:"viewMode property is invalid"}},required:["accessToken","id"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{accessToken:{type:"string",messages:{type:"accessToken must be a string",required:"accessToken is required"}},id:{type:"string",messages:{type:"id must be a string",required:"id is required"}},pageView:{type:"string",messages:{type:'pageView must be a string with one of the following values: "actualSize", "fitToWidth", "oneColumn"'}}},required:["accessToken","id"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{name:{type:"string",messages:{type:"name must be a string",required:"name is required"}}},required:["name"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{filterPaneEnabled:{type:"boolean",messages:{type:"filterPaneEnabled must be a boolean"}},navContentPaneEnabled:{type:"boolean",messages:{type:"navContentPaneEnabled must be a boolean"}},useCustomSaveAsDialog:{type:"boolean",messages:{type:"useCustomSaveAsDialog must be a boolean"}}}}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{target:{type:"object",properties:{table:{type:"string"},column:{type:"string"},hierarchy:{type:"string"},hierarchyLevel:{type:"string"},measure:{type:"string"}},required:["table"]},operator:{type:"string"},values:{type:"array",items:{type:["string","boolean","number"]}}},required:["target","operator","values"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{accessToken:{type:"string",messages:{type:"accessToken must be a string",required:"accessToken is required"}},datasetId:{type:"string",messages:{type:"datasetId must be a string",required:"datasetId is required"}}},required:["accessToken","datasetId"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{name:{type:"string",messages:{type:"name must be a string",required:"name is required"}}},required:["name"]}},function(e,t,r){e.exports=r(11)},function(e,t,r){"use strict";function n(e){return e=e instanceof RegExp?e:new RegExp(e),A?e.toString():"/"+e.source.replace(y,"\\$&")+"/"}function i(e){return'"'+e.replace(v,"\\$1")+'"'}function o(e,t){return b.lastIndex=0,b.test(t)?e+"."+t:e+"["+i(t)+"]"}function s(e){if(void 0===e)return"undefined";var t=Object.prototype.toString.call(e);return t.substr(8,t.length-9).toLowerCase()}function a(e){return(0|e)===e}function c(e,t){k[t].type=e,k[t].keyword=t}function h(e){var t,r,n,i=Object.keys(e),o=i.indexOf("properties"),s=i.indexOf("patternProperties"),a={"enum":Array.isArray(e["enum"])&&e["enum"].length>0,type:null,allType:[],perType:{}};for(e.type&&("string"==typeof e.type?a.type=[e.type]:Array.isArray(e.type)&&e.type.length&&(a.type=e.type.slice(0))),n=0;n-1&&"required"===t||s>-1&&"additionalProperties"===t||a.perType[r.type].push(t)):a.allType.push(t)));return a}function u(e,t){var r,n,i=e.substr(4),o=i.length,s=[],a="",c=!1;for(n=0;n "+e.schema.maximum+") {"),e.error("maximum"),e.code("}"))},k.exclusiveMaximum=function(e){e.schema.exclusiveMaximum===!0&&"number"==typeof e.schema.maximum&&(e.code("if ("+e.path+" === "+e.schema.maximum+") {"),e.error("exclusiveMaximum"),e.code("}"))},k.multipleOf=function(e){if("number"==typeof e.schema.multipleOf){var t=e.schema.multipleOf,r=t.toString().length-t.toFixed(0).length-1,n=r>0?Math.pow(10,r):1,i=e.path;r>0?e.code("if (+(Math.round(("+i+" * "+n+') + "e+" + '+r+') + "e-" + '+r+") % "+t*n+" !== 0) {"):e.code("if ((("+i+" * "+n+") % "+t*n+") !== 0) {"),e.error("multipleOf"),e.code("}")}},k.minLength=function(e){a(e.schema.minLength)&&(e.code("if (ucs2length("+e.path+") < "+e.schema.minLength+") {"),e.error("minLength"),e.code("}"))},k.maxLength=function(e){a(e.schema.maxLength)&&(e.code("if (ucs2length("+e.path+") > "+e.schema.maxLength+") {"),e.error("maxLength"),e.code("}"))},k.pattern=function(e){var t=e.schema.pattern;("string"==typeof t||t instanceof RegExp)&&(e.code("if (!("+n(t)+").test("+e.path+")) {"),e.error("pattern"),e.code("}"))},k.format=function(e){"string"==typeof e.schema.format&&I[e.schema.format]&&(e.code("if (!("+I[e.schema.format]+").test("+e.path+")) {"),e.error("format"),e.code("}"))},k.minItems=function(e){a(e.schema.minItems)&&(e.code("if ("+e.path+".length < "+e.schema.minItems+") {"),e.error("minItems"),e.code("}"))},k.maxItems=function(e){a(e.schema.maxItems)&&(e.code("if ("+e.path+".length > "+e.schema.maxItems+") {"),e.error("maxItems"),e.code("}"))},k.additionalItems=function(e){e.schema.additionalItems===!1&&Array.isArray(e.schema.items)&&(e.code("if ("+e.path+".length > "+e.schema.items.length+") {"),e.error("additionalItems"),e.code("}"))},k.uniqueItems=function(e){e.schema.uniqueItems&&(e.code("if (unique("+e.path+").length !== "+e.path+".length) {"),e.error("uniqueItems"),e.code("}"))},k.items=function(e){var t=e.declare(0),r=0;if("object"===s(e.schema.items))e.code("for ("+t+" = 0; "+t+" < "+e.path+".length; "+t+"++) {"),e.descend(e.path+"["+t+"]",e.schema.items),e.code("}");else if(Array.isArray(e.schema.items)){for(;r= "+r+") {"),e.descend(e.path+"["+r+"]",e.schema.items[r]),e.code("}");"object"===s(e.schema.additionalItems)&&(e.code("for ("+t+" = "+r+"; "+t+" < "+e.path+".length; "+t+"++) {"),e.descend(e.path+"["+t+"]",e.schema.additionalItems),e.code("}"))}},k.maxProperties=function(e){a(e.schema.maxProperties)&&(e.code("if (Object.keys("+e.path+").length > "+e.schema.maxProperties+") {"),e.error("maxProperties"),e.code("}"))},k.minProperties=function(e){a(e.schema.minProperties)&&(e.code("if (Object.keys("+e.path+").length < "+e.schema.minProperties+") {"),e.error("minProperties"),e.code("}"))},k.required=function(e){if(Array.isArray(e.schema.required))for(var t=0;t-1&&(e.code("else {"),e.error("required",t),e.code("}"))},k.patternProperties=k.additionalProperties=function(e){var t,r,i,o,a,c,h,u="object"===s(e.schema.properties)?Object.keys(e.schema.properties):[],d=e.schema.patternProperties,p="object"===s(d)?Object.keys(d):[],f=e.schema.additionalProperties,l=f===!1||"object"===s(f);if(p.length||l){for(r=e.declare("[]"),i=e.declare('""'),o=e.declare(0),l&&(a=e.declare(!1)),e.code(r+" = Object.keys("+e.path+")"),e.code("for ("+o+" = 0; "+o+" < "+r+".length; "+o+"++) {")(i+" = "+r+"["+o+"]")("if ("+e.path+"["+i+"] === undefined) {")("continue")("}"),l&&e.code(a+" = false"),h=0;h -1) {")("continue")("}")),e.code("if (!"+a+") {"),f===!1?e.error("additionalProperties",void 0,i):e.descend(e.path+"["+i+"]",f),e.code("}")),e.code("}")}},k.dependencies=function(e){if("object"===s(e.schema.dependencies))for(var t,r,n=Object.keys(e.schema.dependencies),i=n.length,a=0,c=0;c1&&delete this.objects[n][r]},f.prototype.dispose=function(){this.objects.length=0,this.properties.length=0},m.prototype.clone=function(e){var t=new m({schema:e,formats:this.formats,greedy:this.greedy,resolver:this.resolver,id:this.id,funcache:this.funcache,scope:this.scope});return t},m.prototype.declare=function(e){var t=this.id();return this.code.def(t,e),t},m.prototype.cache=function(e,t){var r,n=this.funcache[e];return n||(n=this.funcache[e]={key:this.id()},r=this.clone(t),n.func=r.compile(n.key),this.scope.refs[n.key]=n.func,r.dispose()),"refs."+n.key},m.prototype.error=function(e,t,r){var n=this.schema,o=this.path,s="data"!==o||t?'(path ? path + "." : "") + '+u(o,t)+",":"path,",a=t&&n.properties&&n.properties[t]?this.resolver.resolve(n.properties[t]):null,c=a?a.requiredMessage:n.invalidMessage;c||(c=a&&a.messages&&a.messages[e]||n.messages&&n.messages[e]),this.code("errors.push({"),c&&this.code("message: "+i(c)+","),r&&this.code("additionalProperties: "+r+","),this.code("path: "+s)("keyword: "+i(e))("})"),this.greedy||this.code("return")},m.prototype.refactor=function(e,t,r){var n="data"!==e?'(path ? path + "." : "") + '+u(e):"path",i=this.cache(r,t),o=this.declare();this.code(o+" = "+i+"("+e+", "+n+", errors)"),this.greedy||this.code("if (errors.length) { return }")},m.prototype.descend=function(e,t){var r=this.path,n=this.schema;this.path=e,this.schema=t,this.generate(),this.path=r,this.schema=n},m.prototype.generate=function(){function e(e){k[e](l)}var t,r,o,a,c,u,d,p=this.path,f=this.schema,l=this,m=this.scope;if("object"===s(f)){if(void 0!==f.$ref){if(f=this.resolver.resolve(f),this.resolver.hasRef(f))return void this.refactor(p,f,this.resolver.getNormalizedRef(this.schema)||this.schema.$ref);this.schema=f}if(o=h(f),o["enum"])return void k["enum"](l);for(a=Object.keys(o.perType),d=0;d-1&&o.type.splice(c,1));o.type&&(o.type.length?(this.code((a.length?"else ":"")+"if (!("+o.type.map(function(e){return S[e]?S[e](p):"true"}).join(" || ")+")) {"),this.error("type"),this.code("}")):(this.code("else {"),this.error("type"),this.code("}"))),o.allType.forEach(function(e){k[e](l)}),f.format&&this.formats&&(r=this.formats[f.format],r&&("string"==typeof r||r instanceof RegExp?(this.code("if (!("+n(r)+").test("+p+")) {"),this.error("format"),this.code("}")):"function"==typeof r&&((m.formats||(m.formats={}))[f.format]=r,(m.schemas||(m.schemas={}))[f.format]=f,t=i(f.format),this.code("if (!formats["+t+"]("+p+", schemas["+t+"])) {"),this.error("format"),this.code("}"))))}},m.prototype.compile=function(e){return this.code=E("jsen_compiled"+(e?"_"+e:""),"data","path","errors"),this.generate(),this.code.compile(this.scope)},m.prototype.dispose=function(){for(var e in this)this[e]=void 0},g.browser=x,g.clone=d,g.equal=O,g.unique=P,g.ucs2length=C,g.SchemaResolver=j,g.resolve=j.resolvePointer,e.exports=g},function(e,t){"use strict";e.exports=function(){var e=Array.apply(null,arguments),t=e.shift(),r=" ",n="",i="",o=1,s="{[",a="}]",c=function(){for(var e=r,t=0;t++-1&&s.indexOf(r)>-1?(o--,h(e),o++):s.indexOf(r)>-1?(h(e),o++):a.indexOf(t)>-1?(o--,h(e)):h(e),u};return u.def=function(e,t){return i+=(i?",\n"+r+" ":"")+e+(void 0!==t?" = "+t:""),u},u.toSource=function(){return"function "+t+"("+e.join(", ")+") {\n"+r+'"use strict"\n'+(i?r+"var "+i+";\n":"")+n+"}"},u.compile=function(e){var t="return ("+u.toSource()+")",r=e||{},n=Object.keys(r),i=n.map(function(e){return r[e]});return Function.apply(null,n.concat(t)).apply(null,i)},u}},function(e,t){"use strict";function r(e){var t=Object.prototype.toString.call(e);return t.substr(8,t.length-9).toLowerCase()}function n(e,t){var r,n,o=Object.keys(e).sort(),s=Object.keys(t).sort();if(!i(o,s))return!1;for(r=0;r-1)throw new Error(u+" "+t);return this.refStack.push(t),r=this._resolveRef(t),this.refStack.pop(),e===this.rootSchema&&(this.resolvedRootSchema=r),r},o.prototype.hasRef=function(e){var t,r,n,i,o=Object.keys(e);if(o.indexOf("$ref")>-1)return!0;for(n=0,t=o.length;n",'"',"`"," ","\r","\n","\t"],l=["{","}","|","\\","^","`"].concat(f),m=["'"].concat(l),g=["%","/","?",";","#"].concat(m),y=["/","?","#"],v=255,b=/^[+a-z0-9A-Z_-]{0,63}$/,w=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,x={javascript:!0,"javascript:":!0},A={javascript:!0,"javascript:":!0},E={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},O=r(20);n.prototype.parse=function(e,t,r){if(!h.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var n=e.indexOf("?"),i=n!==-1&&n127?"x":F[$];if(!M.match(b)){var U=T.slice(0,I),L=T.slice(I+1),W=F.match(w);W&&(U.push(W[1]),L.unshift(W[2])),L.length&&(a="/"+L.join(".")+a),this.hostname=U.join(".");break}}}this.hostname.length>v?this.hostname="":this.hostname=this.hostname.toLowerCase(),q||(this.hostname=c.toASCII(this.hostname));var z=this.port?":"+this.port:"",H=this.hostname||"";this.host=H+z,this.href+=this.host,q&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==a[0]&&(a="/"+a))}if(!x[l])for(var I=0,R=m.length;I0)&&r.host.split("@");P&&(r.auth=P.shift(),r.host=r.hostname=P.shift())}return r.search=e.search,r.query=e.query,h.isNull(r.pathname)&&h.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!x.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var j=x.slice(-1)[0],I=(r.host||e.host||x.length>1)&&("."===j||".."===j)||""===j,S=0,k=x.length;k>=0;k--)j=x[k],"."===j?x.splice(k,1):".."===j?(x.splice(k,1),S++):S&&(x.splice(k,1),S--);if(!b&&!w)for(;S--;S)x.unshift("..");!b||""===x[0]||x[0]&&"/"===x[0].charAt(0)||x.unshift(""),I&&"/"!==x.join("/").substr(-1)&&x.push("");var C=""===x[0]||x[0]&&"/"===x[0].charAt(0);if(O){r.hostname=r.host=C?"":x.length?x.shift():"";var P=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@");P&&(r.auth=P.shift(),r.host=r.hostname=P.shift())}return b=b||r.host&&x.length,b&&!C&&x.unshift(""),x.length?r.pathname=x.join("/"):(r.pathname=null,r.path=null),h.isNull(r.pathname)&&h.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},n.prototype.parseHost=function(){var e=this.host,t=d.exec(e);t&&(t=t[0],":"!==t&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,r){var n;(function(e,i){!function(o){function s(e){throw RangeError(T[e])}function a(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function c(e,t){var r=e.split("@"),n="";r.length>1&&(n=r[0]+"@",e=r[1]),e=e.replace(q,".");var i=e.split("."),o=a(i,t).join(".");return n+o}function h(e){for(var t,r,n=[],i=0,o=e.length;i=55296&&t<=56319&&i65535&&(e-=65536,t+=M(e>>>10&1023|55296),e=56320|1023&e),t+=M(e)}).join("")}function d(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:x}function p(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function f(e,t,r){var n=0;for(e=r?F(e/P):e>>1,e+=F(e/t);e>R*E>>1;n+=x)e=F(e/R);return F(n+(R+1)*e/(e+O))}function l(e){var t,r,n,i,o,a,c,h,p,l,m=[],g=e.length,y=0,v=I,b=j;for(r=e.lastIndexOf(S),r<0&&(r=0),n=0;n=128&&s("not-basic"),m.push(e.charCodeAt(n));for(i=r>0?r+1:0;i=g&&s("invalid-input"),h=d(e.charCodeAt(i++)),(h>=x||h>F((w-y)/a))&&s("overflow"),y+=h*a,p=c<=b?A:c>=b+E?E:c-b,!(hF(w/l)&&s("overflow"),a*=l;t=m.length+1,b=f(y-o,t,0==o),F(y/t)>w-v&&s("overflow"),v+=F(y/t),y%=t,m.splice(y++,0,v)}return u(m)}function m(e){var t,r,n,i,o,a,c,u,d,l,m,g,y,v,b,O=[];for(e=h(e),g=e.length,t=I,r=0,o=j,a=0;a=t&&mF((w-r)/y)&&s("overflow"),r+=(c-t)*y,t=c,a=0;aw&&s("overflow"),m==t){for(u=r,d=x;l=d<=o?A:d>=o+E?E:d-o,!(u= 0x80 (not a basic code point)","invalid-input":"Invalid input"},R=x-A,F=Math.floor,M=String.fromCharCode;b={version:"1.3.2",ucs2:{decode:h,encode:u},decode:l,encode:m,toASCII:y,toUnicode:g},n=function(){return b}.call(t,r,t,e),!(void 0!==n&&(e.exports=n))}(this)}).call(t,r(18)(e),function(){return this}())},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],e.webpackPolyfill=1),e}},function(e,t){"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,t,r){"use strict";t.decode=t.parse=r(21),t.encode=t.stringify=r(22)},function(e,t){ +"use strict";function n(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function i(e,t,r){if(e&&h.isObject(e)&&e instanceof n)return e;var i=new n;return i.parse(e,t,r),i}function o(e){return h.isString(e)&&(e=i(e)),e instanceof n?e.format():n.prototype.format.call(e)}function s(e,t){return i(e,!1,!0).resolve(t)}function a(e,t){return e?i(e,!1,!0).resolveObject(t):t}var c=r(17),h=r(19);t.parse=i,t.resolve=s,t.resolveObject=a,t.format=o,t.Url=n;var u=/^([a-z0-9.+-]+:)/i,d=/:[0-9]*$/,p=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,f=["<",">",'"',"`"," ","\r","\n","\t"],l=["{","}","|","\\","^","`"].concat(f),m=["'"].concat(l),g=["%","/","?",";","#"].concat(m),y=["/","?","#"],v=255,b=/^[+a-z0-9A-Z_-]{0,63}$/,w=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,x={javascript:!0,"javascript:":!0},A={javascript:!0,"javascript:":!0},E={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},O=r(20);n.prototype.parse=function(e,t,r){if(!h.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var n=e.indexOf("?"),i=n!==-1&&n127?"x":F[$];if(!M.match(b)){var U=T.slice(0,I),L=T.slice(I+1),W=F.match(w);W&&(U.push(W[1]),L.unshift(W[2])),L.length&&(a="/"+L.join(".")+a),this.hostname=U.join(".");break}}}this.hostname.length>v?this.hostname="":this.hostname=this.hostname.toLowerCase(),q||(this.hostname=c.toASCII(this.hostname));var z=this.port?":"+this.port:"",H=this.hostname||"";this.host=H+z,this.href+=this.host,q&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==a[0]&&(a="/"+a))}if(!x[l])for(var I=0,R=m.length;I0)&&r.host.split("@");P&&(r.auth=P.shift(),r.host=r.hostname=P.shift())}return r.search=e.search,r.query=e.query,h.isNull(r.pathname)&&h.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!x.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var j=x.slice(-1)[0],I=(r.host||e.host||x.length>1)&&("."===j||".."===j)||""===j,C=0,S=x.length;S>=0;S--)j=x[S],"."===j?x.splice(S,1):".."===j?(x.splice(S,1),C++):C&&(x.splice(S,1),C--);if(!b&&!w)for(;C--;C)x.unshift("..");!b||""===x[0]||x[0]&&"/"===x[0].charAt(0)||x.unshift(""),I&&"/"!==x.join("/").substr(-1)&&x.push("");var k=""===x[0]||x[0]&&"/"===x[0].charAt(0);if(O){r.hostname=r.host=k?"":x.length?x.shift():"";var P=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@");P&&(r.auth=P.shift(),r.host=r.hostname=P.shift())}return b=b||r.host&&x.length,b&&!k&&x.unshift(""),x.length?r.pathname=x.join("/"):(r.pathname=null,r.path=null),h.isNull(r.pathname)&&h.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},n.prototype.parseHost=function(){var e=this.host,t=d.exec(e);t&&(t=t[0],":"!==t&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,r){var n;(function(e,i){!function(o){function s(e){throw RangeError(T[e])}function a(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function c(e,t){var r=e.split("@"),n="";r.length>1&&(n=r[0]+"@",e=r[1]),e=e.replace(q,".");var i=e.split("."),o=a(i,t).join(".");return n+o}function h(e){for(var t,r,n=[],i=0,o=e.length;i=55296&&t<=56319&&i65535&&(e-=65536,t+=M(e>>>10&1023|55296),e=56320|1023&e),t+=M(e)}).join("")}function d(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:x}function p(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function f(e,t,r){var n=0;for(e=r?F(e/P):e>>1,e+=F(e/t);e>R*E>>1;n+=x)e=F(e/R);return F(n+(R+1)*e/(e+O))}function l(e){var t,r,n,i,o,a,c,h,p,l,m=[],g=e.length,y=0,v=I,b=j;for(r=e.lastIndexOf(C),r<0&&(r=0),n=0;n=128&&s("not-basic"),m.push(e.charCodeAt(n));for(i=r>0?r+1:0;i=g&&s("invalid-input"),h=d(e.charCodeAt(i++)),(h>=x||h>F((w-y)/a))&&s("overflow"),y+=h*a,p=c<=b?A:c>=b+E?E:c-b,!(hF(w/l)&&s("overflow"),a*=l;t=m.length+1,b=f(y-o,t,0==o),F(y/t)>w-v&&s("overflow"),v+=F(y/t),y%=t,m.splice(y++,0,v)}return u(m)}function m(e){var t,r,n,i,o,a,c,u,d,l,m,g,y,v,b,O=[];for(e=h(e),g=e.length,t=I,r=0,o=j,a=0;a=t&&mF((w-r)/y)&&s("overflow"),r+=(c-t)*y,t=c,a=0;aw&&s("overflow"),m==t){for(u=r,d=x;l=d<=o?A:d>=o+E?E:d-o,!(u= 0x80 (not a basic code point)","invalid-input":"Invalid input"},R=x-A,F=Math.floor,M=String.fromCharCode;b={version:"1.3.2",ucs2:{decode:h,encode:u},decode:l,encode:m,toASCII:y,toUnicode:g},n=function(){return b}.call(t,r,t,e),!(void 0!==n&&(e.exports=n))}(this)}).call(t,r(18)(e),function(){return this}())},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],e.webpackPolyfill=1),e}},function(e,t){"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,t,r){"use strict";t.decode=t.parse=r(21),t.encode=t.stringify=r(22)},function(e,t){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -63,7 +63,7 @@ // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. -"use strict";var r=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,n,i){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map(function(i){var o=encodeURIComponent(r(i))+n;return Array.isArray(e[i])?e[i].map(function(e){return o+encodeURIComponent(r(e))}).join(t):o+encodeURIComponent(r(e[i]))}).join(t):i?encodeURIComponent(r(i))+n+encodeURIComponent(r(e)):""}},function(e,t){e.exports={id:"http://json-schema.org/draft-04/schema#",$schema:"http://json-schema.org/draft-04/schema#",description:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},positiveInteger:{type:"integer",minimum:0},positiveIntegerDefault0:{allOf:[{$ref:"#/definitions/positiveInteger"},{"default":0}]},simpleTypes:{"enum":["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0}},type:"object",properties:{id:{type:"string",format:"uri"},$schema:{type:"string",format:"uri"},title:{type:"string"},description:{type:"string"},"default":{},multipleOf:{type:"number",minimum:0,exclusiveMinimum:!0},maximum:{type:"number"},exclusiveMaximum:{type:"boolean","default":!1},minimum:{type:"number"},exclusiveMinimum:{type:"boolean","default":!1},maxLength:{$ref:"#/definitions/positiveInteger"},minLength:{$ref:"#/definitions/positiveIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{anyOf:[{type:"boolean"},{$ref:"#"}],"default":{}},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],"default":{}},maxItems:{$ref:"#/definitions/positiveInteger"},minItems:{$ref:"#/definitions/positiveIntegerDefault0"},uniqueItems:{type:"boolean","default":!1},maxProperties:{$ref:"#/definitions/positiveInteger"},minProperties:{$ref:"#/definitions/positiveIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{anyOf:[{type:"boolean"},{$ref:"#"}],"default":{}},definitions:{type:"object",additionalProperties:{$ref:"#"},"default":{}},properties:{type:"object",additionalProperties:{$ref:"#"},"default":{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},"default":{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},"enum":{type:"array",minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},dependencies:{exclusiveMaximum:["maximum"],exclusiveMinimum:["minimum"]},"default":{}}},function(e,t){"use strict";var r={};r["date-time"]=/(\d\d\d\d)(-)?(\d\d)(-)?(\d\d)(T)?(\d\d)(:)?(\d\d)(:)?(\d\d)(\.\d+)?(Z|([+-])(\d\d)(:)?(\d\d))/,r.uri=/^([a-zA-Z][a-zA-Z0-9+-.]*:){0,1}\/\/[^\s]*$/,r.email=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,r.ipv4=/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,r.ipv6=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|[fF][eE]80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::([fF]{4}(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,r.hostname=/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]))*$/,e.exports=r},function(e,t){"use strict";function r(e){for(var t,r,n=0,i=0,o=e.length;i=55296&&t<=56319&&i=55296&&t<=56319&&i2&&"[]"===s.slice(a-2)&&(c=!0,s=s.slice(0,a-2),r[s]||(r[s]=[])),i=o[1]?w(o[1]):""),c?r[s].push(i):r[s]=i}return r},recognize:function(e){var t,r,n,i=[this.rootState],o={},s=!1;if(n=e.indexOf("?"),n!==-1){var a=e.substr(n+1,e.length);e=e.substr(0,n),o=this.parseQueryString(a)}for(e=decodeURI(e),"/"!==e.charAt(0)&&(e="/"+e),t=e.length,t>1&&"/"===e.charAt(t-1)&&(e=e.substr(0,t-1),s=!0),r=0;r): void { const embed = utils.find(embed => { - return (embed.config.type === event.type - && embed.config.uniqueId === event.id); + return (embed.config.uniqueId === event.id); }, this.embeds); if (embed) { diff --git a/test/test.spec.ts b/test/test.spec.ts index f7f3ee3a..3353d3c5 100644 --- a/test/test.spec.ts +++ b/test/test.spec.ts @@ -1,6 +1,7 @@ import * as service from '../src/service'; import * as embed from '../src/embed'; import * as report from '../src/report'; +import * as create from '../src/create'; import * as dashboard from '../src/dashboard'; import * as page from '../src/page'; import * as Wpmp from 'window-post-message-proxy'; @@ -197,6 +198,36 @@ describe('service', function () { expect(attemptEmbed).toThrowError(Error); }); + it('if Create is already embedded in element re-use the existing component by calling load with the new information', function () { + // Arrange + const $element = $('
    ') + .appendTo('#powerbi-fixture'); + + const testConfiguration = { + accessToken: "fakeAccessToken", + embedUrl: 'fakeUrl', + id: 'report2', + type: 'report' + }; + + const createConfig: embed.IEmbedConfiguration = { + datasetId: "fakeDashboardId", + accessToken: "fakeAccessToken", + embedUrl: "fakeEmbedUrl" + }; + + // Act + const component = powerbi.createReport($element[0], createConfig); + const component2 = powerbi.embed($element[0], testConfiguration); + const component3 = powerbi.get($element[0]); + + // Assert + //expect(component.createReport).toHaveBeenCalledWith(createConfig); + expect(component).toBeDefined(); + expect(component2).toBeDefined(); + expect(component2).toBe(component3); + }); + it('if attempting to embed without specifying an embed url, throw error', function () { // Arrange const component = $('
    ') @@ -422,6 +453,115 @@ describe('service', function () { powerbi.accessToken = originalToken; }); + describe('createReport', function () { + const embedUrl = `https://embedded.powerbi.com/appTokenReportEmbed`; + const accessToken = 'ABC123'; + + it('if attempting to createReport without specifying an embed url, throw error', function () { + // Arrange + const component = $('
    ') + .appendTo('#powerbi-fixture'); + + // Act + const attemptCreate = () => { + powerbi.createReport(component[0], { embedUrl: null, accessToken: accessToken, datasetId: '123' }); + }; + + // Assert + expect(attemptCreate).toThrowError(Error); + }); + + it('if attempting to createReport without specifying an access token, throw error', function () { + // Arrange + const component = $('
    ') + .appendTo('#powerbi-fixture'); + + const originalToken = powerbi.accessToken; + powerbi.accessToken = undefined; + + // Act + const attemptCreate = () => { + powerbi.createReport(component[0], { embedUrl: embedUrl, accessToken: null, datasetId: '123' }); + }; + + // Assert + expect(attemptCreate).toThrowError(Error); + + // Cleanup + powerbi.accessToken = originalToken; + }); + + it('if attempting to createReport without specifying an datasetId, throw error', function () { + // Arrange + const $reportContainer = $(`
    `) + .appendTo('#powerbi-fixture'); + + // Act + const attemptCreate = () => { + powerbi.createReport($reportContainer[0], { embedUrl: embedUrl, accessToken: accessToken }); + }; + + // Assert + expect(attemptCreate).toThrowError(); + }); + + }); + + describe('findIdFromEmbedUrl of Create', function () { + it('should return value of datasetId query parameter in embedUrl', function () { + // Arrange + const testDatasetId = "ABC123"; + const testEmbedUrl = `http://embedded.powerbi.com/appTokenReportEmbed?datasetId=${testDatasetId}`; + + // Act + const datasetId = create.Create.findIdFromEmbedUrl(testEmbedUrl); + + // Assert + expect(datasetId).toEqual(testDatasetId); + }); + + it('should return undefinded if the datasetId parameter is not in the url', function () { + // Arrange + const testEmbedUrl = `http://embedded.powerbi.com/appTokenReportEmbed`; + + // Act + const datasetId = create.Create.findIdFromEmbedUrl(testEmbedUrl); + + // Assert + expect(datasetId).toBeUndefined(); + }); + + it('should get datasetId from configuration first', function () { + // Arrange + const testDatasetId = "ABC123"; + const accessToken = 'ABC123'; + const embedUrl = `https://embedded.powerbi.com/appTokenReportEmbed?datasetId=DIFFERENTID`; + const $reportContainer = $(`
    `) + .appendTo('#powerbi-fixture'); + + // Act + const report = powerbi.createReport($reportContainer[0], { embedUrl: embedUrl, accessToken: accessToken, datasetId: testDatasetId }); + + // Assert + expect(report.createConfig.datasetId).toEqual(testDatasetId); + }); + + it('should fallback to using datasetId from embedUrl if not supplied in create configuration', function () { + // Arrange + const testDatasetId = "ABC123"; + const accessToken = 'ABC123'; + const embedUrl = `https://embedded.powerbi.com/appTokenReportEmbed?datasetId=${testDatasetId}`; + const $reportContainer = $(`
    `) + .appendTo('#powerbi-fixture'); + + // Act + const report = powerbi.createReport($reportContainer[0], { embedUrl: embedUrl, accessToken: accessToken }); + + // Assert + expect(report.createConfig.datasetId).toEqual(testDatasetId); + }); + }); + describe('reports', function () { it('creates report iframe from embedUrl', function () { // Arrange @@ -776,6 +916,74 @@ describe('Protocol', function () { }); }); + describe('create', function () { + describe('report', function () { + it('POST /report/create returns 400 if the request is invalid', function (done) { + // Arrange + const testData = { + uniqueId: 'uniqueId', + create: { + datasetId: "fakeId", + accessToken: "fakeToken", + } + }; + + iframeLoaded + .then(() => { + spyApp.validateCreateReport.and.returnValue(Promise.reject(null)); + + // Act + hpm.post('/report/create', testData.create, { uid: testData.uniqueId }) + .then(() => { + expect(false).toBe(true); + spyApp.validateReportLoad.calls.reset(); + done(); + }) + .catch(response => { + // Assert + expect(spyApp.validateCreateReport).toHaveBeenCalledWith(testData.create); + expect(response.statusCode).toEqual(400); + + // Cleanup + spyApp.validateCreateReport.calls.reset(); + done(); + }); + }); + }); + + it('POST /report/create returns 202 if the request is valid', function (done) { + // Arrange + const testData = { + create: { + datasetId: "fakeId", + accessToken: "fakeToken", + } + }; + + iframeLoaded + .then(() => { + spyApp.validateCreateReport.and.returnValue(Promise.resolve(null)); + // Act + hpm.post('/report/create', testData.create) + .then(response => { + // Assert + expect(spyApp.validateCreateReport).toHaveBeenCalledWith(testData.create); + expect(response.statusCode).toEqual(202); + // Cleanup + spyApp.validateCreateReport.calls.reset(); + spyApp.reportLoad.calls.reset(); + done(); + }) + .catch(response => { + expect(false).toBe(true); + spyApp.validateCreateReport.calls.reset(); + done(); + }); + }); + }); + }); + }); + describe('load', function () { describe('report', function () { it('POST /report/load returns 400 if the request is invalid', function (done) { @@ -1202,6 +1410,92 @@ describe('Protocol', function () { }); }); + describe('switchMode', function () { + it('POST /report/switchMode returns 202 if the request is valid', function (done) { + // Arrange + iframeLoaded + .then(() => { + spyApp.switchMode.and.returnValue(Promise.resolve(null)); + // Act + hpm.post('/report/switchMode/Edit', null) + .then(response => { + // Assert + expect(spyApp.switchMode).toHaveBeenCalled(); + expect(response.statusCode).toEqual(202); + // Cleanup + spyApp.switchMode.calls.reset(); + done(); + }); + }); + }); + }); + + describe('save', function () { + it('POST /report/save returns 202 if the request is valid', function (done) { + // Arrange + iframeLoaded + .then(() => { + spyApp.save.and.returnValue(Promise.resolve(null)); + // Act + hpm.post('/report/save', null) + .then(response => { + // Assert + expect(spyApp.save).toHaveBeenCalled(); + expect(response.statusCode).toEqual(202); + // Cleanup + spyApp.save.calls.reset(); + done(); + }); + }); + }); + }); + + describe('saveAs', function () { + it('POST /report/saveAs returns 202 if the request is valid', function (done) { + // Arrange + let saveAsParameters: models.ISaveAsParameters = { name: "reportName" }; + + iframeLoaded + .then(() => { + spyApp.saveAs.and.returnValue(Promise.resolve(null)); + // Act + hpm.post('/report/saveAs', saveAsParameters) + .then(response => { + // Assert + expect(spyApp.saveAs).toHaveBeenCalled(); + expect(spyApp.saveAs).toHaveBeenCalledWith(saveAsParameters); + expect(response.statusCode).toEqual(202); + // Cleanup + spyApp.saveAs.calls.reset(); + done(); + }); + }); + }); + }); + + describe('setAccessToken', function () { + it('POST /report/token returns 202 if the request is valid', function (done) { + // Arrange + let accessToken: string = "fakeToken"; + + iframeLoaded + .then(() => { + spyApp.setAccessToken.and.returnValue(Promise.resolve(null)); + // Act + hpm.post('/report/token', accessToken) + .then(response => { + // Assert + expect(spyApp.setAccessToken).toHaveBeenCalled(); + expect(spyApp.setAccessToken).toHaveBeenCalledWith(accessToken); + expect(response.statusCode).toEqual(202); + // Cleanup + spyApp.saveAs.calls.reset(); + done(); + }); + }); + }); + }); + describe('filters (report level)', function () { it('GET /report/filters returns 200 with body as array of filters', function (done) { // Arrange @@ -1805,16 +2099,21 @@ describe('Protocol', function () { describe('SDK-to-HPM', function () { let $reportElement: JQuery; let $dashboardElement: JQuery; + let $createElement: JQuery; let iframe: HTMLIFrameElement; let dashboardIframe: HTMLIFrameElement; + let createIframe: HTMLIFrameElement; let powerbi: service.Service; let report: report.Report; + let create: create.Create; let dashboard: dashboard.Dashboard; let page1: page.Page; let uniqueId = 'uniqueId'; + let createUniqueId = 'uniqueId'; let dashboardUniqueId = 'uniqueId'; let embedConfiguration: embed.IEmbedConfiguration; let dashboardEmbedConfiguration: embed.IEmbedConfiguration; + let embedCreateConfiguration: embed.IEmbedConfiguration; beforeAll(function () { const spyHpmFactory: factories.IHpmFactory = () => { @@ -1832,6 +2131,8 @@ describe('SDK-to-HPM', function () { $reportElement = $(`
    `) .appendTo(document.body); + $createElement = $(`
    `) + .appendTo(document.body); $dashboardElement = $(`
    `) .appendTo(document.body); @@ -1842,6 +2143,11 @@ describe('SDK-to-HPM', function () { accessToken: 'fakeToken', embedUrl: iframeSrc }; + embedCreateConfiguration = { + datasetId: "fakeReportId", + accessToken: 'fakeToken', + embedUrl: iframeSrc + }; dashboardEmbedConfiguration = { type: "dashboard", id: "fakeDashboardId", @@ -1849,12 +2155,15 @@ describe('SDK-to-HPM', function () { embedUrl: iframeSrc }; report = powerbi.embed($reportElement[0], embedConfiguration); + create = powerbi.createReport($createElement[0], embedCreateConfiguration); dashboard = powerbi.embed($dashboardElement[0], dashboardEmbedConfiguration); page1 = new page.Page(report, 'xyz'); uniqueId = report.config.uniqueId; + createUniqueId = create.config.uniqueId; dashboardUniqueId = dashboard.config.uniqueId; iframe = $reportElement.find('iframe')[0]; + createIframe = $createElement.find('iframe')[0]; dashboardIframe = $dashboardElement.find('iframe')[0]; // Reset load handler @@ -2212,6 +2521,132 @@ describe('SDK-to-HPM', function () { }); }); + describe('switchMode', function () { + it('report.switchMode() sends POST /report/switchMode', function () { + // Arrange + spyHpm.post.and.returnValue(Promise.resolve({ + body: {} + })); + + // Act + report.switchMode(models.ViewMode.Edit); + + // Assert + let url = '/report/switchMode/' + models.ViewMode.Edit; + expect(spyHpm.post).toHaveBeenCalledWith(url, null, { uid: uniqueId }, iframe.contentWindow); + }); + + it('report.switchMode() returns promise that resolves if the request is accepted', function (done) { + // Arrange + spyHpm.post.and.returnValue(Promise.resolve({ + body: {} + })); + + // Act + report.switchMode(models.ViewMode.Edit) + .then(() => { + // Assert + let url = '/report/switchMode/' + models.ViewMode.Edit; + expect(spyHpm.post).toHaveBeenCalledWith(url, null, { uid: uniqueId }, iframe.contentWindow); + done(); + }); + }); + }); + + describe('save', function () { + it('report.save() sends POST /report/save', function () { + // Arrange + spyHpm.post.and.returnValue(Promise.resolve({ + body: {} + })); + + // Act + report.save(); + + // Assert + expect(spyHpm.post).toHaveBeenCalledWith('/report/save', null, { uid: uniqueId }, iframe.contentWindow); + }); + + it('report.save() returns promise that resolves if the request is accepted', function (done) { + // Arrange + spyHpm.post.and.returnValue(Promise.resolve({ + body: {} + })); + + // Act + report.save() + .then(() => { + // Assert + expect(spyHpm.post).toHaveBeenCalledWith('/report/save', null, { uid: uniqueId }, iframe.contentWindow); + done(); + }); + }); + }); + + describe('saveAs', function () { + let saveAsParameters: models.ISaveAsParameters = { name: "reportName" }; + + it('report.saveAs() sends POST /report/saveAs', function () { + // Arrange + spyHpm.post.and.returnValue(Promise.resolve({ + body: {} + })); + + // Act + report.saveAs(saveAsParameters); + + // Assert + expect(spyHpm.post).toHaveBeenCalledWith('/report/saveAs', saveAsParameters, { uid: uniqueId }, iframe.contentWindow); + }); + + it('report.saveAs() returns promise that resolves if the request is accepted', function (done) { + // Arrange + spyHpm.post.and.returnValue(Promise.resolve({ + body: {} + })); + + // Act + report.saveAs(saveAsParameters) + .then(() => { + // Assert + expect(spyHpm.post).toHaveBeenCalledWith('/report/saveAs', saveAsParameters, { uid: uniqueId }, iframe.contentWindow); + done(); + }); + }); + }); + + describe('setAccessToken', function () { + let accessToken: string = "fakeToken"; + + it('report.setAccessToken() sends POST /report/token', function () { + // Arrange + spyHpm.post.and.returnValue(Promise.resolve({ + body: {} + })); + + // Act + report.setAccessToken(accessToken); + + // Assert + expect(spyHpm.post).toHaveBeenCalledWith('/report/token', accessToken, { uid: uniqueId }, iframe.contentWindow); + }); + + it('report.setAccessToken() returns promise that resolves if the request is accepted', function (done) { + // Arrange + spyHpm.post.and.returnValue(Promise.resolve({ + body: {} + })); + + // Act + report.setAccessToken(accessToken) + .then(() => { + // Assert + expect(spyHpm.post).toHaveBeenCalledWith('/report/token', accessToken, { uid: uniqueId }, iframe.contentWindow); + done(); + }); + }); + }); + describe('print', function () { it('report.print() sends POST /report/print', function () { // Arrange @@ -2336,6 +2771,81 @@ describe('SDK-to-HPM', function () { }); }); + describe('create', function () { + describe('createReport', function () { + it('create.createReport() sends POST /report/create with configuration in body', function () { + // Arrange + const testData = { + createConfiguration: { + datasetId: 'fakeId', + accessToken: 'fakeToken' + }, + response: { + body: null + } + }; + + spyHpm.post.and.returnValue(Promise.resolve(testData.response)); + + // Act + create.createReport(testData.createConfiguration); + + // Assert + expect(spyHpm.post).toHaveBeenCalledWith('/report/create', testData.createConfiguration, { uid: createUniqueId }, createIframe.contentWindow); + }); + + it('create.createReport() returns promise that rejects with validation error if the create configuration is invalid', function (done) { + // Arrange + const testData = { + createConfiguration: { + datasetId: 'fakeId', + accessToken: 'fakeToken' + }, + errorResponse: { + body: { + message: "invalid configuration object" + } + } + }; + + spyHpm.post.and.returnValue(Promise.reject(testData.errorResponse)); + + // Act + create.createReport(testData.createConfiguration) + .catch(error => { + expect(spyHpm.post).toHaveBeenCalledWith('/report/create', testData.createConfiguration, { uid: createUniqueId }, createIframe.contentWindow); + expect(error).toEqual(testData.errorResponse.body); + // Assert + done(); + }); + }); + + it('create.createReport() returns promise that resolves with null if create report was successful', function (done) { + // Arrange + const testData = { + createConfiguration: { + datasetId: 'fakeId', + accessToken: 'fakeToken' + }, + response: { + body: null + } + }; + + spyHpm.post.and.returnValue(Promise.resolve(testData.response)); + + // Act + create.createReport(testData.createConfiguration) + .then(response => { + expect(spyHpm.post).toHaveBeenCalledWith('/report/create', testData.createConfiguration, { uid: createUniqueId }, createIframe.contentWindow); + expect(response).toEqual(null); + // Assert + done(); + }); + }); + }); + }); + describe('dashboard', function () { describe('load', function () { it('dashboard.load() sends POST /dashboard/load with configuration in body', function () { diff --git a/test/utility/mockApp.ts b/test/utility/mockApp.ts index ae015a56..e9242dfb 100644 --- a/test/utility/mockApp.ts +++ b/test/utility/mockApp.ts @@ -20,6 +20,11 @@ export interface IApp { // Other print(): Promise; exportData(): Promise; + validateCreateReport(config: models.IReportCreateConfiguration): Promise; + switchMode(): Promise; + save(): Promise; + saveAs(saveAsParameters: models.ISaveAsParameters): Promise; + setAccessToken(accessToken: string): Promise; } export const mockAppSpyObj = { @@ -42,6 +47,11 @@ export const mockAppSpyObj = { // Other print: jasmine.createSpy("print").and.returnValue(Promise.resolve(null)), exportData: jasmine.createSpy("exportData").and.returnValue(Promise.resolve(null)), + validateCreateReport: jasmine.createSpy("validateCreateReport").and.callFake(models.validateCreateReport), + switchMode: jasmine.createSpy("switchMode").and.returnValue(Promise.resolve(null)), + save: jasmine.createSpy("save").and.returnValue(Promise.resolve(null)), + saveAs: jasmine.createSpy("saveAs").and.returnValue(Promise.resolve(null)), + setAccessToken: jasmine.createSpy("setAccessToken").and.returnValue(Promise.resolve(null)), reset() { mockAppSpyObj.dashboardLoad.calls.reset(); @@ -58,6 +68,11 @@ export const mockAppSpyObj = { mockAppSpyObj.validateFilter.calls.reset(); mockAppSpyObj.print.calls.reset(); mockAppSpyObj.exportData.calls.reset(); + mockAppSpyObj.validateCreateReport.calls.reset(); + mockAppSpyObj.switchMode.calls.reset(); + mockAppSpyObj.save.calls.reset(); + mockAppSpyObj.saveAs.calls.reset(); + mockAppSpyObj.setAccessToken.calls.reset(); } }; diff --git a/test/utility/mockEmbed.ts b/test/utility/mockEmbed.ts index 60f98160..0c05226e 100644 --- a/test/utility/mockEmbed.ts +++ b/test/utility/mockEmbed.ts @@ -65,6 +65,30 @@ export function setupEmbedMockApp(iframeContentWindow: Window, parentWindow: Win }); }); + /** + * Create Report + */ + router.post('/report/create', (req, res) => { + const uniqueId = req.headers['uid']; + const createConfig = req.body; + return app.validateCreateReport(createConfig) + .then(() => { + app.reportLoad(createConfig) + .then(() => { + const initiator = "sdk"; + hpm.post(`/reports/${uniqueId}/events/loaded`, { + initiator + }); + }, error => { + hpm.post(`/reports/${uniqueId}/events/error`, error); + }); + + res.send(202); + }, error => { + res.send(400, error); + }); + }); + /** * Report Embed */ @@ -244,5 +268,27 @@ export function setupEmbedMockApp(iframeContentWindow: Window, parentWindow: Win res.send(202); }); + router.post('report/switchMode/Edit', (req, res) => { + app.switchMode(); + res.send(202); + }); + + router.post('report/save', (req, res) => { + app.save(); + res.send(202); + }); + + router.post('report/saveAs', (req, res) => { + const settings = req.body; + app.saveAs(settings); + res.send(202); + }); + + router.post('report/token', (req, res) => { + const settings = req.body; + app.setAccessToken(settings); + res.send(202); + }); + return hpm; } \ No newline at end of file From 8f6e925f7e20e6e93dbace2145ecdbc0fcfda06a Mon Sep 17 00:00:00 2001 From: Omri Armstrong Date: Thu, 2 Feb 2017 09:37:59 +0200 Subject: [PATCH 05/11] fixing save event --- demo/code-demo/scripts/codesamples.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/demo/code-demo/scripts/codesamples.js b/demo/code-demo/scripts/codesamples.js index 1fd9e690..23b09ad2 100644 --- a/demo/code-demo/scripts/codesamples.js +++ b/demo/code-demo/scripts/codesamples.js @@ -364,6 +364,7 @@ function _Report_save() { // report.on will add an event handler which prints to Log window. report.on("saved", function(event) { Log.log(event.detail); + report.off("saved"); }); } @@ -387,6 +388,7 @@ function _Report_saveAs() { // report.on will add an event handler which prints to Log window. report.on("saved", function(event) { Log.log(event.detail); + report.off("saved"); }); } From 7f6806a15ef99ea22cb9407c3d4ab8a972d58126 Mon Sep 17 00:00:00 2001 From: Omri Armstrong Date: Wed, 8 Feb 2017 10:58:57 +0200 Subject: [PATCH 06/11] handle error events --- demo/code-demo/scripts/codesamples.js | 26 ++++++++++++++------------ dist/powerbi.js | 4 ++-- dist/powerbi.js.map | 2 +- dist/powerbi.min.js | 2 +- src/embed.ts | 2 +- src/report.ts | 2 +- 6 files changed, 20 insertions(+), 18 deletions(-) diff --git a/demo/code-demo/scripts/codesamples.js b/demo/code-demo/scripts/codesamples.js index 23b09ad2..6d4f56e8 100644 --- a/demo/code-demo/scripts/codesamples.js +++ b/demo/code-demo/scripts/codesamples.js @@ -48,11 +48,15 @@ function _Embed_BasicEmbed() { // Report.off removes a given event handler if it exists. report.off("loaded"); + report.off("error"); // Report.on will add an event handler which prints to Log window. report.on("loaded", function() { Log.logText("Loaded"); }); + report.on("error", function(event) { + Log.log(event.detail); + }); } function _Embed_EmbedWithDefaultFilter() { @@ -110,13 +114,13 @@ function _Embed_Create() { // Create report var report = powerbi.createReport(reportContainer, embedCreateConfiguration); - // // Report.off removes a given event handler if it exists. - // report.off("loaded"); + // Report.off removes a given event handler if it exists. + report.off("error"); - // // Report.on will add an event handler which prints to Log window. - // report.on("loaded", function() { - // Log.logText("Loaded"); - // }); + // Report.on will add an event handler which prints to Log window. + report.on("error", function(event) { + Log.log(event.detail); + }); } // ---- Report Operations ---------------------------------------------------- @@ -357,13 +361,12 @@ function _Report_save() { // Save report report.save(); - - // report.off removes a given event handler if it exists. - report.off("saved"); // report.on will add an event handler which prints to Log window. report.on("saved", function(event) { Log.log(event.detail); + + // report.off removes a given event handler if it exists. report.off("saved"); }); } @@ -382,12 +385,11 @@ function _Report_saveAs() { // SaveAs report report.saveAs(saveAsParameters); - // report.off removes a given event handler if it exists. - report.off("saved"); - // report.on will add an event handler which prints to Log window. report.on("saved", function(event) { Log.log(event.detail); + + // report.off removes a given event handler if it exists. report.off("saved"); }); } diff --git a/dist/powerbi.js b/dist/powerbi.js index 0cd7d4c4..8dc2e8b9 100644 --- a/dist/powerbi.js +++ b/dist/powerbi.js @@ -681,7 +681,7 @@ return /******/ (function(modules) { // webpackBootstrap this.iframe.addEventListener('load', function () { return _this.createReport(_this.createConfig); }, false); } }; - Embed.allowedEvents = ["loaded", "saved", "rendered", "saveAsTriggered"]; + Embed.allowedEvents = ["loaded", "saved", "rendered", "saveAsTriggered", "error", "dataSelected"]; Embed.accessTokenAttribute = 'powerbi-access-token'; Embed.embedUrlAttribute = 'powerbi-embed-url'; Embed.nameAttribute = 'powerbi-name'; @@ -1058,7 +1058,7 @@ return /******/ (function(modules) { // webpackBootstrap throw response.body; }); }; - Report.allowedEvents = ["dataSelected", "filtersApplied", "pageChanged", "error"]; + Report.allowedEvents = ["filtersApplied", "pageChanged"]; Report.reportIdAttribute = 'powerbi-report-id'; Report.filterPaneEnabledAttribute = 'powerbi-settings-filter-pane-enabled'; Report.navContentPaneEnabledAttribute = 'powerbi-settings-nav-content-pane-enabled'; diff --git a/dist/powerbi.js.map b/dist/powerbi.js.map index 081c78fb..ea2e825a 100644 --- a/dist/powerbi.js.map +++ b/dist/powerbi.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 8979148a721b44a2ce6f","webpack:///./src/powerbi.ts","webpack:///./src/service.ts","webpack:///./src/embed.ts","webpack:///./src/util.ts","webpack:///./src/report.ts","webpack:///./~/powerbi-models/dist/models.js","webpack:///./src/page.ts","webpack:///./src/create.ts","webpack:///./src/dashboard.ts","webpack:///./src/tile.ts","webpack:///./src/factories.ts","webpack:///./src/config.ts","webpack:///./~/window-post-message-proxy/dist/windowPostMessageProxy.js","webpack:///./~/http-post-message/dist/httpPostMessage.js","webpack:///./~/powerbi-router/dist/router.js"],"names":[],"mappings":"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cACD,KAAK,CAAC,kBAAQ;aACb,MAAM,QAAQ,CAAC,IAAI,CAAC;SACtB,CAAC,CAAC,CAAC;KACP,CAAC;KAzPM,oBAAa,GAAG,CAAC,cAAc,EAAE,gBAAgB,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC;KAC3E,wBAAiB,GAAG,mBAAmB,CAAC;KACxC,iCAA0B,GAAG,sCAAsC,CAAC;KACpE,qCAA8B,GAAG,2CAA2C,CAAC;KAC7E,oBAAa,GAAG,cAAc,CAAC;KAC/B,WAAI,GAAG,QAAQ,CAAC;KAqPzB,aAAC;AAAD,EAAC,CA3P2B,KAAK,CAAC,KAAK,GA2PtC;AA3PY,eAAM,SA2PlB;;;;;;;ACzRD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD,qCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;AACA,qBAAoB,sBAAsB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA,GAAE,gDAAgD;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA,0BAAyB,uBAAuB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAwB,2BAA2B;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA,0BAAyB,uBAAuB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAiD,+BAA+B,GAAG,sCAAsC;AACzH,mDAAkD,+BAA+B,GAAG,sCAAsC;AAC1H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE,kDAAkD;AACpD;AACA;AACA;AACA;AACA,GAAE,4CAA4C;AAC9C;AACA;;;AAGA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAQ;AACR;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;AACA,SAAQ;AACR;AACA;AACA,SAAQ;AACR;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;AACA,SAAQ;AACR;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA,MAAK;AACL;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA,OAAM;AACN;AACA;AACA,OAAM;AACN;AACA;AACA,OAAM;AACN;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;;AAEA,QAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAe;AACf;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,+BAA8B;AAC9B;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,uFAAsF;AACtF;AACA,qBAAoB;AACpB;;AAEA;AACA;AACA,oFAAmF;AACnF;AACA,yBAAwB;AACxB;AACA;;AAEA;AACA;AACA,sFAAqF;AACrF;AACA,yBAAwB;AACxB;AACA;;AAEA;AACA;AACA,oFAAmF;AACnF;AACA,yBAAwB;AACxB;AACA;;AAEA;AACA;AACA,sFAAqF;AACrF;AACA,yBAAwB;AACxB;AACA;;AAEA;AACA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ACA;AACA;AACA;;AAEA,iBAAgB,iBAAiB;AACjC;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAgB,SAAS;AACzB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,wCAAuC,SAAS;AAChD;AACA;AACA;AACA;AACA;AACA;;AAEA,uCAAsC,SAAS;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,2CAA0C,SAAS;AACnD;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA,iBAAgB,4BAA4B;AAC5C;AACA;;AAEA,qBAAoB,iBAAiB;AACrC;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA,qBAAoB,kBAAkB;AACtC;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,yBAAwB,qBAAqB;AAC7C;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAwB,yBAAyB;AACjD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAwB,gBAAgB;AACxC;AACA;AACA;AACA;AACA;AACA;;AAEA,qBAAoB,yBAAyB;AAC7C;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;;AAEN;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,8BAA6B;;AAE7B;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,SAAQ;;AAER;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,yCAAwC,SAAS;AACjD;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA,iBAAgB;AAChB;;AAEA;;AAEA;AACA,qCAAoC;AACpC;;AAEA,iBAAgB,qBAAqB;AACrC;;AAEA,mFAAkF;;AAElF;;AAEA,sBAAqB;;AAErB;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,4BAA2B;AAC3B,uCAAsC;AACtC;AACA;AACA,eAAc,sBAAsB;AACpC;AACA,0BAAyB;AACzB;AACA;AACA,+BAA8B,GAAG;AACjC;AACA,0BAAyB;AACzB;AACA;;AAEA;AACA;AACA,OAAM;;AAEN;AACA;;AAEA;AACA;AACA,qFAAoF;AACpF;AACA,8BAA6B;AAC7B;AACA;AACA,uDAAsD;AACtD,uDAAsD;;AAEtD;;AAEA,iHAAgH;AAChH;AACA,8BAA6B;AAC7B;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,4BAA2B,0BAA0B,EAAE;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA;AACA;AACA,wBAAuB,yBAAyB;;AAEhD;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;AAGA,QAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAgB;AAChB,iBAAgB;AAChB;AACA;AACA,qCAAoC,WAAW;AAC/C;AACA,WAAU;AACV;AACA;AACA,WAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,kEAAiE;AACjE;AACA,8CAA6C;AAC7C,wBAAuB;AACvB;;AAEA;AACA;AACA,+BAA8B;AAC9B;AACA,8CAA6C,iBAAiB,EAAE;;AAEhE;AACA;;AAEA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,iBAAgB,kBAAkB;AAClC;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,wBAAuB;AACvB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,qBAAoB,cAAc;AAClC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA,QAAO;AACP;AACA;;AAEA;;AAEA;;AAEA;AACA,uCAAsC,SAAS;AAC/C;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,OAAM;AACN;;AAEA;;AAEA,QAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAM;;AAEN;AACA;AACA;;AAEA;AACA;;AAEA;AACA,sEAAqE;AACrE;AACA;AACA;AACA;AACA;AACA,uBAAsB;AACtB;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,0BAAyB;AACzB;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,iBAAgB,iBAAiB;AACjC;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,WAAU;;AAEV;AACA,OAAM;;AAEN;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,oCAAmC,SAAS;AAC5C;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,kBAAiB,KAAK;;AAEtB;AACA;AACA;AACA;AACA;AACA;AACA,uCAAsC;AACtC;AACA;AACA,6CAA4C,KAAK;AACjD,4CAA2C,KAAK;AAChD;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;AACN;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA,SAAQ;AACR;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,sCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,qBAAoB,4BAA4B;AAChD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,qBAAoB,yBAAyB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,6CAA4C,OAAO;AACnD;AACA;AACA;AACA;AACA,4CAA2C,OAAO;AAClD;AACA;AACA;AACA;AACA;AACA,eAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,4CAA2C,OAAO;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAI;AACJ;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,oBAAmB,mBAAmB;AACtC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,sBAAqB,mBAAmB;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAsB,iBAAiB;AACvC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,gCAA+B,QAAQ;AACvC;AACA;AACA;AACA,OAAM;AACN;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA,YAAW,MAAM;AACjB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAI;AACJ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA,QAAO;AACP;AACA;;AAEA,oCAAmC,sDAAsD;AACzF,GAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,cAAa,OAAO;AACpB,gBAAe,MAAM;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAa,MAAM;AACnB,cAAa,SAAS;AACtB;AACA,gBAAe,MAAM;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB,cAAa,SAAS;AACtB;AACA,gBAAe,MAAM;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB,gBAAe,MAAM;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAsC;AACtC;AACA,OAAM;AACN,8BAA6B;AAC7B;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAa,MAAM;AACnB,gBAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;;AAEA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB,gBAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB,gBAAe,OAAO;AACtB;AACA;AACA,WAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAgC,mCAAmC;AACnE;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB,gBAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,eAAc,WAAW;AACzB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,0BAAyB;;AAEzB,2CAA0C,qBAAqB;;AAE/D;AACA;AACA;AACA;AACA;AACA,oCAAmC,oBAAoB;;AAEvD;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB,gBAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,eAAc,iBAAiB;AAC/B;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,4BAA2B,iBAAiB;AAC5C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,gBAAe,iBAAiB;AAChC;;AAEA;AACA;AACA;;AAEA;AACA;AACA,gCAA+B,oBAAoB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB;AACA,gBAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB;AACA,gBAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ,IAAG;AACH,wCAAuC;AACvC;AACA,KAAI,OAAO;AACX;AACA;AACA;AACA;AACA,IAAG,OAAO;AACV;AACA;;AAEA,GAAE;;AAEF,8BAA6B,6DAA6D,aAAa,EAAE;;AAEzG,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA,QAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;;;AAGA,QAAO;AACP;AACA;;AAEA;;AAEA;AACA;;;AAGA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,mBAAkB,SAAS;AAC3B;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,OAAM;AACN;AACA,OAAM;AACN;AACA;AACA;;AAEA;AACA;;;AAGA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV,SAAQ;AACR;AACA;AACA,OAAM;;AAEN;;AAEA;AACA;AACA;AACA;;;AAGA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ,iBAAgB;AAChB;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AA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CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAuD,uCAAuC;AAC9F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2FAA0F;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAsB;AACtB;AACA;AACA,eAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;;;AAGA;AACA;AACA,EAAC;AACD;AACA,mD;;;;;;ACtSA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD,qCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,0CAAyC,qBAAqB;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAkC,cAAc;AAChD,wCAAuC,yCAAyC;AAChF;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA,mCAAkC,cAAc;AAChD,wCAAuC,yCAAyC;AAChF;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA,mCAAkC,cAAc;AAChD,wCAAuC,yCAAyC;AAChF;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA,mCAAkC,cAAc;AAChD,wCAAuC,yCAAyC;AAChF;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA,gCAA+B,aAAa;AAC5C,mCAAkC,cAAc;AAChD,wCAAuC,yCAAyC;AAChF;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA,wCAAuC,yCAAyC;AAChF,0CAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAAyB,uBAAuB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA;AACA,GAAE;AACF;;;AAGA;AACA;AACA,EAAC;AACD;AACA,4C;;;;;;AClLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD,qCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAqC,iBAAiB,EAAE;AACxD;AACA;AACA,eAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;;;AAGA,QAAO;AACP;AACA;;AAEA,oCAAmC,8CAA8C;AACjF;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,wCAAuC,6EAA6E;AACpH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAQ;;AAER;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,WAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;AACA,qBAAoB,qBAAqB;AACzC;AACA;;AAEA;AACA,qBAAoB;AACpB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAY;AACZ;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA,iCAAgC,+BAA+B;AAC/D,gBAAe,iBAAiB;AAChC,SAAQ;AACR;;AAEA;AACA;AACA,8BAA6B,KAAK;AAClC;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,0DAAyD,sBAAsB;AAC/E;AACA;AACA;;AAEA,uBAAsB,iBAAiB;AACvC;AACA,6CAA4C,yDAAyD;AACrG;;AAEA;AACA,SAAQ;;AAER;AACA;AACA,SAAQ;;AAER;AACA;AACA;AACA;;AAEA,yDAAwD,kBAAkB;AAC1E;AACA;AACA,mCAAkC,yDAAyD;AAC3F,SAAQ;;AAER;AACA;AACA,SAAQ;;AAER;AACA;AACA;AACA;;AAEA,sDAAqD,kBAAkB;AACvE;AACA;AACA,mCAAkC,wDAAwD;AAC1F,SAAQ;;AAER;AACA;AACA,SAAQ;;AAER;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAQ;AACR,2BAA0B,WAAW,EAAE;AACvC,8BAA6B,WAAW;AACxC;;AAEA;AACA;AACA;AACA,sCAAqC,yBAAyB;;AAE9D;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,qBAAoB,mBAAmB;AACvC;;AAEA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA;AACA,WAAU;AACV;AACA;AACA,WAAU;AACV;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,uBAAsB,qBAAqB;AAC3C;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAQ;;AAER;AACA;;AAEA;AACA;AACA,2CAA0C,cAAc;;AAExD;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAQ;;AAER;AACA;AACA;AACA;;AAEA;;AAEA,uBAAsB,qBAAqB;AAC3C;;AAEA;;AAEA;AACA,6CAA4C,sBAAsB;AAClE,aAAY;AACZ,6CAA4C,sBAAsB;AAClE;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAQ;AACR;;AAEA;AACA;;AAEA,sCAAqC,KAAK;AAC1C;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;;AAEN;AACA;AACA;AACA;;AAEA;;AAEA,qBAAoB,mBAAmB;AACvC;;AAEA,uBAAsB,gBAAgB;AACtC;AACA;;AAEA,uBAAsB;AACtB;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAQ,eAAe;AACvB;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,8BAA6B;AAC7B;;AAEA;;AAEA,uBAAsB,iBAAiB;AACvC;;AAEA;;AAEA;;AAEA,yBAAwB,mBAAmB;AAC3C;;AAEA,0EAAyE,UAAU;;AAEnF;;AAEA;AACA,+CAA8C,0DAA0D;AACxG;;AAEA;AACA;AACA;AACA;AACA,2BAA0B;AAC1B;AACA;;AAEA;AACA,6CAA4C,0DAA0D;AACtG;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAQ;;AAER;AACA;;AAEA,uBAAsB,oDAAoD;;AAE1E;;AAEA,uBAAsB,yBAAyB;AAC/C;AACA;;AAEA;AACA,SAAQ;;AAER;AACA;AACA,SAAQ;;AAER;AACA;AACA,uBAAsB,oDAAoD;;AAE1E;;AAEA,uBAAsB,mBAAmB;AACzC;;AAEA,wEAAuE,UAAU;;AAEjF;AACA;AACA;;AAEA,yCAAwC,uBAAuB;;AAE/D;AACA;AACA;;AAEA;AACA,SAAQ;;AAER;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAwB,iBAAiB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA4B,kBAAkB;AAC9C;AACA;AACA;AACA,aAAY;AACZ;AACA;AACA;AACA;;AAEA,mCAAkC,WAAW;;AAE7C;AACA,SAAQ;;AAER;AACA;AACA,sBAAqB,kBAAkB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAY;AACZ;AACA;AACA;AACA;AACA,SAAQ;;AAER;AACA;AACA,yDAAwD;AACxD;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,uCAAsC,mBAAmB;;AAEzD;AACA;AACA;AACA;AACA;;AAEA,mBAAkB,eAAe;AACjC;AACA,iCAAgC,OAAO;AACvC;;AAEA;AACA,mBAAkB,iBAAiB;AACnC,qCAAoC,2BAA2B;AAC/D;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA,sDAAqD,oCAAoC,EAAE;AAC3F,OAAM;AACN;AACA,OAAM;AACN;AACA;AACA,GAAE;;AAEF;AACA,8BAA6B;;AAE7B,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA,QAAO;AACP;AACA;;AAEA,+BAA8B,mDAAmD;;;AAGjF;AACA;AACA,EAAC;AACD;AACA,mC","file":"powerbi.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"powerbi-client\"] = factory();\n\telse\n\t\troot[\"powerbi-client\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 8979148a721b44a2ce6f","import * as service from './service';\r\nimport * as factories from './factories';\r\nimport * as models from 'powerbi-models';\r\nimport { IFilterable } from './ifilterable';\r\n\r\nexport {\r\n IFilterable,\r\n service,\r\n factories,\r\n models\r\n};\r\nexport {\r\n Report\r\n} from './report';\r\nexport {\r\n Tile\r\n} from './tile';\r\nexport {\r\n IEmbedConfiguration,\r\n Embed\r\n} from './embed';\r\nexport {\r\n Page\r\n} from './page';\r\n\r\ndeclare var powerbi: service.Service;\r\ndeclare global {\r\n interface Window {\r\n powerbi: service.Service;\r\n }\r\n}\r\n\r\n/**\r\n * Makes Power BI available to the global object for use in applications that don't have module loading support.\r\n *\r\n * Note: create an instance of the class with the default configuration for normal usage, or save the class so that you can create an instance of the service.\r\n */\r\nvar powerbi = new service.Service(factories.hpmFactory, factories.wpmpFactory, factories.routerFactory);\r\nwindow.powerbi = powerbi;\n\n\n// WEBPACK FOOTER //\n// ./src/powerbi.ts","import * as embed from './embed';\nimport { Report } from './report';\nimport { Create } from './create';\nimport { Dashboard } from './dashboard';\nimport { Tile } from './tile';\nimport { Page } from './page';\nimport * as utils from './util';\nimport * as wpmp from 'window-post-message-proxy';\nimport * as hpm from 'http-post-message';\nimport * as router from 'powerbi-router';\nimport * as models from 'powerbi-models';\n\nexport interface IEvent {\n type: string;\n id: string;\n name: string;\n value: T;\n}\n\nexport interface ICustomEvent extends CustomEvent {\n detail: T;\n}\n\nexport interface IEventHandler {\n (event: ICustomEvent): any;\n}\n\nexport interface IHpmFactory {\n (wpmp: wpmp.WindowPostMessageProxy, targetWindow?: Window, version?: string, type?: string, origin?: string): hpm.HttpPostMessage;\n}\n\nexport interface IWpmpFactory {\n (name?: string, logMessages?: boolean, eventSourceOverrideWindow?: Window): wpmp.WindowPostMessageProxy;\n}\n\nexport interface IRouterFactory {\n (wpmp: wpmp.WindowPostMessageProxy): router.Router;\n}\n\nexport interface IPowerBiElement extends HTMLElement {\n powerBiEmbed: embed.Embed;\n}\n\nexport interface IDebugOptions {\n logMessages?: boolean;\n wpmpName?: string;\n}\n\nexport interface IServiceConfiguration extends IDebugOptions {\n autoEmbedOnContentLoaded?: boolean;\n onError?: (error: any) => any;\n version?: string;\n type?: string;\n}\n\nexport interface IService {\n hpm: hpm.HttpPostMessage;\n}\n\n/**\n * The Power BI Service embed component, which is the entry point to embed all other Power BI components into your application\n * \n * @export\n * @class Service\n * @implements {IService}\n */\nexport class Service implements IService {\n\n /**\n * A list of components that this service can embed\n */\n private static components: (typeof Report | typeof Tile | typeof Dashboard)[] = [\n Tile,\n Report,\n Dashboard\n ];\n\n /**\n * The default configuration for the service\n */\n private static defaultConfig: IServiceConfiguration = {\n autoEmbedOnContentLoaded: false,\n onError: (...args) => console.log(args[0], args.slice(1))\n };\n\n /**\n * Gets or sets the access token as the global fallback token to use when a local token is not provided for a report or tile.\n * \n * @type {string}\n */\n accessToken: string;\n\n /**The Configuration object for the service*/\n private config: IServiceConfiguration;\n\n /** A list of Dashboard, Report and Tile components that have been embedded using this service instance. */\n private embeds: embed.Embed[];\n /** TODO: Look for way to make hpm private without sacraficing ease of maitenance. This should be private but in embed needs to call methods. */\n hpm: hpm.HttpPostMessage;\n /** TODO: Look for way to make wpmp private. This is only public to allow stopping the wpmp in tests */\n wpmp: wpmp.WindowPostMessageProxy;\n private router: router.Router;\n\n /**\n * Creates an instance of a Power BI Service.\n * \n * @param {IHpmFactory} hpmFactory The http post message factory used in the postMessage communication layer\n * @param {IWpmpFactory} wpmpFactory The window post message factory used in the postMessage communication layer\n * @param {IRouterFactory} routerFactory The router factory used in the postMessage communication layer\n * @param {IServiceConfiguration} [config={}]\n */\n constructor(hpmFactory: IHpmFactory, wpmpFactory: IWpmpFactory, routerFactory: IRouterFactory, config: IServiceConfiguration = {}) {\n this.wpmp = wpmpFactory(config.wpmpName, config.logMessages);\n this.hpm = hpmFactory(this.wpmp, null, config.version, config.type);\n this.router = routerFactory(this.wpmp);\n\n /**\n * Adds handler for report events.\n */\n this.router.post(`/reports/:uniqueId/events/:eventName`, (req, res) => {\n const event: IEvent = {\n type: 'report',\n id: req.params.uniqueId,\n name: req.params.eventName,\n value: req.body\n };\n\n this.handleEvent(event);\n });\n this.router.post(`/reports/:uniqueId/pages/:pageName/events/:eventName`, (req, res) => {\n const event: IEvent = {\n type: 'report',\n id: req.params.uniqueId,\n name: req.params.eventName,\n value: req.body\n };\n\n this.handleEvent(event);\n });\n\n this.router.post(`/dashboards/:uniqueId/events/:eventName`, (req, res) => {\n const event: IEvent = {\n type: 'dashboard',\n id: req.params.uniqueId,\n name: req.params.eventName,\n value: req.body\n };\n\n this.handleEvent(event);\n });\n\n this.embeds = [];\n\n // TODO: Change when Object.assign is available.\n this.config = utils.assign({}, Service.defaultConfig, config);\n\n if (this.config.autoEmbedOnContentLoaded) {\n this.enableAutoEmbed();\n }\n }\n\n /**\n * Creates new report\n * @param {HTMLElement} element\n * @param {embed.IEmbedConfiguration} [config={}]\n * @returns {embed.Embed}\n */\n createReport(element: HTMLElement, config: embed.IEmbedConfiguration): embed.Embed {\n config.type = 'create';\n let powerBiElement = element;\n const component = new Create(this, powerBiElement, config);\n powerBiElement.powerBiEmbed = component;\n this.embeds.push(component);\n\n return component;\n }\n\n /**\n * TODO: Add a description here\n * \n * @param {HTMLElement} [container]\n * @param {embed.IEmbedConfiguration} [config=undefined]\n * @returns {embed.Embed[]}\n */\n init(container?: HTMLElement, config: embed.IEmbedConfiguration = undefined): embed.Embed[] {\n container = (container && container instanceof HTMLElement) ? container : document.body;\n\n const elements = Array.prototype.slice.call(container.querySelectorAll(`[${embed.Embed.embedUrlAttribute}]`));\n return elements.map(element => this.embed(element, config));\n }\n\n /**\n * Given a configuration based on an HTML element,\n * if the component has already been created and attached to the element, reuses the component instance and existing iframe,\n * otherwise creates a new component instance.\n * \n * @param {HTMLElement} element\n * @param {embed.IEmbedConfiguration} [config={}]\n * @returns {embed.Embed}\n */\n embed(element: HTMLElement, config: embed.IEmbedConfiguration = {}): embed.Embed {\n let component: embed.Embed;\n let powerBiElement = element;\n\n if (powerBiElement.powerBiEmbed) {\n component = this.embedExisting(powerBiElement, config);\n }\n else {\n component = this.embedNew(powerBiElement, config);\n }\n\n return component;\n }\n\n /**\n * Given a configuration based on a Power BI element, saves the component instance that reference the element for later lookup.\n * \n * @private\n * @param {IPowerBiElement} element\n * @param {embed.IEmbedConfiguration} config\n * @returns {embed.Embed}\n */\n private embedNew(element: IPowerBiElement, config: embed.IEmbedConfiguration): embed.Embed {\n const componentType = config.type || element.getAttribute(embed.Embed.typeAttribute);\n if (!componentType) {\n throw new Error(`Attempted to embed using config ${JSON.stringify(config)} on element ${element.outerHTML}, but could not determine what type of component to embed. You must specify a type in the configuration or as an attribute such as '${embed.Embed.typeAttribute}=\"${Report.type.toLowerCase()}\"'.`);\n }\n\n // Saves the type as part of the configuration so that it can be referenced later at a known location.\n config.type = componentType;\n\n const Component = utils.find(component => componentType === component.type.toLowerCase(), Service.components);\n if (!Component) {\n throw new Error(`Attempted to embed component of type: ${componentType} but did not find any matching component. Please verify the type you specified is intended.`);\n }\n\n const component = new Component(this, element, config);\n element.powerBiEmbed = component;\n this.embeds.push(component);\n\n return component;\n }\n\n /**\n * Given an element that already contains an embed component, load with a new configuration.\n * \n * @private\n * @param {IPowerBiElement} element\n * @param {embed.IEmbedConfiguration} config\n * @returns {embed.Embed}\n */\n private embedExisting(element: IPowerBiElement, config: embed.IEmbedConfiguration): embed.Embed {\n const component = utils.find(x => x.element === element, this.embeds);\n if (!component) {\n throw new Error(`Attempted to embed using config ${JSON.stringify(config)} on element ${element.outerHTML} which already has embedded comopnent associated, but could not find the existing comopnent in the list of active components. This could indicate the embeds list is out of sync with the DOM, or the component is referencing the incorrect HTML element.`);\n }\n\n /**\n * TODO: Dynamic embed type switching could be supported but there is work needed to prepare the service state and DOM cleanup.\n * remove all event handlers from the DOM, then reset the element to initial state which removes iframe, and removes from list of embeds\n * then we can call the embedNew function which would allow setting the proper embedUrl and construction of object based on the new type.\n */\n if (typeof config.type === \"string\" && config.type !== component.config.type) {\n\n /**\n * When loading report after create we want to use existing Iframe to optimize load period\n */\n if(config.type === \"report\" && component.config.type === \"create\") {\n const report = new Report(this, element, config, element.powerBiEmbed.iframe);\n report.load(config);\n element.powerBiEmbed = report;\n this.embeds.push(report);\n\n return report;\n }\n\n throw new Error(`Embedding on an existing element with a different type than the previous embed object is not supported. Attempted to embed using config ${JSON.stringify(config)} on element ${element.outerHTML}, but the existing element contains an embed of type: ${this.config.type} which does not match the new type: ${config.type}`);\n }\n\n component.load(config);\n\n return component;\n }\n\n /**\n * Adds an event handler for DOMContentLoaded, which searches the DOM for elements that have the 'powerbi-embed-url' attribute,\n * and automatically attempts to embed a powerbi component based on information from other powerbi-* attributes.\n *\n * Note: Only runs if `config.autoEmbedOnContentLoaded` is true when the service is created.\n * This handler is typically useful only for applications that are rendered on the server so that all required data is available when the handler is called.\n */\n enableAutoEmbed(): void {\n window.addEventListener('DOMContentLoaded', (event: Event) => this.init(document.body), false);\n }\n\n /**\n * Returns an instance of the component associated with the element.\n * \n * @param {HTMLElement} element\n * @returns {(Report | Tile)}\n */\n get(element: HTMLElement): Report | Tile | Dashboard {\n const powerBiElement = element;\n\n if (!powerBiElement.powerBiEmbed) {\n throw new Error(`You attempted to get an instance of powerbi component associated with element: ${element.outerHTML} but there was no associated instance.`);\n }\n\n return powerBiElement.powerBiEmbed;\n }\n\n /**\n * Finds an embed instance by the name or unique ID that is provided.\n * \n * @param {string} uniqueId\n * @returns {(Report | Tile)}\n */\n find(uniqueId: string): Report | Tile | Dashboard {\n return utils.find(x => x.config.uniqueId === uniqueId, this.embeds);\n }\n\n /**\n * Given an HTML element that has a component embedded within it, removes the component from the list of embedded components, removes the association between the element and the component, and removes the iframe.\n * \n * @param {HTMLElement} element\n * @returns {void}\n */\n reset(element: HTMLElement): void {\n const powerBiElement = element;\n\n if (!powerBiElement.powerBiEmbed) {\n return;\n }\n\n /** Removes the component from an internal list of components. */\n utils.remove(x => x === powerBiElement.powerBiEmbed, this.embeds);\n /** Deletes a property from the HTML element. */\n delete powerBiElement.powerBiEmbed;\n /** Removes the iframe from the element. */\n const iframe = element.querySelector('iframe');\n if (iframe) {\n iframe.remove();\n }\n }\n\n /**\n * Given an event object, finds the embed component with the matching type and ID, and invokes its handleEvent method with the event object.\n * \n * @private\n * @param {IEvent} event\n */\n private handleEvent(event: IEvent): void {\n const embed = utils.find(embed => {\n return (embed.config.uniqueId === event.id);\n }, this.embeds);\n\n if (embed) {\n const value = event.value;\n\n if (event.name === 'pageChanged') {\n const pageKey = 'newPage';\n const page: models.IPage = value[pageKey];\n if (!page) {\n throw new Error(`Page model not found at 'event.value.${pageKey}'.`);\n }\n value[pageKey] = new Page(embed, page.name, page.displayName);\n }\n\n utils.raiseCustomEvent(embed.element, event.name, value);\n }\n }\n}\n\n\n// WEBPACK FOOTER //\n// ./src/service.ts","import * as utils from './util';\r\nimport * as service from './service';\r\nimport * as models from 'powerbi-models';\r\nimport * as hpm from 'http-post-message';\r\n\r\ndeclare global {\r\n interface Document {\r\n // Mozilla Fullscreen\r\n mozCancelFullScreen: Function;\r\n\r\n // Ms Fullscreen\r\n msExitFullscreen: Function;\r\n }\r\n\r\n interface HTMLIFrameElement {\r\n // Mozilla Fullscreen\r\n mozRequestFullScreen: Function;\r\n\r\n // Ms Fullscreen\r\n msRequestFullscreen: Function;\r\n }\r\n}\r\n\r\n// TODO: Re-use ILoadConfiguration interface to prevent duplicating properties.\r\n// Current issue is that they are optional when embedding since they can be specificed as attributes but they are required when loading.\r\n/**\r\n * Configuration settings for Power BI embed components\r\n * \r\n * @export\r\n * @interface IEmbedConfiguration\r\n */\r\nexport interface IEmbedConfiguration {\r\n type?: string;\r\n id?: string;\r\n uniqueId?: string;\r\n embedUrl?: string;\r\n accessToken?: string;\r\n settings?: models.ISettings;\r\n pageName?: string;\r\n filters?: models.IFilter[];\r\n pageView?: models.PageView;\r\n datasetId?: string;\r\n permissions?: models.Permissions;\r\n viewMode?: models.ViewMode;\r\n}\r\n\r\nexport interface IInternalEmbedConfiguration extends models.IReportLoadConfiguration {\r\n uniqueId: string;\r\n type: string;\r\n embedUrl: string;\r\n}\r\n\r\nexport interface IInternalEventHandler {\r\n test(event: service.IEvent): boolean;\r\n handle(event: service.ICustomEvent): void;\r\n}\r\n\r\n/**\r\n * Base class for all Power BI embed components\r\n * \r\n * @export\r\n * @abstract\r\n * @class Embed\r\n */\r\nexport abstract class Embed {\r\n static allowedEvents = [\"loaded\", \"saved\", \"rendered\", \"saveAsTriggered\"];\r\n static accessTokenAttribute = 'powerbi-access-token';\r\n static embedUrlAttribute = 'powerbi-embed-url';\r\n static nameAttribute = 'powerbi-name';\r\n static typeAttribute = 'powerbi-type';\r\n static type: string;\r\n\r\n private static defaultSettings: models.ISettings = {\r\n filterPaneEnabled: true\r\n };\r\n\r\n allowedEvents = [];\r\n\r\n /**\r\n * Gets or sets the event handler registered for this embed component.\r\n * \r\n * @type {IInternalEventHandler[]}\r\n */\r\n eventHandlers: IInternalEventHandler[];\r\n\r\n /**\r\n * Gets or sets the Power BI embed service.\r\n * \r\n * @type {service.Service}\r\n */\r\n service: service.Service;\r\n\r\n /**\r\n * Gets or sets the HTML element that contains the Power BI embed component.\r\n * \r\n * @type {HTMLElement}\r\n */\r\n element: HTMLElement;\r\n\r\n /**\r\n * Gets or sets the HTML iframe element that renders the Power BI embed component.\r\n * \r\n * @type {HTMLIFrameElement}\r\n */\r\n iframe: HTMLIFrameElement;\r\n\r\n /**\r\n * Gets or sets the configuration settings for the Power BI embed component.\r\n * \r\n * @type {IInternalEmbedConfiguration}\r\n */\r\n config: IInternalEmbedConfiguration;\r\n\r\n /**\r\n * Gets or sets the configuration settings for creating report.\r\n * \r\n * @type {models.IReportCreateConfiguration}\r\n */\r\n createConfig: models.IReportCreateConfiguration;\r\n\r\n /**\r\n * Url used in the load request.\r\n */\r\n loadPath: string;\r\n\r\n /**\r\n * Type of embed\r\n */\r\n embeType: string;\r\n\r\n /**\r\n * Creates an instance of Embed.\r\n * \r\n * Note: there is circular reference between embeds and the service, because\r\n * the service has a list of all embeds on the host page, and each embed has a reference to the service that created it.\r\n * \r\n * @param {service.Service} service\r\n * @param {HTMLElement} element\r\n * @param {IEmbedConfiguration} config\r\n */\r\n constructor(service: service.Service, element: HTMLElement, config: IEmbedConfiguration, iframe?: HTMLIFrameElement) {\r\n Array.prototype.push.apply(this.allowedEvents, Embed.allowedEvents);\r\n this.eventHandlers = [];\r\n this.service = service;\r\n this.element = element;\r\n this.iframe = iframe;\r\n this.embeType = config.type.toLowerCase();\r\n\r\n this.populateConfig(config);\r\n \r\n if(this.embeType === 'create'){\r\n this.setIframe(false/*set EventListener to call create() on 'load' event*/);\r\n } else {\r\n this.setIframe(true/*set EventListener to call load() on 'load' event*/);\r\n }\r\n }\r\n\r\n /**\r\n * Sends createReport configuration data.\r\n * \r\n * ```javascript\r\n * createReport({\r\n * datasetId: '5dac7a4a-4452-46b3-99f6-a25915e0fe55',\r\n * accessToken: 'eyJ0eXA ... TaE2rTSbmg',\r\n * ```\r\n * \r\n * @param {models.IReportCreateConfiguration} config\r\n * @returns {Promise}\r\n */\r\n createReport(config: models.IReportCreateConfiguration): Promise {\r\n const errors = this.validate(config);\r\n if (errors) {\r\n throw errors;\r\n }\r\n \r\n return this.service.hpm.post(\"/report/create\", config, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n return response.body;\r\n },\r\n response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Saves Report.\r\n * \r\n * @returns {Promise}\r\n */\r\n save(): Promise {\r\n return this.service.hpm.post('/report/save', null, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n return response.body;\r\n })\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * SaveAs Report.\r\n * \r\n * @returns {Promise}\r\n */\r\n saveAs(saveAsParameters: models.ISaveAsParameters): Promise {\r\n return this.service.hpm.post('/report/saveAs', saveAsParameters, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n return response.body;\r\n })\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Sends load configuration data.\r\n * \r\n * ```javascript\r\n * report.load({\r\n * type: 'report',\r\n * id: '5dac7a4a-4452-46b3-99f6-a25915e0fe55',\r\n * accessToken: 'eyJ0eXA ... TaE2rTSbmg',\r\n * settings: {\r\n * navContentPaneEnabled: false\r\n * },\r\n * pageName: \"DefaultPage\",\r\n * filters: [\r\n * {\r\n * ... DefaultReportFilter ...\r\n * }\r\n * ]\r\n * })\r\n * .catch(error => { ... });\r\n * ```\r\n * \r\n * @param {models.ILoadConfiguration} config\r\n * @returns {Promise}\r\n */\r\n load(config: models.IReportLoadConfiguration | models.IDashboardLoadConfiguration): Promise {\r\n const errors = this.validate(config);\r\n if (errors) {\r\n throw errors;\r\n }\r\n\r\n return this.service.hpm.post(this.loadPath, config, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n utils.assign(this.config, config);\r\n return response.body;\r\n },\r\n response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Removes one or more event handlers from the list of handlers.\r\n * If a reference to the existing handle function is specified, remove the specific handler.\r\n * If the handler is not specified, remove all handlers for the event name specified.\r\n * \r\n * ```javascript\r\n * report.off('pageChanged')\r\n * \r\n * or \r\n * \r\n * const logHandler = function (event) {\r\n * console.log(event);\r\n * };\r\n * \r\n * report.off('pageChanged', logHandler);\r\n * ```\r\n * \r\n * @template T\r\n * @param {string} eventName\r\n * @param {service.IEventHandler} [handler]\r\n */\r\n off(eventName: string, handler?: service.IEventHandler): void {\r\n const fakeEvent: service.IEvent = { name: eventName, type: null, id: null, value: null };\r\n if (handler) {\r\n utils.remove(eventHandler => eventHandler.test(fakeEvent) && (eventHandler.handle === handler), this.eventHandlers);\r\n this.element.removeEventListener(eventName, handler);\r\n }\r\n else {\r\n const eventHandlersToRemove = this.eventHandlers\r\n .filter(eventHandler => eventHandler.test(fakeEvent));\r\n\r\n eventHandlersToRemove\r\n .forEach(eventHandlerToRemove => {\r\n utils.remove(eventHandler => eventHandler === eventHandlerToRemove, this.eventHandlers);\r\n this.element.removeEventListener(eventName, eventHandlerToRemove.handle);\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Adds an event handler for a specific event.\r\n * \r\n * ```javascript\r\n * report.on('pageChanged', (event) => {\r\n * console.log('PageChanged: ', event.page.name);\r\n * });\r\n * ```\r\n * \r\n * @template T\r\n * @param {string} eventName\r\n * @param {service.IEventHandler} handler\r\n */\r\n on(eventName: string, handler: service.IEventHandler): void {\r\n if (this.allowedEvents.indexOf(eventName) === -1) {\r\n throw new Error(`eventName is must be one of ${this.allowedEvents}. You passed: ${eventName}`);\r\n }\r\n\r\n this.eventHandlers.push({\r\n test: (event: service.IEvent) => event.name === eventName,\r\n handle: handler\r\n });\r\n\r\n this.element.addEventListener(eventName, handler)\r\n }\r\n\r\n /**\r\n * Reloads embed using existing configuration.\r\n * E.g. For reports this effectively clears all filters and makes the first page active which simulates resetting a report back to loaded state.\r\n * \r\n * ```javascript\r\n * report.reload();\r\n * ```\r\n */\r\n reload(): Promise {\r\n return this.load(this.config);\r\n }\r\n \r\n /**\r\n * Set accessToken.\r\n * \r\n * @returns {Promise}\r\n */\r\n setAccessToken(accessToken: string): Promise {\r\n return this.service.hpm.post('/report/token', accessToken, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n return response.body;\r\n })\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n \r\n /**\r\n * Gets an access token from the first available location: config, attribute, global.\r\n * \r\n * @private\r\n * @param {string} globalAccessToken\r\n * @returns {string}\r\n */\r\n private getAccessToken(globalAccessToken: string): string {\r\n const accessToken = this.config.accessToken || this.element.getAttribute(Embed.accessTokenAttribute) || globalAccessToken;\r\n\r\n if (!accessToken) {\r\n throw new Error(`No access token was found for element. You must specify an access token directly on the element using attribute '${Embed.accessTokenAttribute}' or specify a global token at: powerbi.accessToken.`);\r\n }\r\n\r\n return accessToken;\r\n }\r\n\r\n /**\r\n * Populate config for create and load\r\n * \r\n * @private\r\n * @param {IEmbedConfiguration}\r\n * @returns {void}\r\n */\r\n private populateConfig(config: IEmbedConfiguration): void {\r\n // TODO: Change when Object.assign is available.\r\n const settings = utils.assign({}, Embed.defaultSettings, config.settings);\r\n this.config = utils.assign({ settings }, config);\r\n this.config.uniqueId = this.getUniqueId();\r\n this.config.embedUrl = this.getEmbedUrl();\r\n\r\n if(this.embeType === 'create') {\r\n this.createConfig = {\r\n datasetId: config.datasetId || this.getId(),\r\n accessToken: this.getAccessToken(this.service.accessToken),\r\n settings: settings\r\n }\r\n } else {\r\n this.config.id = this.getId();\r\n this.config.accessToken = this.getAccessToken(this.service.accessToken);\r\n } \r\n }\r\n\r\n\r\n /**\r\n * Gets an embed url from the first available location: options, attribute.\r\n * \r\n * @private\r\n * @returns {string}\r\n */\r\n private getEmbedUrl(): string {\r\n const embedUrl = this.config.embedUrl || this.element.getAttribute(Embed.embedUrlAttribute);\r\n\r\n if (typeof embedUrl !== 'string' || embedUrl.length === 0) {\r\n throw new Error(`Embed Url is required, but it was not found. You must provide an embed url either as part of embed configuration or as attribute '${Embed.embedUrlAttribute}'.`);\r\n }\r\n\r\n return embedUrl;\r\n }\r\n\r\n /**\r\n * Gets a unique ID from the first available location: options, attribute.\r\n * If neither is provided generate a unique string.\r\n * \r\n * @private\r\n * @returns {string}\r\n */\r\n private getUniqueId(): string {\r\n return this.config.uniqueId || this.element.getAttribute(Embed.nameAttribute) || utils.createRandomString();\r\n }\r\n\r\n /**\r\n * Gets the report ID from the first available location: options, attribute.\r\n * \r\n * @abstract\r\n * @returns {string}\r\n */\r\n abstract getId(): string;\r\n\r\n /**\r\n * Requests the browser to render the component's iframe in fullscreen mode.\r\n */\r\n fullscreen(): void {\r\n const requestFullScreen = this.iframe.requestFullscreen || this.iframe.msRequestFullscreen || this.iframe.mozRequestFullScreen || this.iframe.webkitRequestFullscreen;\r\n requestFullScreen.call(this.iframe);\r\n }\r\n\r\n /**\r\n * Requests the browser to exit fullscreen mode.\r\n */\r\n exitFullscreen(): void {\r\n if (!this.isFullscreen(this.iframe)) {\r\n return;\r\n }\r\n\r\n const exitFullscreen = document.exitFullscreen || document.mozCancelFullScreen || document.webkitExitFullscreen || document.msExitFullscreen;\r\n exitFullscreen.call(document);\r\n }\r\n\r\n /**\r\n * Returns true if the iframe is rendered in fullscreen mode,\r\n * otherwise returns false.\r\n * \r\n * @private\r\n * @param {HTMLIFrameElement} iframe\r\n * @returns {boolean}\r\n */\r\n private isFullscreen(iframe: HTMLIFrameElement): boolean {\r\n const options = ['fullscreenElement', 'webkitFullscreenElement', 'mozFullscreenScreenElement', 'msFullscreenElement'];\r\n\r\n return options.some(option => document[option] === iframe);\r\n }\r\n \r\n /**\r\n * Validate load and create configuration.\r\n */\r\n abstract validate(config: models.IReportLoadConfiguration | models.IDashboardLoadConfiguration | models.IReportCreateConfiguration): models.IError[];\r\n\r\n /**\r\n * Sets Iframe for embed\r\n */\r\n private setIframe(isLoad: boolean): void {\r\n if(!this.iframe) {\r\n const iframeHtml = ``;\r\n this.element.innerHTML = iframeHtml;\r\n this.iframe = this.element.childNodes[0];\r\n }\r\n\r\n if(isLoad){\r\n this.iframe.addEventListener('load', () => this.load(this.config), false);\r\n } else {\r\n this.iframe.addEventListener('load', () => this.createReport(this.createConfig), false);\r\n }\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/embed.ts","\r\n/**\r\n * Raises a custom event with event data on the specified HTML element.\r\n * \r\n * @export\r\n * @param {HTMLElement} element\r\n * @param {string} eventName\r\n * @param {*} eventData\r\n */\r\nexport function raiseCustomEvent(element: HTMLElement, eventName: string, eventData: any): void {\r\n let customEvent;\r\n if (typeof CustomEvent === 'function') {\r\n customEvent = new CustomEvent(eventName, {\r\n detail: eventData,\r\n bubbles: true,\r\n cancelable: true\r\n });\r\n } else {\r\n customEvent = document.createEvent('CustomEvent');\r\n customEvent.initCustomEvent(eventName, true, true, eventData);\r\n }\r\n\r\n element.dispatchEvent(customEvent);\r\n}\r\n\r\n/**\r\n * Finds the index of the first value in an array that matches the specified predicate.\r\n * \r\n * @export\r\n * @template T\r\n * @param {(x: T) => boolean} predicate\r\n * @param {T[]} xs\r\n * @returns {number}\r\n */\r\nexport function findIndex(predicate: (x: T) => boolean, xs: T[]): number {\r\n if (!Array.isArray(xs)) {\r\n throw new Error(`You attempted to call find with second parameter that was not an array. You passed: ${xs}`);\r\n }\r\n\r\n let index;\r\n xs.some((x, i) => {\r\n if (predicate(x)) {\r\n index = i;\r\n return true;\r\n }\r\n });\r\n\r\n return index;\r\n}\r\n\r\n/**\r\n * Finds the first value in an array that matches the specified predicate.\r\n * \r\n * @export\r\n * @template T\r\n * @param {(x: T) => boolean} predicate\r\n * @param {T[]} xs\r\n * @returns {T}\r\n */\r\nexport function find(predicate: (x: T) => boolean, xs: T[]): T {\r\n const index = findIndex(predicate, xs);\r\n return xs[index];\r\n}\r\n\r\nexport function remove(predicate: (x: T) => boolean, xs: T[]): void {\r\n const index = findIndex(predicate, xs);\r\n xs.splice(index, 1);\r\n}\r\n\r\n// See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\r\n// TODO: replace in favor of using polyfill\r\n/**\r\n * Copies the values of all enumerable properties from one or more source objects to a target object, and returns the target object.\r\n * \r\n * @export\r\n * @param {any} args\r\n * @returns\r\n */\r\nexport function assign(...args) {\r\n var target = args[0];\r\n\r\n 'use strict';\r\n if (target === undefined || target === null) {\r\n throw new TypeError('Cannot convert undefined or null to object');\r\n }\r\n\r\n var output = Object(target);\r\n for (var index = 1; index < arguments.length; index++) {\r\n var source = arguments[index];\r\n if (source !== undefined && source !== null) {\r\n for (var nextKey in source) {\r\n if (source.hasOwnProperty(nextKey)) {\r\n output[nextKey] = source[nextKey];\r\n }\r\n }\r\n }\r\n }\r\n return output;\r\n}\r\n\r\n/**\r\n * Generates a random 7 character string.\r\n * \r\n * @export\r\n * @returns {string}\r\n */\r\nexport function createRandomString(): string {\r\n return (Math.random() + 1).toString(36).substring(7);\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/util.ts","import * as service from './service';\nimport * as embed from './embed';\nimport * as models from 'powerbi-models';\nimport * as wpmp from 'window-post-message-proxy';\nimport * as hpm from 'http-post-message';\nimport * as utils from './util';\nimport { IFilterable } from './ifilterable';\nimport { IPageNode, Page } from './page';\n\n/**\n * A Report node within a report hierarchy\n * \n * @export\n * @interface IReportNode\n */\nexport interface IReportNode {\n iframe: HTMLIFrameElement;\n service: service.IService;\n config: embed.IInternalEmbedConfiguration\n}\n\n/**\n * The Power BI Report embed component\n * \n * @export\n * @class Report\n * @extends {embed.Embed}\n * @implements {IReportNode}\n * @implements {IFilterable}\n */\nexport class Report extends embed.Embed implements IReportNode, IFilterable {\n static allowedEvents = [\"dataSelected\", \"filtersApplied\", \"pageChanged\", \"error\"];\n static reportIdAttribute = 'powerbi-report-id';\n static filterPaneEnabledAttribute = 'powerbi-settings-filter-pane-enabled';\n static navContentPaneEnabledAttribute = 'powerbi-settings-nav-content-pane-enabled';\n static typeAttribute = 'powerbi-type';\n static type = \"Report\";\n\n /**\n * Creates an instance of a Power BI Report.\n * \n * @param {service.Service} service\n * @param {HTMLElement} element\n * @param {embed.IEmbedConfiguration} config\n */\n constructor(service: service.Service, element: HTMLElement, config: embed.IEmbedConfiguration, iframe?: HTMLIFrameElement) {\n const filterPaneEnabled = (config.settings && config.settings.filterPaneEnabled) || !(element.getAttribute(Report.filterPaneEnabledAttribute) === \"false\");\n const navContentPaneEnabled = (config.settings && config.settings.navContentPaneEnabled) || !(element.getAttribute(Report.navContentPaneEnabledAttribute) === \"false\");\n const settings = utils.assign({\n filterPaneEnabled,\n navContentPaneEnabled\n }, config.settings);\n const configCopy = utils.assign({ settings }, config);\n\n super(service, element, configCopy, iframe);\n this.loadPath = \"/report/load\";\n Array.prototype.push.apply(this.allowedEvents, Report.allowedEvents);\n }\n\n /**\n * Adds backwards compatibility for the previous load configuration, which used the reportId query parameter to specify the report ID\n * (e.g. http://embedded.powerbi.com/appTokenReportEmbed?reportId=854846ed-2106-4dc2-bc58-eb77533bf2f1).\n * \n * By extracting the ID we can ensure that the ID is always explicitly provided as part of the load configuration.\n * \n * @static\n * @param {string} url\n * @returns {string}\n */\n static findIdFromEmbedUrl(url: string): string {\n const reportIdRegEx = /reportId=\"?([^&]+)\"?/\n const reportIdMatch = url.match(reportIdRegEx);\n\n let reportId;\n if (reportIdMatch) {\n reportId = reportIdMatch[1];\n }\n\n return reportId;\n }\n\n /**\n * Gets filters that are applied at the report level.\n * \n * ```javascript\n * // Get filters applied at report level\n * report.getFilters()\n * .then(filters => {\n * ...\n * });\n * ```\n * \n * @returns {Promise}\n */\n getFilters(): Promise {\n return this.service.hpm.get(`/report/filters`, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .then(response => response.body,\n response => {\n throw response.body;\n });\n }\n\n /**\n * Gets the report ID from the first available location: options, attribute, embed url.\n * \n * @returns {string}\n */\n getId(): string {\n const reportId = this.config.id || this.element.getAttribute(Report.reportIdAttribute) || Report.findIdFromEmbedUrl(this.config.embedUrl);\n\n if (typeof reportId !== 'string' || reportId.length === 0) {\n throw new Error(`Report id is required, but it was not found. You must provide an id either as part of embed configuration or as attribute '${Report.reportIdAttribute}'.`);\n }\n\n return reportId;\n }\n\n /**\n * Gets the list of pages within the report.\n * \n * ```javascript\n * report.getPages()\n * .then(pages => {\n * ...\n * });\n * ```\n * \n * @returns {Promise}\n */\n getPages(): Promise {\n return this.service.hpm.get('/report/pages', { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .then(response => {\n return response.body\n .map(page => {\n return new Page(this, page.name, page.displayName);\n });\n }, response => {\n throw response.body;\n });\n }\n\n /**\n * Creates an instance of a Page.\n * \n * Normally you would get Page objects by calling `report.getPages()`, but in the case\n * that the page name is known and you want to perform an action on a page without having to retrieve it\n * you can create it directly.\n * \n * Note: Because you are creating the page manually there is no guarantee that the page actually exists in the report, and subsequent requests could fail.\n * \n * ```javascript\n * const page = report.page('ReportSection1');\n * page.setActive();\n * ```\n * \n * @param {string} name\n * @param {string} [displayName]\n * @returns {Page}\n */\n page(name: string, displayName?: string): Page {\n return new Page(this, name, displayName);\n }\n\n /**\n * Prints the active page of the report by invoking `window.print()` on the embed iframe component.\n */\n print(): Promise {\n return this.service.hpm.post('/report/print', null, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .then(response => {\n return response.body;\n })\n .catch(response => {\n throw response.body;\n });\n }\n\n /**\n * Removes all filters at the report level.\n * \n * ```javascript\n * report.removeFilters();\n * ```\n * \n * @returns {Promise}\n */\n removeFilters(): Promise {\n return this.setFilters([]);\n }\n\n /**\n * Sets the active page of the report.\n * \n * ```javascript\n * report.setPage(\"page2\")\n * .catch(error => { ... });\n * ```\n * \n * @param {string} pageName\n * @returns {Promise}\n */\n setPage(pageName: string): Promise {\n const page: models.IPage = {\n name: pageName,\n displayName: null\n };\n\n return this.service.hpm.put('/report/pages/active', page, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .catch(response => {\n throw response.body;\n });\n }\n\n /**\n * Sets filters at the report level.\n * \n * ```javascript\n * const filters: [\n * ...\n * ];\n * \n * report.setFilters(filters)\n * .catch(errors => {\n * ...\n * });\n * ```\n * \n * @param {(models.IFilter[])} filters\n * @returns {Promise}\n */\n setFilters(filters: models.IFilter[]): Promise {\n return this.service.hpm.put(`/report/filters`, filters, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .catch(response => {\n throw response.body;\n });\n }\n\n /**\n * Updates visibility settings for the filter pane and the page navigation pane.\n * \n * ```javascript\n * const newSettings = {\n * navContentPaneEnabled: true,\n * filterPaneEnabled: false\n * };\n * \n * report.updateSettings(newSettings)\n * .catch(error => { ... });\n * ```\n * \n * @param {models.ISettings} settings\n * @returns {Promise}\n */\n updateSettings(settings: models.ISettings): Promise {\n return this.service.hpm.patch('/report/settings', settings, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .catch(response => {\n throw response.body;\n });\n }\n\n /**\n * Validate load configuration.\n */\n validate(config: models.IReportLoadConfiguration): models.IError[] {\n return models.validateReportLoad(config);\n }\n\n /**\n * Switch Report view mode.\n * \n * @returns {Promise}\n */\n switchMode(viewMode: models.ViewMode): Promise {\n let url = '/report/switchMode/' + viewMode;\n return this.service.hpm.post(url, null, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .then(response => {\n return response.body;\n })\n .catch(response => {\n throw response.body;\n });\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/report.ts","/*! powerbi-models v0.10.4 | (c) 2016 Microsoft Corporation MIT */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"powerbi-models\"] = factory();\n\telse\n\t\troot[\"powerbi-models\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __extends = (this && this.__extends) || function (d, b) {\r\n\t for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\r\n\t function __() { this.constructor = d; }\r\n\t d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n\t};\r\n\t/* tslint:disable:no-var-requires */\r\n\texports.advancedFilterSchema = __webpack_require__(1);\r\n\texports.filterSchema = __webpack_require__(2);\r\n\texports.loadSchema = __webpack_require__(3);\r\n\texports.dashboardLoadSchema = __webpack_require__(4);\r\n\texports.pageSchema = __webpack_require__(5);\r\n\texports.settingsSchema = __webpack_require__(6);\r\n\texports.basicFilterSchema = __webpack_require__(7);\r\n\texports.createReportSchema = __webpack_require__(8);\r\n\texports.saveAsParametersSchema = __webpack_require__(9);\r\n\t/* tslint:enable:no-var-requires */\r\n\tvar jsen = __webpack_require__(10);\r\n\tfunction normalizeError(error) {\r\n\t var message = error.message;\r\n\t if (!message) {\r\n\t message = error.path + \" is invalid. Not meeting \" + error.keyword + \" constraint\";\r\n\t }\r\n\t return {\r\n\t message: message\r\n\t };\r\n\t}\r\n\t/**\r\n\t * Takes in schema and returns function which can be used to validate the schema with better semantics around exposing errors\r\n\t */\r\n\tfunction validate(schema, options) {\r\n\t return function (x) {\r\n\t var validate = jsen(schema, options);\r\n\t var isValid = validate(x);\r\n\t if (isValid) {\r\n\t return undefined;\r\n\t }\r\n\t else {\r\n\t return validate.errors\r\n\t .map(normalizeError);\r\n\t }\r\n\t };\r\n\t}\r\n\texports.validateSettings = validate(exports.settingsSchema, {\r\n\t schemas: {\r\n\t basicFilter: exports.basicFilterSchema,\r\n\t advancedFilter: exports.advancedFilterSchema\r\n\t }\r\n\t});\r\n\texports.validateReportLoad = validate(exports.loadSchema, {\r\n\t schemas: {\r\n\t settings: exports.settingsSchema,\r\n\t basicFilter: exports.basicFilterSchema,\r\n\t advancedFilter: exports.advancedFilterSchema\r\n\t }\r\n\t});\r\n\texports.validateCreateReport = validate(exports.createReportSchema);\r\n\texports.validateDashboardLoad = validate(exports.dashboardLoadSchema);\r\n\texports.validatePage = validate(exports.pageSchema);\r\n\texports.validateFilter = validate(exports.filterSchema, {\r\n\t schemas: {\r\n\t basicFilter: exports.basicFilterSchema,\r\n\t advancedFilter: exports.advancedFilterSchema\r\n\t }\r\n\t});\r\n\t(function (FilterType) {\r\n\t FilterType[FilterType[\"Advanced\"] = 0] = \"Advanced\";\r\n\t FilterType[FilterType[\"Basic\"] = 1] = \"Basic\";\r\n\t FilterType[FilterType[\"Unknown\"] = 2] = \"Unknown\";\r\n\t})(exports.FilterType || (exports.FilterType = {}));\r\n\tvar FilterType = exports.FilterType;\r\n\tfunction isFilterKeyColumnsTarget(target) {\r\n\t return isColumn(target) && !!target.keys;\r\n\t}\r\n\texports.isFilterKeyColumnsTarget = isFilterKeyColumnsTarget;\r\n\tfunction isBasicFilterWithKeys(filter) {\r\n\t return getFilterType(filter) === FilterType.Basic && !!filter.keyValues;\r\n\t}\r\n\texports.isBasicFilterWithKeys = isBasicFilterWithKeys;\r\n\tfunction getFilterType(filter) {\r\n\t var basicFilter = filter;\r\n\t var advancedFilter = filter;\r\n\t if ((typeof basicFilter.operator === \"string\")\r\n\t && (Array.isArray(basicFilter.values))) {\r\n\t return FilterType.Basic;\r\n\t }\r\n\t else if ((typeof advancedFilter.logicalOperator === \"string\")\r\n\t && (Array.isArray(advancedFilter.conditions))) {\r\n\t return FilterType.Advanced;\r\n\t }\r\n\t else {\r\n\t return FilterType.Unknown;\r\n\t }\r\n\t}\r\n\texports.getFilterType = getFilterType;\r\n\tfunction isMeasure(arg) {\r\n\t return arg.table !== undefined && arg.measure !== undefined;\r\n\t}\r\n\texports.isMeasure = isMeasure;\r\n\tfunction isColumn(arg) {\r\n\t return arg.table !== undefined && arg.column !== undefined;\r\n\t}\r\n\texports.isColumn = isColumn;\r\n\tfunction isHierarchy(arg) {\r\n\t return arg.table !== undefined && arg.hierarchy !== undefined && arg.hierarchyLevel !== undefined;\r\n\t}\r\n\texports.isHierarchy = isHierarchy;\r\n\tvar Filter = (function () {\r\n\t function Filter(target) {\r\n\t this.target = target;\r\n\t }\r\n\t Filter.prototype.toJSON = function () {\r\n\t return {\r\n\t $schema: this.schemaUrl,\r\n\t target: this.target\r\n\t };\r\n\t };\r\n\t ;\r\n\t return Filter;\r\n\t}());\r\n\texports.Filter = Filter;\r\n\tvar BasicFilter = (function (_super) {\r\n\t __extends(BasicFilter, _super);\r\n\t function BasicFilter(target, operator) {\r\n\t var values = [];\r\n\t for (var _i = 2; _i < arguments.length; _i++) {\r\n\t values[_i - 2] = arguments[_i];\r\n\t }\r\n\t _super.call(this, target);\r\n\t this.operator = operator;\r\n\t this.schemaUrl = BasicFilter.schemaUrl;\r\n\t if (values.length === 0 && operator !== \"All\") {\r\n\t throw new Error(\"values must be a non-empty array unless your operator is \\\"All\\\".\");\r\n\t }\r\n\t /**\r\n\t * Accept values as array instead of as individual arguments\r\n\t * new BasicFilter('a', 'b', 1, 2);\r\n\t * new BasicFilter('a', 'b', [1,2]);\r\n\t */\r\n\t if (Array.isArray(values[0])) {\r\n\t this.values = values[0];\r\n\t }\r\n\t else {\r\n\t this.values = values;\r\n\t }\r\n\t }\r\n\t BasicFilter.prototype.toJSON = function () {\r\n\t var filter = _super.prototype.toJSON.call(this);\r\n\t filter.operator = this.operator;\r\n\t filter.values = this.values;\r\n\t return filter;\r\n\t };\r\n\t BasicFilter.schemaUrl = \"http://powerbi.com/product/schema#basic\";\r\n\t return BasicFilter;\r\n\t}(Filter));\r\n\texports.BasicFilter = BasicFilter;\r\n\tvar BasicFilterWithKeys = (function (_super) {\r\n\t __extends(BasicFilterWithKeys, _super);\r\n\t function BasicFilterWithKeys(target, operator, values, keyValues) {\r\n\t _super.call(this, target, operator, values);\r\n\t this.keyValues = keyValues;\r\n\t this.target = target;\r\n\t var numberOfKeys = target.keys ? target.keys.length : 0;\r\n\t if (numberOfKeys > 0 && !keyValues) {\r\n\t throw new Error(\"You shold pass the values to be filtered for each key. You passed: no values and \" + numberOfKeys + \" keys\");\r\n\t }\r\n\t if (numberOfKeys === 0 && keyValues && keyValues.length > 0) {\r\n\t throw new Error(\"You passed key values but your target object doesn't contain the keys to be filtered\");\r\n\t }\r\n\t for (var i = 0; i < this.keyValues.length; i++) {\r\n\t if (this.keyValues[i]) {\r\n\t var lengthOfArray = this.keyValues[i].length;\r\n\t if (lengthOfArray !== numberOfKeys) {\r\n\t throw new Error(\"Each tuple of key values should contain a value for each of the keys. You passed: \" + lengthOfArray + \" values and \" + numberOfKeys + \" keys\");\r\n\t }\r\n\t }\r\n\t }\r\n\t }\r\n\t BasicFilterWithKeys.prototype.toJSON = function () {\r\n\t var filter = _super.prototype.toJSON.call(this);\r\n\t filter.keyValues = this.keyValues;\r\n\t return filter;\r\n\t };\r\n\t return BasicFilterWithKeys;\r\n\t}(BasicFilter));\r\n\texports.BasicFilterWithKeys = BasicFilterWithKeys;\r\n\tvar AdvancedFilter = (function (_super) {\r\n\t __extends(AdvancedFilter, _super);\r\n\t function AdvancedFilter(target, logicalOperator) {\r\n\t var conditions = [];\r\n\t for (var _i = 2; _i < arguments.length; _i++) {\r\n\t conditions[_i - 2] = arguments[_i];\r\n\t }\r\n\t _super.call(this, target);\r\n\t this.schemaUrl = AdvancedFilter.schemaUrl;\r\n\t // Guard statements\r\n\t if (typeof logicalOperator !== \"string\" || logicalOperator.length === 0) {\r\n\t // TODO: It would be nicer to list out the possible logical operators.\r\n\t throw new Error(\"logicalOperator must be a valid operator, You passed: \" + logicalOperator);\r\n\t }\r\n\t this.logicalOperator = logicalOperator;\r\n\t var extractedConditions;\r\n\t /**\r\n\t * Accept conditions as array instead of as individual arguments\r\n\t * new AdvancedFilter('a', 'b', \"And\", { value: 1, operator: \"Equals\" }, { value: 2, operator: \"IsGreaterThan\" });\r\n\t * new AdvancedFilter('a', 'b', \"And\", [{ value: 1, operator: \"Equals\" }, { value: 2, operator: \"IsGreaterThan\" }]);\r\n\t */\r\n\t if (Array.isArray(conditions[0])) {\r\n\t extractedConditions = conditions[0];\r\n\t }\r\n\t else {\r\n\t extractedConditions = conditions;\r\n\t }\r\n\t if (extractedConditions.length === 0) {\r\n\t throw new Error(\"conditions must be a non-empty array. You passed: \" + conditions);\r\n\t }\r\n\t if (extractedConditions.length > 2) {\r\n\t throw new Error(\"AdvancedFilters may not have more than two conditions. You passed: \" + conditions.length);\r\n\t }\r\n\t if (extractedConditions.length === 1 && logicalOperator !== \"And\") {\r\n\t throw new Error(\"Logical Operator must be \\\"And\\\" when there is only one condition provided\");\r\n\t }\r\n\t this.conditions = extractedConditions;\r\n\t }\r\n\t AdvancedFilter.prototype.toJSON = function () {\r\n\t var filter = _super.prototype.toJSON.call(this);\r\n\t filter.logicalOperator = this.logicalOperator;\r\n\t filter.conditions = this.conditions;\r\n\t return filter;\r\n\t };\r\n\t AdvancedFilter.schemaUrl = \"http://powerbi.com/product/schema#advanced\";\r\n\t return AdvancedFilter;\r\n\t}(Filter));\r\n\texports.AdvancedFilter = AdvancedFilter;\r\n\t(function (Permissions) {\r\n\t Permissions[Permissions[\"Read\"] = 0] = \"Read\";\r\n\t Permissions[Permissions[\"ReadWrite\"] = 1] = \"ReadWrite\";\r\n\t Permissions[Permissions[\"Copy\"] = 2] = \"Copy\";\r\n\t Permissions[Permissions[\"Create\"] = 4] = \"Create\";\r\n\t Permissions[Permissions[\"All\"] = 7] = \"All\";\r\n\t})(exports.Permissions || (exports.Permissions = {}));\r\n\tvar Permissions = exports.Permissions;\r\n\t(function (ViewMode) {\r\n\t ViewMode[ViewMode[\"View\"] = 0] = \"View\";\r\n\t ViewMode[ViewMode[\"Edit\"] = 1] = \"Edit\";\r\n\t})(exports.ViewMode || (exports.ViewMode = {}));\r\n\tvar ViewMode = exports.ViewMode;\r\n\texports.validateSaveAsParameters = validate(exports.saveAsParametersSchema);\r\n\n\n/***/ },\n/* 1 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"target\": {\n\t\t\t\t\"oneOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\t\"table\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"column\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"required\": [\n\t\t\t\t\t\t\t\"table\",\n\t\t\t\t\t\t\t\"column\"\n\t\t\t\t\t\t]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\t\"table\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"hierarchy\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"hierarchyLevel\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"required\": [\n\t\t\t\t\t\t\t\"table\",\n\t\t\t\t\t\t\t\"hierarchy\",\n\t\t\t\t\t\t\t\"hierarchyLevel\"\n\t\t\t\t\t\t]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\t\"table\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"measure\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"required\": [\n\t\t\t\t\t\t\t\"table\",\n\t\t\t\t\t\t\t\"measure\"\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"logicalOperator\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"conditions\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\"value\": {\n\t\t\t\t\t\t\t\"type\": [\n\t\t\t\t\t\t\t\t\"string\",\n\t\t\t\t\t\t\t\t\"boolean\",\n\t\t\t\t\t\t\t\t\"number\"\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"operator\": {\n\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\"required\": [\n\t\t\t\t\t\t\"value\",\n\t\t\t\t\t\t\"operator\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"target\",\n\t\t\t\"logicalOperator\",\n\t\t\t\"conditions\"\n\t\t]\n\t};\n\n/***/ },\n/* 2 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"oneOf\": [\n\t\t\t{\n\t\t\t\t\"$ref\": \"#basicFilter\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"$ref\": \"#advancedFilter\"\n\t\t\t}\n\t\t],\n\t\t\"invalidMessage\": \"filter is invalid\"\n\t};\n\n/***/ },\n/* 3 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"accessToken\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"accessToken must be a string\",\n\t\t\t\t\t\"required\": \"accessToken is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"id\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"id must be a string\",\n\t\t\t\t\t\"required\": \"id is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"settings\": {\n\t\t\t\t\"$ref\": \"#settings\"\n\t\t\t},\n\t\t\t\"pageName\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"pageName must be a string\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"filters\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\"oneOf\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"$ref\": \"#basicFilter\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"$ref\": \"#advancedFilter\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t\"invalidMessage\": \"filters property is invalid\"\n\t\t\t},\n\t\t\t\"permissions\": {\n\t\t\t\t\"type\": \"number\",\n\t\t\t\t\"enum\": [\n\t\t\t\t\t0,\n\t\t\t\t\t1,\n\t\t\t\t\t2,\n\t\t\t\t\t3\n\t\t\t\t],\n\t\t\t\t\"default\": 0,\n\t\t\t\t\"invalidMessage\": \"permissions property is invalid\"\n\t\t\t},\n\t\t\t\"viewMode\": {\n\t\t\t\t\"type\": \"number\",\n\t\t\t\t\"enum\": [\n\t\t\t\t\t0,\n\t\t\t\t\t1\n\t\t\t\t],\n\t\t\t\t\"default\": 0,\n\t\t\t\t\"invalidMessage\": \"viewMode property is invalid\"\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"accessToken\",\n\t\t\t\"id\"\n\t\t]\n\t};\n\n/***/ },\n/* 4 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"accessToken\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"accessToken must be a string\",\n\t\t\t\t\t\"required\": \"accessToken is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"id\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"id must be a string\",\n\t\t\t\t\t\"required\": \"id is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"pageView\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"pageView must be a string with one of the following values: \\\"actualSize\\\", \\\"fitToWidth\\\", \\\"oneColumn\\\"\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"accessToken\",\n\t\t\t\"id\"\n\t\t]\n\t};\n\n/***/ },\n/* 5 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"name\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"name must be a string\",\n\t\t\t\t\t\"required\": \"name is required\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"name\"\n\t\t]\n\t};\n\n/***/ },\n/* 6 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"filterPaneEnabled\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"filterPaneEnabled must be a boolean\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"navContentPaneEnabled\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"navContentPaneEnabled must be a boolean\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"useCustomSaveAsDialog\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"useCustomSaveAsDialog must be a boolean\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n/***/ },\n/* 7 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"target\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"properties\": {\n\t\t\t\t\t\"table\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"column\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"hierarchy\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"hierarchyLevel\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"measure\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"required\": [\n\t\t\t\t\t\"table\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"operator\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"values\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"type\": [\n\t\t\t\t\t\t\"string\",\n\t\t\t\t\t\t\"boolean\",\n\t\t\t\t\t\t\"number\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"target\",\n\t\t\t\"operator\",\n\t\t\t\"values\"\n\t\t]\n\t};\n\n/***/ },\n/* 8 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"accessToken\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"accessToken must be a string\",\n\t\t\t\t\t\"required\": \"accessToken is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"datasetId\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"datasetId must be a string\",\n\t\t\t\t\t\"required\": \"datasetId is required\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"accessToken\",\n\t\t\t\"datasetId\"\n\t\t]\n\t};\n\n/***/ },\n/* 9 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"name\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"name must be a string\",\n\t\t\t\t\t\"required\": \"name is required\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"name\"\n\t\t]\n\t};\n\n/***/ },\n/* 10 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = __webpack_require__(11);\n\n/***/ },\n/* 11 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar REGEX_ESCAPE_EXPR = /[\\/]/g,\n\t STR_ESCAPE_EXPR = /(\")/gim,\n\t VALID_IDENTIFIER_EXPR = /^[a-z_$][0-9a-z]*$/gi,\n\t INVALID_SCHEMA = 'jsen: invalid schema object',\n\t browser = typeof window === 'object' && !!window.navigator, // jshint ignore: line\n\t regescape = new RegExp('/').source !== '/', // node v0.x does not properly escape '/'s in inline regex\n\t func = __webpack_require__(12),\n\t equal = __webpack_require__(13),\n\t unique = __webpack_require__(14),\n\t SchemaResolver = __webpack_require__(15),\n\t formats = __webpack_require__(24),\n\t ucs2length = __webpack_require__(25),\n\t types = {},\n\t keywords = {};\n\t\n\tfunction inlineRegex(regex) {\n\t regex = regex instanceof RegExp ? regex : new RegExp(regex);\n\t\n\t return regescape ?\n\t regex.toString() :\n\t '/' + regex.source.replace(REGEX_ESCAPE_EXPR, '\\\\$&') + '/';\n\t}\n\t\n\tfunction encodeStr(str) {\n\t return '\"' + str.replace(STR_ESCAPE_EXPR, '\\\\$1') + '\"';\n\t}\n\t\n\tfunction appendToPath(path, key) {\n\t VALID_IDENTIFIER_EXPR.lastIndex = 0;\n\t\n\t return VALID_IDENTIFIER_EXPR.test(key) ?\n\t path + '.' + key :\n\t path + '[' + encodeStr(key) + ']';\n\t}\n\t\n\tfunction type(obj) {\n\t if (obj === undefined) {\n\t return 'undefined';\n\t }\n\t\n\t var str = Object.prototype.toString.call(obj);\n\t return str.substr(8, str.length - 9).toLowerCase();\n\t}\n\t\n\tfunction isInteger(obj) {\n\t return (obj | 0) === obj; // jshint ignore: line\n\t}\n\t\n\ttypes['null'] = function (path) {\n\t return path + ' === null';\n\t};\n\t\n\ttypes.boolean = function (path) {\n\t return 'typeof ' + path + ' === \"boolean\"';\n\t};\n\t\n\ttypes.string = function (path) {\n\t return 'typeof ' + path + ' === \"string\"';\n\t};\n\t\n\ttypes.number = function (path) {\n\t return 'typeof ' + path + ' === \"number\"';\n\t};\n\t\n\ttypes.integer = function (path) {\n\t return 'typeof ' + path + ' === \"number\" && !(' + path + ' % 1)';\n\t};\n\t\n\ttypes.array = function (path) {\n\t return 'Array.isArray(' + path + ')';\n\t};\n\t\n\ttypes.object = function (path) {\n\t return 'typeof ' + path + ' === \"object\" && ' + path + ' !== null && !Array.isArray(' + path + ')';\n\t};\n\t\n\ttypes.date = function (path) {\n\t return path + ' instanceof Date';\n\t};\n\t\n\tkeywords.enum = function (context) {\n\t var arr = context.schema['enum'];\n\t\n\t context.code('if (!equalAny(' + context.path + ', ' + JSON.stringify(arr) + ')) {');\n\t context.error('enum');\n\t context.code('}');\n\t};\n\t\n\tkeywords.minimum = function (context) {\n\t if (typeof context.schema.minimum === 'number') {\n\t context.code('if (' + context.path + ' < ' + context.schema.minimum + ') {');\n\t context.error('minimum');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.exclusiveMinimum = function (context) {\n\t if (context.schema.exclusiveMinimum === true && typeof context.schema.minimum === 'number') {\n\t context.code('if (' + context.path + ' === ' + context.schema.minimum + ') {');\n\t context.error('exclusiveMinimum');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.maximum = function (context) {\n\t if (typeof context.schema.maximum === 'number') {\n\t context.code('if (' + context.path + ' > ' + context.schema.maximum + ') {');\n\t context.error('maximum');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.exclusiveMaximum = function (context) {\n\t if (context.schema.exclusiveMaximum === true && typeof context.schema.maximum === 'number') {\n\t context.code('if (' + context.path + ' === ' + context.schema.maximum + ') {');\n\t context.error('exclusiveMaximum');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.multipleOf = function (context) {\n\t if (typeof context.schema.multipleOf === 'number') {\n\t var mul = context.schema.multipleOf,\n\t decimals = mul.toString().length - mul.toFixed(0).length - 1,\n\t pow = decimals > 0 ? Math.pow(10, decimals) : 1,\n\t path = context.path;\n\t\n\t if (decimals > 0) {\n\t context.code('if (+(Math.round((' + path + ' * ' + pow + ') + \"e+\" + ' + decimals + ') + \"e-\" + ' + decimals + ') % ' + (mul * pow) + ' !== 0) {');\n\t } else {\n\t context.code('if (((' + path + ' * ' + pow + ') % ' + (mul * pow) + ') !== 0) {');\n\t }\n\t\n\t context.error('multipleOf');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.minLength = function (context) {\n\t if (isInteger(context.schema.minLength)) {\n\t context.code('if (ucs2length(' + context.path + ') < ' + context.schema.minLength + ') {');\n\t context.error('minLength');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.maxLength = function (context) {\n\t if (isInteger(context.schema.maxLength)) {\n\t context.code('if (ucs2length(' + context.path + ') > ' + context.schema.maxLength + ') {');\n\t context.error('maxLength');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.pattern = function (context) {\n\t var pattern = context.schema.pattern;\n\t\n\t if (typeof pattern === 'string' || pattern instanceof RegExp) {\n\t context.code('if (!(' + inlineRegex(pattern) + ').test(' + context.path + ')) {');\n\t context.error('pattern');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.format = function (context) {\n\t if (typeof context.schema.format !== 'string' || !formats[context.schema.format]) {\n\t return;\n\t }\n\t\n\t context.code('if (!(' + formats[context.schema.format] + ').test(' + context.path + ')) {');\n\t context.error('format');\n\t context.code('}');\n\t};\n\t\n\tkeywords.minItems = function (context) {\n\t if (isInteger(context.schema.minItems)) {\n\t context.code('if (' + context.path + '.length < ' + context.schema.minItems + ') {');\n\t context.error('minItems');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.maxItems = function (context) {\n\t if (isInteger(context.schema.maxItems)) {\n\t context.code('if (' + context.path + '.length > ' + context.schema.maxItems + ') {');\n\t context.error('maxItems');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.additionalItems = function (context) {\n\t if (context.schema.additionalItems === false && Array.isArray(context.schema.items)) {\n\t context.code('if (' + context.path + '.length > ' + context.schema.items.length + ') {');\n\t context.error('additionalItems');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.uniqueItems = function (context) {\n\t if (context.schema.uniqueItems) {\n\t context.code('if (unique(' + context.path + ').length !== ' + context.path + '.length) {');\n\t context.error('uniqueItems');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.items = function (context) {\n\t var index = context.declare(0),\n\t i = 0;\n\t\n\t if (type(context.schema.items) === 'object') {\n\t context.code('for (' + index + ' = 0; ' + index + ' < ' + context.path + '.length; ' + index + '++) {');\n\t\n\t context.descend(context.path + '[' + index + ']', context.schema.items);\n\t\n\t context.code('}');\n\t }\n\t else if (Array.isArray(context.schema.items)) {\n\t for (; i < context.schema.items.length; i++) {\n\t context.code('if (' + context.path + '.length - 1 >= ' + i + ') {');\n\t\n\t context.descend(context.path + '[' + i + ']', context.schema.items[i]);\n\t\n\t context.code('}');\n\t }\n\t\n\t if (type(context.schema.additionalItems) === 'object') {\n\t context.code('for (' + index + ' = ' + i + '; ' + index + ' < ' + context.path + '.length; ' + index + '++) {');\n\t\n\t context.descend(context.path + '[' + index + ']', context.schema.additionalItems);\n\t\n\t context.code('}');\n\t }\n\t }\n\t};\n\t\n\tkeywords.maxProperties = function (context) {\n\t if (isInteger(context.schema.maxProperties)) {\n\t context.code('if (Object.keys(' + context.path + ').length > ' + context.schema.maxProperties + ') {');\n\t context.error('maxProperties');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.minProperties = function (context) {\n\t if (isInteger(context.schema.minProperties)) {\n\t context.code('if (Object.keys(' + context.path + ').length < ' + context.schema.minProperties + ') {');\n\t context.error('minProperties');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.required = function (context) {\n\t if (!Array.isArray(context.schema.required)) {\n\t return;\n\t }\n\t\n\t for (var i = 0; i < context.schema.required.length; i++) {\n\t context.code('if (' + appendToPath(context.path, context.schema.required[i]) + ' === undefined) {');\n\t context.error('required', context.schema.required[i]);\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.properties = function (context) {\n\t var props = context.schema.properties,\n\t propKeys = type(props) === 'object' ? Object.keys(props) : [],\n\t required = Array.isArray(context.schema.required) ? context.schema.required : [],\n\t prop, i, nestedPath;\n\t\n\t if (!propKeys.length) {\n\t return;\n\t }\n\t\n\t for (i = 0; i < propKeys.length; i++) {\n\t prop = propKeys[i];\n\t nestedPath = appendToPath(context.path, prop);\n\t\n\t context.code('if (' + nestedPath + ' !== undefined) {');\n\t\n\t context.descend(nestedPath, props[prop]);\n\t\n\t context.code('}');\n\t\n\t if (required.indexOf(prop) > -1) {\n\t context.code('else {');\n\t context.error('required', prop);\n\t context.code('}');\n\t }\n\t }\n\t};\n\t\n\tkeywords.patternProperties = keywords.additionalProperties = function (context) {\n\t var propKeys = type(context.schema.properties) === 'object' ?\n\t Object.keys(context.schema.properties) : [],\n\t patProps = context.schema.patternProperties,\n\t patterns = type(patProps) === 'object' ? Object.keys(patProps) : [],\n\t addProps = context.schema.additionalProperties,\n\t addPropsCheck = addProps === false || type(addProps) === 'object',\n\t props, keys, key, n, found, pattern, i;\n\t\n\t if (!patterns.length && !addPropsCheck) {\n\t return;\n\t }\n\t\n\t keys = context.declare('[]');\n\t key = context.declare('\"\"');\n\t n = context.declare(0);\n\t\n\t if (addPropsCheck) {\n\t found = context.declare(false);\n\t }\n\t\n\t context.code(keys + ' = Object.keys(' + context.path + ')');\n\t\n\t context.code('for (' + n + ' = 0; ' + n + ' < ' + keys + '.length; ' + n + '++) {')\n\t (key + ' = ' + keys + '[' + n + ']')\n\t\n\t ('if (' + context.path + '[' + key + '] === undefined) {')\n\t ('continue')\n\t ('}');\n\t\n\t if (addPropsCheck) {\n\t context.code(found + ' = false');\n\t }\n\t\n\t // validate pattern properties\n\t for (i = 0; i < patterns.length; i++) {\n\t pattern = patterns[i];\n\t\n\t context.code('if ((' + inlineRegex(pattern) + ').test(' + key + ')) {');\n\t\n\t context.descend(context.path + '[' + key + ']', patProps[pattern]);\n\t\n\t if (addPropsCheck) {\n\t context.code(found + ' = true');\n\t }\n\t\n\t context.code('}');\n\t }\n\t\n\t // validate additional properties\n\t if (addPropsCheck) {\n\t if (propKeys.length) {\n\t props = context.declare(JSON.stringify(propKeys));\n\t\n\t // do not validate regular properties\n\t context.code('if (' + props + '.indexOf(' + key + ') > -1) {')\n\t ('continue')\n\t ('}');\n\t }\n\t\n\t context.code('if (!' + found + ') {');\n\t\n\t if (addProps === false) {\n\t // do not allow additional properties\n\t context.error('additionalProperties', undefined, key);\n\t }\n\t else {\n\t // validate additional properties\n\t context.descend(context.path + '[' + key + ']', addProps);\n\t }\n\t\n\t context.code('}');\n\t }\n\t\n\t context.code('}');\n\t};\n\t\n\tkeywords.dependencies = function (context) {\n\t if (type(context.schema.dependencies) !== 'object') {\n\t return;\n\t }\n\t\n\t var depKeys = Object.keys(context.schema.dependencies),\n\t len = depKeys.length,\n\t key, dep, i = 0, k = 0;\n\t\n\t for (; k < len; k++) {\n\t key = depKeys[k];\n\t dep = context.schema.dependencies[key];\n\t\n\t context.code('if (' + appendToPath(context.path, key) + ' !== undefined) {');\n\t\n\t if (type(dep) === 'object') {\n\t //schema dependency\n\t context.descend(context.path, dep);\n\t }\n\t else {\n\t // property dependency\n\t for (i; i < dep.length; i++) {\n\t context.code('if (' + appendToPath(context.path, dep[i]) + ' === undefined) {');\n\t context.error('dependencies', dep[i]);\n\t context.code('}');\n\t }\n\t }\n\t\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.allOf = function (context) {\n\t if (!Array.isArray(context.schema.allOf)) {\n\t return;\n\t }\n\t\n\t for (var i = 0; i < context.schema.allOf.length; i++) {\n\t context.descend(context.path, context.schema.allOf[i]);\n\t }\n\t};\n\t\n\tkeywords.anyOf = function (context) {\n\t if (!Array.isArray(context.schema.anyOf)) {\n\t return;\n\t }\n\t\n\t var greedy = context.greedy,\n\t errCount = context.declare(0),\n\t initialCount = context.declare(0),\n\t found = context.declare(false),\n\t i = 0;\n\t\n\t context.code(initialCount + ' = errors.length');\n\t\n\t for (; i < context.schema.anyOf.length; i++) {\n\t context.code('if (!' + found + ') {');\n\t\n\t context.code(errCount + ' = errors.length');\n\t\n\t context.greedy = true;\n\t\n\t context.descend(context.path, context.schema.anyOf[i]);\n\t\n\t context.code(found + ' = errors.length === ' + errCount)\n\t ('}');\n\t }\n\t\n\t context.greedy = greedy;\n\t\n\t context.code('if (!' + found + ') {');\n\t\n\t context.error('anyOf');\n\t\n\t context.code('} else {')\n\t ('errors.length = ' + initialCount)\n\t ('}');\n\t};\n\t\n\tkeywords.oneOf = function (context) {\n\t if (!Array.isArray(context.schema.oneOf)) {\n\t return;\n\t }\n\t\n\t var greedy = context.greedy,\n\t matching = context.declare(0),\n\t initialCount = context.declare(0),\n\t errCount = context.declare(0),\n\t i = 0;\n\t\n\t context.code(initialCount + ' = errors.length');\n\t context.code(matching + ' = 0');\n\t\n\t for (; i < context.schema.oneOf.length; i++) {\n\t context.code(errCount + ' = errors.length');\n\t\n\t context.greedy = true;\n\t\n\t context.descend(context.path, context.schema.oneOf[i]);\n\t\n\t context.code('if (errors.length === ' + errCount + ') {')\n\t (matching + '++')\n\t ('}');\n\t }\n\t\n\t context.greedy = greedy;\n\t\n\t context.code('if (' + matching + ' !== 1) {');\n\t\n\t context.error('oneOf');\n\t\n\t context.code('} else {')\n\t ('errors.length = ' + initialCount)\n\t ('}');\n\t};\n\t\n\tkeywords.not = function (context) {\n\t if (type(context.schema.not) !== 'object') {\n\t return;\n\t }\n\t\n\t var greedy = context.greedy,\n\t errCount = context.declare(0);\n\t\n\t context.code(errCount + ' = errors.length');\n\t\n\t context.greedy = true;\n\t\n\t context.descend(context.path, context.schema.not);\n\t\n\t context.greedy = greedy;\n\t\n\t context.code('if (errors.length === ' + errCount + ') {');\n\t\n\t context.error('not');\n\t\n\t context.code('} else {')\n\t ('errors.length = ' + errCount)\n\t ('}');\n\t};\n\t\n\tfunction decorateGenerator(type, keyword) {\n\t keywords[keyword].type = type;\n\t keywords[keyword].keyword = keyword;\n\t}\n\t\n\t['minimum', 'exclusiveMinimum', 'maximum', 'exclusiveMaximum', 'multipleOf']\n\t .forEach(decorateGenerator.bind(null, 'number'));\n\t\n\t['minLength', 'maxLength', 'pattern', 'format']\n\t .forEach(decorateGenerator.bind(null, 'string'));\n\t\n\t['minItems', 'maxItems', 'additionalItems', 'uniqueItems', 'items']\n\t .forEach(decorateGenerator.bind(null, 'array'));\n\t\n\t['maxProperties', 'minProperties', 'required', 'properties', 'patternProperties', 'additionalProperties', 'dependencies']\n\t .forEach(decorateGenerator.bind(null, 'object'));\n\t\n\t['enum', 'allOf', 'anyOf', 'oneOf', 'not']\n\t .forEach(decorateGenerator.bind(null, null));\n\t\n\tfunction groupKeywords(schema) {\n\t var keys = Object.keys(schema),\n\t propIndex = keys.indexOf('properties'),\n\t patIndex = keys.indexOf('patternProperties'),\n\t ret = {\n\t enum: Array.isArray(schema.enum) && schema.enum.length > 0,\n\t type: null,\n\t allType: [],\n\t perType: {}\n\t },\n\t key, gen, i;\n\t\n\t if (schema.type) {\n\t if (typeof schema.type === 'string') {\n\t ret.type = [schema.type];\n\t }\n\t else if (Array.isArray(schema.type) && schema.type.length) {\n\t ret.type = schema.type.slice(0);\n\t }\n\t }\n\t\n\t for (i = 0; i < keys.length; i++) {\n\t key = keys[i];\n\t\n\t if (key === 'enum' || key === 'type') {\n\t continue;\n\t }\n\t\n\t gen = keywords[key];\n\t\n\t if (!gen) {\n\t continue;\n\t }\n\t\n\t if (gen.type) {\n\t if (!ret.perType[gen.type]) {\n\t ret.perType[gen.type] = [];\n\t }\n\t\n\t if (!(propIndex > -1 && key === 'required') &&\n\t !(patIndex > -1 && key === 'additionalProperties')) {\n\t ret.perType[gen.type].push(key);\n\t }\n\t }\n\t else {\n\t ret.allType.push(key);\n\t }\n\t }\n\t\n\t return ret;\n\t}\n\t\n\tfunction getPathExpression(path, key) {\n\t var path_ = path.substr(4),\n\t len = path_.length,\n\t tokens = [],\n\t token = '',\n\t isvar = false,\n\t char, i;\n\t\n\t for (i = 0; i < len; i++) {\n\t char = path_[i];\n\t\n\t switch (char) {\n\t case '.':\n\t if (token) {\n\t token += char;\n\t }\n\t break;\n\t case '[':\n\t if (isNaN(+path_[i + 1])) {\n\t isvar = true;\n\t\n\t if (token) {\n\t tokens.push('\"' + token + '\"');\n\t token = '';\n\t }\n\t }\n\t else {\n\t isvar = false;\n\t\n\t if (token) {\n\t token += '.';\n\t }\n\t }\n\t break;\n\t case ']':\n\t tokens.push(isvar ? token : '\"' + token + '\"');\n\t token = '';\n\t break;\n\t default:\n\t token += char;\n\t }\n\t }\n\t\n\t if (token) {\n\t tokens.push('\"' + token + '\"');\n\t }\n\t\n\t if (key) {\n\t tokens.push('\"' + key + '\"');\n\t }\n\t\n\t if (tokens.length === 1 && isvar) {\n\t return '\"\" + ' + tokens[0] + ' + \"\"';\n\t }\n\t\n\t return tokens.join(' + \".\" + ') || '\"\"';\n\t}\n\t\n\tfunction clone(obj) {\n\t var cloned = obj,\n\t objType = type(obj),\n\t keys, len, key, i;\n\t\n\t if (objType === 'object') {\n\t cloned = {};\n\t keys = Object.keys(obj);\n\t\n\t for (i = 0, len = keys.length; i < len; i++) {\n\t key = keys[i];\n\t cloned[key] = clone(obj[key]);\n\t }\n\t }\n\t else if (objType === 'array') {\n\t cloned = [];\n\t\n\t for (i = 0, len = obj.length; i < len; i++) {\n\t cloned[i] = clone(obj[i]);\n\t }\n\t }\n\t else if (objType === 'regexp') {\n\t return new RegExp(obj);\n\t }\n\t else if (objType === 'date') {\n\t return new Date(obj.toJSON());\n\t }\n\t\n\t return cloned;\n\t}\n\t\n\tfunction equalAny(obj, options) {\n\t for (var i = 0, len = options.length; i < len; i++) {\n\t if (equal(obj, options[i])) {\n\t return true;\n\t }\n\t }\n\t\n\t return false;\n\t}\n\t\n\tfunction PropertyMarker() {\n\t this.objects = [];\n\t this.properties = [];\n\t}\n\t\n\tPropertyMarker.prototype.mark = function (obj, key) {\n\t var index = this.objects.indexOf(obj),\n\t prop;\n\t\n\t if (index < 0) {\n\t this.objects.push(obj);\n\t\n\t prop = {};\n\t prop[key] = 1;\n\t\n\t this.properties.push(prop);\n\t\n\t return;\n\t }\n\t\n\t prop = this.properties[index];\n\t\n\t prop[key] = prop[key] ? prop[key] + 1 : 1;\n\t};\n\t\n\tPropertyMarker.prototype.deleteDuplicates = function () {\n\t var props, keys, key, i, j;\n\t\n\t for (i = 0; i < this.properties.length; i++) {\n\t props = this.properties[i];\n\t keys = Object.keys(props);\n\t\n\t for (j = 0; j < keys.length; j++) {\n\t key = keys[j];\n\t\n\t if (props[key] > 1) {\n\t delete this.objects[i][key];\n\t }\n\t }\n\t }\n\t};\n\t\n\tPropertyMarker.prototype.dispose = function () {\n\t this.objects.length = 0;\n\t this.properties.length = 0;\n\t};\n\t\n\tfunction build(schema, def, additional, resolver, parentMarker) {\n\t var defType, defValue, key, i, propertyMarker, props, defProps;\n\t\n\t if (type(schema) !== 'object') {\n\t return def;\n\t }\n\t\n\t schema = resolver.resolve(schema);\n\t\n\t if (def === undefined && schema.hasOwnProperty('default')) {\n\t def = clone(schema['default']);\n\t }\n\t\n\t defType = type(def);\n\t\n\t if (defType === 'object' && type(schema.properties) === 'object') {\n\t props = Object.keys(schema.properties);\n\t\n\t for (i = 0; i < props.length; i++) {\n\t key = props[i];\n\t defValue = build(schema.properties[key], def[key], additional, resolver);\n\t\n\t if (defValue !== undefined) {\n\t def[key] = defValue;\n\t }\n\t }\n\t\n\t if (additional !== 'always') {\n\t defProps = Object.keys(def);\n\t\n\t for (i = 0; i < defProps.length; i++) {\n\t key = defProps[i];\n\t\n\t if (props.indexOf(key) < 0 &&\n\t (schema.additionalProperties === false ||\n\t (additional === false && !schema.additionalProperties))) {\n\t\n\t if (parentMarker) {\n\t parentMarker.mark(def, key);\n\t }\n\t else {\n\t delete def[key];\n\t }\n\t }\n\t }\n\t }\n\t }\n\t else if (defType === 'array' && schema.items) {\n\t if (type(schema.items) === 'array') {\n\t for (i = 0; i < schema.items.length; i++) {\n\t defValue = build(schema.items[i], def[i], additional, resolver);\n\t\n\t if (defValue !== undefined || i < def.length) {\n\t def[i] = defValue;\n\t }\n\t }\n\t }\n\t else if (def.length) {\n\t for (i = 0; i < def.length; i++) {\n\t def[i] = build(schema.items, def[i], additional, resolver);\n\t }\n\t }\n\t }\n\t else if (type(schema.allOf) === 'array' && schema.allOf.length) {\n\t propertyMarker = new PropertyMarker();\n\t\n\t for (i = 0; i < schema.allOf.length; i++) {\n\t def = build(schema.allOf[i], def, additional, resolver, propertyMarker);\n\t }\n\t\n\t propertyMarker.deleteDuplicates();\n\t propertyMarker.dispose();\n\t }\n\t\n\t return def;\n\t}\n\t\n\tfunction ValidationContext(options) {\n\t this.path = 'data';\n\t this.schema = options.schema;\n\t this.formats = options.formats;\n\t this.greedy = options.greedy;\n\t this.resolver = options.resolver;\n\t this.id = options.id;\n\t this.funcache = options.funcache || {};\n\t this.scope = options.scope || {\n\t equalAny: equalAny,\n\t unique: unique,\n\t ucs2length: ucs2length,\n\t refs: {}\n\t };\n\t}\n\t\n\tValidationContext.prototype.clone = function (schema) {\n\t var ctx = new ValidationContext({\n\t schema: schema,\n\t formats: this.formats,\n\t greedy: this.greedy,\n\t resolver: this.resolver,\n\t id: this.id,\n\t funcache: this.funcache,\n\t scope: this.scope\n\t });\n\t\n\t return ctx;\n\t};\n\t\n\tValidationContext.prototype.declare = function (def) {\n\t var variname = this.id();\n\t this.code.def(variname, def);\n\t return variname;\n\t};\n\t\n\tValidationContext.prototype.cache = function (cacheKey, schema) {\n\t var cached = this.funcache[cacheKey],\n\t context;\n\t\n\t if (!cached) {\n\t cached = this.funcache[cacheKey] = {\n\t key: this.id()\n\t };\n\t\n\t context = this.clone(schema);\n\t\n\t cached.func = context.compile(cached.key);\n\t\n\t this.scope.refs[cached.key] = cached.func;\n\t\n\t context.dispose();\n\t }\n\t\n\t return 'refs.' + cached.key;\n\t};\n\t\n\tValidationContext.prototype.error = function (keyword, key, additional) {\n\t var schema = this.schema,\n\t path = this.path,\n\t errorPath = path !== 'data' || key ?\n\t '(path ? path + \".\" : \"\") + ' + getPathExpression(path, key) + ',' :\n\t 'path,',\n\t res = key && schema.properties && schema.properties[key] ?\n\t this.resolver.resolve(schema.properties[key]) : null,\n\t message = res ? res.requiredMessage : schema.invalidMessage;\n\t\n\t if (!message) {\n\t message = (res && res.messages && res.messages[keyword]) ||\n\t (schema.messages && schema.messages[keyword]);\n\t }\n\t\n\t this.code('errors.push({');\n\t\n\t if (message) {\n\t this.code('message: ' + encodeStr(message) + ',');\n\t }\n\t\n\t if (additional) {\n\t this.code('additionalProperties: ' + additional + ',');\n\t }\n\t\n\t this.code('path: ' + errorPath)\n\t ('keyword: ' + encodeStr(keyword))\n\t ('})');\n\t\n\t if (!this.greedy) {\n\t this.code('return');\n\t }\n\t};\n\t\n\tValidationContext.prototype.refactor = function (path, schema, cacheKey) {\n\t var parentPathExp = path !== 'data' ?\n\t '(path ? path + \".\" : \"\") + ' + getPathExpression(path) :\n\t 'path',\n\t cachedRef = this.cache(cacheKey, schema),\n\t refErrors = this.declare();\n\t\n\t this.code(refErrors + ' = ' + cachedRef + '(' + path + ', ' + parentPathExp + ', errors)');\n\t\n\t if (!this.greedy) {\n\t this.code('if (errors.length) { return }');\n\t }\n\t};\n\t\n\tValidationContext.prototype.descend = function (path, schema) {\n\t var origPath = this.path,\n\t origSchema = this.schema;\n\t\n\t this.path = path;\n\t this.schema = schema;\n\t\n\t this.generate();\n\t\n\t this.path = origPath;\n\t this.schema = origSchema;\n\t};\n\t\n\tValidationContext.prototype.generate = function () {\n\t var path = this.path,\n\t schema = this.schema,\n\t context = this,\n\t scope = this.scope,\n\t encodedFormat,\n\t format,\n\t schemaKeys,\n\t typeKeys,\n\t typeIndex,\n\t validatedType,\n\t i;\n\t\n\t if (type(schema) !== 'object') {\n\t return;\n\t }\n\t\n\t if (schema.$ref !== undefined) {\n\t schema = this.resolver.resolve(schema);\n\t\n\t if (this.resolver.hasRef(schema)) {\n\t this.refactor(path, schema,\n\t this.resolver.getNormalizedRef(this.schema) || this.schema.$ref);\n\t\n\t return;\n\t }\n\t else {\n\t // substitute $ref schema with the resolved instance\n\t this.schema = schema;\n\t }\n\t }\n\t\n\t schemaKeys = groupKeywords(schema);\n\t\n\t if (schemaKeys.enum) {\n\t keywords.enum(context);\n\t\n\t return; // do not process the schema further\n\t }\n\t\n\t typeKeys = Object.keys(schemaKeys.perType);\n\t\n\t function generateForKeyword(keyword) {\n\t keywords[keyword](context); // jshint ignore: line\n\t }\n\t\n\t for (i = 0; i < typeKeys.length; i++) {\n\t validatedType = typeKeys[i];\n\t\n\t this.code((i ? 'else ' : '') + 'if (' + types[validatedType](path) + ') {');\n\t\n\t schemaKeys.perType[validatedType].forEach(generateForKeyword);\n\t\n\t this.code('}');\n\t\n\t if (schemaKeys.type) {\n\t typeIndex = schemaKeys.type.indexOf(validatedType);\n\t\n\t if (typeIndex > -1) {\n\t schemaKeys.type.splice(typeIndex, 1);\n\t }\n\t }\n\t }\n\t\n\t if (schemaKeys.type) { // we have types in the schema\n\t if (schemaKeys.type.length) { // case 1: we still have some left to check\n\t this.code((typeKeys.length ? 'else ' : '') + 'if (!(' + schemaKeys.type.map(function (type) {\n\t return types[type] ? types[type](path) : 'true';\n\t }).join(' || ') + ')) {');\n\t this.error('type');\n\t this.code('}');\n\t }\n\t else {\n\t this.code('else {'); // case 2: we don't have any left to check\n\t this.error('type');\n\t this.code('}');\n\t }\n\t }\n\t\n\t schemaKeys.allType.forEach(function (keyword) {\n\t keywords[keyword](context);\n\t });\n\t\n\t if (schema.format && this.formats) {\n\t format = this.formats[schema.format];\n\t\n\t if (format) {\n\t if (typeof format === 'string' || format instanceof RegExp) {\n\t this.code('if (!(' + inlineRegex(format) + ').test(' + path + ')) {');\n\t this.error('format');\n\t this.code('}');\n\t }\n\t else if (typeof format === 'function') {\n\t (scope.formats || (scope.formats = {}))[schema.format] = format;\n\t (scope.schemas || (scope.schemas = {}))[schema.format] = schema;\n\t\n\t encodedFormat = encodeStr(schema.format);\n\t\n\t this.code('if (!formats[' + encodedFormat + '](' + path + ', schemas[' + encodedFormat + '])) {');\n\t this.error('format');\n\t this.code('}');\n\t }\n\t }\n\t }\n\t};\n\t\n\tValidationContext.prototype.compile = function (id) {\n\t this.code = func('jsen_compiled' + (id ? '_' + id : ''), 'data', 'path', 'errors');\n\t this.generate();\n\t\n\t return this.code.compile(this.scope);\n\t};\n\t\n\tValidationContext.prototype.dispose = function () {\n\t for (var key in this) {\n\t this[key] = undefined;\n\t }\n\t};\n\t\n\tfunction jsen(schema, options) {\n\t if (type(schema) !== 'object') {\n\t throw new Error(INVALID_SCHEMA);\n\t }\n\t\n\t options = options || {};\n\t\n\t var counter = 0,\n\t id = function () { return 'i' + (counter++); },\n\t resolver = new SchemaResolver(schema, options.schemas, options.missing$Ref || false),\n\t context = new ValidationContext({\n\t schema: schema,\n\t resolver: resolver,\n\t id: id,\n\t schemas: options.schemas,\n\t formats: options.formats,\n\t greedy: options.greedy || false\n\t }),\n\t compiled = func('validate', 'data')\n\t ('validate.errors = []')\n\t ('gen(data, \"\", validate.errors)')\n\t ('return validate.errors.length === 0')\n\t .compile({ gen: context.compile() });\n\t\n\t context.dispose();\n\t context = null;\n\t\n\t compiled.errors = [];\n\t\n\t compiled.build = function (initial, options) {\n\t return build(\n\t schema,\n\t (options && options.copy === false ? initial : clone(initial)),\n\t options && options.additionalProperties,\n\t resolver);\n\t };\n\t\n\t return compiled;\n\t}\n\t\n\tjsen.browser = browser;\n\tjsen.clone = clone;\n\tjsen.equal = equal;\n\tjsen.unique = unique;\n\tjsen.ucs2length = ucs2length;\n\tjsen.SchemaResolver = SchemaResolver;\n\tjsen.resolve = SchemaResolver.resolvePointer;\n\t\n\tmodule.exports = jsen;\n\n\n/***/ },\n/* 12 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = function func() {\n\t var args = Array.apply(null, arguments),\n\t name = args.shift(),\n\t tab = ' ',\n\t lines = '',\n\t vars = '',\n\t ind = 1, // indentation\n\t bs = '{[', // block start\n\t be = '}]', // block end\n\t space = function () {\n\t var sp = tab, i = 0;\n\t while (i++ < ind - 1) { sp += tab; }\n\t return sp;\n\t },\n\t add = function (line) {\n\t lines += space() + line + '\\n';\n\t },\n\t builder = function (line) {\n\t var first = line[0],\n\t last = line[line.length - 1];\n\t\n\t if (be.indexOf(first) > -1 && bs.indexOf(last) > -1) {\n\t ind--;\n\t add(line);\n\t ind++;\n\t }\n\t else if (bs.indexOf(last) > -1) {\n\t add(line);\n\t ind++;\n\t }\n\t else if (be.indexOf(first) > -1) {\n\t ind--;\n\t add(line);\n\t }\n\t else {\n\t add(line);\n\t }\n\t\n\t return builder;\n\t };\n\t\n\t builder.def = function (id, def) {\n\t vars += (vars ? ',\\n' + tab + ' ' : '') + id + (def !== undefined ? ' = ' + def : '');\n\t return builder;\n\t };\n\t\n\t builder.toSource = function () {\n\t return 'function ' + name + '(' + args.join(', ') + ') {\\n' +\n\t tab + '\"use strict\"' + '\\n' +\n\t (vars ? tab + 'var ' + vars + ';\\n' : '') +\n\t lines + '}';\n\t };\n\t\n\t builder.compile = function (scope) {\n\t var src = 'return (' + builder.toSource() + ')',\n\t scp = scope || {},\n\t keys = Object.keys(scp),\n\t vals = keys.map(function (key) { return scp[key]; });\n\t\n\t return Function.apply(null, keys.concat(src)).apply(null, vals);\n\t };\n\t\n\t return builder;\n\t};\n\n/***/ },\n/* 13 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tfunction type(obj) {\n\t var str = Object.prototype.toString.call(obj);\n\t return str.substr(8, str.length - 9).toLowerCase();\n\t}\n\t\n\tfunction deepEqual(a, b) {\n\t var keysA = Object.keys(a).sort(),\n\t keysB = Object.keys(b).sort(),\n\t i, key;\n\t\n\t if (!equal(keysA, keysB)) {\n\t return false;\n\t }\n\t\n\t for (i = 0; i < keysA.length; i++) {\n\t key = keysA[i];\n\t\n\t if (!equal(a[key], b[key])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t}\n\t\n\tfunction equal(a, b) { // jshint ignore: line\n\t var typeA = typeof a,\n\t typeB = typeof b,\n\t i;\n\t\n\t // get detailed object type\n\t if (typeA === 'object') {\n\t typeA = type(a);\n\t }\n\t\n\t // get detailed object type\n\t if (typeB === 'object') {\n\t typeB = type(b);\n\t }\n\t\n\t if (typeA !== typeB) {\n\t return false;\n\t }\n\t\n\t if (typeA === 'object') {\n\t return deepEqual(a, b);\n\t }\n\t\n\t if (typeA === 'regexp') {\n\t return a.toString() === b.toString();\n\t }\n\t\n\t if (typeA === 'array') {\n\t if (a.length !== b.length) {\n\t return false;\n\t }\n\t\n\t for (i = 0; i < a.length; i++) {\n\t if (!equal(a[i], b[i])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t }\n\t\n\t return a === b;\n\t}\n\t\n\tmodule.exports = equal;\n\n/***/ },\n/* 14 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar equal = __webpack_require__(13);\n\t\n\tfunction findIndex(arr, value, comparator) {\n\t for (var i = 0, len = arr.length; i < len; i++) {\n\t if (comparator(arr[i], value)) {\n\t return i;\n\t }\n\t }\n\t\n\t return -1;\n\t}\n\t\n\tmodule.exports = function unique(arr) {\n\t return arr.filter(function uniqueOnly(value, index, self) {\n\t return findIndex(self, value, equal) === index;\n\t });\n\t};\n\t\n\tmodule.exports.findIndex = findIndex;\n\n/***/ },\n/* 15 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar url = __webpack_require__(16),\n\t metaschema = __webpack_require__(23),\n\t INVALID_SCHEMA_REFERENCE = 'jsen: invalid schema reference',\n\t DUPLICATE_SCHEMA_ID = 'jsen: duplicate schema id',\n\t CIRCULAR_SCHEMA_REFERENCE = 'jsen: circular schema reference';\n\t\n\tfunction get(obj, path) {\n\t if (!path.length) {\n\t return obj;\n\t }\n\t\n\t var key = path.shift(),\n\t val;\n\t\n\t if (obj && typeof obj === 'object' && obj.hasOwnProperty(key)) {\n\t val = obj[key];\n\t }\n\t\n\t if (path.length) {\n\t if (val && typeof val === 'object') {\n\t return get(val, path);\n\t }\n\t\n\t return undefined;\n\t }\n\t\n\t return val;\n\t}\n\t\n\tfunction refToObj(ref) {\n\t var index = ref.indexOf('#'),\n\t ret = {\n\t base: ref.substr(0, index),\n\t path: []\n\t };\n\t\n\t if (index < 0) {\n\t ret.base = ref;\n\t return ret;\n\t }\n\t\n\t ref = ref.substr(index + 1);\n\t\n\t if (!ref) {\n\t return ret;\n\t }\n\t\n\t ret.path = ref.split('/').map(function (segment) {\n\t // Reference: http://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-08#section-3\n\t return decodeURIComponent(segment)\n\t .replace(/~1/g, '/')\n\t .replace(/~0/g, '~');\n\t });\n\t\n\t if (ref[0] === '/') {\n\t ret.path.shift();\n\t }\n\t\n\t return ret;\n\t}\n\t\n\t// TODO: Can we prevent nested resolvers and combine schemas instead?\n\tfunction SchemaResolver(rootSchema, external, missing$Ref, baseId) { // jshint ignore: line\n\t this.rootSchema = rootSchema;\n\t this.resolvers = null;\n\t this.resolvedRootSchema = null;\n\t this.cache = {};\n\t this.idCache = {};\n\t this.refCache = { refs: [], schemas: [] };\n\t this.missing$Ref = missing$Ref;\n\t this.refStack = [];\n\t\n\t baseId = baseId || '';\n\t\n\t this._buildIdCache(rootSchema, baseId);\n\t\n\t // get updated base id after normalizing root schema id\n\t baseId = this.refCache.refs[this.refCache.schemas.indexOf(this.rootSchema)] || baseId;\n\t\n\t this._buildResolvers(external, baseId);\n\t}\n\t\n\tSchemaResolver.prototype._cacheId = function (id, schema, resolver) {\n\t if (this.idCache[id]) {\n\t throw new Error(DUPLICATE_SCHEMA_ID + ' ' + id);\n\t }\n\t\n\t this.idCache[id] = { resolver: resolver, schema: schema };\n\t};\n\t\n\tSchemaResolver.prototype._buildIdCache = function (schema, baseId) {\n\t var id = baseId,\n\t ref, keys, i;\n\t\n\t if (!schema || typeof schema !== 'object') {\n\t return;\n\t }\n\t\n\t if (typeof schema.id === 'string' && schema.id) {\n\t id = url.resolve(baseId, schema.id);\n\t\n\t this._cacheId(id, schema, this);\n\t }\n\t else if (schema === this.rootSchema && baseId) {\n\t this._cacheId(baseId, schema, this);\n\t }\n\t\n\t if (schema.$ref && typeof schema.$ref === 'string') {\n\t ref = url.resolve(id, schema.$ref);\n\t\n\t this.refCache.schemas.push(schema);\n\t this.refCache.refs.push(ref);\n\t }\n\t\n\t keys = Object.keys(schema);\n\t\n\t for (i = 0; i < keys.length; i++) {\n\t this._buildIdCache(schema[keys[i]], id);\n\t }\n\t};\n\t\n\tSchemaResolver.prototype._buildResolvers = function (schemas, baseId) {\n\t if (!schemas || typeof schemas !== 'object') {\n\t return;\n\t }\n\t\n\t var that = this,\n\t resolvers = {};\n\t\n\t Object.keys(schemas).forEach(function (key) {\n\t var id = url.resolve(baseId, key),\n\t resolver = new SchemaResolver(schemas[key], null, that.missing$Ref, id);\n\t\n\t that._cacheId(id, resolver.rootSchema, resolver);\n\t\n\t Object.keys(resolver.idCache).forEach(function (idKey) {\n\t that.idCache[idKey] = resolver.idCache[idKey];\n\t });\n\t\n\t resolvers[key] = resolver;\n\t });\n\t\n\t this.resolvers = resolvers;\n\t};\n\t\n\tSchemaResolver.prototype.getNormalizedRef = function (schema) {\n\t var index = this.refCache.schemas.indexOf(schema);\n\t return this.refCache.refs[index];\n\t};\n\t\n\tSchemaResolver.prototype._resolveRef = function (ref) {\n\t var err = new Error(INVALID_SCHEMA_REFERENCE + ' ' + ref),\n\t idCache = this.idCache,\n\t externalResolver, cached, descriptor, path, dest;\n\t\n\t if (!ref || typeof ref !== 'string') {\n\t throw err;\n\t }\n\t\n\t if (ref === metaschema.id) {\n\t dest = metaschema;\n\t }\n\t\n\t cached = idCache[ref];\n\t\n\t if (cached) {\n\t dest = cached.resolver.resolve(cached.schema);\n\t }\n\t\n\t if (dest === undefined) {\n\t descriptor = refToObj(ref);\n\t path = descriptor.path;\n\t\n\t if (descriptor.base) {\n\t cached = idCache[descriptor.base] || idCache[descriptor.base + '#'];\n\t\n\t if (cached) {\n\t dest = cached.resolver.resolve(get(cached.schema, path.slice(0)));\n\t }\n\t else {\n\t path.unshift(descriptor.base);\n\t }\n\t }\n\t }\n\t\n\t if (dest === undefined && this.resolvedRootSchema) {\n\t dest = get(this.resolvedRootSchema, path.slice(0));\n\t }\n\t\n\t if (dest === undefined) {\n\t dest = get(this.rootSchema, path.slice(0));\n\t }\n\t\n\t if (dest === undefined && path.length && this.resolvers) {\n\t externalResolver = get(this.resolvers, path);\n\t\n\t if (externalResolver) {\n\t dest = externalResolver.resolve(externalResolver.rootSchema);\n\t }\n\t }\n\t\n\t if (dest === undefined || typeof dest !== 'object') {\n\t if (this.missing$Ref) {\n\t dest = {};\n\t } else {\n\t throw err;\n\t }\n\t }\n\t\n\t if (this.cache[ref] === dest) {\n\t return dest;\n\t }\n\t\n\t this.cache[ref] = dest;\n\t\n\t if (dest.$ref !== undefined) {\n\t dest = this.resolve(dest);\n\t }\n\t\n\t return dest;\n\t};\n\t\n\tSchemaResolver.prototype.resolve = function (schema) {\n\t if (!schema || typeof schema !== 'object' || schema.$ref === undefined) {\n\t return schema;\n\t }\n\t\n\t var ref = this.getNormalizedRef(schema) || schema.$ref,\n\t resolved = this.cache[ref];\n\t\n\t if (resolved !== undefined) {\n\t return resolved;\n\t }\n\t\n\t if (this.refStack.indexOf(ref) > -1) {\n\t throw new Error(CIRCULAR_SCHEMA_REFERENCE + ' ' + ref);\n\t }\n\t\n\t this.refStack.push(ref);\n\t\n\t resolved = this._resolveRef(ref);\n\t\n\t this.refStack.pop();\n\t\n\t if (schema === this.rootSchema) {\n\t // cache the resolved root schema\n\t this.resolvedRootSchema = resolved;\n\t }\n\t\n\t return resolved;\n\t};\n\t\n\tSchemaResolver.prototype.hasRef = function (schema) {\n\t var keys = Object.keys(schema),\n\t len, key, i, hasChildRef;\n\t\n\t if (keys.indexOf('$ref') > -1) {\n\t return true;\n\t }\n\t\n\t for (i = 0, len = keys.length; i < len; i++) {\n\t key = keys[i];\n\t\n\t if (schema[key] && typeof schema[key] === 'object' && !Array.isArray(schema[key])) {\n\t hasChildRef = this.hasRef(schema[key]);\n\t\n\t if (hasChildRef) {\n\t return true;\n\t }\n\t }\n\t }\n\t\n\t return false;\n\t};\n\t\n\tSchemaResolver.resolvePointer = function (obj, pointer) {\n\t var descriptor = refToObj(pointer),\n\t path = descriptor.path;\n\t\n\t if (descriptor.base) {\n\t path = [descriptor.base].concat(path);\n\t }\n\t\n\t return get(obj, path);\n\t};\n\t\n\tmodule.exports = SchemaResolver;\n\n/***/ },\n/* 16 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t// Copyright Joyent, Inc. and other Node contributors.\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a\n\t// copy of this software and associated documentation files (the\n\t// \"Software\"), to deal in the Software without restriction, including\n\t// without limitation the rights to use, copy, modify, merge, publish,\n\t// distribute, sublicense, and/or sell copies of the Software, and to permit\n\t// persons to whom the Software is furnished to do so, subject to the\n\t// following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included\n\t// in all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n\t// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\t// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n\t// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n\t// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n\t// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n\t// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\t\n\t'use strict';\n\t\n\tvar punycode = __webpack_require__(17);\n\tvar util = __webpack_require__(19);\n\t\n\texports.parse = urlParse;\n\texports.resolve = urlResolve;\n\texports.resolveObject = urlResolveObject;\n\texports.format = urlFormat;\n\t\n\texports.Url = Url;\n\t\n\tfunction Url() {\n\t this.protocol = null;\n\t this.slashes = null;\n\t this.auth = null;\n\t this.host = null;\n\t this.port = null;\n\t this.hostname = null;\n\t this.hash = null;\n\t this.search = null;\n\t this.query = null;\n\t this.pathname = null;\n\t this.path = null;\n\t this.href = null;\n\t}\n\t\n\t// Reference: RFC 3986, RFC 1808, RFC 2396\n\t\n\t// define these here so at least they only have to be\n\t// compiled once on the first module load.\n\tvar protocolPattern = /^([a-z0-9.+-]+:)/i,\n\t portPattern = /:[0-9]*$/,\n\t\n\t // Special case for a simple path URL\n\t simplePathPattern = /^(\\/\\/?(?!\\/)[^\\?\\s]*)(\\?[^\\s]*)?$/,\n\t\n\t // RFC 2396: characters reserved for delimiting URLs.\n\t // We actually just auto-escape these.\n\t delims = ['<', '>', '\"', '`', ' ', '\\r', '\\n', '\\t'],\n\t\n\t // RFC 2396: characters not allowed for various reasons.\n\t unwise = ['{', '}', '|', '\\\\', '^', '`'].concat(delims),\n\t\n\t // Allowed by RFCs, but cause of XSS attacks. Always escape these.\n\t autoEscape = ['\\''].concat(unwise),\n\t // Characters that are never ever allowed in a hostname.\n\t // Note that any invalid chars are also handled, but these\n\t // are the ones that are *expected* to be seen, so we fast-path\n\t // them.\n\t nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape),\n\t hostEndingChars = ['/', '?', '#'],\n\t hostnameMaxLen = 255,\n\t hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,\n\t hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,\n\t // protocols that can allow \"unsafe\" and \"unwise\" chars.\n\t unsafeProtocol = {\n\t 'javascript': true,\n\t 'javascript:': true\n\t },\n\t // protocols that never have a hostname.\n\t hostlessProtocol = {\n\t 'javascript': true,\n\t 'javascript:': true\n\t },\n\t // protocols that always contain a // bit.\n\t slashedProtocol = {\n\t 'http': true,\n\t 'https': true,\n\t 'ftp': true,\n\t 'gopher': true,\n\t 'file': true,\n\t 'http:': true,\n\t 'https:': true,\n\t 'ftp:': true,\n\t 'gopher:': true,\n\t 'file:': true\n\t },\n\t querystring = __webpack_require__(20);\n\t\n\tfunction urlParse(url, parseQueryString, slashesDenoteHost) {\n\t if (url && util.isObject(url) && url instanceof Url) return url;\n\t\n\t var u = new Url;\n\t u.parse(url, parseQueryString, slashesDenoteHost);\n\t return u;\n\t}\n\t\n\tUrl.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {\n\t if (!util.isString(url)) {\n\t throw new TypeError(\"Parameter 'url' must be a string, not \" + typeof url);\n\t }\n\t\n\t // Copy chrome, IE, opera backslash-handling behavior.\n\t // Back slashes before the query string get converted to forward slashes\n\t // See: https://code.google.com/p/chromium/issues/detail?id=25916\n\t var queryIndex = url.indexOf('?'),\n\t splitter =\n\t (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#',\n\t uSplit = url.split(splitter),\n\t slashRegex = /\\\\/g;\n\t uSplit[0] = uSplit[0].replace(slashRegex, '/');\n\t url = uSplit.join(splitter);\n\t\n\t var rest = url;\n\t\n\t // trim before proceeding.\n\t // This is to support parse stuff like \" http://foo.com \\n\"\n\t rest = rest.trim();\n\t\n\t if (!slashesDenoteHost && url.split('#').length === 1) {\n\t // Try fast path regexp\n\t var simplePath = simplePathPattern.exec(rest);\n\t if (simplePath) {\n\t this.path = rest;\n\t this.href = rest;\n\t this.pathname = simplePath[1];\n\t if (simplePath[2]) {\n\t this.search = simplePath[2];\n\t if (parseQueryString) {\n\t this.query = querystring.parse(this.search.substr(1));\n\t } else {\n\t this.query = this.search.substr(1);\n\t }\n\t } else if (parseQueryString) {\n\t this.search = '';\n\t this.query = {};\n\t }\n\t return this;\n\t }\n\t }\n\t\n\t var proto = protocolPattern.exec(rest);\n\t if (proto) {\n\t proto = proto[0];\n\t var lowerProto = proto.toLowerCase();\n\t this.protocol = lowerProto;\n\t rest = rest.substr(proto.length);\n\t }\n\t\n\t // figure out if it's got a host\n\t // user@server is *always* interpreted as a hostname, and url\n\t // resolution will treat //foo/bar as host=foo,path=bar because that's\n\t // how the browser resolves relative URLs.\n\t if (slashesDenoteHost || proto || rest.match(/^\\/\\/[^@\\/]+@[^@\\/]+/)) {\n\t var slashes = rest.substr(0, 2) === '//';\n\t if (slashes && !(proto && hostlessProtocol[proto])) {\n\t rest = rest.substr(2);\n\t this.slashes = true;\n\t }\n\t }\n\t\n\t if (!hostlessProtocol[proto] &&\n\t (slashes || (proto && !slashedProtocol[proto]))) {\n\t\n\t // there's a hostname.\n\t // the first instance of /, ?, ;, or # ends the host.\n\t //\n\t // If there is an @ in the hostname, then non-host chars *are* allowed\n\t // to the left of the last @ sign, unless some host-ending character\n\t // comes *before* the @-sign.\n\t // URLs are obnoxious.\n\t //\n\t // ex:\n\t // http://a@b@c/ => user:a@b host:c\n\t // http://a@b?@c => user:a host:c path:/?@c\n\t\n\t // v0.12 TODO(isaacs): This is not quite how Chrome does things.\n\t // Review our test case against browsers more comprehensively.\n\t\n\t // find the first instance of any hostEndingChars\n\t var hostEnd = -1;\n\t for (var i = 0; i < hostEndingChars.length; i++) {\n\t var hec = rest.indexOf(hostEndingChars[i]);\n\t if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n\t hostEnd = hec;\n\t }\n\t\n\t // at this point, either we have an explicit point where the\n\t // auth portion cannot go past, or the last @ char is the decider.\n\t var auth, atSign;\n\t if (hostEnd === -1) {\n\t // atSign can be anywhere.\n\t atSign = rest.lastIndexOf('@');\n\t } else {\n\t // atSign must be in auth portion.\n\t // http://a@b/c@d => host:b auth:a path:/c@d\n\t atSign = rest.lastIndexOf('@', hostEnd);\n\t }\n\t\n\t // Now we have a portion which is definitely the auth.\n\t // Pull that off.\n\t if (atSign !== -1) {\n\t auth = rest.slice(0, atSign);\n\t rest = rest.slice(atSign + 1);\n\t this.auth = decodeURIComponent(auth);\n\t }\n\t\n\t // the host is the remaining to the left of the first non-host char\n\t hostEnd = -1;\n\t for (var i = 0; i < nonHostChars.length; i++) {\n\t var hec = rest.indexOf(nonHostChars[i]);\n\t if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n\t hostEnd = hec;\n\t }\n\t // if we still have not hit it, then the entire thing is a host.\n\t if (hostEnd === -1)\n\t hostEnd = rest.length;\n\t\n\t this.host = rest.slice(0, hostEnd);\n\t rest = rest.slice(hostEnd);\n\t\n\t // pull out port.\n\t this.parseHost();\n\t\n\t // we've indicated that there is a hostname,\n\t // so even if it's empty, it has to be present.\n\t this.hostname = this.hostname || '';\n\t\n\t // if hostname begins with [ and ends with ]\n\t // assume that it's an IPv6 address.\n\t var ipv6Hostname = this.hostname[0] === '[' &&\n\t this.hostname[this.hostname.length - 1] === ']';\n\t\n\t // validate a little.\n\t if (!ipv6Hostname) {\n\t var hostparts = this.hostname.split(/\\./);\n\t for (var i = 0, l = hostparts.length; i < l; i++) {\n\t var part = hostparts[i];\n\t if (!part) continue;\n\t if (!part.match(hostnamePartPattern)) {\n\t var newpart = '';\n\t for (var j = 0, k = part.length; j < k; j++) {\n\t if (part.charCodeAt(j) > 127) {\n\t // we replace non-ASCII char with a temporary placeholder\n\t // we need this to make sure size of hostname is not\n\t // broken by replacing non-ASCII by nothing\n\t newpart += 'x';\n\t } else {\n\t newpart += part[j];\n\t }\n\t }\n\t // we test again with ASCII char only\n\t if (!newpart.match(hostnamePartPattern)) {\n\t var validParts = hostparts.slice(0, i);\n\t var notHost = hostparts.slice(i + 1);\n\t var bit = part.match(hostnamePartStart);\n\t if (bit) {\n\t validParts.push(bit[1]);\n\t notHost.unshift(bit[2]);\n\t }\n\t if (notHost.length) {\n\t rest = '/' + notHost.join('.') + rest;\n\t }\n\t this.hostname = validParts.join('.');\n\t break;\n\t }\n\t }\n\t }\n\t }\n\t\n\t if (this.hostname.length > hostnameMaxLen) {\n\t this.hostname = '';\n\t } else {\n\t // hostnames are always lower case.\n\t this.hostname = this.hostname.toLowerCase();\n\t }\n\t\n\t if (!ipv6Hostname) {\n\t // IDNA Support: Returns a punycoded representation of \"domain\".\n\t // It only converts parts of the domain name that\n\t // have non-ASCII characters, i.e. it doesn't matter if\n\t // you call it with a domain that already is ASCII-only.\n\t this.hostname = punycode.toASCII(this.hostname);\n\t }\n\t\n\t var p = this.port ? ':' + this.port : '';\n\t var h = this.hostname || '';\n\t this.host = h + p;\n\t this.href += this.host;\n\t\n\t // strip [ and ] from the hostname\n\t // the host field still retains them, though\n\t if (ipv6Hostname) {\n\t this.hostname = this.hostname.substr(1, this.hostname.length - 2);\n\t if (rest[0] !== '/') {\n\t rest = '/' + rest;\n\t }\n\t }\n\t }\n\t\n\t // now rest is set to the post-host stuff.\n\t // chop off any delim chars.\n\t if (!unsafeProtocol[lowerProto]) {\n\t\n\t // First, make 100% sure that any \"autoEscape\" chars get\n\t // escaped, even if encodeURIComponent doesn't think they\n\t // need to be.\n\t for (var i = 0, l = autoEscape.length; i < l; i++) {\n\t var ae = autoEscape[i];\n\t if (rest.indexOf(ae) === -1)\n\t continue;\n\t var esc = encodeURIComponent(ae);\n\t if (esc === ae) {\n\t esc = escape(ae);\n\t }\n\t rest = rest.split(ae).join(esc);\n\t }\n\t }\n\t\n\t\n\t // chop off from the tail first.\n\t var hash = rest.indexOf('#');\n\t if (hash !== -1) {\n\t // got a fragment string.\n\t this.hash = rest.substr(hash);\n\t rest = rest.slice(0, hash);\n\t }\n\t var qm = rest.indexOf('?');\n\t if (qm !== -1) {\n\t this.search = rest.substr(qm);\n\t this.query = rest.substr(qm + 1);\n\t if (parseQueryString) {\n\t this.query = querystring.parse(this.query);\n\t }\n\t rest = rest.slice(0, qm);\n\t } else if (parseQueryString) {\n\t // no query string, but parseQueryString still requested\n\t this.search = '';\n\t this.query = {};\n\t }\n\t if (rest) this.pathname = rest;\n\t if (slashedProtocol[lowerProto] &&\n\t this.hostname && !this.pathname) {\n\t this.pathname = '/';\n\t }\n\t\n\t //to support http.request\n\t if (this.pathname || this.search) {\n\t var p = this.pathname || '';\n\t var s = this.search || '';\n\t this.path = p + s;\n\t }\n\t\n\t // finally, reconstruct the href based on what has been validated.\n\t this.href = this.format();\n\t return this;\n\t};\n\t\n\t// format a parsed object into a url string\n\tfunction urlFormat(obj) {\n\t // ensure it's an object, and not a string url.\n\t // If it's an obj, this is a no-op.\n\t // this way, you can call url_format() on strings\n\t // to clean up potentially wonky urls.\n\t if (util.isString(obj)) obj = urlParse(obj);\n\t if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n\t return obj.format();\n\t}\n\t\n\tUrl.prototype.format = function() {\n\t var auth = this.auth || '';\n\t if (auth) {\n\t auth = encodeURIComponent(auth);\n\t auth = auth.replace(/%3A/i, ':');\n\t auth += '@';\n\t }\n\t\n\t var protocol = this.protocol || '',\n\t pathname = this.pathname || '',\n\t hash = this.hash || '',\n\t host = false,\n\t query = '';\n\t\n\t if (this.host) {\n\t host = auth + this.host;\n\t } else if (this.hostname) {\n\t host = auth + (this.hostname.indexOf(':') === -1 ?\n\t this.hostname :\n\t '[' + this.hostname + ']');\n\t if (this.port) {\n\t host += ':' + this.port;\n\t }\n\t }\n\t\n\t if (this.query &&\n\t util.isObject(this.query) &&\n\t Object.keys(this.query).length) {\n\t query = querystring.stringify(this.query);\n\t }\n\t\n\t var search = this.search || (query && ('?' + query)) || '';\n\t\n\t if (protocol && protocol.substr(-1) !== ':') protocol += ':';\n\t\n\t // only the slashedProtocols get the //. Not mailto:, xmpp:, etc.\n\t // unless they had them to begin with.\n\t if (this.slashes ||\n\t (!protocol || slashedProtocol[protocol]) && host !== false) {\n\t host = '//' + (host || '');\n\t if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname;\n\t } else if (!host) {\n\t host = '';\n\t }\n\t\n\t if (hash && hash.charAt(0) !== '#') hash = '#' + hash;\n\t if (search && search.charAt(0) !== '?') search = '?' + search;\n\t\n\t pathname = pathname.replace(/[?#]/g, function(match) {\n\t return encodeURIComponent(match);\n\t });\n\t search = search.replace('#', '%23');\n\t\n\t return protocol + host + pathname + search + hash;\n\t};\n\t\n\tfunction urlResolve(source, relative) {\n\t return urlParse(source, false, true).resolve(relative);\n\t}\n\t\n\tUrl.prototype.resolve = function(relative) {\n\t return this.resolveObject(urlParse(relative, false, true)).format();\n\t};\n\t\n\tfunction urlResolveObject(source, relative) {\n\t if (!source) return relative;\n\t return urlParse(source, false, true).resolveObject(relative);\n\t}\n\t\n\tUrl.prototype.resolveObject = function(relative) {\n\t if (util.isString(relative)) {\n\t var rel = new Url();\n\t rel.parse(relative, false, true);\n\t relative = rel;\n\t }\n\t\n\t var result = new Url();\n\t var tkeys = Object.keys(this);\n\t for (var tk = 0; tk < tkeys.length; tk++) {\n\t var tkey = tkeys[tk];\n\t result[tkey] = this[tkey];\n\t }\n\t\n\t // hash is always overridden, no matter what.\n\t // even href=\"\" will remove it.\n\t result.hash = relative.hash;\n\t\n\t // if the relative url is empty, then there's nothing left to do here.\n\t if (relative.href === '') {\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t // hrefs like //foo/bar always cut to the protocol.\n\t if (relative.slashes && !relative.protocol) {\n\t // take everything except the protocol from relative\n\t var rkeys = Object.keys(relative);\n\t for (var rk = 0; rk < rkeys.length; rk++) {\n\t var rkey = rkeys[rk];\n\t if (rkey !== 'protocol')\n\t result[rkey] = relative[rkey];\n\t }\n\t\n\t //urlParse appends trailing / to urls like http://www.example.com\n\t if (slashedProtocol[result.protocol] &&\n\t result.hostname && !result.pathname) {\n\t result.path = result.pathname = '/';\n\t }\n\t\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t if (relative.protocol && relative.protocol !== result.protocol) {\n\t // if it's a known url protocol, then changing\n\t // the protocol does weird things\n\t // first, if it's not file:, then we MUST have a host,\n\t // and if there was a path\n\t // to begin with, then we MUST have a path.\n\t // if it is file:, then the host is dropped,\n\t // because that's known to be hostless.\n\t // anything else is assumed to be absolute.\n\t if (!slashedProtocol[relative.protocol]) {\n\t var keys = Object.keys(relative);\n\t for (var v = 0; v < keys.length; v++) {\n\t var k = keys[v];\n\t result[k] = relative[k];\n\t }\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t result.protocol = relative.protocol;\n\t if (!relative.host && !hostlessProtocol[relative.protocol]) {\n\t var relPath = (relative.pathname || '').split('/');\n\t while (relPath.length && !(relative.host = relPath.shift()));\n\t if (!relative.host) relative.host = '';\n\t if (!relative.hostname) relative.hostname = '';\n\t if (relPath[0] !== '') relPath.unshift('');\n\t if (relPath.length < 2) relPath.unshift('');\n\t result.pathname = relPath.join('/');\n\t } else {\n\t result.pathname = relative.pathname;\n\t }\n\t result.search = relative.search;\n\t result.query = relative.query;\n\t result.host = relative.host || '';\n\t result.auth = relative.auth;\n\t result.hostname = relative.hostname || relative.host;\n\t result.port = relative.port;\n\t // to support http.request\n\t if (result.pathname || result.search) {\n\t var p = result.pathname || '';\n\t var s = result.search || '';\n\t result.path = p + s;\n\t }\n\t result.slashes = result.slashes || relative.slashes;\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'),\n\t isRelAbs = (\n\t relative.host ||\n\t relative.pathname && relative.pathname.charAt(0) === '/'\n\t ),\n\t mustEndAbs = (isRelAbs || isSourceAbs ||\n\t (result.host && relative.pathname)),\n\t removeAllDots = mustEndAbs,\n\t srcPath = result.pathname && result.pathname.split('/') || [],\n\t relPath = relative.pathname && relative.pathname.split('/') || [],\n\t psychotic = result.protocol && !slashedProtocol[result.protocol];\n\t\n\t // if the url is a non-slashed url, then relative\n\t // links like ../.. should be able\n\t // to crawl up to the hostname, as well. This is strange.\n\t // result.protocol has already been set by now.\n\t // Later on, put the first path part into the host field.\n\t if (psychotic) {\n\t result.hostname = '';\n\t result.port = null;\n\t if (result.host) {\n\t if (srcPath[0] === '') srcPath[0] = result.host;\n\t else srcPath.unshift(result.host);\n\t }\n\t result.host = '';\n\t if (relative.protocol) {\n\t relative.hostname = null;\n\t relative.port = null;\n\t if (relative.host) {\n\t if (relPath[0] === '') relPath[0] = relative.host;\n\t else relPath.unshift(relative.host);\n\t }\n\t relative.host = null;\n\t }\n\t mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === '');\n\t }\n\t\n\t if (isRelAbs) {\n\t // it's absolute.\n\t result.host = (relative.host || relative.host === '') ?\n\t relative.host : result.host;\n\t result.hostname = (relative.hostname || relative.hostname === '') ?\n\t relative.hostname : result.hostname;\n\t result.search = relative.search;\n\t result.query = relative.query;\n\t srcPath = relPath;\n\t // fall through to the dot-handling below.\n\t } else if (relPath.length) {\n\t // it's relative\n\t // throw away the existing file, and take the new path instead.\n\t if (!srcPath) srcPath = [];\n\t srcPath.pop();\n\t srcPath = srcPath.concat(relPath);\n\t result.search = relative.search;\n\t result.query = relative.query;\n\t } else if (!util.isNullOrUndefined(relative.search)) {\n\t // just pull out the search.\n\t // like href='https://github.com/?foo'.\n\t // Put this after the other two cases because it simplifies the booleans\n\t if (psychotic) {\n\t result.hostname = result.host = srcPath.shift();\n\t //occationaly the auth can get stuck only in host\n\t //this especially happens in cases like\n\t //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n\t var authInHost = result.host && result.host.indexOf('@') > 0 ?\n\t result.host.split('@') : false;\n\t if (authInHost) {\n\t result.auth = authInHost.shift();\n\t result.host = result.hostname = authInHost.shift();\n\t }\n\t }\n\t result.search = relative.search;\n\t result.query = relative.query;\n\t //to support http.request\n\t if (!util.isNull(result.pathname) || !util.isNull(result.search)) {\n\t result.path = (result.pathname ? result.pathname : '') +\n\t (result.search ? result.search : '');\n\t }\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t if (!srcPath.length) {\n\t // no path at all. easy.\n\t // we've already handled the other stuff above.\n\t result.pathname = null;\n\t //to support http.request\n\t if (result.search) {\n\t result.path = '/' + result.search;\n\t } else {\n\t result.path = null;\n\t }\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t // if a url ENDs in . or .., then it must get a trailing slash.\n\t // however, if it ends in anything else non-slashy,\n\t // then it must NOT get a trailing slash.\n\t var last = srcPath.slice(-1)[0];\n\t var hasTrailingSlash = (\n\t (result.host || relative.host || srcPath.length > 1) &&\n\t (last === '.' || last === '..') || last === '');\n\t\n\t // strip single dots, resolve double dots to parent dir\n\t // if the path tries to go above the root, `up` ends up > 0\n\t var up = 0;\n\t for (var i = srcPath.length; i >= 0; i--) {\n\t last = srcPath[i];\n\t if (last === '.') {\n\t srcPath.splice(i, 1);\n\t } else if (last === '..') {\n\t srcPath.splice(i, 1);\n\t up++;\n\t } else if (up) {\n\t srcPath.splice(i, 1);\n\t up--;\n\t }\n\t }\n\t\n\t // if the path is allowed to go above the root, restore leading ..s\n\t if (!mustEndAbs && !removeAllDots) {\n\t for (; up--; up) {\n\t srcPath.unshift('..');\n\t }\n\t }\n\t\n\t if (mustEndAbs && srcPath[0] !== '' &&\n\t (!srcPath[0] || srcPath[0].charAt(0) !== '/')) {\n\t srcPath.unshift('');\n\t }\n\t\n\t if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) {\n\t srcPath.push('');\n\t }\n\t\n\t var isAbsolute = srcPath[0] === '' ||\n\t (srcPath[0] && srcPath[0].charAt(0) === '/');\n\t\n\t // put the host back\n\t if (psychotic) {\n\t result.hostname = result.host = isAbsolute ? '' :\n\t srcPath.length ? srcPath.shift() : '';\n\t //occationaly the auth can get stuck only in host\n\t //this especially happens in cases like\n\t //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n\t var authInHost = result.host && result.host.indexOf('@') > 0 ?\n\t result.host.split('@') : false;\n\t if (authInHost) {\n\t result.auth = authInHost.shift();\n\t result.host = result.hostname = authInHost.shift();\n\t }\n\t }\n\t\n\t mustEndAbs = mustEndAbs || (result.host && srcPath.length);\n\t\n\t if (mustEndAbs && !isAbsolute) {\n\t srcPath.unshift('');\n\t }\n\t\n\t if (!srcPath.length) {\n\t result.pathname = null;\n\t result.path = null;\n\t } else {\n\t result.pathname = srcPath.join('/');\n\t }\n\t\n\t //to support request.http\n\t if (!util.isNull(result.pathname) || !util.isNull(result.search)) {\n\t result.path = (result.pathname ? result.pathname : '') +\n\t (result.search ? result.search : '');\n\t }\n\t result.auth = relative.auth || result.auth;\n\t result.slashes = result.slashes || relative.slashes;\n\t result.href = result.format();\n\t return result;\n\t};\n\t\n\tUrl.prototype.parseHost = function() {\n\t var host = this.host;\n\t var port = portPattern.exec(host);\n\t if (port) {\n\t port = port[0];\n\t if (port !== ':') {\n\t this.port = port.substr(1);\n\t }\n\t host = host.substr(0, host.length - port.length);\n\t }\n\t if (host) this.hostname = host;\n\t};\n\n\n/***/ },\n/* 17 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(module, global) {/*! https://mths.be/punycode v1.3.2 by @mathias */\n\t;(function(root) {\n\t\n\t\t/** Detect free variables */\n\t\tvar freeExports = typeof exports == 'object' && exports &&\n\t\t\t!exports.nodeType && exports;\n\t\tvar freeModule = typeof module == 'object' && module &&\n\t\t\t!module.nodeType && module;\n\t\tvar freeGlobal = typeof global == 'object' && global;\n\t\tif (\n\t\t\tfreeGlobal.global === freeGlobal ||\n\t\t\tfreeGlobal.window === freeGlobal ||\n\t\t\tfreeGlobal.self === freeGlobal\n\t\t) {\n\t\t\troot = freeGlobal;\n\t\t}\n\t\n\t\t/**\n\t\t * The `punycode` object.\n\t\t * @name punycode\n\t\t * @type Object\n\t\t */\n\t\tvar punycode,\n\t\n\t\t/** Highest positive signed 32-bit float value */\n\t\tmaxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1\n\t\n\t\t/** Bootstring parameters */\n\t\tbase = 36,\n\t\ttMin = 1,\n\t\ttMax = 26,\n\t\tskew = 38,\n\t\tdamp = 700,\n\t\tinitialBias = 72,\n\t\tinitialN = 128, // 0x80\n\t\tdelimiter = '-', // '\\x2D'\n\t\n\t\t/** Regular expressions */\n\t\tregexPunycode = /^xn--/,\n\t\tregexNonASCII = /[^\\x20-\\x7E]/, // unprintable ASCII chars + non-ASCII chars\n\t\tregexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g, // RFC 3490 separators\n\t\n\t\t/** Error messages */\n\t\terrors = {\n\t\t\t'overflow': 'Overflow: input needs wider integers to process',\n\t\t\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t\t\t'invalid-input': 'Invalid input'\n\t\t},\n\t\n\t\t/** Convenience shortcuts */\n\t\tbaseMinusTMin = base - tMin,\n\t\tfloor = Math.floor,\n\t\tstringFromCharCode = String.fromCharCode,\n\t\n\t\t/** Temporary variable */\n\t\tkey;\n\t\n\t\t/*--------------------------------------------------------------------------*/\n\t\n\t\t/**\n\t\t * A generic error utility function.\n\t\t * @private\n\t\t * @param {String} type The error type.\n\t\t * @returns {Error} Throws a `RangeError` with the applicable error message.\n\t\t */\n\t\tfunction error(type) {\n\t\t\tthrow RangeError(errors[type]);\n\t\t}\n\t\n\t\t/**\n\t\t * A generic `Array#map` utility function.\n\t\t * @private\n\t\t * @param {Array} array The array to iterate over.\n\t\t * @param {Function} callback The function that gets called for every array\n\t\t * item.\n\t\t * @returns {Array} A new array of values returned by the callback function.\n\t\t */\n\t\tfunction map(array, fn) {\n\t\t\tvar length = array.length;\n\t\t\tvar result = [];\n\t\t\twhile (length--) {\n\t\t\t\tresult[length] = fn(array[length]);\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\n\t\t/**\n\t\t * A simple `Array#map`-like wrapper to work with domain name strings or email\n\t\t * addresses.\n\t\t * @private\n\t\t * @param {String} domain The domain name or email address.\n\t\t * @param {Function} callback The function that gets called for every\n\t\t * character.\n\t\t * @returns {Array} A new string of characters returned by the callback\n\t\t * function.\n\t\t */\n\t\tfunction mapDomain(string, fn) {\n\t\t\tvar parts = string.split('@');\n\t\t\tvar result = '';\n\t\t\tif (parts.length > 1) {\n\t\t\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t\t\t// the local part (i.e. everything up to `@`) intact.\n\t\t\t\tresult = parts[0] + '@';\n\t\t\t\tstring = parts[1];\n\t\t\t}\n\t\t\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\t\t\tstring = string.replace(regexSeparators, '\\x2E');\n\t\t\tvar labels = string.split('.');\n\t\t\tvar encoded = map(labels, fn).join('.');\n\t\t\treturn result + encoded;\n\t\t}\n\t\n\t\t/**\n\t\t * Creates an array containing the numeric code points of each Unicode\n\t\t * character in the string. While JavaScript uses UCS-2 internally,\n\t\t * this function will convert a pair of surrogate halves (each of which\n\t\t * UCS-2 exposes as separate characters) into a single code point,\n\t\t * matching UTF-16.\n\t\t * @see `punycode.ucs2.encode`\n\t\t * @see \n\t\t * @memberOf punycode.ucs2\n\t\t * @name decode\n\t\t * @param {String} string The Unicode input string (UCS-2).\n\t\t * @returns {Array} The new array of code points.\n\t\t */\n\t\tfunction ucs2decode(string) {\n\t\t\tvar output = [],\n\t\t\t counter = 0,\n\t\t\t length = string.length,\n\t\t\t value,\n\t\t\t extra;\n\t\t\twhile (counter < length) {\n\t\t\t\tvalue = string.charCodeAt(counter++);\n\t\t\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t\t\t// high surrogate, and there is a next character\n\t\t\t\t\textra = string.charCodeAt(counter++);\n\t\t\t\t\tif ((extra & 0xFC00) == 0xDC00) { // low surrogate\n\t\t\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// unmatched surrogate; only append this code unit, in case the next\n\t\t\t\t\t\t// code unit is the high surrogate of a surrogate pair\n\t\t\t\t\t\toutput.push(value);\n\t\t\t\t\t\tcounter--;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\toutput.push(value);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn output;\n\t\t}\n\t\n\t\t/**\n\t\t * Creates a string based on an array of numeric code points.\n\t\t * @see `punycode.ucs2.decode`\n\t\t * @memberOf punycode.ucs2\n\t\t * @name encode\n\t\t * @param {Array} codePoints The array of numeric code points.\n\t\t * @returns {String} The new Unicode string (UCS-2).\n\t\t */\n\t\tfunction ucs2encode(array) {\n\t\t\treturn map(array, function(value) {\n\t\t\t\tvar output = '';\n\t\t\t\tif (value > 0xFFFF) {\n\t\t\t\t\tvalue -= 0x10000;\n\t\t\t\t\toutput += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);\n\t\t\t\t\tvalue = 0xDC00 | value & 0x3FF;\n\t\t\t\t}\n\t\t\t\toutput += stringFromCharCode(value);\n\t\t\t\treturn output;\n\t\t\t}).join('');\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a basic code point into a digit/integer.\n\t\t * @see `digitToBasic()`\n\t\t * @private\n\t\t * @param {Number} codePoint The basic numeric code point value.\n\t\t * @returns {Number} The numeric value of a basic code point (for use in\n\t\t * representing integers) in the range `0` to `base - 1`, or `base` if\n\t\t * the code point does not represent a value.\n\t\t */\n\t\tfunction basicToDigit(codePoint) {\n\t\t\tif (codePoint - 48 < 10) {\n\t\t\t\treturn codePoint - 22;\n\t\t\t}\n\t\t\tif (codePoint - 65 < 26) {\n\t\t\t\treturn codePoint - 65;\n\t\t\t}\n\t\t\tif (codePoint - 97 < 26) {\n\t\t\t\treturn codePoint - 97;\n\t\t\t}\n\t\t\treturn base;\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a digit/integer into a basic code point.\n\t\t * @see `basicToDigit()`\n\t\t * @private\n\t\t * @param {Number} digit The numeric value of a basic code point.\n\t\t * @returns {Number} The basic code point whose value (when used for\n\t\t * representing integers) is `digit`, which needs to be in the range\n\t\t * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n\t\t * used; else, the lowercase form is used. The behavior is undefined\n\t\t * if `flag` is non-zero and `digit` has no uppercase form.\n\t\t */\n\t\tfunction digitToBasic(digit, flag) {\n\t\t\t// 0..25 map to ASCII a..z or A..Z\n\t\t\t// 26..35 map to ASCII 0..9\n\t\t\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n\t\t}\n\t\n\t\t/**\n\t\t * Bias adaptation function as per section 3.4 of RFC 3492.\n\t\t * http://tools.ietf.org/html/rfc3492#section-3.4\n\t\t * @private\n\t\t */\n\t\tfunction adapt(delta, numPoints, firstTime) {\n\t\t\tvar k = 0;\n\t\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\t\tdelta += floor(delta / numPoints);\n\t\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t\t}\n\t\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n\t\t * symbols.\n\t\t * @memberOf punycode\n\t\t * @param {String} input The Punycode string of ASCII-only symbols.\n\t\t * @returns {String} The resulting string of Unicode symbols.\n\t\t */\n\t\tfunction decode(input) {\n\t\t\t// Don't use UCS-2\n\t\t\tvar output = [],\n\t\t\t inputLength = input.length,\n\t\t\t out,\n\t\t\t i = 0,\n\t\t\t n = initialN,\n\t\t\t bias = initialBias,\n\t\t\t basic,\n\t\t\t j,\n\t\t\t index,\n\t\t\t oldi,\n\t\t\t w,\n\t\t\t k,\n\t\t\t digit,\n\t\t\t t,\n\t\t\t /** Cached calculation results */\n\t\t\t baseMinusT;\n\t\n\t\t\t// Handle the basic code points: let `basic` be the number of input code\n\t\t\t// points before the last delimiter, or `0` if there is none, then copy\n\t\t\t// the first basic code points to the output.\n\t\n\t\t\tbasic = input.lastIndexOf(delimiter);\n\t\t\tif (basic < 0) {\n\t\t\t\tbasic = 0;\n\t\t\t}\n\t\n\t\t\tfor (j = 0; j < basic; ++j) {\n\t\t\t\t// if it's not a basic code point\n\t\t\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\t\t\terror('not-basic');\n\t\t\t\t}\n\t\t\t\toutput.push(input.charCodeAt(j));\n\t\t\t}\n\t\n\t\t\t// Main decoding loop: start just after the last delimiter if any basic code\n\t\t\t// points were copied; start at the beginning otherwise.\n\t\n\t\t\tfor (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\t\n\t\t\t\t// `index` is the index of the next character to be consumed.\n\t\t\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t\t\t// which gets added to `i`. The overflow checking is easier\n\t\t\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t\t\t// value at the end to obtain `delta`.\n\t\t\t\tfor (oldi = i, w = 1, k = base; /* no condition */; k += base) {\n\t\n\t\t\t\t\tif (index >= inputLength) {\n\t\t\t\t\t\terror('invalid-input');\n\t\t\t\t\t}\n\t\n\t\t\t\t\tdigit = basicToDigit(input.charCodeAt(index++));\n\t\n\t\t\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\t\t\terror('overflow');\n\t\t\t\t\t}\n\t\n\t\t\t\t\ti += digit * w;\n\t\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\n\t\t\t\t\tif (digit < t) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tbaseMinusT = base - t;\n\t\t\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\t\t\terror('overflow');\n\t\t\t\t\t}\n\t\n\t\t\t\t\tw *= baseMinusT;\n\t\n\t\t\t\t}\n\t\n\t\t\t\tout = output.length + 1;\n\t\t\t\tbias = adapt(i - oldi, out, oldi == 0);\n\t\n\t\t\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t\t\t// incrementing `n` each time, so we'll fix that now:\n\t\t\t\tif (floor(i / out) > maxInt - n) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\t\n\t\t\t\tn += floor(i / out);\n\t\t\t\ti %= out;\n\t\n\t\t\t\t// Insert `n` at position `i` of the output\n\t\t\t\toutput.splice(i++, 0, n);\n\t\n\t\t\t}\n\t\n\t\t\treturn ucs2encode(output);\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a string of Unicode symbols (e.g. a domain name label) to a\n\t\t * Punycode string of ASCII-only symbols.\n\t\t * @memberOf punycode\n\t\t * @param {String} input The string of Unicode symbols.\n\t\t * @returns {String} The resulting Punycode string of ASCII-only symbols.\n\t\t */\n\t\tfunction encode(input) {\n\t\t\tvar n,\n\t\t\t delta,\n\t\t\t handledCPCount,\n\t\t\t basicLength,\n\t\t\t bias,\n\t\t\t j,\n\t\t\t m,\n\t\t\t q,\n\t\t\t k,\n\t\t\t t,\n\t\t\t currentValue,\n\t\t\t output = [],\n\t\t\t /** `inputLength` will hold the number of code points in `input`. */\n\t\t\t inputLength,\n\t\t\t /** Cached calculation results */\n\t\t\t handledCPCountPlusOne,\n\t\t\t baseMinusT,\n\t\t\t qMinusT;\n\t\n\t\t\t// Convert the input in UCS-2 to Unicode\n\t\t\tinput = ucs2decode(input);\n\t\n\t\t\t// Cache the length\n\t\t\tinputLength = input.length;\n\t\n\t\t\t// Initialize the state\n\t\t\tn = initialN;\n\t\t\tdelta = 0;\n\t\t\tbias = initialBias;\n\t\n\t\t\t// Handle the basic code points\n\t\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\t\tcurrentValue = input[j];\n\t\t\t\tif (currentValue < 0x80) {\n\t\t\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\thandledCPCount = basicLength = output.length;\n\t\n\t\t\t// `handledCPCount` is the number of code points that have been handled;\n\t\t\t// `basicLength` is the number of basic code points.\n\t\n\t\t\t// Finish the basic string - if it is not empty - with a delimiter\n\t\t\tif (basicLength) {\n\t\t\t\toutput.push(delimiter);\n\t\t\t}\n\t\n\t\t\t// Main encoding loop:\n\t\t\twhile (handledCPCount < inputLength) {\n\t\n\t\t\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t\t\t// larger one:\n\t\t\t\tfor (m = maxInt, j = 0; j < inputLength; ++j) {\n\t\t\t\t\tcurrentValue = input[j];\n\t\t\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\t\t\tm = currentValue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\t// Increase `delta` enough to advance the decoder's state to ,\n\t\t\t\t// but guard against overflow\n\t\t\t\thandledCPCountPlusOne = handledCPCount + 1;\n\t\t\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\t\n\t\t\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\t\t\tn = m;\n\t\n\t\t\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\t\t\tcurrentValue = input[j];\n\t\n\t\t\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\t\t\terror('overflow');\n\t\t\t\t\t}\n\t\n\t\t\t\t\tif (currentValue == n) {\n\t\t\t\t\t\t// Represent delta as a generalized variable-length integer\n\t\t\t\t\t\tfor (q = delta, k = base; /* no condition */; k += base) {\n\t\t\t\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tqMinusT = q - t;\n\t\t\t\t\t\t\tbaseMinusT = base - t;\n\t\t\t\t\t\t\toutput.push(\n\t\t\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\t\t\tdelta = 0;\n\t\t\t\t\t\t++handledCPCount;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\t++delta;\n\t\t\t\t++n;\n\t\n\t\t\t}\n\t\t\treturn output.join('');\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a Punycode string representing a domain name or an email address\n\t\t * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n\t\t * it doesn't matter if you call it on a string that has already been\n\t\t * converted to Unicode.\n\t\t * @memberOf punycode\n\t\t * @param {String} input The Punycoded domain name or email address to\n\t\t * convert to Unicode.\n\t\t * @returns {String} The Unicode representation of the given Punycode\n\t\t * string.\n\t\t */\n\t\tfunction toUnicode(input) {\n\t\t\treturn mapDomain(input, function(string) {\n\t\t\t\treturn regexPunycode.test(string)\n\t\t\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t\t\t: string;\n\t\t\t});\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a Unicode string representing a domain name or an email address to\n\t\t * Punycode. Only the non-ASCII parts of the domain name will be converted,\n\t\t * i.e. it doesn't matter if you call it with a domain that's already in\n\t\t * ASCII.\n\t\t * @memberOf punycode\n\t\t * @param {String} input The domain name or email address to convert, as a\n\t\t * Unicode string.\n\t\t * @returns {String} The Punycode representation of the given domain name or\n\t\t * email address.\n\t\t */\n\t\tfunction toASCII(input) {\n\t\t\treturn mapDomain(input, function(string) {\n\t\t\t\treturn regexNonASCII.test(string)\n\t\t\t\t\t? 'xn--' + encode(string)\n\t\t\t\t\t: string;\n\t\t\t});\n\t\t}\n\t\n\t\t/*--------------------------------------------------------------------------*/\n\t\n\t\t/** Define the public API */\n\t\tpunycode = {\n\t\t\t/**\n\t\t\t * A string representing the current Punycode.js version number.\n\t\t\t * @memberOf punycode\n\t\t\t * @type String\n\t\t\t */\n\t\t\t'version': '1.3.2',\n\t\t\t/**\n\t\t\t * An object of methods to convert from JavaScript's internal character\n\t\t\t * representation (UCS-2) to Unicode code points, and back.\n\t\t\t * @see \n\t\t\t * @memberOf punycode\n\t\t\t * @type Object\n\t\t\t */\n\t\t\t'ucs2': {\n\t\t\t\t'decode': ucs2decode,\n\t\t\t\t'encode': ucs2encode\n\t\t\t},\n\t\t\t'decode': decode,\n\t\t\t'encode': encode,\n\t\t\t'toASCII': toASCII,\n\t\t\t'toUnicode': toUnicode\n\t\t};\n\t\n\t\t/** Expose `punycode` */\n\t\t// Some AMD build optimizers, like r.js, check for specific condition patterns\n\t\t// like the following:\n\t\tif (\n\t\t\ttrue\n\t\t) {\n\t\t\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function() {\n\t\t\t\treturn punycode;\n\t\t\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t\t} else if (freeExports && freeModule) {\n\t\t\tif (module.exports == freeExports) { // in Node.js or RingoJS v0.8.0+\n\t\t\t\tfreeModule.exports = punycode;\n\t\t\t} else { // in Narwhal or RingoJS v0.7.0-\n\t\t\t\tfor (key in punycode) {\n\t\t\t\t\tpunycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]);\n\t\t\t\t}\n\t\t\t}\n\t\t} else { // in Rhino or a web browser\n\t\t\troot.punycode = punycode;\n\t\t}\n\t\n\t}(this));\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(18)(module), (function() { return this; }())))\n\n/***/ },\n/* 18 */\n/***/ function(module, exports) {\n\n\tmodule.exports = function(module) {\r\n\t\tif(!module.webpackPolyfill) {\r\n\t\t\tmodule.deprecate = function() {};\r\n\t\t\tmodule.paths = [];\r\n\t\t\t// module.parent = undefined by default\r\n\t\t\tmodule.children = [];\r\n\t\t\tmodule.webpackPolyfill = 1;\r\n\t\t}\r\n\t\treturn module;\r\n\t}\r\n\n\n/***/ },\n/* 19 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = {\n\t isString: function(arg) {\n\t return typeof(arg) === 'string';\n\t },\n\t isObject: function(arg) {\n\t return typeof(arg) === 'object' && arg !== null;\n\t },\n\t isNull: function(arg) {\n\t return arg === null;\n\t },\n\t isNullOrUndefined: function(arg) {\n\t return arg == null;\n\t }\n\t};\n\n\n/***/ },\n/* 20 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\texports.decode = exports.parse = __webpack_require__(21);\n\texports.encode = exports.stringify = __webpack_require__(22);\n\n\n/***/ },\n/* 21 */\n/***/ function(module, exports) {\n\n\t// Copyright Joyent, Inc. and other Node contributors.\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a\n\t// copy of this software and associated documentation files (the\n\t// \"Software\"), to deal in the Software without restriction, including\n\t// without limitation the rights to use, copy, modify, merge, publish,\n\t// distribute, sublicense, and/or sell copies of the Software, and to permit\n\t// persons to whom the Software is furnished to do so, subject to the\n\t// following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included\n\t// in all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n\t// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\t// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n\t// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n\t// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n\t// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n\t// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\t\n\t'use strict';\n\t\n\t// If obj.hasOwnProperty has been overridden, then calling\n\t// obj.hasOwnProperty(prop) will break.\n\t// See: https://github.com/joyent/node/issues/1707\n\tfunction hasOwnProperty(obj, prop) {\n\t return Object.prototype.hasOwnProperty.call(obj, prop);\n\t}\n\t\n\tmodule.exports = function(qs, sep, eq, options) {\n\t sep = sep || '&';\n\t eq = eq || '=';\n\t var obj = {};\n\t\n\t if (typeof qs !== 'string' || qs.length === 0) {\n\t return obj;\n\t }\n\t\n\t var regexp = /\\+/g;\n\t qs = qs.split(sep);\n\t\n\t var maxKeys = 1000;\n\t if (options && typeof options.maxKeys === 'number') {\n\t maxKeys = options.maxKeys;\n\t }\n\t\n\t var len = qs.length;\n\t // maxKeys <= 0 means that we should not limit keys count\n\t if (maxKeys > 0 && len > maxKeys) {\n\t len = maxKeys;\n\t }\n\t\n\t for (var i = 0; i < len; ++i) {\n\t var x = qs[i].replace(regexp, '%20'),\n\t idx = x.indexOf(eq),\n\t kstr, vstr, k, v;\n\t\n\t if (idx >= 0) {\n\t kstr = x.substr(0, idx);\n\t vstr = x.substr(idx + 1);\n\t } else {\n\t kstr = x;\n\t vstr = '';\n\t }\n\t\n\t k = decodeURIComponent(kstr);\n\t v = decodeURIComponent(vstr);\n\t\n\t if (!hasOwnProperty(obj, k)) {\n\t obj[k] = v;\n\t } else if (Array.isArray(obj[k])) {\n\t obj[k].push(v);\n\t } else {\n\t obj[k] = [obj[k], v];\n\t }\n\t }\n\t\n\t return obj;\n\t};\n\n\n/***/ },\n/* 22 */\n/***/ function(module, exports) {\n\n\t// Copyright Joyent, Inc. and other Node contributors.\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a\n\t// copy of this software and associated documentation files (the\n\t// \"Software\"), to deal in the Software without restriction, including\n\t// without limitation the rights to use, copy, modify, merge, publish,\n\t// distribute, sublicense, and/or sell copies of the Software, and to permit\n\t// persons to whom the Software is furnished to do so, subject to the\n\t// following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included\n\t// in all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n\t// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\t// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n\t// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n\t// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n\t// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n\t// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\t\n\t'use strict';\n\t\n\tvar stringifyPrimitive = function(v) {\n\t switch (typeof v) {\n\t case 'string':\n\t return v;\n\t\n\t case 'boolean':\n\t return v ? 'true' : 'false';\n\t\n\t case 'number':\n\t return isFinite(v) ? v : '';\n\t\n\t default:\n\t return '';\n\t }\n\t};\n\t\n\tmodule.exports = function(obj, sep, eq, name) {\n\t sep = sep || '&';\n\t eq = eq || '=';\n\t if (obj === null) {\n\t obj = undefined;\n\t }\n\t\n\t if (typeof obj === 'object') {\n\t return Object.keys(obj).map(function(k) {\n\t var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;\n\t if (Array.isArray(obj[k])) {\n\t return obj[k].map(function(v) {\n\t return ks + encodeURIComponent(stringifyPrimitive(v));\n\t }).join(sep);\n\t } else {\n\t return ks + encodeURIComponent(stringifyPrimitive(obj[k]));\n\t }\n\t }).join(sep);\n\t\n\t }\n\t\n\t if (!name) return '';\n\t return encodeURIComponent(stringifyPrimitive(name)) + eq +\n\t encodeURIComponent(stringifyPrimitive(obj));\n\t};\n\n\n/***/ },\n/* 23 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"id\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"description\": \"Core schema meta-schema\",\n\t\t\"definitions\": {\n\t\t\t\"schemaArray\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"minItems\": 1,\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"positiveInteger\": {\n\t\t\t\t\"type\": \"integer\",\n\t\t\t\t\"minimum\": 0\n\t\t\t},\n\t\t\t\"positiveIntegerDefault0\": {\n\t\t\t\t\"allOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#/definitions/positiveInteger\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"default\": 0\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"simpleTypes\": {\n\t\t\t\t\"enum\": [\n\t\t\t\t\t\"array\",\n\t\t\t\t\t\"boolean\",\n\t\t\t\t\t\"integer\",\n\t\t\t\t\t\"null\",\n\t\t\t\t\t\"number\",\n\t\t\t\t\t\"object\",\n\t\t\t\t\t\"string\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"stringArray\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t},\n\t\t\t\t\"minItems\": 1,\n\t\t\t\t\"uniqueItems\": true\n\t\t\t}\n\t\t},\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"id\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"uri\"\n\t\t\t},\n\t\t\t\"$schema\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"uri\"\n\t\t\t},\n\t\t\t\"title\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"description\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"default\": {},\n\t\t\t\"multipleOf\": {\n\t\t\t\t\"type\": \"number\",\n\t\t\t\t\"minimum\": 0,\n\t\t\t\t\"exclusiveMinimum\": true\n\t\t\t},\n\t\t\t\"maximum\": {\n\t\t\t\t\"type\": \"number\"\n\t\t\t},\n\t\t\t\"exclusiveMaximum\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"minimum\": {\n\t\t\t\t\"type\": \"number\"\n\t\t\t},\n\t\t\t\"exclusiveMinimum\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"maxLength\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveInteger\"\n\t\t\t},\n\t\t\t\"minLength\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveIntegerDefault0\"\n\t\t\t},\n\t\t\t\"pattern\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"regex\"\n\t\t\t},\n\t\t\t\"additionalItems\": {\n\t\t\t\t\"anyOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"boolean\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"items\": {\n\t\t\t\t\"anyOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#/definitions/schemaArray\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"maxItems\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveInteger\"\n\t\t\t},\n\t\t\t\"minItems\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveIntegerDefault0\"\n\t\t\t},\n\t\t\t\"uniqueItems\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"maxProperties\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveInteger\"\n\t\t\t},\n\t\t\t\"minProperties\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveIntegerDefault0\"\n\t\t\t},\n\t\t\t\"required\": {\n\t\t\t\t\"$ref\": \"#/definitions/stringArray\"\n\t\t\t},\n\t\t\t\"additionalProperties\": {\n\t\t\t\t\"anyOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"boolean\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"definitions\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": {\n\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t},\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"properties\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": {\n\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t},\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"patternProperties\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": {\n\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t},\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"dependencies\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": {\n\t\t\t\t\t\"anyOf\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"$ref\": \"#/definitions/stringArray\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"enum\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"minItems\": 1,\n\t\t\t\t\"uniqueItems\": true\n\t\t\t},\n\t\t\t\"type\": {\n\t\t\t\t\"anyOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#/definitions/simpleTypes\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"array\",\n\t\t\t\t\t\t\"items\": {\n\t\t\t\t\t\t\t\"$ref\": \"#/definitions/simpleTypes\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"minItems\": 1,\n\t\t\t\t\t\t\"uniqueItems\": true\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"allOf\": {\n\t\t\t\t\"$ref\": \"#/definitions/schemaArray\"\n\t\t\t},\n\t\t\t\"anyOf\": {\n\t\t\t\t\"$ref\": \"#/definitions/schemaArray\"\n\t\t\t},\n\t\t\t\"oneOf\": {\n\t\t\t\t\"$ref\": \"#/definitions/schemaArray\"\n\t\t\t},\n\t\t\t\"not\": {\n\t\t\t\t\"$ref\": \"#\"\n\t\t\t}\n\t\t},\n\t\t\"dependencies\": {\n\t\t\t\"exclusiveMaximum\": [\n\t\t\t\t\"maximum\"\n\t\t\t],\n\t\t\t\"exclusiveMinimum\": [\n\t\t\t\t\"minimum\"\n\t\t\t]\n\t\t},\n\t\t\"default\": {}\n\t};\n\n/***/ },\n/* 24 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tvar formats = {};\n\t\n\t// reference: http://dansnetwork.com/javascript-iso8601rfc3339-date-parser/\n\tformats['date-time'] = /(\\d\\d\\d\\d)(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))/;\n\t// reference: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js#L7\n\tformats.uri = /^([a-zA-Z][a-zA-Z0-9+-.]*:){0,1}\\/\\/[^\\s]*$/;\n\t// reference: http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363\n\t// http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'willful violation')\n\tformats.email = /^[a-zA-Z0-9.!#$%&'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n\t// reference: https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html\n\tformats.ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;\n\t// reference: http://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses\n\tformats.ipv6 = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|[fF][eE]80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::([fF]{4}(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;\n\t// reference: http://stackoverflow.com/questions/106179/regular-expression-to-match-dns-hostname-or-ip-address#answer-3824105\n\tformats.hostname = /^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])(\\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]))*$/;\n\t\n\tmodule.exports = formats;\n\n/***/ },\n/* 25 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\t// Reference: https://github.com/bestiejs/punycode.js/blob/master/punycode.js#L101`\n\t// Info: https://mathiasbynens.be/notes/javascript-unicode\n\tfunction ucs2length(string) {\n\t var ucs2len = 0,\n\t counter = 0,\n\t length = string.length,\n\t value, extra;\n\t\n\t while (counter < length) {\n\t ucs2len++;\n\t value = string.charCodeAt(counter++);\n\t\n\t if (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t // It's a high surrogate, and there is a next character.\n\t extra = string.charCodeAt(counter++);\n\t\n\t if ((extra & 0xFC00) !== 0xDC00) { /* Low surrogate. */ // jshint ignore: line\n\t counter--;\n\t }\n\t }\n\t }\n\t\n\t return ucs2len;\n\t}\n\t\n\tmodule.exports = ucs2length;\n\n/***/ }\n/******/ ])\n});\n;\n//# sourceMappingURL=models.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/powerbi-models/dist/models.js\n// module id = 5\n// module chunks = 0","import { IFilterable } from './ifilterable';\r\nimport { IReportNode } from './report';\r\nimport * as models from 'powerbi-models';\r\n\r\n/**\r\n * A Page node within a report hierarchy\r\n * \r\n * @export\r\n * @interface IPageNode\r\n */\r\nexport interface IPageNode {\r\n report: IReportNode;\r\n name: string;\r\n}\r\n\r\n/**\r\n * A Power BI report page\r\n * \r\n * @export\r\n * @class Page\r\n * @implements {IPageNode}\r\n * @implements {IFilterable}\r\n */\r\nexport class Page implements IPageNode, IFilterable {\r\n /**\r\n * The parent Power BI report that this page is a member of\r\n * \r\n * @type {IReportNode}\r\n */\r\n report: IReportNode;\r\n /**\r\n * The report page name\r\n * \r\n * @type {string}\r\n */\r\n name: string;\r\n\r\n /**\r\n * The user defined display name of the report page, which is undefined if the page is created manually\r\n * \r\n * @type {string}\r\n */\r\n displayName: string;\r\n\r\n /**\r\n * Creates an instance of a Power BI report page.\r\n * \r\n * @param {IReportNode} report\r\n * @param {string} name\r\n * @param {string} [displayName]\r\n */\r\n constructor(report: IReportNode, name: string, displayName?: string) {\r\n this.report = report;\r\n this.name = name;\r\n this.displayName = displayName;\r\n }\r\n\r\n /**\r\n * Gets all page level filters within the report.\r\n * \r\n * ```javascript\r\n * page.getFilters()\r\n * .then(pages => { ... });\r\n * ```\r\n * \r\n * @returns {(Promise)}\r\n */\r\n getFilters(): Promise {\r\n return this.report.service.hpm.get(`/report/pages/${this.name}/filters`, { uid: this.report.config.uniqueId }, this.report.iframe.contentWindow)\r\n .then(response => response.body,\r\n response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Removes all filters from this page of the report.\r\n * \r\n * ```javascript\r\n * page.removeFilters();\r\n * ```\r\n * \r\n * @returns {Promise}\r\n */\r\n removeFilters(): Promise {\r\n return this.setFilters([]);\r\n }\r\n\r\n /**\r\n * Makes the current page the active page of the report.\r\n * \r\n * ```javascripot\r\n * page.setActive();\r\n * ```\r\n * \r\n * @returns {Promise}\r\n */\r\n setActive(): Promise {\r\n const page: models.IPage = {\r\n name: this.name,\r\n displayName: null\r\n };\r\n\r\n return this.report.service.hpm.put('/report/pages/active', page, { uid: this.report.config.uniqueId }, this.report.iframe.contentWindow)\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Sets all filters on the current page.\r\n * \r\n * ```javascript\r\n * page.setFilters(filters);\r\n * .catch(errors => { ... });\r\n * ```\r\n * \r\n * @param {(models.IFilter[])} filters\r\n * @returns {Promise}\r\n */\r\n setFilters(filters: models.IFilter[]): Promise {\r\n return this.report.service.hpm.put(`/report/pages/${this.name}/filters`, filters, { uid: this.report.config.uniqueId }, this.report.iframe.contentWindow)\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/page.ts","import * as service from './service';\r\nimport * as models from 'powerbi-models';\r\nimport * as embed from './embed';\r\n\r\nexport class Create extends embed.Embed {\r\n\r\n constructor(service: service.Service, element: HTMLElement, config: embed.IEmbedConfiguration) {\r\n super(service, element, config);\r\n }\r\n\r\n /**\r\n * Gets the dataset ID from the first available location: createConfig or embed url.\r\n * \r\n * @returns {string}\r\n */\r\n getId(): string {\r\n const datasetId = (this.createConfig && this.createConfig.datasetId) ? this.createConfig.datasetId : Create.findIdFromEmbedUrl(this.config.embedUrl);\r\n\r\n if (typeof datasetId !== 'string' || datasetId.length === 0) {\r\n throw new Error('Dataset id is required, but it was not found. You must provide an id either as part of embed configuration.');\r\n }\r\n\r\n return datasetId;\r\n }\r\n\r\n /**\r\n * Validate create report configuration.\r\n */\r\n validate(config: models.IReportCreateConfiguration): models.IError[] {\r\n return models.validateCreateReport(config);\r\n }\r\n\r\n /**\r\n * Adds the ability to get datasetId from url. \r\n * (e.g. http://embedded.powerbi.com/appTokenReportEmbed?datasetId=854846ed-2106-4dc2-bc58-eb77533bf2f1).\r\n * \r\n * By extracting the ID we can ensure that the ID is always explicitly provided as part of the create configuration.\r\n * \r\n * @static\r\n * @param {string} url\r\n * @returns {string}\r\n */\r\n static findIdFromEmbedUrl(url: string): string {\r\n const datasetIdRegEx = /datasetId=\"?([^&]+)\"?/\r\n const datasetIdMatch = url.match(datasetIdRegEx);\r\n\r\n let datasetId;\r\n if (datasetIdMatch) {\r\n datasetId = datasetIdMatch[1];\r\n }\r\n\r\n return datasetId;\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/create.ts","import * as service from './service';\r\nimport * as embed from './embed';\r\nimport * as models from 'powerbi-models';\r\nimport * as wpmp from 'window-post-message-proxy';\r\nimport * as hpm from 'http-post-message';\r\nimport * as utils from './util';\r\n\r\n/**\r\n * A Dashboard node within a dashboard hierarchy\r\n * \r\n * @export\r\n * @interface IDashboardNode\r\n */\r\nexport interface IDashboardNode {\r\n iframe: HTMLIFrameElement;\r\n service: service.IService;\r\n config: embed.IInternalEmbedConfiguration\r\n}\r\n\r\n/**\r\n * A Power BI Dashboard embed component\r\n * \r\n * @export\r\n * @class Dashboard\r\n * @extends {embed.Embed}\r\n * @implements {IDashboardNode}\r\n * @implements {IFilterable}\r\n */\r\nexport class Dashboard extends embed.Embed implements IDashboardNode {\r\n static allowedEvents = [\"tileClicked\", \"error\"];\r\n static dashboardIdAttribute = 'powerbi-dashboard-id';\r\n static typeAttribute = 'powerbi-type';\r\n static type = \"Dashboard\";\r\n\r\n /**\r\n * Creates an instance of a Power BI Dashboard.\r\n * \r\n * @param {service.Service} service\r\n * @param {HTMLElement} element\r\n */\r\n constructor(service: service.Service, element: HTMLElement, config: embed.IEmbedConfiguration) {\r\n super(service, element, config);\r\n this.loadPath = \"/dashboard/load\";\r\n Array.prototype.push.apply(this.allowedEvents, Dashboard.allowedEvents);\r\n }\r\n\r\n /**\r\n * This adds backwards compatibility for older config which used the dashboardId query param to specify dashboard id.\r\n * E.g. https://powerbi-df.analysis-df.windows.net/dashboardEmbedHost?dashboardId=e9363c62-edb6-4eac-92d3-2199c5ca2a9e\r\n * \r\n * By extracting the id we can ensure id is always explicitly provided as part of the load configuration.\r\n * \r\n * @static\r\n * @param {string} url\r\n * @returns {string}\r\n */\r\n static findIdFromEmbedUrl(url: string): string {\r\n const dashboardIdRegEx = /dashboardId=\"?([^&]+)\"?/\r\n const dashboardIdMatch = url.match(dashboardIdRegEx);\r\n\r\n let dashboardId;\r\n if (dashboardIdMatch) {\r\n dashboardId = dashboardIdMatch[1];\r\n }\r\n\r\n return dashboardId;\r\n }\r\n\r\n /**\r\n * Get dashboard id from first available location: options, attribute, embed url.\r\n * \r\n * @returns {string}\r\n */\r\n getId(): string {\r\n const dashboardId = this.config.id || this.element.getAttribute(Dashboard.dashboardIdAttribute) || Dashboard.findIdFromEmbedUrl(this.config.embedUrl);\r\n\r\n if (typeof dashboardId !== 'string' || dashboardId.length === 0) {\r\n throw new Error(`Dashboard id is required, but it was not found. You must provide an id either as part of embed configuration or as attribute '${Dashboard.dashboardIdAttribute}'.`);\r\n }\r\n\r\n return dashboardId;\r\n }\r\n\r\n /**\r\n * Validate load configuration.\r\n */\r\n validate(config: models.IDashboardLoadConfiguration): models.IError[] {\r\n let error = models.validateDashboardLoad(config);\r\n return error ? error : this.ValidatePageView(config.pageView);\r\n }\r\n \r\n /**\r\n * Validate that pageView has a legal value: if page view is defined it must have one of the values defined in models.PageView\r\n */\r\n private ValidatePageView(pageView: models.PageView): models.IError[] {\r\n if (pageView && pageView !== \"fitToWidth\" && pageView !== \"oneColumn\" && pageView !== \"actualSize\") {\r\n return [{message: \"pageView must be one of the followings: fitToWidth, oneColumn, actualSize\"}];\r\n }\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/dashboard.ts","import * as models from 'powerbi-models';\r\nimport { Embed } from './embed';\r\n\r\n/**\r\n * The Power BI tile embed component\r\n * \r\n * @export\r\n * @class Tile\r\n * @extends {Embed}\r\n */\r\nexport class Tile extends Embed {\r\n static type = \"Tile\";\r\n\r\n /**\r\n * The ID of the tile\r\n * \r\n * @returns {string}\r\n */\r\n getId(): string {\r\n throw new Error('Not implemented. Embedding tiles is not supported yet.');\r\n }\r\n\r\n /**\r\n * Validate load configuration.\r\n */\r\n validate(config: any): models.IError[] {\r\n throw new Error('Not implemented. Embedding tiles is not supported yet.');\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/tile.ts","/**\r\n * TODO: Need to find better place for these factory functions or refactor how we handle dependency injection\r\n */\r\nimport { IHpmFactory, IWpmpFactory, IRouterFactory } from './service';\r\nimport config from './config';\r\nimport * as wpmp from 'window-post-message-proxy';\r\nimport * as hpm from 'http-post-message';\r\nimport * as router from 'powerbi-router';\r\n\r\nexport {\r\n IHpmFactory,\r\n IWpmpFactory,\r\n IRouterFactory\r\n};\r\n\r\nexport const hpmFactory: IHpmFactory = (wpmp, defaultTargetWindow, sdkVersion = config.version, sdkType = config.type) => {\r\n return new hpm.HttpPostMessage(wpmp, {\r\n 'x-sdk-type': sdkType,\r\n 'x-sdk-version': sdkVersion\r\n }, defaultTargetWindow);\r\n};\r\n\r\nexport const wpmpFactory: IWpmpFactory = (name?: string, logMessages?: boolean, eventSourceOverrideWindow?: Window) => {\r\n return new wpmp.WindowPostMessageProxy({\r\n processTrackingProperties: {\r\n addTrackingProperties: hpm.HttpPostMessage.addTrackingProperties,\r\n getTrackingProperties: hpm.HttpPostMessage.getTrackingProperties,\r\n },\r\n isErrorMessage: hpm.HttpPostMessage.isErrorMessage,\r\n name,\r\n logMessages,\r\n eventSourceOverrideWindow\r\n });\r\n};\r\n\r\nexport const routerFactory: IRouterFactory = (wpmp) => {\r\n return new router.Router(wpmp);\r\n};\n\n\n// WEBPACK FOOTER //\n// ./src/factories.ts","const config = {\r\n version: '2.2.3',\r\n type: 'js'\r\n};\r\n\r\nexport default config;\n\n\n// WEBPACK FOOTER //\n// ./src/config.ts","/*! window-post-message-proxy v0.2.4 | (c) 2016 Microsoft Corporation MIT */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"window-post-message-proxy\"] = factory();\n\telse\n\t\troot[\"window-post-message-proxy\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\tvar WindowPostMessageProxy = (function () {\n\t function WindowPostMessageProxy(options) {\n\t var _this = this;\n\t if (options === void 0) { options = {\n\t processTrackingProperties: {\n\t addTrackingProperties: WindowPostMessageProxy.defaultAddTrackingProperties,\n\t getTrackingProperties: WindowPostMessageProxy.defaultGetTrackingProperties\n\t },\n\t isErrorMessage: WindowPostMessageProxy.defaultIsErrorMessage,\n\t receiveWindow: window,\n\t name: WindowPostMessageProxy.createRandomString()\n\t }; }\n\t this.pendingRequestPromises = {};\n\t // save options with defaults\n\t this.addTrackingProperties = (options.processTrackingProperties && options.processTrackingProperties.addTrackingProperties) || WindowPostMessageProxy.defaultAddTrackingProperties;\n\t this.getTrackingProperties = (options.processTrackingProperties && options.processTrackingProperties.getTrackingProperties) || WindowPostMessageProxy.defaultGetTrackingProperties;\n\t this.isErrorMessage = options.isErrorMessage || WindowPostMessageProxy.defaultIsErrorMessage;\n\t this.receiveWindow = options.receiveWindow || window;\n\t this.name = options.name || WindowPostMessageProxy.createRandomString();\n\t this.logMessages = options.logMessages || false;\n\t this.eventSourceOverrideWindow = options.eventSourceOverrideWindow;\n\t this.suppressWarnings = options.suppressWarnings || false;\n\t if (this.logMessages) {\n\t console.log(\"new WindowPostMessageProxy created with name: \" + this.name + \" receiving on window: \" + this.receiveWindow.document.title);\n\t }\n\t // Initialize\n\t this.handlers = [];\n\t this.windowMessageHandler = function (event) { return _this.onMessageReceived(event); };\n\t this.start();\n\t }\n\t // Static\n\t WindowPostMessageProxy.defaultAddTrackingProperties = function (message, trackingProperties) {\n\t message[WindowPostMessageProxy.messagePropertyName] = trackingProperties;\n\t return message;\n\t };\n\t WindowPostMessageProxy.defaultGetTrackingProperties = function (message) {\n\t return message[WindowPostMessageProxy.messagePropertyName];\n\t };\n\t WindowPostMessageProxy.defaultIsErrorMessage = function (message) {\n\t return !!message.error;\n\t };\n\t /**\n\t * Utility to create a deferred object.\n\t */\n\t // TODO: Look to use RSVP library instead of doing this manually.\n\t // From what I searched RSVP would work better because it has .finally and .deferred; however, it doesn't have Typings information. \n\t WindowPostMessageProxy.createDeferred = function () {\n\t var deferred = {\n\t resolve: null,\n\t reject: null,\n\t promise: null\n\t };\n\t var promise = new Promise(function (resolve, reject) {\n\t deferred.resolve = resolve;\n\t deferred.reject = reject;\n\t });\n\t deferred.promise = promise;\n\t return deferred;\n\t };\n\t /**\n\t * Utility to generate random sequence of characters used as tracking id for promises.\n\t */\n\t WindowPostMessageProxy.createRandomString = function () {\n\t return (Math.random() + 1).toString(36).substring(7);\n\t };\n\t /**\n\t * Adds handler.\n\t * If the first handler whose test method returns true will handle the message and provide a response.\n\t */\n\t WindowPostMessageProxy.prototype.addHandler = function (handler) {\n\t this.handlers.push(handler);\n\t };\n\t /**\n\t * Removes handler.\n\t * The reference must match the original object that was provided when adding the handler.\n\t */\n\t WindowPostMessageProxy.prototype.removeHandler = function (handler) {\n\t var handlerIndex = this.handlers.indexOf(handler);\n\t if (handlerIndex === -1) {\n\t throw new Error(\"You attempted to remove a handler but no matching handler was found.\");\n\t }\n\t this.handlers.splice(handlerIndex, 1);\n\t };\n\t /**\n\t * Start listening to message events.\n\t */\n\t WindowPostMessageProxy.prototype.start = function () {\n\t this.receiveWindow.addEventListener('message', this.windowMessageHandler);\n\t };\n\t /**\n\t * Stops listening to message events.\n\t */\n\t WindowPostMessageProxy.prototype.stop = function () {\n\t this.receiveWindow.removeEventListener('message', this.windowMessageHandler);\n\t };\n\t /**\n\t * Post message to target window with tracking properties added and save deferred object referenced by tracking id.\n\t */\n\t WindowPostMessageProxy.prototype.postMessage = function (targetWindow, message) {\n\t // Add tracking properties to indicate message came from this proxy\n\t var trackingProperties = { id: WindowPostMessageProxy.createRandomString() };\n\t this.addTrackingProperties(message, trackingProperties);\n\t if (this.logMessages) {\n\t console.log(this.name + \" Posting message:\");\n\t console.log(JSON.stringify(message, null, ' '));\n\t }\n\t targetWindow.postMessage(message, \"*\");\n\t var deferred = WindowPostMessageProxy.createDeferred();\n\t this.pendingRequestPromises[trackingProperties.id] = deferred;\n\t return deferred.promise;\n\t };\n\t /**\n\t * Send response message to target window.\n\t * Response messages re-use tracking properties from a previous request message.\n\t */\n\t WindowPostMessageProxy.prototype.sendResponse = function (targetWindow, message, trackingProperties) {\n\t this.addTrackingProperties(message, trackingProperties);\n\t if (this.logMessages) {\n\t console.log(this.name + \" Sending response:\");\n\t console.log(JSON.stringify(message, null, ' '));\n\t }\n\t targetWindow.postMessage(message, \"*\");\n\t };\n\t /**\n\t * Message handler.\n\t */\n\t WindowPostMessageProxy.prototype.onMessageReceived = function (event) {\n\t var _this = this;\n\t if (this.logMessages) {\n\t console.log(this.name + \" Received message:\");\n\t console.log(\"type: \" + event.type);\n\t console.log(JSON.stringify(event.data, null, ' '));\n\t }\n\t var sendingWindow = this.eventSourceOverrideWindow || event.source;\n\t var message = event.data;\n\t if (typeof message !== \"object\") {\n\t if (!this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + this.name + \"): Received message that was not an object. Discarding message\");\n\t }\n\t return;\n\t }\n\t var trackingProperties;\n\t try {\n\t trackingProperties = this.getTrackingProperties(message);\n\t }\n\t catch (e) {\n\t if (!this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + this.name + \"): Error occurred when attempting to get tracking properties from incoming message:\", JSON.stringify(message, null, ' '), \"Error: \", e);\n\t }\n\t }\n\t var deferred;\n\t if (trackingProperties) {\n\t deferred = this.pendingRequestPromises[trackingProperties.id];\n\t }\n\t // If message does not have a known ID, treat it as a request\n\t // Otherwise, treat message as response\n\t if (!deferred) {\n\t var handled = this.handlers.some(function (handler) {\n\t var canMessageBeHandled = false;\n\t try {\n\t canMessageBeHandled = handler.test(message);\n\t }\n\t catch (e) {\n\t if (!_this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + _this.name + \"): Error occurred when handler was testing incoming message:\", JSON.stringify(message, null, ' '), \"Error: \", e);\n\t }\n\t }\n\t if (canMessageBeHandled) {\n\t var responseMessagePromise = void 0;\n\t try {\n\t responseMessagePromise = Promise.resolve(handler.handle(message));\n\t }\n\t catch (e) {\n\t if (!_this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + _this.name + \"): Error occurred when handler was processing incoming message:\", JSON.stringify(message, null, ' '), \"Error: \", e);\n\t }\n\t responseMessagePromise = Promise.resolve();\n\t }\n\t responseMessagePromise\n\t .then(function (responseMessage) {\n\t if (!responseMessage) {\n\t var warningMessage = \"Handler for message: \" + JSON.stringify(message, null, ' ') + \" did not return a response message. The default response message will be returned instead.\";\n\t if (!_this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + _this.name + \"): \" + warningMessage);\n\t }\n\t responseMessage = {\n\t warning: warningMessage\n\t };\n\t }\n\t _this.sendResponse(sendingWindow, responseMessage, trackingProperties);\n\t });\n\t return true;\n\t }\n\t });\n\t /**\n\t * TODO: Consider returning an error message if nothing handled the message.\n\t * In the case of the Report receiving messages all of them should be handled,\n\t * however, in the case of the SDK receiving messages it's likely it won't register handlers\n\t * for all events. Perhaps make this an option at construction time.\n\t */\n\t if (!handled && !this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + this.name + \") did not handle message. Handlers: \" + this.handlers.length + \" Message: \" + JSON.stringify(message, null, '') + \".\");\n\t }\n\t }\n\t else {\n\t /**\n\t * If error message reject promise,\n\t * Otherwise, resolve promise\n\t */\n\t var isErrorMessage = true;\n\t try {\n\t isErrorMessage = this.isErrorMessage(message);\n\t }\n\t catch (e) {\n\t console.warn(\"Proxy(\" + this.name + \") Error occurred when trying to determine if message is consider an error response. Message: \", JSON.stringify(message, null, ''), 'Error: ', e);\n\t }\n\t if (isErrorMessage) {\n\t deferred.reject(message);\n\t }\n\t else {\n\t deferred.resolve(message);\n\t }\n\t // TODO: Move to .finally clause up where promise is created for better maitenance like original proxy code.\n\t delete this.pendingRequestPromises[trackingProperties.id];\n\t }\n\t };\n\t WindowPostMessageProxy.messagePropertyName = \"windowPostMessageProxy\";\n\t return WindowPostMessageProxy;\n\t}());\n\texports.WindowPostMessageProxy = WindowPostMessageProxy;\n\n\n/***/ }\n/******/ ])\n});\n;\n//# sourceMappingURL=windowPostMessageProxy.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/window-post-message-proxy/dist/windowPostMessageProxy.js\n// module id = 12\n// module chunks = 0","/*! http-post-message v0.2.3 | (c) 2016 Microsoft Corporation MIT */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"http-post-message\"] = factory();\n\telse\n\t\troot[\"http-post-message\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\tvar HttpPostMessage = (function () {\n\t function HttpPostMessage(windowPostMessageProxy, defaultHeaders, defaultTargetWindow) {\n\t if (defaultHeaders === void 0) { defaultHeaders = {}; }\n\t this.defaultHeaders = defaultHeaders;\n\t this.defaultTargetWindow = defaultTargetWindow;\n\t this.windowPostMessageProxy = windowPostMessageProxy;\n\t }\n\t // TODO: See if it's possible to share tracking properties interface?\n\t // The responsibility of knowing how to configure windowPostMessageProxy for http should\n\t // live in this http class, but the configuration would need ITrackingProperties\n\t // interface which lives in WindowPostMessageProxy. Use type as workaround\n\t HttpPostMessage.addTrackingProperties = function (message, trackingProperties) {\n\t message.headers = message.headers || {};\n\t if (trackingProperties && trackingProperties.id) {\n\t message.headers.id = trackingProperties.id;\n\t }\n\t return message;\n\t };\n\t HttpPostMessage.getTrackingProperties = function (message) {\n\t return {\n\t id: message.headers && message.headers.id\n\t };\n\t };\n\t HttpPostMessage.isErrorMessage = function (message) {\n\t if (typeof (message && message.statusCode) !== 'number') {\n\t return false;\n\t }\n\t return !(200 <= message.statusCode && message.statusCode < 300);\n\t };\n\t HttpPostMessage.prototype.get = function (url, headers, targetWindow) {\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"GET\",\n\t url: url,\n\t headers: headers\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.post = function (url, body, headers, targetWindow) {\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"POST\",\n\t url: url,\n\t headers: headers,\n\t body: body\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.put = function (url, body, headers, targetWindow) {\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"PUT\",\n\t url: url,\n\t headers: headers,\n\t body: body\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.patch = function (url, body, headers, targetWindow) {\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"PATCH\",\n\t url: url,\n\t headers: headers,\n\t body: body\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.delete = function (url, body, headers, targetWindow) {\n\t if (body === void 0) { body = null; }\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"DELETE\",\n\t url: url,\n\t headers: headers,\n\t body: body\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.send = function (request, targetWindow) {\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t request.headers = this.assign({}, this.defaultHeaders, request.headers);\n\t if (!targetWindow) {\n\t throw new Error(\"target window is not provided. You must either provide the target window explicitly as argument to request, or specify default target window when constructing instance of this class.\");\n\t }\n\t return this.windowPostMessageProxy.postMessage(targetWindow, request);\n\t };\n\t /**\n\t * Object.assign() polyfill\n\t * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\n\t */\n\t HttpPostMessage.prototype.assign = function (target) {\n\t var sources = [];\n\t for (var _i = 1; _i < arguments.length; _i++) {\n\t sources[_i - 1] = arguments[_i];\n\t }\n\t if (target === undefined || target === null) {\n\t throw new TypeError('Cannot convert undefined or null to object');\n\t }\n\t var output = Object(target);\n\t sources.forEach(function (source) {\n\t if (source !== undefined && source !== null) {\n\t for (var nextKey in source) {\n\t if (Object.prototype.hasOwnProperty.call(source, nextKey)) {\n\t output[nextKey] = source[nextKey];\n\t }\n\t }\n\t }\n\t });\n\t return output;\n\t };\n\t return HttpPostMessage;\n\t}());\n\texports.HttpPostMessage = HttpPostMessage;\n\n\n/***/ }\n/******/ ])\n});\n;\n//# sourceMappingURL=httpPostMessage.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/http-post-message/dist/httpPostMessage.js\n// module id = 13\n// module chunks = 0","/*! powerbi-router v0.1.5 | (c) 2016 Microsoft Corporation MIT */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"powerbi-router\"] = factory();\n\telse\n\t\troot[\"powerbi-router\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar RouteRecognizer = __webpack_require__(1);\n\tvar Router = (function () {\n\t function Router(handlers) {\n\t this.handlers = handlers;\n\t /**\n\t * TODO: look at generating the router dynamically based on list of supported http methods\n\t * instead of hardcoding the creation of these and the methods.\n\t */\n\t this.getRouteRecognizer = new RouteRecognizer();\n\t this.patchRouteRecognizer = new RouteRecognizer();\n\t this.postRouteRecognizer = new RouteRecognizer();\n\t this.putRouteRecognizer = new RouteRecognizer();\n\t this.deleteRouteRecognizer = new RouteRecognizer();\n\t }\n\t Router.prototype.get = function (url, handler) {\n\t this.registerHandler(this.getRouteRecognizer, \"GET\", url, handler);\n\t return this;\n\t };\n\t Router.prototype.patch = function (url, handler) {\n\t this.registerHandler(this.patchRouteRecognizer, \"PATCH\", url, handler);\n\t return this;\n\t };\n\t Router.prototype.post = function (url, handler) {\n\t this.registerHandler(this.postRouteRecognizer, \"POST\", url, handler);\n\t return this;\n\t };\n\t Router.prototype.put = function (url, handler) {\n\t this.registerHandler(this.putRouteRecognizer, \"PUT\", url, handler);\n\t return this;\n\t };\n\t Router.prototype.delete = function (url, handler) {\n\t this.registerHandler(this.deleteRouteRecognizer, \"DELETE\", url, handler);\n\t return this;\n\t };\n\t /**\n\t * TODO: This method could use some refactoring. There is conflict of interest between keeping clean separation of test and handle method\n\t * Test method only returns boolean indicating if request can be handled, and handle method has opportunity to modify response and return promise of it.\n\t * In the case of the router with route-recognizer where handlers are associated with routes, this already guarantees that only one handler is selected and makes the test method feel complicated\n\t * Will leave as is an investigate cleaner ways at later time.\n\t */\n\t Router.prototype.registerHandler = function (routeRecognizer, method, url, handler) {\n\t var routeRecognizerHandler = function (request) {\n\t var response = new Response();\n\t return Promise.resolve(handler(request, response))\n\t .then(function (x) { return response; });\n\t };\n\t routeRecognizer.add([\n\t { path: url, handler: routeRecognizerHandler }\n\t ]);\n\t var internalHandler = {\n\t test: function (request) {\n\t if (request.method !== method) {\n\t return false;\n\t }\n\t var matchingRoutes = routeRecognizer.recognize(request.url);\n\t if (matchingRoutes === undefined) {\n\t return false;\n\t }\n\t /**\n\t * Copy parameters from recognized route to the request so they can be used within the handler function\n\t * This isn't ideal because it is side affect which modifies the request instead of strictly testing for true or false\n\t * but I don't see a better place to put this. If we move it between the call to test and the handle it becomes part of the window post message proxy\n\t * even though it's responsibility is related to routing.\n\t */\n\t var route = matchingRoutes[0];\n\t request.params = route.params;\n\t request.queryParams = matchingRoutes.queryParams;\n\t request.handler = route.handler;\n\t return true;\n\t },\n\t handle: function (request) {\n\t return request.handler(request);\n\t }\n\t };\n\t this.handlers.addHandler(internalHandler);\n\t };\n\t return Router;\n\t}());\n\texports.Router = Router;\n\tvar Response = (function () {\n\t function Response() {\n\t this.statusCode = 200;\n\t this.headers = {};\n\t this.body = null;\n\t }\n\t Response.prototype.send = function (statusCode, body) {\n\t this.statusCode = statusCode;\n\t this.body = body;\n\t };\n\t return Response;\n\t}());\n\texports.Response = Response;\n\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(module) {(function() {\n\t \"use strict\";\n\t function $$route$recognizer$dsl$$Target(path, matcher, delegate) {\n\t this.path = path;\n\t this.matcher = matcher;\n\t this.delegate = delegate;\n\t }\n\t\n\t $$route$recognizer$dsl$$Target.prototype = {\n\t to: function(target, callback) {\n\t var delegate = this.delegate;\n\t\n\t if (delegate && delegate.willAddRoute) {\n\t target = delegate.willAddRoute(this.matcher.target, target);\n\t }\n\t\n\t this.matcher.add(this.path, target);\n\t\n\t if (callback) {\n\t if (callback.length === 0) { throw new Error(\"You must have an argument in the function passed to `to`\"); }\n\t this.matcher.addChild(this.path, target, callback, this.delegate);\n\t }\n\t return this;\n\t }\n\t };\n\t\n\t function $$route$recognizer$dsl$$Matcher(target) {\n\t this.routes = {};\n\t this.children = {};\n\t this.target = target;\n\t }\n\t\n\t $$route$recognizer$dsl$$Matcher.prototype = {\n\t add: function(path, handler) {\n\t this.routes[path] = handler;\n\t },\n\t\n\t addChild: function(path, target, callback, delegate) {\n\t var matcher = new $$route$recognizer$dsl$$Matcher(target);\n\t this.children[path] = matcher;\n\t\n\t var match = $$route$recognizer$dsl$$generateMatch(path, matcher, delegate);\n\t\n\t if (delegate && delegate.contextEntered) {\n\t delegate.contextEntered(target, match);\n\t }\n\t\n\t callback(match);\n\t }\n\t };\n\t\n\t function $$route$recognizer$dsl$$generateMatch(startingPath, matcher, delegate) {\n\t return function(path, nestedCallback) {\n\t var fullPath = startingPath + path;\n\t\n\t if (nestedCallback) {\n\t nestedCallback($$route$recognizer$dsl$$generateMatch(fullPath, matcher, delegate));\n\t } else {\n\t return new $$route$recognizer$dsl$$Target(startingPath + path, matcher, delegate);\n\t }\n\t };\n\t }\n\t\n\t function $$route$recognizer$dsl$$addRoute(routeArray, path, handler) {\n\t var len = 0;\n\t for (var i=0; i z`. For instance, \"199\" is smaller\n\t // then \"200\", even though \"y\" and \"z\" (which are both 9) are larger than \"0\" (the value\n\t // of (`b` and `c`). This is because the leading symbol, \"2\", is larger than the other\n\t // leading symbol, \"1\".\n\t // The rule is that symbols to the left carry more weight than symbols to the right\n\t // when a number is written out as a string. In the above strings, the leading digit\n\t // represents how many 100's are in the number, and it carries more weight than the middle\n\t // number which represents how many 10's are in the number.\n\t // This system of number magnitude works well for route specificity, too. A route written as\n\t // `a/b/c` will be more specific than `x/y/z` as long as `a` is more specific than\n\t // `x`, irrespective of the other parts.\n\t // Because of this similarity, we assign each type of segment a number value written as a\n\t // string. We can find the specificity of compound routes by concatenating these strings\n\t // together, from left to right. After we have looped through all of the segments,\n\t // we convert the string to a number.\n\t specificity.val = '';\n\t\n\t for (var i=0; i 2 && key.slice(keyLength -2) === '[]') {\n\t isArray = true;\n\t key = key.slice(0, keyLength - 2);\n\t if(!queryParams[key]) {\n\t queryParams[key] = [];\n\t }\n\t }\n\t value = pair[1] ? $$route$recognizer$$decodeQueryParamPart(pair[1]) : '';\n\t }\n\t if (isArray) {\n\t queryParams[key].push(value);\n\t } else {\n\t queryParams[key] = value;\n\t }\n\t }\n\t return queryParams;\n\t },\n\t\n\t recognize: function(path) {\n\t var states = [ this.rootState ],\n\t pathLen, i, l, queryStart, queryParams = {},\n\t isSlashDropped = false;\n\t\n\t queryStart = path.indexOf('?');\n\t if (queryStart !== -1) {\n\t var queryString = path.substr(queryStart + 1, path.length);\n\t path = path.substr(0, queryStart);\n\t queryParams = this.parseQueryString(queryString);\n\t }\n\t\n\t path = decodeURI(path);\n\t\n\t if (path.charAt(0) !== \"/\") { path = \"/\" + path; }\n\t\n\t pathLen = path.length;\n\t if (pathLen > 1 && path.charAt(pathLen - 1) === \"/\") {\n\t path = path.substr(0, pathLen - 1);\n\t isSlashDropped = true;\n\t }\n\t\n\t for (i=0; i {\n type: string;\n id: string;\n name: string;\n value: T;\n}\n\nexport interface ICustomEvent extends CustomEvent {\n detail: T;\n}\n\nexport interface IEventHandler {\n (event: ICustomEvent): any;\n}\n\nexport interface IHpmFactory {\n (wpmp: wpmp.WindowPostMessageProxy, targetWindow?: Window, version?: string, type?: string, origin?: string): hpm.HttpPostMessage;\n}\n\nexport interface IWpmpFactory {\n (name?: string, logMessages?: boolean, eventSourceOverrideWindow?: Window): wpmp.WindowPostMessageProxy;\n}\n\nexport interface IRouterFactory {\n (wpmp: wpmp.WindowPostMessageProxy): router.Router;\n}\n\nexport interface IPowerBiElement extends HTMLElement {\n powerBiEmbed: embed.Embed;\n}\n\nexport interface IDebugOptions {\n logMessages?: boolean;\n wpmpName?: string;\n}\n\nexport interface IServiceConfiguration extends IDebugOptions {\n autoEmbedOnContentLoaded?: boolean;\n onError?: (error: any) => any;\n version?: string;\n type?: string;\n}\n\nexport interface IService {\n hpm: hpm.HttpPostMessage;\n}\n\n/**\n * The Power BI Service embed component, which is the entry point to embed all other Power BI components into your application\n * \n * @export\n * @class Service\n * @implements {IService}\n */\nexport class Service implements IService {\n\n /**\n * A list of components that this service can embed\n */\n private static components: (typeof Report | typeof Tile | typeof Dashboard)[] = [\n Tile,\n Report,\n Dashboard\n ];\n\n /**\n * The default configuration for the service\n */\n private static defaultConfig: IServiceConfiguration = {\n autoEmbedOnContentLoaded: false,\n onError: (...args) => console.log(args[0], args.slice(1))\n };\n\n /**\n * Gets or sets the access token as the global fallback token to use when a local token is not provided for a report or tile.\n * \n * @type {string}\n */\n accessToken: string;\n\n /**The Configuration object for the service*/\n private config: IServiceConfiguration;\n\n /** A list of Dashboard, Report and Tile components that have been embedded using this service instance. */\n private embeds: embed.Embed[];\n /** TODO: Look for way to make hpm private without sacraficing ease of maitenance. This should be private but in embed needs to call methods. */\n hpm: hpm.HttpPostMessage;\n /** TODO: Look for way to make wpmp private. This is only public to allow stopping the wpmp in tests */\n wpmp: wpmp.WindowPostMessageProxy;\n private router: router.Router;\n\n /**\n * Creates an instance of a Power BI Service.\n * \n * @param {IHpmFactory} hpmFactory The http post message factory used in the postMessage communication layer\n * @param {IWpmpFactory} wpmpFactory The window post message factory used in the postMessage communication layer\n * @param {IRouterFactory} routerFactory The router factory used in the postMessage communication layer\n * @param {IServiceConfiguration} [config={}]\n */\n constructor(hpmFactory: IHpmFactory, wpmpFactory: IWpmpFactory, routerFactory: IRouterFactory, config: IServiceConfiguration = {}) {\n this.wpmp = wpmpFactory(config.wpmpName, config.logMessages);\n this.hpm = hpmFactory(this.wpmp, null, config.version, config.type);\n this.router = routerFactory(this.wpmp);\n\n /**\n * Adds handler for report events.\n */\n this.router.post(`/reports/:uniqueId/events/:eventName`, (req, res) => {\n const event: IEvent = {\n type: 'report',\n id: req.params.uniqueId,\n name: req.params.eventName,\n value: req.body\n };\n\n this.handleEvent(event);\n });\n this.router.post(`/reports/:uniqueId/pages/:pageName/events/:eventName`, (req, res) => {\n const event: IEvent = {\n type: 'report',\n id: req.params.uniqueId,\n name: req.params.eventName,\n value: req.body\n };\n\n this.handleEvent(event);\n });\n\n this.router.post(`/dashboards/:uniqueId/events/:eventName`, (req, res) => {\n const event: IEvent = {\n type: 'dashboard',\n id: req.params.uniqueId,\n name: req.params.eventName,\n value: req.body\n };\n\n this.handleEvent(event);\n });\n\n this.embeds = [];\n\n // TODO: Change when Object.assign is available.\n this.config = utils.assign({}, Service.defaultConfig, config);\n\n if (this.config.autoEmbedOnContentLoaded) {\n this.enableAutoEmbed();\n }\n }\n\n /**\n * Creates new report\n * @param {HTMLElement} element\n * @param {embed.IEmbedConfiguration} [config={}]\n * @returns {embed.Embed}\n */\n createReport(element: HTMLElement, config: embed.IEmbedConfiguration): embed.Embed {\n config.type = 'create';\n let powerBiElement = element;\n const component = new Create(this, powerBiElement, config);\n powerBiElement.powerBiEmbed = component;\n this.embeds.push(component);\n\n return component;\n }\n\n /**\n * TODO: Add a description here\n * \n * @param {HTMLElement} [container]\n * @param {embed.IEmbedConfiguration} [config=undefined]\n * @returns {embed.Embed[]}\n */\n init(container?: HTMLElement, config: embed.IEmbedConfiguration = undefined): embed.Embed[] {\n container = (container && container instanceof HTMLElement) ? container : document.body;\n\n const elements = Array.prototype.slice.call(container.querySelectorAll(`[${embed.Embed.embedUrlAttribute}]`));\n return elements.map(element => this.embed(element, config));\n }\n\n /**\n * Given a configuration based on an HTML element,\n * if the component has already been created and attached to the element, reuses the component instance and existing iframe,\n * otherwise creates a new component instance.\n * \n * @param {HTMLElement} element\n * @param {embed.IEmbedConfiguration} [config={}]\n * @returns {embed.Embed}\n */\n embed(element: HTMLElement, config: embed.IEmbedConfiguration = {}): embed.Embed {\n let component: embed.Embed;\n let powerBiElement = element;\n\n if (powerBiElement.powerBiEmbed) {\n component = this.embedExisting(powerBiElement, config);\n }\n else {\n component = this.embedNew(powerBiElement, config);\n }\n\n return component;\n }\n\n /**\n * Given a configuration based on a Power BI element, saves the component instance that reference the element for later lookup.\n * \n * @private\n * @param {IPowerBiElement} element\n * @param {embed.IEmbedConfiguration} config\n * @returns {embed.Embed}\n */\n private embedNew(element: IPowerBiElement, config: embed.IEmbedConfiguration): embed.Embed {\n const componentType = config.type || element.getAttribute(embed.Embed.typeAttribute);\n if (!componentType) {\n throw new Error(`Attempted to embed using config ${JSON.stringify(config)} on element ${element.outerHTML}, but could not determine what type of component to embed. You must specify a type in the configuration or as an attribute such as '${embed.Embed.typeAttribute}=\"${Report.type.toLowerCase()}\"'.`);\n }\n\n // Saves the type as part of the configuration so that it can be referenced later at a known location.\n config.type = componentType;\n\n const Component = utils.find(component => componentType === component.type.toLowerCase(), Service.components);\n if (!Component) {\n throw new Error(`Attempted to embed component of type: ${componentType} but did not find any matching component. Please verify the type you specified is intended.`);\n }\n\n const component = new Component(this, element, config);\n element.powerBiEmbed = component;\n this.embeds.push(component);\n\n return component;\n }\n\n /**\n * Given an element that already contains an embed component, load with a new configuration.\n * \n * @private\n * @param {IPowerBiElement} element\n * @param {embed.IEmbedConfiguration} config\n * @returns {embed.Embed}\n */\n private embedExisting(element: IPowerBiElement, config: embed.IEmbedConfiguration): embed.Embed {\n const component = utils.find(x => x.element === element, this.embeds);\n if (!component) {\n throw new Error(`Attempted to embed using config ${JSON.stringify(config)} on element ${element.outerHTML} which already has embedded comopnent associated, but could not find the existing comopnent in the list of active components. This could indicate the embeds list is out of sync with the DOM, or the component is referencing the incorrect HTML element.`);\n }\n\n /**\n * TODO: Dynamic embed type switching could be supported but there is work needed to prepare the service state and DOM cleanup.\n * remove all event handlers from the DOM, then reset the element to initial state which removes iframe, and removes from list of embeds\n * then we can call the embedNew function which would allow setting the proper embedUrl and construction of object based on the new type.\n */\n if (typeof config.type === \"string\" && config.type !== component.config.type) {\n\n /**\n * When loading report after create we want to use existing Iframe to optimize load period\n */\n if(config.type === \"report\" && component.config.type === \"create\") {\n const report = new Report(this, element, config, element.powerBiEmbed.iframe);\n report.load(config);\n element.powerBiEmbed = report;\n this.embeds.push(report);\n\n return report;\n }\n\n throw new Error(`Embedding on an existing element with a different type than the previous embed object is not supported. Attempted to embed using config ${JSON.stringify(config)} on element ${element.outerHTML}, but the existing element contains an embed of type: ${this.config.type} which does not match the new type: ${config.type}`);\n }\n\n component.load(config);\n\n return component;\n }\n\n /**\n * Adds an event handler for DOMContentLoaded, which searches the DOM for elements that have the 'powerbi-embed-url' attribute,\n * and automatically attempts to embed a powerbi component based on information from other powerbi-* attributes.\n *\n * Note: Only runs if `config.autoEmbedOnContentLoaded` is true when the service is created.\n * This handler is typically useful only for applications that are rendered on the server so that all required data is available when the handler is called.\n */\n enableAutoEmbed(): void {\n window.addEventListener('DOMContentLoaded', (event: Event) => this.init(document.body), false);\n }\n\n /**\n * Returns an instance of the component associated with the element.\n * \n * @param {HTMLElement} element\n * @returns {(Report | Tile)}\n */\n get(element: HTMLElement): Report | Tile | Dashboard {\n const powerBiElement = element;\n\n if (!powerBiElement.powerBiEmbed) {\n throw new Error(`You attempted to get an instance of powerbi component associated with element: ${element.outerHTML} but there was no associated instance.`);\n }\n\n return powerBiElement.powerBiEmbed;\n }\n\n /**\n * Finds an embed instance by the name or unique ID that is provided.\n * \n * @param {string} uniqueId\n * @returns {(Report | Tile)}\n */\n find(uniqueId: string): Report | Tile | Dashboard {\n return utils.find(x => x.config.uniqueId === uniqueId, this.embeds);\n }\n\n /**\n * Given an HTML element that has a component embedded within it, removes the component from the list of embedded components, removes the association between the element and the component, and removes the iframe.\n * \n * @param {HTMLElement} element\n * @returns {void}\n */\n reset(element: HTMLElement): void {\n const powerBiElement = element;\n\n if (!powerBiElement.powerBiEmbed) {\n return;\n }\n\n /** Removes the component from an internal list of components. */\n utils.remove(x => x === powerBiElement.powerBiEmbed, this.embeds);\n /** Deletes a property from the HTML element. */\n delete powerBiElement.powerBiEmbed;\n /** Removes the iframe from the element. */\n const iframe = element.querySelector('iframe');\n if (iframe) {\n iframe.remove();\n }\n }\n\n /**\n * Given an event object, finds the embed component with the matching type and ID, and invokes its handleEvent method with the event object.\n * \n * @private\n * @param {IEvent} event\n */\n private handleEvent(event: IEvent): void {\n const embed = utils.find(embed => {\n return (embed.config.uniqueId === event.id);\n }, this.embeds);\n\n if (embed) {\n const value = event.value;\n\n if (event.name === 'pageChanged') {\n const pageKey = 'newPage';\n const page: models.IPage = value[pageKey];\n if (!page) {\n throw new Error(`Page model not found at 'event.value.${pageKey}'.`);\n }\n value[pageKey] = new Page(embed, page.name, page.displayName);\n }\n\n utils.raiseCustomEvent(embed.element, event.name, value);\n }\n }\n}\n\n\n// WEBPACK FOOTER //\n// ./src/service.ts","import * as utils from './util';\r\nimport * as service from './service';\r\nimport * as models from 'powerbi-models';\r\nimport * as hpm from 'http-post-message';\r\n\r\ndeclare global {\r\n interface Document {\r\n // Mozilla Fullscreen\r\n mozCancelFullScreen: Function;\r\n\r\n // Ms Fullscreen\r\n msExitFullscreen: Function;\r\n }\r\n\r\n interface HTMLIFrameElement {\r\n // Mozilla Fullscreen\r\n mozRequestFullScreen: Function;\r\n\r\n // Ms Fullscreen\r\n msRequestFullscreen: Function;\r\n }\r\n}\r\n\r\n// TODO: Re-use ILoadConfiguration interface to prevent duplicating properties.\r\n// Current issue is that they are optional when embedding since they can be specificed as attributes but they are required when loading.\r\n/**\r\n * Configuration settings for Power BI embed components\r\n * \r\n * @export\r\n * @interface IEmbedConfiguration\r\n */\r\nexport interface IEmbedConfiguration {\r\n type?: string;\r\n id?: string;\r\n uniqueId?: string;\r\n embedUrl?: string;\r\n accessToken?: string;\r\n settings?: models.ISettings;\r\n pageName?: string;\r\n filters?: models.IFilter[];\r\n pageView?: models.PageView;\r\n datasetId?: string;\r\n permissions?: models.Permissions;\r\n viewMode?: models.ViewMode;\r\n}\r\n\r\nexport interface IInternalEmbedConfiguration extends models.IReportLoadConfiguration {\r\n uniqueId: string;\r\n type: string;\r\n embedUrl: string;\r\n}\r\n\r\nexport interface IInternalEventHandler {\r\n test(event: service.IEvent): boolean;\r\n handle(event: service.ICustomEvent): void;\r\n}\r\n\r\n/**\r\n * Base class for all Power BI embed components\r\n * \r\n * @export\r\n * @abstract\r\n * @class Embed\r\n */\r\nexport abstract class Embed {\r\n static allowedEvents = [\"loaded\", \"saved\", \"rendered\", \"saveAsTriggered\", \"error\", \"dataSelected\"];\r\n static accessTokenAttribute = 'powerbi-access-token';\r\n static embedUrlAttribute = 'powerbi-embed-url';\r\n static nameAttribute = 'powerbi-name';\r\n static typeAttribute = 'powerbi-type';\r\n static type: string;\r\n\r\n private static defaultSettings: models.ISettings = {\r\n filterPaneEnabled: true\r\n };\r\n\r\n allowedEvents = [];\r\n\r\n /**\r\n * Gets or sets the event handler registered for this embed component.\r\n * \r\n * @type {IInternalEventHandler[]}\r\n */\r\n eventHandlers: IInternalEventHandler[];\r\n\r\n /**\r\n * Gets or sets the Power BI embed service.\r\n * \r\n * @type {service.Service}\r\n */\r\n service: service.Service;\r\n\r\n /**\r\n * Gets or sets the HTML element that contains the Power BI embed component.\r\n * \r\n * @type {HTMLElement}\r\n */\r\n element: HTMLElement;\r\n\r\n /**\r\n * Gets or sets the HTML iframe element that renders the Power BI embed component.\r\n * \r\n * @type {HTMLIFrameElement}\r\n */\r\n iframe: HTMLIFrameElement;\r\n\r\n /**\r\n * Gets or sets the configuration settings for the Power BI embed component.\r\n * \r\n * @type {IInternalEmbedConfiguration}\r\n */\r\n config: IInternalEmbedConfiguration;\r\n\r\n /**\r\n * Gets or sets the configuration settings for creating report.\r\n * \r\n * @type {models.IReportCreateConfiguration}\r\n */\r\n createConfig: models.IReportCreateConfiguration;\r\n\r\n /**\r\n * Url used in the load request.\r\n */\r\n loadPath: string;\r\n\r\n /**\r\n * Type of embed\r\n */\r\n embeType: string;\r\n\r\n /**\r\n * Creates an instance of Embed.\r\n * \r\n * Note: there is circular reference between embeds and the service, because\r\n * the service has a list of all embeds on the host page, and each embed has a reference to the service that created it.\r\n * \r\n * @param {service.Service} service\r\n * @param {HTMLElement} element\r\n * @param {IEmbedConfiguration} config\r\n */\r\n constructor(service: service.Service, element: HTMLElement, config: IEmbedConfiguration, iframe?: HTMLIFrameElement) {\r\n Array.prototype.push.apply(this.allowedEvents, Embed.allowedEvents);\r\n this.eventHandlers = [];\r\n this.service = service;\r\n this.element = element;\r\n this.iframe = iframe;\r\n this.embeType = config.type.toLowerCase();\r\n\r\n this.populateConfig(config);\r\n \r\n if(this.embeType === 'create'){\r\n this.setIframe(false/*set EventListener to call create() on 'load' event*/);\r\n } else {\r\n this.setIframe(true/*set EventListener to call load() on 'load' event*/);\r\n }\r\n }\r\n\r\n /**\r\n * Sends createReport configuration data.\r\n * \r\n * ```javascript\r\n * createReport({\r\n * datasetId: '5dac7a4a-4452-46b3-99f6-a25915e0fe55',\r\n * accessToken: 'eyJ0eXA ... TaE2rTSbmg',\r\n * ```\r\n * \r\n * @param {models.IReportCreateConfiguration} config\r\n * @returns {Promise}\r\n */\r\n createReport(config: models.IReportCreateConfiguration): Promise {\r\n const errors = this.validate(config);\r\n if (errors) {\r\n throw errors;\r\n }\r\n \r\n return this.service.hpm.post(\"/report/create\", config, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n return response.body;\r\n },\r\n response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Saves Report.\r\n * \r\n * @returns {Promise}\r\n */\r\n save(): Promise {\r\n return this.service.hpm.post('/report/save', null, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n return response.body;\r\n })\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * SaveAs Report.\r\n * \r\n * @returns {Promise}\r\n */\r\n saveAs(saveAsParameters: models.ISaveAsParameters): Promise {\r\n return this.service.hpm.post('/report/saveAs', saveAsParameters, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n return response.body;\r\n })\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Sends load configuration data.\r\n * \r\n * ```javascript\r\n * report.load({\r\n * type: 'report',\r\n * id: '5dac7a4a-4452-46b3-99f6-a25915e0fe55',\r\n * accessToken: 'eyJ0eXA ... TaE2rTSbmg',\r\n * settings: {\r\n * navContentPaneEnabled: false\r\n * },\r\n * pageName: \"DefaultPage\",\r\n * filters: [\r\n * {\r\n * ... DefaultReportFilter ...\r\n * }\r\n * ]\r\n * })\r\n * .catch(error => { ... });\r\n * ```\r\n * \r\n * @param {models.ILoadConfiguration} config\r\n * @returns {Promise}\r\n */\r\n load(config: models.IReportLoadConfiguration | models.IDashboardLoadConfiguration): Promise {\r\n const errors = this.validate(config);\r\n if (errors) {\r\n throw errors;\r\n }\r\n\r\n return this.service.hpm.post(this.loadPath, config, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n utils.assign(this.config, config);\r\n return response.body;\r\n },\r\n response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Removes one or more event handlers from the list of handlers.\r\n * If a reference to the existing handle function is specified, remove the specific handler.\r\n * If the handler is not specified, remove all handlers for the event name specified.\r\n * \r\n * ```javascript\r\n * report.off('pageChanged')\r\n * \r\n * or \r\n * \r\n * const logHandler = function (event) {\r\n * console.log(event);\r\n * };\r\n * \r\n * report.off('pageChanged', logHandler);\r\n * ```\r\n * \r\n * @template T\r\n * @param {string} eventName\r\n * @param {service.IEventHandler} [handler]\r\n */\r\n off(eventName: string, handler?: service.IEventHandler): void {\r\n const fakeEvent: service.IEvent = { name: eventName, type: null, id: null, value: null };\r\n if (handler) {\r\n utils.remove(eventHandler => eventHandler.test(fakeEvent) && (eventHandler.handle === handler), this.eventHandlers);\r\n this.element.removeEventListener(eventName, handler);\r\n }\r\n else {\r\n const eventHandlersToRemove = this.eventHandlers\r\n .filter(eventHandler => eventHandler.test(fakeEvent));\r\n\r\n eventHandlersToRemove\r\n .forEach(eventHandlerToRemove => {\r\n utils.remove(eventHandler => eventHandler === eventHandlerToRemove, this.eventHandlers);\r\n this.element.removeEventListener(eventName, eventHandlerToRemove.handle);\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Adds an event handler for a specific event.\r\n * \r\n * ```javascript\r\n * report.on('pageChanged', (event) => {\r\n * console.log('PageChanged: ', event.page.name);\r\n * });\r\n * ```\r\n * \r\n * @template T\r\n * @param {string} eventName\r\n * @param {service.IEventHandler} handler\r\n */\r\n on(eventName: string, handler: service.IEventHandler): void {\r\n if (this.allowedEvents.indexOf(eventName) === -1) {\r\n throw new Error(`eventName is must be one of ${this.allowedEvents}. You passed: ${eventName}`);\r\n }\r\n\r\n this.eventHandlers.push({\r\n test: (event: service.IEvent) => event.name === eventName,\r\n handle: handler\r\n });\r\n\r\n this.element.addEventListener(eventName, handler)\r\n }\r\n\r\n /**\r\n * Reloads embed using existing configuration.\r\n * E.g. For reports this effectively clears all filters and makes the first page active which simulates resetting a report back to loaded state.\r\n * \r\n * ```javascript\r\n * report.reload();\r\n * ```\r\n */\r\n reload(): Promise {\r\n return this.load(this.config);\r\n }\r\n \r\n /**\r\n * Set accessToken.\r\n * \r\n * @returns {Promise}\r\n */\r\n setAccessToken(accessToken: string): Promise {\r\n return this.service.hpm.post('/report/token', accessToken, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n return response.body;\r\n })\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n \r\n /**\r\n * Gets an access token from the first available location: config, attribute, global.\r\n * \r\n * @private\r\n * @param {string} globalAccessToken\r\n * @returns {string}\r\n */\r\n private getAccessToken(globalAccessToken: string): string {\r\n const accessToken = this.config.accessToken || this.element.getAttribute(Embed.accessTokenAttribute) || globalAccessToken;\r\n\r\n if (!accessToken) {\r\n throw new Error(`No access token was found for element. You must specify an access token directly on the element using attribute '${Embed.accessTokenAttribute}' or specify a global token at: powerbi.accessToken.`);\r\n }\r\n\r\n return accessToken;\r\n }\r\n\r\n /**\r\n * Populate config for create and load\r\n * \r\n * @private\r\n * @param {IEmbedConfiguration}\r\n * @returns {void}\r\n */\r\n private populateConfig(config: IEmbedConfiguration): void {\r\n // TODO: Change when Object.assign is available.\r\n const settings = utils.assign({}, Embed.defaultSettings, config.settings);\r\n this.config = utils.assign({ settings }, config);\r\n this.config.uniqueId = this.getUniqueId();\r\n this.config.embedUrl = this.getEmbedUrl();\r\n\r\n if(this.embeType === 'create') {\r\n this.createConfig = {\r\n datasetId: config.datasetId || this.getId(),\r\n accessToken: this.getAccessToken(this.service.accessToken),\r\n settings: settings\r\n }\r\n } else {\r\n this.config.id = this.getId();\r\n this.config.accessToken = this.getAccessToken(this.service.accessToken);\r\n } \r\n }\r\n\r\n\r\n /**\r\n * Gets an embed url from the first available location: options, attribute.\r\n * \r\n * @private\r\n * @returns {string}\r\n */\r\n private getEmbedUrl(): string {\r\n const embedUrl = this.config.embedUrl || this.element.getAttribute(Embed.embedUrlAttribute);\r\n\r\n if (typeof embedUrl !== 'string' || embedUrl.length === 0) {\r\n throw new Error(`Embed Url is required, but it was not found. You must provide an embed url either as part of embed configuration or as attribute '${Embed.embedUrlAttribute}'.`);\r\n }\r\n\r\n return embedUrl;\r\n }\r\n\r\n /**\r\n * Gets a unique ID from the first available location: options, attribute.\r\n * If neither is provided generate a unique string.\r\n * \r\n * @private\r\n * @returns {string}\r\n */\r\n private getUniqueId(): string {\r\n return this.config.uniqueId || this.element.getAttribute(Embed.nameAttribute) || utils.createRandomString();\r\n }\r\n\r\n /**\r\n * Gets the report ID from the first available location: options, attribute.\r\n * \r\n * @abstract\r\n * @returns {string}\r\n */\r\n abstract getId(): string;\r\n\r\n /**\r\n * Requests the browser to render the component's iframe in fullscreen mode.\r\n */\r\n fullscreen(): void {\r\n const requestFullScreen = this.iframe.requestFullscreen || this.iframe.msRequestFullscreen || this.iframe.mozRequestFullScreen || this.iframe.webkitRequestFullscreen;\r\n requestFullScreen.call(this.iframe);\r\n }\r\n\r\n /**\r\n * Requests the browser to exit fullscreen mode.\r\n */\r\n exitFullscreen(): void {\r\n if (!this.isFullscreen(this.iframe)) {\r\n return;\r\n }\r\n\r\n const exitFullscreen = document.exitFullscreen || document.mozCancelFullScreen || document.webkitExitFullscreen || document.msExitFullscreen;\r\n exitFullscreen.call(document);\r\n }\r\n\r\n /**\r\n * Returns true if the iframe is rendered in fullscreen mode,\r\n * otherwise returns false.\r\n * \r\n * @private\r\n * @param {HTMLIFrameElement} iframe\r\n * @returns {boolean}\r\n */\r\n private isFullscreen(iframe: HTMLIFrameElement): boolean {\r\n const options = ['fullscreenElement', 'webkitFullscreenElement', 'mozFullscreenScreenElement', 'msFullscreenElement'];\r\n\r\n return options.some(option => document[option] === iframe);\r\n }\r\n \r\n /**\r\n * Validate load and create configuration.\r\n */\r\n abstract validate(config: models.IReportLoadConfiguration | models.IDashboardLoadConfiguration | models.IReportCreateConfiguration): models.IError[];\r\n\r\n /**\r\n * Sets Iframe for embed\r\n */\r\n private setIframe(isLoad: boolean): void {\r\n if(!this.iframe) {\r\n const iframeHtml = ``;\r\n this.element.innerHTML = iframeHtml;\r\n this.iframe = this.element.childNodes[0];\r\n }\r\n\r\n if(isLoad){\r\n this.iframe.addEventListener('load', () => this.load(this.config), false);\r\n } else {\r\n this.iframe.addEventListener('load', () => this.createReport(this.createConfig), false);\r\n }\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/embed.ts","\r\n/**\r\n * Raises a custom event with event data on the specified HTML element.\r\n * \r\n * @export\r\n * @param {HTMLElement} element\r\n * @param {string} eventName\r\n * @param {*} eventData\r\n */\r\nexport function raiseCustomEvent(element: HTMLElement, eventName: string, eventData: any): void {\r\n let customEvent;\r\n if (typeof CustomEvent === 'function') {\r\n customEvent = new CustomEvent(eventName, {\r\n detail: eventData,\r\n bubbles: true,\r\n cancelable: true\r\n });\r\n } else {\r\n customEvent = document.createEvent('CustomEvent');\r\n customEvent.initCustomEvent(eventName, true, true, eventData);\r\n }\r\n\r\n element.dispatchEvent(customEvent);\r\n}\r\n\r\n/**\r\n * Finds the index of the first value in an array that matches the specified predicate.\r\n * \r\n * @export\r\n * @template T\r\n * @param {(x: T) => boolean} predicate\r\n * @param {T[]} xs\r\n * @returns {number}\r\n */\r\nexport function findIndex(predicate: (x: T) => boolean, xs: T[]): number {\r\n if (!Array.isArray(xs)) {\r\n throw new Error(`You attempted to call find with second parameter that was not an array. You passed: ${xs}`);\r\n }\r\n\r\n let index;\r\n xs.some((x, i) => {\r\n if (predicate(x)) {\r\n index = i;\r\n return true;\r\n }\r\n });\r\n\r\n return index;\r\n}\r\n\r\n/**\r\n * Finds the first value in an array that matches the specified predicate.\r\n * \r\n * @export\r\n * @template T\r\n * @param {(x: T) => boolean} predicate\r\n * @param {T[]} xs\r\n * @returns {T}\r\n */\r\nexport function find(predicate: (x: T) => boolean, xs: T[]): T {\r\n const index = findIndex(predicate, xs);\r\n return xs[index];\r\n}\r\n\r\nexport function remove(predicate: (x: T) => boolean, xs: T[]): void {\r\n const index = findIndex(predicate, xs);\r\n xs.splice(index, 1);\r\n}\r\n\r\n// See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\r\n// TODO: replace in favor of using polyfill\r\n/**\r\n * Copies the values of all enumerable properties from one or more source objects to a target object, and returns the target object.\r\n * \r\n * @export\r\n * @param {any} args\r\n * @returns\r\n */\r\nexport function assign(...args) {\r\n var target = args[0];\r\n\r\n 'use strict';\r\n if (target === undefined || target === null) {\r\n throw new TypeError('Cannot convert undefined or null to object');\r\n }\r\n\r\n var output = Object(target);\r\n for (var index = 1; index < arguments.length; index++) {\r\n var source = arguments[index];\r\n if (source !== undefined && source !== null) {\r\n for (var nextKey in source) {\r\n if (source.hasOwnProperty(nextKey)) {\r\n output[nextKey] = source[nextKey];\r\n }\r\n }\r\n }\r\n }\r\n return output;\r\n}\r\n\r\n/**\r\n * Generates a random 7 character string.\r\n * \r\n * @export\r\n * @returns {string}\r\n */\r\nexport function createRandomString(): string {\r\n return (Math.random() + 1).toString(36).substring(7);\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/util.ts","import * as service from './service';\nimport * as embed from './embed';\nimport * as models from 'powerbi-models';\nimport * as wpmp from 'window-post-message-proxy';\nimport * as hpm from 'http-post-message';\nimport * as utils from './util';\nimport { IFilterable } from './ifilterable';\nimport { IPageNode, Page } from './page';\n\n/**\n * A Report node within a report hierarchy\n * \n * @export\n * @interface IReportNode\n */\nexport interface IReportNode {\n iframe: HTMLIFrameElement;\n service: service.IService;\n config: embed.IInternalEmbedConfiguration\n}\n\n/**\n * The Power BI Report embed component\n * \n * @export\n * @class Report\n * @extends {embed.Embed}\n * @implements {IReportNode}\n * @implements {IFilterable}\n */\nexport class Report extends embed.Embed implements IReportNode, IFilterable {\n static allowedEvents = [\"filtersApplied\", \"pageChanged\"];\n static reportIdAttribute = 'powerbi-report-id';\n static filterPaneEnabledAttribute = 'powerbi-settings-filter-pane-enabled';\n static navContentPaneEnabledAttribute = 'powerbi-settings-nav-content-pane-enabled';\n static typeAttribute = 'powerbi-type';\n static type = \"Report\";\n\n /**\n * Creates an instance of a Power BI Report.\n * \n * @param {service.Service} service\n * @param {HTMLElement} element\n * @param {embed.IEmbedConfiguration} config\n */\n constructor(service: service.Service, element: HTMLElement, config: embed.IEmbedConfiguration, iframe?: HTMLIFrameElement) {\n const filterPaneEnabled = (config.settings && config.settings.filterPaneEnabled) || !(element.getAttribute(Report.filterPaneEnabledAttribute) === \"false\");\n const navContentPaneEnabled = (config.settings && config.settings.navContentPaneEnabled) || !(element.getAttribute(Report.navContentPaneEnabledAttribute) === \"false\");\n const settings = utils.assign({\n filterPaneEnabled,\n navContentPaneEnabled\n }, config.settings);\n const configCopy = utils.assign({ settings }, config);\n\n super(service, element, configCopy, iframe);\n this.loadPath = \"/report/load\";\n Array.prototype.push.apply(this.allowedEvents, Report.allowedEvents);\n }\n\n /**\n * Adds backwards compatibility for the previous load configuration, which used the reportId query parameter to specify the report ID\n * (e.g. http://embedded.powerbi.com/appTokenReportEmbed?reportId=854846ed-2106-4dc2-bc58-eb77533bf2f1).\n * \n * By extracting the ID we can ensure that the ID is always explicitly provided as part of the load configuration.\n * \n * @static\n * @param {string} url\n * @returns {string}\n */\n static findIdFromEmbedUrl(url: string): string {\n const reportIdRegEx = /reportId=\"?([^&]+)\"?/\n const reportIdMatch = url.match(reportIdRegEx);\n\n let reportId;\n if (reportIdMatch) {\n reportId = reportIdMatch[1];\n }\n\n return reportId;\n }\n\n /**\n * Gets filters that are applied at the report level.\n * \n * ```javascript\n * // Get filters applied at report level\n * report.getFilters()\n * .then(filters => {\n * ...\n * });\n * ```\n * \n * @returns {Promise}\n */\n getFilters(): Promise {\n return this.service.hpm.get(`/report/filters`, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .then(response => response.body,\n response => {\n throw response.body;\n });\n }\n\n /**\n * Gets the report ID from the first available location: options, attribute, embed url.\n * \n * @returns {string}\n */\n getId(): string {\n const reportId = this.config.id || this.element.getAttribute(Report.reportIdAttribute) || Report.findIdFromEmbedUrl(this.config.embedUrl);\n\n if (typeof reportId !== 'string' || reportId.length === 0) {\n throw new Error(`Report id is required, but it was not found. You must provide an id either as part of embed configuration or as attribute '${Report.reportIdAttribute}'.`);\n }\n\n return reportId;\n }\n\n /**\n * Gets the list of pages within the report.\n * \n * ```javascript\n * report.getPages()\n * .then(pages => {\n * ...\n * });\n * ```\n * \n * @returns {Promise}\n */\n getPages(): Promise {\n return this.service.hpm.get('/report/pages', { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .then(response => {\n return response.body\n .map(page => {\n return new Page(this, page.name, page.displayName);\n });\n }, response => {\n throw response.body;\n });\n }\n\n /**\n * Creates an instance of a Page.\n * \n * Normally you would get Page objects by calling `report.getPages()`, but in the case\n * that the page name is known and you want to perform an action on a page without having to retrieve it\n * you can create it directly.\n * \n * Note: Because you are creating the page manually there is no guarantee that the page actually exists in the report, and subsequent requests could fail.\n * \n * ```javascript\n * const page = report.page('ReportSection1');\n * page.setActive();\n * ```\n * \n * @param {string} name\n * @param {string} [displayName]\n * @returns {Page}\n */\n page(name: string, displayName?: string): Page {\n return new Page(this, name, displayName);\n }\n\n /**\n * Prints the active page of the report by invoking `window.print()` on the embed iframe component.\n */\n print(): Promise {\n return this.service.hpm.post('/report/print', null, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .then(response => {\n return response.body;\n })\n .catch(response => {\n throw response.body;\n });\n }\n\n /**\n * Removes all filters at the report level.\n * \n * ```javascript\n * report.removeFilters();\n * ```\n * \n * @returns {Promise}\n */\n removeFilters(): Promise {\n return this.setFilters([]);\n }\n\n /**\n * Sets the active page of the report.\n * \n * ```javascript\n * report.setPage(\"page2\")\n * .catch(error => { ... });\n * ```\n * \n * @param {string} pageName\n * @returns {Promise}\n */\n setPage(pageName: string): Promise {\n const page: models.IPage = {\n name: pageName,\n displayName: null\n };\n\n return this.service.hpm.put('/report/pages/active', page, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .catch(response => {\n throw response.body;\n });\n }\n\n /**\n * Sets filters at the report level.\n * \n * ```javascript\n * const filters: [\n * ...\n * ];\n * \n * report.setFilters(filters)\n * .catch(errors => {\n * ...\n * });\n * ```\n * \n * @param {(models.IFilter[])} filters\n * @returns {Promise}\n */\n setFilters(filters: models.IFilter[]): Promise {\n return this.service.hpm.put(`/report/filters`, filters, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .catch(response => {\n throw response.body;\n });\n }\n\n /**\n * Updates visibility settings for the filter pane and the page navigation pane.\n * \n * ```javascript\n * const newSettings = {\n * navContentPaneEnabled: true,\n * filterPaneEnabled: false\n * };\n * \n * report.updateSettings(newSettings)\n * .catch(error => { ... });\n * ```\n * \n * @param {models.ISettings} settings\n * @returns {Promise}\n */\n updateSettings(settings: models.ISettings): Promise {\n return this.service.hpm.patch('/report/settings', settings, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .catch(response => {\n throw response.body;\n });\n }\n\n /**\n * Validate load configuration.\n */\n validate(config: models.IReportLoadConfiguration): models.IError[] {\n return models.validateReportLoad(config);\n }\n\n /**\n * Switch Report view mode.\n * \n * @returns {Promise}\n */\n switchMode(viewMode: models.ViewMode): Promise {\n let url = '/report/switchMode/' + viewMode;\n return this.service.hpm.post(url, null, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .then(response => {\n return response.body;\n })\n .catch(response => {\n throw response.body;\n });\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/report.ts","/*! powerbi-models v0.10.4 | (c) 2016 Microsoft Corporation MIT */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"powerbi-models\"] = factory();\n\telse\n\t\troot[\"powerbi-models\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __extends = (this && this.__extends) || function (d, b) {\r\n\t for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\r\n\t function __() { this.constructor = d; }\r\n\t d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n\t};\r\n\t/* tslint:disable:no-var-requires */\r\n\texports.advancedFilterSchema = __webpack_require__(1);\r\n\texports.filterSchema = __webpack_require__(2);\r\n\texports.loadSchema = __webpack_require__(3);\r\n\texports.dashboardLoadSchema = __webpack_require__(4);\r\n\texports.pageSchema = __webpack_require__(5);\r\n\texports.settingsSchema = __webpack_require__(6);\r\n\texports.basicFilterSchema = __webpack_require__(7);\r\n\texports.createReportSchema = __webpack_require__(8);\r\n\texports.saveAsParametersSchema = __webpack_require__(9);\r\n\t/* tslint:enable:no-var-requires */\r\n\tvar jsen = __webpack_require__(10);\r\n\tfunction normalizeError(error) {\r\n\t var message = error.message;\r\n\t if (!message) {\r\n\t message = error.path + \" is invalid. Not meeting \" + error.keyword + \" constraint\";\r\n\t }\r\n\t return {\r\n\t message: message\r\n\t };\r\n\t}\r\n\t/**\r\n\t * Takes in schema and returns function which can be used to validate the schema with better semantics around exposing errors\r\n\t */\r\n\tfunction validate(schema, options) {\r\n\t return function (x) {\r\n\t var validate = jsen(schema, options);\r\n\t var isValid = validate(x);\r\n\t if (isValid) {\r\n\t return undefined;\r\n\t }\r\n\t else {\r\n\t return validate.errors\r\n\t .map(normalizeError);\r\n\t }\r\n\t };\r\n\t}\r\n\texports.validateSettings = validate(exports.settingsSchema, {\r\n\t schemas: {\r\n\t basicFilter: exports.basicFilterSchema,\r\n\t advancedFilter: exports.advancedFilterSchema\r\n\t }\r\n\t});\r\n\texports.validateReportLoad = validate(exports.loadSchema, {\r\n\t schemas: {\r\n\t settings: exports.settingsSchema,\r\n\t basicFilter: exports.basicFilterSchema,\r\n\t advancedFilter: exports.advancedFilterSchema\r\n\t }\r\n\t});\r\n\texports.validateCreateReport = validate(exports.createReportSchema);\r\n\texports.validateDashboardLoad = validate(exports.dashboardLoadSchema);\r\n\texports.validatePage = validate(exports.pageSchema);\r\n\texports.validateFilter = validate(exports.filterSchema, {\r\n\t schemas: {\r\n\t basicFilter: exports.basicFilterSchema,\r\n\t advancedFilter: exports.advancedFilterSchema\r\n\t }\r\n\t});\r\n\t(function (FilterType) {\r\n\t FilterType[FilterType[\"Advanced\"] = 0] = \"Advanced\";\r\n\t FilterType[FilterType[\"Basic\"] = 1] = \"Basic\";\r\n\t FilterType[FilterType[\"Unknown\"] = 2] = \"Unknown\";\r\n\t})(exports.FilterType || (exports.FilterType = {}));\r\n\tvar FilterType = exports.FilterType;\r\n\tfunction isFilterKeyColumnsTarget(target) {\r\n\t return isColumn(target) && !!target.keys;\r\n\t}\r\n\texports.isFilterKeyColumnsTarget = isFilterKeyColumnsTarget;\r\n\tfunction isBasicFilterWithKeys(filter) {\r\n\t return getFilterType(filter) === FilterType.Basic && !!filter.keyValues;\r\n\t}\r\n\texports.isBasicFilterWithKeys = isBasicFilterWithKeys;\r\n\tfunction getFilterType(filter) {\r\n\t var basicFilter = filter;\r\n\t var advancedFilter = filter;\r\n\t if ((typeof basicFilter.operator === \"string\")\r\n\t && (Array.isArray(basicFilter.values))) {\r\n\t return FilterType.Basic;\r\n\t }\r\n\t else if ((typeof advancedFilter.logicalOperator === \"string\")\r\n\t && (Array.isArray(advancedFilter.conditions))) {\r\n\t return FilterType.Advanced;\r\n\t }\r\n\t else {\r\n\t return FilterType.Unknown;\r\n\t }\r\n\t}\r\n\texports.getFilterType = getFilterType;\r\n\tfunction isMeasure(arg) {\r\n\t return arg.table !== undefined && arg.measure !== undefined;\r\n\t}\r\n\texports.isMeasure = isMeasure;\r\n\tfunction isColumn(arg) {\r\n\t return arg.table !== undefined && arg.column !== undefined;\r\n\t}\r\n\texports.isColumn = isColumn;\r\n\tfunction isHierarchy(arg) {\r\n\t return arg.table !== undefined && arg.hierarchy !== undefined && arg.hierarchyLevel !== undefined;\r\n\t}\r\n\texports.isHierarchy = isHierarchy;\r\n\tvar Filter = (function () {\r\n\t function Filter(target) {\r\n\t this.target = target;\r\n\t }\r\n\t Filter.prototype.toJSON = function () {\r\n\t return {\r\n\t $schema: this.schemaUrl,\r\n\t target: this.target\r\n\t };\r\n\t };\r\n\t ;\r\n\t return Filter;\r\n\t}());\r\n\texports.Filter = Filter;\r\n\tvar BasicFilter = (function (_super) {\r\n\t __extends(BasicFilter, _super);\r\n\t function BasicFilter(target, operator) {\r\n\t var values = [];\r\n\t for (var _i = 2; _i < arguments.length; _i++) {\r\n\t values[_i - 2] = arguments[_i];\r\n\t }\r\n\t _super.call(this, target);\r\n\t this.operator = operator;\r\n\t this.schemaUrl = BasicFilter.schemaUrl;\r\n\t if (values.length === 0 && operator !== \"All\") {\r\n\t throw new Error(\"values must be a non-empty array unless your operator is \\\"All\\\".\");\r\n\t }\r\n\t /**\r\n\t * Accept values as array instead of as individual arguments\r\n\t * new BasicFilter('a', 'b', 1, 2);\r\n\t * new BasicFilter('a', 'b', [1,2]);\r\n\t */\r\n\t if (Array.isArray(values[0])) {\r\n\t this.values = values[0];\r\n\t }\r\n\t else {\r\n\t this.values = values;\r\n\t }\r\n\t }\r\n\t BasicFilter.prototype.toJSON = function () {\r\n\t var filter = _super.prototype.toJSON.call(this);\r\n\t filter.operator = this.operator;\r\n\t filter.values = this.values;\r\n\t return filter;\r\n\t };\r\n\t BasicFilter.schemaUrl = \"http://powerbi.com/product/schema#basic\";\r\n\t return BasicFilter;\r\n\t}(Filter));\r\n\texports.BasicFilter = BasicFilter;\r\n\tvar BasicFilterWithKeys = (function (_super) {\r\n\t __extends(BasicFilterWithKeys, _super);\r\n\t function BasicFilterWithKeys(target, operator, values, keyValues) {\r\n\t _super.call(this, target, operator, values);\r\n\t this.keyValues = keyValues;\r\n\t this.target = target;\r\n\t var numberOfKeys = target.keys ? target.keys.length : 0;\r\n\t if (numberOfKeys > 0 && !keyValues) {\r\n\t throw new Error(\"You shold pass the values to be filtered for each key. You passed: no values and \" + numberOfKeys + \" keys\");\r\n\t }\r\n\t if (numberOfKeys === 0 && keyValues && keyValues.length > 0) {\r\n\t throw new Error(\"You passed key values but your target object doesn't contain the keys to be filtered\");\r\n\t }\r\n\t for (var i = 0; i < this.keyValues.length; i++) {\r\n\t if (this.keyValues[i]) {\r\n\t var lengthOfArray = this.keyValues[i].length;\r\n\t if (lengthOfArray !== numberOfKeys) {\r\n\t throw new Error(\"Each tuple of key values should contain a value for each of the keys. You passed: \" + lengthOfArray + \" values and \" + numberOfKeys + \" keys\");\r\n\t }\r\n\t }\r\n\t }\r\n\t }\r\n\t BasicFilterWithKeys.prototype.toJSON = function () {\r\n\t var filter = _super.prototype.toJSON.call(this);\r\n\t filter.keyValues = this.keyValues;\r\n\t return filter;\r\n\t };\r\n\t return BasicFilterWithKeys;\r\n\t}(BasicFilter));\r\n\texports.BasicFilterWithKeys = BasicFilterWithKeys;\r\n\tvar AdvancedFilter = (function (_super) {\r\n\t __extends(AdvancedFilter, _super);\r\n\t function AdvancedFilter(target, logicalOperator) {\r\n\t var conditions = [];\r\n\t for (var _i = 2; _i < arguments.length; _i++) {\r\n\t conditions[_i - 2] = arguments[_i];\r\n\t }\r\n\t _super.call(this, target);\r\n\t this.schemaUrl = AdvancedFilter.schemaUrl;\r\n\t // Guard statements\r\n\t if (typeof logicalOperator !== \"string\" || logicalOperator.length === 0) {\r\n\t // TODO: It would be nicer to list out the possible logical operators.\r\n\t throw new Error(\"logicalOperator must be a valid operator, You passed: \" + logicalOperator);\r\n\t }\r\n\t this.logicalOperator = logicalOperator;\r\n\t var extractedConditions;\r\n\t /**\r\n\t * Accept conditions as array instead of as individual arguments\r\n\t * new AdvancedFilter('a', 'b', \"And\", { value: 1, operator: \"Equals\" }, { value: 2, operator: \"IsGreaterThan\" });\r\n\t * new AdvancedFilter('a', 'b', \"And\", [{ value: 1, operator: \"Equals\" }, { value: 2, operator: \"IsGreaterThan\" }]);\r\n\t */\r\n\t if (Array.isArray(conditions[0])) {\r\n\t extractedConditions = conditions[0];\r\n\t }\r\n\t else {\r\n\t extractedConditions = conditions;\r\n\t }\r\n\t if (extractedConditions.length === 0) {\r\n\t throw new Error(\"conditions must be a non-empty array. You passed: \" + conditions);\r\n\t }\r\n\t if (extractedConditions.length > 2) {\r\n\t throw new Error(\"AdvancedFilters may not have more than two conditions. You passed: \" + conditions.length);\r\n\t }\r\n\t if (extractedConditions.length === 1 && logicalOperator !== \"And\") {\r\n\t throw new Error(\"Logical Operator must be \\\"And\\\" when there is only one condition provided\");\r\n\t }\r\n\t this.conditions = extractedConditions;\r\n\t }\r\n\t AdvancedFilter.prototype.toJSON = function () {\r\n\t var filter = _super.prototype.toJSON.call(this);\r\n\t filter.logicalOperator = this.logicalOperator;\r\n\t filter.conditions = this.conditions;\r\n\t return filter;\r\n\t };\r\n\t AdvancedFilter.schemaUrl = \"http://powerbi.com/product/schema#advanced\";\r\n\t return AdvancedFilter;\r\n\t}(Filter));\r\n\texports.AdvancedFilter = AdvancedFilter;\r\n\t(function (Permissions) {\r\n\t Permissions[Permissions[\"Read\"] = 0] = \"Read\";\r\n\t Permissions[Permissions[\"ReadWrite\"] = 1] = \"ReadWrite\";\r\n\t Permissions[Permissions[\"Copy\"] = 2] = \"Copy\";\r\n\t Permissions[Permissions[\"Create\"] = 4] = \"Create\";\r\n\t Permissions[Permissions[\"All\"] = 7] = \"All\";\r\n\t})(exports.Permissions || (exports.Permissions = {}));\r\n\tvar Permissions = exports.Permissions;\r\n\t(function (ViewMode) {\r\n\t ViewMode[ViewMode[\"View\"] = 0] = \"View\";\r\n\t ViewMode[ViewMode[\"Edit\"] = 1] = \"Edit\";\r\n\t})(exports.ViewMode || (exports.ViewMode = {}));\r\n\tvar ViewMode = exports.ViewMode;\r\n\texports.validateSaveAsParameters = validate(exports.saveAsParametersSchema);\r\n\n\n/***/ },\n/* 1 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"target\": {\n\t\t\t\t\"oneOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\t\"table\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"column\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"required\": [\n\t\t\t\t\t\t\t\"table\",\n\t\t\t\t\t\t\t\"column\"\n\t\t\t\t\t\t]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\t\"table\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"hierarchy\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"hierarchyLevel\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"required\": [\n\t\t\t\t\t\t\t\"table\",\n\t\t\t\t\t\t\t\"hierarchy\",\n\t\t\t\t\t\t\t\"hierarchyLevel\"\n\t\t\t\t\t\t]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\t\"table\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"measure\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"required\": [\n\t\t\t\t\t\t\t\"table\",\n\t\t\t\t\t\t\t\"measure\"\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"logicalOperator\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"conditions\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\"value\": {\n\t\t\t\t\t\t\t\"type\": [\n\t\t\t\t\t\t\t\t\"string\",\n\t\t\t\t\t\t\t\t\"boolean\",\n\t\t\t\t\t\t\t\t\"number\"\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"operator\": {\n\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\"required\": [\n\t\t\t\t\t\t\"value\",\n\t\t\t\t\t\t\"operator\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"target\",\n\t\t\t\"logicalOperator\",\n\t\t\t\"conditions\"\n\t\t]\n\t};\n\n/***/ },\n/* 2 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"oneOf\": [\n\t\t\t{\n\t\t\t\t\"$ref\": \"#basicFilter\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"$ref\": \"#advancedFilter\"\n\t\t\t}\n\t\t],\n\t\t\"invalidMessage\": \"filter is invalid\"\n\t};\n\n/***/ },\n/* 3 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"accessToken\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"accessToken must be a string\",\n\t\t\t\t\t\"required\": \"accessToken is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"id\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"id must be a string\",\n\t\t\t\t\t\"required\": \"id is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"settings\": {\n\t\t\t\t\"$ref\": \"#settings\"\n\t\t\t},\n\t\t\t\"pageName\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"pageName must be a string\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"filters\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\"oneOf\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"$ref\": \"#basicFilter\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"$ref\": \"#advancedFilter\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t\"invalidMessage\": \"filters property is invalid\"\n\t\t\t},\n\t\t\t\"permissions\": {\n\t\t\t\t\"type\": \"number\",\n\t\t\t\t\"enum\": [\n\t\t\t\t\t0,\n\t\t\t\t\t1,\n\t\t\t\t\t2,\n\t\t\t\t\t3\n\t\t\t\t],\n\t\t\t\t\"default\": 0,\n\t\t\t\t\"invalidMessage\": \"permissions property is invalid\"\n\t\t\t},\n\t\t\t\"viewMode\": {\n\t\t\t\t\"type\": \"number\",\n\t\t\t\t\"enum\": [\n\t\t\t\t\t0,\n\t\t\t\t\t1\n\t\t\t\t],\n\t\t\t\t\"default\": 0,\n\t\t\t\t\"invalidMessage\": \"viewMode property is invalid\"\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"accessToken\",\n\t\t\t\"id\"\n\t\t]\n\t};\n\n/***/ },\n/* 4 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"accessToken\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"accessToken must be a string\",\n\t\t\t\t\t\"required\": \"accessToken is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"id\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"id must be a string\",\n\t\t\t\t\t\"required\": \"id is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"pageView\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"pageView must be a string with one of the following values: \\\"actualSize\\\", \\\"fitToWidth\\\", \\\"oneColumn\\\"\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"accessToken\",\n\t\t\t\"id\"\n\t\t]\n\t};\n\n/***/ },\n/* 5 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"name\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"name must be a string\",\n\t\t\t\t\t\"required\": \"name is required\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"name\"\n\t\t]\n\t};\n\n/***/ },\n/* 6 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"filterPaneEnabled\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"filterPaneEnabled must be a boolean\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"navContentPaneEnabled\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"navContentPaneEnabled must be a boolean\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"useCustomSaveAsDialog\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"useCustomSaveAsDialog must be a boolean\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n/***/ },\n/* 7 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"target\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"properties\": {\n\t\t\t\t\t\"table\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"column\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"hierarchy\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"hierarchyLevel\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"measure\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"required\": [\n\t\t\t\t\t\"table\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"operator\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"values\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"type\": [\n\t\t\t\t\t\t\"string\",\n\t\t\t\t\t\t\"boolean\",\n\t\t\t\t\t\t\"number\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"target\",\n\t\t\t\"operator\",\n\t\t\t\"values\"\n\t\t]\n\t};\n\n/***/ },\n/* 8 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"accessToken\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"accessToken must be a string\",\n\t\t\t\t\t\"required\": \"accessToken is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"datasetId\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"datasetId must be a string\",\n\t\t\t\t\t\"required\": \"datasetId is required\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"accessToken\",\n\t\t\t\"datasetId\"\n\t\t]\n\t};\n\n/***/ },\n/* 9 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"name\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"name must be a string\",\n\t\t\t\t\t\"required\": \"name is required\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"name\"\n\t\t]\n\t};\n\n/***/ },\n/* 10 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = __webpack_require__(11);\n\n/***/ },\n/* 11 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar REGEX_ESCAPE_EXPR = /[\\/]/g,\n\t STR_ESCAPE_EXPR = /(\")/gim,\n\t VALID_IDENTIFIER_EXPR = /^[a-z_$][0-9a-z]*$/gi,\n\t INVALID_SCHEMA = 'jsen: invalid schema object',\n\t browser = typeof window === 'object' && !!window.navigator, // jshint ignore: line\n\t regescape = new RegExp('/').source !== '/', // node v0.x does not properly escape '/'s in inline regex\n\t func = __webpack_require__(12),\n\t equal = __webpack_require__(13),\n\t unique = __webpack_require__(14),\n\t SchemaResolver = __webpack_require__(15),\n\t formats = __webpack_require__(24),\n\t ucs2length = __webpack_require__(25),\n\t types = {},\n\t keywords = {};\n\t\n\tfunction inlineRegex(regex) {\n\t regex = regex instanceof RegExp ? regex : new RegExp(regex);\n\t\n\t return regescape ?\n\t regex.toString() :\n\t '/' + regex.source.replace(REGEX_ESCAPE_EXPR, '\\\\$&') + '/';\n\t}\n\t\n\tfunction encodeStr(str) {\n\t return '\"' + str.replace(STR_ESCAPE_EXPR, '\\\\$1') + '\"';\n\t}\n\t\n\tfunction appendToPath(path, key) {\n\t VALID_IDENTIFIER_EXPR.lastIndex = 0;\n\t\n\t return VALID_IDENTIFIER_EXPR.test(key) ?\n\t path + '.' + key :\n\t path + '[' + encodeStr(key) + ']';\n\t}\n\t\n\tfunction type(obj) {\n\t if (obj === undefined) {\n\t return 'undefined';\n\t }\n\t\n\t var str = Object.prototype.toString.call(obj);\n\t return str.substr(8, str.length - 9).toLowerCase();\n\t}\n\t\n\tfunction isInteger(obj) {\n\t return (obj | 0) === obj; // jshint ignore: line\n\t}\n\t\n\ttypes['null'] = function (path) {\n\t return path + ' === null';\n\t};\n\t\n\ttypes.boolean = function (path) {\n\t return 'typeof ' + path + ' === \"boolean\"';\n\t};\n\t\n\ttypes.string = function (path) {\n\t return 'typeof ' + path + ' === \"string\"';\n\t};\n\t\n\ttypes.number = function (path) {\n\t return 'typeof ' + path + ' === \"number\"';\n\t};\n\t\n\ttypes.integer = function (path) {\n\t return 'typeof ' + path + ' === \"number\" && !(' + path + ' % 1)';\n\t};\n\t\n\ttypes.array = function (path) {\n\t return 'Array.isArray(' + path + ')';\n\t};\n\t\n\ttypes.object = function (path) {\n\t return 'typeof ' + path + ' === \"object\" && ' + path + ' !== null && !Array.isArray(' + path + ')';\n\t};\n\t\n\ttypes.date = function (path) {\n\t return path + ' instanceof Date';\n\t};\n\t\n\tkeywords.enum = function (context) {\n\t var arr = context.schema['enum'];\n\t\n\t context.code('if (!equalAny(' + context.path + ', ' + JSON.stringify(arr) + ')) {');\n\t context.error('enum');\n\t context.code('}');\n\t};\n\t\n\tkeywords.minimum = function (context) {\n\t if (typeof context.schema.minimum === 'number') {\n\t context.code('if (' + context.path + ' < ' + context.schema.minimum + ') {');\n\t context.error('minimum');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.exclusiveMinimum = function (context) {\n\t if (context.schema.exclusiveMinimum === true && typeof context.schema.minimum === 'number') {\n\t context.code('if (' + context.path + ' === ' + context.schema.minimum + ') {');\n\t context.error('exclusiveMinimum');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.maximum = function (context) {\n\t if (typeof context.schema.maximum === 'number') {\n\t context.code('if (' + context.path + ' > ' + context.schema.maximum + ') {');\n\t context.error('maximum');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.exclusiveMaximum = function (context) {\n\t if (context.schema.exclusiveMaximum === true && typeof context.schema.maximum === 'number') {\n\t context.code('if (' + context.path + ' === ' + context.schema.maximum + ') {');\n\t context.error('exclusiveMaximum');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.multipleOf = function (context) {\n\t if (typeof context.schema.multipleOf === 'number') {\n\t var mul = context.schema.multipleOf,\n\t decimals = mul.toString().length - mul.toFixed(0).length - 1,\n\t pow = decimals > 0 ? Math.pow(10, decimals) : 1,\n\t path = context.path;\n\t\n\t if (decimals > 0) {\n\t context.code('if (+(Math.round((' + path + ' * ' + pow + ') + \"e+\" + ' + decimals + ') + \"e-\" + ' + decimals + ') % ' + (mul * pow) + ' !== 0) {');\n\t } else {\n\t context.code('if (((' + path + ' * ' + pow + ') % ' + (mul * pow) + ') !== 0) {');\n\t }\n\t\n\t context.error('multipleOf');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.minLength = function (context) {\n\t if (isInteger(context.schema.minLength)) {\n\t context.code('if (ucs2length(' + context.path + ') < ' + context.schema.minLength + ') {');\n\t context.error('minLength');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.maxLength = function (context) {\n\t if (isInteger(context.schema.maxLength)) {\n\t context.code('if (ucs2length(' + context.path + ') > ' + context.schema.maxLength + ') {');\n\t context.error('maxLength');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.pattern = function (context) {\n\t var pattern = context.schema.pattern;\n\t\n\t if (typeof pattern === 'string' || pattern instanceof RegExp) {\n\t context.code('if (!(' + inlineRegex(pattern) + ').test(' + context.path + ')) {');\n\t context.error('pattern');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.format = function (context) {\n\t if (typeof context.schema.format !== 'string' || !formats[context.schema.format]) {\n\t return;\n\t }\n\t\n\t context.code('if (!(' + formats[context.schema.format] + ').test(' + context.path + ')) {');\n\t context.error('format');\n\t context.code('}');\n\t};\n\t\n\tkeywords.minItems = function (context) {\n\t if (isInteger(context.schema.minItems)) {\n\t context.code('if (' + context.path + '.length < ' + context.schema.minItems + ') {');\n\t context.error('minItems');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.maxItems = function (context) {\n\t if (isInteger(context.schema.maxItems)) {\n\t context.code('if (' + context.path + '.length > ' + context.schema.maxItems + ') {');\n\t context.error('maxItems');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.additionalItems = function (context) {\n\t if (context.schema.additionalItems === false && Array.isArray(context.schema.items)) {\n\t context.code('if (' + context.path + '.length > ' + context.schema.items.length + ') {');\n\t context.error('additionalItems');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.uniqueItems = function (context) {\n\t if (context.schema.uniqueItems) {\n\t context.code('if (unique(' + context.path + ').length !== ' + context.path + '.length) {');\n\t context.error('uniqueItems');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.items = function (context) {\n\t var index = context.declare(0),\n\t i = 0;\n\t\n\t if (type(context.schema.items) === 'object') {\n\t context.code('for (' + index + ' = 0; ' + index + ' < ' + context.path + '.length; ' + index + '++) {');\n\t\n\t context.descend(context.path + '[' + index + ']', context.schema.items);\n\t\n\t context.code('}');\n\t }\n\t else if (Array.isArray(context.schema.items)) {\n\t for (; i < context.schema.items.length; i++) {\n\t context.code('if (' + context.path + '.length - 1 >= ' + i + ') {');\n\t\n\t context.descend(context.path + '[' + i + ']', context.schema.items[i]);\n\t\n\t context.code('}');\n\t }\n\t\n\t if (type(context.schema.additionalItems) === 'object') {\n\t context.code('for (' + index + ' = ' + i + '; ' + index + ' < ' + context.path + '.length; ' + index + '++) {');\n\t\n\t context.descend(context.path + '[' + index + ']', context.schema.additionalItems);\n\t\n\t context.code('}');\n\t }\n\t }\n\t};\n\t\n\tkeywords.maxProperties = function (context) {\n\t if (isInteger(context.schema.maxProperties)) {\n\t context.code('if (Object.keys(' + context.path + ').length > ' + context.schema.maxProperties + ') {');\n\t context.error('maxProperties');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.minProperties = function (context) {\n\t if (isInteger(context.schema.minProperties)) {\n\t context.code('if (Object.keys(' + context.path + ').length < ' + context.schema.minProperties + ') {');\n\t context.error('minProperties');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.required = function (context) {\n\t if (!Array.isArray(context.schema.required)) {\n\t return;\n\t }\n\t\n\t for (var i = 0; i < context.schema.required.length; i++) {\n\t context.code('if (' + appendToPath(context.path, context.schema.required[i]) + ' === undefined) {');\n\t context.error('required', context.schema.required[i]);\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.properties = function (context) {\n\t var props = context.schema.properties,\n\t propKeys = type(props) === 'object' ? Object.keys(props) : [],\n\t required = Array.isArray(context.schema.required) ? context.schema.required : [],\n\t prop, i, nestedPath;\n\t\n\t if (!propKeys.length) {\n\t return;\n\t }\n\t\n\t for (i = 0; i < propKeys.length; i++) {\n\t prop = propKeys[i];\n\t nestedPath = appendToPath(context.path, prop);\n\t\n\t context.code('if (' + nestedPath + ' !== undefined) {');\n\t\n\t context.descend(nestedPath, props[prop]);\n\t\n\t context.code('}');\n\t\n\t if (required.indexOf(prop) > -1) {\n\t context.code('else {');\n\t context.error('required', prop);\n\t context.code('}');\n\t }\n\t }\n\t};\n\t\n\tkeywords.patternProperties = keywords.additionalProperties = function (context) {\n\t var propKeys = type(context.schema.properties) === 'object' ?\n\t Object.keys(context.schema.properties) : [],\n\t patProps = context.schema.patternProperties,\n\t patterns = type(patProps) === 'object' ? Object.keys(patProps) : [],\n\t addProps = context.schema.additionalProperties,\n\t addPropsCheck = addProps === false || type(addProps) === 'object',\n\t props, keys, key, n, found, pattern, i;\n\t\n\t if (!patterns.length && !addPropsCheck) {\n\t return;\n\t }\n\t\n\t keys = context.declare('[]');\n\t key = context.declare('\"\"');\n\t n = context.declare(0);\n\t\n\t if (addPropsCheck) {\n\t found = context.declare(false);\n\t }\n\t\n\t context.code(keys + ' = Object.keys(' + context.path + ')');\n\t\n\t context.code('for (' + n + ' = 0; ' + n + ' < ' + keys + '.length; ' + n + '++) {')\n\t (key + ' = ' + keys + '[' + n + ']')\n\t\n\t ('if (' + context.path + '[' + key + '] === undefined) {')\n\t ('continue')\n\t ('}');\n\t\n\t if (addPropsCheck) {\n\t context.code(found + ' = false');\n\t }\n\t\n\t // validate pattern properties\n\t for (i = 0; i < patterns.length; i++) {\n\t pattern = patterns[i];\n\t\n\t context.code('if ((' + inlineRegex(pattern) + ').test(' + key + ')) {');\n\t\n\t context.descend(context.path + '[' + key + ']', patProps[pattern]);\n\t\n\t if (addPropsCheck) {\n\t context.code(found + ' = true');\n\t }\n\t\n\t context.code('}');\n\t }\n\t\n\t // validate additional properties\n\t if (addPropsCheck) {\n\t if (propKeys.length) {\n\t props = context.declare(JSON.stringify(propKeys));\n\t\n\t // do not validate regular properties\n\t context.code('if (' + props + '.indexOf(' + key + ') > -1) {')\n\t ('continue')\n\t ('}');\n\t }\n\t\n\t context.code('if (!' + found + ') {');\n\t\n\t if (addProps === false) {\n\t // do not allow additional properties\n\t context.error('additionalProperties', undefined, key);\n\t }\n\t else {\n\t // validate additional properties\n\t context.descend(context.path + '[' + key + ']', addProps);\n\t }\n\t\n\t context.code('}');\n\t }\n\t\n\t context.code('}');\n\t};\n\t\n\tkeywords.dependencies = function (context) {\n\t if (type(context.schema.dependencies) !== 'object') {\n\t return;\n\t }\n\t\n\t var depKeys = Object.keys(context.schema.dependencies),\n\t len = depKeys.length,\n\t key, dep, i = 0, k = 0;\n\t\n\t for (; k < len; k++) {\n\t key = depKeys[k];\n\t dep = context.schema.dependencies[key];\n\t\n\t context.code('if (' + appendToPath(context.path, key) + ' !== undefined) {');\n\t\n\t if (type(dep) === 'object') {\n\t //schema dependency\n\t context.descend(context.path, dep);\n\t }\n\t else {\n\t // property dependency\n\t for (i; i < dep.length; i++) {\n\t context.code('if (' + appendToPath(context.path, dep[i]) + ' === undefined) {');\n\t context.error('dependencies', dep[i]);\n\t context.code('}');\n\t }\n\t }\n\t\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.allOf = function (context) {\n\t if (!Array.isArray(context.schema.allOf)) {\n\t return;\n\t }\n\t\n\t for (var i = 0; i < context.schema.allOf.length; i++) {\n\t context.descend(context.path, context.schema.allOf[i]);\n\t }\n\t};\n\t\n\tkeywords.anyOf = function (context) {\n\t if (!Array.isArray(context.schema.anyOf)) {\n\t return;\n\t }\n\t\n\t var greedy = context.greedy,\n\t errCount = context.declare(0),\n\t initialCount = context.declare(0),\n\t found = context.declare(false),\n\t i = 0;\n\t\n\t context.code(initialCount + ' = errors.length');\n\t\n\t for (; i < context.schema.anyOf.length; i++) {\n\t context.code('if (!' + found + ') {');\n\t\n\t context.code(errCount + ' = errors.length');\n\t\n\t context.greedy = true;\n\t\n\t context.descend(context.path, context.schema.anyOf[i]);\n\t\n\t context.code(found + ' = errors.length === ' + errCount)\n\t ('}');\n\t }\n\t\n\t context.greedy = greedy;\n\t\n\t context.code('if (!' + found + ') {');\n\t\n\t context.error('anyOf');\n\t\n\t context.code('} else {')\n\t ('errors.length = ' + initialCount)\n\t ('}');\n\t};\n\t\n\tkeywords.oneOf = function (context) {\n\t if (!Array.isArray(context.schema.oneOf)) {\n\t return;\n\t }\n\t\n\t var greedy = context.greedy,\n\t matching = context.declare(0),\n\t initialCount = context.declare(0),\n\t errCount = context.declare(0),\n\t i = 0;\n\t\n\t context.code(initialCount + ' = errors.length');\n\t context.code(matching + ' = 0');\n\t\n\t for (; i < context.schema.oneOf.length; i++) {\n\t context.code(errCount + ' = errors.length');\n\t\n\t context.greedy = true;\n\t\n\t context.descend(context.path, context.schema.oneOf[i]);\n\t\n\t context.code('if (errors.length === ' + errCount + ') {')\n\t (matching + '++')\n\t ('}');\n\t }\n\t\n\t context.greedy = greedy;\n\t\n\t context.code('if (' + matching + ' !== 1) {');\n\t\n\t context.error('oneOf');\n\t\n\t context.code('} else {')\n\t ('errors.length = ' + initialCount)\n\t ('}');\n\t};\n\t\n\tkeywords.not = function (context) {\n\t if (type(context.schema.not) !== 'object') {\n\t return;\n\t }\n\t\n\t var greedy = context.greedy,\n\t errCount = context.declare(0);\n\t\n\t context.code(errCount + ' = errors.length');\n\t\n\t context.greedy = true;\n\t\n\t context.descend(context.path, context.schema.not);\n\t\n\t context.greedy = greedy;\n\t\n\t context.code('if (errors.length === ' + errCount + ') {');\n\t\n\t context.error('not');\n\t\n\t context.code('} else {')\n\t ('errors.length = ' + errCount)\n\t ('}');\n\t};\n\t\n\tfunction decorateGenerator(type, keyword) {\n\t keywords[keyword].type = type;\n\t keywords[keyword].keyword = keyword;\n\t}\n\t\n\t['minimum', 'exclusiveMinimum', 'maximum', 'exclusiveMaximum', 'multipleOf']\n\t .forEach(decorateGenerator.bind(null, 'number'));\n\t\n\t['minLength', 'maxLength', 'pattern', 'format']\n\t .forEach(decorateGenerator.bind(null, 'string'));\n\t\n\t['minItems', 'maxItems', 'additionalItems', 'uniqueItems', 'items']\n\t .forEach(decorateGenerator.bind(null, 'array'));\n\t\n\t['maxProperties', 'minProperties', 'required', 'properties', 'patternProperties', 'additionalProperties', 'dependencies']\n\t .forEach(decorateGenerator.bind(null, 'object'));\n\t\n\t['enum', 'allOf', 'anyOf', 'oneOf', 'not']\n\t .forEach(decorateGenerator.bind(null, null));\n\t\n\tfunction groupKeywords(schema) {\n\t var keys = Object.keys(schema),\n\t propIndex = keys.indexOf('properties'),\n\t patIndex = keys.indexOf('patternProperties'),\n\t ret = {\n\t enum: Array.isArray(schema.enum) && schema.enum.length > 0,\n\t type: null,\n\t allType: [],\n\t perType: {}\n\t },\n\t key, gen, i;\n\t\n\t if (schema.type) {\n\t if (typeof schema.type === 'string') {\n\t ret.type = [schema.type];\n\t }\n\t else if (Array.isArray(schema.type) && schema.type.length) {\n\t ret.type = schema.type.slice(0);\n\t }\n\t }\n\t\n\t for (i = 0; i < keys.length; i++) {\n\t key = keys[i];\n\t\n\t if (key === 'enum' || key === 'type') {\n\t continue;\n\t }\n\t\n\t gen = keywords[key];\n\t\n\t if (!gen) {\n\t continue;\n\t }\n\t\n\t if (gen.type) {\n\t if (!ret.perType[gen.type]) {\n\t ret.perType[gen.type] = [];\n\t }\n\t\n\t if (!(propIndex > -1 && key === 'required') &&\n\t !(patIndex > -1 && key === 'additionalProperties')) {\n\t ret.perType[gen.type].push(key);\n\t }\n\t }\n\t else {\n\t ret.allType.push(key);\n\t }\n\t }\n\t\n\t return ret;\n\t}\n\t\n\tfunction getPathExpression(path, key) {\n\t var path_ = path.substr(4),\n\t len = path_.length,\n\t tokens = [],\n\t token = '',\n\t isvar = false,\n\t char, i;\n\t\n\t for (i = 0; i < len; i++) {\n\t char = path_[i];\n\t\n\t switch (char) {\n\t case '.':\n\t if (token) {\n\t token += char;\n\t }\n\t break;\n\t case '[':\n\t if (isNaN(+path_[i + 1])) {\n\t isvar = true;\n\t\n\t if (token) {\n\t tokens.push('\"' + token + '\"');\n\t token = '';\n\t }\n\t }\n\t else {\n\t isvar = false;\n\t\n\t if (token) {\n\t token += '.';\n\t }\n\t }\n\t break;\n\t case ']':\n\t tokens.push(isvar ? token : '\"' + token + '\"');\n\t token = '';\n\t break;\n\t default:\n\t token += char;\n\t }\n\t }\n\t\n\t if (token) {\n\t tokens.push('\"' + token + '\"');\n\t }\n\t\n\t if (key) {\n\t tokens.push('\"' + key + '\"');\n\t }\n\t\n\t if (tokens.length === 1 && isvar) {\n\t return '\"\" + ' + tokens[0] + ' + \"\"';\n\t }\n\t\n\t return tokens.join(' + \".\" + ') || '\"\"';\n\t}\n\t\n\tfunction clone(obj) {\n\t var cloned = obj,\n\t objType = type(obj),\n\t keys, len, key, i;\n\t\n\t if (objType === 'object') {\n\t cloned = {};\n\t keys = Object.keys(obj);\n\t\n\t for (i = 0, len = keys.length; i < len; i++) {\n\t key = keys[i];\n\t cloned[key] = clone(obj[key]);\n\t }\n\t }\n\t else if (objType === 'array') {\n\t cloned = [];\n\t\n\t for (i = 0, len = obj.length; i < len; i++) {\n\t cloned[i] = clone(obj[i]);\n\t }\n\t }\n\t else if (objType === 'regexp') {\n\t return new RegExp(obj);\n\t }\n\t else if (objType === 'date') {\n\t return new Date(obj.toJSON());\n\t }\n\t\n\t return cloned;\n\t}\n\t\n\tfunction equalAny(obj, options) {\n\t for (var i = 0, len = options.length; i < len; i++) {\n\t if (equal(obj, options[i])) {\n\t return true;\n\t }\n\t }\n\t\n\t return false;\n\t}\n\t\n\tfunction PropertyMarker() {\n\t this.objects = [];\n\t this.properties = [];\n\t}\n\t\n\tPropertyMarker.prototype.mark = function (obj, key) {\n\t var index = this.objects.indexOf(obj),\n\t prop;\n\t\n\t if (index < 0) {\n\t this.objects.push(obj);\n\t\n\t prop = {};\n\t prop[key] = 1;\n\t\n\t this.properties.push(prop);\n\t\n\t return;\n\t }\n\t\n\t prop = this.properties[index];\n\t\n\t prop[key] = prop[key] ? prop[key] + 1 : 1;\n\t};\n\t\n\tPropertyMarker.prototype.deleteDuplicates = function () {\n\t var props, keys, key, i, j;\n\t\n\t for (i = 0; i < this.properties.length; i++) {\n\t props = this.properties[i];\n\t keys = Object.keys(props);\n\t\n\t for (j = 0; j < keys.length; j++) {\n\t key = keys[j];\n\t\n\t if (props[key] > 1) {\n\t delete this.objects[i][key];\n\t }\n\t }\n\t }\n\t};\n\t\n\tPropertyMarker.prototype.dispose = function () {\n\t this.objects.length = 0;\n\t this.properties.length = 0;\n\t};\n\t\n\tfunction build(schema, def, additional, resolver, parentMarker) {\n\t var defType, defValue, key, i, propertyMarker, props, defProps;\n\t\n\t if (type(schema) !== 'object') {\n\t return def;\n\t }\n\t\n\t schema = resolver.resolve(schema);\n\t\n\t if (def === undefined && schema.hasOwnProperty('default')) {\n\t def = clone(schema['default']);\n\t }\n\t\n\t defType = type(def);\n\t\n\t if (defType === 'object' && type(schema.properties) === 'object') {\n\t props = Object.keys(schema.properties);\n\t\n\t for (i = 0; i < props.length; i++) {\n\t key = props[i];\n\t defValue = build(schema.properties[key], def[key], additional, resolver);\n\t\n\t if (defValue !== undefined) {\n\t def[key] = defValue;\n\t }\n\t }\n\t\n\t if (additional !== 'always') {\n\t defProps = Object.keys(def);\n\t\n\t for (i = 0; i < defProps.length; i++) {\n\t key = defProps[i];\n\t\n\t if (props.indexOf(key) < 0 &&\n\t (schema.additionalProperties === false ||\n\t (additional === false && !schema.additionalProperties))) {\n\t\n\t if (parentMarker) {\n\t parentMarker.mark(def, key);\n\t }\n\t else {\n\t delete def[key];\n\t }\n\t }\n\t }\n\t }\n\t }\n\t else if (defType === 'array' && schema.items) {\n\t if (type(schema.items) === 'array') {\n\t for (i = 0; i < schema.items.length; i++) {\n\t defValue = build(schema.items[i], def[i], additional, resolver);\n\t\n\t if (defValue !== undefined || i < def.length) {\n\t def[i] = defValue;\n\t }\n\t }\n\t }\n\t else if (def.length) {\n\t for (i = 0; i < def.length; i++) {\n\t def[i] = build(schema.items, def[i], additional, resolver);\n\t }\n\t }\n\t }\n\t else if (type(schema.allOf) === 'array' && schema.allOf.length) {\n\t propertyMarker = new PropertyMarker();\n\t\n\t for (i = 0; i < schema.allOf.length; i++) {\n\t def = build(schema.allOf[i], def, additional, resolver, propertyMarker);\n\t }\n\t\n\t propertyMarker.deleteDuplicates();\n\t propertyMarker.dispose();\n\t }\n\t\n\t return def;\n\t}\n\t\n\tfunction ValidationContext(options) {\n\t this.path = 'data';\n\t this.schema = options.schema;\n\t this.formats = options.formats;\n\t this.greedy = options.greedy;\n\t this.resolver = options.resolver;\n\t this.id = options.id;\n\t this.funcache = options.funcache || {};\n\t this.scope = options.scope || {\n\t equalAny: equalAny,\n\t unique: unique,\n\t ucs2length: ucs2length,\n\t refs: {}\n\t };\n\t}\n\t\n\tValidationContext.prototype.clone = function (schema) {\n\t var ctx = new ValidationContext({\n\t schema: schema,\n\t formats: this.formats,\n\t greedy: this.greedy,\n\t resolver: this.resolver,\n\t id: this.id,\n\t funcache: this.funcache,\n\t scope: this.scope\n\t });\n\t\n\t return ctx;\n\t};\n\t\n\tValidationContext.prototype.declare = function (def) {\n\t var variname = this.id();\n\t this.code.def(variname, def);\n\t return variname;\n\t};\n\t\n\tValidationContext.prototype.cache = function (cacheKey, schema) {\n\t var cached = this.funcache[cacheKey],\n\t context;\n\t\n\t if (!cached) {\n\t cached = this.funcache[cacheKey] = {\n\t key: this.id()\n\t };\n\t\n\t context = this.clone(schema);\n\t\n\t cached.func = context.compile(cached.key);\n\t\n\t this.scope.refs[cached.key] = cached.func;\n\t\n\t context.dispose();\n\t }\n\t\n\t return 'refs.' + cached.key;\n\t};\n\t\n\tValidationContext.prototype.error = function (keyword, key, additional) {\n\t var schema = this.schema,\n\t path = this.path,\n\t errorPath = path !== 'data' || key ?\n\t '(path ? path + \".\" : \"\") + ' + getPathExpression(path, key) + ',' :\n\t 'path,',\n\t res = key && schema.properties && schema.properties[key] ?\n\t this.resolver.resolve(schema.properties[key]) : null,\n\t message = res ? res.requiredMessage : schema.invalidMessage;\n\t\n\t if (!message) {\n\t message = (res && res.messages && res.messages[keyword]) ||\n\t (schema.messages && schema.messages[keyword]);\n\t }\n\t\n\t this.code('errors.push({');\n\t\n\t if (message) {\n\t this.code('message: ' + encodeStr(message) + ',');\n\t }\n\t\n\t if (additional) {\n\t this.code('additionalProperties: ' + additional + ',');\n\t }\n\t\n\t this.code('path: ' + errorPath)\n\t ('keyword: ' + encodeStr(keyword))\n\t ('})');\n\t\n\t if (!this.greedy) {\n\t this.code('return');\n\t }\n\t};\n\t\n\tValidationContext.prototype.refactor = function (path, schema, cacheKey) {\n\t var parentPathExp = path !== 'data' ?\n\t '(path ? path + \".\" : \"\") + ' + getPathExpression(path) :\n\t 'path',\n\t cachedRef = this.cache(cacheKey, schema),\n\t refErrors = this.declare();\n\t\n\t this.code(refErrors + ' = ' + cachedRef + '(' + path + ', ' + parentPathExp + ', errors)');\n\t\n\t if (!this.greedy) {\n\t this.code('if (errors.length) { return }');\n\t }\n\t};\n\t\n\tValidationContext.prototype.descend = function (path, schema) {\n\t var origPath = this.path,\n\t origSchema = this.schema;\n\t\n\t this.path = path;\n\t this.schema = schema;\n\t\n\t this.generate();\n\t\n\t this.path = origPath;\n\t this.schema = origSchema;\n\t};\n\t\n\tValidationContext.prototype.generate = function () {\n\t var path = this.path,\n\t schema = this.schema,\n\t context = this,\n\t scope = this.scope,\n\t encodedFormat,\n\t format,\n\t schemaKeys,\n\t typeKeys,\n\t typeIndex,\n\t validatedType,\n\t i;\n\t\n\t if (type(schema) !== 'object') {\n\t return;\n\t }\n\t\n\t if (schema.$ref !== undefined) {\n\t schema = this.resolver.resolve(schema);\n\t\n\t if (this.resolver.hasRef(schema)) {\n\t this.refactor(path, schema,\n\t this.resolver.getNormalizedRef(this.schema) || this.schema.$ref);\n\t\n\t return;\n\t }\n\t else {\n\t // substitute $ref schema with the resolved instance\n\t this.schema = schema;\n\t }\n\t }\n\t\n\t schemaKeys = groupKeywords(schema);\n\t\n\t if (schemaKeys.enum) {\n\t keywords.enum(context);\n\t\n\t return; // do not process the schema further\n\t }\n\t\n\t typeKeys = Object.keys(schemaKeys.perType);\n\t\n\t function generateForKeyword(keyword) {\n\t keywords[keyword](context); // jshint ignore: line\n\t }\n\t\n\t for (i = 0; i < typeKeys.length; i++) {\n\t validatedType = typeKeys[i];\n\t\n\t this.code((i ? 'else ' : '') + 'if (' + types[validatedType](path) + ') {');\n\t\n\t schemaKeys.perType[validatedType].forEach(generateForKeyword);\n\t\n\t this.code('}');\n\t\n\t if (schemaKeys.type) {\n\t typeIndex = schemaKeys.type.indexOf(validatedType);\n\t\n\t if (typeIndex > -1) {\n\t schemaKeys.type.splice(typeIndex, 1);\n\t }\n\t }\n\t }\n\t\n\t if (schemaKeys.type) { // we have types in the schema\n\t if (schemaKeys.type.length) { // case 1: we still have some left to check\n\t this.code((typeKeys.length ? 'else ' : '') + 'if (!(' + schemaKeys.type.map(function (type) {\n\t return types[type] ? types[type](path) : 'true';\n\t }).join(' || ') + ')) {');\n\t this.error('type');\n\t this.code('}');\n\t }\n\t else {\n\t this.code('else {'); // case 2: we don't have any left to check\n\t this.error('type');\n\t this.code('}');\n\t }\n\t }\n\t\n\t schemaKeys.allType.forEach(function (keyword) {\n\t keywords[keyword](context);\n\t });\n\t\n\t if (schema.format && this.formats) {\n\t format = this.formats[schema.format];\n\t\n\t if (format) {\n\t if (typeof format === 'string' || format instanceof RegExp) {\n\t this.code('if (!(' + inlineRegex(format) + ').test(' + path + ')) {');\n\t this.error('format');\n\t this.code('}');\n\t }\n\t else if (typeof format === 'function') {\n\t (scope.formats || (scope.formats = {}))[schema.format] = format;\n\t (scope.schemas || (scope.schemas = {}))[schema.format] = schema;\n\t\n\t encodedFormat = encodeStr(schema.format);\n\t\n\t this.code('if (!formats[' + encodedFormat + '](' + path + ', schemas[' + encodedFormat + '])) {');\n\t this.error('format');\n\t this.code('}');\n\t }\n\t }\n\t }\n\t};\n\t\n\tValidationContext.prototype.compile = function (id) {\n\t this.code = func('jsen_compiled' + (id ? '_' + id : ''), 'data', 'path', 'errors');\n\t this.generate();\n\t\n\t return this.code.compile(this.scope);\n\t};\n\t\n\tValidationContext.prototype.dispose = function () {\n\t for (var key in this) {\n\t this[key] = undefined;\n\t }\n\t};\n\t\n\tfunction jsen(schema, options) {\n\t if (type(schema) !== 'object') {\n\t throw new Error(INVALID_SCHEMA);\n\t }\n\t\n\t options = options || {};\n\t\n\t var counter = 0,\n\t id = function () { return 'i' + (counter++); },\n\t resolver = new SchemaResolver(schema, options.schemas, options.missing$Ref || false),\n\t context = new ValidationContext({\n\t schema: schema,\n\t resolver: resolver,\n\t id: id,\n\t schemas: options.schemas,\n\t formats: options.formats,\n\t greedy: options.greedy || false\n\t }),\n\t compiled = func('validate', 'data')\n\t ('validate.errors = []')\n\t ('gen(data, \"\", validate.errors)')\n\t ('return validate.errors.length === 0')\n\t .compile({ gen: context.compile() });\n\t\n\t context.dispose();\n\t context = null;\n\t\n\t compiled.errors = [];\n\t\n\t compiled.build = function (initial, options) {\n\t return build(\n\t schema,\n\t (options && options.copy === false ? initial : clone(initial)),\n\t options && options.additionalProperties,\n\t resolver);\n\t };\n\t\n\t return compiled;\n\t}\n\t\n\tjsen.browser = browser;\n\tjsen.clone = clone;\n\tjsen.equal = equal;\n\tjsen.unique = unique;\n\tjsen.ucs2length = ucs2length;\n\tjsen.SchemaResolver = SchemaResolver;\n\tjsen.resolve = SchemaResolver.resolvePointer;\n\t\n\tmodule.exports = jsen;\n\n\n/***/ },\n/* 12 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = function func() {\n\t var args = Array.apply(null, arguments),\n\t name = args.shift(),\n\t tab = ' ',\n\t lines = '',\n\t vars = '',\n\t ind = 1, // indentation\n\t bs = '{[', // block start\n\t be = '}]', // block end\n\t space = function () {\n\t var sp = tab, i = 0;\n\t while (i++ < ind - 1) { sp += tab; }\n\t return sp;\n\t },\n\t add = function (line) {\n\t lines += space() + line + '\\n';\n\t },\n\t builder = function (line) {\n\t var first = line[0],\n\t last = line[line.length - 1];\n\t\n\t if (be.indexOf(first) > -1 && bs.indexOf(last) > -1) {\n\t ind--;\n\t add(line);\n\t ind++;\n\t }\n\t else if (bs.indexOf(last) > -1) {\n\t add(line);\n\t ind++;\n\t }\n\t else if (be.indexOf(first) > -1) {\n\t ind--;\n\t add(line);\n\t }\n\t else {\n\t add(line);\n\t }\n\t\n\t return builder;\n\t };\n\t\n\t builder.def = function (id, def) {\n\t vars += (vars ? ',\\n' + tab + ' ' : '') + id + (def !== undefined ? ' = ' + def : '');\n\t return builder;\n\t };\n\t\n\t builder.toSource = function () {\n\t return 'function ' + name + '(' + args.join(', ') + ') {\\n' +\n\t tab + '\"use strict\"' + '\\n' +\n\t (vars ? tab + 'var ' + vars + ';\\n' : '') +\n\t lines + '}';\n\t };\n\t\n\t builder.compile = function (scope) {\n\t var src = 'return (' + builder.toSource() + ')',\n\t scp = scope || {},\n\t keys = Object.keys(scp),\n\t vals = keys.map(function (key) { return scp[key]; });\n\t\n\t return Function.apply(null, keys.concat(src)).apply(null, vals);\n\t };\n\t\n\t return builder;\n\t};\n\n/***/ },\n/* 13 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tfunction type(obj) {\n\t var str = Object.prototype.toString.call(obj);\n\t return str.substr(8, str.length - 9).toLowerCase();\n\t}\n\t\n\tfunction deepEqual(a, b) {\n\t var keysA = Object.keys(a).sort(),\n\t keysB = Object.keys(b).sort(),\n\t i, key;\n\t\n\t if (!equal(keysA, keysB)) {\n\t return false;\n\t }\n\t\n\t for (i = 0; i < keysA.length; i++) {\n\t key = keysA[i];\n\t\n\t if (!equal(a[key], b[key])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t}\n\t\n\tfunction equal(a, b) { // jshint ignore: line\n\t var typeA = typeof a,\n\t typeB = typeof b,\n\t i;\n\t\n\t // get detailed object type\n\t if (typeA === 'object') {\n\t typeA = type(a);\n\t }\n\t\n\t // get detailed object type\n\t if (typeB === 'object') {\n\t typeB = type(b);\n\t }\n\t\n\t if (typeA !== typeB) {\n\t return false;\n\t }\n\t\n\t if (typeA === 'object') {\n\t return deepEqual(a, b);\n\t }\n\t\n\t if (typeA === 'regexp') {\n\t return a.toString() === b.toString();\n\t }\n\t\n\t if (typeA === 'array') {\n\t if (a.length !== b.length) {\n\t return false;\n\t }\n\t\n\t for (i = 0; i < a.length; i++) {\n\t if (!equal(a[i], b[i])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t }\n\t\n\t return a === b;\n\t}\n\t\n\tmodule.exports = equal;\n\n/***/ },\n/* 14 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar equal = __webpack_require__(13);\n\t\n\tfunction findIndex(arr, value, comparator) {\n\t for (var i = 0, len = arr.length; i < len; i++) {\n\t if (comparator(arr[i], value)) {\n\t return i;\n\t }\n\t }\n\t\n\t return -1;\n\t}\n\t\n\tmodule.exports = function unique(arr) {\n\t return arr.filter(function uniqueOnly(value, index, self) {\n\t return findIndex(self, value, equal) === index;\n\t });\n\t};\n\t\n\tmodule.exports.findIndex = findIndex;\n\n/***/ },\n/* 15 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar url = __webpack_require__(16),\n\t metaschema = __webpack_require__(23),\n\t INVALID_SCHEMA_REFERENCE = 'jsen: invalid schema reference',\n\t DUPLICATE_SCHEMA_ID = 'jsen: duplicate schema id',\n\t CIRCULAR_SCHEMA_REFERENCE = 'jsen: circular schema reference';\n\t\n\tfunction get(obj, path) {\n\t if (!path.length) {\n\t return obj;\n\t }\n\t\n\t var key = path.shift(),\n\t val;\n\t\n\t if (obj && typeof obj === 'object' && obj.hasOwnProperty(key)) {\n\t val = obj[key];\n\t }\n\t\n\t if (path.length) {\n\t if (val && typeof val === 'object') {\n\t return get(val, path);\n\t }\n\t\n\t return undefined;\n\t }\n\t\n\t return val;\n\t}\n\t\n\tfunction refToObj(ref) {\n\t var index = ref.indexOf('#'),\n\t ret = {\n\t base: ref.substr(0, index),\n\t path: []\n\t };\n\t\n\t if (index < 0) {\n\t ret.base = ref;\n\t return ret;\n\t }\n\t\n\t ref = ref.substr(index + 1);\n\t\n\t if (!ref) {\n\t return ret;\n\t }\n\t\n\t ret.path = ref.split('/').map(function (segment) {\n\t // Reference: http://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-08#section-3\n\t return decodeURIComponent(segment)\n\t .replace(/~1/g, '/')\n\t .replace(/~0/g, '~');\n\t });\n\t\n\t if (ref[0] === '/') {\n\t ret.path.shift();\n\t }\n\t\n\t return ret;\n\t}\n\t\n\t// TODO: Can we prevent nested resolvers and combine schemas instead?\n\tfunction SchemaResolver(rootSchema, external, missing$Ref, baseId) { // jshint ignore: line\n\t this.rootSchema = rootSchema;\n\t this.resolvers = null;\n\t this.resolvedRootSchema = null;\n\t this.cache = {};\n\t this.idCache = {};\n\t this.refCache = { refs: [], schemas: [] };\n\t this.missing$Ref = missing$Ref;\n\t this.refStack = [];\n\t\n\t baseId = baseId || '';\n\t\n\t this._buildIdCache(rootSchema, baseId);\n\t\n\t // get updated base id after normalizing root schema id\n\t baseId = this.refCache.refs[this.refCache.schemas.indexOf(this.rootSchema)] || baseId;\n\t\n\t this._buildResolvers(external, baseId);\n\t}\n\t\n\tSchemaResolver.prototype._cacheId = function (id, schema, resolver) {\n\t if (this.idCache[id]) {\n\t throw new Error(DUPLICATE_SCHEMA_ID + ' ' + id);\n\t }\n\t\n\t this.idCache[id] = { resolver: resolver, schema: schema };\n\t};\n\t\n\tSchemaResolver.prototype._buildIdCache = function (schema, baseId) {\n\t var id = baseId,\n\t ref, keys, i;\n\t\n\t if (!schema || typeof schema !== 'object') {\n\t return;\n\t }\n\t\n\t if (typeof schema.id === 'string' && schema.id) {\n\t id = url.resolve(baseId, schema.id);\n\t\n\t this._cacheId(id, schema, this);\n\t }\n\t else if (schema === this.rootSchema && baseId) {\n\t this._cacheId(baseId, schema, this);\n\t }\n\t\n\t if (schema.$ref && typeof schema.$ref === 'string') {\n\t ref = url.resolve(id, schema.$ref);\n\t\n\t this.refCache.schemas.push(schema);\n\t this.refCache.refs.push(ref);\n\t }\n\t\n\t keys = Object.keys(schema);\n\t\n\t for (i = 0; i < keys.length; i++) {\n\t this._buildIdCache(schema[keys[i]], id);\n\t }\n\t};\n\t\n\tSchemaResolver.prototype._buildResolvers = function (schemas, baseId) {\n\t if (!schemas || typeof schemas !== 'object') {\n\t return;\n\t }\n\t\n\t var that = this,\n\t resolvers = {};\n\t\n\t Object.keys(schemas).forEach(function (key) {\n\t var id = url.resolve(baseId, key),\n\t resolver = new SchemaResolver(schemas[key], null, that.missing$Ref, id);\n\t\n\t that._cacheId(id, resolver.rootSchema, resolver);\n\t\n\t Object.keys(resolver.idCache).forEach(function (idKey) {\n\t that.idCache[idKey] = resolver.idCache[idKey];\n\t });\n\t\n\t resolvers[key] = resolver;\n\t });\n\t\n\t this.resolvers = resolvers;\n\t};\n\t\n\tSchemaResolver.prototype.getNormalizedRef = function (schema) {\n\t var index = this.refCache.schemas.indexOf(schema);\n\t return this.refCache.refs[index];\n\t};\n\t\n\tSchemaResolver.prototype._resolveRef = function (ref) {\n\t var err = new Error(INVALID_SCHEMA_REFERENCE + ' ' + ref),\n\t idCache = this.idCache,\n\t externalResolver, cached, descriptor, path, dest;\n\t\n\t if (!ref || typeof ref !== 'string') {\n\t throw err;\n\t }\n\t\n\t if (ref === metaschema.id) {\n\t dest = metaschema;\n\t }\n\t\n\t cached = idCache[ref];\n\t\n\t if (cached) {\n\t dest = cached.resolver.resolve(cached.schema);\n\t }\n\t\n\t if (dest === undefined) {\n\t descriptor = refToObj(ref);\n\t path = descriptor.path;\n\t\n\t if (descriptor.base) {\n\t cached = idCache[descriptor.base] || idCache[descriptor.base + '#'];\n\t\n\t if (cached) {\n\t dest = cached.resolver.resolve(get(cached.schema, path.slice(0)));\n\t }\n\t else {\n\t path.unshift(descriptor.base);\n\t }\n\t }\n\t }\n\t\n\t if (dest === undefined && this.resolvedRootSchema) {\n\t dest = get(this.resolvedRootSchema, path.slice(0));\n\t }\n\t\n\t if (dest === undefined) {\n\t dest = get(this.rootSchema, path.slice(0));\n\t }\n\t\n\t if (dest === undefined && path.length && this.resolvers) {\n\t externalResolver = get(this.resolvers, path);\n\t\n\t if (externalResolver) {\n\t dest = externalResolver.resolve(externalResolver.rootSchema);\n\t }\n\t }\n\t\n\t if (dest === undefined || typeof dest !== 'object') {\n\t if (this.missing$Ref) {\n\t dest = {};\n\t } else {\n\t throw err;\n\t }\n\t }\n\t\n\t if (this.cache[ref] === dest) {\n\t return dest;\n\t }\n\t\n\t this.cache[ref] = dest;\n\t\n\t if (dest.$ref !== undefined) {\n\t dest = this.resolve(dest);\n\t }\n\t\n\t return dest;\n\t};\n\t\n\tSchemaResolver.prototype.resolve = function (schema) {\n\t if (!schema || typeof schema !== 'object' || schema.$ref === undefined) {\n\t return schema;\n\t }\n\t\n\t var ref = this.getNormalizedRef(schema) || schema.$ref,\n\t resolved = this.cache[ref];\n\t\n\t if (resolved !== undefined) {\n\t return resolved;\n\t }\n\t\n\t if (this.refStack.indexOf(ref) > -1) {\n\t throw new Error(CIRCULAR_SCHEMA_REFERENCE + ' ' + ref);\n\t }\n\t\n\t this.refStack.push(ref);\n\t\n\t resolved = this._resolveRef(ref);\n\t\n\t this.refStack.pop();\n\t\n\t if (schema === this.rootSchema) {\n\t // cache the resolved root schema\n\t this.resolvedRootSchema = resolved;\n\t }\n\t\n\t return resolved;\n\t};\n\t\n\tSchemaResolver.prototype.hasRef = function (schema) {\n\t var keys = Object.keys(schema),\n\t len, key, i, hasChildRef;\n\t\n\t if (keys.indexOf('$ref') > -1) {\n\t return true;\n\t }\n\t\n\t for (i = 0, len = keys.length; i < len; i++) {\n\t key = keys[i];\n\t\n\t if (schema[key] && typeof schema[key] === 'object' && !Array.isArray(schema[key])) {\n\t hasChildRef = this.hasRef(schema[key]);\n\t\n\t if (hasChildRef) {\n\t return true;\n\t }\n\t }\n\t }\n\t\n\t return false;\n\t};\n\t\n\tSchemaResolver.resolvePointer = function (obj, pointer) {\n\t var descriptor = refToObj(pointer),\n\t path = descriptor.path;\n\t\n\t if (descriptor.base) {\n\t path = [descriptor.base].concat(path);\n\t }\n\t\n\t return get(obj, path);\n\t};\n\t\n\tmodule.exports = SchemaResolver;\n\n/***/ },\n/* 16 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t// Copyright Joyent, Inc. and other Node contributors.\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a\n\t// copy of this software and associated documentation files (the\n\t// \"Software\"), to deal in the Software without restriction, including\n\t// without limitation the rights to use, copy, modify, merge, publish,\n\t// distribute, sublicense, and/or sell copies of the Software, and to permit\n\t// persons to whom the Software is furnished to do so, subject to the\n\t// following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included\n\t// in all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n\t// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\t// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n\t// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n\t// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n\t// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n\t// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\t\n\t'use strict';\n\t\n\tvar punycode = __webpack_require__(17);\n\tvar util = __webpack_require__(19);\n\t\n\texports.parse = urlParse;\n\texports.resolve = urlResolve;\n\texports.resolveObject = urlResolveObject;\n\texports.format = urlFormat;\n\t\n\texports.Url = Url;\n\t\n\tfunction Url() {\n\t this.protocol = null;\n\t this.slashes = null;\n\t this.auth = null;\n\t this.host = null;\n\t this.port = null;\n\t this.hostname = null;\n\t this.hash = null;\n\t this.search = null;\n\t this.query = null;\n\t this.pathname = null;\n\t this.path = null;\n\t this.href = null;\n\t}\n\t\n\t// Reference: RFC 3986, RFC 1808, RFC 2396\n\t\n\t// define these here so at least they only have to be\n\t// compiled once on the first module load.\n\tvar protocolPattern = /^([a-z0-9.+-]+:)/i,\n\t portPattern = /:[0-9]*$/,\n\t\n\t // Special case for a simple path URL\n\t simplePathPattern = /^(\\/\\/?(?!\\/)[^\\?\\s]*)(\\?[^\\s]*)?$/,\n\t\n\t // RFC 2396: characters reserved for delimiting URLs.\n\t // We actually just auto-escape these.\n\t delims = ['<', '>', '\"', '`', ' ', '\\r', '\\n', '\\t'],\n\t\n\t // RFC 2396: characters not allowed for various reasons.\n\t unwise = ['{', '}', '|', '\\\\', '^', '`'].concat(delims),\n\t\n\t // Allowed by RFCs, but cause of XSS attacks. Always escape these.\n\t autoEscape = ['\\''].concat(unwise),\n\t // Characters that are never ever allowed in a hostname.\n\t // Note that any invalid chars are also handled, but these\n\t // are the ones that are *expected* to be seen, so we fast-path\n\t // them.\n\t nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape),\n\t hostEndingChars = ['/', '?', '#'],\n\t hostnameMaxLen = 255,\n\t hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,\n\t hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,\n\t // protocols that can allow \"unsafe\" and \"unwise\" chars.\n\t unsafeProtocol = {\n\t 'javascript': true,\n\t 'javascript:': true\n\t },\n\t // protocols that never have a hostname.\n\t hostlessProtocol = {\n\t 'javascript': true,\n\t 'javascript:': true\n\t },\n\t // protocols that always contain a // bit.\n\t slashedProtocol = {\n\t 'http': true,\n\t 'https': true,\n\t 'ftp': true,\n\t 'gopher': true,\n\t 'file': true,\n\t 'http:': true,\n\t 'https:': true,\n\t 'ftp:': true,\n\t 'gopher:': true,\n\t 'file:': true\n\t },\n\t querystring = __webpack_require__(20);\n\t\n\tfunction urlParse(url, parseQueryString, slashesDenoteHost) {\n\t if (url && util.isObject(url) && url instanceof Url) return url;\n\t\n\t var u = new Url;\n\t u.parse(url, parseQueryString, slashesDenoteHost);\n\t return u;\n\t}\n\t\n\tUrl.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {\n\t if (!util.isString(url)) {\n\t throw new TypeError(\"Parameter 'url' must be a string, not \" + typeof url);\n\t }\n\t\n\t // Copy chrome, IE, opera backslash-handling behavior.\n\t // Back slashes before the query string get converted to forward slashes\n\t // See: https://code.google.com/p/chromium/issues/detail?id=25916\n\t var queryIndex = url.indexOf('?'),\n\t splitter =\n\t (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#',\n\t uSplit = url.split(splitter),\n\t slashRegex = /\\\\/g;\n\t uSplit[0] = uSplit[0].replace(slashRegex, '/');\n\t url = uSplit.join(splitter);\n\t\n\t var rest = url;\n\t\n\t // trim before proceeding.\n\t // This is to support parse stuff like \" http://foo.com \\n\"\n\t rest = rest.trim();\n\t\n\t if (!slashesDenoteHost && url.split('#').length === 1) {\n\t // Try fast path regexp\n\t var simplePath = simplePathPattern.exec(rest);\n\t if (simplePath) {\n\t this.path = rest;\n\t this.href = rest;\n\t this.pathname = simplePath[1];\n\t if (simplePath[2]) {\n\t this.search = simplePath[2];\n\t if (parseQueryString) {\n\t this.query = querystring.parse(this.search.substr(1));\n\t } else {\n\t this.query = this.search.substr(1);\n\t }\n\t } else if (parseQueryString) {\n\t this.search = '';\n\t this.query = {};\n\t }\n\t return this;\n\t }\n\t }\n\t\n\t var proto = protocolPattern.exec(rest);\n\t if (proto) {\n\t proto = proto[0];\n\t var lowerProto = proto.toLowerCase();\n\t this.protocol = lowerProto;\n\t rest = rest.substr(proto.length);\n\t }\n\t\n\t // figure out if it's got a host\n\t // user@server is *always* interpreted as a hostname, and url\n\t // resolution will treat //foo/bar as host=foo,path=bar because that's\n\t // how the browser resolves relative URLs.\n\t if (slashesDenoteHost || proto || rest.match(/^\\/\\/[^@\\/]+@[^@\\/]+/)) {\n\t var slashes = rest.substr(0, 2) === '//';\n\t if (slashes && !(proto && hostlessProtocol[proto])) {\n\t rest = rest.substr(2);\n\t this.slashes = true;\n\t }\n\t }\n\t\n\t if (!hostlessProtocol[proto] &&\n\t (slashes || (proto && !slashedProtocol[proto]))) {\n\t\n\t // there's a hostname.\n\t // the first instance of /, ?, ;, or # ends the host.\n\t //\n\t // If there is an @ in the hostname, then non-host chars *are* allowed\n\t // to the left of the last @ sign, unless some host-ending character\n\t // comes *before* the @-sign.\n\t // URLs are obnoxious.\n\t //\n\t // ex:\n\t // http://a@b@c/ => user:a@b host:c\n\t // http://a@b?@c => user:a host:c path:/?@c\n\t\n\t // v0.12 TODO(isaacs): This is not quite how Chrome does things.\n\t // Review our test case against browsers more comprehensively.\n\t\n\t // find the first instance of any hostEndingChars\n\t var hostEnd = -1;\n\t for (var i = 0; i < hostEndingChars.length; i++) {\n\t var hec = rest.indexOf(hostEndingChars[i]);\n\t if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n\t hostEnd = hec;\n\t }\n\t\n\t // at this point, either we have an explicit point where the\n\t // auth portion cannot go past, or the last @ char is the decider.\n\t var auth, atSign;\n\t if (hostEnd === -1) {\n\t // atSign can be anywhere.\n\t atSign = rest.lastIndexOf('@');\n\t } else {\n\t // atSign must be in auth portion.\n\t // http://a@b/c@d => host:b auth:a path:/c@d\n\t atSign = rest.lastIndexOf('@', hostEnd);\n\t }\n\t\n\t // Now we have a portion which is definitely the auth.\n\t // Pull that off.\n\t if (atSign !== -1) {\n\t auth = rest.slice(0, atSign);\n\t rest = rest.slice(atSign + 1);\n\t this.auth = decodeURIComponent(auth);\n\t }\n\t\n\t // the host is the remaining to the left of the first non-host char\n\t hostEnd = -1;\n\t for (var i = 0; i < nonHostChars.length; i++) {\n\t var hec = rest.indexOf(nonHostChars[i]);\n\t if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n\t hostEnd = hec;\n\t }\n\t // if we still have not hit it, then the entire thing is a host.\n\t if (hostEnd === -1)\n\t hostEnd = rest.length;\n\t\n\t this.host = rest.slice(0, hostEnd);\n\t rest = rest.slice(hostEnd);\n\t\n\t // pull out port.\n\t this.parseHost();\n\t\n\t // we've indicated that there is a hostname,\n\t // so even if it's empty, it has to be present.\n\t this.hostname = this.hostname || '';\n\t\n\t // if hostname begins with [ and ends with ]\n\t // assume that it's an IPv6 address.\n\t var ipv6Hostname = this.hostname[0] === '[' &&\n\t this.hostname[this.hostname.length - 1] === ']';\n\t\n\t // validate a little.\n\t if (!ipv6Hostname) {\n\t var hostparts = this.hostname.split(/\\./);\n\t for (var i = 0, l = hostparts.length; i < l; i++) {\n\t var part = hostparts[i];\n\t if (!part) continue;\n\t if (!part.match(hostnamePartPattern)) {\n\t var newpart = '';\n\t for (var j = 0, k = part.length; j < k; j++) {\n\t if (part.charCodeAt(j) > 127) {\n\t // we replace non-ASCII char with a temporary placeholder\n\t // we need this to make sure size of hostname is not\n\t // broken by replacing non-ASCII by nothing\n\t newpart += 'x';\n\t } else {\n\t newpart += part[j];\n\t }\n\t }\n\t // we test again with ASCII char only\n\t if (!newpart.match(hostnamePartPattern)) {\n\t var validParts = hostparts.slice(0, i);\n\t var notHost = hostparts.slice(i + 1);\n\t var bit = part.match(hostnamePartStart);\n\t if (bit) {\n\t validParts.push(bit[1]);\n\t notHost.unshift(bit[2]);\n\t }\n\t if (notHost.length) {\n\t rest = '/' + notHost.join('.') + rest;\n\t }\n\t this.hostname = validParts.join('.');\n\t break;\n\t }\n\t }\n\t }\n\t }\n\t\n\t if (this.hostname.length > hostnameMaxLen) {\n\t this.hostname = '';\n\t } else {\n\t // hostnames are always lower case.\n\t this.hostname = this.hostname.toLowerCase();\n\t }\n\t\n\t if (!ipv6Hostname) {\n\t // IDNA Support: Returns a punycoded representation of \"domain\".\n\t // It only converts parts of the domain name that\n\t // have non-ASCII characters, i.e. it doesn't matter if\n\t // you call it with a domain that already is ASCII-only.\n\t this.hostname = punycode.toASCII(this.hostname);\n\t }\n\t\n\t var p = this.port ? ':' + this.port : '';\n\t var h = this.hostname || '';\n\t this.host = h + p;\n\t this.href += this.host;\n\t\n\t // strip [ and ] from the hostname\n\t // the host field still retains them, though\n\t if (ipv6Hostname) {\n\t this.hostname = this.hostname.substr(1, this.hostname.length - 2);\n\t if (rest[0] !== '/') {\n\t rest = '/' + rest;\n\t }\n\t }\n\t }\n\t\n\t // now rest is set to the post-host stuff.\n\t // chop off any delim chars.\n\t if (!unsafeProtocol[lowerProto]) {\n\t\n\t // First, make 100% sure that any \"autoEscape\" chars get\n\t // escaped, even if encodeURIComponent doesn't think they\n\t // need to be.\n\t for (var i = 0, l = autoEscape.length; i < l; i++) {\n\t var ae = autoEscape[i];\n\t if (rest.indexOf(ae) === -1)\n\t continue;\n\t var esc = encodeURIComponent(ae);\n\t if (esc === ae) {\n\t esc = escape(ae);\n\t }\n\t rest = rest.split(ae).join(esc);\n\t }\n\t }\n\t\n\t\n\t // chop off from the tail first.\n\t var hash = rest.indexOf('#');\n\t if (hash !== -1) {\n\t // got a fragment string.\n\t this.hash = rest.substr(hash);\n\t rest = rest.slice(0, hash);\n\t }\n\t var qm = rest.indexOf('?');\n\t if (qm !== -1) {\n\t this.search = rest.substr(qm);\n\t this.query = rest.substr(qm + 1);\n\t if (parseQueryString) {\n\t this.query = querystring.parse(this.query);\n\t }\n\t rest = rest.slice(0, qm);\n\t } else if (parseQueryString) {\n\t // no query string, but parseQueryString still requested\n\t this.search = '';\n\t this.query = {};\n\t }\n\t if (rest) this.pathname = rest;\n\t if (slashedProtocol[lowerProto] &&\n\t this.hostname && !this.pathname) {\n\t this.pathname = '/';\n\t }\n\t\n\t //to support http.request\n\t if (this.pathname || this.search) {\n\t var p = this.pathname || '';\n\t var s = this.search || '';\n\t this.path = p + s;\n\t }\n\t\n\t // finally, reconstruct the href based on what has been validated.\n\t this.href = this.format();\n\t return this;\n\t};\n\t\n\t// format a parsed object into a url string\n\tfunction urlFormat(obj) {\n\t // ensure it's an object, and not a string url.\n\t // If it's an obj, this is a no-op.\n\t // this way, you can call url_format() on strings\n\t // to clean up potentially wonky urls.\n\t if (util.isString(obj)) obj = urlParse(obj);\n\t if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n\t return obj.format();\n\t}\n\t\n\tUrl.prototype.format = function() {\n\t var auth = this.auth || '';\n\t if (auth) {\n\t auth = encodeURIComponent(auth);\n\t auth = auth.replace(/%3A/i, ':');\n\t auth += '@';\n\t }\n\t\n\t var protocol = this.protocol || '',\n\t pathname = this.pathname || '',\n\t hash = this.hash || '',\n\t host = false,\n\t query = '';\n\t\n\t if (this.host) {\n\t host = auth + this.host;\n\t } else if (this.hostname) {\n\t host = auth + (this.hostname.indexOf(':') === -1 ?\n\t this.hostname :\n\t '[' + this.hostname + ']');\n\t if (this.port) {\n\t host += ':' + this.port;\n\t }\n\t }\n\t\n\t if (this.query &&\n\t util.isObject(this.query) &&\n\t Object.keys(this.query).length) {\n\t query = querystring.stringify(this.query);\n\t }\n\t\n\t var search = this.search || (query && ('?' + query)) || '';\n\t\n\t if (protocol && protocol.substr(-1) !== ':') protocol += ':';\n\t\n\t // only the slashedProtocols get the //. Not mailto:, xmpp:, etc.\n\t // unless they had them to begin with.\n\t if (this.slashes ||\n\t (!protocol || slashedProtocol[protocol]) && host !== false) {\n\t host = '//' + (host || '');\n\t if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname;\n\t } else if (!host) {\n\t host = '';\n\t }\n\t\n\t if (hash && hash.charAt(0) !== '#') hash = '#' + hash;\n\t if (search && search.charAt(0) !== '?') search = '?' + search;\n\t\n\t pathname = pathname.replace(/[?#]/g, function(match) {\n\t return encodeURIComponent(match);\n\t });\n\t search = search.replace('#', '%23');\n\t\n\t return protocol + host + pathname + search + hash;\n\t};\n\t\n\tfunction urlResolve(source, relative) {\n\t return urlParse(source, false, true).resolve(relative);\n\t}\n\t\n\tUrl.prototype.resolve = function(relative) {\n\t return this.resolveObject(urlParse(relative, false, true)).format();\n\t};\n\t\n\tfunction urlResolveObject(source, relative) {\n\t if (!source) return relative;\n\t return urlParse(source, false, true).resolveObject(relative);\n\t}\n\t\n\tUrl.prototype.resolveObject = function(relative) {\n\t if (util.isString(relative)) {\n\t var rel = new Url();\n\t rel.parse(relative, false, true);\n\t relative = rel;\n\t }\n\t\n\t var result = new Url();\n\t var tkeys = Object.keys(this);\n\t for (var tk = 0; tk < tkeys.length; tk++) {\n\t var tkey = tkeys[tk];\n\t result[tkey] = this[tkey];\n\t }\n\t\n\t // hash is always overridden, no matter what.\n\t // even href=\"\" will remove it.\n\t result.hash = relative.hash;\n\t\n\t // if the relative url is empty, then there's nothing left to do here.\n\t if (relative.href === '') {\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t // hrefs like //foo/bar always cut to the protocol.\n\t if (relative.slashes && !relative.protocol) {\n\t // take everything except the protocol from relative\n\t var rkeys = Object.keys(relative);\n\t for (var rk = 0; rk < rkeys.length; rk++) {\n\t var rkey = rkeys[rk];\n\t if (rkey !== 'protocol')\n\t result[rkey] = relative[rkey];\n\t }\n\t\n\t //urlParse appends trailing / to urls like http://www.example.com\n\t if (slashedProtocol[result.protocol] &&\n\t result.hostname && !result.pathname) {\n\t result.path = result.pathname = '/';\n\t }\n\t\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t if (relative.protocol && relative.protocol !== result.protocol) {\n\t // if it's a known url protocol, then changing\n\t // the protocol does weird things\n\t // first, if it's not file:, then we MUST have a host,\n\t // and if there was a path\n\t // to begin with, then we MUST have a path.\n\t // if it is file:, then the host is dropped,\n\t // because that's known to be hostless.\n\t // anything else is assumed to be absolute.\n\t if (!slashedProtocol[relative.protocol]) {\n\t var keys = Object.keys(relative);\n\t for (var v = 0; v < keys.length; v++) {\n\t var k = keys[v];\n\t result[k] = relative[k];\n\t }\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t result.protocol = relative.protocol;\n\t if (!relative.host && !hostlessProtocol[relative.protocol]) {\n\t var relPath = (relative.pathname || '').split('/');\n\t while (relPath.length && !(relative.host = relPath.shift()));\n\t if (!relative.host) relative.host = '';\n\t if (!relative.hostname) relative.hostname = '';\n\t if (relPath[0] !== '') relPath.unshift('');\n\t if (relPath.length < 2) relPath.unshift('');\n\t result.pathname = relPath.join('/');\n\t } else {\n\t result.pathname = relative.pathname;\n\t }\n\t result.search = relative.search;\n\t result.query = relative.query;\n\t result.host = relative.host || '';\n\t result.auth = relative.auth;\n\t result.hostname = relative.hostname || relative.host;\n\t result.port = relative.port;\n\t // to support http.request\n\t if (result.pathname || result.search) {\n\t var p = result.pathname || '';\n\t var s = result.search || '';\n\t result.path = p + s;\n\t }\n\t result.slashes = result.slashes || relative.slashes;\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'),\n\t isRelAbs = (\n\t relative.host ||\n\t relative.pathname && relative.pathname.charAt(0) === '/'\n\t ),\n\t mustEndAbs = (isRelAbs || isSourceAbs ||\n\t (result.host && relative.pathname)),\n\t removeAllDots = mustEndAbs,\n\t srcPath = result.pathname && result.pathname.split('/') || [],\n\t relPath = relative.pathname && relative.pathname.split('/') || [],\n\t psychotic = result.protocol && !slashedProtocol[result.protocol];\n\t\n\t // if the url is a non-slashed url, then relative\n\t // links like ../.. should be able\n\t // to crawl up to the hostname, as well. This is strange.\n\t // result.protocol has already been set by now.\n\t // Later on, put the first path part into the host field.\n\t if (psychotic) {\n\t result.hostname = '';\n\t result.port = null;\n\t if (result.host) {\n\t if (srcPath[0] === '') srcPath[0] = result.host;\n\t else srcPath.unshift(result.host);\n\t }\n\t result.host = '';\n\t if (relative.protocol) {\n\t relative.hostname = null;\n\t relative.port = null;\n\t if (relative.host) {\n\t if (relPath[0] === '') relPath[0] = relative.host;\n\t else relPath.unshift(relative.host);\n\t }\n\t relative.host = null;\n\t }\n\t mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === '');\n\t }\n\t\n\t if (isRelAbs) {\n\t // it's absolute.\n\t result.host = (relative.host || relative.host === '') ?\n\t relative.host : result.host;\n\t result.hostname = (relative.hostname || relative.hostname === '') ?\n\t relative.hostname : result.hostname;\n\t result.search = relative.search;\n\t result.query = relative.query;\n\t srcPath = relPath;\n\t // fall through to the dot-handling below.\n\t } else if (relPath.length) {\n\t // it's relative\n\t // throw away the existing file, and take the new path instead.\n\t if (!srcPath) srcPath = [];\n\t srcPath.pop();\n\t srcPath = srcPath.concat(relPath);\n\t result.search = relative.search;\n\t result.query = relative.query;\n\t } else if (!util.isNullOrUndefined(relative.search)) {\n\t // just pull out the search.\n\t // like href='https://github.com/?foo'.\n\t // Put this after the other two cases because it simplifies the booleans\n\t if (psychotic) {\n\t result.hostname = result.host = srcPath.shift();\n\t //occationaly the auth can get stuck only in host\n\t //this especially happens in cases like\n\t //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n\t var authInHost = result.host && result.host.indexOf('@') > 0 ?\n\t result.host.split('@') : false;\n\t if (authInHost) {\n\t result.auth = authInHost.shift();\n\t result.host = result.hostname = authInHost.shift();\n\t }\n\t }\n\t result.search = relative.search;\n\t result.query = relative.query;\n\t //to support http.request\n\t if (!util.isNull(result.pathname) || !util.isNull(result.search)) {\n\t result.path = (result.pathname ? result.pathname : '') +\n\t (result.search ? result.search : '');\n\t }\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t if (!srcPath.length) {\n\t // no path at all. easy.\n\t // we've already handled the other stuff above.\n\t result.pathname = null;\n\t //to support http.request\n\t if (result.search) {\n\t result.path = '/' + result.search;\n\t } else {\n\t result.path = null;\n\t }\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t // if a url ENDs in . or .., then it must get a trailing slash.\n\t // however, if it ends in anything else non-slashy,\n\t // then it must NOT get a trailing slash.\n\t var last = srcPath.slice(-1)[0];\n\t var hasTrailingSlash = (\n\t (result.host || relative.host || srcPath.length > 1) &&\n\t (last === '.' || last === '..') || last === '');\n\t\n\t // strip single dots, resolve double dots to parent dir\n\t // if the path tries to go above the root, `up` ends up > 0\n\t var up = 0;\n\t for (var i = srcPath.length; i >= 0; i--) {\n\t last = srcPath[i];\n\t if (last === '.') {\n\t srcPath.splice(i, 1);\n\t } else if (last === '..') {\n\t srcPath.splice(i, 1);\n\t up++;\n\t } else if (up) {\n\t srcPath.splice(i, 1);\n\t up--;\n\t }\n\t }\n\t\n\t // if the path is allowed to go above the root, restore leading ..s\n\t if (!mustEndAbs && !removeAllDots) {\n\t for (; up--; up) {\n\t srcPath.unshift('..');\n\t }\n\t }\n\t\n\t if (mustEndAbs && srcPath[0] !== '' &&\n\t (!srcPath[0] || srcPath[0].charAt(0) !== '/')) {\n\t srcPath.unshift('');\n\t }\n\t\n\t if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) {\n\t srcPath.push('');\n\t }\n\t\n\t var isAbsolute = srcPath[0] === '' ||\n\t (srcPath[0] && srcPath[0].charAt(0) === '/');\n\t\n\t // put the host back\n\t if (psychotic) {\n\t result.hostname = result.host = isAbsolute ? '' :\n\t srcPath.length ? srcPath.shift() : '';\n\t //occationaly the auth can get stuck only in host\n\t //this especially happens in cases like\n\t //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n\t var authInHost = result.host && result.host.indexOf('@') > 0 ?\n\t result.host.split('@') : false;\n\t if (authInHost) {\n\t result.auth = authInHost.shift();\n\t result.host = result.hostname = authInHost.shift();\n\t }\n\t }\n\t\n\t mustEndAbs = mustEndAbs || (result.host && srcPath.length);\n\t\n\t if (mustEndAbs && !isAbsolute) {\n\t srcPath.unshift('');\n\t }\n\t\n\t if (!srcPath.length) {\n\t result.pathname = null;\n\t result.path = null;\n\t } else {\n\t result.pathname = srcPath.join('/');\n\t }\n\t\n\t //to support request.http\n\t if (!util.isNull(result.pathname) || !util.isNull(result.search)) {\n\t result.path = (result.pathname ? result.pathname : '') +\n\t (result.search ? result.search : '');\n\t }\n\t result.auth = relative.auth || result.auth;\n\t result.slashes = result.slashes || relative.slashes;\n\t result.href = result.format();\n\t return result;\n\t};\n\t\n\tUrl.prototype.parseHost = function() {\n\t var host = this.host;\n\t var port = portPattern.exec(host);\n\t if (port) {\n\t port = port[0];\n\t if (port !== ':') {\n\t this.port = port.substr(1);\n\t }\n\t host = host.substr(0, host.length - port.length);\n\t }\n\t if (host) this.hostname = host;\n\t};\n\n\n/***/ },\n/* 17 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(module, global) {/*! https://mths.be/punycode v1.3.2 by @mathias */\n\t;(function(root) {\n\t\n\t\t/** Detect free variables */\n\t\tvar freeExports = typeof exports == 'object' && exports &&\n\t\t\t!exports.nodeType && exports;\n\t\tvar freeModule = typeof module == 'object' && module &&\n\t\t\t!module.nodeType && module;\n\t\tvar freeGlobal = typeof global == 'object' && global;\n\t\tif (\n\t\t\tfreeGlobal.global === freeGlobal ||\n\t\t\tfreeGlobal.window === freeGlobal ||\n\t\t\tfreeGlobal.self === freeGlobal\n\t\t) {\n\t\t\troot = freeGlobal;\n\t\t}\n\t\n\t\t/**\n\t\t * The `punycode` object.\n\t\t * @name punycode\n\t\t * @type Object\n\t\t */\n\t\tvar punycode,\n\t\n\t\t/** Highest positive signed 32-bit float value */\n\t\tmaxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1\n\t\n\t\t/** Bootstring parameters */\n\t\tbase = 36,\n\t\ttMin = 1,\n\t\ttMax = 26,\n\t\tskew = 38,\n\t\tdamp = 700,\n\t\tinitialBias = 72,\n\t\tinitialN = 128, // 0x80\n\t\tdelimiter = '-', // '\\x2D'\n\t\n\t\t/** Regular expressions */\n\t\tregexPunycode = /^xn--/,\n\t\tregexNonASCII = /[^\\x20-\\x7E]/, // unprintable ASCII chars + non-ASCII chars\n\t\tregexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g, // RFC 3490 separators\n\t\n\t\t/** Error messages */\n\t\terrors = {\n\t\t\t'overflow': 'Overflow: input needs wider integers to process',\n\t\t\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t\t\t'invalid-input': 'Invalid input'\n\t\t},\n\t\n\t\t/** Convenience shortcuts */\n\t\tbaseMinusTMin = base - tMin,\n\t\tfloor = Math.floor,\n\t\tstringFromCharCode = String.fromCharCode,\n\t\n\t\t/** Temporary variable */\n\t\tkey;\n\t\n\t\t/*--------------------------------------------------------------------------*/\n\t\n\t\t/**\n\t\t * A generic error utility function.\n\t\t * @private\n\t\t * @param {String} type The error type.\n\t\t * @returns {Error} Throws a `RangeError` with the applicable error message.\n\t\t */\n\t\tfunction error(type) {\n\t\t\tthrow RangeError(errors[type]);\n\t\t}\n\t\n\t\t/**\n\t\t * A generic `Array#map` utility function.\n\t\t * @private\n\t\t * @param {Array} array The array to iterate over.\n\t\t * @param {Function} callback The function that gets called for every array\n\t\t * item.\n\t\t * @returns {Array} A new array of values returned by the callback function.\n\t\t */\n\t\tfunction map(array, fn) {\n\t\t\tvar length = array.length;\n\t\t\tvar result = [];\n\t\t\twhile (length--) {\n\t\t\t\tresult[length] = fn(array[length]);\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\n\t\t/**\n\t\t * A simple `Array#map`-like wrapper to work with domain name strings or email\n\t\t * addresses.\n\t\t * @private\n\t\t * @param {String} domain The domain name or email address.\n\t\t * @param {Function} callback The function that gets called for every\n\t\t * character.\n\t\t * @returns {Array} A new string of characters returned by the callback\n\t\t * function.\n\t\t */\n\t\tfunction mapDomain(string, fn) {\n\t\t\tvar parts = string.split('@');\n\t\t\tvar result = '';\n\t\t\tif (parts.length > 1) {\n\t\t\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t\t\t// the local part (i.e. everything up to `@`) intact.\n\t\t\t\tresult = parts[0] + '@';\n\t\t\t\tstring = parts[1];\n\t\t\t}\n\t\t\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\t\t\tstring = string.replace(regexSeparators, '\\x2E');\n\t\t\tvar labels = string.split('.');\n\t\t\tvar encoded = map(labels, fn).join('.');\n\t\t\treturn result + encoded;\n\t\t}\n\t\n\t\t/**\n\t\t * Creates an array containing the numeric code points of each Unicode\n\t\t * character in the string. While JavaScript uses UCS-2 internally,\n\t\t * this function will convert a pair of surrogate halves (each of which\n\t\t * UCS-2 exposes as separate characters) into a single code point,\n\t\t * matching UTF-16.\n\t\t * @see `punycode.ucs2.encode`\n\t\t * @see \n\t\t * @memberOf punycode.ucs2\n\t\t * @name decode\n\t\t * @param {String} string The Unicode input string (UCS-2).\n\t\t * @returns {Array} The new array of code points.\n\t\t */\n\t\tfunction ucs2decode(string) {\n\t\t\tvar output = [],\n\t\t\t counter = 0,\n\t\t\t length = string.length,\n\t\t\t value,\n\t\t\t extra;\n\t\t\twhile (counter < length) {\n\t\t\t\tvalue = string.charCodeAt(counter++);\n\t\t\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t\t\t// high surrogate, and there is a next character\n\t\t\t\t\textra = string.charCodeAt(counter++);\n\t\t\t\t\tif ((extra & 0xFC00) == 0xDC00) { // low surrogate\n\t\t\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// unmatched surrogate; only append this code unit, in case the next\n\t\t\t\t\t\t// code unit is the high surrogate of a surrogate pair\n\t\t\t\t\t\toutput.push(value);\n\t\t\t\t\t\tcounter--;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\toutput.push(value);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn output;\n\t\t}\n\t\n\t\t/**\n\t\t * Creates a string based on an array of numeric code points.\n\t\t * @see `punycode.ucs2.decode`\n\t\t * @memberOf punycode.ucs2\n\t\t * @name encode\n\t\t * @param {Array} codePoints The array of numeric code points.\n\t\t * @returns {String} The new Unicode string (UCS-2).\n\t\t */\n\t\tfunction ucs2encode(array) {\n\t\t\treturn map(array, function(value) {\n\t\t\t\tvar output = '';\n\t\t\t\tif (value > 0xFFFF) {\n\t\t\t\t\tvalue -= 0x10000;\n\t\t\t\t\toutput += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);\n\t\t\t\t\tvalue = 0xDC00 | value & 0x3FF;\n\t\t\t\t}\n\t\t\t\toutput += stringFromCharCode(value);\n\t\t\t\treturn output;\n\t\t\t}).join('');\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a basic code point into a digit/integer.\n\t\t * @see `digitToBasic()`\n\t\t * @private\n\t\t * @param {Number} codePoint The basic numeric code point value.\n\t\t * @returns {Number} The numeric value of a basic code point (for use in\n\t\t * representing integers) in the range `0` to `base - 1`, or `base` if\n\t\t * the code point does not represent a value.\n\t\t */\n\t\tfunction basicToDigit(codePoint) {\n\t\t\tif (codePoint - 48 < 10) {\n\t\t\t\treturn codePoint - 22;\n\t\t\t}\n\t\t\tif (codePoint - 65 < 26) {\n\t\t\t\treturn codePoint - 65;\n\t\t\t}\n\t\t\tif (codePoint - 97 < 26) {\n\t\t\t\treturn codePoint - 97;\n\t\t\t}\n\t\t\treturn base;\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a digit/integer into a basic code point.\n\t\t * @see `basicToDigit()`\n\t\t * @private\n\t\t * @param {Number} digit The numeric value of a basic code point.\n\t\t * @returns {Number} The basic code point whose value (when used for\n\t\t * representing integers) is `digit`, which needs to be in the range\n\t\t * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n\t\t * used; else, the lowercase form is used. The behavior is undefined\n\t\t * if `flag` is non-zero and `digit` has no uppercase form.\n\t\t */\n\t\tfunction digitToBasic(digit, flag) {\n\t\t\t// 0..25 map to ASCII a..z or A..Z\n\t\t\t// 26..35 map to ASCII 0..9\n\t\t\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n\t\t}\n\t\n\t\t/**\n\t\t * Bias adaptation function as per section 3.4 of RFC 3492.\n\t\t * http://tools.ietf.org/html/rfc3492#section-3.4\n\t\t * @private\n\t\t */\n\t\tfunction adapt(delta, numPoints, firstTime) {\n\t\t\tvar k = 0;\n\t\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\t\tdelta += floor(delta / numPoints);\n\t\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t\t}\n\t\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n\t\t * symbols.\n\t\t * @memberOf punycode\n\t\t * @param {String} input The Punycode string of ASCII-only symbols.\n\t\t * @returns {String} The resulting string of Unicode symbols.\n\t\t */\n\t\tfunction decode(input) {\n\t\t\t// Don't use UCS-2\n\t\t\tvar output = [],\n\t\t\t inputLength = input.length,\n\t\t\t out,\n\t\t\t i = 0,\n\t\t\t n = initialN,\n\t\t\t bias = initialBias,\n\t\t\t basic,\n\t\t\t j,\n\t\t\t index,\n\t\t\t oldi,\n\t\t\t w,\n\t\t\t k,\n\t\t\t digit,\n\t\t\t t,\n\t\t\t /** Cached calculation results */\n\t\t\t baseMinusT;\n\t\n\t\t\t// Handle the basic code points: let `basic` be the number of input code\n\t\t\t// points before the last delimiter, or `0` if there is none, then copy\n\t\t\t// the first basic code points to the output.\n\t\n\t\t\tbasic = input.lastIndexOf(delimiter);\n\t\t\tif (basic < 0) {\n\t\t\t\tbasic = 0;\n\t\t\t}\n\t\n\t\t\tfor (j = 0; j < basic; ++j) {\n\t\t\t\t// if it's not a basic code point\n\t\t\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\t\t\terror('not-basic');\n\t\t\t\t}\n\t\t\t\toutput.push(input.charCodeAt(j));\n\t\t\t}\n\t\n\t\t\t// Main decoding loop: start just after the last delimiter if any basic code\n\t\t\t// points were copied; start at the beginning otherwise.\n\t\n\t\t\tfor (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\t\n\t\t\t\t// `index` is the index of the next character to be consumed.\n\t\t\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t\t\t// which gets added to `i`. The overflow checking is easier\n\t\t\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t\t\t// value at the end to obtain `delta`.\n\t\t\t\tfor (oldi = i, w = 1, k = base; /* no condition */; k += base) {\n\t\n\t\t\t\t\tif (index >= inputLength) {\n\t\t\t\t\t\terror('invalid-input');\n\t\t\t\t\t}\n\t\n\t\t\t\t\tdigit = basicToDigit(input.charCodeAt(index++));\n\t\n\t\t\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\t\t\terror('overflow');\n\t\t\t\t\t}\n\t\n\t\t\t\t\ti += digit * w;\n\t\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\n\t\t\t\t\tif (digit < t) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tbaseMinusT = base - t;\n\t\t\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\t\t\terror('overflow');\n\t\t\t\t\t}\n\t\n\t\t\t\t\tw *= baseMinusT;\n\t\n\t\t\t\t}\n\t\n\t\t\t\tout = output.length + 1;\n\t\t\t\tbias = adapt(i - oldi, out, oldi == 0);\n\t\n\t\t\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t\t\t// incrementing `n` each time, so we'll fix that now:\n\t\t\t\tif (floor(i / out) > maxInt - n) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\t\n\t\t\t\tn += floor(i / out);\n\t\t\t\ti %= out;\n\t\n\t\t\t\t// Insert `n` at position `i` of the output\n\t\t\t\toutput.splice(i++, 0, n);\n\t\n\t\t\t}\n\t\n\t\t\treturn ucs2encode(output);\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a string of Unicode symbols (e.g. a domain name label) to a\n\t\t * Punycode string of ASCII-only symbols.\n\t\t * @memberOf punycode\n\t\t * @param {String} input The string of Unicode symbols.\n\t\t * @returns {String} The resulting Punycode string of ASCII-only symbols.\n\t\t */\n\t\tfunction encode(input) {\n\t\t\tvar n,\n\t\t\t delta,\n\t\t\t handledCPCount,\n\t\t\t basicLength,\n\t\t\t bias,\n\t\t\t j,\n\t\t\t m,\n\t\t\t q,\n\t\t\t k,\n\t\t\t t,\n\t\t\t currentValue,\n\t\t\t output = [],\n\t\t\t /** `inputLength` will hold the number of code points in `input`. */\n\t\t\t inputLength,\n\t\t\t /** Cached calculation results */\n\t\t\t handledCPCountPlusOne,\n\t\t\t baseMinusT,\n\t\t\t qMinusT;\n\t\n\t\t\t// Convert the input in UCS-2 to Unicode\n\t\t\tinput = ucs2decode(input);\n\t\n\t\t\t// Cache the length\n\t\t\tinputLength = input.length;\n\t\n\t\t\t// Initialize the state\n\t\t\tn = initialN;\n\t\t\tdelta = 0;\n\t\t\tbias = initialBias;\n\t\n\t\t\t// Handle the basic code points\n\t\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\t\tcurrentValue = input[j];\n\t\t\t\tif (currentValue < 0x80) {\n\t\t\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\thandledCPCount = basicLength = output.length;\n\t\n\t\t\t// `handledCPCount` is the number of code points that have been handled;\n\t\t\t// `basicLength` is the number of basic code points.\n\t\n\t\t\t// Finish the basic string - if it is not empty - with a delimiter\n\t\t\tif (basicLength) {\n\t\t\t\toutput.push(delimiter);\n\t\t\t}\n\t\n\t\t\t// Main encoding loop:\n\t\t\twhile (handledCPCount < inputLength) {\n\t\n\t\t\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t\t\t// larger one:\n\t\t\t\tfor (m = maxInt, j = 0; j < inputLength; ++j) {\n\t\t\t\t\tcurrentValue = input[j];\n\t\t\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\t\t\tm = currentValue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\t// Increase `delta` enough to advance the decoder's state to ,\n\t\t\t\t// but guard against overflow\n\t\t\t\thandledCPCountPlusOne = handledCPCount + 1;\n\t\t\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\t\n\t\t\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\t\t\tn = m;\n\t\n\t\t\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\t\t\tcurrentValue = input[j];\n\t\n\t\t\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\t\t\terror('overflow');\n\t\t\t\t\t}\n\t\n\t\t\t\t\tif (currentValue == n) {\n\t\t\t\t\t\t// Represent delta as a generalized variable-length integer\n\t\t\t\t\t\tfor (q = delta, k = base; /* no condition */; k += base) {\n\t\t\t\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tqMinusT = q - t;\n\t\t\t\t\t\t\tbaseMinusT = base - t;\n\t\t\t\t\t\t\toutput.push(\n\t\t\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\t\t\tdelta = 0;\n\t\t\t\t\t\t++handledCPCount;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\t++delta;\n\t\t\t\t++n;\n\t\n\t\t\t}\n\t\t\treturn output.join('');\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a Punycode string representing a domain name or an email address\n\t\t * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n\t\t * it doesn't matter if you call it on a string that has already been\n\t\t * converted to Unicode.\n\t\t * @memberOf punycode\n\t\t * @param {String} input The Punycoded domain name or email address to\n\t\t * convert to Unicode.\n\t\t * @returns {String} The Unicode representation of the given Punycode\n\t\t * string.\n\t\t */\n\t\tfunction toUnicode(input) {\n\t\t\treturn mapDomain(input, function(string) {\n\t\t\t\treturn regexPunycode.test(string)\n\t\t\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t\t\t: string;\n\t\t\t});\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a Unicode string representing a domain name or an email address to\n\t\t * Punycode. Only the non-ASCII parts of the domain name will be converted,\n\t\t * i.e. it doesn't matter if you call it with a domain that's already in\n\t\t * ASCII.\n\t\t * @memberOf punycode\n\t\t * @param {String} input The domain name or email address to convert, as a\n\t\t * Unicode string.\n\t\t * @returns {String} The Punycode representation of the given domain name or\n\t\t * email address.\n\t\t */\n\t\tfunction toASCII(input) {\n\t\t\treturn mapDomain(input, function(string) {\n\t\t\t\treturn regexNonASCII.test(string)\n\t\t\t\t\t? 'xn--' + encode(string)\n\t\t\t\t\t: string;\n\t\t\t});\n\t\t}\n\t\n\t\t/*--------------------------------------------------------------------------*/\n\t\n\t\t/** Define the public API */\n\t\tpunycode = {\n\t\t\t/**\n\t\t\t * A string representing the current Punycode.js version number.\n\t\t\t * @memberOf punycode\n\t\t\t * @type String\n\t\t\t */\n\t\t\t'version': '1.3.2',\n\t\t\t/**\n\t\t\t * An object of methods to convert from JavaScript's internal character\n\t\t\t * representation (UCS-2) to Unicode code points, and back.\n\t\t\t * @see \n\t\t\t * @memberOf punycode\n\t\t\t * @type Object\n\t\t\t */\n\t\t\t'ucs2': {\n\t\t\t\t'decode': ucs2decode,\n\t\t\t\t'encode': ucs2encode\n\t\t\t},\n\t\t\t'decode': decode,\n\t\t\t'encode': encode,\n\t\t\t'toASCII': toASCII,\n\t\t\t'toUnicode': toUnicode\n\t\t};\n\t\n\t\t/** Expose `punycode` */\n\t\t// Some AMD build optimizers, like r.js, check for specific condition patterns\n\t\t// like the following:\n\t\tif (\n\t\t\ttrue\n\t\t) {\n\t\t\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function() {\n\t\t\t\treturn punycode;\n\t\t\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t\t} else if (freeExports && freeModule) {\n\t\t\tif (module.exports == freeExports) { // in Node.js or RingoJS v0.8.0+\n\t\t\t\tfreeModule.exports = punycode;\n\t\t\t} else { // in Narwhal or RingoJS v0.7.0-\n\t\t\t\tfor (key in punycode) {\n\t\t\t\t\tpunycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]);\n\t\t\t\t}\n\t\t\t}\n\t\t} else { // in Rhino or a web browser\n\t\t\troot.punycode = punycode;\n\t\t}\n\t\n\t}(this));\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(18)(module), (function() { return this; }())))\n\n/***/ },\n/* 18 */\n/***/ function(module, exports) {\n\n\tmodule.exports = function(module) {\r\n\t\tif(!module.webpackPolyfill) {\r\n\t\t\tmodule.deprecate = function() {};\r\n\t\t\tmodule.paths = [];\r\n\t\t\t// module.parent = undefined by default\r\n\t\t\tmodule.children = [];\r\n\t\t\tmodule.webpackPolyfill = 1;\r\n\t\t}\r\n\t\treturn module;\r\n\t}\r\n\n\n/***/ },\n/* 19 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = {\n\t isString: function(arg) {\n\t return typeof(arg) === 'string';\n\t },\n\t isObject: function(arg) {\n\t return typeof(arg) === 'object' && arg !== null;\n\t },\n\t isNull: function(arg) {\n\t return arg === null;\n\t },\n\t isNullOrUndefined: function(arg) {\n\t return arg == null;\n\t }\n\t};\n\n\n/***/ },\n/* 20 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\texports.decode = exports.parse = __webpack_require__(21);\n\texports.encode = exports.stringify = __webpack_require__(22);\n\n\n/***/ },\n/* 21 */\n/***/ function(module, exports) {\n\n\t// Copyright Joyent, Inc. and other Node contributors.\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a\n\t// copy of this software and associated documentation files (the\n\t// \"Software\"), to deal in the Software without restriction, including\n\t// without limitation the rights to use, copy, modify, merge, publish,\n\t// distribute, sublicense, and/or sell copies of the Software, and to permit\n\t// persons to whom the Software is furnished to do so, subject to the\n\t// following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included\n\t// in all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n\t// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\t// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n\t// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n\t// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n\t// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n\t// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\t\n\t'use strict';\n\t\n\t// If obj.hasOwnProperty has been overridden, then calling\n\t// obj.hasOwnProperty(prop) will break.\n\t// See: https://github.com/joyent/node/issues/1707\n\tfunction hasOwnProperty(obj, prop) {\n\t return Object.prototype.hasOwnProperty.call(obj, prop);\n\t}\n\t\n\tmodule.exports = function(qs, sep, eq, options) {\n\t sep = sep || '&';\n\t eq = eq || '=';\n\t var obj = {};\n\t\n\t if (typeof qs !== 'string' || qs.length === 0) {\n\t return obj;\n\t }\n\t\n\t var regexp = /\\+/g;\n\t qs = qs.split(sep);\n\t\n\t var maxKeys = 1000;\n\t if (options && typeof options.maxKeys === 'number') {\n\t maxKeys = options.maxKeys;\n\t }\n\t\n\t var len = qs.length;\n\t // maxKeys <= 0 means that we should not limit keys count\n\t if (maxKeys > 0 && len > maxKeys) {\n\t len = maxKeys;\n\t }\n\t\n\t for (var i = 0; i < len; ++i) {\n\t var x = qs[i].replace(regexp, '%20'),\n\t idx = x.indexOf(eq),\n\t kstr, vstr, k, v;\n\t\n\t if (idx >= 0) {\n\t kstr = x.substr(0, idx);\n\t vstr = x.substr(idx + 1);\n\t } else {\n\t kstr = x;\n\t vstr = '';\n\t }\n\t\n\t k = decodeURIComponent(kstr);\n\t v = decodeURIComponent(vstr);\n\t\n\t if (!hasOwnProperty(obj, k)) {\n\t obj[k] = v;\n\t } else if (Array.isArray(obj[k])) {\n\t obj[k].push(v);\n\t } else {\n\t obj[k] = [obj[k], v];\n\t }\n\t }\n\t\n\t return obj;\n\t};\n\n\n/***/ },\n/* 22 */\n/***/ function(module, exports) {\n\n\t// Copyright Joyent, Inc. and other Node contributors.\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a\n\t// copy of this software and associated documentation files (the\n\t// \"Software\"), to deal in the Software without restriction, including\n\t// without limitation the rights to use, copy, modify, merge, publish,\n\t// distribute, sublicense, and/or sell copies of the Software, and to permit\n\t// persons to whom the Software is furnished to do so, subject to the\n\t// following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included\n\t// in all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n\t// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\t// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n\t// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n\t// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n\t// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n\t// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\t\n\t'use strict';\n\t\n\tvar stringifyPrimitive = function(v) {\n\t switch (typeof v) {\n\t case 'string':\n\t return v;\n\t\n\t case 'boolean':\n\t return v ? 'true' : 'false';\n\t\n\t case 'number':\n\t return isFinite(v) ? v : '';\n\t\n\t default:\n\t return '';\n\t }\n\t};\n\t\n\tmodule.exports = function(obj, sep, eq, name) {\n\t sep = sep || '&';\n\t eq = eq || '=';\n\t if (obj === null) {\n\t obj = undefined;\n\t }\n\t\n\t if (typeof obj === 'object') {\n\t return Object.keys(obj).map(function(k) {\n\t var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;\n\t if (Array.isArray(obj[k])) {\n\t return obj[k].map(function(v) {\n\t return ks + encodeURIComponent(stringifyPrimitive(v));\n\t }).join(sep);\n\t } else {\n\t return ks + encodeURIComponent(stringifyPrimitive(obj[k]));\n\t }\n\t }).join(sep);\n\t\n\t }\n\t\n\t if (!name) return '';\n\t return encodeURIComponent(stringifyPrimitive(name)) + eq +\n\t encodeURIComponent(stringifyPrimitive(obj));\n\t};\n\n\n/***/ },\n/* 23 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"id\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"description\": \"Core schema meta-schema\",\n\t\t\"definitions\": {\n\t\t\t\"schemaArray\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"minItems\": 1,\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"positiveInteger\": {\n\t\t\t\t\"type\": \"integer\",\n\t\t\t\t\"minimum\": 0\n\t\t\t},\n\t\t\t\"positiveIntegerDefault0\": {\n\t\t\t\t\"allOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#/definitions/positiveInteger\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"default\": 0\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"simpleTypes\": {\n\t\t\t\t\"enum\": [\n\t\t\t\t\t\"array\",\n\t\t\t\t\t\"boolean\",\n\t\t\t\t\t\"integer\",\n\t\t\t\t\t\"null\",\n\t\t\t\t\t\"number\",\n\t\t\t\t\t\"object\",\n\t\t\t\t\t\"string\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"stringArray\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t},\n\t\t\t\t\"minItems\": 1,\n\t\t\t\t\"uniqueItems\": true\n\t\t\t}\n\t\t},\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"id\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"uri\"\n\t\t\t},\n\t\t\t\"$schema\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"uri\"\n\t\t\t},\n\t\t\t\"title\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"description\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"default\": {},\n\t\t\t\"multipleOf\": {\n\t\t\t\t\"type\": \"number\",\n\t\t\t\t\"minimum\": 0,\n\t\t\t\t\"exclusiveMinimum\": true\n\t\t\t},\n\t\t\t\"maximum\": {\n\t\t\t\t\"type\": \"number\"\n\t\t\t},\n\t\t\t\"exclusiveMaximum\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"minimum\": {\n\t\t\t\t\"type\": \"number\"\n\t\t\t},\n\t\t\t\"exclusiveMinimum\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"maxLength\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveInteger\"\n\t\t\t},\n\t\t\t\"minLength\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveIntegerDefault0\"\n\t\t\t},\n\t\t\t\"pattern\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"regex\"\n\t\t\t},\n\t\t\t\"additionalItems\": {\n\t\t\t\t\"anyOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"boolean\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"items\": {\n\t\t\t\t\"anyOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#/definitions/schemaArray\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"maxItems\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveInteger\"\n\t\t\t},\n\t\t\t\"minItems\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveIntegerDefault0\"\n\t\t\t},\n\t\t\t\"uniqueItems\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"maxProperties\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveInteger\"\n\t\t\t},\n\t\t\t\"minProperties\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveIntegerDefault0\"\n\t\t\t},\n\t\t\t\"required\": {\n\t\t\t\t\"$ref\": \"#/definitions/stringArray\"\n\t\t\t},\n\t\t\t\"additionalProperties\": {\n\t\t\t\t\"anyOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"boolean\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"definitions\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": {\n\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t},\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"properties\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": {\n\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t},\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"patternProperties\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": {\n\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t},\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"dependencies\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": {\n\t\t\t\t\t\"anyOf\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"$ref\": \"#/definitions/stringArray\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"enum\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"minItems\": 1,\n\t\t\t\t\"uniqueItems\": true\n\t\t\t},\n\t\t\t\"type\": {\n\t\t\t\t\"anyOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#/definitions/simpleTypes\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"array\",\n\t\t\t\t\t\t\"items\": {\n\t\t\t\t\t\t\t\"$ref\": \"#/definitions/simpleTypes\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"minItems\": 1,\n\t\t\t\t\t\t\"uniqueItems\": true\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"allOf\": {\n\t\t\t\t\"$ref\": \"#/definitions/schemaArray\"\n\t\t\t},\n\t\t\t\"anyOf\": {\n\t\t\t\t\"$ref\": \"#/definitions/schemaArray\"\n\t\t\t},\n\t\t\t\"oneOf\": {\n\t\t\t\t\"$ref\": \"#/definitions/schemaArray\"\n\t\t\t},\n\t\t\t\"not\": {\n\t\t\t\t\"$ref\": \"#\"\n\t\t\t}\n\t\t},\n\t\t\"dependencies\": {\n\t\t\t\"exclusiveMaximum\": [\n\t\t\t\t\"maximum\"\n\t\t\t],\n\t\t\t\"exclusiveMinimum\": [\n\t\t\t\t\"minimum\"\n\t\t\t]\n\t\t},\n\t\t\"default\": {}\n\t};\n\n/***/ },\n/* 24 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tvar formats = {};\n\t\n\t// reference: http://dansnetwork.com/javascript-iso8601rfc3339-date-parser/\n\tformats['date-time'] = /(\\d\\d\\d\\d)(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))/;\n\t// reference: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js#L7\n\tformats.uri = /^([a-zA-Z][a-zA-Z0-9+-.]*:){0,1}\\/\\/[^\\s]*$/;\n\t// reference: http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363\n\t// http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'willful violation')\n\tformats.email = /^[a-zA-Z0-9.!#$%&'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n\t// reference: https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html\n\tformats.ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;\n\t// reference: http://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses\n\tformats.ipv6 = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|[fF][eE]80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::([fF]{4}(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;\n\t// reference: http://stackoverflow.com/questions/106179/regular-expression-to-match-dns-hostname-or-ip-address#answer-3824105\n\tformats.hostname = /^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])(\\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]))*$/;\n\t\n\tmodule.exports = formats;\n\n/***/ },\n/* 25 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\t// Reference: https://github.com/bestiejs/punycode.js/blob/master/punycode.js#L101`\n\t// Info: https://mathiasbynens.be/notes/javascript-unicode\n\tfunction ucs2length(string) {\n\t var ucs2len = 0,\n\t counter = 0,\n\t length = string.length,\n\t value, extra;\n\t\n\t while (counter < length) {\n\t ucs2len++;\n\t value = string.charCodeAt(counter++);\n\t\n\t if (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t // It's a high surrogate, and there is a next character.\n\t extra = string.charCodeAt(counter++);\n\t\n\t if ((extra & 0xFC00) !== 0xDC00) { /* Low surrogate. */ // jshint ignore: line\n\t counter--;\n\t }\n\t }\n\t }\n\t\n\t return ucs2len;\n\t}\n\t\n\tmodule.exports = ucs2length;\n\n/***/ }\n/******/ ])\n});\n;\n//# sourceMappingURL=models.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/powerbi-models/dist/models.js\n// module id = 5\n// module chunks = 0","import { IFilterable } from './ifilterable';\r\nimport { IReportNode } from './report';\r\nimport * as models from 'powerbi-models';\r\n\r\n/**\r\n * A Page node within a report hierarchy\r\n * \r\n * @export\r\n * @interface IPageNode\r\n */\r\nexport interface IPageNode {\r\n report: IReportNode;\r\n name: string;\r\n}\r\n\r\n/**\r\n * A Power BI report page\r\n * \r\n * @export\r\n * @class Page\r\n * @implements {IPageNode}\r\n * @implements {IFilterable}\r\n */\r\nexport class Page implements IPageNode, IFilterable {\r\n /**\r\n * The parent Power BI report that this page is a member of\r\n * \r\n * @type {IReportNode}\r\n */\r\n report: IReportNode;\r\n /**\r\n * The report page name\r\n * \r\n * @type {string}\r\n */\r\n name: string;\r\n\r\n /**\r\n * The user defined display name of the report page, which is undefined if the page is created manually\r\n * \r\n * @type {string}\r\n */\r\n displayName: string;\r\n\r\n /**\r\n * Creates an instance of a Power BI report page.\r\n * \r\n * @param {IReportNode} report\r\n * @param {string} name\r\n * @param {string} [displayName]\r\n */\r\n constructor(report: IReportNode, name: string, displayName?: string) {\r\n this.report = report;\r\n this.name = name;\r\n this.displayName = displayName;\r\n }\r\n\r\n /**\r\n * Gets all page level filters within the report.\r\n * \r\n * ```javascript\r\n * page.getFilters()\r\n * .then(pages => { ... });\r\n * ```\r\n * \r\n * @returns {(Promise)}\r\n */\r\n getFilters(): Promise {\r\n return this.report.service.hpm.get(`/report/pages/${this.name}/filters`, { uid: this.report.config.uniqueId }, this.report.iframe.contentWindow)\r\n .then(response => response.body,\r\n response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Removes all filters from this page of the report.\r\n * \r\n * ```javascript\r\n * page.removeFilters();\r\n * ```\r\n * \r\n * @returns {Promise}\r\n */\r\n removeFilters(): Promise {\r\n return this.setFilters([]);\r\n }\r\n\r\n /**\r\n * Makes the current page the active page of the report.\r\n * \r\n * ```javascripot\r\n * page.setActive();\r\n * ```\r\n * \r\n * @returns {Promise}\r\n */\r\n setActive(): Promise {\r\n const page: models.IPage = {\r\n name: this.name,\r\n displayName: null\r\n };\r\n\r\n return this.report.service.hpm.put('/report/pages/active', page, { uid: this.report.config.uniqueId }, this.report.iframe.contentWindow)\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Sets all filters on the current page.\r\n * \r\n * ```javascript\r\n * page.setFilters(filters);\r\n * .catch(errors => { ... });\r\n * ```\r\n * \r\n * @param {(models.IFilter[])} filters\r\n * @returns {Promise}\r\n */\r\n setFilters(filters: models.IFilter[]): Promise {\r\n return this.report.service.hpm.put(`/report/pages/${this.name}/filters`, filters, { uid: this.report.config.uniqueId }, this.report.iframe.contentWindow)\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/page.ts","import * as service from './service';\r\nimport * as models from 'powerbi-models';\r\nimport * as embed from './embed';\r\n\r\nexport class Create extends embed.Embed {\r\n\r\n constructor(service: service.Service, element: HTMLElement, config: embed.IEmbedConfiguration) {\r\n super(service, element, config);\r\n }\r\n\r\n /**\r\n * Gets the dataset ID from the first available location: createConfig or embed url.\r\n * \r\n * @returns {string}\r\n */\r\n getId(): string {\r\n const datasetId = (this.createConfig && this.createConfig.datasetId) ? this.createConfig.datasetId : Create.findIdFromEmbedUrl(this.config.embedUrl);\r\n\r\n if (typeof datasetId !== 'string' || datasetId.length === 0) {\r\n throw new Error('Dataset id is required, but it was not found. You must provide an id either as part of embed configuration.');\r\n }\r\n\r\n return datasetId;\r\n }\r\n\r\n /**\r\n * Validate create report configuration.\r\n */\r\n validate(config: models.IReportCreateConfiguration): models.IError[] {\r\n return models.validateCreateReport(config);\r\n }\r\n\r\n /**\r\n * Adds the ability to get datasetId from url. \r\n * (e.g. http://embedded.powerbi.com/appTokenReportEmbed?datasetId=854846ed-2106-4dc2-bc58-eb77533bf2f1).\r\n * \r\n * By extracting the ID we can ensure that the ID is always explicitly provided as part of the create configuration.\r\n * \r\n * @static\r\n * @param {string} url\r\n * @returns {string}\r\n */\r\n static findIdFromEmbedUrl(url: string): string {\r\n const datasetIdRegEx = /datasetId=\"?([^&]+)\"?/\r\n const datasetIdMatch = url.match(datasetIdRegEx);\r\n\r\n let datasetId;\r\n if (datasetIdMatch) {\r\n datasetId = datasetIdMatch[1];\r\n }\r\n\r\n return datasetId;\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/create.ts","import * as service from './service';\r\nimport * as embed from './embed';\r\nimport * as models from 'powerbi-models';\r\nimport * as wpmp from 'window-post-message-proxy';\r\nimport * as hpm from 'http-post-message';\r\nimport * as utils from './util';\r\n\r\n/**\r\n * A Dashboard node within a dashboard hierarchy\r\n * \r\n * @export\r\n * @interface IDashboardNode\r\n */\r\nexport interface IDashboardNode {\r\n iframe: HTMLIFrameElement;\r\n service: service.IService;\r\n config: embed.IInternalEmbedConfiguration\r\n}\r\n\r\n/**\r\n * A Power BI Dashboard embed component\r\n * \r\n * @export\r\n * @class Dashboard\r\n * @extends {embed.Embed}\r\n * @implements {IDashboardNode}\r\n * @implements {IFilterable}\r\n */\r\nexport class Dashboard extends embed.Embed implements IDashboardNode {\r\n static allowedEvents = [\"tileClicked\", \"error\"];\r\n static dashboardIdAttribute = 'powerbi-dashboard-id';\r\n static typeAttribute = 'powerbi-type';\r\n static type = \"Dashboard\";\r\n\r\n /**\r\n * Creates an instance of a Power BI Dashboard.\r\n * \r\n * @param {service.Service} service\r\n * @param {HTMLElement} element\r\n */\r\n constructor(service: service.Service, element: HTMLElement, config: embed.IEmbedConfiguration) {\r\n super(service, element, config);\r\n this.loadPath = \"/dashboard/load\";\r\n Array.prototype.push.apply(this.allowedEvents, Dashboard.allowedEvents);\r\n }\r\n\r\n /**\r\n * This adds backwards compatibility for older config which used the dashboardId query param to specify dashboard id.\r\n * E.g. https://powerbi-df.analysis-df.windows.net/dashboardEmbedHost?dashboardId=e9363c62-edb6-4eac-92d3-2199c5ca2a9e\r\n * \r\n * By extracting the id we can ensure id is always explicitly provided as part of the load configuration.\r\n * \r\n * @static\r\n * @param {string} url\r\n * @returns {string}\r\n */\r\n static findIdFromEmbedUrl(url: string): string {\r\n const dashboardIdRegEx = /dashboardId=\"?([^&]+)\"?/\r\n const dashboardIdMatch = url.match(dashboardIdRegEx);\r\n\r\n let dashboardId;\r\n if (dashboardIdMatch) {\r\n dashboardId = dashboardIdMatch[1];\r\n }\r\n\r\n return dashboardId;\r\n }\r\n\r\n /**\r\n * Get dashboard id from first available location: options, attribute, embed url.\r\n * \r\n * @returns {string}\r\n */\r\n getId(): string {\r\n const dashboardId = this.config.id || this.element.getAttribute(Dashboard.dashboardIdAttribute) || Dashboard.findIdFromEmbedUrl(this.config.embedUrl);\r\n\r\n if (typeof dashboardId !== 'string' || dashboardId.length === 0) {\r\n throw new Error(`Dashboard id is required, but it was not found. You must provide an id either as part of embed configuration or as attribute '${Dashboard.dashboardIdAttribute}'.`);\r\n }\r\n\r\n return dashboardId;\r\n }\r\n\r\n /**\r\n * Validate load configuration.\r\n */\r\n validate(config: models.IDashboardLoadConfiguration): models.IError[] {\r\n let error = models.validateDashboardLoad(config);\r\n return error ? error : this.ValidatePageView(config.pageView);\r\n }\r\n \r\n /**\r\n * Validate that pageView has a legal value: if page view is defined it must have one of the values defined in models.PageView\r\n */\r\n private ValidatePageView(pageView: models.PageView): models.IError[] {\r\n if (pageView && pageView !== \"fitToWidth\" && pageView !== \"oneColumn\" && pageView !== \"actualSize\") {\r\n return [{message: \"pageView must be one of the followings: fitToWidth, oneColumn, actualSize\"}];\r\n }\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/dashboard.ts","import * as models from 'powerbi-models';\r\nimport { Embed } from './embed';\r\n\r\n/**\r\n * The Power BI tile embed component\r\n * \r\n * @export\r\n * @class Tile\r\n * @extends {Embed}\r\n */\r\nexport class Tile extends Embed {\r\n static type = \"Tile\";\r\n\r\n /**\r\n * The ID of the tile\r\n * \r\n * @returns {string}\r\n */\r\n getId(): string {\r\n throw new Error('Not implemented. Embedding tiles is not supported yet.');\r\n }\r\n\r\n /**\r\n * Validate load configuration.\r\n */\r\n validate(config: any): models.IError[] {\r\n throw new Error('Not implemented. Embedding tiles is not supported yet.');\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/tile.ts","/**\r\n * TODO: Need to find better place for these factory functions or refactor how we handle dependency injection\r\n */\r\nimport { IHpmFactory, IWpmpFactory, IRouterFactory } from './service';\r\nimport config from './config';\r\nimport * as wpmp from 'window-post-message-proxy';\r\nimport * as hpm from 'http-post-message';\r\nimport * as router from 'powerbi-router';\r\n\r\nexport {\r\n IHpmFactory,\r\n IWpmpFactory,\r\n IRouterFactory\r\n};\r\n\r\nexport const hpmFactory: IHpmFactory = (wpmp, defaultTargetWindow, sdkVersion = config.version, sdkType = config.type) => {\r\n return new hpm.HttpPostMessage(wpmp, {\r\n 'x-sdk-type': sdkType,\r\n 'x-sdk-version': sdkVersion\r\n }, defaultTargetWindow);\r\n};\r\n\r\nexport const wpmpFactory: IWpmpFactory = (name?: string, logMessages?: boolean, eventSourceOverrideWindow?: Window) => {\r\n return new wpmp.WindowPostMessageProxy({\r\n processTrackingProperties: {\r\n addTrackingProperties: hpm.HttpPostMessage.addTrackingProperties,\r\n getTrackingProperties: hpm.HttpPostMessage.getTrackingProperties,\r\n },\r\n isErrorMessage: hpm.HttpPostMessage.isErrorMessage,\r\n name,\r\n logMessages,\r\n eventSourceOverrideWindow\r\n });\r\n};\r\n\r\nexport const routerFactory: IRouterFactory = (wpmp) => {\r\n return new router.Router(wpmp);\r\n};\n\n\n// WEBPACK FOOTER //\n// ./src/factories.ts","const config = {\r\n version: '2.2.3',\r\n type: 'js'\r\n};\r\n\r\nexport default config;\n\n\n// WEBPACK FOOTER //\n// ./src/config.ts","/*! window-post-message-proxy v0.2.4 | (c) 2016 Microsoft Corporation MIT */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"window-post-message-proxy\"] = factory();\n\telse\n\t\troot[\"window-post-message-proxy\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\tvar WindowPostMessageProxy = (function () {\n\t function WindowPostMessageProxy(options) {\n\t var _this = this;\n\t if (options === void 0) { options = {\n\t processTrackingProperties: {\n\t addTrackingProperties: WindowPostMessageProxy.defaultAddTrackingProperties,\n\t getTrackingProperties: WindowPostMessageProxy.defaultGetTrackingProperties\n\t },\n\t isErrorMessage: WindowPostMessageProxy.defaultIsErrorMessage,\n\t receiveWindow: window,\n\t name: WindowPostMessageProxy.createRandomString()\n\t }; }\n\t this.pendingRequestPromises = {};\n\t // save options with defaults\n\t this.addTrackingProperties = (options.processTrackingProperties && options.processTrackingProperties.addTrackingProperties) || WindowPostMessageProxy.defaultAddTrackingProperties;\n\t this.getTrackingProperties = (options.processTrackingProperties && options.processTrackingProperties.getTrackingProperties) || WindowPostMessageProxy.defaultGetTrackingProperties;\n\t this.isErrorMessage = options.isErrorMessage || WindowPostMessageProxy.defaultIsErrorMessage;\n\t this.receiveWindow = options.receiveWindow || window;\n\t this.name = options.name || WindowPostMessageProxy.createRandomString();\n\t this.logMessages = options.logMessages || false;\n\t this.eventSourceOverrideWindow = options.eventSourceOverrideWindow;\n\t this.suppressWarnings = options.suppressWarnings || false;\n\t if (this.logMessages) {\n\t console.log(\"new WindowPostMessageProxy created with name: \" + this.name + \" receiving on window: \" + this.receiveWindow.document.title);\n\t }\n\t // Initialize\n\t this.handlers = [];\n\t this.windowMessageHandler = function (event) { return _this.onMessageReceived(event); };\n\t this.start();\n\t }\n\t // Static\n\t WindowPostMessageProxy.defaultAddTrackingProperties = function (message, trackingProperties) {\n\t message[WindowPostMessageProxy.messagePropertyName] = trackingProperties;\n\t return message;\n\t };\n\t WindowPostMessageProxy.defaultGetTrackingProperties = function (message) {\n\t return message[WindowPostMessageProxy.messagePropertyName];\n\t };\n\t WindowPostMessageProxy.defaultIsErrorMessage = function (message) {\n\t return !!message.error;\n\t };\n\t /**\n\t * Utility to create a deferred object.\n\t */\n\t // TODO: Look to use RSVP library instead of doing this manually.\n\t // From what I searched RSVP would work better because it has .finally and .deferred; however, it doesn't have Typings information. \n\t WindowPostMessageProxy.createDeferred = function () {\n\t var deferred = {\n\t resolve: null,\n\t reject: null,\n\t promise: null\n\t };\n\t var promise = new Promise(function (resolve, reject) {\n\t deferred.resolve = resolve;\n\t deferred.reject = reject;\n\t });\n\t deferred.promise = promise;\n\t return deferred;\n\t };\n\t /**\n\t * Utility to generate random sequence of characters used as tracking id for promises.\n\t */\n\t WindowPostMessageProxy.createRandomString = function () {\n\t return (Math.random() + 1).toString(36).substring(7);\n\t };\n\t /**\n\t * Adds handler.\n\t * If the first handler whose test method returns true will handle the message and provide a response.\n\t */\n\t WindowPostMessageProxy.prototype.addHandler = function (handler) {\n\t this.handlers.push(handler);\n\t };\n\t /**\n\t * Removes handler.\n\t * The reference must match the original object that was provided when adding the handler.\n\t */\n\t WindowPostMessageProxy.prototype.removeHandler = function (handler) {\n\t var handlerIndex = this.handlers.indexOf(handler);\n\t if (handlerIndex === -1) {\n\t throw new Error(\"You attempted to remove a handler but no matching handler was found.\");\n\t }\n\t this.handlers.splice(handlerIndex, 1);\n\t };\n\t /**\n\t * Start listening to message events.\n\t */\n\t WindowPostMessageProxy.prototype.start = function () {\n\t this.receiveWindow.addEventListener('message', this.windowMessageHandler);\n\t };\n\t /**\n\t * Stops listening to message events.\n\t */\n\t WindowPostMessageProxy.prototype.stop = function () {\n\t this.receiveWindow.removeEventListener('message', this.windowMessageHandler);\n\t };\n\t /**\n\t * Post message to target window with tracking properties added and save deferred object referenced by tracking id.\n\t */\n\t WindowPostMessageProxy.prototype.postMessage = function (targetWindow, message) {\n\t // Add tracking properties to indicate message came from this proxy\n\t var trackingProperties = { id: WindowPostMessageProxy.createRandomString() };\n\t this.addTrackingProperties(message, trackingProperties);\n\t if (this.logMessages) {\n\t console.log(this.name + \" Posting message:\");\n\t console.log(JSON.stringify(message, null, ' '));\n\t }\n\t targetWindow.postMessage(message, \"*\");\n\t var deferred = WindowPostMessageProxy.createDeferred();\n\t this.pendingRequestPromises[trackingProperties.id] = deferred;\n\t return deferred.promise;\n\t };\n\t /**\n\t * Send response message to target window.\n\t * Response messages re-use tracking properties from a previous request message.\n\t */\n\t WindowPostMessageProxy.prototype.sendResponse = function (targetWindow, message, trackingProperties) {\n\t this.addTrackingProperties(message, trackingProperties);\n\t if (this.logMessages) {\n\t console.log(this.name + \" Sending response:\");\n\t console.log(JSON.stringify(message, null, ' '));\n\t }\n\t targetWindow.postMessage(message, \"*\");\n\t };\n\t /**\n\t * Message handler.\n\t */\n\t WindowPostMessageProxy.prototype.onMessageReceived = function (event) {\n\t var _this = this;\n\t if (this.logMessages) {\n\t console.log(this.name + \" Received message:\");\n\t console.log(\"type: \" + event.type);\n\t console.log(JSON.stringify(event.data, null, ' '));\n\t }\n\t var sendingWindow = this.eventSourceOverrideWindow || event.source;\n\t var message = event.data;\n\t if (typeof message !== \"object\") {\n\t if (!this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + this.name + \"): Received message that was not an object. Discarding message\");\n\t }\n\t return;\n\t }\n\t var trackingProperties;\n\t try {\n\t trackingProperties = this.getTrackingProperties(message);\n\t }\n\t catch (e) {\n\t if (!this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + this.name + \"): Error occurred when attempting to get tracking properties from incoming message:\", JSON.stringify(message, null, ' '), \"Error: \", e);\n\t }\n\t }\n\t var deferred;\n\t if (trackingProperties) {\n\t deferred = this.pendingRequestPromises[trackingProperties.id];\n\t }\n\t // If message does not have a known ID, treat it as a request\n\t // Otherwise, treat message as response\n\t if (!deferred) {\n\t var handled = this.handlers.some(function (handler) {\n\t var canMessageBeHandled = false;\n\t try {\n\t canMessageBeHandled = handler.test(message);\n\t }\n\t catch (e) {\n\t if (!_this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + _this.name + \"): Error occurred when handler was testing incoming message:\", JSON.stringify(message, null, ' '), \"Error: \", e);\n\t }\n\t }\n\t if (canMessageBeHandled) {\n\t var responseMessagePromise = void 0;\n\t try {\n\t responseMessagePromise = Promise.resolve(handler.handle(message));\n\t }\n\t catch (e) {\n\t if (!_this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + _this.name + \"): Error occurred when handler was processing incoming message:\", JSON.stringify(message, null, ' '), \"Error: \", e);\n\t }\n\t responseMessagePromise = Promise.resolve();\n\t }\n\t responseMessagePromise\n\t .then(function (responseMessage) {\n\t if (!responseMessage) {\n\t var warningMessage = \"Handler for message: \" + JSON.stringify(message, null, ' ') + \" did not return a response message. The default response message will be returned instead.\";\n\t if (!_this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + _this.name + \"): \" + warningMessage);\n\t }\n\t responseMessage = {\n\t warning: warningMessage\n\t };\n\t }\n\t _this.sendResponse(sendingWindow, responseMessage, trackingProperties);\n\t });\n\t return true;\n\t }\n\t });\n\t /**\n\t * TODO: Consider returning an error message if nothing handled the message.\n\t * In the case of the Report receiving messages all of them should be handled,\n\t * however, in the case of the SDK receiving messages it's likely it won't register handlers\n\t * for all events. Perhaps make this an option at construction time.\n\t */\n\t if (!handled && !this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + this.name + \") did not handle message. Handlers: \" + this.handlers.length + \" Message: \" + JSON.stringify(message, null, '') + \".\");\n\t }\n\t }\n\t else {\n\t /**\n\t * If error message reject promise,\n\t * Otherwise, resolve promise\n\t */\n\t var isErrorMessage = true;\n\t try {\n\t isErrorMessage = this.isErrorMessage(message);\n\t }\n\t catch (e) {\n\t console.warn(\"Proxy(\" + this.name + \") Error occurred when trying to determine if message is consider an error response. Message: \", JSON.stringify(message, null, ''), 'Error: ', e);\n\t }\n\t if (isErrorMessage) {\n\t deferred.reject(message);\n\t }\n\t else {\n\t deferred.resolve(message);\n\t }\n\t // TODO: Move to .finally clause up where promise is created for better maitenance like original proxy code.\n\t delete this.pendingRequestPromises[trackingProperties.id];\n\t }\n\t };\n\t WindowPostMessageProxy.messagePropertyName = \"windowPostMessageProxy\";\n\t return WindowPostMessageProxy;\n\t}());\n\texports.WindowPostMessageProxy = WindowPostMessageProxy;\n\n\n/***/ }\n/******/ ])\n});\n;\n//# sourceMappingURL=windowPostMessageProxy.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/window-post-message-proxy/dist/windowPostMessageProxy.js\n// module id = 12\n// module chunks = 0","/*! http-post-message v0.2.3 | (c) 2016 Microsoft Corporation MIT */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"http-post-message\"] = factory();\n\telse\n\t\troot[\"http-post-message\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\tvar HttpPostMessage = (function () {\n\t function HttpPostMessage(windowPostMessageProxy, defaultHeaders, defaultTargetWindow) {\n\t if (defaultHeaders === void 0) { defaultHeaders = {}; }\n\t this.defaultHeaders = defaultHeaders;\n\t this.defaultTargetWindow = defaultTargetWindow;\n\t this.windowPostMessageProxy = windowPostMessageProxy;\n\t }\n\t // TODO: See if it's possible to share tracking properties interface?\n\t // The responsibility of knowing how to configure windowPostMessageProxy for http should\n\t // live in this http class, but the configuration would need ITrackingProperties\n\t // interface which lives in WindowPostMessageProxy. Use type as workaround\n\t HttpPostMessage.addTrackingProperties = function (message, trackingProperties) {\n\t message.headers = message.headers || {};\n\t if (trackingProperties && trackingProperties.id) {\n\t message.headers.id = trackingProperties.id;\n\t }\n\t return message;\n\t };\n\t HttpPostMessage.getTrackingProperties = function (message) {\n\t return {\n\t id: message.headers && message.headers.id\n\t };\n\t };\n\t HttpPostMessage.isErrorMessage = function (message) {\n\t if (typeof (message && message.statusCode) !== 'number') {\n\t return false;\n\t }\n\t return !(200 <= message.statusCode && message.statusCode < 300);\n\t };\n\t HttpPostMessage.prototype.get = function (url, headers, targetWindow) {\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"GET\",\n\t url: url,\n\t headers: headers\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.post = function (url, body, headers, targetWindow) {\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"POST\",\n\t url: url,\n\t headers: headers,\n\t body: body\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.put = function (url, body, headers, targetWindow) {\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"PUT\",\n\t url: url,\n\t headers: headers,\n\t body: body\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.patch = function (url, body, headers, targetWindow) {\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"PATCH\",\n\t url: url,\n\t headers: headers,\n\t body: body\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.delete = function (url, body, headers, targetWindow) {\n\t if (body === void 0) { body = null; }\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"DELETE\",\n\t url: url,\n\t headers: headers,\n\t body: body\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.send = function (request, targetWindow) {\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t request.headers = this.assign({}, this.defaultHeaders, request.headers);\n\t if (!targetWindow) {\n\t throw new Error(\"target window is not provided. You must either provide the target window explicitly as argument to request, or specify default target window when constructing instance of this class.\");\n\t }\n\t return this.windowPostMessageProxy.postMessage(targetWindow, request);\n\t };\n\t /**\n\t * Object.assign() polyfill\n\t * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\n\t */\n\t HttpPostMessage.prototype.assign = function (target) {\n\t var sources = [];\n\t for (var _i = 1; _i < arguments.length; _i++) {\n\t sources[_i - 1] = arguments[_i];\n\t }\n\t if (target === undefined || target === null) {\n\t throw new TypeError('Cannot convert undefined or null to object');\n\t }\n\t var output = Object(target);\n\t sources.forEach(function (source) {\n\t if (source !== undefined && source !== null) {\n\t for (var nextKey in source) {\n\t if (Object.prototype.hasOwnProperty.call(source, nextKey)) {\n\t output[nextKey] = source[nextKey];\n\t }\n\t }\n\t }\n\t });\n\t return output;\n\t };\n\t return HttpPostMessage;\n\t}());\n\texports.HttpPostMessage = HttpPostMessage;\n\n\n/***/ }\n/******/ ])\n});\n;\n//# sourceMappingURL=httpPostMessage.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/http-post-message/dist/httpPostMessage.js\n// module id = 13\n// module chunks = 0","/*! powerbi-router v0.1.5 | (c) 2016 Microsoft Corporation MIT */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"powerbi-router\"] = factory();\n\telse\n\t\troot[\"powerbi-router\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar RouteRecognizer = __webpack_require__(1);\n\tvar Router = (function () {\n\t function Router(handlers) {\n\t this.handlers = handlers;\n\t /**\n\t * TODO: look at generating the router dynamically based on list of supported http methods\n\t * instead of hardcoding the creation of these and the methods.\n\t */\n\t this.getRouteRecognizer = new RouteRecognizer();\n\t this.patchRouteRecognizer = new RouteRecognizer();\n\t this.postRouteRecognizer = new RouteRecognizer();\n\t this.putRouteRecognizer = new RouteRecognizer();\n\t this.deleteRouteRecognizer = new RouteRecognizer();\n\t }\n\t Router.prototype.get = function (url, handler) {\n\t this.registerHandler(this.getRouteRecognizer, \"GET\", url, handler);\n\t return this;\n\t };\n\t Router.prototype.patch = function (url, handler) {\n\t this.registerHandler(this.patchRouteRecognizer, \"PATCH\", url, handler);\n\t return this;\n\t };\n\t Router.prototype.post = function (url, handler) {\n\t this.registerHandler(this.postRouteRecognizer, \"POST\", url, handler);\n\t return this;\n\t };\n\t Router.prototype.put = function (url, handler) {\n\t this.registerHandler(this.putRouteRecognizer, \"PUT\", url, handler);\n\t return this;\n\t };\n\t Router.prototype.delete = function (url, handler) {\n\t this.registerHandler(this.deleteRouteRecognizer, \"DELETE\", url, handler);\n\t return this;\n\t };\n\t /**\n\t * TODO: This method could use some refactoring. There is conflict of interest between keeping clean separation of test and handle method\n\t * Test method only returns boolean indicating if request can be handled, and handle method has opportunity to modify response and return promise of it.\n\t * In the case of the router with route-recognizer where handlers are associated with routes, this already guarantees that only one handler is selected and makes the test method feel complicated\n\t * Will leave as is an investigate cleaner ways at later time.\n\t */\n\t Router.prototype.registerHandler = function (routeRecognizer, method, url, handler) {\n\t var routeRecognizerHandler = function (request) {\n\t var response = new Response();\n\t return Promise.resolve(handler(request, response))\n\t .then(function (x) { return response; });\n\t };\n\t routeRecognizer.add([\n\t { path: url, handler: routeRecognizerHandler }\n\t ]);\n\t var internalHandler = {\n\t test: function (request) {\n\t if (request.method !== method) {\n\t return false;\n\t }\n\t var matchingRoutes = routeRecognizer.recognize(request.url);\n\t if (matchingRoutes === undefined) {\n\t return false;\n\t }\n\t /**\n\t * Copy parameters from recognized route to the request so they can be used within the handler function\n\t * This isn't ideal because it is side affect which modifies the request instead of strictly testing for true or false\n\t * but I don't see a better place to put this. If we move it between the call to test and the handle it becomes part of the window post message proxy\n\t * even though it's responsibility is related to routing.\n\t */\n\t var route = matchingRoutes[0];\n\t request.params = route.params;\n\t request.queryParams = matchingRoutes.queryParams;\n\t request.handler = route.handler;\n\t return true;\n\t },\n\t handle: function (request) {\n\t return request.handler(request);\n\t }\n\t };\n\t this.handlers.addHandler(internalHandler);\n\t };\n\t return Router;\n\t}());\n\texports.Router = Router;\n\tvar Response = (function () {\n\t function Response() {\n\t this.statusCode = 200;\n\t this.headers = {};\n\t this.body = null;\n\t }\n\t Response.prototype.send = function (statusCode, body) {\n\t this.statusCode = statusCode;\n\t this.body = body;\n\t };\n\t return Response;\n\t}());\n\texports.Response = Response;\n\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(module) {(function() {\n\t \"use strict\";\n\t function $$route$recognizer$dsl$$Target(path, matcher, delegate) {\n\t this.path = path;\n\t this.matcher = matcher;\n\t this.delegate = delegate;\n\t }\n\t\n\t $$route$recognizer$dsl$$Target.prototype = {\n\t to: function(target, callback) {\n\t var delegate = this.delegate;\n\t\n\t if (delegate && delegate.willAddRoute) {\n\t target = delegate.willAddRoute(this.matcher.target, target);\n\t }\n\t\n\t this.matcher.add(this.path, target);\n\t\n\t if (callback) {\n\t if (callback.length === 0) { throw new Error(\"You must have an argument in the function passed to `to`\"); }\n\t this.matcher.addChild(this.path, target, callback, this.delegate);\n\t }\n\t return this;\n\t }\n\t };\n\t\n\t function $$route$recognizer$dsl$$Matcher(target) {\n\t this.routes = {};\n\t this.children = {};\n\t this.target = target;\n\t }\n\t\n\t $$route$recognizer$dsl$$Matcher.prototype = {\n\t add: function(path, handler) {\n\t this.routes[path] = handler;\n\t },\n\t\n\t addChild: function(path, target, callback, delegate) {\n\t var matcher = new $$route$recognizer$dsl$$Matcher(target);\n\t this.children[path] = matcher;\n\t\n\t var match = $$route$recognizer$dsl$$generateMatch(path, matcher, delegate);\n\t\n\t if (delegate && delegate.contextEntered) {\n\t delegate.contextEntered(target, match);\n\t }\n\t\n\t callback(match);\n\t }\n\t };\n\t\n\t function $$route$recognizer$dsl$$generateMatch(startingPath, matcher, delegate) {\n\t return function(path, nestedCallback) {\n\t var fullPath = startingPath + path;\n\t\n\t if (nestedCallback) {\n\t nestedCallback($$route$recognizer$dsl$$generateMatch(fullPath, matcher, delegate));\n\t } else {\n\t return new $$route$recognizer$dsl$$Target(startingPath + path, matcher, delegate);\n\t }\n\t };\n\t }\n\t\n\t function $$route$recognizer$dsl$$addRoute(routeArray, path, handler) {\n\t var len = 0;\n\t for (var i=0; i z`. For instance, \"199\" is smaller\n\t // then \"200\", even though \"y\" and \"z\" (which are both 9) are larger than \"0\" (the value\n\t // of (`b` and `c`). This is because the leading symbol, \"2\", is larger than the other\n\t // leading symbol, \"1\".\n\t // The rule is that symbols to the left carry more weight than symbols to the right\n\t // when a number is written out as a string. In the above strings, the leading digit\n\t // represents how many 100's are in the number, and it carries more weight than the middle\n\t // number which represents how many 10's are in the number.\n\t // This system of number magnitude works well for route specificity, too. A route written as\n\t // `a/b/c` will be more specific than `x/y/z` as long as `a` is more specific than\n\t // `x`, irrespective of the other parts.\n\t // Because of this similarity, we assign each type of segment a number value written as a\n\t // string. We can find the specificity of compound routes by concatenating these strings\n\t // together, from left to right. After we have looped through all of the segments,\n\t // we convert the string to a number.\n\t specificity.val = '';\n\t\n\t for (var i=0; i 2 && key.slice(keyLength -2) === '[]') {\n\t isArray = true;\n\t key = key.slice(0, keyLength - 2);\n\t if(!queryParams[key]) {\n\t queryParams[key] = [];\n\t }\n\t }\n\t value = pair[1] ? $$route$recognizer$$decodeQueryParamPart(pair[1]) : '';\n\t }\n\t if (isArray) {\n\t queryParams[key].push(value);\n\t } else {\n\t queryParams[key] = value;\n\t }\n\t }\n\t return queryParams;\n\t },\n\t\n\t recognize: function(path) {\n\t var states = [ this.rootState ],\n\t pathLen, i, l, queryStart, queryParams = {},\n\t isSlashDropped = false;\n\t\n\t queryStart = path.indexOf('?');\n\t if (queryStart !== -1) {\n\t var queryString = path.substr(queryStart + 1, path.length);\n\t path = path.substr(0, queryStart);\n\t queryParams = this.parseQueryString(queryString);\n\t }\n\t\n\t path = decodeURI(path);\n\t\n\t if (path.charAt(0) !== \"/\") { path = \"/\" + path; }\n\t\n\t pathLen = path.length;\n\t if (pathLen > 1 && path.charAt(pathLen - 1) === \"/\") {\n\t path = path.substr(0, pathLen - 1);\n\t isSlashDropped = true;\n\t }\n\t\n\t for (i=0; i';this.element.innerHTML=r,this.iframe=this.element.childNodes[0]}e?this.iframe.addEventListener("load",function(){return t.load(t.config)},!1):this.iframe.addEventListener("load",function(){return t.createReport(t.createConfig)},!1)},e.allowedEvents=["loaded","saved","rendered","saveAsTriggered"],e.accessTokenAttribute="powerbi-access-token",e.embedUrlAttribute="powerbi-embed-url",e.nameAttribute="powerbi-name",e.typeAttribute="powerbi-type",e.defaultSettings={filterPaneEnabled:!0},e}();t.Embed=i},function(e,t){function r(e,t,r){var n;"function"==typeof CustomEvent?n=new CustomEvent(t,{detail:r,bubbles:!0,cancelable:!0}):(n=document.createEvent("CustomEvent"),n.initCustomEvent(t,!0,!0,r)),e.dispatchEvent(n)}function n(e,t){if(!Array.isArray(t))throw new Error("You attempted to call find with second parameter that was not an array. You passed: "+t);var r;return t.some(function(t,n){if(e(t))return r=n,!0}),r}function i(e,t){var r=n(e,t);return t[r]}function o(e,t){var r=n(e,t);t.splice(r,1)}function s(){for(var e=[],t=0;t';this.element.innerHTML=r,this.iframe=this.element.childNodes[0]}e?this.iframe.addEventListener("load",function(){return t.load(t.config)},!1):this.iframe.addEventListener("load",function(){return t.createReport(t.createConfig)},!1)},e.allowedEvents=["loaded","saved","rendered","saveAsTriggered","error","dataSelected"],e.accessTokenAttribute="powerbi-access-token",e.embedUrlAttribute="powerbi-embed-url",e.nameAttribute="powerbi-name",e.typeAttribute="powerbi-type",e.defaultSettings={filterPaneEnabled:!0},e}();t.Embed=i},function(e,t){function r(e,t,r){var n;"function"==typeof CustomEvent?n=new CustomEvent(t,{detail:r,bubbles:!0,cancelable:!0}):(n=document.createEvent("CustomEvent"),n.initCustomEvent(t,!0,!0,r)),e.dispatchEvent(n)}function n(e,t){if(!Array.isArray(t))throw new Error("You attempted to call find with second parameter that was not an array. You passed: "+t);var r;return t.some(function(t,n){if(e(t))return r=n,!0}),r}function i(e,t){var r=n(e,t);return t[r]}function o(e,t){var r=n(e,t);t.splice(r,1)}function s(){for(var e=[],t=0;t0&&!i)throw new Error("You shold pass the values to be filtered for each key. You passed: no values and "+o+" keys");if(0===o&&i&&i.length>0)throw new Error("You passed key values but your target object doesn't contain the keys to be filtered");for(var s=0;s2)throw new Error("AdvancedFilters may not have more than two conditions. You passed: "+i.length);if(1===s.length&&"And"!==n)throw new Error('Logical Operator must be "And" when there is only one condition provided');this.conditions=s}return d(t,e),t.prototype.toJSON=function(){var t=e.prototype.toJSON.call(this);return t.logicalOperator=this.logicalOperator,t.conditions=this.conditions,t},t.schemaUrl="http://powerbi.com/product/schema#advanced",t}(l);t.AdvancedFilter=y,function(e){e[e.Read=0]="Read",e[e.ReadWrite=1]="ReadWrite",e[e.Copy=2]="Copy",e[e.Create=4]="Create",e[e.All=7]="All"}(t.Permissions||(t.Permissions={}));t.Permissions;!function(e){e[e.View=0]="View",e[e.Edit=1]="Edit"}(t.ViewMode||(t.ViewMode={}));t.ViewMode;t.validateSaveAsParameters=i(t.saveAsParametersSchema)},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{target:{oneOf:[{type:"object",properties:{table:{type:"string"},column:{type:"string"}},required:["table","column"]},{type:"object",properties:{table:{type:"string"},hierarchy:{type:"string"},hierarchyLevel:{type:"string"}},required:["table","hierarchy","hierarchyLevel"]},{type:"object",properties:{table:{type:"string"},measure:{type:"string"}},required:["table","measure"]}]},logicalOperator:{type:"string"},conditions:{type:"array",items:{type:"object",properties:{value:{type:["string","boolean","number"]},operator:{type:"string"}},required:["value","operator"]}}},required:["target","logicalOperator","conditions"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",oneOf:[{$ref:"#basicFilter"},{$ref:"#advancedFilter"}],invalidMessage:"filter is invalid"}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{accessToken:{type:"string",messages:{type:"accessToken must be a string",required:"accessToken is required"}},id:{type:"string",messages:{type:"id must be a string",required:"id is required"}},settings:{$ref:"#settings"},pageName:{type:"string",messages:{type:"pageName must be a string"}},filters:{type:"array",items:{type:"object",oneOf:[{$ref:"#basicFilter"},{$ref:"#advancedFilter"}]},invalidMessage:"filters property is invalid"},permissions:{type:"number","enum":[0,1,2,3],"default":0,invalidMessage:"permissions property is invalid"},viewMode:{type:"number","enum":[0,1],"default":0,invalidMessage:"viewMode property is invalid"}},required:["accessToken","id"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{accessToken:{type:"string",messages:{type:"accessToken must be a string",required:"accessToken is required"}},id:{type:"string",messages:{type:"id must be a string",required:"id is required"}},pageView:{type:"string",messages:{type:'pageView must be a string with one of the following values: "actualSize", "fitToWidth", "oneColumn"'}}},required:["accessToken","id"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{name:{type:"string",messages:{type:"name must be a string",required:"name is required"}}},required:["name"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{filterPaneEnabled:{type:"boolean",messages:{type:"filterPaneEnabled must be a boolean"}},navContentPaneEnabled:{type:"boolean",messages:{type:"navContentPaneEnabled must be a boolean"}},useCustomSaveAsDialog:{type:"boolean",messages:{type:"useCustomSaveAsDialog must be a boolean"}}}}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{target:{type:"object",properties:{table:{type:"string"},column:{type:"string"},hierarchy:{type:"string"},hierarchyLevel:{type:"string"},measure:{type:"string"}},required:["table"]},operator:{type:"string"},values:{type:"array",items:{type:["string","boolean","number"]}}},required:["target","operator","values"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{accessToken:{type:"string",messages:{type:"accessToken must be a string",required:"accessToken is required"}},datasetId:{type:"string",messages:{type:"datasetId must be a string",required:"datasetId is required"}}},required:["accessToken","datasetId"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{name:{type:"string",messages:{type:"name must be a string",required:"name is required"}}},required:["name"]}},function(e,t,r){e.exports=r(11)},function(e,t,r){"use strict";function n(e){return e=e instanceof RegExp?e:new RegExp(e),A?e.toString():"/"+e.source.replace(y,"\\$&")+"/"}function i(e){return'"'+e.replace(v,"\\$1")+'"'}function o(e,t){return b.lastIndex=0,b.test(t)?e+"."+t:e+"["+i(t)+"]"}function s(e){if(void 0===e)return"undefined";var t=Object.prototype.toString.call(e);return t.substr(8,t.length-9).toLowerCase()}function a(e){return(0|e)===e}function c(e,t){k[t].type=e,k[t].keyword=t}function h(e){var t,r,n,i=Object.keys(e),o=i.indexOf("properties"),s=i.indexOf("patternProperties"),a={"enum":Array.isArray(e["enum"])&&e["enum"].length>0,type:null,allType:[],perType:{}};for(e.type&&("string"==typeof e.type?a.type=[e.type]:Array.isArray(e.type)&&e.type.length&&(a.type=e.type.slice(0))),n=0;n-1&&"required"===t||s>-1&&"additionalProperties"===t||a.perType[r.type].push(t)):a.allType.push(t)));return a}function u(e,t){var r,n,i=e.substr(4),o=i.length,s=[],a="",c=!1;for(n=0;n "+e.schema.maximum+") {"),e.error("maximum"),e.code("}"))},k.exclusiveMaximum=function(e){e.schema.exclusiveMaximum===!0&&"number"==typeof e.schema.maximum&&(e.code("if ("+e.path+" === "+e.schema.maximum+") {"),e.error("exclusiveMaximum"),e.code("}"))},k.multipleOf=function(e){if("number"==typeof e.schema.multipleOf){var t=e.schema.multipleOf,r=t.toString().length-t.toFixed(0).length-1,n=r>0?Math.pow(10,r):1,i=e.path;r>0?e.code("if (+(Math.round(("+i+" * "+n+') + "e+" + '+r+') + "e-" + '+r+") % "+t*n+" !== 0) {"):e.code("if ((("+i+" * "+n+") % "+t*n+") !== 0) {"),e.error("multipleOf"),e.code("}")}},k.minLength=function(e){a(e.schema.minLength)&&(e.code("if (ucs2length("+e.path+") < "+e.schema.minLength+") {"),e.error("minLength"),e.code("}"))},k.maxLength=function(e){a(e.schema.maxLength)&&(e.code("if (ucs2length("+e.path+") > "+e.schema.maxLength+") {"),e.error("maxLength"),e.code("}"))},k.pattern=function(e){var t=e.schema.pattern;("string"==typeof t||t instanceof RegExp)&&(e.code("if (!("+n(t)+").test("+e.path+")) {"),e.error("pattern"),e.code("}"))},k.format=function(e){"string"==typeof e.schema.format&&I[e.schema.format]&&(e.code("if (!("+I[e.schema.format]+").test("+e.path+")) {"),e.error("format"),e.code("}"))},k.minItems=function(e){a(e.schema.minItems)&&(e.code("if ("+e.path+".length < "+e.schema.minItems+") {"),e.error("minItems"),e.code("}"))},k.maxItems=function(e){a(e.schema.maxItems)&&(e.code("if ("+e.path+".length > "+e.schema.maxItems+") {"),e.error("maxItems"),e.code("}"))},k.additionalItems=function(e){e.schema.additionalItems===!1&&Array.isArray(e.schema.items)&&(e.code("if ("+e.path+".length > "+e.schema.items.length+") {"),e.error("additionalItems"),e.code("}"))},k.uniqueItems=function(e){e.schema.uniqueItems&&(e.code("if (unique("+e.path+").length !== "+e.path+".length) {"),e.error("uniqueItems"),e.code("}"))},k.items=function(e){var t=e.declare(0),r=0;if("object"===s(e.schema.items))e.code("for ("+t+" = 0; "+t+" < "+e.path+".length; "+t+"++) {"),e.descend(e.path+"["+t+"]",e.schema.items),e.code("}");else if(Array.isArray(e.schema.items)){for(;r= "+r+") {"),e.descend(e.path+"["+r+"]",e.schema.items[r]),e.code("}");"object"===s(e.schema.additionalItems)&&(e.code("for ("+t+" = "+r+"; "+t+" < "+e.path+".length; "+t+"++) {"),e.descend(e.path+"["+t+"]",e.schema.additionalItems),e.code("}"))}},k.maxProperties=function(e){a(e.schema.maxProperties)&&(e.code("if (Object.keys("+e.path+").length > "+e.schema.maxProperties+") {"),e.error("maxProperties"),e.code("}"))},k.minProperties=function(e){a(e.schema.minProperties)&&(e.code("if (Object.keys("+e.path+").length < "+e.schema.minProperties+") {"),e.error("minProperties"),e.code("}"))},k.required=function(e){if(Array.isArray(e.schema.required))for(var t=0;t-1&&(e.code("else {"),e.error("required",t),e.code("}"))},k.patternProperties=k.additionalProperties=function(e){var t,r,i,o,a,c,h,u="object"===s(e.schema.properties)?Object.keys(e.schema.properties):[],d=e.schema.patternProperties,p="object"===s(d)?Object.keys(d):[],f=e.schema.additionalProperties,l=f===!1||"object"===s(f);if(p.length||l){for(r=e.declare("[]"),i=e.declare('""'),o=e.declare(0),l&&(a=e.declare(!1)),e.code(r+" = Object.keys("+e.path+")"),e.code("for ("+o+" = 0; "+o+" < "+r+".length; "+o+"++) {")(i+" = "+r+"["+o+"]")("if ("+e.path+"["+i+"] === undefined) {")("continue")("}"),l&&e.code(a+" = false"),h=0;h -1) {")("continue")("}")),e.code("if (!"+a+") {"),f===!1?e.error("additionalProperties",void 0,i):e.descend(e.path+"["+i+"]",f),e.code("}")),e.code("}")}},k.dependencies=function(e){if("object"===s(e.schema.dependencies))for(var t,r,n=Object.keys(e.schema.dependencies),i=n.length,a=0,c=0;c1&&delete this.objects[n][r]},f.prototype.dispose=function(){this.objects.length=0,this.properties.length=0},m.prototype.clone=function(e){var t=new m({schema:e,formats:this.formats,greedy:this.greedy,resolver:this.resolver,id:this.id,funcache:this.funcache,scope:this.scope});return t},m.prototype.declare=function(e){var t=this.id();return this.code.def(t,e),t},m.prototype.cache=function(e,t){var r,n=this.funcache[e];return n||(n=this.funcache[e]={key:this.id()},r=this.clone(t),n.func=r.compile(n.key),this.scope.refs[n.key]=n.func,r.dispose()),"refs."+n.key},m.prototype.error=function(e,t,r){var n=this.schema,o=this.path,s="data"!==o||t?'(path ? path + "." : "") + '+u(o,t)+",":"path,",a=t&&n.properties&&n.properties[t]?this.resolver.resolve(n.properties[t]):null,c=a?a.requiredMessage:n.invalidMessage;c||(c=a&&a.messages&&a.messages[e]||n.messages&&n.messages[e]),this.code("errors.push({"),c&&this.code("message: "+i(c)+","),r&&this.code("additionalProperties: "+r+","),this.code("path: "+s)("keyword: "+i(e))("})"),this.greedy||this.code("return")},m.prototype.refactor=function(e,t,r){var n="data"!==e?'(path ? path + "." : "") + '+u(e):"path",i=this.cache(r,t),o=this.declare();this.code(o+" = "+i+"("+e+", "+n+", errors)"),this.greedy||this.code("if (errors.length) { return }")},m.prototype.descend=function(e,t){var r=this.path,n=this.schema;this.path=e,this.schema=t,this.generate(),this.path=r,this.schema=n},m.prototype.generate=function(){function e(e){k[e](l)}var t,r,o,a,c,u,d,p=this.path,f=this.schema,l=this,m=this.scope;if("object"===s(f)){if(void 0!==f.$ref){if(f=this.resolver.resolve(f),this.resolver.hasRef(f))return void this.refactor(p,f,this.resolver.getNormalizedRef(this.schema)||this.schema.$ref);this.schema=f}if(o=h(f),o["enum"])return void k["enum"](l);for(a=Object.keys(o.perType),d=0;d-1&&o.type.splice(c,1));o.type&&(o.type.length?(this.code((a.length?"else ":"")+"if (!("+o.type.map(function(e){return S[e]?S[e](p):"true"}).join(" || ")+")) {"),this.error("type"),this.code("}")):(this.code("else {"),this.error("type"),this.code("}"))),o.allType.forEach(function(e){k[e](l)}),f.format&&this.formats&&(r=this.formats[f.format],r&&("string"==typeof r||r instanceof RegExp?(this.code("if (!("+n(r)+").test("+p+")) {"),this.error("format"),this.code("}")):"function"==typeof r&&((m.formats||(m.formats={}))[f.format]=r,(m.schemas||(m.schemas={}))[f.format]=f,t=i(f.format),this.code("if (!formats["+t+"]("+p+", schemas["+t+"])) {"),this.error("format"),this.code("}"))))}},m.prototype.compile=function(e){return this.code=E("jsen_compiled"+(e?"_"+e:""),"data","path","errors"),this.generate(),this.code.compile(this.scope)},m.prototype.dispose=function(){for(var e in this)this[e]=void 0},g.browser=x,g.clone=d,g.equal=O,g.unique=P,g.ucs2length=C,g.SchemaResolver=j,g.resolve=j.resolvePointer,e.exports=g},function(e,t){"use strict";e.exports=function(){var e=Array.apply(null,arguments),t=e.shift(),r=" ",n="",i="",o=1,s="{[",a="}]",c=function(){for(var e=r,t=0;t++-1&&s.indexOf(r)>-1?(o--,h(e),o++):s.indexOf(r)>-1?(h(e),o++):a.indexOf(t)>-1?(o--,h(e)):h(e),u};return u.def=function(e,t){return i+=(i?",\n"+r+" ":"")+e+(void 0!==t?" = "+t:""),u},u.toSource=function(){return"function "+t+"("+e.join(", ")+") {\n"+r+'"use strict"\n'+(i?r+"var "+i+";\n":"")+n+"}"},u.compile=function(e){var t="return ("+u.toSource()+")",r=e||{},n=Object.keys(r),i=n.map(function(e){return r[e]});return Function.apply(null,n.concat(t)).apply(null,i)},u}},function(e,t){"use strict";function r(e){var t=Object.prototype.toString.call(e);return t.substr(8,t.length-9).toLowerCase()}function n(e,t){var r,n,o=Object.keys(e).sort(),s=Object.keys(t).sort();if(!i(o,s))return!1;for(r=0;r-1)throw new Error(u+" "+t);return this.refStack.push(t),r=this._resolveRef(t),this.refStack.pop(),e===this.rootSchema&&(this.resolvedRootSchema=r),r},o.prototype.hasRef=function(e){var t,r,n,i,o=Object.keys(e);if(o.indexOf("$ref")>-1)return!0;for(n=0,t=o.length;n { * @class Embed */ export abstract class Embed { - static allowedEvents = ["loaded", "saved", "rendered", "saveAsTriggered"]; + static allowedEvents = ["loaded", "saved", "rendered", "saveAsTriggered", "error", "dataSelected"]; static accessTokenAttribute = 'powerbi-access-token'; static embedUrlAttribute = 'powerbi-embed-url'; static nameAttribute = 'powerbi-name'; diff --git a/src/report.ts b/src/report.ts index 10ea566e..d4c498c0 100644 --- a/src/report.ts +++ b/src/report.ts @@ -29,7 +29,7 @@ export interface IReportNode { * @implements {IFilterable} */ export class Report extends embed.Embed implements IReportNode, IFilterable { - static allowedEvents = ["dataSelected", "filtersApplied", "pageChanged", "error"]; + static allowedEvents = ["filtersApplied", "pageChanged"]; static reportIdAttribute = 'powerbi-report-id'; static filterPaneEnabledAttribute = 'powerbi-settings-filter-pane-enabled'; static navContentPaneEnabledAttribute = 'powerbi-settings-nav-content-pane-enabled'; From 50c14b01482e550b15c2fec9b7663347965b4b69 Mon Sep 17 00:00:00 2001 From: Omri Armstrong Date: Sun, 12 Feb 2017 10:53:11 +0200 Subject: [PATCH 07/11] changing create sample --- demo/code-demo/scripts/codesamples.js | 16 +++++++++------- demo/code-demo/scripts/step_authorize.js | 6 +++--- demo/code-demo/settings_embed.html | 2 +- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/demo/code-demo/scripts/codesamples.js b/demo/code-demo/scripts/codesamples.js index 6d4f56e8..6e85949c 100644 --- a/demo/code-demo/scripts/codesamples.js +++ b/demo/code-demo/scripts/codesamples.js @@ -7,8 +7,6 @@ // ---- Embed Code ---------------------------------------------------- function _Embed_BasicEmbed() { - // Get models. models contains enums that can be used. - var models = window['powerbi-client'].models; // Read embed application token from textbox var txtAccessToken = $('#txtAccessToken').val(); @@ -19,8 +17,11 @@ function _Embed_BasicEmbed() { // Read report Id from textbox var txtEmbedReportId = $('#txtEmbedReportId').val(); + // Get models. models contains enums that can be used. + var models = window['powerbi-client'].models; + // Embed report in View mode or Edit mode based or checkbox value. - var checked = $('#viewMode:checked').val(); + var checked = $('#viewModeCheckbox')[0].checked; var viewMode = checked ? models.ViewMode.Edit : models.ViewMode.View; // Embed configuration used to describe the what and how to embed. @@ -32,7 +33,7 @@ function _Embed_BasicEmbed() { accessToken: txtAccessToken, embedUrl: txtEmbedUrl, id: txtEmbedReportId, - permissions: 3 /*models.Permissions.All gives maximum permissions*/, + permissions: models.Permissions.All /*gives maximum permissions*/, viewMode: viewMode, settings: { filterPaneEnabled: true, @@ -48,7 +49,6 @@ function _Embed_BasicEmbed() { // Report.off removes a given event handler if it exists. report.off("loaded"); - report.off("error"); // Report.on will add an event handler which prints to Log window. report.on("loaded", function() { @@ -56,6 +56,8 @@ function _Embed_BasicEmbed() { }); report.on("error", function(event) { Log.log(event.detail); + + report.off("error"); }); } @@ -558,8 +560,8 @@ function _Events_SaveAsTriggered() { Log.log(event); }); - // Select Run and then run SaveAs. + // Select Run and then select SaveAs. // You should see an entry in the Log window. - Log.logText("Run SaveAs to see events in Log window."); + Log.logText("Select SaveAs to see events in Log window."); } \ No newline at end of file diff --git a/demo/code-demo/scripts/step_authorize.js b/demo/code-demo/scripts/step_authorize.js index d97078ad..d28d1f02 100644 --- a/demo/code-demo/scripts/step_authorize.js +++ b/demo/code-demo/scripts/step_authorize.js @@ -37,9 +37,9 @@ function OpenCleanEmbedStepCreate() function OpenEmbedStepCreateWithSample() { // Default values - report with embed token which expires on 1/1/2030. - var embedUrl = 'https://dxt.powerbi.com/appTokenReportEmbed?reportEmbedEditingEnabled=true'; - var datasetId = '56603ccc-e43f-46ad-ba2f-b9e9a145f0b7'; - var accessToken = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ3Y24iOiJTYWdlRFhUV0MiLCJ3aWQiOiIwZmI4MGMyNC05ODlmLTQ4NDEtOWU0OS1iOWFjOWNhMzRmZTIiLCJkaWQiOiI1NjYwM2NjYy1lNDNmLTQ2YWQtYmEyZi1iOWU5YTE0NWYwYjciLCJ2ZXIiOiIwLjIuMCIsInR5cGUiOiJlbWJlZCIsInNjcCI6IkRhdGFzZXQuUmVhZCBXb3Jrc3BhY2UuUmVwb3J0LkNyZWF0ZSIsImlzcyI6IlBvd2VyQklTREsiLCJhdWQiOiJodHRwczovL2FuYWx5c2lzLndpbmRvd3MubmV0L3Bvd2VyYmkvYXBpIiwiZXhwIjoxNDkzNzE3MTU2LCJuYmYiOjE0ODUwNzM1NTZ9.3V7S7JinkJygkXaLtyK_StfYSR53Mbc56-VPFJFlETI"; + var embedUrl = 'https://embedded.powerbi.com/appTokenReportEmbed?reportEmbedEditingEnabled=true'; + var datasetId = '8f94aa87-a12b-4afa-9ff3-a0f78cd434b9'; + var accessToken = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ3Y24iOiJEYmctV0FCSS1QQUFTLTEtU0NVUyIsIndpZCI6IjhhMGNlZTNlLTc3ZmEtNGM1Ny1hZTQ4LWM4NzliOTkwMjQyNSIsImRpZCI6IjhmOTRhYTg3LWExMmItNGFmYS05ZmYzLWEwZjc4Y2Q0MzRiOSIsInZlciI6IjAuMi4wIiwidHlwZSI6ImVtYmVkIiwic2NwIjoiRGF0YXNldC5SZWFkIiwiaXNzIjoiUG93ZXJCSVNESyIsImF1ZCI6Imh0dHBzOi8vYW5hbHlzaXMud2luZG93cy5uZXQvcG93ZXJiaS9hcGkiLCJleHAiOjE0OTU1MzE5MjEsIm5iZiI6MTQ4Njg4ODMyMX0.Lzug-8hFwPEWNgCJovk338Fc6Y6lrAZOcOruDRzT-Qw"; OpenEmbedStepCreateWithSampleValues(accessToken, embedUrl, datasetId); } diff --git a/demo/code-demo/settings_embed.html b/demo/code-demo/settings_embed.html index 1c47a739..4010e078 100644 --- a/demo/code-demo/settings_embed.html +++ b/demo/code-demo/settings_embed.html @@ -29,6 +29,6 @@

    Embed Report

    - +
    \ No newline at end of file From 3ad6791c5ab4bc37950ed1de99088019f3aac4d6 Mon Sep 17 00:00:00 2001 From: Omri Armstrong Date: Mon, 13 Feb 2017 15:24:11 +0200 Subject: [PATCH 08/11] update models to 11.1 --- demo/code-demo/scripts/codesamples.js | 8 +++++++- dist/powerbi.js | 5 +++-- dist/powerbi.js.map | 2 +- dist/powerbi.min.js | 4 ++-- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/demo/code-demo/scripts/codesamples.js b/demo/code-demo/scripts/codesamples.js index 6e85949c..ef57249e 100644 --- a/demo/code-demo/scripts/codesamples.js +++ b/demo/code-demo/scripts/codesamples.js @@ -117,11 +117,17 @@ function _Embed_Create() { var report = powerbi.createReport(reportContainer, embedCreateConfiguration); // Report.off removes a given event handler if it exists. - report.off("error"); + report.off("loaded"); // Report.on will add an event handler which prints to Log window. + report.on("loaded", function() { + Log.logText("Loaded"); + }); + report.on("error", function(event) { Log.log(event.detail); + + report.off("error"); }); } diff --git a/dist/powerbi.js b/dist/powerbi.js index 8dc2e8b9..30f2a582 100644 --- a/dist/powerbi.js +++ b/dist/powerbi.js @@ -1073,7 +1073,7 @@ return /******/ (function(modules) { // webpackBootstrap /* 5 */ /***/ function(module, exports, __webpack_require__) { - /*! powerbi-models v0.10.4 | (c) 2016 Microsoft Corporation MIT */ + /*! powerbi-models v0.11.1 | (c) 2016 Microsoft Corporation MIT */ (function webpackUniversalModuleDefinition(root, factory) { if(true) module.exports = factory(); @@ -1542,7 +1542,8 @@ return /******/ (function(modules) { // webpackBootstrap 0, 1, 2, - 3 + 4, + 7 ], "default": 0, "invalidMessage": "permissions property is invalid" diff --git a/dist/powerbi.js.map b/dist/powerbi.js.map index ea2e825a..47a16ee7 100644 --- a/dist/powerbi.js.map +++ b/dist/powerbi.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap cf91274332dca4206ff6","webpack:///./src/powerbi.ts","webpack:///./src/service.ts","webpack:///./src/embed.ts","webpack:///./src/util.ts","webpack:///./src/report.ts","webpack:///./~/powerbi-models/dist/models.js","webpack:///./src/page.ts","webpack:///./src/create.ts","webpack:///./src/dashboard.ts","webpack:///./src/tile.ts","webpack:///./src/factories.ts","webpack:///./src/config.ts","webpack:///./~/window-post-message-proxy/dist/windowPostMessageProxy.js","webpack:///./~/http-post-message/dist/httpPostMessage.js","webpack:///./~/powerbi-router/dist/router.js"],"names":[],"mappings":"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AAC;SACvB,CAAC,CAAC;cACD,KAAK,CAAC,kBAAQ;aACb,MAAM,QAAQ,CAAC,IAAI,CAAC;SACtB,CAAC,CAAC,CAAC;KACP,CAAC;KAzPM,oBAAa,GAAG,CAAC,gBAAgB,EAAE,aAAa,CAAC,CAAC;KAClD,wBAAiB,GAAG,mBAAmB,CAAC;KACxC,iCAA0B,GAAG,sCAAsC,CAAC;KACpE,qCAA8B,GAAG,2CAA2C,CAAC;KAC7E,oBAAa,GAAG,cAAc,CAAC;KAC/B,WAAI,GAAG,QAAQ,CAAC;KAqPzB,aAAC;AAAD,EAAC,CA3P2B,KAAK,CAAC,KAAK,GA2PtC;AA3PY,eAAM,SA2PlB;;;;;;;ACzRD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD,qCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;AACA,qBAAoB,sBAAsB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA,GAAE,gDAAgD;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA,0BAAyB,uBAAuB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAwB,2BAA2B;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA,0BAAyB,uBAAuB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAiD,+BAA+B,GAAG,sCAAsC;AACzH,mDAAkD,+BAA+B,GAAG,sCAAsC;AAC1H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE,kDAAkD;AACpD;AACA;AACA;AACA;AACA,GAAE,4CAA4C;AAC9C;AACA;;;AAGA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAQ;AACR;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;AACA,SAAQ;AACR;AACA;AACA,SAAQ;AACR;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;AACA,SAAQ;AACR;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA,MAAK;AACL;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA,OAAM;AACN;AACA;AACA,OAAM;AACN;AACA;AACA,OAAM;AACN;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;;AAEA,QAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAe;AACf;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,+BAA8B;AAC9B;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,uFAAsF;AACtF;AACA,qBAAoB;AACpB;;AAEA;AACA;AACA,oFAAmF;AACnF;AACA,yBAAwB;AACxB;AACA;;AAEA;AACA;AACA,sFAAqF;AACrF;AACA,yBAAwB;AACxB;AACA;;AAEA;AACA;AACA,oFAAmF;AACnF;AACA,yBAAwB;AACxB;AACA;;AAEA;AACA;AACA,sFAAqF;AACrF;AACA,yBAAwB;AACxB;AACA;;AAEA;AACA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ACA;AACA;AACA;;AAEA,iBAAgB,iBAAiB;AACjC;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAgB,SAAS;AACzB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,wCAAuC,SAAS;AAChD;AACA;AACA;AACA;AACA;AACA;;AAEA,uCAAsC,SAAS;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,2CAA0C,SAAS;AACnD;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA,iBAAgB,4BAA4B;AAC5C;AACA;;AAEA,qBAAoB,iBAAiB;AACrC;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA,qBAAoB,kBAAkB;AACtC;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,yBAAwB,qBAAqB;AAC7C;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAwB,yBAAyB;AACjD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAwB,gBAAgB;AACxC;AACA;AACA;AACA;AACA;AACA;;AAEA,qBAAoB,yBAAyB;AAC7C;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;;AAEN;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,8BAA6B;;AAE7B;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,SAAQ;;AAER;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,yCAAwC,SAAS;AACjD;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA,iBAAgB;AAChB;;AAEA;;AAEA;AACA,qCAAoC;AACpC;;AAEA,iBAAgB,qBAAqB;AACrC;;AAEA,mFAAkF;;AAElF;;AAEA,sBAAqB;;AAErB;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,4BAA2B;AAC3B,uCAAsC;AACtC;AACA;AACA,eAAc,sBAAsB;AACpC;AACA,0BAAyB;AACzB;AACA;AACA,+BAA8B,GAAG;AACjC;AACA,0BAAyB;AACzB;AACA;;AAEA;AACA;AACA,OAAM;;AAEN;AACA;;AAEA;AACA;AACA,qFAAoF;AACpF;AACA,8BAA6B;AAC7B;AACA;AACA,uDAAsD;AACtD,uDAAsD;;AAEtD;;AAEA,iHAAgH;AAChH;AACA,8BAA6B;AAC7B;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,4BAA2B,0BAA0B,EAAE;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA;AACA;AACA,wBAAuB,yBAAyB;;AAEhD;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;AAGA,QAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAgB;AAChB,iBAAgB;AAChB;AACA;AACA,qCAAoC,WAAW;AAC/C;AACA,WAAU;AACV;AACA;AACA,WAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,kEAAiE;AACjE;AACA,8CAA6C;AAC7C,wBAAuB;AACvB;;AAEA;AACA;AACA,+BAA8B;AAC9B;AACA,8CAA6C,iBAAiB,EAAE;;AAEhE;AACA;;AAEA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,iBAAgB,kBAAkB;AAClC;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,wBAAuB;AACvB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,qBAAoB,cAAc;AAClC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA,QAAO;AACP;AACA;;AAEA;;AAEA;;AAEA;AACA,uCAAsC,SAAS;AAC/C;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,OAAM;AACN;;AAEA;;AAEA,QAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAM;;AAEN;AACA;AACA;;AAEA;AACA;;AAEA;AACA,sEAAqE;AACrE;AACA;AACA;AACA;AACA;AACA,uBAAsB;AACtB;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,0BAAyB;AACzB;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,iBAAgB,iBAAiB;AACjC;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,WAAU;;AAEV;AACA,OAAM;;AAEN;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,oCAAmC,SAAS;AAC5C;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,kBAAiB,KAAK;;AAEtB;AACA;AACA;AACA;AACA;AACA;AACA,uCAAsC;AACtC;AACA;AACA,6CAA4C,KAAK;AACjD,4CAA2C,KAAK;AAChD;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;AACN;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA,SAAQ;AACR;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,sCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,qBAAoB,4BAA4B;AAChD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,qBAAoB,yBAAyB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,6CAA4C,OAAO;AACnD;AACA;AACA;AACA;AACA,4CAA2C,OAAO;AAClD;AACA;AACA;AACA;AACA;AACA,eAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,4CAA2C,OAAO;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAI;AACJ;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,oBAAmB,mBAAmB;AACtC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,sBAAqB,mBAAmB;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAsB,iBAAiB;AACvC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,gCAA+B,QAAQ;AACvC;AACA;AACA;AACA,OAAM;AACN;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA,YAAW,MAAM;AACjB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAI;AACJ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA,QAAO;AACP;AACA;;AAEA,oCAAmC,sDAAsD;AACzF,GAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,cAAa,OAAO;AACpB,gBAAe,MAAM;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAa,MAAM;AACnB,cAAa,SAAS;AACtB;AACA,gBAAe,MAAM;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB,cAAa,SAAS;AACtB;AACA,gBAAe,MAAM;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB,gBAAe,MAAM;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAsC;AACtC;AACA,OAAM;AACN,8BAA6B;AAC7B;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAa,MAAM;AACnB,gBAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;;AAEA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB,gBAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB,gBAAe,OAAO;AACtB;AACA;AACA,WAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAgC,mCAAmC;AACnE;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB,gBAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,eAAc,WAAW;AACzB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,0BAAyB;;AAEzB,2CAA0C,qBAAqB;;AAE/D;AACA;AACA;AACA;AACA;AACA,oCAAmC,oBAAoB;;AAEvD;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB,gBAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,eAAc,iBAAiB;AAC/B;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,4BAA2B,iBAAiB;AAC5C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,gBAAe,iBAAiB;AAChC;;AAEA;AACA;AACA;;AAEA;AACA;AACA,gCAA+B,oBAAoB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB;AACA,gBAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB;AACA,gBAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ,IAAG;AACH,wCAAuC;AACvC;AACA,KAAI,OAAO;AACX;AACA;AACA;AACA;AACA,IAAG,OAAO;AACV;AACA;;AAEA,GAAE;;AAEF,8BAA6B,6DAA6D,aAAa,EAAE;;AAEzG,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA,QAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;;;AAGA,QAAO;AACP;AACA;;AAEA;;AAEA;AACA;;;AAGA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,mBAAkB,SAAS;AAC3B;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,OAAM;AACN;AACA,OAAM;AACN;AACA;AACA;;AAEA;AACA;;;AAGA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV,SAAQ;AACR;AACA;AACA,OAAM;;AAEN;;AAEA;AACA;AACA;AACA;;;AAGA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ,iBAAgB;AAChB;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AA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CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAuD,uCAAuC;AAC9F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2FAA0F;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAsB;AACtB;AACA;AACA,eAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;;;AAGA;AACA;AACA,EAAC;AACD;AACA,mD;;;;;;ACtSA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD,qCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,0CAAyC,qBAAqB;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAkC,cAAc;AAChD,wCAAuC,yCAAyC;AAChF;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA,mCAAkC,cAAc;AAChD,wCAAuC,yCAAyC;AAChF;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA,mCAAkC,cAAc;AAChD,wCAAuC,yCAAyC;AAChF;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA,mCAAkC,cAAc;AAChD,wCAAuC,yCAAyC;AAChF;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA,gCAA+B,aAAa;AAC5C,mCAAkC,cAAc;AAChD,wCAAuC,yCAAyC;AAChF;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA,wCAAuC,yCAAyC;AAChF,0CAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAAyB,uBAAuB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA;AACA,GAAE;AACF;;;AAGA;AACA;AACA,EAAC;AACD;AACA,4C;;;;;;AClLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD,qCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAqC,iBAAiB,EAAE;AACxD;AACA;AACA,eAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;;;AAGA,QAAO;AACP;AACA;;AAEA,oCAAmC,8CAA8C;AACjF;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,wCAAuC,6EAA6E;AACpH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAQ;;AAER;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,WAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;AACA,qBAAoB,qBAAqB;AACzC;AACA;;AAEA;AACA,qBAAoB;AACpB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAY;AACZ;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA,iCAAgC,+BAA+B;AAC/D,gBAAe,iBAAiB;AAChC,SAAQ;AACR;;AAEA;AACA;AACA,8BAA6B,KAAK;AAClC;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,0DAAyD,sBAAsB;AAC/E;AACA;AACA;;AAEA,uBAAsB,iBAAiB;AACvC;AACA,6CAA4C,yDAAyD;AACrG;;AAEA;AACA,SAAQ;;AAER;AACA;AACA,SAAQ;;AAER;AACA;AACA;AACA;;AAEA,yDAAwD,kBAAkB;AAC1E;AACA;AACA,mCAAkC,yDAAyD;AAC3F,SAAQ;;AAER;AACA;AACA,SAAQ;;AAER;AACA;AACA;AACA;;AAEA,sDAAqD,kBAAkB;AACvE;AACA;AACA,mCAAkC,wDAAwD;AAC1F,SAAQ;;AAER;AACA;AACA,SAAQ;;AAER;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAQ;AACR,2BAA0B,WAAW,EAAE;AACvC,8BAA6B,WAAW;AACxC;;AAEA;AACA;AACA;AACA,sCAAqC,yBAAyB;;AAE9D;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,qBAAoB,mBAAmB;AACvC;;AAEA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA;AACA,WAAU;AACV;AACA;AACA,WAAU;AACV;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,uBAAsB,qBAAqB;AAC3C;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAQ;;AAER;AACA;;AAEA;AACA;AACA,2CAA0C,cAAc;;AAExD;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAQ;;AAER;AACA;AACA;AACA;;AAEA;;AAEA,uBAAsB,qBAAqB;AAC3C;;AAEA;;AAEA;AACA,6CAA4C,sBAAsB;AAClE,aAAY;AACZ,6CAA4C,sBAAsB;AAClE;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAQ;AACR;;AAEA;AACA;;AAEA,sCAAqC,KAAK;AAC1C;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;;AAEN;AACA;AACA;AACA;;AAEA;;AAEA,qBAAoB,mBAAmB;AACvC;;AAEA,uBAAsB,gBAAgB;AACtC;AACA;;AAEA,uBAAsB;AACtB;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAQ,eAAe;AACvB;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,8BAA6B;AAC7B;;AAEA;;AAEA,uBAAsB,iBAAiB;AACvC;;AAEA;;AAEA;;AAEA,yBAAwB,mBAAmB;AAC3C;;AAEA,0EAAyE,UAAU;;AAEnF;;AAEA;AACA,+CAA8C,0DAA0D;AACxG;;AAEA;AACA;AACA;AACA;AACA,2BAA0B;AAC1B;AACA;;AAEA;AACA,6CAA4C,0DAA0D;AACtG;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAQ;;AAER;AACA;;AAEA,uBAAsB,oDAAoD;;AAE1E;;AAEA,uBAAsB,yBAAyB;AAC/C;AACA;;AAEA;AACA,SAAQ;;AAER;AACA;AACA,SAAQ;;AAER;AACA;AACA,uBAAsB,oDAAoD;;AAE1E;;AAEA,uBAAsB,mBAAmB;AACzC;;AAEA,wEAAuE,UAAU;;AAEjF;AACA;AACA;;AAEA,yCAAwC,uBAAuB;;AAE/D;AACA;AACA;;AAEA;AACA,SAAQ;;AAER;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAwB,iBAAiB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA4B,kBAAkB;AAC9C;AACA;AACA;AACA,aAAY;AACZ;AACA;AACA;AACA;;AAEA,mCAAkC,WAAW;;AAE7C;AACA,SAAQ;;AAER;AACA;AACA,sBAAqB,kBAAkB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAY;AACZ;AACA;AACA;AACA;AACA,SAAQ;;AAER;AACA;AACA,yDAAwD;AACxD;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,uCAAsC,mBAAmB;;AAEzD;AACA;AACA;AACA;AACA;;AAEA,mBAAkB,eAAe;AACjC;AACA,iCAAgC,OAAO;AACvC;;AAEA;AACA,mBAAkB,iBAAiB;AACnC,qCAAoC,2BAA2B;AAC/D;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA,sDAAqD,oCAAoC,EAAE;AAC3F,OAAM;AACN;AACA,OAAM;AACN;AACA;AACA,GAAE;;AAEF;AACA,8BAA6B;;AAE7B,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA,QAAO;AACP;AACA;;AAEA,+BAA8B,mDAAmD;;;AAGjF;AACA;AACA,EAAC;AACD;AACA,mC","file":"powerbi.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"powerbi-client\"] = factory();\n\telse\n\t\troot[\"powerbi-client\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap cf91274332dca4206ff6","import * as service from './service';\r\nimport * as factories from './factories';\r\nimport * as models from 'powerbi-models';\r\nimport { IFilterable } from './ifilterable';\r\n\r\nexport {\r\n IFilterable,\r\n service,\r\n factories,\r\n models\r\n};\r\nexport {\r\n Report\r\n} from './report';\r\nexport {\r\n Tile\r\n} from './tile';\r\nexport {\r\n IEmbedConfiguration,\r\n Embed\r\n} from './embed';\r\nexport {\r\n Page\r\n} from './page';\r\n\r\ndeclare var powerbi: service.Service;\r\ndeclare global {\r\n interface Window {\r\n powerbi: service.Service;\r\n }\r\n}\r\n\r\n/**\r\n * Makes Power BI available to the global object for use in applications that don't have module loading support.\r\n *\r\n * Note: create an instance of the class with the default configuration for normal usage, or save the class so that you can create an instance of the service.\r\n */\r\nvar powerbi = new service.Service(factories.hpmFactory, factories.wpmpFactory, factories.routerFactory);\r\nwindow.powerbi = powerbi;\n\n\n// WEBPACK FOOTER //\n// ./src/powerbi.ts","import * as embed from './embed';\nimport { Report } from './report';\nimport { Create } from './create';\nimport { Dashboard } from './dashboard';\nimport { Tile } from './tile';\nimport { Page } from './page';\nimport * as utils from './util';\nimport * as wpmp from 'window-post-message-proxy';\nimport * as hpm from 'http-post-message';\nimport * as router from 'powerbi-router';\nimport * as models from 'powerbi-models';\n\nexport interface IEvent {\n type: string;\n id: string;\n name: string;\n value: T;\n}\n\nexport interface ICustomEvent extends CustomEvent {\n detail: T;\n}\n\nexport interface IEventHandler {\n (event: ICustomEvent): any;\n}\n\nexport interface IHpmFactory {\n (wpmp: wpmp.WindowPostMessageProxy, targetWindow?: Window, version?: string, type?: string, origin?: string): hpm.HttpPostMessage;\n}\n\nexport interface IWpmpFactory {\n (name?: string, logMessages?: boolean, eventSourceOverrideWindow?: Window): wpmp.WindowPostMessageProxy;\n}\n\nexport interface IRouterFactory {\n (wpmp: wpmp.WindowPostMessageProxy): router.Router;\n}\n\nexport interface IPowerBiElement extends HTMLElement {\n powerBiEmbed: embed.Embed;\n}\n\nexport interface IDebugOptions {\n logMessages?: boolean;\n wpmpName?: string;\n}\n\nexport interface IServiceConfiguration extends IDebugOptions {\n autoEmbedOnContentLoaded?: boolean;\n onError?: (error: any) => any;\n version?: string;\n type?: string;\n}\n\nexport interface IService {\n hpm: hpm.HttpPostMessage;\n}\n\n/**\n * The Power BI Service embed component, which is the entry point to embed all other Power BI components into your application\n * \n * @export\n * @class Service\n * @implements {IService}\n */\nexport class Service implements IService {\n\n /**\n * A list of components that this service can embed\n */\n private static components: (typeof Report | typeof Tile | typeof Dashboard)[] = [\n Tile,\n Report,\n Dashboard\n ];\n\n /**\n * The default configuration for the service\n */\n private static defaultConfig: IServiceConfiguration = {\n autoEmbedOnContentLoaded: false,\n onError: (...args) => console.log(args[0], args.slice(1))\n };\n\n /**\n * Gets or sets the access token as the global fallback token to use when a local token is not provided for a report or tile.\n * \n * @type {string}\n */\n accessToken: string;\n\n /**The Configuration object for the service*/\n private config: IServiceConfiguration;\n\n /** A list of Dashboard, Report and Tile components that have been embedded using this service instance. */\n private embeds: embed.Embed[];\n /** TODO: Look for way to make hpm private without sacraficing ease of maitenance. This should be private but in embed needs to call methods. */\n hpm: hpm.HttpPostMessage;\n /** TODO: Look for way to make wpmp private. This is only public to allow stopping the wpmp in tests */\n wpmp: wpmp.WindowPostMessageProxy;\n private router: router.Router;\n\n /**\n * Creates an instance of a Power BI Service.\n * \n * @param {IHpmFactory} hpmFactory The http post message factory used in the postMessage communication layer\n * @param {IWpmpFactory} wpmpFactory The window post message factory used in the postMessage communication layer\n * @param {IRouterFactory} routerFactory The router factory used in the postMessage communication layer\n * @param {IServiceConfiguration} [config={}]\n */\n constructor(hpmFactory: IHpmFactory, wpmpFactory: IWpmpFactory, routerFactory: IRouterFactory, config: IServiceConfiguration = {}) {\n this.wpmp = wpmpFactory(config.wpmpName, config.logMessages);\n this.hpm = hpmFactory(this.wpmp, null, config.version, config.type);\n this.router = routerFactory(this.wpmp);\n\n /**\n * Adds handler for report events.\n */\n this.router.post(`/reports/:uniqueId/events/:eventName`, (req, res) => {\n const event: IEvent = {\n type: 'report',\n id: req.params.uniqueId,\n name: req.params.eventName,\n value: req.body\n };\n\n this.handleEvent(event);\n });\n this.router.post(`/reports/:uniqueId/pages/:pageName/events/:eventName`, (req, res) => {\n const event: IEvent = {\n type: 'report',\n id: req.params.uniqueId,\n name: req.params.eventName,\n value: req.body\n };\n\n this.handleEvent(event);\n });\n\n this.router.post(`/dashboards/:uniqueId/events/:eventName`, (req, res) => {\n const event: IEvent = {\n type: 'dashboard',\n id: req.params.uniqueId,\n name: req.params.eventName,\n value: req.body\n };\n\n this.handleEvent(event);\n });\n\n this.embeds = [];\n\n // TODO: Change when Object.assign is available.\n this.config = utils.assign({}, Service.defaultConfig, config);\n\n if (this.config.autoEmbedOnContentLoaded) {\n this.enableAutoEmbed();\n }\n }\n\n /**\n * Creates new report\n * @param {HTMLElement} element\n * @param {embed.IEmbedConfiguration} [config={}]\n * @returns {embed.Embed}\n */\n createReport(element: HTMLElement, config: embed.IEmbedConfiguration): embed.Embed {\n config.type = 'create';\n let powerBiElement = element;\n const component = new Create(this, powerBiElement, config);\n powerBiElement.powerBiEmbed = component;\n this.embeds.push(component);\n\n return component;\n }\n\n /**\n * TODO: Add a description here\n * \n * @param {HTMLElement} [container]\n * @param {embed.IEmbedConfiguration} [config=undefined]\n * @returns {embed.Embed[]}\n */\n init(container?: HTMLElement, config: embed.IEmbedConfiguration = undefined): embed.Embed[] {\n container = (container && container instanceof HTMLElement) ? container : document.body;\n\n const elements = Array.prototype.slice.call(container.querySelectorAll(`[${embed.Embed.embedUrlAttribute}]`));\n return elements.map(element => this.embed(element, config));\n }\n\n /**\n * Given a configuration based on an HTML element,\n * if the component has already been created and attached to the element, reuses the component instance and existing iframe,\n * otherwise creates a new component instance.\n * \n * @param {HTMLElement} element\n * @param {embed.IEmbedConfiguration} [config={}]\n * @returns {embed.Embed}\n */\n embed(element: HTMLElement, config: embed.IEmbedConfiguration = {}): embed.Embed {\n let component: embed.Embed;\n let powerBiElement = element;\n\n if (powerBiElement.powerBiEmbed) {\n component = this.embedExisting(powerBiElement, config);\n }\n else {\n component = this.embedNew(powerBiElement, config);\n }\n\n return component;\n }\n\n /**\n * Given a configuration based on a Power BI element, saves the component instance that reference the element for later lookup.\n * \n * @private\n * @param {IPowerBiElement} element\n * @param {embed.IEmbedConfiguration} config\n * @returns {embed.Embed}\n */\n private embedNew(element: IPowerBiElement, config: embed.IEmbedConfiguration): embed.Embed {\n const componentType = config.type || element.getAttribute(embed.Embed.typeAttribute);\n if (!componentType) {\n throw new Error(`Attempted to embed using config ${JSON.stringify(config)} on element ${element.outerHTML}, but could not determine what type of component to embed. You must specify a type in the configuration or as an attribute such as '${embed.Embed.typeAttribute}=\"${Report.type.toLowerCase()}\"'.`);\n }\n\n // Saves the type as part of the configuration so that it can be referenced later at a known location.\n config.type = componentType;\n\n const Component = utils.find(component => componentType === component.type.toLowerCase(), Service.components);\n if (!Component) {\n throw new Error(`Attempted to embed component of type: ${componentType} but did not find any matching component. Please verify the type you specified is intended.`);\n }\n\n const component = new Component(this, element, config);\n element.powerBiEmbed = component;\n this.embeds.push(component);\n\n return component;\n }\n\n /**\n * Given an element that already contains an embed component, load with a new configuration.\n * \n * @private\n * @param {IPowerBiElement} element\n * @param {embed.IEmbedConfiguration} config\n * @returns {embed.Embed}\n */\n private embedExisting(element: IPowerBiElement, config: embed.IEmbedConfiguration): embed.Embed {\n const component = utils.find(x => x.element === element, this.embeds);\n if (!component) {\n throw new Error(`Attempted to embed using config ${JSON.stringify(config)} on element ${element.outerHTML} which already has embedded comopnent associated, but could not find the existing comopnent in the list of active components. This could indicate the embeds list is out of sync with the DOM, or the component is referencing the incorrect HTML element.`);\n }\n\n /**\n * TODO: Dynamic embed type switching could be supported but there is work needed to prepare the service state and DOM cleanup.\n * remove all event handlers from the DOM, then reset the element to initial state which removes iframe, and removes from list of embeds\n * then we can call the embedNew function which would allow setting the proper embedUrl and construction of object based on the new type.\n */\n if (typeof config.type === \"string\" && config.type !== component.config.type) {\n\n /**\n * When loading report after create we want to use existing Iframe to optimize load period\n */\n if(config.type === \"report\" && component.config.type === \"create\") {\n const report = new Report(this, element, config, element.powerBiEmbed.iframe);\n report.load(config);\n element.powerBiEmbed = report;\n this.embeds.push(report);\n\n return report;\n }\n\n throw new Error(`Embedding on an existing element with a different type than the previous embed object is not supported. Attempted to embed using config ${JSON.stringify(config)} on element ${element.outerHTML}, but the existing element contains an embed of type: ${this.config.type} which does not match the new type: ${config.type}`);\n }\n\n component.load(config);\n\n return component;\n }\n\n /**\n * Adds an event handler for DOMContentLoaded, which searches the DOM for elements that have the 'powerbi-embed-url' attribute,\n * and automatically attempts to embed a powerbi component based on information from other powerbi-* attributes.\n *\n * Note: Only runs if `config.autoEmbedOnContentLoaded` is true when the service is created.\n * This handler is typically useful only for applications that are rendered on the server so that all required data is available when the handler is called.\n */\n enableAutoEmbed(): void {\n window.addEventListener('DOMContentLoaded', (event: Event) => this.init(document.body), false);\n }\n\n /**\n * Returns an instance of the component associated with the element.\n * \n * @param {HTMLElement} element\n * @returns {(Report | Tile)}\n */\n get(element: HTMLElement): Report | Tile | Dashboard {\n const powerBiElement = element;\n\n if (!powerBiElement.powerBiEmbed) {\n throw new Error(`You attempted to get an instance of powerbi component associated with element: ${element.outerHTML} but there was no associated instance.`);\n }\n\n return powerBiElement.powerBiEmbed;\n }\n\n /**\n * Finds an embed instance by the name or unique ID that is provided.\n * \n * @param {string} uniqueId\n * @returns {(Report | Tile)}\n */\n find(uniqueId: string): Report | Tile | Dashboard {\n return utils.find(x => x.config.uniqueId === uniqueId, this.embeds);\n }\n\n /**\n * Given an HTML element that has a component embedded within it, removes the component from the list of embedded components, removes the association between the element and the component, and removes the iframe.\n * \n * @param {HTMLElement} element\n * @returns {void}\n */\n reset(element: HTMLElement): void {\n const powerBiElement = element;\n\n if (!powerBiElement.powerBiEmbed) {\n return;\n }\n\n /** Removes the component from an internal list of components. */\n utils.remove(x => x === powerBiElement.powerBiEmbed, this.embeds);\n /** Deletes a property from the HTML element. */\n delete powerBiElement.powerBiEmbed;\n /** Removes the iframe from the element. */\n const iframe = element.querySelector('iframe');\n if (iframe) {\n iframe.remove();\n }\n }\n\n /**\n * Given an event object, finds the embed component with the matching type and ID, and invokes its handleEvent method with the event object.\n * \n * @private\n * @param {IEvent} event\n */\n private handleEvent(event: IEvent): void {\n const embed = utils.find(embed => {\n return (embed.config.uniqueId === event.id);\n }, this.embeds);\n\n if (embed) {\n const value = event.value;\n\n if (event.name === 'pageChanged') {\n const pageKey = 'newPage';\n const page: models.IPage = value[pageKey];\n if (!page) {\n throw new Error(`Page model not found at 'event.value.${pageKey}'.`);\n }\n value[pageKey] = new Page(embed, page.name, page.displayName);\n }\n\n utils.raiseCustomEvent(embed.element, event.name, value);\n }\n }\n}\n\n\n// WEBPACK FOOTER //\n// ./src/service.ts","import * as utils from './util';\r\nimport * as service from './service';\r\nimport * as models from 'powerbi-models';\r\nimport * as hpm from 'http-post-message';\r\n\r\ndeclare global {\r\n interface Document {\r\n // Mozilla Fullscreen\r\n mozCancelFullScreen: Function;\r\n\r\n // Ms Fullscreen\r\n msExitFullscreen: Function;\r\n }\r\n\r\n interface HTMLIFrameElement {\r\n // Mozilla Fullscreen\r\n mozRequestFullScreen: Function;\r\n\r\n // Ms Fullscreen\r\n msRequestFullscreen: Function;\r\n }\r\n}\r\n\r\n// TODO: Re-use ILoadConfiguration interface to prevent duplicating properties.\r\n// Current issue is that they are optional when embedding since they can be specificed as attributes but they are required when loading.\r\n/**\r\n * Configuration settings for Power BI embed components\r\n * \r\n * @export\r\n * @interface IEmbedConfiguration\r\n */\r\nexport interface IEmbedConfiguration {\r\n type?: string;\r\n id?: string;\r\n uniqueId?: string;\r\n embedUrl?: string;\r\n accessToken?: string;\r\n settings?: models.ISettings;\r\n pageName?: string;\r\n filters?: models.IFilter[];\r\n pageView?: models.PageView;\r\n datasetId?: string;\r\n permissions?: models.Permissions;\r\n viewMode?: models.ViewMode;\r\n}\r\n\r\nexport interface IInternalEmbedConfiguration extends models.IReportLoadConfiguration {\r\n uniqueId: string;\r\n type: string;\r\n embedUrl: string;\r\n}\r\n\r\nexport interface IInternalEventHandler {\r\n test(event: service.IEvent): boolean;\r\n handle(event: service.ICustomEvent): void;\r\n}\r\n\r\n/**\r\n * Base class for all Power BI embed components\r\n * \r\n * @export\r\n * @abstract\r\n * @class Embed\r\n */\r\nexport abstract class Embed {\r\n static allowedEvents = [\"loaded\", \"saved\", \"rendered\", \"saveAsTriggered\", \"error\", \"dataSelected\"];\r\n static accessTokenAttribute = 'powerbi-access-token';\r\n static embedUrlAttribute = 'powerbi-embed-url';\r\n static nameAttribute = 'powerbi-name';\r\n static typeAttribute = 'powerbi-type';\r\n static type: string;\r\n\r\n private static defaultSettings: models.ISettings = {\r\n filterPaneEnabled: true\r\n };\r\n\r\n allowedEvents = [];\r\n\r\n /**\r\n * Gets or sets the event handler registered for this embed component.\r\n * \r\n * @type {IInternalEventHandler[]}\r\n */\r\n eventHandlers: IInternalEventHandler[];\r\n\r\n /**\r\n * Gets or sets the Power BI embed service.\r\n * \r\n * @type {service.Service}\r\n */\r\n service: service.Service;\r\n\r\n /**\r\n * Gets or sets the HTML element that contains the Power BI embed component.\r\n * \r\n * @type {HTMLElement}\r\n */\r\n element: HTMLElement;\r\n\r\n /**\r\n * Gets or sets the HTML iframe element that renders the Power BI embed component.\r\n * \r\n * @type {HTMLIFrameElement}\r\n */\r\n iframe: HTMLIFrameElement;\r\n\r\n /**\r\n * Gets or sets the configuration settings for the Power BI embed component.\r\n * \r\n * @type {IInternalEmbedConfiguration}\r\n */\r\n config: IInternalEmbedConfiguration;\r\n\r\n /**\r\n * Gets or sets the configuration settings for creating report.\r\n * \r\n * @type {models.IReportCreateConfiguration}\r\n */\r\n createConfig: models.IReportCreateConfiguration;\r\n\r\n /**\r\n * Url used in the load request.\r\n */\r\n loadPath: string;\r\n\r\n /**\r\n * Type of embed\r\n */\r\n embeType: string;\r\n\r\n /**\r\n * Creates an instance of Embed.\r\n * \r\n * Note: there is circular reference between embeds and the service, because\r\n * the service has a list of all embeds on the host page, and each embed has a reference to the service that created it.\r\n * \r\n * @param {service.Service} service\r\n * @param {HTMLElement} element\r\n * @param {IEmbedConfiguration} config\r\n */\r\n constructor(service: service.Service, element: HTMLElement, config: IEmbedConfiguration, iframe?: HTMLIFrameElement) {\r\n Array.prototype.push.apply(this.allowedEvents, Embed.allowedEvents);\r\n this.eventHandlers = [];\r\n this.service = service;\r\n this.element = element;\r\n this.iframe = iframe;\r\n this.embeType = config.type.toLowerCase();\r\n\r\n this.populateConfig(config);\r\n \r\n if(this.embeType === 'create'){\r\n this.setIframe(false/*set EventListener to call create() on 'load' event*/);\r\n } else {\r\n this.setIframe(true/*set EventListener to call load() on 'load' event*/);\r\n }\r\n }\r\n\r\n /**\r\n * Sends createReport configuration data.\r\n * \r\n * ```javascript\r\n * createReport({\r\n * datasetId: '5dac7a4a-4452-46b3-99f6-a25915e0fe55',\r\n * accessToken: 'eyJ0eXA ... TaE2rTSbmg',\r\n * ```\r\n * \r\n * @param {models.IReportCreateConfiguration} config\r\n * @returns {Promise}\r\n */\r\n createReport(config: models.IReportCreateConfiguration): Promise {\r\n const errors = this.validate(config);\r\n if (errors) {\r\n throw errors;\r\n }\r\n \r\n return this.service.hpm.post(\"/report/create\", config, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n return response.body;\r\n },\r\n response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Saves Report.\r\n * \r\n * @returns {Promise}\r\n */\r\n save(): Promise {\r\n return this.service.hpm.post('/report/save', null, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n return response.body;\r\n })\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * SaveAs Report.\r\n * \r\n * @returns {Promise}\r\n */\r\n saveAs(saveAsParameters: models.ISaveAsParameters): Promise {\r\n return this.service.hpm.post('/report/saveAs', saveAsParameters, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n return response.body;\r\n })\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Sends load configuration data.\r\n * \r\n * ```javascript\r\n * report.load({\r\n * type: 'report',\r\n * id: '5dac7a4a-4452-46b3-99f6-a25915e0fe55',\r\n * accessToken: 'eyJ0eXA ... TaE2rTSbmg',\r\n * settings: {\r\n * navContentPaneEnabled: false\r\n * },\r\n * pageName: \"DefaultPage\",\r\n * filters: [\r\n * {\r\n * ... DefaultReportFilter ...\r\n * }\r\n * ]\r\n * })\r\n * .catch(error => { ... });\r\n * ```\r\n * \r\n * @param {models.ILoadConfiguration} config\r\n * @returns {Promise}\r\n */\r\n load(config: models.IReportLoadConfiguration | models.IDashboardLoadConfiguration): Promise {\r\n const errors = this.validate(config);\r\n if (errors) {\r\n throw errors;\r\n }\r\n\r\n return this.service.hpm.post(this.loadPath, config, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n utils.assign(this.config, config);\r\n return response.body;\r\n },\r\n response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Removes one or more event handlers from the list of handlers.\r\n * If a reference to the existing handle function is specified, remove the specific handler.\r\n * If the handler is not specified, remove all handlers for the event name specified.\r\n * \r\n * ```javascript\r\n * report.off('pageChanged')\r\n * \r\n * or \r\n * \r\n * const logHandler = function (event) {\r\n * console.log(event);\r\n * };\r\n * \r\n * report.off('pageChanged', logHandler);\r\n * ```\r\n * \r\n * @template T\r\n * @param {string} eventName\r\n * @param {service.IEventHandler} [handler]\r\n */\r\n off(eventName: string, handler?: service.IEventHandler): void {\r\n const fakeEvent: service.IEvent = { name: eventName, type: null, id: null, value: null };\r\n if (handler) {\r\n utils.remove(eventHandler => eventHandler.test(fakeEvent) && (eventHandler.handle === handler), this.eventHandlers);\r\n this.element.removeEventListener(eventName, handler);\r\n }\r\n else {\r\n const eventHandlersToRemove = this.eventHandlers\r\n .filter(eventHandler => eventHandler.test(fakeEvent));\r\n\r\n eventHandlersToRemove\r\n .forEach(eventHandlerToRemove => {\r\n utils.remove(eventHandler => eventHandler === eventHandlerToRemove, this.eventHandlers);\r\n this.element.removeEventListener(eventName, eventHandlerToRemove.handle);\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Adds an event handler for a specific event.\r\n * \r\n * ```javascript\r\n * report.on('pageChanged', (event) => {\r\n * console.log('PageChanged: ', event.page.name);\r\n * });\r\n * ```\r\n * \r\n * @template T\r\n * @param {string} eventName\r\n * @param {service.IEventHandler} handler\r\n */\r\n on(eventName: string, handler: service.IEventHandler): void {\r\n if (this.allowedEvents.indexOf(eventName) === -1) {\r\n throw new Error(`eventName is must be one of ${this.allowedEvents}. You passed: ${eventName}`);\r\n }\r\n\r\n this.eventHandlers.push({\r\n test: (event: service.IEvent) => event.name === eventName,\r\n handle: handler\r\n });\r\n\r\n this.element.addEventListener(eventName, handler)\r\n }\r\n\r\n /**\r\n * Reloads embed using existing configuration.\r\n * E.g. For reports this effectively clears all filters and makes the first page active which simulates resetting a report back to loaded state.\r\n * \r\n * ```javascript\r\n * report.reload();\r\n * ```\r\n */\r\n reload(): Promise {\r\n return this.load(this.config);\r\n }\r\n \r\n /**\r\n * Set accessToken.\r\n * \r\n * @returns {Promise}\r\n */\r\n setAccessToken(accessToken: string): Promise {\r\n return this.service.hpm.post('/report/token', accessToken, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n return response.body;\r\n })\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n \r\n /**\r\n * Gets an access token from the first available location: config, attribute, global.\r\n * \r\n * @private\r\n * @param {string} globalAccessToken\r\n * @returns {string}\r\n */\r\n private getAccessToken(globalAccessToken: string): string {\r\n const accessToken = this.config.accessToken || this.element.getAttribute(Embed.accessTokenAttribute) || globalAccessToken;\r\n\r\n if (!accessToken) {\r\n throw new Error(`No access token was found for element. You must specify an access token directly on the element using attribute '${Embed.accessTokenAttribute}' or specify a global token at: powerbi.accessToken.`);\r\n }\r\n\r\n return accessToken;\r\n }\r\n\r\n /**\r\n * Populate config for create and load\r\n * \r\n * @private\r\n * @param {IEmbedConfiguration}\r\n * @returns {void}\r\n */\r\n private populateConfig(config: IEmbedConfiguration): void {\r\n // TODO: Change when Object.assign is available.\r\n const settings = utils.assign({}, Embed.defaultSettings, config.settings);\r\n this.config = utils.assign({ settings }, config);\r\n this.config.uniqueId = this.getUniqueId();\r\n this.config.embedUrl = this.getEmbedUrl();\r\n\r\n if(this.embeType === 'create') {\r\n this.createConfig = {\r\n datasetId: config.datasetId || this.getId(),\r\n accessToken: this.getAccessToken(this.service.accessToken),\r\n settings: settings\r\n }\r\n } else {\r\n this.config.id = this.getId();\r\n this.config.accessToken = this.getAccessToken(this.service.accessToken);\r\n } \r\n }\r\n\r\n\r\n /**\r\n * Gets an embed url from the first available location: options, attribute.\r\n * \r\n * @private\r\n * @returns {string}\r\n */\r\n private getEmbedUrl(): string {\r\n const embedUrl = this.config.embedUrl || this.element.getAttribute(Embed.embedUrlAttribute);\r\n\r\n if (typeof embedUrl !== 'string' || embedUrl.length === 0) {\r\n throw new Error(`Embed Url is required, but it was not found. You must provide an embed url either as part of embed configuration or as attribute '${Embed.embedUrlAttribute}'.`);\r\n }\r\n\r\n return embedUrl;\r\n }\r\n\r\n /**\r\n * Gets a unique ID from the first available location: options, attribute.\r\n * If neither is provided generate a unique string.\r\n * \r\n * @private\r\n * @returns {string}\r\n */\r\n private getUniqueId(): string {\r\n return this.config.uniqueId || this.element.getAttribute(Embed.nameAttribute) || utils.createRandomString();\r\n }\r\n\r\n /**\r\n * Gets the report ID from the first available location: options, attribute.\r\n * \r\n * @abstract\r\n * @returns {string}\r\n */\r\n abstract getId(): string;\r\n\r\n /**\r\n * Requests the browser to render the component's iframe in fullscreen mode.\r\n */\r\n fullscreen(): void {\r\n const requestFullScreen = this.iframe.requestFullscreen || this.iframe.msRequestFullscreen || this.iframe.mozRequestFullScreen || this.iframe.webkitRequestFullscreen;\r\n requestFullScreen.call(this.iframe);\r\n }\r\n\r\n /**\r\n * Requests the browser to exit fullscreen mode.\r\n */\r\n exitFullscreen(): void {\r\n if (!this.isFullscreen(this.iframe)) {\r\n return;\r\n }\r\n\r\n const exitFullscreen = document.exitFullscreen || document.mozCancelFullScreen || document.webkitExitFullscreen || document.msExitFullscreen;\r\n exitFullscreen.call(document);\r\n }\r\n\r\n /**\r\n * Returns true if the iframe is rendered in fullscreen mode,\r\n * otherwise returns false.\r\n * \r\n * @private\r\n * @param {HTMLIFrameElement} iframe\r\n * @returns {boolean}\r\n */\r\n private isFullscreen(iframe: HTMLIFrameElement): boolean {\r\n const options = ['fullscreenElement', 'webkitFullscreenElement', 'mozFullscreenScreenElement', 'msFullscreenElement'];\r\n\r\n return options.some(option => document[option] === iframe);\r\n }\r\n \r\n /**\r\n * Validate load and create configuration.\r\n */\r\n abstract validate(config: models.IReportLoadConfiguration | models.IDashboardLoadConfiguration | models.IReportCreateConfiguration): models.IError[];\r\n\r\n /**\r\n * Sets Iframe for embed\r\n */\r\n private setIframe(isLoad: boolean): void {\r\n if(!this.iframe) {\r\n const iframeHtml = ``;\r\n this.element.innerHTML = iframeHtml;\r\n this.iframe = this.element.childNodes[0];\r\n }\r\n\r\n if(isLoad){\r\n this.iframe.addEventListener('load', () => this.load(this.config), false);\r\n } else {\r\n this.iframe.addEventListener('load', () => this.createReport(this.createConfig), false);\r\n }\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/embed.ts","\r\n/**\r\n * Raises a custom event with event data on the specified HTML element.\r\n * \r\n * @export\r\n * @param {HTMLElement} element\r\n * @param {string} eventName\r\n * @param {*} eventData\r\n */\r\nexport function raiseCustomEvent(element: HTMLElement, eventName: string, eventData: any): void {\r\n let customEvent;\r\n if (typeof CustomEvent === 'function') {\r\n customEvent = new CustomEvent(eventName, {\r\n detail: eventData,\r\n bubbles: true,\r\n cancelable: true\r\n });\r\n } else {\r\n customEvent = document.createEvent('CustomEvent');\r\n customEvent.initCustomEvent(eventName, true, true, eventData);\r\n }\r\n\r\n element.dispatchEvent(customEvent);\r\n}\r\n\r\n/**\r\n * Finds the index of the first value in an array that matches the specified predicate.\r\n * \r\n * @export\r\n * @template T\r\n * @param {(x: T) => boolean} predicate\r\n * @param {T[]} xs\r\n * @returns {number}\r\n */\r\nexport function findIndex(predicate: (x: T) => boolean, xs: T[]): number {\r\n if (!Array.isArray(xs)) {\r\n throw new Error(`You attempted to call find with second parameter that was not an array. You passed: ${xs}`);\r\n }\r\n\r\n let index;\r\n xs.some((x, i) => {\r\n if (predicate(x)) {\r\n index = i;\r\n return true;\r\n }\r\n });\r\n\r\n return index;\r\n}\r\n\r\n/**\r\n * Finds the first value in an array that matches the specified predicate.\r\n * \r\n * @export\r\n * @template T\r\n * @param {(x: T) => boolean} predicate\r\n * @param {T[]} xs\r\n * @returns {T}\r\n */\r\nexport function find(predicate: (x: T) => boolean, xs: T[]): T {\r\n const index = findIndex(predicate, xs);\r\n return xs[index];\r\n}\r\n\r\nexport function remove(predicate: (x: T) => boolean, xs: T[]): void {\r\n const index = findIndex(predicate, xs);\r\n xs.splice(index, 1);\r\n}\r\n\r\n// See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\r\n// TODO: replace in favor of using polyfill\r\n/**\r\n * Copies the values of all enumerable properties from one or more source objects to a target object, and returns the target object.\r\n * \r\n * @export\r\n * @param {any} args\r\n * @returns\r\n */\r\nexport function assign(...args) {\r\n var target = args[0];\r\n\r\n 'use strict';\r\n if (target === undefined || target === null) {\r\n throw new TypeError('Cannot convert undefined or null to object');\r\n }\r\n\r\n var output = Object(target);\r\n for (var index = 1; index < arguments.length; index++) {\r\n var source = arguments[index];\r\n if (source !== undefined && source !== null) {\r\n for (var nextKey in source) {\r\n if (source.hasOwnProperty(nextKey)) {\r\n output[nextKey] = source[nextKey];\r\n }\r\n }\r\n }\r\n }\r\n return output;\r\n}\r\n\r\n/**\r\n * Generates a random 7 character string.\r\n * \r\n * @export\r\n * @returns {string}\r\n */\r\nexport function createRandomString(): string {\r\n return (Math.random() + 1).toString(36).substring(7);\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/util.ts","import * as service from './service';\nimport * as embed from './embed';\nimport * as models from 'powerbi-models';\nimport * as wpmp from 'window-post-message-proxy';\nimport * as hpm from 'http-post-message';\nimport * as utils from './util';\nimport { IFilterable } from './ifilterable';\nimport { IPageNode, Page } from './page';\n\n/**\n * A Report node within a report hierarchy\n * \n * @export\n * @interface IReportNode\n */\nexport interface IReportNode {\n iframe: HTMLIFrameElement;\n service: service.IService;\n config: embed.IInternalEmbedConfiguration\n}\n\n/**\n * The Power BI Report embed component\n * \n * @export\n * @class Report\n * @extends {embed.Embed}\n * @implements {IReportNode}\n * @implements {IFilterable}\n */\nexport class Report extends embed.Embed implements IReportNode, IFilterable {\n static allowedEvents = [\"filtersApplied\", \"pageChanged\"];\n static reportIdAttribute = 'powerbi-report-id';\n static filterPaneEnabledAttribute = 'powerbi-settings-filter-pane-enabled';\n static navContentPaneEnabledAttribute = 'powerbi-settings-nav-content-pane-enabled';\n static typeAttribute = 'powerbi-type';\n static type = \"Report\";\n\n /**\n * Creates an instance of a Power BI Report.\n * \n * @param {service.Service} service\n * @param {HTMLElement} element\n * @param {embed.IEmbedConfiguration} config\n */\n constructor(service: service.Service, element: HTMLElement, config: embed.IEmbedConfiguration, iframe?: HTMLIFrameElement) {\n const filterPaneEnabled = (config.settings && config.settings.filterPaneEnabled) || !(element.getAttribute(Report.filterPaneEnabledAttribute) === \"false\");\n const navContentPaneEnabled = (config.settings && config.settings.navContentPaneEnabled) || !(element.getAttribute(Report.navContentPaneEnabledAttribute) === \"false\");\n const settings = utils.assign({\n filterPaneEnabled,\n navContentPaneEnabled\n }, config.settings);\n const configCopy = utils.assign({ settings }, config);\n\n super(service, element, configCopy, iframe);\n this.loadPath = \"/report/load\";\n Array.prototype.push.apply(this.allowedEvents, Report.allowedEvents);\n }\n\n /**\n * Adds backwards compatibility for the previous load configuration, which used the reportId query parameter to specify the report ID\n * (e.g. http://embedded.powerbi.com/appTokenReportEmbed?reportId=854846ed-2106-4dc2-bc58-eb77533bf2f1).\n * \n * By extracting the ID we can ensure that the ID is always explicitly provided as part of the load configuration.\n * \n * @static\n * @param {string} url\n * @returns {string}\n */\n static findIdFromEmbedUrl(url: string): string {\n const reportIdRegEx = /reportId=\"?([^&]+)\"?/\n const reportIdMatch = url.match(reportIdRegEx);\n\n let reportId;\n if (reportIdMatch) {\n reportId = reportIdMatch[1];\n }\n\n return reportId;\n }\n\n /**\n * Gets filters that are applied at the report level.\n * \n * ```javascript\n * // Get filters applied at report level\n * report.getFilters()\n * .then(filters => {\n * ...\n * });\n * ```\n * \n * @returns {Promise}\n */\n getFilters(): Promise {\n return this.service.hpm.get(`/report/filters`, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .then(response => response.body,\n response => {\n throw response.body;\n });\n }\n\n /**\n * Gets the report ID from the first available location: options, attribute, embed url.\n * \n * @returns {string}\n */\n getId(): string {\n const reportId = this.config.id || this.element.getAttribute(Report.reportIdAttribute) || Report.findIdFromEmbedUrl(this.config.embedUrl);\n\n if (typeof reportId !== 'string' || reportId.length === 0) {\n throw new Error(`Report id is required, but it was not found. You must provide an id either as part of embed configuration or as attribute '${Report.reportIdAttribute}'.`);\n }\n\n return reportId;\n }\n\n /**\n * Gets the list of pages within the report.\n * \n * ```javascript\n * report.getPages()\n * .then(pages => {\n * ...\n * });\n * ```\n * \n * @returns {Promise}\n */\n getPages(): Promise {\n return this.service.hpm.get('/report/pages', { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .then(response => {\n return response.body\n .map(page => {\n return new Page(this, page.name, page.displayName);\n });\n }, response => {\n throw response.body;\n });\n }\n\n /**\n * Creates an instance of a Page.\n * \n * Normally you would get Page objects by calling `report.getPages()`, but in the case\n * that the page name is known and you want to perform an action on a page without having to retrieve it\n * you can create it directly.\n * \n * Note: Because you are creating the page manually there is no guarantee that the page actually exists in the report, and subsequent requests could fail.\n * \n * ```javascript\n * const page = report.page('ReportSection1');\n * page.setActive();\n * ```\n * \n * @param {string} name\n * @param {string} [displayName]\n * @returns {Page}\n */\n page(name: string, displayName?: string): Page {\n return new Page(this, name, displayName);\n }\n\n /**\n * Prints the active page of the report by invoking `window.print()` on the embed iframe component.\n */\n print(): Promise {\n return this.service.hpm.post('/report/print', null, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .then(response => {\n return response.body;\n })\n .catch(response => {\n throw response.body;\n });\n }\n\n /**\n * Removes all filters at the report level.\n * \n * ```javascript\n * report.removeFilters();\n * ```\n * \n * @returns {Promise}\n */\n removeFilters(): Promise {\n return this.setFilters([]);\n }\n\n /**\n * Sets the active page of the report.\n * \n * ```javascript\n * report.setPage(\"page2\")\n * .catch(error => { ... });\n * ```\n * \n * @param {string} pageName\n * @returns {Promise}\n */\n setPage(pageName: string): Promise {\n const page: models.IPage = {\n name: pageName,\n displayName: null\n };\n\n return this.service.hpm.put('/report/pages/active', page, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .catch(response => {\n throw response.body;\n });\n }\n\n /**\n * Sets filters at the report level.\n * \n * ```javascript\n * const filters: [\n * ...\n * ];\n * \n * report.setFilters(filters)\n * .catch(errors => {\n * ...\n * });\n * ```\n * \n * @param {(models.IFilter[])} filters\n * @returns {Promise}\n */\n setFilters(filters: models.IFilter[]): Promise {\n return this.service.hpm.put(`/report/filters`, filters, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .catch(response => {\n throw response.body;\n });\n }\n\n /**\n * Updates visibility settings for the filter pane and the page navigation pane.\n * \n * ```javascript\n * const newSettings = {\n * navContentPaneEnabled: true,\n * filterPaneEnabled: false\n * };\n * \n * report.updateSettings(newSettings)\n * .catch(error => { ... });\n * ```\n * \n * @param {models.ISettings} settings\n * @returns {Promise}\n */\n updateSettings(settings: models.ISettings): Promise {\n return this.service.hpm.patch('/report/settings', settings, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .catch(response => {\n throw response.body;\n });\n }\n\n /**\n * Validate load configuration.\n */\n validate(config: models.IReportLoadConfiguration): models.IError[] {\n return models.validateReportLoad(config);\n }\n\n /**\n * Switch Report view mode.\n * \n * @returns {Promise}\n */\n switchMode(viewMode: models.ViewMode): Promise {\n let url = '/report/switchMode/' + viewMode;\n return this.service.hpm.post(url, null, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .then(response => {\n return response.body;\n })\n .catch(response => {\n throw response.body;\n });\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/report.ts","/*! powerbi-models v0.10.4 | (c) 2016 Microsoft Corporation MIT */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"powerbi-models\"] = factory();\n\telse\n\t\troot[\"powerbi-models\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __extends = (this && this.__extends) || function (d, b) {\r\n\t for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\r\n\t function __() { this.constructor = d; }\r\n\t d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n\t};\r\n\t/* tslint:disable:no-var-requires */\r\n\texports.advancedFilterSchema = __webpack_require__(1);\r\n\texports.filterSchema = __webpack_require__(2);\r\n\texports.loadSchema = __webpack_require__(3);\r\n\texports.dashboardLoadSchema = __webpack_require__(4);\r\n\texports.pageSchema = __webpack_require__(5);\r\n\texports.settingsSchema = __webpack_require__(6);\r\n\texports.basicFilterSchema = __webpack_require__(7);\r\n\texports.createReportSchema = __webpack_require__(8);\r\n\texports.saveAsParametersSchema = __webpack_require__(9);\r\n\t/* tslint:enable:no-var-requires */\r\n\tvar jsen = __webpack_require__(10);\r\n\tfunction normalizeError(error) {\r\n\t var message = error.message;\r\n\t if (!message) {\r\n\t message = error.path + \" is invalid. Not meeting \" + error.keyword + \" constraint\";\r\n\t }\r\n\t return {\r\n\t message: message\r\n\t };\r\n\t}\r\n\t/**\r\n\t * Takes in schema and returns function which can be used to validate the schema with better semantics around exposing errors\r\n\t */\r\n\tfunction validate(schema, options) {\r\n\t return function (x) {\r\n\t var validate = jsen(schema, options);\r\n\t var isValid = validate(x);\r\n\t if (isValid) {\r\n\t return undefined;\r\n\t }\r\n\t else {\r\n\t return validate.errors\r\n\t .map(normalizeError);\r\n\t }\r\n\t };\r\n\t}\r\n\texports.validateSettings = validate(exports.settingsSchema, {\r\n\t schemas: {\r\n\t basicFilter: exports.basicFilterSchema,\r\n\t advancedFilter: exports.advancedFilterSchema\r\n\t }\r\n\t});\r\n\texports.validateReportLoad = validate(exports.loadSchema, {\r\n\t schemas: {\r\n\t settings: exports.settingsSchema,\r\n\t basicFilter: exports.basicFilterSchema,\r\n\t advancedFilter: exports.advancedFilterSchema\r\n\t }\r\n\t});\r\n\texports.validateCreateReport = validate(exports.createReportSchema);\r\n\texports.validateDashboardLoad = validate(exports.dashboardLoadSchema);\r\n\texports.validatePage = validate(exports.pageSchema);\r\n\texports.validateFilter = validate(exports.filterSchema, {\r\n\t schemas: {\r\n\t basicFilter: exports.basicFilterSchema,\r\n\t advancedFilter: exports.advancedFilterSchema\r\n\t }\r\n\t});\r\n\t(function (FilterType) {\r\n\t FilterType[FilterType[\"Advanced\"] = 0] = \"Advanced\";\r\n\t FilterType[FilterType[\"Basic\"] = 1] = \"Basic\";\r\n\t FilterType[FilterType[\"Unknown\"] = 2] = \"Unknown\";\r\n\t})(exports.FilterType || (exports.FilterType = {}));\r\n\tvar FilterType = exports.FilterType;\r\n\tfunction isFilterKeyColumnsTarget(target) {\r\n\t return isColumn(target) && !!target.keys;\r\n\t}\r\n\texports.isFilterKeyColumnsTarget = isFilterKeyColumnsTarget;\r\n\tfunction isBasicFilterWithKeys(filter) {\r\n\t return getFilterType(filter) === FilterType.Basic && !!filter.keyValues;\r\n\t}\r\n\texports.isBasicFilterWithKeys = isBasicFilterWithKeys;\r\n\tfunction getFilterType(filter) {\r\n\t var basicFilter = filter;\r\n\t var advancedFilter = filter;\r\n\t if ((typeof basicFilter.operator === \"string\")\r\n\t && (Array.isArray(basicFilter.values))) {\r\n\t return FilterType.Basic;\r\n\t }\r\n\t else if ((typeof advancedFilter.logicalOperator === \"string\")\r\n\t && (Array.isArray(advancedFilter.conditions))) {\r\n\t return FilterType.Advanced;\r\n\t }\r\n\t else {\r\n\t return FilterType.Unknown;\r\n\t }\r\n\t}\r\n\texports.getFilterType = getFilterType;\r\n\tfunction isMeasure(arg) {\r\n\t return arg.table !== undefined && arg.measure !== undefined;\r\n\t}\r\n\texports.isMeasure = isMeasure;\r\n\tfunction isColumn(arg) {\r\n\t return arg.table !== undefined && arg.column !== undefined;\r\n\t}\r\n\texports.isColumn = isColumn;\r\n\tfunction isHierarchy(arg) {\r\n\t return arg.table !== undefined && arg.hierarchy !== undefined && arg.hierarchyLevel !== undefined;\r\n\t}\r\n\texports.isHierarchy = isHierarchy;\r\n\tvar Filter = (function () {\r\n\t function Filter(target) {\r\n\t this.target = target;\r\n\t }\r\n\t Filter.prototype.toJSON = function () {\r\n\t return {\r\n\t $schema: this.schemaUrl,\r\n\t target: this.target\r\n\t };\r\n\t };\r\n\t ;\r\n\t return Filter;\r\n\t}());\r\n\texports.Filter = Filter;\r\n\tvar BasicFilter = (function (_super) {\r\n\t __extends(BasicFilter, _super);\r\n\t function BasicFilter(target, operator) {\r\n\t var values = [];\r\n\t for (var _i = 2; _i < arguments.length; _i++) {\r\n\t values[_i - 2] = arguments[_i];\r\n\t }\r\n\t _super.call(this, target);\r\n\t this.operator = operator;\r\n\t this.schemaUrl = BasicFilter.schemaUrl;\r\n\t if (values.length === 0 && operator !== \"All\") {\r\n\t throw new Error(\"values must be a non-empty array unless your operator is \\\"All\\\".\");\r\n\t }\r\n\t /**\r\n\t * Accept values as array instead of as individual arguments\r\n\t * new BasicFilter('a', 'b', 1, 2);\r\n\t * new BasicFilter('a', 'b', [1,2]);\r\n\t */\r\n\t if (Array.isArray(values[0])) {\r\n\t this.values = values[0];\r\n\t }\r\n\t else {\r\n\t this.values = values;\r\n\t }\r\n\t }\r\n\t BasicFilter.prototype.toJSON = function () {\r\n\t var filter = _super.prototype.toJSON.call(this);\r\n\t filter.operator = this.operator;\r\n\t filter.values = this.values;\r\n\t return filter;\r\n\t };\r\n\t BasicFilter.schemaUrl = \"http://powerbi.com/product/schema#basic\";\r\n\t return BasicFilter;\r\n\t}(Filter));\r\n\texports.BasicFilter = BasicFilter;\r\n\tvar BasicFilterWithKeys = (function (_super) {\r\n\t __extends(BasicFilterWithKeys, _super);\r\n\t function BasicFilterWithKeys(target, operator, values, keyValues) {\r\n\t _super.call(this, target, operator, values);\r\n\t this.keyValues = keyValues;\r\n\t this.target = target;\r\n\t var numberOfKeys = target.keys ? target.keys.length : 0;\r\n\t if (numberOfKeys > 0 && !keyValues) {\r\n\t throw new Error(\"You shold pass the values to be filtered for each key. You passed: no values and \" + numberOfKeys + \" keys\");\r\n\t }\r\n\t if (numberOfKeys === 0 && keyValues && keyValues.length > 0) {\r\n\t throw new Error(\"You passed key values but your target object doesn't contain the keys to be filtered\");\r\n\t }\r\n\t for (var i = 0; i < this.keyValues.length; i++) {\r\n\t if (this.keyValues[i]) {\r\n\t var lengthOfArray = this.keyValues[i].length;\r\n\t if (lengthOfArray !== numberOfKeys) {\r\n\t throw new Error(\"Each tuple of key values should contain a value for each of the keys. You passed: \" + lengthOfArray + \" values and \" + numberOfKeys + \" keys\");\r\n\t }\r\n\t }\r\n\t }\r\n\t }\r\n\t BasicFilterWithKeys.prototype.toJSON = function () {\r\n\t var filter = _super.prototype.toJSON.call(this);\r\n\t filter.keyValues = this.keyValues;\r\n\t return filter;\r\n\t };\r\n\t return BasicFilterWithKeys;\r\n\t}(BasicFilter));\r\n\texports.BasicFilterWithKeys = BasicFilterWithKeys;\r\n\tvar AdvancedFilter = (function (_super) {\r\n\t __extends(AdvancedFilter, _super);\r\n\t function AdvancedFilter(target, logicalOperator) {\r\n\t var conditions = [];\r\n\t for (var _i = 2; _i < arguments.length; _i++) {\r\n\t conditions[_i - 2] = arguments[_i];\r\n\t }\r\n\t _super.call(this, target);\r\n\t this.schemaUrl = AdvancedFilter.schemaUrl;\r\n\t // Guard statements\r\n\t if (typeof logicalOperator !== \"string\" || logicalOperator.length === 0) {\r\n\t // TODO: It would be nicer to list out the possible logical operators.\r\n\t throw new Error(\"logicalOperator must be a valid operator, You passed: \" + logicalOperator);\r\n\t }\r\n\t this.logicalOperator = logicalOperator;\r\n\t var extractedConditions;\r\n\t /**\r\n\t * Accept conditions as array instead of as individual arguments\r\n\t * new AdvancedFilter('a', 'b', \"And\", { value: 1, operator: \"Equals\" }, { value: 2, operator: \"IsGreaterThan\" });\r\n\t * new AdvancedFilter('a', 'b', \"And\", [{ value: 1, operator: \"Equals\" }, { value: 2, operator: \"IsGreaterThan\" }]);\r\n\t */\r\n\t if (Array.isArray(conditions[0])) {\r\n\t extractedConditions = conditions[0];\r\n\t }\r\n\t else {\r\n\t extractedConditions = conditions;\r\n\t }\r\n\t if (extractedConditions.length === 0) {\r\n\t throw new Error(\"conditions must be a non-empty array. You passed: \" + conditions);\r\n\t }\r\n\t if (extractedConditions.length > 2) {\r\n\t throw new Error(\"AdvancedFilters may not have more than two conditions. You passed: \" + conditions.length);\r\n\t }\r\n\t if (extractedConditions.length === 1 && logicalOperator !== \"And\") {\r\n\t throw new Error(\"Logical Operator must be \\\"And\\\" when there is only one condition provided\");\r\n\t }\r\n\t this.conditions = extractedConditions;\r\n\t }\r\n\t AdvancedFilter.prototype.toJSON = function () {\r\n\t var filter = _super.prototype.toJSON.call(this);\r\n\t filter.logicalOperator = this.logicalOperator;\r\n\t filter.conditions = this.conditions;\r\n\t return filter;\r\n\t };\r\n\t AdvancedFilter.schemaUrl = \"http://powerbi.com/product/schema#advanced\";\r\n\t return AdvancedFilter;\r\n\t}(Filter));\r\n\texports.AdvancedFilter = AdvancedFilter;\r\n\t(function (Permissions) {\r\n\t Permissions[Permissions[\"Read\"] = 0] = \"Read\";\r\n\t Permissions[Permissions[\"ReadWrite\"] = 1] = \"ReadWrite\";\r\n\t Permissions[Permissions[\"Copy\"] = 2] = \"Copy\";\r\n\t Permissions[Permissions[\"Create\"] = 4] = \"Create\";\r\n\t Permissions[Permissions[\"All\"] = 7] = \"All\";\r\n\t})(exports.Permissions || (exports.Permissions = {}));\r\n\tvar Permissions = exports.Permissions;\r\n\t(function (ViewMode) {\r\n\t ViewMode[ViewMode[\"View\"] = 0] = \"View\";\r\n\t ViewMode[ViewMode[\"Edit\"] = 1] = \"Edit\";\r\n\t})(exports.ViewMode || (exports.ViewMode = {}));\r\n\tvar ViewMode = exports.ViewMode;\r\n\texports.validateSaveAsParameters = validate(exports.saveAsParametersSchema);\r\n\n\n/***/ },\n/* 1 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"target\": {\n\t\t\t\t\"oneOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\t\"table\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"column\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"required\": [\n\t\t\t\t\t\t\t\"table\",\n\t\t\t\t\t\t\t\"column\"\n\t\t\t\t\t\t]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\t\"table\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"hierarchy\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"hierarchyLevel\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"required\": [\n\t\t\t\t\t\t\t\"table\",\n\t\t\t\t\t\t\t\"hierarchy\",\n\t\t\t\t\t\t\t\"hierarchyLevel\"\n\t\t\t\t\t\t]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\t\"table\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"measure\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"required\": [\n\t\t\t\t\t\t\t\"table\",\n\t\t\t\t\t\t\t\"measure\"\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"logicalOperator\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"conditions\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\"value\": {\n\t\t\t\t\t\t\t\"type\": [\n\t\t\t\t\t\t\t\t\"string\",\n\t\t\t\t\t\t\t\t\"boolean\",\n\t\t\t\t\t\t\t\t\"number\"\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"operator\": {\n\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\"required\": [\n\t\t\t\t\t\t\"value\",\n\t\t\t\t\t\t\"operator\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"target\",\n\t\t\t\"logicalOperator\",\n\t\t\t\"conditions\"\n\t\t]\n\t};\n\n/***/ },\n/* 2 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"oneOf\": [\n\t\t\t{\n\t\t\t\t\"$ref\": \"#basicFilter\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"$ref\": \"#advancedFilter\"\n\t\t\t}\n\t\t],\n\t\t\"invalidMessage\": \"filter is invalid\"\n\t};\n\n/***/ },\n/* 3 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"accessToken\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"accessToken must be a string\",\n\t\t\t\t\t\"required\": \"accessToken is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"id\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"id must be a string\",\n\t\t\t\t\t\"required\": \"id is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"settings\": {\n\t\t\t\t\"$ref\": \"#settings\"\n\t\t\t},\n\t\t\t\"pageName\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"pageName must be a string\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"filters\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\"oneOf\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"$ref\": \"#basicFilter\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"$ref\": \"#advancedFilter\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t\"invalidMessage\": \"filters property is invalid\"\n\t\t\t},\n\t\t\t\"permissions\": {\n\t\t\t\t\"type\": \"number\",\n\t\t\t\t\"enum\": [\n\t\t\t\t\t0,\n\t\t\t\t\t1,\n\t\t\t\t\t2,\n\t\t\t\t\t3\n\t\t\t\t],\n\t\t\t\t\"default\": 0,\n\t\t\t\t\"invalidMessage\": \"permissions property is invalid\"\n\t\t\t},\n\t\t\t\"viewMode\": {\n\t\t\t\t\"type\": \"number\",\n\t\t\t\t\"enum\": [\n\t\t\t\t\t0,\n\t\t\t\t\t1\n\t\t\t\t],\n\t\t\t\t\"default\": 0,\n\t\t\t\t\"invalidMessage\": \"viewMode property is invalid\"\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"accessToken\",\n\t\t\t\"id\"\n\t\t]\n\t};\n\n/***/ },\n/* 4 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"accessToken\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"accessToken must be a string\",\n\t\t\t\t\t\"required\": \"accessToken is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"id\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"id must be a string\",\n\t\t\t\t\t\"required\": \"id is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"pageView\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"pageView must be a string with one of the following values: \\\"actualSize\\\", \\\"fitToWidth\\\", \\\"oneColumn\\\"\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"accessToken\",\n\t\t\t\"id\"\n\t\t]\n\t};\n\n/***/ },\n/* 5 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"name\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"name must be a string\",\n\t\t\t\t\t\"required\": \"name is required\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"name\"\n\t\t]\n\t};\n\n/***/ },\n/* 6 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"filterPaneEnabled\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"filterPaneEnabled must be a boolean\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"navContentPaneEnabled\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"navContentPaneEnabled must be a boolean\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"useCustomSaveAsDialog\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"useCustomSaveAsDialog must be a boolean\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n/***/ },\n/* 7 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"target\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"properties\": {\n\t\t\t\t\t\"table\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"column\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"hierarchy\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"hierarchyLevel\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"measure\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"required\": [\n\t\t\t\t\t\"table\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"operator\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"values\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"type\": [\n\t\t\t\t\t\t\"string\",\n\t\t\t\t\t\t\"boolean\",\n\t\t\t\t\t\t\"number\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"target\",\n\t\t\t\"operator\",\n\t\t\t\"values\"\n\t\t]\n\t};\n\n/***/ },\n/* 8 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"accessToken\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"accessToken must be a string\",\n\t\t\t\t\t\"required\": \"accessToken is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"datasetId\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"datasetId must be a string\",\n\t\t\t\t\t\"required\": \"datasetId is required\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"accessToken\",\n\t\t\t\"datasetId\"\n\t\t]\n\t};\n\n/***/ },\n/* 9 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"name\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"name must be a string\",\n\t\t\t\t\t\"required\": \"name is required\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"name\"\n\t\t]\n\t};\n\n/***/ },\n/* 10 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = __webpack_require__(11);\n\n/***/ },\n/* 11 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar REGEX_ESCAPE_EXPR = /[\\/]/g,\n\t STR_ESCAPE_EXPR = /(\")/gim,\n\t VALID_IDENTIFIER_EXPR = /^[a-z_$][0-9a-z]*$/gi,\n\t INVALID_SCHEMA = 'jsen: invalid schema object',\n\t browser = typeof window === 'object' && !!window.navigator, // jshint ignore: line\n\t regescape = new RegExp('/').source !== '/', // node v0.x does not properly escape '/'s in inline regex\n\t func = __webpack_require__(12),\n\t equal = __webpack_require__(13),\n\t unique = __webpack_require__(14),\n\t SchemaResolver = __webpack_require__(15),\n\t formats = __webpack_require__(24),\n\t ucs2length = __webpack_require__(25),\n\t types = {},\n\t keywords = {};\n\t\n\tfunction inlineRegex(regex) {\n\t regex = regex instanceof RegExp ? regex : new RegExp(regex);\n\t\n\t return regescape ?\n\t regex.toString() :\n\t '/' + regex.source.replace(REGEX_ESCAPE_EXPR, '\\\\$&') + '/';\n\t}\n\t\n\tfunction encodeStr(str) {\n\t return '\"' + str.replace(STR_ESCAPE_EXPR, '\\\\$1') + '\"';\n\t}\n\t\n\tfunction appendToPath(path, key) {\n\t VALID_IDENTIFIER_EXPR.lastIndex = 0;\n\t\n\t return VALID_IDENTIFIER_EXPR.test(key) ?\n\t path + '.' + key :\n\t path + '[' + encodeStr(key) + ']';\n\t}\n\t\n\tfunction type(obj) {\n\t if (obj === undefined) {\n\t return 'undefined';\n\t }\n\t\n\t var str = Object.prototype.toString.call(obj);\n\t return str.substr(8, str.length - 9).toLowerCase();\n\t}\n\t\n\tfunction isInteger(obj) {\n\t return (obj | 0) === obj; // jshint ignore: line\n\t}\n\t\n\ttypes['null'] = function (path) {\n\t return path + ' === null';\n\t};\n\t\n\ttypes.boolean = function (path) {\n\t return 'typeof ' + path + ' === \"boolean\"';\n\t};\n\t\n\ttypes.string = function (path) {\n\t return 'typeof ' + path + ' === \"string\"';\n\t};\n\t\n\ttypes.number = function (path) {\n\t return 'typeof ' + path + ' === \"number\"';\n\t};\n\t\n\ttypes.integer = function (path) {\n\t return 'typeof ' + path + ' === \"number\" && !(' + path + ' % 1)';\n\t};\n\t\n\ttypes.array = function (path) {\n\t return 'Array.isArray(' + path + ')';\n\t};\n\t\n\ttypes.object = function (path) {\n\t return 'typeof ' + path + ' === \"object\" && ' + path + ' !== null && !Array.isArray(' + path + ')';\n\t};\n\t\n\ttypes.date = function (path) {\n\t return path + ' instanceof Date';\n\t};\n\t\n\tkeywords.enum = function (context) {\n\t var arr = context.schema['enum'];\n\t\n\t context.code('if (!equalAny(' + context.path + ', ' + JSON.stringify(arr) + ')) {');\n\t context.error('enum');\n\t context.code('}');\n\t};\n\t\n\tkeywords.minimum = function (context) {\n\t if (typeof context.schema.minimum === 'number') {\n\t context.code('if (' + context.path + ' < ' + context.schema.minimum + ') {');\n\t context.error('minimum');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.exclusiveMinimum = function (context) {\n\t if (context.schema.exclusiveMinimum === true && typeof context.schema.minimum === 'number') {\n\t context.code('if (' + context.path + ' === ' + context.schema.minimum + ') {');\n\t context.error('exclusiveMinimum');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.maximum = function (context) {\n\t if (typeof context.schema.maximum === 'number') {\n\t context.code('if (' + context.path + ' > ' + context.schema.maximum + ') {');\n\t context.error('maximum');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.exclusiveMaximum = function (context) {\n\t if (context.schema.exclusiveMaximum === true && typeof context.schema.maximum === 'number') {\n\t context.code('if (' + context.path + ' === ' + context.schema.maximum + ') {');\n\t context.error('exclusiveMaximum');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.multipleOf = function (context) {\n\t if (typeof context.schema.multipleOf === 'number') {\n\t var mul = context.schema.multipleOf,\n\t decimals = mul.toString().length - mul.toFixed(0).length - 1,\n\t pow = decimals > 0 ? Math.pow(10, decimals) : 1,\n\t path = context.path;\n\t\n\t if (decimals > 0) {\n\t context.code('if (+(Math.round((' + path + ' * ' + pow + ') + \"e+\" + ' + decimals + ') + \"e-\" + ' + decimals + ') % ' + (mul * pow) + ' !== 0) {');\n\t } else {\n\t context.code('if (((' + path + ' * ' + pow + ') % ' + (mul * pow) + ') !== 0) {');\n\t }\n\t\n\t context.error('multipleOf');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.minLength = function (context) {\n\t if (isInteger(context.schema.minLength)) {\n\t context.code('if (ucs2length(' + context.path + ') < ' + context.schema.minLength + ') {');\n\t context.error('minLength');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.maxLength = function (context) {\n\t if (isInteger(context.schema.maxLength)) {\n\t context.code('if (ucs2length(' + context.path + ') > ' + context.schema.maxLength + ') {');\n\t context.error('maxLength');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.pattern = function (context) {\n\t var pattern = context.schema.pattern;\n\t\n\t if (typeof pattern === 'string' || pattern instanceof RegExp) {\n\t context.code('if (!(' + inlineRegex(pattern) + ').test(' + context.path + ')) {');\n\t context.error('pattern');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.format = function (context) {\n\t if (typeof context.schema.format !== 'string' || !formats[context.schema.format]) {\n\t return;\n\t }\n\t\n\t context.code('if (!(' + formats[context.schema.format] + ').test(' + context.path + ')) {');\n\t context.error('format');\n\t context.code('}');\n\t};\n\t\n\tkeywords.minItems = function (context) {\n\t if (isInteger(context.schema.minItems)) {\n\t context.code('if (' + context.path + '.length < ' + context.schema.minItems + ') {');\n\t context.error('minItems');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.maxItems = function (context) {\n\t if (isInteger(context.schema.maxItems)) {\n\t context.code('if (' + context.path + '.length > ' + context.schema.maxItems + ') {');\n\t context.error('maxItems');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.additionalItems = function (context) {\n\t if (context.schema.additionalItems === false && Array.isArray(context.schema.items)) {\n\t context.code('if (' + context.path + '.length > ' + context.schema.items.length + ') {');\n\t context.error('additionalItems');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.uniqueItems = function (context) {\n\t if (context.schema.uniqueItems) {\n\t context.code('if (unique(' + context.path + ').length !== ' + context.path + '.length) {');\n\t context.error('uniqueItems');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.items = function (context) {\n\t var index = context.declare(0),\n\t i = 0;\n\t\n\t if (type(context.schema.items) === 'object') {\n\t context.code('for (' + index + ' = 0; ' + index + ' < ' + context.path + '.length; ' + index + '++) {');\n\t\n\t context.descend(context.path + '[' + index + ']', context.schema.items);\n\t\n\t context.code('}');\n\t }\n\t else if (Array.isArray(context.schema.items)) {\n\t for (; i < context.schema.items.length; i++) {\n\t context.code('if (' + context.path + '.length - 1 >= ' + i + ') {');\n\t\n\t context.descend(context.path + '[' + i + ']', context.schema.items[i]);\n\t\n\t context.code('}');\n\t }\n\t\n\t if (type(context.schema.additionalItems) === 'object') {\n\t context.code('for (' + index + ' = ' + i + '; ' + index + ' < ' + context.path + '.length; ' + index + '++) {');\n\t\n\t context.descend(context.path + '[' + index + ']', context.schema.additionalItems);\n\t\n\t context.code('}');\n\t }\n\t }\n\t};\n\t\n\tkeywords.maxProperties = function (context) {\n\t if (isInteger(context.schema.maxProperties)) {\n\t context.code('if (Object.keys(' + context.path + ').length > ' + context.schema.maxProperties + ') {');\n\t context.error('maxProperties');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.minProperties = function (context) {\n\t if (isInteger(context.schema.minProperties)) {\n\t context.code('if (Object.keys(' + context.path + ').length < ' + context.schema.minProperties + ') {');\n\t context.error('minProperties');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.required = function (context) {\n\t if (!Array.isArray(context.schema.required)) {\n\t return;\n\t }\n\t\n\t for (var i = 0; i < context.schema.required.length; i++) {\n\t context.code('if (' + appendToPath(context.path, context.schema.required[i]) + ' === undefined) {');\n\t context.error('required', context.schema.required[i]);\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.properties = function (context) {\n\t var props = context.schema.properties,\n\t propKeys = type(props) === 'object' ? Object.keys(props) : [],\n\t required = Array.isArray(context.schema.required) ? context.schema.required : [],\n\t prop, i, nestedPath;\n\t\n\t if (!propKeys.length) {\n\t return;\n\t }\n\t\n\t for (i = 0; i < propKeys.length; i++) {\n\t prop = propKeys[i];\n\t nestedPath = appendToPath(context.path, prop);\n\t\n\t context.code('if (' + nestedPath + ' !== undefined) {');\n\t\n\t context.descend(nestedPath, props[prop]);\n\t\n\t context.code('}');\n\t\n\t if (required.indexOf(prop) > -1) {\n\t context.code('else {');\n\t context.error('required', prop);\n\t context.code('}');\n\t }\n\t }\n\t};\n\t\n\tkeywords.patternProperties = keywords.additionalProperties = function (context) {\n\t var propKeys = type(context.schema.properties) === 'object' ?\n\t Object.keys(context.schema.properties) : [],\n\t patProps = context.schema.patternProperties,\n\t patterns = type(patProps) === 'object' ? Object.keys(patProps) : [],\n\t addProps = context.schema.additionalProperties,\n\t addPropsCheck = addProps === false || type(addProps) === 'object',\n\t props, keys, key, n, found, pattern, i;\n\t\n\t if (!patterns.length && !addPropsCheck) {\n\t return;\n\t }\n\t\n\t keys = context.declare('[]');\n\t key = context.declare('\"\"');\n\t n = context.declare(0);\n\t\n\t if (addPropsCheck) {\n\t found = context.declare(false);\n\t }\n\t\n\t context.code(keys + ' = Object.keys(' + context.path + ')');\n\t\n\t context.code('for (' + n + ' = 0; ' + n + ' < ' + keys + '.length; ' + n + '++) {')\n\t (key + ' = ' + keys + '[' + n + ']')\n\t\n\t ('if (' + context.path + '[' + key + '] === undefined) {')\n\t ('continue')\n\t ('}');\n\t\n\t if (addPropsCheck) {\n\t context.code(found + ' = false');\n\t }\n\t\n\t // validate pattern properties\n\t for (i = 0; i < patterns.length; i++) {\n\t pattern = patterns[i];\n\t\n\t context.code('if ((' + inlineRegex(pattern) + ').test(' + key + ')) {');\n\t\n\t context.descend(context.path + '[' + key + ']', patProps[pattern]);\n\t\n\t if (addPropsCheck) {\n\t context.code(found + ' = true');\n\t }\n\t\n\t context.code('}');\n\t }\n\t\n\t // validate additional properties\n\t if (addPropsCheck) {\n\t if (propKeys.length) {\n\t props = context.declare(JSON.stringify(propKeys));\n\t\n\t // do not validate regular properties\n\t context.code('if (' + props + '.indexOf(' + key + ') > -1) {')\n\t ('continue')\n\t ('}');\n\t }\n\t\n\t context.code('if (!' + found + ') {');\n\t\n\t if (addProps === false) {\n\t // do not allow additional properties\n\t context.error('additionalProperties', undefined, key);\n\t }\n\t else {\n\t // validate additional properties\n\t context.descend(context.path + '[' + key + ']', addProps);\n\t }\n\t\n\t context.code('}');\n\t }\n\t\n\t context.code('}');\n\t};\n\t\n\tkeywords.dependencies = function (context) {\n\t if (type(context.schema.dependencies) !== 'object') {\n\t return;\n\t }\n\t\n\t var depKeys = Object.keys(context.schema.dependencies),\n\t len = depKeys.length,\n\t key, dep, i = 0, k = 0;\n\t\n\t for (; k < len; k++) {\n\t key = depKeys[k];\n\t dep = context.schema.dependencies[key];\n\t\n\t context.code('if (' + appendToPath(context.path, key) + ' !== undefined) {');\n\t\n\t if (type(dep) === 'object') {\n\t //schema dependency\n\t context.descend(context.path, dep);\n\t }\n\t else {\n\t // property dependency\n\t for (i; i < dep.length; i++) {\n\t context.code('if (' + appendToPath(context.path, dep[i]) + ' === undefined) {');\n\t context.error('dependencies', dep[i]);\n\t context.code('}');\n\t }\n\t }\n\t\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.allOf = function (context) {\n\t if (!Array.isArray(context.schema.allOf)) {\n\t return;\n\t }\n\t\n\t for (var i = 0; i < context.schema.allOf.length; i++) {\n\t context.descend(context.path, context.schema.allOf[i]);\n\t }\n\t};\n\t\n\tkeywords.anyOf = function (context) {\n\t if (!Array.isArray(context.schema.anyOf)) {\n\t return;\n\t }\n\t\n\t var greedy = context.greedy,\n\t errCount = context.declare(0),\n\t initialCount = context.declare(0),\n\t found = context.declare(false),\n\t i = 0;\n\t\n\t context.code(initialCount + ' = errors.length');\n\t\n\t for (; i < context.schema.anyOf.length; i++) {\n\t context.code('if (!' + found + ') {');\n\t\n\t context.code(errCount + ' = errors.length');\n\t\n\t context.greedy = true;\n\t\n\t context.descend(context.path, context.schema.anyOf[i]);\n\t\n\t context.code(found + ' = errors.length === ' + errCount)\n\t ('}');\n\t }\n\t\n\t context.greedy = greedy;\n\t\n\t context.code('if (!' + found + ') {');\n\t\n\t context.error('anyOf');\n\t\n\t context.code('} else {')\n\t ('errors.length = ' + initialCount)\n\t ('}');\n\t};\n\t\n\tkeywords.oneOf = function (context) {\n\t if (!Array.isArray(context.schema.oneOf)) {\n\t return;\n\t }\n\t\n\t var greedy = context.greedy,\n\t matching = context.declare(0),\n\t initialCount = context.declare(0),\n\t errCount = context.declare(0),\n\t i = 0;\n\t\n\t context.code(initialCount + ' = errors.length');\n\t context.code(matching + ' = 0');\n\t\n\t for (; i < context.schema.oneOf.length; i++) {\n\t context.code(errCount + ' = errors.length');\n\t\n\t context.greedy = true;\n\t\n\t context.descend(context.path, context.schema.oneOf[i]);\n\t\n\t context.code('if (errors.length === ' + errCount + ') {')\n\t (matching + '++')\n\t ('}');\n\t }\n\t\n\t context.greedy = greedy;\n\t\n\t context.code('if (' + matching + ' !== 1) {');\n\t\n\t context.error('oneOf');\n\t\n\t context.code('} else {')\n\t ('errors.length = ' + initialCount)\n\t ('}');\n\t};\n\t\n\tkeywords.not = function (context) {\n\t if (type(context.schema.not) !== 'object') {\n\t return;\n\t }\n\t\n\t var greedy = context.greedy,\n\t errCount = context.declare(0);\n\t\n\t context.code(errCount + ' = errors.length');\n\t\n\t context.greedy = true;\n\t\n\t context.descend(context.path, context.schema.not);\n\t\n\t context.greedy = greedy;\n\t\n\t context.code('if (errors.length === ' + errCount + ') {');\n\t\n\t context.error('not');\n\t\n\t context.code('} else {')\n\t ('errors.length = ' + errCount)\n\t ('}');\n\t};\n\t\n\tfunction decorateGenerator(type, keyword) {\n\t keywords[keyword].type = type;\n\t keywords[keyword].keyword = keyword;\n\t}\n\t\n\t['minimum', 'exclusiveMinimum', 'maximum', 'exclusiveMaximum', 'multipleOf']\n\t .forEach(decorateGenerator.bind(null, 'number'));\n\t\n\t['minLength', 'maxLength', 'pattern', 'format']\n\t .forEach(decorateGenerator.bind(null, 'string'));\n\t\n\t['minItems', 'maxItems', 'additionalItems', 'uniqueItems', 'items']\n\t .forEach(decorateGenerator.bind(null, 'array'));\n\t\n\t['maxProperties', 'minProperties', 'required', 'properties', 'patternProperties', 'additionalProperties', 'dependencies']\n\t .forEach(decorateGenerator.bind(null, 'object'));\n\t\n\t['enum', 'allOf', 'anyOf', 'oneOf', 'not']\n\t .forEach(decorateGenerator.bind(null, null));\n\t\n\tfunction groupKeywords(schema) {\n\t var keys = Object.keys(schema),\n\t propIndex = keys.indexOf('properties'),\n\t patIndex = keys.indexOf('patternProperties'),\n\t ret = {\n\t enum: Array.isArray(schema.enum) && schema.enum.length > 0,\n\t type: null,\n\t allType: [],\n\t perType: {}\n\t },\n\t key, gen, i;\n\t\n\t if (schema.type) {\n\t if (typeof schema.type === 'string') {\n\t ret.type = [schema.type];\n\t }\n\t else if (Array.isArray(schema.type) && schema.type.length) {\n\t ret.type = schema.type.slice(0);\n\t }\n\t }\n\t\n\t for (i = 0; i < keys.length; i++) {\n\t key = keys[i];\n\t\n\t if (key === 'enum' || key === 'type') {\n\t continue;\n\t }\n\t\n\t gen = keywords[key];\n\t\n\t if (!gen) {\n\t continue;\n\t }\n\t\n\t if (gen.type) {\n\t if (!ret.perType[gen.type]) {\n\t ret.perType[gen.type] = [];\n\t }\n\t\n\t if (!(propIndex > -1 && key === 'required') &&\n\t !(patIndex > -1 && key === 'additionalProperties')) {\n\t ret.perType[gen.type].push(key);\n\t }\n\t }\n\t else {\n\t ret.allType.push(key);\n\t }\n\t }\n\t\n\t return ret;\n\t}\n\t\n\tfunction getPathExpression(path, key) {\n\t var path_ = path.substr(4),\n\t len = path_.length,\n\t tokens = [],\n\t token = '',\n\t isvar = false,\n\t char, i;\n\t\n\t for (i = 0; i < len; i++) {\n\t char = path_[i];\n\t\n\t switch (char) {\n\t case '.':\n\t if (token) {\n\t token += char;\n\t }\n\t break;\n\t case '[':\n\t if (isNaN(+path_[i + 1])) {\n\t isvar = true;\n\t\n\t if (token) {\n\t tokens.push('\"' + token + '\"');\n\t token = '';\n\t }\n\t }\n\t else {\n\t isvar = false;\n\t\n\t if (token) {\n\t token += '.';\n\t }\n\t }\n\t break;\n\t case ']':\n\t tokens.push(isvar ? token : '\"' + token + '\"');\n\t token = '';\n\t break;\n\t default:\n\t token += char;\n\t }\n\t }\n\t\n\t if (token) {\n\t tokens.push('\"' + token + '\"');\n\t }\n\t\n\t if (key) {\n\t tokens.push('\"' + key + '\"');\n\t }\n\t\n\t if (tokens.length === 1 && isvar) {\n\t return '\"\" + ' + tokens[0] + ' + \"\"';\n\t }\n\t\n\t return tokens.join(' + \".\" + ') || '\"\"';\n\t}\n\t\n\tfunction clone(obj) {\n\t var cloned = obj,\n\t objType = type(obj),\n\t keys, len, key, i;\n\t\n\t if (objType === 'object') {\n\t cloned = {};\n\t keys = Object.keys(obj);\n\t\n\t for (i = 0, len = keys.length; i < len; i++) {\n\t key = keys[i];\n\t cloned[key] = clone(obj[key]);\n\t }\n\t }\n\t else if (objType === 'array') {\n\t cloned = [];\n\t\n\t for (i = 0, len = obj.length; i < len; i++) {\n\t cloned[i] = clone(obj[i]);\n\t }\n\t }\n\t else if (objType === 'regexp') {\n\t return new RegExp(obj);\n\t }\n\t else if (objType === 'date') {\n\t return new Date(obj.toJSON());\n\t }\n\t\n\t return cloned;\n\t}\n\t\n\tfunction equalAny(obj, options) {\n\t for (var i = 0, len = options.length; i < len; i++) {\n\t if (equal(obj, options[i])) {\n\t return true;\n\t }\n\t }\n\t\n\t return false;\n\t}\n\t\n\tfunction PropertyMarker() {\n\t this.objects = [];\n\t this.properties = [];\n\t}\n\t\n\tPropertyMarker.prototype.mark = function (obj, key) {\n\t var index = this.objects.indexOf(obj),\n\t prop;\n\t\n\t if (index < 0) {\n\t this.objects.push(obj);\n\t\n\t prop = {};\n\t prop[key] = 1;\n\t\n\t this.properties.push(prop);\n\t\n\t return;\n\t }\n\t\n\t prop = this.properties[index];\n\t\n\t prop[key] = prop[key] ? prop[key] + 1 : 1;\n\t};\n\t\n\tPropertyMarker.prototype.deleteDuplicates = function () {\n\t var props, keys, key, i, j;\n\t\n\t for (i = 0; i < this.properties.length; i++) {\n\t props = this.properties[i];\n\t keys = Object.keys(props);\n\t\n\t for (j = 0; j < keys.length; j++) {\n\t key = keys[j];\n\t\n\t if (props[key] > 1) {\n\t delete this.objects[i][key];\n\t }\n\t }\n\t }\n\t};\n\t\n\tPropertyMarker.prototype.dispose = function () {\n\t this.objects.length = 0;\n\t this.properties.length = 0;\n\t};\n\t\n\tfunction build(schema, def, additional, resolver, parentMarker) {\n\t var defType, defValue, key, i, propertyMarker, props, defProps;\n\t\n\t if (type(schema) !== 'object') {\n\t return def;\n\t }\n\t\n\t schema = resolver.resolve(schema);\n\t\n\t if (def === undefined && schema.hasOwnProperty('default')) {\n\t def = clone(schema['default']);\n\t }\n\t\n\t defType = type(def);\n\t\n\t if (defType === 'object' && type(schema.properties) === 'object') {\n\t props = Object.keys(schema.properties);\n\t\n\t for (i = 0; i < props.length; i++) {\n\t key = props[i];\n\t defValue = build(schema.properties[key], def[key], additional, resolver);\n\t\n\t if (defValue !== undefined) {\n\t def[key] = defValue;\n\t }\n\t }\n\t\n\t if (additional !== 'always') {\n\t defProps = Object.keys(def);\n\t\n\t for (i = 0; i < defProps.length; i++) {\n\t key = defProps[i];\n\t\n\t if (props.indexOf(key) < 0 &&\n\t (schema.additionalProperties === false ||\n\t (additional === false && !schema.additionalProperties))) {\n\t\n\t if (parentMarker) {\n\t parentMarker.mark(def, key);\n\t }\n\t else {\n\t delete def[key];\n\t }\n\t }\n\t }\n\t }\n\t }\n\t else if (defType === 'array' && schema.items) {\n\t if (type(schema.items) === 'array') {\n\t for (i = 0; i < schema.items.length; i++) {\n\t defValue = build(schema.items[i], def[i], additional, resolver);\n\t\n\t if (defValue !== undefined || i < def.length) {\n\t def[i] = defValue;\n\t }\n\t }\n\t }\n\t else if (def.length) {\n\t for (i = 0; i < def.length; i++) {\n\t def[i] = build(schema.items, def[i], additional, resolver);\n\t }\n\t }\n\t }\n\t else if (type(schema.allOf) === 'array' && schema.allOf.length) {\n\t propertyMarker = new PropertyMarker();\n\t\n\t for (i = 0; i < schema.allOf.length; i++) {\n\t def = build(schema.allOf[i], def, additional, resolver, propertyMarker);\n\t }\n\t\n\t propertyMarker.deleteDuplicates();\n\t propertyMarker.dispose();\n\t }\n\t\n\t return def;\n\t}\n\t\n\tfunction ValidationContext(options) {\n\t this.path = 'data';\n\t this.schema = options.schema;\n\t this.formats = options.formats;\n\t this.greedy = options.greedy;\n\t this.resolver = options.resolver;\n\t this.id = options.id;\n\t this.funcache = options.funcache || {};\n\t this.scope = options.scope || {\n\t equalAny: equalAny,\n\t unique: unique,\n\t ucs2length: ucs2length,\n\t refs: {}\n\t };\n\t}\n\t\n\tValidationContext.prototype.clone = function (schema) {\n\t var ctx = new ValidationContext({\n\t schema: schema,\n\t formats: this.formats,\n\t greedy: this.greedy,\n\t resolver: this.resolver,\n\t id: this.id,\n\t funcache: this.funcache,\n\t scope: this.scope\n\t });\n\t\n\t return ctx;\n\t};\n\t\n\tValidationContext.prototype.declare = function (def) {\n\t var variname = this.id();\n\t this.code.def(variname, def);\n\t return variname;\n\t};\n\t\n\tValidationContext.prototype.cache = function (cacheKey, schema) {\n\t var cached = this.funcache[cacheKey],\n\t context;\n\t\n\t if (!cached) {\n\t cached = this.funcache[cacheKey] = {\n\t key: this.id()\n\t };\n\t\n\t context = this.clone(schema);\n\t\n\t cached.func = context.compile(cached.key);\n\t\n\t this.scope.refs[cached.key] = cached.func;\n\t\n\t context.dispose();\n\t }\n\t\n\t return 'refs.' + cached.key;\n\t};\n\t\n\tValidationContext.prototype.error = function (keyword, key, additional) {\n\t var schema = this.schema,\n\t path = this.path,\n\t errorPath = path !== 'data' || key ?\n\t '(path ? path + \".\" : \"\") + ' + getPathExpression(path, key) + ',' :\n\t 'path,',\n\t res = key && schema.properties && schema.properties[key] ?\n\t this.resolver.resolve(schema.properties[key]) : null,\n\t message = res ? res.requiredMessage : schema.invalidMessage;\n\t\n\t if (!message) {\n\t message = (res && res.messages && res.messages[keyword]) ||\n\t (schema.messages && schema.messages[keyword]);\n\t }\n\t\n\t this.code('errors.push({');\n\t\n\t if (message) {\n\t this.code('message: ' + encodeStr(message) + ',');\n\t }\n\t\n\t if (additional) {\n\t this.code('additionalProperties: ' + additional + ',');\n\t }\n\t\n\t this.code('path: ' + errorPath)\n\t ('keyword: ' + encodeStr(keyword))\n\t ('})');\n\t\n\t if (!this.greedy) {\n\t this.code('return');\n\t }\n\t};\n\t\n\tValidationContext.prototype.refactor = function (path, schema, cacheKey) {\n\t var parentPathExp = path !== 'data' ?\n\t '(path ? path + \".\" : \"\") + ' + getPathExpression(path) :\n\t 'path',\n\t cachedRef = this.cache(cacheKey, schema),\n\t refErrors = this.declare();\n\t\n\t this.code(refErrors + ' = ' + cachedRef + '(' + path + ', ' + parentPathExp + ', errors)');\n\t\n\t if (!this.greedy) {\n\t this.code('if (errors.length) { return }');\n\t }\n\t};\n\t\n\tValidationContext.prototype.descend = function (path, schema) {\n\t var origPath = this.path,\n\t origSchema = this.schema;\n\t\n\t this.path = path;\n\t this.schema = schema;\n\t\n\t this.generate();\n\t\n\t this.path = origPath;\n\t this.schema = origSchema;\n\t};\n\t\n\tValidationContext.prototype.generate = function () {\n\t var path = this.path,\n\t schema = this.schema,\n\t context = this,\n\t scope = this.scope,\n\t encodedFormat,\n\t format,\n\t schemaKeys,\n\t typeKeys,\n\t typeIndex,\n\t validatedType,\n\t i;\n\t\n\t if (type(schema) !== 'object') {\n\t return;\n\t }\n\t\n\t if (schema.$ref !== undefined) {\n\t schema = this.resolver.resolve(schema);\n\t\n\t if (this.resolver.hasRef(schema)) {\n\t this.refactor(path, schema,\n\t this.resolver.getNormalizedRef(this.schema) || this.schema.$ref);\n\t\n\t return;\n\t }\n\t else {\n\t // substitute $ref schema with the resolved instance\n\t this.schema = schema;\n\t }\n\t }\n\t\n\t schemaKeys = groupKeywords(schema);\n\t\n\t if (schemaKeys.enum) {\n\t keywords.enum(context);\n\t\n\t return; // do not process the schema further\n\t }\n\t\n\t typeKeys = Object.keys(schemaKeys.perType);\n\t\n\t function generateForKeyword(keyword) {\n\t keywords[keyword](context); // jshint ignore: line\n\t }\n\t\n\t for (i = 0; i < typeKeys.length; i++) {\n\t validatedType = typeKeys[i];\n\t\n\t this.code((i ? 'else ' : '') + 'if (' + types[validatedType](path) + ') {');\n\t\n\t schemaKeys.perType[validatedType].forEach(generateForKeyword);\n\t\n\t this.code('}');\n\t\n\t if (schemaKeys.type) {\n\t typeIndex = schemaKeys.type.indexOf(validatedType);\n\t\n\t if (typeIndex > -1) {\n\t schemaKeys.type.splice(typeIndex, 1);\n\t }\n\t }\n\t }\n\t\n\t if (schemaKeys.type) { // we have types in the schema\n\t if (schemaKeys.type.length) { // case 1: we still have some left to check\n\t this.code((typeKeys.length ? 'else ' : '') + 'if (!(' + schemaKeys.type.map(function (type) {\n\t return types[type] ? types[type](path) : 'true';\n\t }).join(' || ') + ')) {');\n\t this.error('type');\n\t this.code('}');\n\t }\n\t else {\n\t this.code('else {'); // case 2: we don't have any left to check\n\t this.error('type');\n\t this.code('}');\n\t }\n\t }\n\t\n\t schemaKeys.allType.forEach(function (keyword) {\n\t keywords[keyword](context);\n\t });\n\t\n\t if (schema.format && this.formats) {\n\t format = this.formats[schema.format];\n\t\n\t if (format) {\n\t if (typeof format === 'string' || format instanceof RegExp) {\n\t this.code('if (!(' + inlineRegex(format) + ').test(' + path + ')) {');\n\t this.error('format');\n\t this.code('}');\n\t }\n\t else if (typeof format === 'function') {\n\t (scope.formats || (scope.formats = {}))[schema.format] = format;\n\t (scope.schemas || (scope.schemas = {}))[schema.format] = schema;\n\t\n\t encodedFormat = encodeStr(schema.format);\n\t\n\t this.code('if (!formats[' + encodedFormat + '](' + path + ', schemas[' + encodedFormat + '])) {');\n\t this.error('format');\n\t this.code('}');\n\t }\n\t }\n\t }\n\t};\n\t\n\tValidationContext.prototype.compile = function (id) {\n\t this.code = func('jsen_compiled' + (id ? '_' + id : ''), 'data', 'path', 'errors');\n\t this.generate();\n\t\n\t return this.code.compile(this.scope);\n\t};\n\t\n\tValidationContext.prototype.dispose = function () {\n\t for (var key in this) {\n\t this[key] = undefined;\n\t }\n\t};\n\t\n\tfunction jsen(schema, options) {\n\t if (type(schema) !== 'object') {\n\t throw new Error(INVALID_SCHEMA);\n\t }\n\t\n\t options = options || {};\n\t\n\t var counter = 0,\n\t id = function () { return 'i' + (counter++); },\n\t resolver = new SchemaResolver(schema, options.schemas, options.missing$Ref || false),\n\t context = new ValidationContext({\n\t schema: schema,\n\t resolver: resolver,\n\t id: id,\n\t schemas: options.schemas,\n\t formats: options.formats,\n\t greedy: options.greedy || false\n\t }),\n\t compiled = func('validate', 'data')\n\t ('validate.errors = []')\n\t ('gen(data, \"\", validate.errors)')\n\t ('return validate.errors.length === 0')\n\t .compile({ gen: context.compile() });\n\t\n\t context.dispose();\n\t context = null;\n\t\n\t compiled.errors = [];\n\t\n\t compiled.build = function (initial, options) {\n\t return build(\n\t schema,\n\t (options && options.copy === false ? initial : clone(initial)),\n\t options && options.additionalProperties,\n\t resolver);\n\t };\n\t\n\t return compiled;\n\t}\n\t\n\tjsen.browser = browser;\n\tjsen.clone = clone;\n\tjsen.equal = equal;\n\tjsen.unique = unique;\n\tjsen.ucs2length = ucs2length;\n\tjsen.SchemaResolver = SchemaResolver;\n\tjsen.resolve = SchemaResolver.resolvePointer;\n\t\n\tmodule.exports = jsen;\n\n\n/***/ },\n/* 12 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = function func() {\n\t var args = Array.apply(null, arguments),\n\t name = args.shift(),\n\t tab = ' ',\n\t lines = '',\n\t vars = '',\n\t ind = 1, // indentation\n\t bs = '{[', // block start\n\t be = '}]', // block end\n\t space = function () {\n\t var sp = tab, i = 0;\n\t while (i++ < ind - 1) { sp += tab; }\n\t return sp;\n\t },\n\t add = function (line) {\n\t lines += space() + line + '\\n';\n\t },\n\t builder = function (line) {\n\t var first = line[0],\n\t last = line[line.length - 1];\n\t\n\t if (be.indexOf(first) > -1 && bs.indexOf(last) > -1) {\n\t ind--;\n\t add(line);\n\t ind++;\n\t }\n\t else if (bs.indexOf(last) > -1) {\n\t add(line);\n\t ind++;\n\t }\n\t else if (be.indexOf(first) > -1) {\n\t ind--;\n\t add(line);\n\t }\n\t else {\n\t add(line);\n\t }\n\t\n\t return builder;\n\t };\n\t\n\t builder.def = function (id, def) {\n\t vars += (vars ? ',\\n' + tab + ' ' : '') + id + (def !== undefined ? ' = ' + def : '');\n\t return builder;\n\t };\n\t\n\t builder.toSource = function () {\n\t return 'function ' + name + '(' + args.join(', ') + ') {\\n' +\n\t tab + '\"use strict\"' + '\\n' +\n\t (vars ? tab + 'var ' + vars + ';\\n' : '') +\n\t lines + '}';\n\t };\n\t\n\t builder.compile = function (scope) {\n\t var src = 'return (' + builder.toSource() + ')',\n\t scp = scope || {},\n\t keys = Object.keys(scp),\n\t vals = keys.map(function (key) { return scp[key]; });\n\t\n\t return Function.apply(null, keys.concat(src)).apply(null, vals);\n\t };\n\t\n\t return builder;\n\t};\n\n/***/ },\n/* 13 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tfunction type(obj) {\n\t var str = Object.prototype.toString.call(obj);\n\t return str.substr(8, str.length - 9).toLowerCase();\n\t}\n\t\n\tfunction deepEqual(a, b) {\n\t var keysA = Object.keys(a).sort(),\n\t keysB = Object.keys(b).sort(),\n\t i, key;\n\t\n\t if (!equal(keysA, keysB)) {\n\t return false;\n\t }\n\t\n\t for (i = 0; i < keysA.length; i++) {\n\t key = keysA[i];\n\t\n\t if (!equal(a[key], b[key])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t}\n\t\n\tfunction equal(a, b) { // jshint ignore: line\n\t var typeA = typeof a,\n\t typeB = typeof b,\n\t i;\n\t\n\t // get detailed object type\n\t if (typeA === 'object') {\n\t typeA = type(a);\n\t }\n\t\n\t // get detailed object type\n\t if (typeB === 'object') {\n\t typeB = type(b);\n\t }\n\t\n\t if (typeA !== typeB) {\n\t return false;\n\t }\n\t\n\t if (typeA === 'object') {\n\t return deepEqual(a, b);\n\t }\n\t\n\t if (typeA === 'regexp') {\n\t return a.toString() === b.toString();\n\t }\n\t\n\t if (typeA === 'array') {\n\t if (a.length !== b.length) {\n\t return false;\n\t }\n\t\n\t for (i = 0; i < a.length; i++) {\n\t if (!equal(a[i], b[i])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t }\n\t\n\t return a === b;\n\t}\n\t\n\tmodule.exports = equal;\n\n/***/ },\n/* 14 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar equal = __webpack_require__(13);\n\t\n\tfunction findIndex(arr, value, comparator) {\n\t for (var i = 0, len = arr.length; i < len; i++) {\n\t if (comparator(arr[i], value)) {\n\t return i;\n\t }\n\t }\n\t\n\t return -1;\n\t}\n\t\n\tmodule.exports = function unique(arr) {\n\t return arr.filter(function uniqueOnly(value, index, self) {\n\t return findIndex(self, value, equal) === index;\n\t });\n\t};\n\t\n\tmodule.exports.findIndex = findIndex;\n\n/***/ },\n/* 15 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar url = __webpack_require__(16),\n\t metaschema = __webpack_require__(23),\n\t INVALID_SCHEMA_REFERENCE = 'jsen: invalid schema reference',\n\t DUPLICATE_SCHEMA_ID = 'jsen: duplicate schema id',\n\t CIRCULAR_SCHEMA_REFERENCE = 'jsen: circular schema reference';\n\t\n\tfunction get(obj, path) {\n\t if (!path.length) {\n\t return obj;\n\t }\n\t\n\t var key = path.shift(),\n\t val;\n\t\n\t if (obj && typeof obj === 'object' && obj.hasOwnProperty(key)) {\n\t val = obj[key];\n\t }\n\t\n\t if (path.length) {\n\t if (val && typeof val === 'object') {\n\t return get(val, path);\n\t }\n\t\n\t return undefined;\n\t }\n\t\n\t return val;\n\t}\n\t\n\tfunction refToObj(ref) {\n\t var index = ref.indexOf('#'),\n\t ret = {\n\t base: ref.substr(0, index),\n\t path: []\n\t };\n\t\n\t if (index < 0) {\n\t ret.base = ref;\n\t return ret;\n\t }\n\t\n\t ref = ref.substr(index + 1);\n\t\n\t if (!ref) {\n\t return ret;\n\t }\n\t\n\t ret.path = ref.split('/').map(function (segment) {\n\t // Reference: http://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-08#section-3\n\t return decodeURIComponent(segment)\n\t .replace(/~1/g, '/')\n\t .replace(/~0/g, '~');\n\t });\n\t\n\t if (ref[0] === '/') {\n\t ret.path.shift();\n\t }\n\t\n\t return ret;\n\t}\n\t\n\t// TODO: Can we prevent nested resolvers and combine schemas instead?\n\tfunction SchemaResolver(rootSchema, external, missing$Ref, baseId) { // jshint ignore: line\n\t this.rootSchema = rootSchema;\n\t this.resolvers = null;\n\t this.resolvedRootSchema = null;\n\t this.cache = {};\n\t this.idCache = {};\n\t this.refCache = { refs: [], schemas: [] };\n\t this.missing$Ref = missing$Ref;\n\t this.refStack = [];\n\t\n\t baseId = baseId || '';\n\t\n\t this._buildIdCache(rootSchema, baseId);\n\t\n\t // get updated base id after normalizing root schema id\n\t baseId = this.refCache.refs[this.refCache.schemas.indexOf(this.rootSchema)] || baseId;\n\t\n\t this._buildResolvers(external, baseId);\n\t}\n\t\n\tSchemaResolver.prototype._cacheId = function (id, schema, resolver) {\n\t if (this.idCache[id]) {\n\t throw new Error(DUPLICATE_SCHEMA_ID + ' ' + id);\n\t }\n\t\n\t this.idCache[id] = { resolver: resolver, schema: schema };\n\t};\n\t\n\tSchemaResolver.prototype._buildIdCache = function (schema, baseId) {\n\t var id = baseId,\n\t ref, keys, i;\n\t\n\t if (!schema || typeof schema !== 'object') {\n\t return;\n\t }\n\t\n\t if (typeof schema.id === 'string' && schema.id) {\n\t id = url.resolve(baseId, schema.id);\n\t\n\t this._cacheId(id, schema, this);\n\t }\n\t else if (schema === this.rootSchema && baseId) {\n\t this._cacheId(baseId, schema, this);\n\t }\n\t\n\t if (schema.$ref && typeof schema.$ref === 'string') {\n\t ref = url.resolve(id, schema.$ref);\n\t\n\t this.refCache.schemas.push(schema);\n\t this.refCache.refs.push(ref);\n\t }\n\t\n\t keys = Object.keys(schema);\n\t\n\t for (i = 0; i < keys.length; i++) {\n\t this._buildIdCache(schema[keys[i]], id);\n\t }\n\t};\n\t\n\tSchemaResolver.prototype._buildResolvers = function (schemas, baseId) {\n\t if (!schemas || typeof schemas !== 'object') {\n\t return;\n\t }\n\t\n\t var that = this,\n\t resolvers = {};\n\t\n\t Object.keys(schemas).forEach(function (key) {\n\t var id = url.resolve(baseId, key),\n\t resolver = new SchemaResolver(schemas[key], null, that.missing$Ref, id);\n\t\n\t that._cacheId(id, resolver.rootSchema, resolver);\n\t\n\t Object.keys(resolver.idCache).forEach(function (idKey) {\n\t that.idCache[idKey] = resolver.idCache[idKey];\n\t });\n\t\n\t resolvers[key] = resolver;\n\t });\n\t\n\t this.resolvers = resolvers;\n\t};\n\t\n\tSchemaResolver.prototype.getNormalizedRef = function (schema) {\n\t var index = this.refCache.schemas.indexOf(schema);\n\t return this.refCache.refs[index];\n\t};\n\t\n\tSchemaResolver.prototype._resolveRef = function (ref) {\n\t var err = new Error(INVALID_SCHEMA_REFERENCE + ' ' + ref),\n\t idCache = this.idCache,\n\t externalResolver, cached, descriptor, path, dest;\n\t\n\t if (!ref || typeof ref !== 'string') {\n\t throw err;\n\t }\n\t\n\t if (ref === metaschema.id) {\n\t dest = metaschema;\n\t }\n\t\n\t cached = idCache[ref];\n\t\n\t if (cached) {\n\t dest = cached.resolver.resolve(cached.schema);\n\t }\n\t\n\t if (dest === undefined) {\n\t descriptor = refToObj(ref);\n\t path = descriptor.path;\n\t\n\t if (descriptor.base) {\n\t cached = idCache[descriptor.base] || idCache[descriptor.base + '#'];\n\t\n\t if (cached) {\n\t dest = cached.resolver.resolve(get(cached.schema, path.slice(0)));\n\t }\n\t else {\n\t path.unshift(descriptor.base);\n\t }\n\t }\n\t }\n\t\n\t if (dest === undefined && this.resolvedRootSchema) {\n\t dest = get(this.resolvedRootSchema, path.slice(0));\n\t }\n\t\n\t if (dest === undefined) {\n\t dest = get(this.rootSchema, path.slice(0));\n\t }\n\t\n\t if (dest === undefined && path.length && this.resolvers) {\n\t externalResolver = get(this.resolvers, path);\n\t\n\t if (externalResolver) {\n\t dest = externalResolver.resolve(externalResolver.rootSchema);\n\t }\n\t }\n\t\n\t if (dest === undefined || typeof dest !== 'object') {\n\t if (this.missing$Ref) {\n\t dest = {};\n\t } else {\n\t throw err;\n\t }\n\t }\n\t\n\t if (this.cache[ref] === dest) {\n\t return dest;\n\t }\n\t\n\t this.cache[ref] = dest;\n\t\n\t if (dest.$ref !== undefined) {\n\t dest = this.resolve(dest);\n\t }\n\t\n\t return dest;\n\t};\n\t\n\tSchemaResolver.prototype.resolve = function (schema) {\n\t if (!schema || typeof schema !== 'object' || schema.$ref === undefined) {\n\t return schema;\n\t }\n\t\n\t var ref = this.getNormalizedRef(schema) || schema.$ref,\n\t resolved = this.cache[ref];\n\t\n\t if (resolved !== undefined) {\n\t return resolved;\n\t }\n\t\n\t if (this.refStack.indexOf(ref) > -1) {\n\t throw new Error(CIRCULAR_SCHEMA_REFERENCE + ' ' + ref);\n\t }\n\t\n\t this.refStack.push(ref);\n\t\n\t resolved = this._resolveRef(ref);\n\t\n\t this.refStack.pop();\n\t\n\t if (schema === this.rootSchema) {\n\t // cache the resolved root schema\n\t this.resolvedRootSchema = resolved;\n\t }\n\t\n\t return resolved;\n\t};\n\t\n\tSchemaResolver.prototype.hasRef = function (schema) {\n\t var keys = Object.keys(schema),\n\t len, key, i, hasChildRef;\n\t\n\t if (keys.indexOf('$ref') > -1) {\n\t return true;\n\t }\n\t\n\t for (i = 0, len = keys.length; i < len; i++) {\n\t key = keys[i];\n\t\n\t if (schema[key] && typeof schema[key] === 'object' && !Array.isArray(schema[key])) {\n\t hasChildRef = this.hasRef(schema[key]);\n\t\n\t if (hasChildRef) {\n\t return true;\n\t }\n\t }\n\t }\n\t\n\t return false;\n\t};\n\t\n\tSchemaResolver.resolvePointer = function (obj, pointer) {\n\t var descriptor = refToObj(pointer),\n\t path = descriptor.path;\n\t\n\t if (descriptor.base) {\n\t path = [descriptor.base].concat(path);\n\t }\n\t\n\t return get(obj, path);\n\t};\n\t\n\tmodule.exports = SchemaResolver;\n\n/***/ },\n/* 16 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t// Copyright Joyent, Inc. and other Node contributors.\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a\n\t// copy of this software and associated documentation files (the\n\t// \"Software\"), to deal in the Software without restriction, including\n\t// without limitation the rights to use, copy, modify, merge, publish,\n\t// distribute, sublicense, and/or sell copies of the Software, and to permit\n\t// persons to whom the Software is furnished to do so, subject to the\n\t// following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included\n\t// in all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n\t// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\t// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n\t// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n\t// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n\t// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n\t// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\t\n\t'use strict';\n\t\n\tvar punycode = __webpack_require__(17);\n\tvar util = __webpack_require__(19);\n\t\n\texports.parse = urlParse;\n\texports.resolve = urlResolve;\n\texports.resolveObject = urlResolveObject;\n\texports.format = urlFormat;\n\t\n\texports.Url = Url;\n\t\n\tfunction Url() {\n\t this.protocol = null;\n\t this.slashes = null;\n\t this.auth = null;\n\t this.host = null;\n\t this.port = null;\n\t this.hostname = null;\n\t this.hash = null;\n\t this.search = null;\n\t this.query = null;\n\t this.pathname = null;\n\t this.path = null;\n\t this.href = null;\n\t}\n\t\n\t// Reference: RFC 3986, RFC 1808, RFC 2396\n\t\n\t// define these here so at least they only have to be\n\t// compiled once on the first module load.\n\tvar protocolPattern = /^([a-z0-9.+-]+:)/i,\n\t portPattern = /:[0-9]*$/,\n\t\n\t // Special case for a simple path URL\n\t simplePathPattern = /^(\\/\\/?(?!\\/)[^\\?\\s]*)(\\?[^\\s]*)?$/,\n\t\n\t // RFC 2396: characters reserved for delimiting URLs.\n\t // We actually just auto-escape these.\n\t delims = ['<', '>', '\"', '`', ' ', '\\r', '\\n', '\\t'],\n\t\n\t // RFC 2396: characters not allowed for various reasons.\n\t unwise = ['{', '}', '|', '\\\\', '^', '`'].concat(delims),\n\t\n\t // Allowed by RFCs, but cause of XSS attacks. Always escape these.\n\t autoEscape = ['\\''].concat(unwise),\n\t // Characters that are never ever allowed in a hostname.\n\t // Note that any invalid chars are also handled, but these\n\t // are the ones that are *expected* to be seen, so we fast-path\n\t // them.\n\t nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape),\n\t hostEndingChars = ['/', '?', '#'],\n\t hostnameMaxLen = 255,\n\t hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,\n\t hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,\n\t // protocols that can allow \"unsafe\" and \"unwise\" chars.\n\t unsafeProtocol = {\n\t 'javascript': true,\n\t 'javascript:': true\n\t },\n\t // protocols that never have a hostname.\n\t hostlessProtocol = {\n\t 'javascript': true,\n\t 'javascript:': true\n\t },\n\t // protocols that always contain a // bit.\n\t slashedProtocol = {\n\t 'http': true,\n\t 'https': true,\n\t 'ftp': true,\n\t 'gopher': true,\n\t 'file': true,\n\t 'http:': true,\n\t 'https:': true,\n\t 'ftp:': true,\n\t 'gopher:': true,\n\t 'file:': true\n\t },\n\t querystring = __webpack_require__(20);\n\t\n\tfunction urlParse(url, parseQueryString, slashesDenoteHost) {\n\t if (url && util.isObject(url) && url instanceof Url) return url;\n\t\n\t var u = new Url;\n\t u.parse(url, parseQueryString, slashesDenoteHost);\n\t return u;\n\t}\n\t\n\tUrl.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {\n\t if (!util.isString(url)) {\n\t throw new TypeError(\"Parameter 'url' must be a string, not \" + typeof url);\n\t }\n\t\n\t // Copy chrome, IE, opera backslash-handling behavior.\n\t // Back slashes before the query string get converted to forward slashes\n\t // See: https://code.google.com/p/chromium/issues/detail?id=25916\n\t var queryIndex = url.indexOf('?'),\n\t splitter =\n\t (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#',\n\t uSplit = url.split(splitter),\n\t slashRegex = /\\\\/g;\n\t uSplit[0] = uSplit[0].replace(slashRegex, '/');\n\t url = uSplit.join(splitter);\n\t\n\t var rest = url;\n\t\n\t // trim before proceeding.\n\t // This is to support parse stuff like \" http://foo.com \\n\"\n\t rest = rest.trim();\n\t\n\t if (!slashesDenoteHost && url.split('#').length === 1) {\n\t // Try fast path regexp\n\t var simplePath = simplePathPattern.exec(rest);\n\t if (simplePath) {\n\t this.path = rest;\n\t this.href = rest;\n\t this.pathname = simplePath[1];\n\t if (simplePath[2]) {\n\t this.search = simplePath[2];\n\t if (parseQueryString) {\n\t this.query = querystring.parse(this.search.substr(1));\n\t } else {\n\t this.query = this.search.substr(1);\n\t }\n\t } else if (parseQueryString) {\n\t this.search = '';\n\t this.query = {};\n\t }\n\t return this;\n\t }\n\t }\n\t\n\t var proto = protocolPattern.exec(rest);\n\t if (proto) {\n\t proto = proto[0];\n\t var lowerProto = proto.toLowerCase();\n\t this.protocol = lowerProto;\n\t rest = rest.substr(proto.length);\n\t }\n\t\n\t // figure out if it's got a host\n\t // user@server is *always* interpreted as a hostname, and url\n\t // resolution will treat //foo/bar as host=foo,path=bar because that's\n\t // how the browser resolves relative URLs.\n\t if (slashesDenoteHost || proto || rest.match(/^\\/\\/[^@\\/]+@[^@\\/]+/)) {\n\t var slashes = rest.substr(0, 2) === '//';\n\t if (slashes && !(proto && hostlessProtocol[proto])) {\n\t rest = rest.substr(2);\n\t this.slashes = true;\n\t }\n\t }\n\t\n\t if (!hostlessProtocol[proto] &&\n\t (slashes || (proto && !slashedProtocol[proto]))) {\n\t\n\t // there's a hostname.\n\t // the first instance of /, ?, ;, or # ends the host.\n\t //\n\t // If there is an @ in the hostname, then non-host chars *are* allowed\n\t // to the left of the last @ sign, unless some host-ending character\n\t // comes *before* the @-sign.\n\t // URLs are obnoxious.\n\t //\n\t // ex:\n\t // http://a@b@c/ => user:a@b host:c\n\t // http://a@b?@c => user:a host:c path:/?@c\n\t\n\t // v0.12 TODO(isaacs): This is not quite how Chrome does things.\n\t // Review our test case against browsers more comprehensively.\n\t\n\t // find the first instance of any hostEndingChars\n\t var hostEnd = -1;\n\t for (var i = 0; i < hostEndingChars.length; i++) {\n\t var hec = rest.indexOf(hostEndingChars[i]);\n\t if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n\t hostEnd = hec;\n\t }\n\t\n\t // at this point, either we have an explicit point where the\n\t // auth portion cannot go past, or the last @ char is the decider.\n\t var auth, atSign;\n\t if (hostEnd === -1) {\n\t // atSign can be anywhere.\n\t atSign = rest.lastIndexOf('@');\n\t } else {\n\t // atSign must be in auth portion.\n\t // http://a@b/c@d => host:b auth:a path:/c@d\n\t atSign = rest.lastIndexOf('@', hostEnd);\n\t }\n\t\n\t // Now we have a portion which is definitely the auth.\n\t // Pull that off.\n\t if (atSign !== -1) {\n\t auth = rest.slice(0, atSign);\n\t rest = rest.slice(atSign + 1);\n\t this.auth = decodeURIComponent(auth);\n\t }\n\t\n\t // the host is the remaining to the left of the first non-host char\n\t hostEnd = -1;\n\t for (var i = 0; i < nonHostChars.length; i++) {\n\t var hec = rest.indexOf(nonHostChars[i]);\n\t if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n\t hostEnd = hec;\n\t }\n\t // if we still have not hit it, then the entire thing is a host.\n\t if (hostEnd === -1)\n\t hostEnd = rest.length;\n\t\n\t this.host = rest.slice(0, hostEnd);\n\t rest = rest.slice(hostEnd);\n\t\n\t // pull out port.\n\t this.parseHost();\n\t\n\t // we've indicated that there is a hostname,\n\t // so even if it's empty, it has to be present.\n\t this.hostname = this.hostname || '';\n\t\n\t // if hostname begins with [ and ends with ]\n\t // assume that it's an IPv6 address.\n\t var ipv6Hostname = this.hostname[0] === '[' &&\n\t this.hostname[this.hostname.length - 1] === ']';\n\t\n\t // validate a little.\n\t if (!ipv6Hostname) {\n\t var hostparts = this.hostname.split(/\\./);\n\t for (var i = 0, l = hostparts.length; i < l; i++) {\n\t var part = hostparts[i];\n\t if (!part) continue;\n\t if (!part.match(hostnamePartPattern)) {\n\t var newpart = '';\n\t for (var j = 0, k = part.length; j < k; j++) {\n\t if (part.charCodeAt(j) > 127) {\n\t // we replace non-ASCII char with a temporary placeholder\n\t // we need this to make sure size of hostname is not\n\t // broken by replacing non-ASCII by nothing\n\t newpart += 'x';\n\t } else {\n\t newpart += part[j];\n\t }\n\t }\n\t // we test again with ASCII char only\n\t if (!newpart.match(hostnamePartPattern)) {\n\t var validParts = hostparts.slice(0, i);\n\t var notHost = hostparts.slice(i + 1);\n\t var bit = part.match(hostnamePartStart);\n\t if (bit) {\n\t validParts.push(bit[1]);\n\t notHost.unshift(bit[2]);\n\t }\n\t if (notHost.length) {\n\t rest = '/' + notHost.join('.') + rest;\n\t }\n\t this.hostname = validParts.join('.');\n\t break;\n\t }\n\t }\n\t }\n\t }\n\t\n\t if (this.hostname.length > hostnameMaxLen) {\n\t this.hostname = '';\n\t } else {\n\t // hostnames are always lower case.\n\t this.hostname = this.hostname.toLowerCase();\n\t }\n\t\n\t if (!ipv6Hostname) {\n\t // IDNA Support: Returns a punycoded representation of \"domain\".\n\t // It only converts parts of the domain name that\n\t // have non-ASCII characters, i.e. it doesn't matter if\n\t // you call it with a domain that already is ASCII-only.\n\t this.hostname = punycode.toASCII(this.hostname);\n\t }\n\t\n\t var p = this.port ? ':' + this.port : '';\n\t var h = this.hostname || '';\n\t this.host = h + p;\n\t this.href += this.host;\n\t\n\t // strip [ and ] from the hostname\n\t // the host field still retains them, though\n\t if (ipv6Hostname) {\n\t this.hostname = this.hostname.substr(1, this.hostname.length - 2);\n\t if (rest[0] !== '/') {\n\t rest = '/' + rest;\n\t }\n\t }\n\t }\n\t\n\t // now rest is set to the post-host stuff.\n\t // chop off any delim chars.\n\t if (!unsafeProtocol[lowerProto]) {\n\t\n\t // First, make 100% sure that any \"autoEscape\" chars get\n\t // escaped, even if encodeURIComponent doesn't think they\n\t // need to be.\n\t for (var i = 0, l = autoEscape.length; i < l; i++) {\n\t var ae = autoEscape[i];\n\t if (rest.indexOf(ae) === -1)\n\t continue;\n\t var esc = encodeURIComponent(ae);\n\t if (esc === ae) {\n\t esc = escape(ae);\n\t }\n\t rest = rest.split(ae).join(esc);\n\t }\n\t }\n\t\n\t\n\t // chop off from the tail first.\n\t var hash = rest.indexOf('#');\n\t if (hash !== -1) {\n\t // got a fragment string.\n\t this.hash = rest.substr(hash);\n\t rest = rest.slice(0, hash);\n\t }\n\t var qm = rest.indexOf('?');\n\t if (qm !== -1) {\n\t this.search = rest.substr(qm);\n\t this.query = rest.substr(qm + 1);\n\t if (parseQueryString) {\n\t this.query = querystring.parse(this.query);\n\t }\n\t rest = rest.slice(0, qm);\n\t } else if (parseQueryString) {\n\t // no query string, but parseQueryString still requested\n\t this.search = '';\n\t this.query = {};\n\t }\n\t if (rest) this.pathname = rest;\n\t if (slashedProtocol[lowerProto] &&\n\t this.hostname && !this.pathname) {\n\t this.pathname = '/';\n\t }\n\t\n\t //to support http.request\n\t if (this.pathname || this.search) {\n\t var p = this.pathname || '';\n\t var s = this.search || '';\n\t this.path = p + s;\n\t }\n\t\n\t // finally, reconstruct the href based on what has been validated.\n\t this.href = this.format();\n\t return this;\n\t};\n\t\n\t// format a parsed object into a url string\n\tfunction urlFormat(obj) {\n\t // ensure it's an object, and not a string url.\n\t // If it's an obj, this is a no-op.\n\t // this way, you can call url_format() on strings\n\t // to clean up potentially wonky urls.\n\t if (util.isString(obj)) obj = urlParse(obj);\n\t if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n\t return obj.format();\n\t}\n\t\n\tUrl.prototype.format = function() {\n\t var auth = this.auth || '';\n\t if (auth) {\n\t auth = encodeURIComponent(auth);\n\t auth = auth.replace(/%3A/i, ':');\n\t auth += '@';\n\t }\n\t\n\t var protocol = this.protocol || '',\n\t pathname = this.pathname || '',\n\t hash = this.hash || '',\n\t host = false,\n\t query = '';\n\t\n\t if (this.host) {\n\t host = auth + this.host;\n\t } else if (this.hostname) {\n\t host = auth + (this.hostname.indexOf(':') === -1 ?\n\t this.hostname :\n\t '[' + this.hostname + ']');\n\t if (this.port) {\n\t host += ':' + this.port;\n\t }\n\t }\n\t\n\t if (this.query &&\n\t util.isObject(this.query) &&\n\t Object.keys(this.query).length) {\n\t query = querystring.stringify(this.query);\n\t }\n\t\n\t var search = this.search || (query && ('?' + query)) || '';\n\t\n\t if (protocol && protocol.substr(-1) !== ':') protocol += ':';\n\t\n\t // only the slashedProtocols get the //. Not mailto:, xmpp:, etc.\n\t // unless they had them to begin with.\n\t if (this.slashes ||\n\t (!protocol || slashedProtocol[protocol]) && host !== false) {\n\t host = '//' + (host || '');\n\t if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname;\n\t } else if (!host) {\n\t host = '';\n\t }\n\t\n\t if (hash && hash.charAt(0) !== '#') hash = '#' + hash;\n\t if (search && search.charAt(0) !== '?') search = '?' + search;\n\t\n\t pathname = pathname.replace(/[?#]/g, function(match) {\n\t return encodeURIComponent(match);\n\t });\n\t search = search.replace('#', '%23');\n\t\n\t return protocol + host + pathname + search + hash;\n\t};\n\t\n\tfunction urlResolve(source, relative) {\n\t return urlParse(source, false, true).resolve(relative);\n\t}\n\t\n\tUrl.prototype.resolve = function(relative) {\n\t return this.resolveObject(urlParse(relative, false, true)).format();\n\t};\n\t\n\tfunction urlResolveObject(source, relative) {\n\t if (!source) return relative;\n\t return urlParse(source, false, true).resolveObject(relative);\n\t}\n\t\n\tUrl.prototype.resolveObject = function(relative) {\n\t if (util.isString(relative)) {\n\t var rel = new Url();\n\t rel.parse(relative, false, true);\n\t relative = rel;\n\t }\n\t\n\t var result = new Url();\n\t var tkeys = Object.keys(this);\n\t for (var tk = 0; tk < tkeys.length; tk++) {\n\t var tkey = tkeys[tk];\n\t result[tkey] = this[tkey];\n\t }\n\t\n\t // hash is always overridden, no matter what.\n\t // even href=\"\" will remove it.\n\t result.hash = relative.hash;\n\t\n\t // if the relative url is empty, then there's nothing left to do here.\n\t if (relative.href === '') {\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t // hrefs like //foo/bar always cut to the protocol.\n\t if (relative.slashes && !relative.protocol) {\n\t // take everything except the protocol from relative\n\t var rkeys = Object.keys(relative);\n\t for (var rk = 0; rk < rkeys.length; rk++) {\n\t var rkey = rkeys[rk];\n\t if (rkey !== 'protocol')\n\t result[rkey] = relative[rkey];\n\t }\n\t\n\t //urlParse appends trailing / to urls like http://www.example.com\n\t if (slashedProtocol[result.protocol] &&\n\t result.hostname && !result.pathname) {\n\t result.path = result.pathname = '/';\n\t }\n\t\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t if (relative.protocol && relative.protocol !== result.protocol) {\n\t // if it's a known url protocol, then changing\n\t // the protocol does weird things\n\t // first, if it's not file:, then we MUST have a host,\n\t // and if there was a path\n\t // to begin with, then we MUST have a path.\n\t // if it is file:, then the host is dropped,\n\t // because that's known to be hostless.\n\t // anything else is assumed to be absolute.\n\t if (!slashedProtocol[relative.protocol]) {\n\t var keys = Object.keys(relative);\n\t for (var v = 0; v < keys.length; v++) {\n\t var k = keys[v];\n\t result[k] = relative[k];\n\t }\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t result.protocol = relative.protocol;\n\t if (!relative.host && !hostlessProtocol[relative.protocol]) {\n\t var relPath = (relative.pathname || '').split('/');\n\t while (relPath.length && !(relative.host = relPath.shift()));\n\t if (!relative.host) relative.host = '';\n\t if (!relative.hostname) relative.hostname = '';\n\t if (relPath[0] !== '') relPath.unshift('');\n\t if (relPath.length < 2) relPath.unshift('');\n\t result.pathname = relPath.join('/');\n\t } else {\n\t result.pathname = relative.pathname;\n\t }\n\t result.search = relative.search;\n\t result.query = relative.query;\n\t result.host = relative.host || '';\n\t result.auth = relative.auth;\n\t result.hostname = relative.hostname || relative.host;\n\t result.port = relative.port;\n\t // to support http.request\n\t if (result.pathname || result.search) {\n\t var p = result.pathname || '';\n\t var s = result.search || '';\n\t result.path = p + s;\n\t }\n\t result.slashes = result.slashes || relative.slashes;\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'),\n\t isRelAbs = (\n\t relative.host ||\n\t relative.pathname && relative.pathname.charAt(0) === '/'\n\t ),\n\t mustEndAbs = (isRelAbs || isSourceAbs ||\n\t (result.host && relative.pathname)),\n\t removeAllDots = mustEndAbs,\n\t srcPath = result.pathname && result.pathname.split('/') || [],\n\t relPath = relative.pathname && relative.pathname.split('/') || [],\n\t psychotic = result.protocol && !slashedProtocol[result.protocol];\n\t\n\t // if the url is a non-slashed url, then relative\n\t // links like ../.. should be able\n\t // to crawl up to the hostname, as well. This is strange.\n\t // result.protocol has already been set by now.\n\t // Later on, put the first path part into the host field.\n\t if (psychotic) {\n\t result.hostname = '';\n\t result.port = null;\n\t if (result.host) {\n\t if (srcPath[0] === '') srcPath[0] = result.host;\n\t else srcPath.unshift(result.host);\n\t }\n\t result.host = '';\n\t if (relative.protocol) {\n\t relative.hostname = null;\n\t relative.port = null;\n\t if (relative.host) {\n\t if (relPath[0] === '') relPath[0] = relative.host;\n\t else relPath.unshift(relative.host);\n\t }\n\t relative.host = null;\n\t }\n\t mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === '');\n\t }\n\t\n\t if (isRelAbs) {\n\t // it's absolute.\n\t result.host = (relative.host || relative.host === '') ?\n\t relative.host : result.host;\n\t result.hostname = (relative.hostname || relative.hostname === '') ?\n\t relative.hostname : result.hostname;\n\t result.search = relative.search;\n\t result.query = relative.query;\n\t srcPath = relPath;\n\t // fall through to the dot-handling below.\n\t } else if (relPath.length) {\n\t // it's relative\n\t // throw away the existing file, and take the new path instead.\n\t if (!srcPath) srcPath = [];\n\t srcPath.pop();\n\t srcPath = srcPath.concat(relPath);\n\t result.search = relative.search;\n\t result.query = relative.query;\n\t } else if (!util.isNullOrUndefined(relative.search)) {\n\t // just pull out the search.\n\t // like href='https://github.com/?foo'.\n\t // Put this after the other two cases because it simplifies the booleans\n\t if (psychotic) {\n\t result.hostname = result.host = srcPath.shift();\n\t //occationaly the auth can get stuck only in host\n\t //this especially happens in cases like\n\t //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n\t var authInHost = result.host && result.host.indexOf('@') > 0 ?\n\t result.host.split('@') : false;\n\t if (authInHost) {\n\t result.auth = authInHost.shift();\n\t result.host = result.hostname = authInHost.shift();\n\t }\n\t }\n\t result.search = relative.search;\n\t result.query = relative.query;\n\t //to support http.request\n\t if (!util.isNull(result.pathname) || !util.isNull(result.search)) {\n\t result.path = (result.pathname ? result.pathname : '') +\n\t (result.search ? result.search : '');\n\t }\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t if (!srcPath.length) {\n\t // no path at all. easy.\n\t // we've already handled the other stuff above.\n\t result.pathname = null;\n\t //to support http.request\n\t if (result.search) {\n\t result.path = '/' + result.search;\n\t } else {\n\t result.path = null;\n\t }\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t // if a url ENDs in . or .., then it must get a trailing slash.\n\t // however, if it ends in anything else non-slashy,\n\t // then it must NOT get a trailing slash.\n\t var last = srcPath.slice(-1)[0];\n\t var hasTrailingSlash = (\n\t (result.host || relative.host || srcPath.length > 1) &&\n\t (last === '.' || last === '..') || last === '');\n\t\n\t // strip single dots, resolve double dots to parent dir\n\t // if the path tries to go above the root, `up` ends up > 0\n\t var up = 0;\n\t for (var i = srcPath.length; i >= 0; i--) {\n\t last = srcPath[i];\n\t if (last === '.') {\n\t srcPath.splice(i, 1);\n\t } else if (last === '..') {\n\t srcPath.splice(i, 1);\n\t up++;\n\t } else if (up) {\n\t srcPath.splice(i, 1);\n\t up--;\n\t }\n\t }\n\t\n\t // if the path is allowed to go above the root, restore leading ..s\n\t if (!mustEndAbs && !removeAllDots) {\n\t for (; up--; up) {\n\t srcPath.unshift('..');\n\t }\n\t }\n\t\n\t if (mustEndAbs && srcPath[0] !== '' &&\n\t (!srcPath[0] || srcPath[0].charAt(0) !== '/')) {\n\t srcPath.unshift('');\n\t }\n\t\n\t if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) {\n\t srcPath.push('');\n\t }\n\t\n\t var isAbsolute = srcPath[0] === '' ||\n\t (srcPath[0] && srcPath[0].charAt(0) === '/');\n\t\n\t // put the host back\n\t if (psychotic) {\n\t result.hostname = result.host = isAbsolute ? '' :\n\t srcPath.length ? srcPath.shift() : '';\n\t //occationaly the auth can get stuck only in host\n\t //this especially happens in cases like\n\t //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n\t var authInHost = result.host && result.host.indexOf('@') > 0 ?\n\t result.host.split('@') : false;\n\t if (authInHost) {\n\t result.auth = authInHost.shift();\n\t result.host = result.hostname = authInHost.shift();\n\t }\n\t }\n\t\n\t mustEndAbs = mustEndAbs || (result.host && srcPath.length);\n\t\n\t if (mustEndAbs && !isAbsolute) {\n\t srcPath.unshift('');\n\t }\n\t\n\t if (!srcPath.length) {\n\t result.pathname = null;\n\t result.path = null;\n\t } else {\n\t result.pathname = srcPath.join('/');\n\t }\n\t\n\t //to support request.http\n\t if (!util.isNull(result.pathname) || !util.isNull(result.search)) {\n\t result.path = (result.pathname ? result.pathname : '') +\n\t (result.search ? result.search : '');\n\t }\n\t result.auth = relative.auth || result.auth;\n\t result.slashes = result.slashes || relative.slashes;\n\t result.href = result.format();\n\t return result;\n\t};\n\t\n\tUrl.prototype.parseHost = function() {\n\t var host = this.host;\n\t var port = portPattern.exec(host);\n\t if (port) {\n\t port = port[0];\n\t if (port !== ':') {\n\t this.port = port.substr(1);\n\t }\n\t host = host.substr(0, host.length - port.length);\n\t }\n\t if (host) this.hostname = host;\n\t};\n\n\n/***/ },\n/* 17 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(module, global) {/*! https://mths.be/punycode v1.3.2 by @mathias */\n\t;(function(root) {\n\t\n\t\t/** Detect free variables */\n\t\tvar freeExports = typeof exports == 'object' && exports &&\n\t\t\t!exports.nodeType && exports;\n\t\tvar freeModule = typeof module == 'object' && module &&\n\t\t\t!module.nodeType && module;\n\t\tvar freeGlobal = typeof global == 'object' && global;\n\t\tif (\n\t\t\tfreeGlobal.global === freeGlobal ||\n\t\t\tfreeGlobal.window === freeGlobal ||\n\t\t\tfreeGlobal.self === freeGlobal\n\t\t) {\n\t\t\troot = freeGlobal;\n\t\t}\n\t\n\t\t/**\n\t\t * The `punycode` object.\n\t\t * @name punycode\n\t\t * @type Object\n\t\t */\n\t\tvar punycode,\n\t\n\t\t/** Highest positive signed 32-bit float value */\n\t\tmaxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1\n\t\n\t\t/** Bootstring parameters */\n\t\tbase = 36,\n\t\ttMin = 1,\n\t\ttMax = 26,\n\t\tskew = 38,\n\t\tdamp = 700,\n\t\tinitialBias = 72,\n\t\tinitialN = 128, // 0x80\n\t\tdelimiter = '-', // '\\x2D'\n\t\n\t\t/** Regular expressions */\n\t\tregexPunycode = /^xn--/,\n\t\tregexNonASCII = /[^\\x20-\\x7E]/, // unprintable ASCII chars + non-ASCII chars\n\t\tregexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g, // RFC 3490 separators\n\t\n\t\t/** Error messages */\n\t\terrors = {\n\t\t\t'overflow': 'Overflow: input needs wider integers to process',\n\t\t\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t\t\t'invalid-input': 'Invalid input'\n\t\t},\n\t\n\t\t/** Convenience shortcuts */\n\t\tbaseMinusTMin = base - tMin,\n\t\tfloor = Math.floor,\n\t\tstringFromCharCode = String.fromCharCode,\n\t\n\t\t/** Temporary variable */\n\t\tkey;\n\t\n\t\t/*--------------------------------------------------------------------------*/\n\t\n\t\t/**\n\t\t * A generic error utility function.\n\t\t * @private\n\t\t * @param {String} type The error type.\n\t\t * @returns {Error} Throws a `RangeError` with the applicable error message.\n\t\t */\n\t\tfunction error(type) {\n\t\t\tthrow RangeError(errors[type]);\n\t\t}\n\t\n\t\t/**\n\t\t * A generic `Array#map` utility function.\n\t\t * @private\n\t\t * @param {Array} array The array to iterate over.\n\t\t * @param {Function} callback The function that gets called for every array\n\t\t * item.\n\t\t * @returns {Array} A new array of values returned by the callback function.\n\t\t */\n\t\tfunction map(array, fn) {\n\t\t\tvar length = array.length;\n\t\t\tvar result = [];\n\t\t\twhile (length--) {\n\t\t\t\tresult[length] = fn(array[length]);\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\n\t\t/**\n\t\t * A simple `Array#map`-like wrapper to work with domain name strings or email\n\t\t * addresses.\n\t\t * @private\n\t\t * @param {String} domain The domain name or email address.\n\t\t * @param {Function} callback The function that gets called for every\n\t\t * character.\n\t\t * @returns {Array} A new string of characters returned by the callback\n\t\t * function.\n\t\t */\n\t\tfunction mapDomain(string, fn) {\n\t\t\tvar parts = string.split('@');\n\t\t\tvar result = '';\n\t\t\tif (parts.length > 1) {\n\t\t\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t\t\t// the local part (i.e. everything up to `@`) intact.\n\t\t\t\tresult = parts[0] + '@';\n\t\t\t\tstring = parts[1];\n\t\t\t}\n\t\t\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\t\t\tstring = string.replace(regexSeparators, '\\x2E');\n\t\t\tvar labels = string.split('.');\n\t\t\tvar encoded = map(labels, fn).join('.');\n\t\t\treturn result + encoded;\n\t\t}\n\t\n\t\t/**\n\t\t * Creates an array containing the numeric code points of each Unicode\n\t\t * character in the string. While JavaScript uses UCS-2 internally,\n\t\t * this function will convert a pair of surrogate halves (each of which\n\t\t * UCS-2 exposes as separate characters) into a single code point,\n\t\t * matching UTF-16.\n\t\t * @see `punycode.ucs2.encode`\n\t\t * @see \n\t\t * @memberOf punycode.ucs2\n\t\t * @name decode\n\t\t * @param {String} string The Unicode input string (UCS-2).\n\t\t * @returns {Array} The new array of code points.\n\t\t */\n\t\tfunction ucs2decode(string) {\n\t\t\tvar output = [],\n\t\t\t counter = 0,\n\t\t\t length = string.length,\n\t\t\t value,\n\t\t\t extra;\n\t\t\twhile (counter < length) {\n\t\t\t\tvalue = string.charCodeAt(counter++);\n\t\t\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t\t\t// high surrogate, and there is a next character\n\t\t\t\t\textra = string.charCodeAt(counter++);\n\t\t\t\t\tif ((extra & 0xFC00) == 0xDC00) { // low surrogate\n\t\t\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// unmatched surrogate; only append this code unit, in case the next\n\t\t\t\t\t\t// code unit is the high surrogate of a surrogate pair\n\t\t\t\t\t\toutput.push(value);\n\t\t\t\t\t\tcounter--;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\toutput.push(value);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn output;\n\t\t}\n\t\n\t\t/**\n\t\t * Creates a string based on an array of numeric code points.\n\t\t * @see `punycode.ucs2.decode`\n\t\t * @memberOf punycode.ucs2\n\t\t * @name encode\n\t\t * @param {Array} codePoints The array of numeric code points.\n\t\t * @returns {String} The new Unicode string (UCS-2).\n\t\t */\n\t\tfunction ucs2encode(array) {\n\t\t\treturn map(array, function(value) {\n\t\t\t\tvar output = '';\n\t\t\t\tif (value > 0xFFFF) {\n\t\t\t\t\tvalue -= 0x10000;\n\t\t\t\t\toutput += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);\n\t\t\t\t\tvalue = 0xDC00 | value & 0x3FF;\n\t\t\t\t}\n\t\t\t\toutput += stringFromCharCode(value);\n\t\t\t\treturn output;\n\t\t\t}).join('');\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a basic code point into a digit/integer.\n\t\t * @see `digitToBasic()`\n\t\t * @private\n\t\t * @param {Number} codePoint The basic numeric code point value.\n\t\t * @returns {Number} The numeric value of a basic code point (for use in\n\t\t * representing integers) in the range `0` to `base - 1`, or `base` if\n\t\t * the code point does not represent a value.\n\t\t */\n\t\tfunction basicToDigit(codePoint) {\n\t\t\tif (codePoint - 48 < 10) {\n\t\t\t\treturn codePoint - 22;\n\t\t\t}\n\t\t\tif (codePoint - 65 < 26) {\n\t\t\t\treturn codePoint - 65;\n\t\t\t}\n\t\t\tif (codePoint - 97 < 26) {\n\t\t\t\treturn codePoint - 97;\n\t\t\t}\n\t\t\treturn base;\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a digit/integer into a basic code point.\n\t\t * @see `basicToDigit()`\n\t\t * @private\n\t\t * @param {Number} digit The numeric value of a basic code point.\n\t\t * @returns {Number} The basic code point whose value (when used for\n\t\t * representing integers) is `digit`, which needs to be in the range\n\t\t * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n\t\t * used; else, the lowercase form is used. The behavior is undefined\n\t\t * if `flag` is non-zero and `digit` has no uppercase form.\n\t\t */\n\t\tfunction digitToBasic(digit, flag) {\n\t\t\t// 0..25 map to ASCII a..z or A..Z\n\t\t\t// 26..35 map to ASCII 0..9\n\t\t\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n\t\t}\n\t\n\t\t/**\n\t\t * Bias adaptation function as per section 3.4 of RFC 3492.\n\t\t * http://tools.ietf.org/html/rfc3492#section-3.4\n\t\t * @private\n\t\t */\n\t\tfunction adapt(delta, numPoints, firstTime) {\n\t\t\tvar k = 0;\n\t\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\t\tdelta += floor(delta / numPoints);\n\t\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t\t}\n\t\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n\t\t * symbols.\n\t\t * @memberOf punycode\n\t\t * @param {String} input The Punycode string of ASCII-only symbols.\n\t\t * @returns {String} The resulting string of Unicode symbols.\n\t\t */\n\t\tfunction decode(input) {\n\t\t\t// Don't use UCS-2\n\t\t\tvar output = [],\n\t\t\t inputLength = input.length,\n\t\t\t out,\n\t\t\t i = 0,\n\t\t\t n = initialN,\n\t\t\t bias = initialBias,\n\t\t\t basic,\n\t\t\t j,\n\t\t\t index,\n\t\t\t oldi,\n\t\t\t w,\n\t\t\t k,\n\t\t\t digit,\n\t\t\t t,\n\t\t\t /** Cached calculation results */\n\t\t\t baseMinusT;\n\t\n\t\t\t// Handle the basic code points: let `basic` be the number of input code\n\t\t\t// points before the last delimiter, or `0` if there is none, then copy\n\t\t\t// the first basic code points to the output.\n\t\n\t\t\tbasic = input.lastIndexOf(delimiter);\n\t\t\tif (basic < 0) {\n\t\t\t\tbasic = 0;\n\t\t\t}\n\t\n\t\t\tfor (j = 0; j < basic; ++j) {\n\t\t\t\t// if it's not a basic code point\n\t\t\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\t\t\terror('not-basic');\n\t\t\t\t}\n\t\t\t\toutput.push(input.charCodeAt(j));\n\t\t\t}\n\t\n\t\t\t// Main decoding loop: start just after the last delimiter if any basic code\n\t\t\t// points were copied; start at the beginning otherwise.\n\t\n\t\t\tfor (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\t\n\t\t\t\t// `index` is the index of the next character to be consumed.\n\t\t\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t\t\t// which gets added to `i`. The overflow checking is easier\n\t\t\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t\t\t// value at the end to obtain `delta`.\n\t\t\t\tfor (oldi = i, w = 1, k = base; /* no condition */; k += base) {\n\t\n\t\t\t\t\tif (index >= inputLength) {\n\t\t\t\t\t\terror('invalid-input');\n\t\t\t\t\t}\n\t\n\t\t\t\t\tdigit = basicToDigit(input.charCodeAt(index++));\n\t\n\t\t\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\t\t\terror('overflow');\n\t\t\t\t\t}\n\t\n\t\t\t\t\ti += digit * w;\n\t\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\n\t\t\t\t\tif (digit < t) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tbaseMinusT = base - t;\n\t\t\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\t\t\terror('overflow');\n\t\t\t\t\t}\n\t\n\t\t\t\t\tw *= baseMinusT;\n\t\n\t\t\t\t}\n\t\n\t\t\t\tout = output.length + 1;\n\t\t\t\tbias = adapt(i - oldi, out, oldi == 0);\n\t\n\t\t\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t\t\t// incrementing `n` each time, so we'll fix that now:\n\t\t\t\tif (floor(i / out) > maxInt - n) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\t\n\t\t\t\tn += floor(i / out);\n\t\t\t\ti %= out;\n\t\n\t\t\t\t// Insert `n` at position `i` of the output\n\t\t\t\toutput.splice(i++, 0, n);\n\t\n\t\t\t}\n\t\n\t\t\treturn ucs2encode(output);\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a string of Unicode symbols (e.g. a domain name label) to a\n\t\t * Punycode string of ASCII-only symbols.\n\t\t * @memberOf punycode\n\t\t * @param {String} input The string of Unicode symbols.\n\t\t * @returns {String} The resulting Punycode string of ASCII-only symbols.\n\t\t */\n\t\tfunction encode(input) {\n\t\t\tvar n,\n\t\t\t delta,\n\t\t\t handledCPCount,\n\t\t\t basicLength,\n\t\t\t bias,\n\t\t\t j,\n\t\t\t m,\n\t\t\t q,\n\t\t\t k,\n\t\t\t t,\n\t\t\t currentValue,\n\t\t\t output = [],\n\t\t\t /** `inputLength` will hold the number of code points in `input`. */\n\t\t\t inputLength,\n\t\t\t /** Cached calculation results */\n\t\t\t handledCPCountPlusOne,\n\t\t\t baseMinusT,\n\t\t\t qMinusT;\n\t\n\t\t\t// Convert the input in UCS-2 to Unicode\n\t\t\tinput = ucs2decode(input);\n\t\n\t\t\t// Cache the length\n\t\t\tinputLength = input.length;\n\t\n\t\t\t// Initialize the state\n\t\t\tn = initialN;\n\t\t\tdelta = 0;\n\t\t\tbias = initialBias;\n\t\n\t\t\t// Handle the basic code points\n\t\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\t\tcurrentValue = input[j];\n\t\t\t\tif (currentValue < 0x80) {\n\t\t\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\thandledCPCount = basicLength = output.length;\n\t\n\t\t\t// `handledCPCount` is the number of code points that have been handled;\n\t\t\t// `basicLength` is the number of basic code points.\n\t\n\t\t\t// Finish the basic string - if it is not empty - with a delimiter\n\t\t\tif (basicLength) {\n\t\t\t\toutput.push(delimiter);\n\t\t\t}\n\t\n\t\t\t// Main encoding loop:\n\t\t\twhile (handledCPCount < inputLength) {\n\t\n\t\t\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t\t\t// larger one:\n\t\t\t\tfor (m = maxInt, j = 0; j < inputLength; ++j) {\n\t\t\t\t\tcurrentValue = input[j];\n\t\t\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\t\t\tm = currentValue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\t// Increase `delta` enough to advance the decoder's state to ,\n\t\t\t\t// but guard against overflow\n\t\t\t\thandledCPCountPlusOne = handledCPCount + 1;\n\t\t\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\t\n\t\t\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\t\t\tn = m;\n\t\n\t\t\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\t\t\tcurrentValue = input[j];\n\t\n\t\t\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\t\t\terror('overflow');\n\t\t\t\t\t}\n\t\n\t\t\t\t\tif (currentValue == n) {\n\t\t\t\t\t\t// Represent delta as a generalized variable-length integer\n\t\t\t\t\t\tfor (q = delta, k = base; /* no condition */; k += base) {\n\t\t\t\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tqMinusT = q - t;\n\t\t\t\t\t\t\tbaseMinusT = base - t;\n\t\t\t\t\t\t\toutput.push(\n\t\t\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\t\t\tdelta = 0;\n\t\t\t\t\t\t++handledCPCount;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\t++delta;\n\t\t\t\t++n;\n\t\n\t\t\t}\n\t\t\treturn output.join('');\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a Punycode string representing a domain name or an email address\n\t\t * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n\t\t * it doesn't matter if you call it on a string that has already been\n\t\t * converted to Unicode.\n\t\t * @memberOf punycode\n\t\t * @param {String} input The Punycoded domain name or email address to\n\t\t * convert to Unicode.\n\t\t * @returns {String} The Unicode representation of the given Punycode\n\t\t * string.\n\t\t */\n\t\tfunction toUnicode(input) {\n\t\t\treturn mapDomain(input, function(string) {\n\t\t\t\treturn regexPunycode.test(string)\n\t\t\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t\t\t: string;\n\t\t\t});\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a Unicode string representing a domain name or an email address to\n\t\t * Punycode. Only the non-ASCII parts of the domain name will be converted,\n\t\t * i.e. it doesn't matter if you call it with a domain that's already in\n\t\t * ASCII.\n\t\t * @memberOf punycode\n\t\t * @param {String} input The domain name or email address to convert, as a\n\t\t * Unicode string.\n\t\t * @returns {String} The Punycode representation of the given domain name or\n\t\t * email address.\n\t\t */\n\t\tfunction toASCII(input) {\n\t\t\treturn mapDomain(input, function(string) {\n\t\t\t\treturn regexNonASCII.test(string)\n\t\t\t\t\t? 'xn--' + encode(string)\n\t\t\t\t\t: string;\n\t\t\t});\n\t\t}\n\t\n\t\t/*--------------------------------------------------------------------------*/\n\t\n\t\t/** Define the public API */\n\t\tpunycode = {\n\t\t\t/**\n\t\t\t * A string representing the current Punycode.js version number.\n\t\t\t * @memberOf punycode\n\t\t\t * @type String\n\t\t\t */\n\t\t\t'version': '1.3.2',\n\t\t\t/**\n\t\t\t * An object of methods to convert from JavaScript's internal character\n\t\t\t * representation (UCS-2) to Unicode code points, and back.\n\t\t\t * @see \n\t\t\t * @memberOf punycode\n\t\t\t * @type Object\n\t\t\t */\n\t\t\t'ucs2': {\n\t\t\t\t'decode': ucs2decode,\n\t\t\t\t'encode': ucs2encode\n\t\t\t},\n\t\t\t'decode': decode,\n\t\t\t'encode': encode,\n\t\t\t'toASCII': toASCII,\n\t\t\t'toUnicode': toUnicode\n\t\t};\n\t\n\t\t/** Expose `punycode` */\n\t\t// Some AMD build optimizers, like r.js, check for specific condition patterns\n\t\t// like the following:\n\t\tif (\n\t\t\ttrue\n\t\t) {\n\t\t\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function() {\n\t\t\t\treturn punycode;\n\t\t\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t\t} else if (freeExports && freeModule) {\n\t\t\tif (module.exports == freeExports) { // in Node.js or RingoJS v0.8.0+\n\t\t\t\tfreeModule.exports = punycode;\n\t\t\t} else { // in Narwhal or RingoJS v0.7.0-\n\t\t\t\tfor (key in punycode) {\n\t\t\t\t\tpunycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]);\n\t\t\t\t}\n\t\t\t}\n\t\t} else { // in Rhino or a web browser\n\t\t\troot.punycode = punycode;\n\t\t}\n\t\n\t}(this));\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(18)(module), (function() { return this; }())))\n\n/***/ },\n/* 18 */\n/***/ function(module, exports) {\n\n\tmodule.exports = function(module) {\r\n\t\tif(!module.webpackPolyfill) {\r\n\t\t\tmodule.deprecate = function() {};\r\n\t\t\tmodule.paths = [];\r\n\t\t\t// module.parent = undefined by default\r\n\t\t\tmodule.children = [];\r\n\t\t\tmodule.webpackPolyfill = 1;\r\n\t\t}\r\n\t\treturn module;\r\n\t}\r\n\n\n/***/ },\n/* 19 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = {\n\t isString: function(arg) {\n\t return typeof(arg) === 'string';\n\t },\n\t isObject: function(arg) {\n\t return typeof(arg) === 'object' && arg !== null;\n\t },\n\t isNull: function(arg) {\n\t return arg === null;\n\t },\n\t isNullOrUndefined: function(arg) {\n\t return arg == null;\n\t }\n\t};\n\n\n/***/ },\n/* 20 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\texports.decode = exports.parse = __webpack_require__(21);\n\texports.encode = exports.stringify = __webpack_require__(22);\n\n\n/***/ },\n/* 21 */\n/***/ function(module, exports) {\n\n\t// Copyright Joyent, Inc. and other Node contributors.\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a\n\t// copy of this software and associated documentation files (the\n\t// \"Software\"), to deal in the Software without restriction, including\n\t// without limitation the rights to use, copy, modify, merge, publish,\n\t// distribute, sublicense, and/or sell copies of the Software, and to permit\n\t// persons to whom the Software is furnished to do so, subject to the\n\t// following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included\n\t// in all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n\t// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\t// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n\t// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n\t// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n\t// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n\t// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\t\n\t'use strict';\n\t\n\t// If obj.hasOwnProperty has been overridden, then calling\n\t// obj.hasOwnProperty(prop) will break.\n\t// See: https://github.com/joyent/node/issues/1707\n\tfunction hasOwnProperty(obj, prop) {\n\t return Object.prototype.hasOwnProperty.call(obj, prop);\n\t}\n\t\n\tmodule.exports = function(qs, sep, eq, options) {\n\t sep = sep || '&';\n\t eq = eq || '=';\n\t var obj = {};\n\t\n\t if (typeof qs !== 'string' || qs.length === 0) {\n\t return obj;\n\t }\n\t\n\t var regexp = /\\+/g;\n\t qs = qs.split(sep);\n\t\n\t var maxKeys = 1000;\n\t if (options && typeof options.maxKeys === 'number') {\n\t maxKeys = options.maxKeys;\n\t }\n\t\n\t var len = qs.length;\n\t // maxKeys <= 0 means that we should not limit keys count\n\t if (maxKeys > 0 && len > maxKeys) {\n\t len = maxKeys;\n\t }\n\t\n\t for (var i = 0; i < len; ++i) {\n\t var x = qs[i].replace(regexp, '%20'),\n\t idx = x.indexOf(eq),\n\t kstr, vstr, k, v;\n\t\n\t if (idx >= 0) {\n\t kstr = x.substr(0, idx);\n\t vstr = x.substr(idx + 1);\n\t } else {\n\t kstr = x;\n\t vstr = '';\n\t }\n\t\n\t k = decodeURIComponent(kstr);\n\t v = decodeURIComponent(vstr);\n\t\n\t if (!hasOwnProperty(obj, k)) {\n\t obj[k] = v;\n\t } else if (Array.isArray(obj[k])) {\n\t obj[k].push(v);\n\t } else {\n\t obj[k] = [obj[k], v];\n\t }\n\t }\n\t\n\t return obj;\n\t};\n\n\n/***/ },\n/* 22 */\n/***/ function(module, exports) {\n\n\t// Copyright Joyent, Inc. and other Node contributors.\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a\n\t// copy of this software and associated documentation files (the\n\t// \"Software\"), to deal in the Software without restriction, including\n\t// without limitation the rights to use, copy, modify, merge, publish,\n\t// distribute, sublicense, and/or sell copies of the Software, and to permit\n\t// persons to whom the Software is furnished to do so, subject to the\n\t// following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included\n\t// in all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n\t// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\t// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n\t// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n\t// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n\t// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n\t// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\t\n\t'use strict';\n\t\n\tvar stringifyPrimitive = function(v) {\n\t switch (typeof v) {\n\t case 'string':\n\t return v;\n\t\n\t case 'boolean':\n\t return v ? 'true' : 'false';\n\t\n\t case 'number':\n\t return isFinite(v) ? v : '';\n\t\n\t default:\n\t return '';\n\t }\n\t};\n\t\n\tmodule.exports = function(obj, sep, eq, name) {\n\t sep = sep || '&';\n\t eq = eq || '=';\n\t if (obj === null) {\n\t obj = undefined;\n\t }\n\t\n\t if (typeof obj === 'object') {\n\t return Object.keys(obj).map(function(k) {\n\t var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;\n\t if (Array.isArray(obj[k])) {\n\t return obj[k].map(function(v) {\n\t return ks + encodeURIComponent(stringifyPrimitive(v));\n\t }).join(sep);\n\t } else {\n\t return ks + encodeURIComponent(stringifyPrimitive(obj[k]));\n\t }\n\t }).join(sep);\n\t\n\t }\n\t\n\t if (!name) return '';\n\t return encodeURIComponent(stringifyPrimitive(name)) + eq +\n\t encodeURIComponent(stringifyPrimitive(obj));\n\t};\n\n\n/***/ },\n/* 23 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"id\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"description\": \"Core schema meta-schema\",\n\t\t\"definitions\": {\n\t\t\t\"schemaArray\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"minItems\": 1,\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"positiveInteger\": {\n\t\t\t\t\"type\": \"integer\",\n\t\t\t\t\"minimum\": 0\n\t\t\t},\n\t\t\t\"positiveIntegerDefault0\": {\n\t\t\t\t\"allOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#/definitions/positiveInteger\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"default\": 0\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"simpleTypes\": {\n\t\t\t\t\"enum\": [\n\t\t\t\t\t\"array\",\n\t\t\t\t\t\"boolean\",\n\t\t\t\t\t\"integer\",\n\t\t\t\t\t\"null\",\n\t\t\t\t\t\"number\",\n\t\t\t\t\t\"object\",\n\t\t\t\t\t\"string\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"stringArray\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t},\n\t\t\t\t\"minItems\": 1,\n\t\t\t\t\"uniqueItems\": true\n\t\t\t}\n\t\t},\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"id\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"uri\"\n\t\t\t},\n\t\t\t\"$schema\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"uri\"\n\t\t\t},\n\t\t\t\"title\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"description\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"default\": {},\n\t\t\t\"multipleOf\": {\n\t\t\t\t\"type\": \"number\",\n\t\t\t\t\"minimum\": 0,\n\t\t\t\t\"exclusiveMinimum\": true\n\t\t\t},\n\t\t\t\"maximum\": {\n\t\t\t\t\"type\": \"number\"\n\t\t\t},\n\t\t\t\"exclusiveMaximum\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"minimum\": {\n\t\t\t\t\"type\": \"number\"\n\t\t\t},\n\t\t\t\"exclusiveMinimum\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"maxLength\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveInteger\"\n\t\t\t},\n\t\t\t\"minLength\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveIntegerDefault0\"\n\t\t\t},\n\t\t\t\"pattern\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"regex\"\n\t\t\t},\n\t\t\t\"additionalItems\": {\n\t\t\t\t\"anyOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"boolean\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"items\": {\n\t\t\t\t\"anyOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#/definitions/schemaArray\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"maxItems\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveInteger\"\n\t\t\t},\n\t\t\t\"minItems\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveIntegerDefault0\"\n\t\t\t},\n\t\t\t\"uniqueItems\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"maxProperties\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveInteger\"\n\t\t\t},\n\t\t\t\"minProperties\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveIntegerDefault0\"\n\t\t\t},\n\t\t\t\"required\": {\n\t\t\t\t\"$ref\": \"#/definitions/stringArray\"\n\t\t\t},\n\t\t\t\"additionalProperties\": {\n\t\t\t\t\"anyOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"boolean\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"definitions\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": {\n\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t},\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"properties\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": {\n\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t},\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"patternProperties\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": {\n\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t},\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"dependencies\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": {\n\t\t\t\t\t\"anyOf\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"$ref\": \"#/definitions/stringArray\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"enum\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"minItems\": 1,\n\t\t\t\t\"uniqueItems\": true\n\t\t\t},\n\t\t\t\"type\": {\n\t\t\t\t\"anyOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#/definitions/simpleTypes\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"array\",\n\t\t\t\t\t\t\"items\": {\n\t\t\t\t\t\t\t\"$ref\": \"#/definitions/simpleTypes\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"minItems\": 1,\n\t\t\t\t\t\t\"uniqueItems\": true\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"allOf\": {\n\t\t\t\t\"$ref\": \"#/definitions/schemaArray\"\n\t\t\t},\n\t\t\t\"anyOf\": {\n\t\t\t\t\"$ref\": \"#/definitions/schemaArray\"\n\t\t\t},\n\t\t\t\"oneOf\": {\n\t\t\t\t\"$ref\": \"#/definitions/schemaArray\"\n\t\t\t},\n\t\t\t\"not\": {\n\t\t\t\t\"$ref\": \"#\"\n\t\t\t}\n\t\t},\n\t\t\"dependencies\": {\n\t\t\t\"exclusiveMaximum\": [\n\t\t\t\t\"maximum\"\n\t\t\t],\n\t\t\t\"exclusiveMinimum\": [\n\t\t\t\t\"minimum\"\n\t\t\t]\n\t\t},\n\t\t\"default\": {}\n\t};\n\n/***/ },\n/* 24 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tvar formats = {};\n\t\n\t// reference: http://dansnetwork.com/javascript-iso8601rfc3339-date-parser/\n\tformats['date-time'] = /(\\d\\d\\d\\d)(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))/;\n\t// reference: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js#L7\n\tformats.uri = /^([a-zA-Z][a-zA-Z0-9+-.]*:){0,1}\\/\\/[^\\s]*$/;\n\t// reference: http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363\n\t// http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'willful violation')\n\tformats.email = /^[a-zA-Z0-9.!#$%&'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n\t// reference: https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html\n\tformats.ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;\n\t// reference: http://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses\n\tformats.ipv6 = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|[fF][eE]80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::([fF]{4}(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;\n\t// reference: http://stackoverflow.com/questions/106179/regular-expression-to-match-dns-hostname-or-ip-address#answer-3824105\n\tformats.hostname = /^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])(\\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]))*$/;\n\t\n\tmodule.exports = formats;\n\n/***/ },\n/* 25 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\t// Reference: https://github.com/bestiejs/punycode.js/blob/master/punycode.js#L101`\n\t// Info: https://mathiasbynens.be/notes/javascript-unicode\n\tfunction ucs2length(string) {\n\t var ucs2len = 0,\n\t counter = 0,\n\t length = string.length,\n\t value, extra;\n\t\n\t while (counter < length) {\n\t ucs2len++;\n\t value = string.charCodeAt(counter++);\n\t\n\t if (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t // It's a high surrogate, and there is a next character.\n\t extra = string.charCodeAt(counter++);\n\t\n\t if ((extra & 0xFC00) !== 0xDC00) { /* Low surrogate. */ // jshint ignore: line\n\t counter--;\n\t }\n\t }\n\t }\n\t\n\t return ucs2len;\n\t}\n\t\n\tmodule.exports = ucs2length;\n\n/***/ }\n/******/ ])\n});\n;\n//# sourceMappingURL=models.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/powerbi-models/dist/models.js\n// module id = 5\n// module chunks = 0","import { IFilterable } from './ifilterable';\r\nimport { IReportNode } from './report';\r\nimport * as models from 'powerbi-models';\r\n\r\n/**\r\n * A Page node within a report hierarchy\r\n * \r\n * @export\r\n * @interface IPageNode\r\n */\r\nexport interface IPageNode {\r\n report: IReportNode;\r\n name: string;\r\n}\r\n\r\n/**\r\n * A Power BI report page\r\n * \r\n * @export\r\n * @class Page\r\n * @implements {IPageNode}\r\n * @implements {IFilterable}\r\n */\r\nexport class Page implements IPageNode, IFilterable {\r\n /**\r\n * The parent Power BI report that this page is a member of\r\n * \r\n * @type {IReportNode}\r\n */\r\n report: IReportNode;\r\n /**\r\n * The report page name\r\n * \r\n * @type {string}\r\n */\r\n name: string;\r\n\r\n /**\r\n * The user defined display name of the report page, which is undefined if the page is created manually\r\n * \r\n * @type {string}\r\n */\r\n displayName: string;\r\n\r\n /**\r\n * Creates an instance of a Power BI report page.\r\n * \r\n * @param {IReportNode} report\r\n * @param {string} name\r\n * @param {string} [displayName]\r\n */\r\n constructor(report: IReportNode, name: string, displayName?: string) {\r\n this.report = report;\r\n this.name = name;\r\n this.displayName = displayName;\r\n }\r\n\r\n /**\r\n * Gets all page level filters within the report.\r\n * \r\n * ```javascript\r\n * page.getFilters()\r\n * .then(pages => { ... });\r\n * ```\r\n * \r\n * @returns {(Promise)}\r\n */\r\n getFilters(): Promise {\r\n return this.report.service.hpm.get(`/report/pages/${this.name}/filters`, { uid: this.report.config.uniqueId }, this.report.iframe.contentWindow)\r\n .then(response => response.body,\r\n response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Removes all filters from this page of the report.\r\n * \r\n * ```javascript\r\n * page.removeFilters();\r\n * ```\r\n * \r\n * @returns {Promise}\r\n */\r\n removeFilters(): Promise {\r\n return this.setFilters([]);\r\n }\r\n\r\n /**\r\n * Makes the current page the active page of the report.\r\n * \r\n * ```javascripot\r\n * page.setActive();\r\n * ```\r\n * \r\n * @returns {Promise}\r\n */\r\n setActive(): Promise {\r\n const page: models.IPage = {\r\n name: this.name,\r\n displayName: null\r\n };\r\n\r\n return this.report.service.hpm.put('/report/pages/active', page, { uid: this.report.config.uniqueId }, this.report.iframe.contentWindow)\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Sets all filters on the current page.\r\n * \r\n * ```javascript\r\n * page.setFilters(filters);\r\n * .catch(errors => { ... });\r\n * ```\r\n * \r\n * @param {(models.IFilter[])} filters\r\n * @returns {Promise}\r\n */\r\n setFilters(filters: models.IFilter[]): Promise {\r\n return this.report.service.hpm.put(`/report/pages/${this.name}/filters`, filters, { uid: this.report.config.uniqueId }, this.report.iframe.contentWindow)\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/page.ts","import * as service from './service';\r\nimport * as models from 'powerbi-models';\r\nimport * as embed from './embed';\r\n\r\nexport class Create extends embed.Embed {\r\n\r\n constructor(service: service.Service, element: HTMLElement, config: embed.IEmbedConfiguration) {\r\n super(service, element, config);\r\n }\r\n\r\n /**\r\n * Gets the dataset ID from the first available location: createConfig or embed url.\r\n * \r\n * @returns {string}\r\n */\r\n getId(): string {\r\n const datasetId = (this.createConfig && this.createConfig.datasetId) ? this.createConfig.datasetId : Create.findIdFromEmbedUrl(this.config.embedUrl);\r\n\r\n if (typeof datasetId !== 'string' || datasetId.length === 0) {\r\n throw new Error('Dataset id is required, but it was not found. You must provide an id either as part of embed configuration.');\r\n }\r\n\r\n return datasetId;\r\n }\r\n\r\n /**\r\n * Validate create report configuration.\r\n */\r\n validate(config: models.IReportCreateConfiguration): models.IError[] {\r\n return models.validateCreateReport(config);\r\n }\r\n\r\n /**\r\n * Adds the ability to get datasetId from url. \r\n * (e.g. http://embedded.powerbi.com/appTokenReportEmbed?datasetId=854846ed-2106-4dc2-bc58-eb77533bf2f1).\r\n * \r\n * By extracting the ID we can ensure that the ID is always explicitly provided as part of the create configuration.\r\n * \r\n * @static\r\n * @param {string} url\r\n * @returns {string}\r\n */\r\n static findIdFromEmbedUrl(url: string): string {\r\n const datasetIdRegEx = /datasetId=\"?([^&]+)\"?/\r\n const datasetIdMatch = url.match(datasetIdRegEx);\r\n\r\n let datasetId;\r\n if (datasetIdMatch) {\r\n datasetId = datasetIdMatch[1];\r\n }\r\n\r\n return datasetId;\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/create.ts","import * as service from './service';\r\nimport * as embed from './embed';\r\nimport * as models from 'powerbi-models';\r\nimport * as wpmp from 'window-post-message-proxy';\r\nimport * as hpm from 'http-post-message';\r\nimport * as utils from './util';\r\n\r\n/**\r\n * A Dashboard node within a dashboard hierarchy\r\n * \r\n * @export\r\n * @interface IDashboardNode\r\n */\r\nexport interface IDashboardNode {\r\n iframe: HTMLIFrameElement;\r\n service: service.IService;\r\n config: embed.IInternalEmbedConfiguration\r\n}\r\n\r\n/**\r\n * A Power BI Dashboard embed component\r\n * \r\n * @export\r\n * @class Dashboard\r\n * @extends {embed.Embed}\r\n * @implements {IDashboardNode}\r\n * @implements {IFilterable}\r\n */\r\nexport class Dashboard extends embed.Embed implements IDashboardNode {\r\n static allowedEvents = [\"tileClicked\", \"error\"];\r\n static dashboardIdAttribute = 'powerbi-dashboard-id';\r\n static typeAttribute = 'powerbi-type';\r\n static type = \"Dashboard\";\r\n\r\n /**\r\n * Creates an instance of a Power BI Dashboard.\r\n * \r\n * @param {service.Service} service\r\n * @param {HTMLElement} element\r\n */\r\n constructor(service: service.Service, element: HTMLElement, config: embed.IEmbedConfiguration) {\r\n super(service, element, config);\r\n this.loadPath = \"/dashboard/load\";\r\n Array.prototype.push.apply(this.allowedEvents, Dashboard.allowedEvents);\r\n }\r\n\r\n /**\r\n * This adds backwards compatibility for older config which used the dashboardId query param to specify dashboard id.\r\n * E.g. https://powerbi-df.analysis-df.windows.net/dashboardEmbedHost?dashboardId=e9363c62-edb6-4eac-92d3-2199c5ca2a9e\r\n * \r\n * By extracting the id we can ensure id is always explicitly provided as part of the load configuration.\r\n * \r\n * @static\r\n * @param {string} url\r\n * @returns {string}\r\n */\r\n static findIdFromEmbedUrl(url: string): string {\r\n const dashboardIdRegEx = /dashboardId=\"?([^&]+)\"?/\r\n const dashboardIdMatch = url.match(dashboardIdRegEx);\r\n\r\n let dashboardId;\r\n if (dashboardIdMatch) {\r\n dashboardId = dashboardIdMatch[1];\r\n }\r\n\r\n return dashboardId;\r\n }\r\n\r\n /**\r\n * Get dashboard id from first available location: options, attribute, embed url.\r\n * \r\n * @returns {string}\r\n */\r\n getId(): string {\r\n const dashboardId = this.config.id || this.element.getAttribute(Dashboard.dashboardIdAttribute) || Dashboard.findIdFromEmbedUrl(this.config.embedUrl);\r\n\r\n if (typeof dashboardId !== 'string' || dashboardId.length === 0) {\r\n throw new Error(`Dashboard id is required, but it was not found. You must provide an id either as part of embed configuration or as attribute '${Dashboard.dashboardIdAttribute}'.`);\r\n }\r\n\r\n return dashboardId;\r\n }\r\n\r\n /**\r\n * Validate load configuration.\r\n */\r\n validate(config: models.IDashboardLoadConfiguration): models.IError[] {\r\n let error = models.validateDashboardLoad(config);\r\n return error ? error : this.ValidatePageView(config.pageView);\r\n }\r\n \r\n /**\r\n * Validate that pageView has a legal value: if page view is defined it must have one of the values defined in models.PageView\r\n */\r\n private ValidatePageView(pageView: models.PageView): models.IError[] {\r\n if (pageView && pageView !== \"fitToWidth\" && pageView !== \"oneColumn\" && pageView !== \"actualSize\") {\r\n return [{message: \"pageView must be one of the followings: fitToWidth, oneColumn, actualSize\"}];\r\n }\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/dashboard.ts","import * as models from 'powerbi-models';\r\nimport { Embed } from './embed';\r\n\r\n/**\r\n * The Power BI tile embed component\r\n * \r\n * @export\r\n * @class Tile\r\n * @extends {Embed}\r\n */\r\nexport class Tile extends Embed {\r\n static type = \"Tile\";\r\n\r\n /**\r\n * The ID of the tile\r\n * \r\n * @returns {string}\r\n */\r\n getId(): string {\r\n throw new Error('Not implemented. Embedding tiles is not supported yet.');\r\n }\r\n\r\n /**\r\n * Validate load configuration.\r\n */\r\n validate(config: any): models.IError[] {\r\n throw new Error('Not implemented. Embedding tiles is not supported yet.');\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/tile.ts","/**\r\n * TODO: Need to find better place for these factory functions or refactor how we handle dependency injection\r\n */\r\nimport { IHpmFactory, IWpmpFactory, IRouterFactory } from './service';\r\nimport config from './config';\r\nimport * as wpmp from 'window-post-message-proxy';\r\nimport * as hpm from 'http-post-message';\r\nimport * as router from 'powerbi-router';\r\n\r\nexport {\r\n IHpmFactory,\r\n IWpmpFactory,\r\n IRouterFactory\r\n};\r\n\r\nexport const hpmFactory: IHpmFactory = (wpmp, defaultTargetWindow, sdkVersion = config.version, sdkType = config.type) => {\r\n return new hpm.HttpPostMessage(wpmp, {\r\n 'x-sdk-type': sdkType,\r\n 'x-sdk-version': sdkVersion\r\n }, defaultTargetWindow);\r\n};\r\n\r\nexport const wpmpFactory: IWpmpFactory = (name?: string, logMessages?: boolean, eventSourceOverrideWindow?: Window) => {\r\n return new wpmp.WindowPostMessageProxy({\r\n processTrackingProperties: {\r\n addTrackingProperties: hpm.HttpPostMessage.addTrackingProperties,\r\n getTrackingProperties: hpm.HttpPostMessage.getTrackingProperties,\r\n },\r\n isErrorMessage: hpm.HttpPostMessage.isErrorMessage,\r\n name,\r\n logMessages,\r\n eventSourceOverrideWindow\r\n });\r\n};\r\n\r\nexport const routerFactory: IRouterFactory = (wpmp) => {\r\n return new router.Router(wpmp);\r\n};\n\n\n// WEBPACK FOOTER //\n// ./src/factories.ts","const config = {\r\n version: '2.2.3',\r\n type: 'js'\r\n};\r\n\r\nexport default config;\n\n\n// WEBPACK FOOTER //\n// ./src/config.ts","/*! window-post-message-proxy v0.2.4 | (c) 2016 Microsoft Corporation MIT */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"window-post-message-proxy\"] = factory();\n\telse\n\t\troot[\"window-post-message-proxy\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\tvar WindowPostMessageProxy = (function () {\n\t function WindowPostMessageProxy(options) {\n\t var _this = this;\n\t if (options === void 0) { options = {\n\t processTrackingProperties: {\n\t addTrackingProperties: WindowPostMessageProxy.defaultAddTrackingProperties,\n\t getTrackingProperties: WindowPostMessageProxy.defaultGetTrackingProperties\n\t },\n\t isErrorMessage: WindowPostMessageProxy.defaultIsErrorMessage,\n\t receiveWindow: window,\n\t name: WindowPostMessageProxy.createRandomString()\n\t }; }\n\t this.pendingRequestPromises = {};\n\t // save options with defaults\n\t this.addTrackingProperties = (options.processTrackingProperties && options.processTrackingProperties.addTrackingProperties) || WindowPostMessageProxy.defaultAddTrackingProperties;\n\t this.getTrackingProperties = (options.processTrackingProperties && options.processTrackingProperties.getTrackingProperties) || WindowPostMessageProxy.defaultGetTrackingProperties;\n\t this.isErrorMessage = options.isErrorMessage || WindowPostMessageProxy.defaultIsErrorMessage;\n\t this.receiveWindow = options.receiveWindow || window;\n\t this.name = options.name || WindowPostMessageProxy.createRandomString();\n\t this.logMessages = options.logMessages || false;\n\t this.eventSourceOverrideWindow = options.eventSourceOverrideWindow;\n\t this.suppressWarnings = options.suppressWarnings || false;\n\t if (this.logMessages) {\n\t console.log(\"new WindowPostMessageProxy created with name: \" + this.name + \" receiving on window: \" + this.receiveWindow.document.title);\n\t }\n\t // Initialize\n\t this.handlers = [];\n\t this.windowMessageHandler = function (event) { return _this.onMessageReceived(event); };\n\t this.start();\n\t }\n\t // Static\n\t WindowPostMessageProxy.defaultAddTrackingProperties = function (message, trackingProperties) {\n\t message[WindowPostMessageProxy.messagePropertyName] = trackingProperties;\n\t return message;\n\t };\n\t WindowPostMessageProxy.defaultGetTrackingProperties = function (message) {\n\t return message[WindowPostMessageProxy.messagePropertyName];\n\t };\n\t WindowPostMessageProxy.defaultIsErrorMessage = function (message) {\n\t return !!message.error;\n\t };\n\t /**\n\t * Utility to create a deferred object.\n\t */\n\t // TODO: Look to use RSVP library instead of doing this manually.\n\t // From what I searched RSVP would work better because it has .finally and .deferred; however, it doesn't have Typings information. \n\t WindowPostMessageProxy.createDeferred = function () {\n\t var deferred = {\n\t resolve: null,\n\t reject: null,\n\t promise: null\n\t };\n\t var promise = new Promise(function (resolve, reject) {\n\t deferred.resolve = resolve;\n\t deferred.reject = reject;\n\t });\n\t deferred.promise = promise;\n\t return deferred;\n\t };\n\t /**\n\t * Utility to generate random sequence of characters used as tracking id for promises.\n\t */\n\t WindowPostMessageProxy.createRandomString = function () {\n\t return (Math.random() + 1).toString(36).substring(7);\n\t };\n\t /**\n\t * Adds handler.\n\t * If the first handler whose test method returns true will handle the message and provide a response.\n\t */\n\t WindowPostMessageProxy.prototype.addHandler = function (handler) {\n\t this.handlers.push(handler);\n\t };\n\t /**\n\t * Removes handler.\n\t * The reference must match the original object that was provided when adding the handler.\n\t */\n\t WindowPostMessageProxy.prototype.removeHandler = function (handler) {\n\t var handlerIndex = this.handlers.indexOf(handler);\n\t if (handlerIndex === -1) {\n\t throw new Error(\"You attempted to remove a handler but no matching handler was found.\");\n\t }\n\t this.handlers.splice(handlerIndex, 1);\n\t };\n\t /**\n\t * Start listening to message events.\n\t */\n\t WindowPostMessageProxy.prototype.start = function () {\n\t this.receiveWindow.addEventListener('message', this.windowMessageHandler);\n\t };\n\t /**\n\t * Stops listening to message events.\n\t */\n\t WindowPostMessageProxy.prototype.stop = function () {\n\t this.receiveWindow.removeEventListener('message', this.windowMessageHandler);\n\t };\n\t /**\n\t * Post message to target window with tracking properties added and save deferred object referenced by tracking id.\n\t */\n\t WindowPostMessageProxy.prototype.postMessage = function (targetWindow, message) {\n\t // Add tracking properties to indicate message came from this proxy\n\t var trackingProperties = { id: WindowPostMessageProxy.createRandomString() };\n\t this.addTrackingProperties(message, trackingProperties);\n\t if (this.logMessages) {\n\t console.log(this.name + \" Posting message:\");\n\t console.log(JSON.stringify(message, null, ' '));\n\t }\n\t targetWindow.postMessage(message, \"*\");\n\t var deferred = WindowPostMessageProxy.createDeferred();\n\t this.pendingRequestPromises[trackingProperties.id] = deferred;\n\t return deferred.promise;\n\t };\n\t /**\n\t * Send response message to target window.\n\t * Response messages re-use tracking properties from a previous request message.\n\t */\n\t WindowPostMessageProxy.prototype.sendResponse = function (targetWindow, message, trackingProperties) {\n\t this.addTrackingProperties(message, trackingProperties);\n\t if (this.logMessages) {\n\t console.log(this.name + \" Sending response:\");\n\t console.log(JSON.stringify(message, null, ' '));\n\t }\n\t targetWindow.postMessage(message, \"*\");\n\t };\n\t /**\n\t * Message handler.\n\t */\n\t WindowPostMessageProxy.prototype.onMessageReceived = function (event) {\n\t var _this = this;\n\t if (this.logMessages) {\n\t console.log(this.name + \" Received message:\");\n\t console.log(\"type: \" + event.type);\n\t console.log(JSON.stringify(event.data, null, ' '));\n\t }\n\t var sendingWindow = this.eventSourceOverrideWindow || event.source;\n\t var message = event.data;\n\t if (typeof message !== \"object\") {\n\t if (!this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + this.name + \"): Received message that was not an object. Discarding message\");\n\t }\n\t return;\n\t }\n\t var trackingProperties;\n\t try {\n\t trackingProperties = this.getTrackingProperties(message);\n\t }\n\t catch (e) {\n\t if (!this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + this.name + \"): Error occurred when attempting to get tracking properties from incoming message:\", JSON.stringify(message, null, ' '), \"Error: \", e);\n\t }\n\t }\n\t var deferred;\n\t if (trackingProperties) {\n\t deferred = this.pendingRequestPromises[trackingProperties.id];\n\t }\n\t // If message does not have a known ID, treat it as a request\n\t // Otherwise, treat message as response\n\t if (!deferred) {\n\t var handled = this.handlers.some(function (handler) {\n\t var canMessageBeHandled = false;\n\t try {\n\t canMessageBeHandled = handler.test(message);\n\t }\n\t catch (e) {\n\t if (!_this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + _this.name + \"): Error occurred when handler was testing incoming message:\", JSON.stringify(message, null, ' '), \"Error: \", e);\n\t }\n\t }\n\t if (canMessageBeHandled) {\n\t var responseMessagePromise = void 0;\n\t try {\n\t responseMessagePromise = Promise.resolve(handler.handle(message));\n\t }\n\t catch (e) {\n\t if (!_this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + _this.name + \"): Error occurred when handler was processing incoming message:\", JSON.stringify(message, null, ' '), \"Error: \", e);\n\t }\n\t responseMessagePromise = Promise.resolve();\n\t }\n\t responseMessagePromise\n\t .then(function (responseMessage) {\n\t if (!responseMessage) {\n\t var warningMessage = \"Handler for message: \" + JSON.stringify(message, null, ' ') + \" did not return a response message. The default response message will be returned instead.\";\n\t if (!_this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + _this.name + \"): \" + warningMessage);\n\t }\n\t responseMessage = {\n\t warning: warningMessage\n\t };\n\t }\n\t _this.sendResponse(sendingWindow, responseMessage, trackingProperties);\n\t });\n\t return true;\n\t }\n\t });\n\t /**\n\t * TODO: Consider returning an error message if nothing handled the message.\n\t * In the case of the Report receiving messages all of them should be handled,\n\t * however, in the case of the SDK receiving messages it's likely it won't register handlers\n\t * for all events. Perhaps make this an option at construction time.\n\t */\n\t if (!handled && !this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + this.name + \") did not handle message. Handlers: \" + this.handlers.length + \" Message: \" + JSON.stringify(message, null, '') + \".\");\n\t }\n\t }\n\t else {\n\t /**\n\t * If error message reject promise,\n\t * Otherwise, resolve promise\n\t */\n\t var isErrorMessage = true;\n\t try {\n\t isErrorMessage = this.isErrorMessage(message);\n\t }\n\t catch (e) {\n\t console.warn(\"Proxy(\" + this.name + \") Error occurred when trying to determine if message is consider an error response. Message: \", JSON.stringify(message, null, ''), 'Error: ', e);\n\t }\n\t if (isErrorMessage) {\n\t deferred.reject(message);\n\t }\n\t else {\n\t deferred.resolve(message);\n\t }\n\t // TODO: Move to .finally clause up where promise is created for better maitenance like original proxy code.\n\t delete this.pendingRequestPromises[trackingProperties.id];\n\t }\n\t };\n\t WindowPostMessageProxy.messagePropertyName = \"windowPostMessageProxy\";\n\t return WindowPostMessageProxy;\n\t}());\n\texports.WindowPostMessageProxy = WindowPostMessageProxy;\n\n\n/***/ }\n/******/ ])\n});\n;\n//# sourceMappingURL=windowPostMessageProxy.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/window-post-message-proxy/dist/windowPostMessageProxy.js\n// module id = 12\n// module chunks = 0","/*! http-post-message v0.2.3 | (c) 2016 Microsoft Corporation MIT */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"http-post-message\"] = factory();\n\telse\n\t\troot[\"http-post-message\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\tvar HttpPostMessage = (function () {\n\t function HttpPostMessage(windowPostMessageProxy, defaultHeaders, defaultTargetWindow) {\n\t if (defaultHeaders === void 0) { defaultHeaders = {}; }\n\t this.defaultHeaders = defaultHeaders;\n\t this.defaultTargetWindow = defaultTargetWindow;\n\t this.windowPostMessageProxy = windowPostMessageProxy;\n\t }\n\t // TODO: See if it's possible to share tracking properties interface?\n\t // The responsibility of knowing how to configure windowPostMessageProxy for http should\n\t // live in this http class, but the configuration would need ITrackingProperties\n\t // interface which lives in WindowPostMessageProxy. Use type as workaround\n\t HttpPostMessage.addTrackingProperties = function (message, trackingProperties) {\n\t message.headers = message.headers || {};\n\t if (trackingProperties && trackingProperties.id) {\n\t message.headers.id = trackingProperties.id;\n\t }\n\t return message;\n\t };\n\t HttpPostMessage.getTrackingProperties = function (message) {\n\t return {\n\t id: message.headers && message.headers.id\n\t };\n\t };\n\t HttpPostMessage.isErrorMessage = function (message) {\n\t if (typeof (message && message.statusCode) !== 'number') {\n\t return false;\n\t }\n\t return !(200 <= message.statusCode && message.statusCode < 300);\n\t };\n\t HttpPostMessage.prototype.get = function (url, headers, targetWindow) {\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"GET\",\n\t url: url,\n\t headers: headers\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.post = function (url, body, headers, targetWindow) {\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"POST\",\n\t url: url,\n\t headers: headers,\n\t body: body\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.put = function (url, body, headers, targetWindow) {\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"PUT\",\n\t url: url,\n\t headers: headers,\n\t body: body\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.patch = function (url, body, headers, targetWindow) {\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"PATCH\",\n\t url: url,\n\t headers: headers,\n\t body: body\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.delete = function (url, body, headers, targetWindow) {\n\t if (body === void 0) { body = null; }\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"DELETE\",\n\t url: url,\n\t headers: headers,\n\t body: body\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.send = function (request, targetWindow) {\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t request.headers = this.assign({}, this.defaultHeaders, request.headers);\n\t if (!targetWindow) {\n\t throw new Error(\"target window is not provided. You must either provide the target window explicitly as argument to request, or specify default target window when constructing instance of this class.\");\n\t }\n\t return this.windowPostMessageProxy.postMessage(targetWindow, request);\n\t };\n\t /**\n\t * Object.assign() polyfill\n\t * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\n\t */\n\t HttpPostMessage.prototype.assign = function (target) {\n\t var sources = [];\n\t for (var _i = 1; _i < arguments.length; _i++) {\n\t sources[_i - 1] = arguments[_i];\n\t }\n\t if (target === undefined || target === null) {\n\t throw new TypeError('Cannot convert undefined or null to object');\n\t }\n\t var output = Object(target);\n\t sources.forEach(function (source) {\n\t if (source !== undefined && source !== null) {\n\t for (var nextKey in source) {\n\t if (Object.prototype.hasOwnProperty.call(source, nextKey)) {\n\t output[nextKey] = source[nextKey];\n\t }\n\t }\n\t }\n\t });\n\t return output;\n\t };\n\t return HttpPostMessage;\n\t}());\n\texports.HttpPostMessage = HttpPostMessage;\n\n\n/***/ }\n/******/ ])\n});\n;\n//# sourceMappingURL=httpPostMessage.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/http-post-message/dist/httpPostMessage.js\n// module id = 13\n// module chunks = 0","/*! powerbi-router v0.1.5 | (c) 2016 Microsoft Corporation MIT */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"powerbi-router\"] = factory();\n\telse\n\t\troot[\"powerbi-router\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar RouteRecognizer = __webpack_require__(1);\n\tvar Router = (function () {\n\t function Router(handlers) {\n\t this.handlers = handlers;\n\t /**\n\t * TODO: look at generating the router dynamically based on list of supported http methods\n\t * instead of hardcoding the creation of these and the methods.\n\t */\n\t this.getRouteRecognizer = new RouteRecognizer();\n\t this.patchRouteRecognizer = new RouteRecognizer();\n\t this.postRouteRecognizer = new RouteRecognizer();\n\t this.putRouteRecognizer = new RouteRecognizer();\n\t this.deleteRouteRecognizer = new RouteRecognizer();\n\t }\n\t Router.prototype.get = function (url, handler) {\n\t this.registerHandler(this.getRouteRecognizer, \"GET\", url, handler);\n\t return this;\n\t };\n\t Router.prototype.patch = function (url, handler) {\n\t this.registerHandler(this.patchRouteRecognizer, \"PATCH\", url, handler);\n\t return this;\n\t };\n\t Router.prototype.post = function (url, handler) {\n\t this.registerHandler(this.postRouteRecognizer, \"POST\", url, handler);\n\t return this;\n\t };\n\t Router.prototype.put = function (url, handler) {\n\t this.registerHandler(this.putRouteRecognizer, \"PUT\", url, handler);\n\t return this;\n\t };\n\t Router.prototype.delete = function (url, handler) {\n\t this.registerHandler(this.deleteRouteRecognizer, \"DELETE\", url, handler);\n\t return this;\n\t };\n\t /**\n\t * TODO: This method could use some refactoring. There is conflict of interest between keeping clean separation of test and handle method\n\t * Test method only returns boolean indicating if request can be handled, and handle method has opportunity to modify response and return promise of it.\n\t * In the case of the router with route-recognizer where handlers are associated with routes, this already guarantees that only one handler is selected and makes the test method feel complicated\n\t * Will leave as is an investigate cleaner ways at later time.\n\t */\n\t Router.prototype.registerHandler = function (routeRecognizer, method, url, handler) {\n\t var routeRecognizerHandler = function (request) {\n\t var response = new Response();\n\t return Promise.resolve(handler(request, response))\n\t .then(function (x) { return response; });\n\t };\n\t routeRecognizer.add([\n\t { path: url, handler: routeRecognizerHandler }\n\t ]);\n\t var internalHandler = {\n\t test: function (request) {\n\t if (request.method !== method) {\n\t return false;\n\t }\n\t var matchingRoutes = routeRecognizer.recognize(request.url);\n\t if (matchingRoutes === undefined) {\n\t return false;\n\t }\n\t /**\n\t * Copy parameters from recognized route to the request so they can be used within the handler function\n\t * This isn't ideal because it is side affect which modifies the request instead of strictly testing for true or false\n\t * but I don't see a better place to put this. If we move it between the call to test and the handle it becomes part of the window post message proxy\n\t * even though it's responsibility is related to routing.\n\t */\n\t var route = matchingRoutes[0];\n\t request.params = route.params;\n\t request.queryParams = matchingRoutes.queryParams;\n\t request.handler = route.handler;\n\t return true;\n\t },\n\t handle: function (request) {\n\t return request.handler(request);\n\t }\n\t };\n\t this.handlers.addHandler(internalHandler);\n\t };\n\t return Router;\n\t}());\n\texports.Router = Router;\n\tvar Response = (function () {\n\t function Response() {\n\t this.statusCode = 200;\n\t this.headers = {};\n\t this.body = null;\n\t }\n\t Response.prototype.send = function (statusCode, body) {\n\t this.statusCode = statusCode;\n\t this.body = body;\n\t };\n\t return Response;\n\t}());\n\texports.Response = Response;\n\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(module) {(function() {\n\t \"use strict\";\n\t function $$route$recognizer$dsl$$Target(path, matcher, delegate) {\n\t this.path = path;\n\t this.matcher = matcher;\n\t this.delegate = delegate;\n\t }\n\t\n\t $$route$recognizer$dsl$$Target.prototype = {\n\t to: function(target, callback) {\n\t var delegate = this.delegate;\n\t\n\t if (delegate && delegate.willAddRoute) {\n\t target = delegate.willAddRoute(this.matcher.target, target);\n\t }\n\t\n\t this.matcher.add(this.path, target);\n\t\n\t if (callback) {\n\t if (callback.length === 0) { throw new Error(\"You must have an argument in the function passed to `to`\"); }\n\t this.matcher.addChild(this.path, target, callback, this.delegate);\n\t }\n\t return this;\n\t }\n\t };\n\t\n\t function $$route$recognizer$dsl$$Matcher(target) {\n\t this.routes = {};\n\t this.children = {};\n\t this.target = target;\n\t }\n\t\n\t $$route$recognizer$dsl$$Matcher.prototype = {\n\t add: function(path, handler) {\n\t this.routes[path] = handler;\n\t },\n\t\n\t addChild: function(path, target, callback, delegate) {\n\t var matcher = new $$route$recognizer$dsl$$Matcher(target);\n\t this.children[path] = matcher;\n\t\n\t var match = $$route$recognizer$dsl$$generateMatch(path, matcher, delegate);\n\t\n\t if (delegate && delegate.contextEntered) {\n\t delegate.contextEntered(target, match);\n\t }\n\t\n\t callback(match);\n\t }\n\t };\n\t\n\t function $$route$recognizer$dsl$$generateMatch(startingPath, matcher, delegate) {\n\t return function(path, nestedCallback) {\n\t var fullPath = startingPath + path;\n\t\n\t if (nestedCallback) {\n\t nestedCallback($$route$recognizer$dsl$$generateMatch(fullPath, matcher, delegate));\n\t } else {\n\t return new $$route$recognizer$dsl$$Target(startingPath + path, matcher, delegate);\n\t }\n\t };\n\t }\n\t\n\t function $$route$recognizer$dsl$$addRoute(routeArray, path, handler) {\n\t var len = 0;\n\t for (var i=0; i z`. For instance, \"199\" is smaller\n\t // then \"200\", even though \"y\" and \"z\" (which are both 9) are larger than \"0\" (the value\n\t // of (`b` and `c`). This is because the leading symbol, \"2\", is larger than the other\n\t // leading symbol, \"1\".\n\t // The rule is that symbols to the left carry more weight than symbols to the right\n\t // when a number is written out as a string. In the above strings, the leading digit\n\t // represents how many 100's are in the number, and it carries more weight than the middle\n\t // number which represents how many 10's are in the number.\n\t // This system of number magnitude works well for route specificity, too. A route written as\n\t // `a/b/c` will be more specific than `x/y/z` as long as `a` is more specific than\n\t // `x`, irrespective of the other parts.\n\t // Because of this similarity, we assign each type of segment a number value written as a\n\t // string. We can find the specificity of compound routes by concatenating these strings\n\t // together, from left to right. After we have looped through all of the segments,\n\t // we convert the string to a number.\n\t specificity.val = '';\n\t\n\t for (var i=0; i 2 && key.slice(keyLength -2) === '[]') {\n\t isArray = true;\n\t key = key.slice(0, keyLength - 2);\n\t if(!queryParams[key]) {\n\t queryParams[key] = [];\n\t }\n\t }\n\t value = pair[1] ? $$route$recognizer$$decodeQueryParamPart(pair[1]) : '';\n\t }\n\t if (isArray) {\n\t queryParams[key].push(value);\n\t } else {\n\t queryParams[key] = value;\n\t }\n\t }\n\t return queryParams;\n\t },\n\t\n\t recognize: function(path) {\n\t var states = [ this.rootState ],\n\t pathLen, i, l, queryStart, queryParams = {},\n\t isSlashDropped = false;\n\t\n\t queryStart = path.indexOf('?');\n\t if (queryStart !== -1) {\n\t var queryString = path.substr(queryStart + 1, path.length);\n\t path = path.substr(0, queryStart);\n\t queryParams = this.parseQueryString(queryString);\n\t }\n\t\n\t path = decodeURI(path);\n\t\n\t if (path.charAt(0) !== \"/\") { path = \"/\" + path; }\n\t\n\t pathLen = path.length;\n\t if (pathLen > 1 && path.charAt(pathLen - 1) === \"/\") {\n\t path = path.substr(0, pathLen - 1);\n\t isSlashDropped = true;\n\t }\n\t\n\t for (i=0; i {\n type: string;\n id: string;\n name: string;\n value: T;\n}\n\nexport interface ICustomEvent extends CustomEvent {\n detail: T;\n}\n\nexport interface IEventHandler {\n (event: ICustomEvent): any;\n}\n\nexport interface IHpmFactory {\n (wpmp: wpmp.WindowPostMessageProxy, targetWindow?: Window, version?: string, type?: string, origin?: string): hpm.HttpPostMessage;\n}\n\nexport interface IWpmpFactory {\n (name?: string, logMessages?: boolean, eventSourceOverrideWindow?: Window): wpmp.WindowPostMessageProxy;\n}\n\nexport interface IRouterFactory {\n (wpmp: wpmp.WindowPostMessageProxy): router.Router;\n}\n\nexport interface IPowerBiElement extends HTMLElement {\n powerBiEmbed: embed.Embed;\n}\n\nexport interface IDebugOptions {\n logMessages?: boolean;\n wpmpName?: string;\n}\n\nexport interface IServiceConfiguration extends IDebugOptions {\n autoEmbedOnContentLoaded?: boolean;\n onError?: (error: any) => any;\n version?: string;\n type?: string;\n}\n\nexport interface IService {\n hpm: hpm.HttpPostMessage;\n}\n\n/**\n * The Power BI Service embed component, which is the entry point to embed all other Power BI components into your application\n * \n * @export\n * @class Service\n * @implements {IService}\n */\nexport class Service implements IService {\n\n /**\n * A list of components that this service can embed\n */\n private static components: (typeof Report | typeof Tile | typeof Dashboard)[] = [\n Tile,\n Report,\n Dashboard\n ];\n\n /**\n * The default configuration for the service\n */\n private static defaultConfig: IServiceConfiguration = {\n autoEmbedOnContentLoaded: false,\n onError: (...args) => console.log(args[0], args.slice(1))\n };\n\n /**\n * Gets or sets the access token as the global fallback token to use when a local token is not provided for a report or tile.\n * \n * @type {string}\n */\n accessToken: string;\n\n /**The Configuration object for the service*/\n private config: IServiceConfiguration;\n\n /** A list of Dashboard, Report and Tile components that have been embedded using this service instance. */\n private embeds: embed.Embed[];\n /** TODO: Look for way to make hpm private without sacraficing ease of maitenance. This should be private but in embed needs to call methods. */\n hpm: hpm.HttpPostMessage;\n /** TODO: Look for way to make wpmp private. This is only public to allow stopping the wpmp in tests */\n wpmp: wpmp.WindowPostMessageProxy;\n private router: router.Router;\n\n /**\n * Creates an instance of a Power BI Service.\n * \n * @param {IHpmFactory} hpmFactory The http post message factory used in the postMessage communication layer\n * @param {IWpmpFactory} wpmpFactory The window post message factory used in the postMessage communication layer\n * @param {IRouterFactory} routerFactory The router factory used in the postMessage communication layer\n * @param {IServiceConfiguration} [config={}]\n */\n constructor(hpmFactory: IHpmFactory, wpmpFactory: IWpmpFactory, routerFactory: IRouterFactory, config: IServiceConfiguration = {}) {\n this.wpmp = wpmpFactory(config.wpmpName, config.logMessages);\n this.hpm = hpmFactory(this.wpmp, null, config.version, config.type);\n this.router = routerFactory(this.wpmp);\n\n /**\n * Adds handler for report events.\n */\n this.router.post(`/reports/:uniqueId/events/:eventName`, (req, res) => {\n const event: IEvent = {\n type: 'report',\n id: req.params.uniqueId,\n name: req.params.eventName,\n value: req.body\n };\n\n this.handleEvent(event);\n });\n this.router.post(`/reports/:uniqueId/pages/:pageName/events/:eventName`, (req, res) => {\n const event: IEvent = {\n type: 'report',\n id: req.params.uniqueId,\n name: req.params.eventName,\n value: req.body\n };\n\n this.handleEvent(event);\n });\n\n this.router.post(`/dashboards/:uniqueId/events/:eventName`, (req, res) => {\n const event: IEvent = {\n type: 'dashboard',\n id: req.params.uniqueId,\n name: req.params.eventName,\n value: req.body\n };\n\n this.handleEvent(event);\n });\n\n this.embeds = [];\n\n // TODO: Change when Object.assign is available.\n this.config = utils.assign({}, Service.defaultConfig, config);\n\n if (this.config.autoEmbedOnContentLoaded) {\n this.enableAutoEmbed();\n }\n }\n\n /**\n * Creates new report\n * @param {HTMLElement} element\n * @param {embed.IEmbedConfiguration} [config={}]\n * @returns {embed.Embed}\n */\n createReport(element: HTMLElement, config: embed.IEmbedConfiguration): embed.Embed {\n config.type = 'create';\n let powerBiElement = element;\n const component = new Create(this, powerBiElement, config);\n powerBiElement.powerBiEmbed = component;\n this.embeds.push(component);\n\n return component;\n }\n\n /**\n * TODO: Add a description here\n * \n * @param {HTMLElement} [container]\n * @param {embed.IEmbedConfiguration} [config=undefined]\n * @returns {embed.Embed[]}\n */\n init(container?: HTMLElement, config: embed.IEmbedConfiguration = undefined): embed.Embed[] {\n container = (container && container instanceof HTMLElement) ? container : document.body;\n\n const elements = Array.prototype.slice.call(container.querySelectorAll(`[${embed.Embed.embedUrlAttribute}]`));\n return elements.map(element => this.embed(element, config));\n }\n\n /**\n * Given a configuration based on an HTML element,\n * if the component has already been created and attached to the element, reuses the component instance and existing iframe,\n * otherwise creates a new component instance.\n * \n * @param {HTMLElement} element\n * @param {embed.IEmbedConfiguration} [config={}]\n * @returns {embed.Embed}\n */\n embed(element: HTMLElement, config: embed.IEmbedConfiguration = {}): embed.Embed {\n let component: embed.Embed;\n let powerBiElement = element;\n\n if (powerBiElement.powerBiEmbed) {\n component = this.embedExisting(powerBiElement, config);\n }\n else {\n component = this.embedNew(powerBiElement, config);\n }\n\n return component;\n }\n\n /**\n * Given a configuration based on a Power BI element, saves the component instance that reference the element for later lookup.\n * \n * @private\n * @param {IPowerBiElement} element\n * @param {embed.IEmbedConfiguration} config\n * @returns {embed.Embed}\n */\n private embedNew(element: IPowerBiElement, config: embed.IEmbedConfiguration): embed.Embed {\n const componentType = config.type || element.getAttribute(embed.Embed.typeAttribute);\n if (!componentType) {\n throw new Error(`Attempted to embed using config ${JSON.stringify(config)} on element ${element.outerHTML}, but could not determine what type of component to embed. You must specify a type in the configuration or as an attribute such as '${embed.Embed.typeAttribute}=\"${Report.type.toLowerCase()}\"'.`);\n }\n\n // Saves the type as part of the configuration so that it can be referenced later at a known location.\n config.type = componentType;\n\n const Component = utils.find(component => componentType === component.type.toLowerCase(), Service.components);\n if (!Component) {\n throw new Error(`Attempted to embed component of type: ${componentType} but did not find any matching component. Please verify the type you specified is intended.`);\n }\n\n const component = new Component(this, element, config);\n element.powerBiEmbed = component;\n this.embeds.push(component);\n\n return component;\n }\n\n /**\n * Given an element that already contains an embed component, load with a new configuration.\n * \n * @private\n * @param {IPowerBiElement} element\n * @param {embed.IEmbedConfiguration} config\n * @returns {embed.Embed}\n */\n private embedExisting(element: IPowerBiElement, config: embed.IEmbedConfiguration): embed.Embed {\n const component = utils.find(x => x.element === element, this.embeds);\n if (!component) {\n throw new Error(`Attempted to embed using config ${JSON.stringify(config)} on element ${element.outerHTML} which already has embedded comopnent associated, but could not find the existing comopnent in the list of active components. This could indicate the embeds list is out of sync with the DOM, or the component is referencing the incorrect HTML element.`);\n }\n\n /**\n * TODO: Dynamic embed type switching could be supported but there is work needed to prepare the service state and DOM cleanup.\n * remove all event handlers from the DOM, then reset the element to initial state which removes iframe, and removes from list of embeds\n * then we can call the embedNew function which would allow setting the proper embedUrl and construction of object based on the new type.\n */\n if (typeof config.type === \"string\" && config.type !== component.config.type) {\n\n /**\n * When loading report after create we want to use existing Iframe to optimize load period\n */\n if(config.type === \"report\" && component.config.type === \"create\") {\n const report = new Report(this, element, config, element.powerBiEmbed.iframe);\n report.load(config);\n element.powerBiEmbed = report;\n this.embeds.push(report);\n\n return report;\n }\n\n throw new Error(`Embedding on an existing element with a different type than the previous embed object is not supported. Attempted to embed using config ${JSON.stringify(config)} on element ${element.outerHTML}, but the existing element contains an embed of type: ${this.config.type} which does not match the new type: ${config.type}`);\n }\n\n component.load(config);\n\n return component;\n }\n\n /**\n * Adds an event handler for DOMContentLoaded, which searches the DOM for elements that have the 'powerbi-embed-url' attribute,\n * and automatically attempts to embed a powerbi component based on information from other powerbi-* attributes.\n *\n * Note: Only runs if `config.autoEmbedOnContentLoaded` is true when the service is created.\n * This handler is typically useful only for applications that are rendered on the server so that all required data is available when the handler is called.\n */\n enableAutoEmbed(): void {\n window.addEventListener('DOMContentLoaded', (event: Event) => this.init(document.body), false);\n }\n\n /**\n * Returns an instance of the component associated with the element.\n * \n * @param {HTMLElement} element\n * @returns {(Report | Tile)}\n */\n get(element: HTMLElement): Report | Tile | Dashboard {\n const powerBiElement = element;\n\n if (!powerBiElement.powerBiEmbed) {\n throw new Error(`You attempted to get an instance of powerbi component associated with element: ${element.outerHTML} but there was no associated instance.`);\n }\n\n return powerBiElement.powerBiEmbed;\n }\n\n /**\n * Finds an embed instance by the name or unique ID that is provided.\n * \n * @param {string} uniqueId\n * @returns {(Report | Tile)}\n */\n find(uniqueId: string): Report | Tile | Dashboard {\n return utils.find(x => x.config.uniqueId === uniqueId, this.embeds);\n }\n\n /**\n * Given an HTML element that has a component embedded within it, removes the component from the list of embedded components, removes the association between the element and the component, and removes the iframe.\n * \n * @param {HTMLElement} element\n * @returns {void}\n */\n reset(element: HTMLElement): void {\n const powerBiElement = element;\n\n if (!powerBiElement.powerBiEmbed) {\n return;\n }\n\n /** Removes the component from an internal list of components. */\n utils.remove(x => x === powerBiElement.powerBiEmbed, this.embeds);\n /** Deletes a property from the HTML element. */\n delete powerBiElement.powerBiEmbed;\n /** Removes the iframe from the element. */\n const iframe = element.querySelector('iframe');\n if (iframe) {\n iframe.remove();\n }\n }\n\n /**\n * Given an event object, finds the embed component with the matching type and ID, and invokes its handleEvent method with the event object.\n * \n * @private\n * @param {IEvent} event\n */\n private handleEvent(event: IEvent): void {\n const embed = utils.find(embed => {\n return (embed.config.uniqueId === event.id);\n }, this.embeds);\n\n if (embed) {\n const value = event.value;\n\n if (event.name === 'pageChanged') {\n const pageKey = 'newPage';\n const page: models.IPage = value[pageKey];\n if (!page) {\n throw new Error(`Page model not found at 'event.value.${pageKey}'.`);\n }\n value[pageKey] = new Page(embed, page.name, page.displayName);\n }\n\n utils.raiseCustomEvent(embed.element, event.name, value);\n }\n }\n}\n\n\n// WEBPACK FOOTER //\n// ./src/service.ts","import * as utils from './util';\r\nimport * as service from './service';\r\nimport * as models from 'powerbi-models';\r\nimport * as hpm from 'http-post-message';\r\n\r\ndeclare global {\r\n interface Document {\r\n // Mozilla Fullscreen\r\n mozCancelFullScreen: Function;\r\n\r\n // Ms Fullscreen\r\n msExitFullscreen: Function;\r\n }\r\n\r\n interface HTMLIFrameElement {\r\n // Mozilla Fullscreen\r\n mozRequestFullScreen: Function;\r\n\r\n // Ms Fullscreen\r\n msRequestFullscreen: Function;\r\n }\r\n}\r\n\r\n// TODO: Re-use ILoadConfiguration interface to prevent duplicating properties.\r\n// Current issue is that they are optional when embedding since they can be specificed as attributes but they are required when loading.\r\n/**\r\n * Configuration settings for Power BI embed components\r\n * \r\n * @export\r\n * @interface IEmbedConfiguration\r\n */\r\nexport interface IEmbedConfiguration {\r\n type?: string;\r\n id?: string;\r\n uniqueId?: string;\r\n embedUrl?: string;\r\n accessToken?: string;\r\n settings?: models.ISettings;\r\n pageName?: string;\r\n filters?: models.IFilter[];\r\n pageView?: models.PageView;\r\n datasetId?: string;\r\n permissions?: models.Permissions;\r\n viewMode?: models.ViewMode;\r\n}\r\n\r\nexport interface IInternalEmbedConfiguration extends models.IReportLoadConfiguration {\r\n uniqueId: string;\r\n type: string;\r\n embedUrl: string;\r\n}\r\n\r\nexport interface IInternalEventHandler {\r\n test(event: service.IEvent): boolean;\r\n handle(event: service.ICustomEvent): void;\r\n}\r\n\r\n/**\r\n * Base class for all Power BI embed components\r\n * \r\n * @export\r\n * @abstract\r\n * @class Embed\r\n */\r\nexport abstract class Embed {\r\n static allowedEvents = [\"loaded\", \"saved\", \"rendered\", \"saveAsTriggered\", \"error\", \"dataSelected\"];\r\n static accessTokenAttribute = 'powerbi-access-token';\r\n static embedUrlAttribute = 'powerbi-embed-url';\r\n static nameAttribute = 'powerbi-name';\r\n static typeAttribute = 'powerbi-type';\r\n static type: string;\r\n\r\n private static defaultSettings: models.ISettings = {\r\n filterPaneEnabled: true\r\n };\r\n\r\n allowedEvents = [];\r\n\r\n /**\r\n * Gets or sets the event handler registered for this embed component.\r\n * \r\n * @type {IInternalEventHandler[]}\r\n */\r\n eventHandlers: IInternalEventHandler[];\r\n\r\n /**\r\n * Gets or sets the Power BI embed service.\r\n * \r\n * @type {service.Service}\r\n */\r\n service: service.Service;\r\n\r\n /**\r\n * Gets or sets the HTML element that contains the Power BI embed component.\r\n * \r\n * @type {HTMLElement}\r\n */\r\n element: HTMLElement;\r\n\r\n /**\r\n * Gets or sets the HTML iframe element that renders the Power BI embed component.\r\n * \r\n * @type {HTMLIFrameElement}\r\n */\r\n iframe: HTMLIFrameElement;\r\n\r\n /**\r\n * Gets or sets the configuration settings for the Power BI embed component.\r\n * \r\n * @type {IInternalEmbedConfiguration}\r\n */\r\n config: IInternalEmbedConfiguration;\r\n\r\n /**\r\n * Gets or sets the configuration settings for creating report.\r\n * \r\n * @type {models.IReportCreateConfiguration}\r\n */\r\n createConfig: models.IReportCreateConfiguration;\r\n\r\n /**\r\n * Url used in the load request.\r\n */\r\n loadPath: string;\r\n\r\n /**\r\n * Type of embed\r\n */\r\n embeType: string;\r\n\r\n /**\r\n * Creates an instance of Embed.\r\n * \r\n * Note: there is circular reference between embeds and the service, because\r\n * the service has a list of all embeds on the host page, and each embed has a reference to the service that created it.\r\n * \r\n * @param {service.Service} service\r\n * @param {HTMLElement} element\r\n * @param {IEmbedConfiguration} config\r\n */\r\n constructor(service: service.Service, element: HTMLElement, config: IEmbedConfiguration, iframe?: HTMLIFrameElement) {\r\n Array.prototype.push.apply(this.allowedEvents, Embed.allowedEvents);\r\n this.eventHandlers = [];\r\n this.service = service;\r\n this.element = element;\r\n this.iframe = iframe;\r\n this.embeType = config.type.toLowerCase();\r\n\r\n this.populateConfig(config);\r\n \r\n if(this.embeType === 'create'){\r\n this.setIframe(false/*set EventListener to call create() on 'load' event*/);\r\n } else {\r\n this.setIframe(true/*set EventListener to call load() on 'load' event*/);\r\n }\r\n }\r\n\r\n /**\r\n * Sends createReport configuration data.\r\n * \r\n * ```javascript\r\n * createReport({\r\n * datasetId: '5dac7a4a-4452-46b3-99f6-a25915e0fe55',\r\n * accessToken: 'eyJ0eXA ... TaE2rTSbmg',\r\n * ```\r\n * \r\n * @param {models.IReportCreateConfiguration} config\r\n * @returns {Promise}\r\n */\r\n createReport(config: models.IReportCreateConfiguration): Promise {\r\n const errors = this.validate(config);\r\n if (errors) {\r\n throw errors;\r\n }\r\n \r\n return this.service.hpm.post(\"/report/create\", config, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n return response.body;\r\n },\r\n response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Saves Report.\r\n * \r\n * @returns {Promise}\r\n */\r\n save(): Promise {\r\n return this.service.hpm.post('/report/save', null, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n return response.body;\r\n })\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * SaveAs Report.\r\n * \r\n * @returns {Promise}\r\n */\r\n saveAs(saveAsParameters: models.ISaveAsParameters): Promise {\r\n return this.service.hpm.post('/report/saveAs', saveAsParameters, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n return response.body;\r\n })\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Sends load configuration data.\r\n * \r\n * ```javascript\r\n * report.load({\r\n * type: 'report',\r\n * id: '5dac7a4a-4452-46b3-99f6-a25915e0fe55',\r\n * accessToken: 'eyJ0eXA ... TaE2rTSbmg',\r\n * settings: {\r\n * navContentPaneEnabled: false\r\n * },\r\n * pageName: \"DefaultPage\",\r\n * filters: [\r\n * {\r\n * ... DefaultReportFilter ...\r\n * }\r\n * ]\r\n * })\r\n * .catch(error => { ... });\r\n * ```\r\n * \r\n * @param {models.ILoadConfiguration} config\r\n * @returns {Promise}\r\n */\r\n load(config: models.IReportLoadConfiguration | models.IDashboardLoadConfiguration): Promise {\r\n const errors = this.validate(config);\r\n if (errors) {\r\n throw errors;\r\n }\r\n\r\n return this.service.hpm.post(this.loadPath, config, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n utils.assign(this.config, config);\r\n return response.body;\r\n },\r\n response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Removes one or more event handlers from the list of handlers.\r\n * If a reference to the existing handle function is specified, remove the specific handler.\r\n * If the handler is not specified, remove all handlers for the event name specified.\r\n * \r\n * ```javascript\r\n * report.off('pageChanged')\r\n * \r\n * or \r\n * \r\n * const logHandler = function (event) {\r\n * console.log(event);\r\n * };\r\n * \r\n * report.off('pageChanged', logHandler);\r\n * ```\r\n * \r\n * @template T\r\n * @param {string} eventName\r\n * @param {service.IEventHandler} [handler]\r\n */\r\n off(eventName: string, handler?: service.IEventHandler): void {\r\n const fakeEvent: service.IEvent = { name: eventName, type: null, id: null, value: null };\r\n if (handler) {\r\n utils.remove(eventHandler => eventHandler.test(fakeEvent) && (eventHandler.handle === handler), this.eventHandlers);\r\n this.element.removeEventListener(eventName, handler);\r\n }\r\n else {\r\n const eventHandlersToRemove = this.eventHandlers\r\n .filter(eventHandler => eventHandler.test(fakeEvent));\r\n\r\n eventHandlersToRemove\r\n .forEach(eventHandlerToRemove => {\r\n utils.remove(eventHandler => eventHandler === eventHandlerToRemove, this.eventHandlers);\r\n this.element.removeEventListener(eventName, eventHandlerToRemove.handle);\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Adds an event handler for a specific event.\r\n * \r\n * ```javascript\r\n * report.on('pageChanged', (event) => {\r\n * console.log('PageChanged: ', event.page.name);\r\n * });\r\n * ```\r\n * \r\n * @template T\r\n * @param {string} eventName\r\n * @param {service.IEventHandler} handler\r\n */\r\n on(eventName: string, handler: service.IEventHandler): void {\r\n if (this.allowedEvents.indexOf(eventName) === -1) {\r\n throw new Error(`eventName is must be one of ${this.allowedEvents}. You passed: ${eventName}`);\r\n }\r\n\r\n this.eventHandlers.push({\r\n test: (event: service.IEvent) => event.name === eventName,\r\n handle: handler\r\n });\r\n\r\n this.element.addEventListener(eventName, handler)\r\n }\r\n\r\n /**\r\n * Reloads embed using existing configuration.\r\n * E.g. For reports this effectively clears all filters and makes the first page active which simulates resetting a report back to loaded state.\r\n * \r\n * ```javascript\r\n * report.reload();\r\n * ```\r\n */\r\n reload(): Promise {\r\n return this.load(this.config);\r\n }\r\n \r\n /**\r\n * Set accessToken.\r\n * \r\n * @returns {Promise}\r\n */\r\n setAccessToken(accessToken: string): Promise {\r\n return this.service.hpm.post('/report/token', accessToken, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n return response.body;\r\n })\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n \r\n /**\r\n * Gets an access token from the first available location: config, attribute, global.\r\n * \r\n * @private\r\n * @param {string} globalAccessToken\r\n * @returns {string}\r\n */\r\n private getAccessToken(globalAccessToken: string): string {\r\n const accessToken = this.config.accessToken || this.element.getAttribute(Embed.accessTokenAttribute) || globalAccessToken;\r\n\r\n if (!accessToken) {\r\n throw new Error(`No access token was found for element. You must specify an access token directly on the element using attribute '${Embed.accessTokenAttribute}' or specify a global token at: powerbi.accessToken.`);\r\n }\r\n\r\n return accessToken;\r\n }\r\n\r\n /**\r\n * Populate config for create and load\r\n * \r\n * @private\r\n * @param {IEmbedConfiguration}\r\n * @returns {void}\r\n */\r\n private populateConfig(config: IEmbedConfiguration): void {\r\n // TODO: Change when Object.assign is available.\r\n const settings = utils.assign({}, Embed.defaultSettings, config.settings);\r\n this.config = utils.assign({ settings }, config);\r\n this.config.uniqueId = this.getUniqueId();\r\n this.config.embedUrl = this.getEmbedUrl();\r\n\r\n if(this.embeType === 'create') {\r\n this.createConfig = {\r\n datasetId: config.datasetId || this.getId(),\r\n accessToken: this.getAccessToken(this.service.accessToken),\r\n settings: settings\r\n }\r\n } else {\r\n this.config.id = this.getId();\r\n this.config.accessToken = this.getAccessToken(this.service.accessToken);\r\n } \r\n }\r\n\r\n\r\n /**\r\n * Gets an embed url from the first available location: options, attribute.\r\n * \r\n * @private\r\n * @returns {string}\r\n */\r\n private getEmbedUrl(): string {\r\n const embedUrl = this.config.embedUrl || this.element.getAttribute(Embed.embedUrlAttribute);\r\n\r\n if (typeof embedUrl !== 'string' || embedUrl.length === 0) {\r\n throw new Error(`Embed Url is required, but it was not found. You must provide an embed url either as part of embed configuration or as attribute '${Embed.embedUrlAttribute}'.`);\r\n }\r\n\r\n return embedUrl;\r\n }\r\n\r\n /**\r\n * Gets a unique ID from the first available location: options, attribute.\r\n * If neither is provided generate a unique string.\r\n * \r\n * @private\r\n * @returns {string}\r\n */\r\n private getUniqueId(): string {\r\n return this.config.uniqueId || this.element.getAttribute(Embed.nameAttribute) || utils.createRandomString();\r\n }\r\n\r\n /**\r\n * Gets the report ID from the first available location: options, attribute.\r\n * \r\n * @abstract\r\n * @returns {string}\r\n */\r\n abstract getId(): string;\r\n\r\n /**\r\n * Requests the browser to render the component's iframe in fullscreen mode.\r\n */\r\n fullscreen(): void {\r\n const requestFullScreen = this.iframe.requestFullscreen || this.iframe.msRequestFullscreen || this.iframe.mozRequestFullScreen || this.iframe.webkitRequestFullscreen;\r\n requestFullScreen.call(this.iframe);\r\n }\r\n\r\n /**\r\n * Requests the browser to exit fullscreen mode.\r\n */\r\n exitFullscreen(): void {\r\n if (!this.isFullscreen(this.iframe)) {\r\n return;\r\n }\r\n\r\n const exitFullscreen = document.exitFullscreen || document.mozCancelFullScreen || document.webkitExitFullscreen || document.msExitFullscreen;\r\n exitFullscreen.call(document);\r\n }\r\n\r\n /**\r\n * Returns true if the iframe is rendered in fullscreen mode,\r\n * otherwise returns false.\r\n * \r\n * @private\r\n * @param {HTMLIFrameElement} iframe\r\n * @returns {boolean}\r\n */\r\n private isFullscreen(iframe: HTMLIFrameElement): boolean {\r\n const options = ['fullscreenElement', 'webkitFullscreenElement', 'mozFullscreenScreenElement', 'msFullscreenElement'];\r\n\r\n return options.some(option => document[option] === iframe);\r\n }\r\n \r\n /**\r\n * Validate load and create configuration.\r\n */\r\n abstract validate(config: models.IReportLoadConfiguration | models.IDashboardLoadConfiguration | models.IReportCreateConfiguration): models.IError[];\r\n\r\n /**\r\n * Sets Iframe for embed\r\n */\r\n private setIframe(isLoad: boolean): void {\r\n if(!this.iframe) {\r\n const iframeHtml = ``;\r\n this.element.innerHTML = iframeHtml;\r\n this.iframe = this.element.childNodes[0];\r\n }\r\n\r\n if(isLoad){\r\n this.iframe.addEventListener('load', () => this.load(this.config), false);\r\n } else {\r\n this.iframe.addEventListener('load', () => this.createReport(this.createConfig), false);\r\n }\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/embed.ts","\r\n/**\r\n * Raises a custom event with event data on the specified HTML element.\r\n * \r\n * @export\r\n * @param {HTMLElement} element\r\n * @param {string} eventName\r\n * @param {*} eventData\r\n */\r\nexport function raiseCustomEvent(element: HTMLElement, eventName: string, eventData: any): void {\r\n let customEvent;\r\n if (typeof CustomEvent === 'function') {\r\n customEvent = new CustomEvent(eventName, {\r\n detail: eventData,\r\n bubbles: true,\r\n cancelable: true\r\n });\r\n } else {\r\n customEvent = document.createEvent('CustomEvent');\r\n customEvent.initCustomEvent(eventName, true, true, eventData);\r\n }\r\n\r\n element.dispatchEvent(customEvent);\r\n}\r\n\r\n/**\r\n * Finds the index of the first value in an array that matches the specified predicate.\r\n * \r\n * @export\r\n * @template T\r\n * @param {(x: T) => boolean} predicate\r\n * @param {T[]} xs\r\n * @returns {number}\r\n */\r\nexport function findIndex(predicate: (x: T) => boolean, xs: T[]): number {\r\n if (!Array.isArray(xs)) {\r\n throw new Error(`You attempted to call find with second parameter that was not an array. You passed: ${xs}`);\r\n }\r\n\r\n let index;\r\n xs.some((x, i) => {\r\n if (predicate(x)) {\r\n index = i;\r\n return true;\r\n }\r\n });\r\n\r\n return index;\r\n}\r\n\r\n/**\r\n * Finds the first value in an array that matches the specified predicate.\r\n * \r\n * @export\r\n * @template T\r\n * @param {(x: T) => boolean} predicate\r\n * @param {T[]} xs\r\n * @returns {T}\r\n */\r\nexport function find(predicate: (x: T) => boolean, xs: T[]): T {\r\n const index = findIndex(predicate, xs);\r\n return xs[index];\r\n}\r\n\r\nexport function remove(predicate: (x: T) => boolean, xs: T[]): void {\r\n const index = findIndex(predicate, xs);\r\n xs.splice(index, 1);\r\n}\r\n\r\n// See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\r\n// TODO: replace in favor of using polyfill\r\n/**\r\n * Copies the values of all enumerable properties from one or more source objects to a target object, and returns the target object.\r\n * \r\n * @export\r\n * @param {any} args\r\n * @returns\r\n */\r\nexport function assign(...args) {\r\n var target = args[0];\r\n\r\n 'use strict';\r\n if (target === undefined || target === null) {\r\n throw new TypeError('Cannot convert undefined or null to object');\r\n }\r\n\r\n var output = Object(target);\r\n for (var index = 1; index < arguments.length; index++) {\r\n var source = arguments[index];\r\n if (source !== undefined && source !== null) {\r\n for (var nextKey in source) {\r\n if (source.hasOwnProperty(nextKey)) {\r\n output[nextKey] = source[nextKey];\r\n }\r\n }\r\n }\r\n }\r\n return output;\r\n}\r\n\r\n/**\r\n * Generates a random 7 character string.\r\n * \r\n * @export\r\n * @returns {string}\r\n */\r\nexport function createRandomString(): string {\r\n return (Math.random() + 1).toString(36).substring(7);\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/util.ts","import * as service from './service';\nimport * as embed from './embed';\nimport * as models from 'powerbi-models';\nimport * as wpmp from 'window-post-message-proxy';\nimport * as hpm from 'http-post-message';\nimport * as utils from './util';\nimport { IFilterable } from './ifilterable';\nimport { IPageNode, Page } from './page';\n\n/**\n * A Report node within a report hierarchy\n * \n * @export\n * @interface IReportNode\n */\nexport interface IReportNode {\n iframe: HTMLIFrameElement;\n service: service.IService;\n config: embed.IInternalEmbedConfiguration\n}\n\n/**\n * The Power BI Report embed component\n * \n * @export\n * @class Report\n * @extends {embed.Embed}\n * @implements {IReportNode}\n * @implements {IFilterable}\n */\nexport class Report extends embed.Embed implements IReportNode, IFilterable {\n static allowedEvents = [\"filtersApplied\", \"pageChanged\"];\n static reportIdAttribute = 'powerbi-report-id';\n static filterPaneEnabledAttribute = 'powerbi-settings-filter-pane-enabled';\n static navContentPaneEnabledAttribute = 'powerbi-settings-nav-content-pane-enabled';\n static typeAttribute = 'powerbi-type';\n static type = \"Report\";\n\n /**\n * Creates an instance of a Power BI Report.\n * \n * @param {service.Service} service\n * @param {HTMLElement} element\n * @param {embed.IEmbedConfiguration} config\n */\n constructor(service: service.Service, element: HTMLElement, config: embed.IEmbedConfiguration, iframe?: HTMLIFrameElement) {\n const filterPaneEnabled = (config.settings && config.settings.filterPaneEnabled) || !(element.getAttribute(Report.filterPaneEnabledAttribute) === \"false\");\n const navContentPaneEnabled = (config.settings && config.settings.navContentPaneEnabled) || !(element.getAttribute(Report.navContentPaneEnabledAttribute) === \"false\");\n const settings = utils.assign({\n filterPaneEnabled,\n navContentPaneEnabled\n }, config.settings);\n const configCopy = utils.assign({ settings }, config);\n\n super(service, element, configCopy, iframe);\n this.loadPath = \"/report/load\";\n Array.prototype.push.apply(this.allowedEvents, Report.allowedEvents);\n }\n\n /**\n * Adds backwards compatibility for the previous load configuration, which used the reportId query parameter to specify the report ID\n * (e.g. http://embedded.powerbi.com/appTokenReportEmbed?reportId=854846ed-2106-4dc2-bc58-eb77533bf2f1).\n * \n * By extracting the ID we can ensure that the ID is always explicitly provided as part of the load configuration.\n * \n * @static\n * @param {string} url\n * @returns {string}\n */\n static findIdFromEmbedUrl(url: string): string {\n const reportIdRegEx = /reportId=\"?([^&]+)\"?/\n const reportIdMatch = url.match(reportIdRegEx);\n\n let reportId;\n if (reportIdMatch) {\n reportId = reportIdMatch[1];\n }\n\n return reportId;\n }\n\n /**\n * Gets filters that are applied at the report level.\n * \n * ```javascript\n * // Get filters applied at report level\n * report.getFilters()\n * .then(filters => {\n * ...\n * });\n * ```\n * \n * @returns {Promise}\n */\n getFilters(): Promise {\n return this.service.hpm.get(`/report/filters`, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .then(response => response.body,\n response => {\n throw response.body;\n });\n }\n\n /**\n * Gets the report ID from the first available location: options, attribute, embed url.\n * \n * @returns {string}\n */\n getId(): string {\n const reportId = this.config.id || this.element.getAttribute(Report.reportIdAttribute) || Report.findIdFromEmbedUrl(this.config.embedUrl);\n\n if (typeof reportId !== 'string' || reportId.length === 0) {\n throw new Error(`Report id is required, but it was not found. You must provide an id either as part of embed configuration or as attribute '${Report.reportIdAttribute}'.`);\n }\n\n return reportId;\n }\n\n /**\n * Gets the list of pages within the report.\n * \n * ```javascript\n * report.getPages()\n * .then(pages => {\n * ...\n * });\n * ```\n * \n * @returns {Promise}\n */\n getPages(): Promise {\n return this.service.hpm.get('/report/pages', { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .then(response => {\n return response.body\n .map(page => {\n return new Page(this, page.name, page.displayName);\n });\n }, response => {\n throw response.body;\n });\n }\n\n /**\n * Creates an instance of a Page.\n * \n * Normally you would get Page objects by calling `report.getPages()`, but in the case\n * that the page name is known and you want to perform an action on a page without having to retrieve it\n * you can create it directly.\n * \n * Note: Because you are creating the page manually there is no guarantee that the page actually exists in the report, and subsequent requests could fail.\n * \n * ```javascript\n * const page = report.page('ReportSection1');\n * page.setActive();\n * ```\n * \n * @param {string} name\n * @param {string} [displayName]\n * @returns {Page}\n */\n page(name: string, displayName?: string): Page {\n return new Page(this, name, displayName);\n }\n\n /**\n * Prints the active page of the report by invoking `window.print()` on the embed iframe component.\n */\n print(): Promise {\n return this.service.hpm.post('/report/print', null, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .then(response => {\n return response.body;\n })\n .catch(response => {\n throw response.body;\n });\n }\n\n /**\n * Removes all filters at the report level.\n * \n * ```javascript\n * report.removeFilters();\n * ```\n * \n * @returns {Promise}\n */\n removeFilters(): Promise {\n return this.setFilters([]);\n }\n\n /**\n * Sets the active page of the report.\n * \n * ```javascript\n * report.setPage(\"page2\")\n * .catch(error => { ... });\n * ```\n * \n * @param {string} pageName\n * @returns {Promise}\n */\n setPage(pageName: string): Promise {\n const page: models.IPage = {\n name: pageName,\n displayName: null\n };\n\n return this.service.hpm.put('/report/pages/active', page, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .catch(response => {\n throw response.body;\n });\n }\n\n /**\n * Sets filters at the report level.\n * \n * ```javascript\n * const filters: [\n * ...\n * ];\n * \n * report.setFilters(filters)\n * .catch(errors => {\n * ...\n * });\n * ```\n * \n * @param {(models.IFilter[])} filters\n * @returns {Promise}\n */\n setFilters(filters: models.IFilter[]): Promise {\n return this.service.hpm.put(`/report/filters`, filters, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .catch(response => {\n throw response.body;\n });\n }\n\n /**\n * Updates visibility settings for the filter pane and the page navigation pane.\n * \n * ```javascript\n * const newSettings = {\n * navContentPaneEnabled: true,\n * filterPaneEnabled: false\n * };\n * \n * report.updateSettings(newSettings)\n * .catch(error => { ... });\n * ```\n * \n * @param {models.ISettings} settings\n * @returns {Promise}\n */\n updateSettings(settings: models.ISettings): Promise {\n return this.service.hpm.patch('/report/settings', settings, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .catch(response => {\n throw response.body;\n });\n }\n\n /**\n * Validate load configuration.\n */\n validate(config: models.IReportLoadConfiguration): models.IError[] {\n return models.validateReportLoad(config);\n }\n\n /**\n * Switch Report view mode.\n * \n * @returns {Promise}\n */\n switchMode(viewMode: models.ViewMode): Promise {\n let url = '/report/switchMode/' + viewMode;\n return this.service.hpm.post(url, null, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .then(response => {\n return response.body;\n })\n .catch(response => {\n throw response.body;\n });\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/report.ts","/*! powerbi-models v0.11.1 | (c) 2016 Microsoft Corporation MIT */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"powerbi-models\"] = factory();\n\telse\n\t\troot[\"powerbi-models\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __extends = (this && this.__extends) || function (d, b) {\r\n\t for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\r\n\t function __() { this.constructor = d; }\r\n\t d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n\t};\r\n\t/* tslint:disable:no-var-requires */\r\n\texports.advancedFilterSchema = __webpack_require__(1);\r\n\texports.filterSchema = __webpack_require__(2);\r\n\texports.loadSchema = __webpack_require__(3);\r\n\texports.dashboardLoadSchema = __webpack_require__(4);\r\n\texports.pageSchema = __webpack_require__(5);\r\n\texports.settingsSchema = __webpack_require__(6);\r\n\texports.basicFilterSchema = __webpack_require__(7);\r\n\texports.createReportSchema = __webpack_require__(8);\r\n\texports.saveAsParametersSchema = __webpack_require__(9);\r\n\t/* tslint:enable:no-var-requires */\r\n\tvar jsen = __webpack_require__(10);\r\n\tfunction normalizeError(error) {\r\n\t var message = error.message;\r\n\t if (!message) {\r\n\t message = error.path + \" is invalid. Not meeting \" + error.keyword + \" constraint\";\r\n\t }\r\n\t return {\r\n\t message: message\r\n\t };\r\n\t}\r\n\t/**\r\n\t * Takes in schema and returns function which can be used to validate the schema with better semantics around exposing errors\r\n\t */\r\n\tfunction validate(schema, options) {\r\n\t return function (x) {\r\n\t var validate = jsen(schema, options);\r\n\t var isValid = validate(x);\r\n\t if (isValid) {\r\n\t return undefined;\r\n\t }\r\n\t else {\r\n\t return validate.errors\r\n\t .map(normalizeError);\r\n\t }\r\n\t };\r\n\t}\r\n\texports.validateSettings = validate(exports.settingsSchema, {\r\n\t schemas: {\r\n\t basicFilter: exports.basicFilterSchema,\r\n\t advancedFilter: exports.advancedFilterSchema\r\n\t }\r\n\t});\r\n\texports.validateReportLoad = validate(exports.loadSchema, {\r\n\t schemas: {\r\n\t settings: exports.settingsSchema,\r\n\t basicFilter: exports.basicFilterSchema,\r\n\t advancedFilter: exports.advancedFilterSchema\r\n\t }\r\n\t});\r\n\texports.validateCreateReport = validate(exports.createReportSchema);\r\n\texports.validateDashboardLoad = validate(exports.dashboardLoadSchema);\r\n\texports.validatePage = validate(exports.pageSchema);\r\n\texports.validateFilter = validate(exports.filterSchema, {\r\n\t schemas: {\r\n\t basicFilter: exports.basicFilterSchema,\r\n\t advancedFilter: exports.advancedFilterSchema\r\n\t }\r\n\t});\r\n\t(function (FilterType) {\r\n\t FilterType[FilterType[\"Advanced\"] = 0] = \"Advanced\";\r\n\t FilterType[FilterType[\"Basic\"] = 1] = \"Basic\";\r\n\t FilterType[FilterType[\"Unknown\"] = 2] = \"Unknown\";\r\n\t})(exports.FilterType || (exports.FilterType = {}));\r\n\tvar FilterType = exports.FilterType;\r\n\tfunction isFilterKeyColumnsTarget(target) {\r\n\t return isColumn(target) && !!target.keys;\r\n\t}\r\n\texports.isFilterKeyColumnsTarget = isFilterKeyColumnsTarget;\r\n\tfunction isBasicFilterWithKeys(filter) {\r\n\t return getFilterType(filter) === FilterType.Basic && !!filter.keyValues;\r\n\t}\r\n\texports.isBasicFilterWithKeys = isBasicFilterWithKeys;\r\n\tfunction getFilterType(filter) {\r\n\t var basicFilter = filter;\r\n\t var advancedFilter = filter;\r\n\t if ((typeof basicFilter.operator === \"string\")\r\n\t && (Array.isArray(basicFilter.values))) {\r\n\t return FilterType.Basic;\r\n\t }\r\n\t else if ((typeof advancedFilter.logicalOperator === \"string\")\r\n\t && (Array.isArray(advancedFilter.conditions))) {\r\n\t return FilterType.Advanced;\r\n\t }\r\n\t else {\r\n\t return FilterType.Unknown;\r\n\t }\r\n\t}\r\n\texports.getFilterType = getFilterType;\r\n\tfunction isMeasure(arg) {\r\n\t return arg.table !== undefined && arg.measure !== undefined;\r\n\t}\r\n\texports.isMeasure = isMeasure;\r\n\tfunction isColumn(arg) {\r\n\t return arg.table !== undefined && arg.column !== undefined;\r\n\t}\r\n\texports.isColumn = isColumn;\r\n\tfunction isHierarchy(arg) {\r\n\t return arg.table !== undefined && arg.hierarchy !== undefined && arg.hierarchyLevel !== undefined;\r\n\t}\r\n\texports.isHierarchy = isHierarchy;\r\n\tvar Filter = (function () {\r\n\t function Filter(target) {\r\n\t this.target = target;\r\n\t }\r\n\t Filter.prototype.toJSON = function () {\r\n\t return {\r\n\t $schema: this.schemaUrl,\r\n\t target: this.target\r\n\t };\r\n\t };\r\n\t ;\r\n\t return Filter;\r\n\t}());\r\n\texports.Filter = Filter;\r\n\tvar BasicFilter = (function (_super) {\r\n\t __extends(BasicFilter, _super);\r\n\t function BasicFilter(target, operator) {\r\n\t var values = [];\r\n\t for (var _i = 2; _i < arguments.length; _i++) {\r\n\t values[_i - 2] = arguments[_i];\r\n\t }\r\n\t _super.call(this, target);\r\n\t this.operator = operator;\r\n\t this.schemaUrl = BasicFilter.schemaUrl;\r\n\t if (values.length === 0 && operator !== \"All\") {\r\n\t throw new Error(\"values must be a non-empty array unless your operator is \\\"All\\\".\");\r\n\t }\r\n\t /**\r\n\t * Accept values as array instead of as individual arguments\r\n\t * new BasicFilter('a', 'b', 1, 2);\r\n\t * new BasicFilter('a', 'b', [1,2]);\r\n\t */\r\n\t if (Array.isArray(values[0])) {\r\n\t this.values = values[0];\r\n\t }\r\n\t else {\r\n\t this.values = values;\r\n\t }\r\n\t }\r\n\t BasicFilter.prototype.toJSON = function () {\r\n\t var filter = _super.prototype.toJSON.call(this);\r\n\t filter.operator = this.operator;\r\n\t filter.values = this.values;\r\n\t return filter;\r\n\t };\r\n\t BasicFilter.schemaUrl = \"http://powerbi.com/product/schema#basic\";\r\n\t return BasicFilter;\r\n\t}(Filter));\r\n\texports.BasicFilter = BasicFilter;\r\n\tvar BasicFilterWithKeys = (function (_super) {\r\n\t __extends(BasicFilterWithKeys, _super);\r\n\t function BasicFilterWithKeys(target, operator, values, keyValues) {\r\n\t _super.call(this, target, operator, values);\r\n\t this.keyValues = keyValues;\r\n\t this.target = target;\r\n\t var numberOfKeys = target.keys ? target.keys.length : 0;\r\n\t if (numberOfKeys > 0 && !keyValues) {\r\n\t throw new Error(\"You shold pass the values to be filtered for each key. You passed: no values and \" + numberOfKeys + \" keys\");\r\n\t }\r\n\t if (numberOfKeys === 0 && keyValues && keyValues.length > 0) {\r\n\t throw new Error(\"You passed key values but your target object doesn't contain the keys to be filtered\");\r\n\t }\r\n\t for (var i = 0; i < this.keyValues.length; i++) {\r\n\t if (this.keyValues[i]) {\r\n\t var lengthOfArray = this.keyValues[i].length;\r\n\t if (lengthOfArray !== numberOfKeys) {\r\n\t throw new Error(\"Each tuple of key values should contain a value for each of the keys. You passed: \" + lengthOfArray + \" values and \" + numberOfKeys + \" keys\");\r\n\t }\r\n\t }\r\n\t }\r\n\t }\r\n\t BasicFilterWithKeys.prototype.toJSON = function () {\r\n\t var filter = _super.prototype.toJSON.call(this);\r\n\t filter.keyValues = this.keyValues;\r\n\t return filter;\r\n\t };\r\n\t return BasicFilterWithKeys;\r\n\t}(BasicFilter));\r\n\texports.BasicFilterWithKeys = BasicFilterWithKeys;\r\n\tvar AdvancedFilter = (function (_super) {\r\n\t __extends(AdvancedFilter, _super);\r\n\t function AdvancedFilter(target, logicalOperator) {\r\n\t var conditions = [];\r\n\t for (var _i = 2; _i < arguments.length; _i++) {\r\n\t conditions[_i - 2] = arguments[_i];\r\n\t }\r\n\t _super.call(this, target);\r\n\t this.schemaUrl = AdvancedFilter.schemaUrl;\r\n\t // Guard statements\r\n\t if (typeof logicalOperator !== \"string\" || logicalOperator.length === 0) {\r\n\t // TODO: It would be nicer to list out the possible logical operators.\r\n\t throw new Error(\"logicalOperator must be a valid operator, You passed: \" + logicalOperator);\r\n\t }\r\n\t this.logicalOperator = logicalOperator;\r\n\t var extractedConditions;\r\n\t /**\r\n\t * Accept conditions as array instead of as individual arguments\r\n\t * new AdvancedFilter('a', 'b', \"And\", { value: 1, operator: \"Equals\" }, { value: 2, operator: \"IsGreaterThan\" });\r\n\t * new AdvancedFilter('a', 'b', \"And\", [{ value: 1, operator: \"Equals\" }, { value: 2, operator: \"IsGreaterThan\" }]);\r\n\t */\r\n\t if (Array.isArray(conditions[0])) {\r\n\t extractedConditions = conditions[0];\r\n\t }\r\n\t else {\r\n\t extractedConditions = conditions;\r\n\t }\r\n\t if (extractedConditions.length === 0) {\r\n\t throw new Error(\"conditions must be a non-empty array. You passed: \" + conditions);\r\n\t }\r\n\t if (extractedConditions.length > 2) {\r\n\t throw new Error(\"AdvancedFilters may not have more than two conditions. You passed: \" + conditions.length);\r\n\t }\r\n\t if (extractedConditions.length === 1 && logicalOperator !== \"And\") {\r\n\t throw new Error(\"Logical Operator must be \\\"And\\\" when there is only one condition provided\");\r\n\t }\r\n\t this.conditions = extractedConditions;\r\n\t }\r\n\t AdvancedFilter.prototype.toJSON = function () {\r\n\t var filter = _super.prototype.toJSON.call(this);\r\n\t filter.logicalOperator = this.logicalOperator;\r\n\t filter.conditions = this.conditions;\r\n\t return filter;\r\n\t };\r\n\t AdvancedFilter.schemaUrl = \"http://powerbi.com/product/schema#advanced\";\r\n\t return AdvancedFilter;\r\n\t}(Filter));\r\n\texports.AdvancedFilter = AdvancedFilter;\r\n\t(function (Permissions) {\r\n\t Permissions[Permissions[\"Read\"] = 0] = \"Read\";\r\n\t Permissions[Permissions[\"ReadWrite\"] = 1] = \"ReadWrite\";\r\n\t Permissions[Permissions[\"Copy\"] = 2] = \"Copy\";\r\n\t Permissions[Permissions[\"Create\"] = 4] = \"Create\";\r\n\t Permissions[Permissions[\"All\"] = 7] = \"All\";\r\n\t})(exports.Permissions || (exports.Permissions = {}));\r\n\tvar Permissions = exports.Permissions;\r\n\t(function (ViewMode) {\r\n\t ViewMode[ViewMode[\"View\"] = 0] = \"View\";\r\n\t ViewMode[ViewMode[\"Edit\"] = 1] = \"Edit\";\r\n\t})(exports.ViewMode || (exports.ViewMode = {}));\r\n\tvar ViewMode = exports.ViewMode;\r\n\texports.validateSaveAsParameters = validate(exports.saveAsParametersSchema);\r\n\n\n/***/ },\n/* 1 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"target\": {\n\t\t\t\t\"oneOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\t\"table\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"column\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"required\": [\n\t\t\t\t\t\t\t\"table\",\n\t\t\t\t\t\t\t\"column\"\n\t\t\t\t\t\t]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\t\"table\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"hierarchy\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"hierarchyLevel\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"required\": [\n\t\t\t\t\t\t\t\"table\",\n\t\t\t\t\t\t\t\"hierarchy\",\n\t\t\t\t\t\t\t\"hierarchyLevel\"\n\t\t\t\t\t\t]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\t\"table\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"measure\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"required\": [\n\t\t\t\t\t\t\t\"table\",\n\t\t\t\t\t\t\t\"measure\"\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"logicalOperator\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"conditions\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\"value\": {\n\t\t\t\t\t\t\t\"type\": [\n\t\t\t\t\t\t\t\t\"string\",\n\t\t\t\t\t\t\t\t\"boolean\",\n\t\t\t\t\t\t\t\t\"number\"\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"operator\": {\n\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\"required\": [\n\t\t\t\t\t\t\"value\",\n\t\t\t\t\t\t\"operator\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"target\",\n\t\t\t\"logicalOperator\",\n\t\t\t\"conditions\"\n\t\t]\n\t};\n\n/***/ },\n/* 2 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"oneOf\": [\n\t\t\t{\n\t\t\t\t\"$ref\": \"#basicFilter\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"$ref\": \"#advancedFilter\"\n\t\t\t}\n\t\t],\n\t\t\"invalidMessage\": \"filter is invalid\"\n\t};\n\n/***/ },\n/* 3 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"accessToken\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"accessToken must be a string\",\n\t\t\t\t\t\"required\": \"accessToken is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"id\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"id must be a string\",\n\t\t\t\t\t\"required\": \"id is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"settings\": {\n\t\t\t\t\"$ref\": \"#settings\"\n\t\t\t},\n\t\t\t\"pageName\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"pageName must be a string\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"filters\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\"oneOf\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"$ref\": \"#basicFilter\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"$ref\": \"#advancedFilter\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t\"invalidMessage\": \"filters property is invalid\"\n\t\t\t},\n\t\t\t\"permissions\": {\n\t\t\t\t\"type\": \"number\",\n\t\t\t\t\"enum\": [\n\t\t\t\t\t0,\n\t\t\t\t\t1,\n\t\t\t\t\t2,\n\t\t\t\t\t4,\n\t\t\t\t\t7\n\t\t\t\t],\n\t\t\t\t\"default\": 0,\n\t\t\t\t\"invalidMessage\": \"permissions property is invalid\"\n\t\t\t},\n\t\t\t\"viewMode\": {\n\t\t\t\t\"type\": \"number\",\n\t\t\t\t\"enum\": [\n\t\t\t\t\t0,\n\t\t\t\t\t1\n\t\t\t\t],\n\t\t\t\t\"default\": 0,\n\t\t\t\t\"invalidMessage\": \"viewMode property is invalid\"\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"accessToken\",\n\t\t\t\"id\"\n\t\t]\n\t};\n\n/***/ },\n/* 4 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"accessToken\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"accessToken must be a string\",\n\t\t\t\t\t\"required\": \"accessToken is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"id\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"id must be a string\",\n\t\t\t\t\t\"required\": \"id is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"pageView\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"pageView must be a string with one of the following values: \\\"actualSize\\\", \\\"fitToWidth\\\", \\\"oneColumn\\\"\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"accessToken\",\n\t\t\t\"id\"\n\t\t]\n\t};\n\n/***/ },\n/* 5 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"name\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"name must be a string\",\n\t\t\t\t\t\"required\": \"name is required\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"name\"\n\t\t]\n\t};\n\n/***/ },\n/* 6 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"filterPaneEnabled\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"filterPaneEnabled must be a boolean\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"navContentPaneEnabled\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"navContentPaneEnabled must be a boolean\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"useCustomSaveAsDialog\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"useCustomSaveAsDialog must be a boolean\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n/***/ },\n/* 7 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"target\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"properties\": {\n\t\t\t\t\t\"table\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"column\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"hierarchy\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"hierarchyLevel\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"measure\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"required\": [\n\t\t\t\t\t\"table\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"operator\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"values\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"type\": [\n\t\t\t\t\t\t\"string\",\n\t\t\t\t\t\t\"boolean\",\n\t\t\t\t\t\t\"number\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"target\",\n\t\t\t\"operator\",\n\t\t\t\"values\"\n\t\t]\n\t};\n\n/***/ },\n/* 8 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"accessToken\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"accessToken must be a string\",\n\t\t\t\t\t\"required\": \"accessToken is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"datasetId\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"datasetId must be a string\",\n\t\t\t\t\t\"required\": \"datasetId is required\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"accessToken\",\n\t\t\t\"datasetId\"\n\t\t]\n\t};\n\n/***/ },\n/* 9 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"name\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"name must be a string\",\n\t\t\t\t\t\"required\": \"name is required\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"name\"\n\t\t]\n\t};\n\n/***/ },\n/* 10 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = __webpack_require__(11);\n\n/***/ },\n/* 11 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar REGEX_ESCAPE_EXPR = /[\\/]/g,\n\t STR_ESCAPE_EXPR = /(\")/gim,\n\t VALID_IDENTIFIER_EXPR = /^[a-z_$][0-9a-z]*$/gi,\n\t INVALID_SCHEMA = 'jsen: invalid schema object',\n\t browser = typeof window === 'object' && !!window.navigator, // jshint ignore: line\n\t regescape = new RegExp('/').source !== '/', // node v0.x does not properly escape '/'s in inline regex\n\t func = __webpack_require__(12),\n\t equal = __webpack_require__(13),\n\t unique = __webpack_require__(14),\n\t SchemaResolver = __webpack_require__(15),\n\t formats = __webpack_require__(24),\n\t ucs2length = __webpack_require__(25),\n\t types = {},\n\t keywords = {};\n\t\n\tfunction inlineRegex(regex) {\n\t regex = regex instanceof RegExp ? regex : new RegExp(regex);\n\t\n\t return regescape ?\n\t regex.toString() :\n\t '/' + regex.source.replace(REGEX_ESCAPE_EXPR, '\\\\$&') + '/';\n\t}\n\t\n\tfunction encodeStr(str) {\n\t return '\"' + str.replace(STR_ESCAPE_EXPR, '\\\\$1') + '\"';\n\t}\n\t\n\tfunction appendToPath(path, key) {\n\t VALID_IDENTIFIER_EXPR.lastIndex = 0;\n\t\n\t return VALID_IDENTIFIER_EXPR.test(key) ?\n\t path + '.' + key :\n\t path + '[' + encodeStr(key) + ']';\n\t}\n\t\n\tfunction type(obj) {\n\t if (obj === undefined) {\n\t return 'undefined';\n\t }\n\t\n\t var str = Object.prototype.toString.call(obj);\n\t return str.substr(8, str.length - 9).toLowerCase();\n\t}\n\t\n\tfunction isInteger(obj) {\n\t return (obj | 0) === obj; // jshint ignore: line\n\t}\n\t\n\ttypes['null'] = function (path) {\n\t return path + ' === null';\n\t};\n\t\n\ttypes.boolean = function (path) {\n\t return 'typeof ' + path + ' === \"boolean\"';\n\t};\n\t\n\ttypes.string = function (path) {\n\t return 'typeof ' + path + ' === \"string\"';\n\t};\n\t\n\ttypes.number = function (path) {\n\t return 'typeof ' + path + ' === \"number\"';\n\t};\n\t\n\ttypes.integer = function (path) {\n\t return 'typeof ' + path + ' === \"number\" && !(' + path + ' % 1)';\n\t};\n\t\n\ttypes.array = function (path) {\n\t return 'Array.isArray(' + path + ')';\n\t};\n\t\n\ttypes.object = function (path) {\n\t return 'typeof ' + path + ' === \"object\" && ' + path + ' !== null && !Array.isArray(' + path + ')';\n\t};\n\t\n\ttypes.date = function (path) {\n\t return path + ' instanceof Date';\n\t};\n\t\n\tkeywords.enum = function (context) {\n\t var arr = context.schema['enum'];\n\t\n\t context.code('if (!equalAny(' + context.path + ', ' + JSON.stringify(arr) + ')) {');\n\t context.error('enum');\n\t context.code('}');\n\t};\n\t\n\tkeywords.minimum = function (context) {\n\t if (typeof context.schema.minimum === 'number') {\n\t context.code('if (' + context.path + ' < ' + context.schema.minimum + ') {');\n\t context.error('minimum');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.exclusiveMinimum = function (context) {\n\t if (context.schema.exclusiveMinimum === true && typeof context.schema.minimum === 'number') {\n\t context.code('if (' + context.path + ' === ' + context.schema.minimum + ') {');\n\t context.error('exclusiveMinimum');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.maximum = function (context) {\n\t if (typeof context.schema.maximum === 'number') {\n\t context.code('if (' + context.path + ' > ' + context.schema.maximum + ') {');\n\t context.error('maximum');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.exclusiveMaximum = function (context) {\n\t if (context.schema.exclusiveMaximum === true && typeof context.schema.maximum === 'number') {\n\t context.code('if (' + context.path + ' === ' + context.schema.maximum + ') {');\n\t context.error('exclusiveMaximum');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.multipleOf = function (context) {\n\t if (typeof context.schema.multipleOf === 'number') {\n\t var mul = context.schema.multipleOf,\n\t decimals = mul.toString().length - mul.toFixed(0).length - 1,\n\t pow = decimals > 0 ? Math.pow(10, decimals) : 1,\n\t path = context.path;\n\t\n\t if (decimals > 0) {\n\t context.code('if (+(Math.round((' + path + ' * ' + pow + ') + \"e+\" + ' + decimals + ') + \"e-\" + ' + decimals + ') % ' + (mul * pow) + ' !== 0) {');\n\t } else {\n\t context.code('if (((' + path + ' * ' + pow + ') % ' + (mul * pow) + ') !== 0) {');\n\t }\n\t\n\t context.error('multipleOf');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.minLength = function (context) {\n\t if (isInteger(context.schema.minLength)) {\n\t context.code('if (ucs2length(' + context.path + ') < ' + context.schema.minLength + ') {');\n\t context.error('minLength');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.maxLength = function (context) {\n\t if (isInteger(context.schema.maxLength)) {\n\t context.code('if (ucs2length(' + context.path + ') > ' + context.schema.maxLength + ') {');\n\t context.error('maxLength');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.pattern = function (context) {\n\t var pattern = context.schema.pattern;\n\t\n\t if (typeof pattern === 'string' || pattern instanceof RegExp) {\n\t context.code('if (!(' + inlineRegex(pattern) + ').test(' + context.path + ')) {');\n\t context.error('pattern');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.format = function (context) {\n\t if (typeof context.schema.format !== 'string' || !formats[context.schema.format]) {\n\t return;\n\t }\n\t\n\t context.code('if (!(' + formats[context.schema.format] + ').test(' + context.path + ')) {');\n\t context.error('format');\n\t context.code('}');\n\t};\n\t\n\tkeywords.minItems = function (context) {\n\t if (isInteger(context.schema.minItems)) {\n\t context.code('if (' + context.path + '.length < ' + context.schema.minItems + ') {');\n\t context.error('minItems');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.maxItems = function (context) {\n\t if (isInteger(context.schema.maxItems)) {\n\t context.code('if (' + context.path + '.length > ' + context.schema.maxItems + ') {');\n\t context.error('maxItems');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.additionalItems = function (context) {\n\t if (context.schema.additionalItems === false && Array.isArray(context.schema.items)) {\n\t context.code('if (' + context.path + '.length > ' + context.schema.items.length + ') {');\n\t context.error('additionalItems');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.uniqueItems = function (context) {\n\t if (context.schema.uniqueItems) {\n\t context.code('if (unique(' + context.path + ').length !== ' + context.path + '.length) {');\n\t context.error('uniqueItems');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.items = function (context) {\n\t var index = context.declare(0),\n\t i = 0;\n\t\n\t if (type(context.schema.items) === 'object') {\n\t context.code('for (' + index + ' = 0; ' + index + ' < ' + context.path + '.length; ' + index + '++) {');\n\t\n\t context.descend(context.path + '[' + index + ']', context.schema.items);\n\t\n\t context.code('}');\n\t }\n\t else if (Array.isArray(context.schema.items)) {\n\t for (; i < context.schema.items.length; i++) {\n\t context.code('if (' + context.path + '.length - 1 >= ' + i + ') {');\n\t\n\t context.descend(context.path + '[' + i + ']', context.schema.items[i]);\n\t\n\t context.code('}');\n\t }\n\t\n\t if (type(context.schema.additionalItems) === 'object') {\n\t context.code('for (' + index + ' = ' + i + '; ' + index + ' < ' + context.path + '.length; ' + index + '++) {');\n\t\n\t context.descend(context.path + '[' + index + ']', context.schema.additionalItems);\n\t\n\t context.code('}');\n\t }\n\t }\n\t};\n\t\n\tkeywords.maxProperties = function (context) {\n\t if (isInteger(context.schema.maxProperties)) {\n\t context.code('if (Object.keys(' + context.path + ').length > ' + context.schema.maxProperties + ') {');\n\t context.error('maxProperties');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.minProperties = function (context) {\n\t if (isInteger(context.schema.minProperties)) {\n\t context.code('if (Object.keys(' + context.path + ').length < ' + context.schema.minProperties + ') {');\n\t context.error('minProperties');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.required = function (context) {\n\t if (!Array.isArray(context.schema.required)) {\n\t return;\n\t }\n\t\n\t for (var i = 0; i < context.schema.required.length; i++) {\n\t context.code('if (' + appendToPath(context.path, context.schema.required[i]) + ' === undefined) {');\n\t context.error('required', context.schema.required[i]);\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.properties = function (context) {\n\t var props = context.schema.properties,\n\t propKeys = type(props) === 'object' ? Object.keys(props) : [],\n\t required = Array.isArray(context.schema.required) ? context.schema.required : [],\n\t prop, i, nestedPath;\n\t\n\t if (!propKeys.length) {\n\t return;\n\t }\n\t\n\t for (i = 0; i < propKeys.length; i++) {\n\t prop = propKeys[i];\n\t nestedPath = appendToPath(context.path, prop);\n\t\n\t context.code('if (' + nestedPath + ' !== undefined) {');\n\t\n\t context.descend(nestedPath, props[prop]);\n\t\n\t context.code('}');\n\t\n\t if (required.indexOf(prop) > -1) {\n\t context.code('else {');\n\t context.error('required', prop);\n\t context.code('}');\n\t }\n\t }\n\t};\n\t\n\tkeywords.patternProperties = keywords.additionalProperties = function (context) {\n\t var propKeys = type(context.schema.properties) === 'object' ?\n\t Object.keys(context.schema.properties) : [],\n\t patProps = context.schema.patternProperties,\n\t patterns = type(patProps) === 'object' ? Object.keys(patProps) : [],\n\t addProps = context.schema.additionalProperties,\n\t addPropsCheck = addProps === false || type(addProps) === 'object',\n\t props, keys, key, n, found, pattern, i;\n\t\n\t if (!patterns.length && !addPropsCheck) {\n\t return;\n\t }\n\t\n\t keys = context.declare('[]');\n\t key = context.declare('\"\"');\n\t n = context.declare(0);\n\t\n\t if (addPropsCheck) {\n\t found = context.declare(false);\n\t }\n\t\n\t context.code(keys + ' = Object.keys(' + context.path + ')');\n\t\n\t context.code('for (' + n + ' = 0; ' + n + ' < ' + keys + '.length; ' + n + '++) {')\n\t (key + ' = ' + keys + '[' + n + ']')\n\t\n\t ('if (' + context.path + '[' + key + '] === undefined) {')\n\t ('continue')\n\t ('}');\n\t\n\t if (addPropsCheck) {\n\t context.code(found + ' = false');\n\t }\n\t\n\t // validate pattern properties\n\t for (i = 0; i < patterns.length; i++) {\n\t pattern = patterns[i];\n\t\n\t context.code('if ((' + inlineRegex(pattern) + ').test(' + key + ')) {');\n\t\n\t context.descend(context.path + '[' + key + ']', patProps[pattern]);\n\t\n\t if (addPropsCheck) {\n\t context.code(found + ' = true');\n\t }\n\t\n\t context.code('}');\n\t }\n\t\n\t // validate additional properties\n\t if (addPropsCheck) {\n\t if (propKeys.length) {\n\t props = context.declare(JSON.stringify(propKeys));\n\t\n\t // do not validate regular properties\n\t context.code('if (' + props + '.indexOf(' + key + ') > -1) {')\n\t ('continue')\n\t ('}');\n\t }\n\t\n\t context.code('if (!' + found + ') {');\n\t\n\t if (addProps === false) {\n\t // do not allow additional properties\n\t context.error('additionalProperties', undefined, key);\n\t }\n\t else {\n\t // validate additional properties\n\t context.descend(context.path + '[' + key + ']', addProps);\n\t }\n\t\n\t context.code('}');\n\t }\n\t\n\t context.code('}');\n\t};\n\t\n\tkeywords.dependencies = function (context) {\n\t if (type(context.schema.dependencies) !== 'object') {\n\t return;\n\t }\n\t\n\t var depKeys = Object.keys(context.schema.dependencies),\n\t len = depKeys.length,\n\t key, dep, i = 0, k = 0;\n\t\n\t for (; k < len; k++) {\n\t key = depKeys[k];\n\t dep = context.schema.dependencies[key];\n\t\n\t context.code('if (' + appendToPath(context.path, key) + ' !== undefined) {');\n\t\n\t if (type(dep) === 'object') {\n\t //schema dependency\n\t context.descend(context.path, dep);\n\t }\n\t else {\n\t // property dependency\n\t for (i; i < dep.length; i++) {\n\t context.code('if (' + appendToPath(context.path, dep[i]) + ' === undefined) {');\n\t context.error('dependencies', dep[i]);\n\t context.code('}');\n\t }\n\t }\n\t\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.allOf = function (context) {\n\t if (!Array.isArray(context.schema.allOf)) {\n\t return;\n\t }\n\t\n\t for (var i = 0; i < context.schema.allOf.length; i++) {\n\t context.descend(context.path, context.schema.allOf[i]);\n\t }\n\t};\n\t\n\tkeywords.anyOf = function (context) {\n\t if (!Array.isArray(context.schema.anyOf)) {\n\t return;\n\t }\n\t\n\t var greedy = context.greedy,\n\t errCount = context.declare(0),\n\t initialCount = context.declare(0),\n\t found = context.declare(false),\n\t i = 0;\n\t\n\t context.code(initialCount + ' = errors.length');\n\t\n\t for (; i < context.schema.anyOf.length; i++) {\n\t context.code('if (!' + found + ') {');\n\t\n\t context.code(errCount + ' = errors.length');\n\t\n\t context.greedy = true;\n\t\n\t context.descend(context.path, context.schema.anyOf[i]);\n\t\n\t context.code(found + ' = errors.length === ' + errCount)\n\t ('}');\n\t }\n\t\n\t context.greedy = greedy;\n\t\n\t context.code('if (!' + found + ') {');\n\t\n\t context.error('anyOf');\n\t\n\t context.code('} else {')\n\t ('errors.length = ' + initialCount)\n\t ('}');\n\t};\n\t\n\tkeywords.oneOf = function (context) {\n\t if (!Array.isArray(context.schema.oneOf)) {\n\t return;\n\t }\n\t\n\t var greedy = context.greedy,\n\t matching = context.declare(0),\n\t initialCount = context.declare(0),\n\t errCount = context.declare(0),\n\t i = 0;\n\t\n\t context.code(initialCount + ' = errors.length');\n\t context.code(matching + ' = 0');\n\t\n\t for (; i < context.schema.oneOf.length; i++) {\n\t context.code(errCount + ' = errors.length');\n\t\n\t context.greedy = true;\n\t\n\t context.descend(context.path, context.schema.oneOf[i]);\n\t\n\t context.code('if (errors.length === ' + errCount + ') {')\n\t (matching + '++')\n\t ('}');\n\t }\n\t\n\t context.greedy = greedy;\n\t\n\t context.code('if (' + matching + ' !== 1) {');\n\t\n\t context.error('oneOf');\n\t\n\t context.code('} else {')\n\t ('errors.length = ' + initialCount)\n\t ('}');\n\t};\n\t\n\tkeywords.not = function (context) {\n\t if (type(context.schema.not) !== 'object') {\n\t return;\n\t }\n\t\n\t var greedy = context.greedy,\n\t errCount = context.declare(0);\n\t\n\t context.code(errCount + ' = errors.length');\n\t\n\t context.greedy = true;\n\t\n\t context.descend(context.path, context.schema.not);\n\t\n\t context.greedy = greedy;\n\t\n\t context.code('if (errors.length === ' + errCount + ') {');\n\t\n\t context.error('not');\n\t\n\t context.code('} else {')\n\t ('errors.length = ' + errCount)\n\t ('}');\n\t};\n\t\n\tfunction decorateGenerator(type, keyword) {\n\t keywords[keyword].type = type;\n\t keywords[keyword].keyword = keyword;\n\t}\n\t\n\t['minimum', 'exclusiveMinimum', 'maximum', 'exclusiveMaximum', 'multipleOf']\n\t .forEach(decorateGenerator.bind(null, 'number'));\n\t\n\t['minLength', 'maxLength', 'pattern', 'format']\n\t .forEach(decorateGenerator.bind(null, 'string'));\n\t\n\t['minItems', 'maxItems', 'additionalItems', 'uniqueItems', 'items']\n\t .forEach(decorateGenerator.bind(null, 'array'));\n\t\n\t['maxProperties', 'minProperties', 'required', 'properties', 'patternProperties', 'additionalProperties', 'dependencies']\n\t .forEach(decorateGenerator.bind(null, 'object'));\n\t\n\t['enum', 'allOf', 'anyOf', 'oneOf', 'not']\n\t .forEach(decorateGenerator.bind(null, null));\n\t\n\tfunction groupKeywords(schema) {\n\t var keys = Object.keys(schema),\n\t propIndex = keys.indexOf('properties'),\n\t patIndex = keys.indexOf('patternProperties'),\n\t ret = {\n\t enum: Array.isArray(schema.enum) && schema.enum.length > 0,\n\t type: null,\n\t allType: [],\n\t perType: {}\n\t },\n\t key, gen, i;\n\t\n\t if (schema.type) {\n\t if (typeof schema.type === 'string') {\n\t ret.type = [schema.type];\n\t }\n\t else if (Array.isArray(schema.type) && schema.type.length) {\n\t ret.type = schema.type.slice(0);\n\t }\n\t }\n\t\n\t for (i = 0; i < keys.length; i++) {\n\t key = keys[i];\n\t\n\t if (key === 'enum' || key === 'type') {\n\t continue;\n\t }\n\t\n\t gen = keywords[key];\n\t\n\t if (!gen) {\n\t continue;\n\t }\n\t\n\t if (gen.type) {\n\t if (!ret.perType[gen.type]) {\n\t ret.perType[gen.type] = [];\n\t }\n\t\n\t if (!(propIndex > -1 && key === 'required') &&\n\t !(patIndex > -1 && key === 'additionalProperties')) {\n\t ret.perType[gen.type].push(key);\n\t }\n\t }\n\t else {\n\t ret.allType.push(key);\n\t }\n\t }\n\t\n\t return ret;\n\t}\n\t\n\tfunction getPathExpression(path, key) {\n\t var path_ = path.substr(4),\n\t len = path_.length,\n\t tokens = [],\n\t token = '',\n\t isvar = false,\n\t char, i;\n\t\n\t for (i = 0; i < len; i++) {\n\t char = path_[i];\n\t\n\t switch (char) {\n\t case '.':\n\t if (token) {\n\t token += char;\n\t }\n\t break;\n\t case '[':\n\t if (isNaN(+path_[i + 1])) {\n\t isvar = true;\n\t\n\t if (token) {\n\t tokens.push('\"' + token + '\"');\n\t token = '';\n\t }\n\t }\n\t else {\n\t isvar = false;\n\t\n\t if (token) {\n\t token += '.';\n\t }\n\t }\n\t break;\n\t case ']':\n\t tokens.push(isvar ? token : '\"' + token + '\"');\n\t token = '';\n\t break;\n\t default:\n\t token += char;\n\t }\n\t }\n\t\n\t if (token) {\n\t tokens.push('\"' + token + '\"');\n\t }\n\t\n\t if (key) {\n\t tokens.push('\"' + key + '\"');\n\t }\n\t\n\t if (tokens.length === 1 && isvar) {\n\t return '\"\" + ' + tokens[0] + ' + \"\"';\n\t }\n\t\n\t return tokens.join(' + \".\" + ') || '\"\"';\n\t}\n\t\n\tfunction clone(obj) {\n\t var cloned = obj,\n\t objType = type(obj),\n\t keys, len, key, i;\n\t\n\t if (objType === 'object') {\n\t cloned = {};\n\t keys = Object.keys(obj);\n\t\n\t for (i = 0, len = keys.length; i < len; i++) {\n\t key = keys[i];\n\t cloned[key] = clone(obj[key]);\n\t }\n\t }\n\t else if (objType === 'array') {\n\t cloned = [];\n\t\n\t for (i = 0, len = obj.length; i < len; i++) {\n\t cloned[i] = clone(obj[i]);\n\t }\n\t }\n\t else if (objType === 'regexp') {\n\t return new RegExp(obj);\n\t }\n\t else if (objType === 'date') {\n\t return new Date(obj.toJSON());\n\t }\n\t\n\t return cloned;\n\t}\n\t\n\tfunction equalAny(obj, options) {\n\t for (var i = 0, len = options.length; i < len; i++) {\n\t if (equal(obj, options[i])) {\n\t return true;\n\t }\n\t }\n\t\n\t return false;\n\t}\n\t\n\tfunction PropertyMarker() {\n\t this.objects = [];\n\t this.properties = [];\n\t}\n\t\n\tPropertyMarker.prototype.mark = function (obj, key) {\n\t var index = this.objects.indexOf(obj),\n\t prop;\n\t\n\t if (index < 0) {\n\t this.objects.push(obj);\n\t\n\t prop = {};\n\t prop[key] = 1;\n\t\n\t this.properties.push(prop);\n\t\n\t return;\n\t }\n\t\n\t prop = this.properties[index];\n\t\n\t prop[key] = prop[key] ? prop[key] + 1 : 1;\n\t};\n\t\n\tPropertyMarker.prototype.deleteDuplicates = function () {\n\t var props, keys, key, i, j;\n\t\n\t for (i = 0; i < this.properties.length; i++) {\n\t props = this.properties[i];\n\t keys = Object.keys(props);\n\t\n\t for (j = 0; j < keys.length; j++) {\n\t key = keys[j];\n\t\n\t if (props[key] > 1) {\n\t delete this.objects[i][key];\n\t }\n\t }\n\t }\n\t};\n\t\n\tPropertyMarker.prototype.dispose = function () {\n\t this.objects.length = 0;\n\t this.properties.length = 0;\n\t};\n\t\n\tfunction build(schema, def, additional, resolver, parentMarker) {\n\t var defType, defValue, key, i, propertyMarker, props, defProps;\n\t\n\t if (type(schema) !== 'object') {\n\t return def;\n\t }\n\t\n\t schema = resolver.resolve(schema);\n\t\n\t if (def === undefined && schema.hasOwnProperty('default')) {\n\t def = clone(schema['default']);\n\t }\n\t\n\t defType = type(def);\n\t\n\t if (defType === 'object' && type(schema.properties) === 'object') {\n\t props = Object.keys(schema.properties);\n\t\n\t for (i = 0; i < props.length; i++) {\n\t key = props[i];\n\t defValue = build(schema.properties[key], def[key], additional, resolver);\n\t\n\t if (defValue !== undefined) {\n\t def[key] = defValue;\n\t }\n\t }\n\t\n\t if (additional !== 'always') {\n\t defProps = Object.keys(def);\n\t\n\t for (i = 0; i < defProps.length; i++) {\n\t key = defProps[i];\n\t\n\t if (props.indexOf(key) < 0 &&\n\t (schema.additionalProperties === false ||\n\t (additional === false && !schema.additionalProperties))) {\n\t\n\t if (parentMarker) {\n\t parentMarker.mark(def, key);\n\t }\n\t else {\n\t delete def[key];\n\t }\n\t }\n\t }\n\t }\n\t }\n\t else if (defType === 'array' && schema.items) {\n\t if (type(schema.items) === 'array') {\n\t for (i = 0; i < schema.items.length; i++) {\n\t defValue = build(schema.items[i], def[i], additional, resolver);\n\t\n\t if (defValue !== undefined || i < def.length) {\n\t def[i] = defValue;\n\t }\n\t }\n\t }\n\t else if (def.length) {\n\t for (i = 0; i < def.length; i++) {\n\t def[i] = build(schema.items, def[i], additional, resolver);\n\t }\n\t }\n\t }\n\t else if (type(schema.allOf) === 'array' && schema.allOf.length) {\n\t propertyMarker = new PropertyMarker();\n\t\n\t for (i = 0; i < schema.allOf.length; i++) {\n\t def = build(schema.allOf[i], def, additional, resolver, propertyMarker);\n\t }\n\t\n\t propertyMarker.deleteDuplicates();\n\t propertyMarker.dispose();\n\t }\n\t\n\t return def;\n\t}\n\t\n\tfunction ValidationContext(options) {\n\t this.path = 'data';\n\t this.schema = options.schema;\n\t this.formats = options.formats;\n\t this.greedy = options.greedy;\n\t this.resolver = options.resolver;\n\t this.id = options.id;\n\t this.funcache = options.funcache || {};\n\t this.scope = options.scope || {\n\t equalAny: equalAny,\n\t unique: unique,\n\t ucs2length: ucs2length,\n\t refs: {}\n\t };\n\t}\n\t\n\tValidationContext.prototype.clone = function (schema) {\n\t var ctx = new ValidationContext({\n\t schema: schema,\n\t formats: this.formats,\n\t greedy: this.greedy,\n\t resolver: this.resolver,\n\t id: this.id,\n\t funcache: this.funcache,\n\t scope: this.scope\n\t });\n\t\n\t return ctx;\n\t};\n\t\n\tValidationContext.prototype.declare = function (def) {\n\t var variname = this.id();\n\t this.code.def(variname, def);\n\t return variname;\n\t};\n\t\n\tValidationContext.prototype.cache = function (cacheKey, schema) {\n\t var cached = this.funcache[cacheKey],\n\t context;\n\t\n\t if (!cached) {\n\t cached = this.funcache[cacheKey] = {\n\t key: this.id()\n\t };\n\t\n\t context = this.clone(schema);\n\t\n\t cached.func = context.compile(cached.key);\n\t\n\t this.scope.refs[cached.key] = cached.func;\n\t\n\t context.dispose();\n\t }\n\t\n\t return 'refs.' + cached.key;\n\t};\n\t\n\tValidationContext.prototype.error = function (keyword, key, additional) {\n\t var schema = this.schema,\n\t path = this.path,\n\t errorPath = path !== 'data' || key ?\n\t '(path ? path + \".\" : \"\") + ' + getPathExpression(path, key) + ',' :\n\t 'path,',\n\t res = key && schema.properties && schema.properties[key] ?\n\t this.resolver.resolve(schema.properties[key]) : null,\n\t message = res ? res.requiredMessage : schema.invalidMessage;\n\t\n\t if (!message) {\n\t message = (res && res.messages && res.messages[keyword]) ||\n\t (schema.messages && schema.messages[keyword]);\n\t }\n\t\n\t this.code('errors.push({');\n\t\n\t if (message) {\n\t this.code('message: ' + encodeStr(message) + ',');\n\t }\n\t\n\t if (additional) {\n\t this.code('additionalProperties: ' + additional + ',');\n\t }\n\t\n\t this.code('path: ' + errorPath)\n\t ('keyword: ' + encodeStr(keyword))\n\t ('})');\n\t\n\t if (!this.greedy) {\n\t this.code('return');\n\t }\n\t};\n\t\n\tValidationContext.prototype.refactor = function (path, schema, cacheKey) {\n\t var parentPathExp = path !== 'data' ?\n\t '(path ? path + \".\" : \"\") + ' + getPathExpression(path) :\n\t 'path',\n\t cachedRef = this.cache(cacheKey, schema),\n\t refErrors = this.declare();\n\t\n\t this.code(refErrors + ' = ' + cachedRef + '(' + path + ', ' + parentPathExp + ', errors)');\n\t\n\t if (!this.greedy) {\n\t this.code('if (errors.length) { return }');\n\t }\n\t};\n\t\n\tValidationContext.prototype.descend = function (path, schema) {\n\t var origPath = this.path,\n\t origSchema = this.schema;\n\t\n\t this.path = path;\n\t this.schema = schema;\n\t\n\t this.generate();\n\t\n\t this.path = origPath;\n\t this.schema = origSchema;\n\t};\n\t\n\tValidationContext.prototype.generate = function () {\n\t var path = this.path,\n\t schema = this.schema,\n\t context = this,\n\t scope = this.scope,\n\t encodedFormat,\n\t format,\n\t schemaKeys,\n\t typeKeys,\n\t typeIndex,\n\t validatedType,\n\t i;\n\t\n\t if (type(schema) !== 'object') {\n\t return;\n\t }\n\t\n\t if (schema.$ref !== undefined) {\n\t schema = this.resolver.resolve(schema);\n\t\n\t if (this.resolver.hasRef(schema)) {\n\t this.refactor(path, schema,\n\t this.resolver.getNormalizedRef(this.schema) || this.schema.$ref);\n\t\n\t return;\n\t }\n\t else {\n\t // substitute $ref schema with the resolved instance\n\t this.schema = schema;\n\t }\n\t }\n\t\n\t schemaKeys = groupKeywords(schema);\n\t\n\t if (schemaKeys.enum) {\n\t keywords.enum(context);\n\t\n\t return; // do not process the schema further\n\t }\n\t\n\t typeKeys = Object.keys(schemaKeys.perType);\n\t\n\t function generateForKeyword(keyword) {\n\t keywords[keyword](context); // jshint ignore: line\n\t }\n\t\n\t for (i = 0; i < typeKeys.length; i++) {\n\t validatedType = typeKeys[i];\n\t\n\t this.code((i ? 'else ' : '') + 'if (' + types[validatedType](path) + ') {');\n\t\n\t schemaKeys.perType[validatedType].forEach(generateForKeyword);\n\t\n\t this.code('}');\n\t\n\t if (schemaKeys.type) {\n\t typeIndex = schemaKeys.type.indexOf(validatedType);\n\t\n\t if (typeIndex > -1) {\n\t schemaKeys.type.splice(typeIndex, 1);\n\t }\n\t }\n\t }\n\t\n\t if (schemaKeys.type) { // we have types in the schema\n\t if (schemaKeys.type.length) { // case 1: we still have some left to check\n\t this.code((typeKeys.length ? 'else ' : '') + 'if (!(' + schemaKeys.type.map(function (type) {\n\t return types[type] ? types[type](path) : 'true';\n\t }).join(' || ') + ')) {');\n\t this.error('type');\n\t this.code('}');\n\t }\n\t else {\n\t this.code('else {'); // case 2: we don't have any left to check\n\t this.error('type');\n\t this.code('}');\n\t }\n\t }\n\t\n\t schemaKeys.allType.forEach(function (keyword) {\n\t keywords[keyword](context);\n\t });\n\t\n\t if (schema.format && this.formats) {\n\t format = this.formats[schema.format];\n\t\n\t if (format) {\n\t if (typeof format === 'string' || format instanceof RegExp) {\n\t this.code('if (!(' + inlineRegex(format) + ').test(' + path + ')) {');\n\t this.error('format');\n\t this.code('}');\n\t }\n\t else if (typeof format === 'function') {\n\t (scope.formats || (scope.formats = {}))[schema.format] = format;\n\t (scope.schemas || (scope.schemas = {}))[schema.format] = schema;\n\t\n\t encodedFormat = encodeStr(schema.format);\n\t\n\t this.code('if (!formats[' + encodedFormat + '](' + path + ', schemas[' + encodedFormat + '])) {');\n\t this.error('format');\n\t this.code('}');\n\t }\n\t }\n\t }\n\t};\n\t\n\tValidationContext.prototype.compile = function (id) {\n\t this.code = func('jsen_compiled' + (id ? '_' + id : ''), 'data', 'path', 'errors');\n\t this.generate();\n\t\n\t return this.code.compile(this.scope);\n\t};\n\t\n\tValidationContext.prototype.dispose = function () {\n\t for (var key in this) {\n\t this[key] = undefined;\n\t }\n\t};\n\t\n\tfunction jsen(schema, options) {\n\t if (type(schema) !== 'object') {\n\t throw new Error(INVALID_SCHEMA);\n\t }\n\t\n\t options = options || {};\n\t\n\t var counter = 0,\n\t id = function () { return 'i' + (counter++); },\n\t resolver = new SchemaResolver(schema, options.schemas, options.missing$Ref || false),\n\t context = new ValidationContext({\n\t schema: schema,\n\t resolver: resolver,\n\t id: id,\n\t schemas: options.schemas,\n\t formats: options.formats,\n\t greedy: options.greedy || false\n\t }),\n\t compiled = func('validate', 'data')\n\t ('validate.errors = []')\n\t ('gen(data, \"\", validate.errors)')\n\t ('return validate.errors.length === 0')\n\t .compile({ gen: context.compile() });\n\t\n\t context.dispose();\n\t context = null;\n\t\n\t compiled.errors = [];\n\t\n\t compiled.build = function (initial, options) {\n\t return build(\n\t schema,\n\t (options && options.copy === false ? initial : clone(initial)),\n\t options && options.additionalProperties,\n\t resolver);\n\t };\n\t\n\t return compiled;\n\t}\n\t\n\tjsen.browser = browser;\n\tjsen.clone = clone;\n\tjsen.equal = equal;\n\tjsen.unique = unique;\n\tjsen.ucs2length = ucs2length;\n\tjsen.SchemaResolver = SchemaResolver;\n\tjsen.resolve = SchemaResolver.resolvePointer;\n\t\n\tmodule.exports = jsen;\n\n\n/***/ },\n/* 12 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = function func() {\n\t var args = Array.apply(null, arguments),\n\t name = args.shift(),\n\t tab = ' ',\n\t lines = '',\n\t vars = '',\n\t ind = 1, // indentation\n\t bs = '{[', // block start\n\t be = '}]', // block end\n\t space = function () {\n\t var sp = tab, i = 0;\n\t while (i++ < ind - 1) { sp += tab; }\n\t return sp;\n\t },\n\t add = function (line) {\n\t lines += space() + line + '\\n';\n\t },\n\t builder = function (line) {\n\t var first = line[0],\n\t last = line[line.length - 1];\n\t\n\t if (be.indexOf(first) > -1 && bs.indexOf(last) > -1) {\n\t ind--;\n\t add(line);\n\t ind++;\n\t }\n\t else if (bs.indexOf(last) > -1) {\n\t add(line);\n\t ind++;\n\t }\n\t else if (be.indexOf(first) > -1) {\n\t ind--;\n\t add(line);\n\t }\n\t else {\n\t add(line);\n\t }\n\t\n\t return builder;\n\t };\n\t\n\t builder.def = function (id, def) {\n\t vars += (vars ? ',\\n' + tab + ' ' : '') + id + (def !== undefined ? ' = ' + def : '');\n\t return builder;\n\t };\n\t\n\t builder.toSource = function () {\n\t return 'function ' + name + '(' + args.join(', ') + ') {\\n' +\n\t tab + '\"use strict\"' + '\\n' +\n\t (vars ? tab + 'var ' + vars + ';\\n' : '') +\n\t lines + '}';\n\t };\n\t\n\t builder.compile = function (scope) {\n\t var src = 'return (' + builder.toSource() + ')',\n\t scp = scope || {},\n\t keys = Object.keys(scp),\n\t vals = keys.map(function (key) { return scp[key]; });\n\t\n\t return Function.apply(null, keys.concat(src)).apply(null, vals);\n\t };\n\t\n\t return builder;\n\t};\n\n/***/ },\n/* 13 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tfunction type(obj) {\n\t var str = Object.prototype.toString.call(obj);\n\t return str.substr(8, str.length - 9).toLowerCase();\n\t}\n\t\n\tfunction deepEqual(a, b) {\n\t var keysA = Object.keys(a).sort(),\n\t keysB = Object.keys(b).sort(),\n\t i, key;\n\t\n\t if (!equal(keysA, keysB)) {\n\t return false;\n\t }\n\t\n\t for (i = 0; i < keysA.length; i++) {\n\t key = keysA[i];\n\t\n\t if (!equal(a[key], b[key])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t}\n\t\n\tfunction equal(a, b) { // jshint ignore: line\n\t var typeA = typeof a,\n\t typeB = typeof b,\n\t i;\n\t\n\t // get detailed object type\n\t if (typeA === 'object') {\n\t typeA = type(a);\n\t }\n\t\n\t // get detailed object type\n\t if (typeB === 'object') {\n\t typeB = type(b);\n\t }\n\t\n\t if (typeA !== typeB) {\n\t return false;\n\t }\n\t\n\t if (typeA === 'object') {\n\t return deepEqual(a, b);\n\t }\n\t\n\t if (typeA === 'regexp') {\n\t return a.toString() === b.toString();\n\t }\n\t\n\t if (typeA === 'array') {\n\t if (a.length !== b.length) {\n\t return false;\n\t }\n\t\n\t for (i = 0; i < a.length; i++) {\n\t if (!equal(a[i], b[i])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t }\n\t\n\t return a === b;\n\t}\n\t\n\tmodule.exports = equal;\n\n/***/ },\n/* 14 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar equal = __webpack_require__(13);\n\t\n\tfunction findIndex(arr, value, comparator) {\n\t for (var i = 0, len = arr.length; i < len; i++) {\n\t if (comparator(arr[i], value)) {\n\t return i;\n\t }\n\t }\n\t\n\t return -1;\n\t}\n\t\n\tmodule.exports = function unique(arr) {\n\t return arr.filter(function uniqueOnly(value, index, self) {\n\t return findIndex(self, value, equal) === index;\n\t });\n\t};\n\t\n\tmodule.exports.findIndex = findIndex;\n\n/***/ },\n/* 15 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar url = __webpack_require__(16),\n\t metaschema = __webpack_require__(23),\n\t INVALID_SCHEMA_REFERENCE = 'jsen: invalid schema reference',\n\t DUPLICATE_SCHEMA_ID = 'jsen: duplicate schema id',\n\t CIRCULAR_SCHEMA_REFERENCE = 'jsen: circular schema reference';\n\t\n\tfunction get(obj, path) {\n\t if (!path.length) {\n\t return obj;\n\t }\n\t\n\t var key = path.shift(),\n\t val;\n\t\n\t if (obj && typeof obj === 'object' && obj.hasOwnProperty(key)) {\n\t val = obj[key];\n\t }\n\t\n\t if (path.length) {\n\t if (val && typeof val === 'object') {\n\t return get(val, path);\n\t }\n\t\n\t return undefined;\n\t }\n\t\n\t return val;\n\t}\n\t\n\tfunction refToObj(ref) {\n\t var index = ref.indexOf('#'),\n\t ret = {\n\t base: ref.substr(0, index),\n\t path: []\n\t };\n\t\n\t if (index < 0) {\n\t ret.base = ref;\n\t return ret;\n\t }\n\t\n\t ref = ref.substr(index + 1);\n\t\n\t if (!ref) {\n\t return ret;\n\t }\n\t\n\t ret.path = ref.split('/').map(function (segment) {\n\t // Reference: http://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-08#section-3\n\t return decodeURIComponent(segment)\n\t .replace(/~1/g, '/')\n\t .replace(/~0/g, '~');\n\t });\n\t\n\t if (ref[0] === '/') {\n\t ret.path.shift();\n\t }\n\t\n\t return ret;\n\t}\n\t\n\t// TODO: Can we prevent nested resolvers and combine schemas instead?\n\tfunction SchemaResolver(rootSchema, external, missing$Ref, baseId) { // jshint ignore: line\n\t this.rootSchema = rootSchema;\n\t this.resolvers = null;\n\t this.resolvedRootSchema = null;\n\t this.cache = {};\n\t this.idCache = {};\n\t this.refCache = { refs: [], schemas: [] };\n\t this.missing$Ref = missing$Ref;\n\t this.refStack = [];\n\t\n\t baseId = baseId || '';\n\t\n\t this._buildIdCache(rootSchema, baseId);\n\t\n\t // get updated base id after normalizing root schema id\n\t baseId = this.refCache.refs[this.refCache.schemas.indexOf(this.rootSchema)] || baseId;\n\t\n\t this._buildResolvers(external, baseId);\n\t}\n\t\n\tSchemaResolver.prototype._cacheId = function (id, schema, resolver) {\n\t if (this.idCache[id]) {\n\t throw new Error(DUPLICATE_SCHEMA_ID + ' ' + id);\n\t }\n\t\n\t this.idCache[id] = { resolver: resolver, schema: schema };\n\t};\n\t\n\tSchemaResolver.prototype._buildIdCache = function (schema, baseId) {\n\t var id = baseId,\n\t ref, keys, i;\n\t\n\t if (!schema || typeof schema !== 'object') {\n\t return;\n\t }\n\t\n\t if (typeof schema.id === 'string' && schema.id) {\n\t id = url.resolve(baseId, schema.id);\n\t\n\t this._cacheId(id, schema, this);\n\t }\n\t else if (schema === this.rootSchema && baseId) {\n\t this._cacheId(baseId, schema, this);\n\t }\n\t\n\t if (schema.$ref && typeof schema.$ref === 'string') {\n\t ref = url.resolve(id, schema.$ref);\n\t\n\t this.refCache.schemas.push(schema);\n\t this.refCache.refs.push(ref);\n\t }\n\t\n\t keys = Object.keys(schema);\n\t\n\t for (i = 0; i < keys.length; i++) {\n\t this._buildIdCache(schema[keys[i]], id);\n\t }\n\t};\n\t\n\tSchemaResolver.prototype._buildResolvers = function (schemas, baseId) {\n\t if (!schemas || typeof schemas !== 'object') {\n\t return;\n\t }\n\t\n\t var that = this,\n\t resolvers = {};\n\t\n\t Object.keys(schemas).forEach(function (key) {\n\t var id = url.resolve(baseId, key),\n\t resolver = new SchemaResolver(schemas[key], null, that.missing$Ref, id);\n\t\n\t that._cacheId(id, resolver.rootSchema, resolver);\n\t\n\t Object.keys(resolver.idCache).forEach(function (idKey) {\n\t that.idCache[idKey] = resolver.idCache[idKey];\n\t });\n\t\n\t resolvers[key] = resolver;\n\t });\n\t\n\t this.resolvers = resolvers;\n\t};\n\t\n\tSchemaResolver.prototype.getNormalizedRef = function (schema) {\n\t var index = this.refCache.schemas.indexOf(schema);\n\t return this.refCache.refs[index];\n\t};\n\t\n\tSchemaResolver.prototype._resolveRef = function (ref) {\n\t var err = new Error(INVALID_SCHEMA_REFERENCE + ' ' + ref),\n\t idCache = this.idCache,\n\t externalResolver, cached, descriptor, path, dest;\n\t\n\t if (!ref || typeof ref !== 'string') {\n\t throw err;\n\t }\n\t\n\t if (ref === metaschema.id) {\n\t dest = metaschema;\n\t }\n\t\n\t cached = idCache[ref];\n\t\n\t if (cached) {\n\t dest = cached.resolver.resolve(cached.schema);\n\t }\n\t\n\t if (dest === undefined) {\n\t descriptor = refToObj(ref);\n\t path = descriptor.path;\n\t\n\t if (descriptor.base) {\n\t cached = idCache[descriptor.base] || idCache[descriptor.base + '#'];\n\t\n\t if (cached) {\n\t dest = cached.resolver.resolve(get(cached.schema, path.slice(0)));\n\t }\n\t else {\n\t path.unshift(descriptor.base);\n\t }\n\t }\n\t }\n\t\n\t if (dest === undefined && this.resolvedRootSchema) {\n\t dest = get(this.resolvedRootSchema, path.slice(0));\n\t }\n\t\n\t if (dest === undefined) {\n\t dest = get(this.rootSchema, path.slice(0));\n\t }\n\t\n\t if (dest === undefined && path.length && this.resolvers) {\n\t externalResolver = get(this.resolvers, path);\n\t\n\t if (externalResolver) {\n\t dest = externalResolver.resolve(externalResolver.rootSchema);\n\t }\n\t }\n\t\n\t if (dest === undefined || typeof dest !== 'object') {\n\t if (this.missing$Ref) {\n\t dest = {};\n\t } else {\n\t throw err;\n\t }\n\t }\n\t\n\t if (this.cache[ref] === dest) {\n\t return dest;\n\t }\n\t\n\t this.cache[ref] = dest;\n\t\n\t if (dest.$ref !== undefined) {\n\t dest = this.resolve(dest);\n\t }\n\t\n\t return dest;\n\t};\n\t\n\tSchemaResolver.prototype.resolve = function (schema) {\n\t if (!schema || typeof schema !== 'object' || schema.$ref === undefined) {\n\t return schema;\n\t }\n\t\n\t var ref = this.getNormalizedRef(schema) || schema.$ref,\n\t resolved = this.cache[ref];\n\t\n\t if (resolved !== undefined) {\n\t return resolved;\n\t }\n\t\n\t if (this.refStack.indexOf(ref) > -1) {\n\t throw new Error(CIRCULAR_SCHEMA_REFERENCE + ' ' + ref);\n\t }\n\t\n\t this.refStack.push(ref);\n\t\n\t resolved = this._resolveRef(ref);\n\t\n\t this.refStack.pop();\n\t\n\t if (schema === this.rootSchema) {\n\t // cache the resolved root schema\n\t this.resolvedRootSchema = resolved;\n\t }\n\t\n\t return resolved;\n\t};\n\t\n\tSchemaResolver.prototype.hasRef = function (schema) {\n\t var keys = Object.keys(schema),\n\t len, key, i, hasChildRef;\n\t\n\t if (keys.indexOf('$ref') > -1) {\n\t return true;\n\t }\n\t\n\t for (i = 0, len = keys.length; i < len; i++) {\n\t key = keys[i];\n\t\n\t if (schema[key] && typeof schema[key] === 'object' && !Array.isArray(schema[key])) {\n\t hasChildRef = this.hasRef(schema[key]);\n\t\n\t if (hasChildRef) {\n\t return true;\n\t }\n\t }\n\t }\n\t\n\t return false;\n\t};\n\t\n\tSchemaResolver.resolvePointer = function (obj, pointer) {\n\t var descriptor = refToObj(pointer),\n\t path = descriptor.path;\n\t\n\t if (descriptor.base) {\n\t path = [descriptor.base].concat(path);\n\t }\n\t\n\t return get(obj, path);\n\t};\n\t\n\tmodule.exports = SchemaResolver;\n\n/***/ },\n/* 16 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t// Copyright Joyent, Inc. and other Node contributors.\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a\n\t// copy of this software and associated documentation files (the\n\t// \"Software\"), to deal in the Software without restriction, including\n\t// without limitation the rights to use, copy, modify, merge, publish,\n\t// distribute, sublicense, and/or sell copies of the Software, and to permit\n\t// persons to whom the Software is furnished to do so, subject to the\n\t// following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included\n\t// in all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n\t// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\t// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n\t// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n\t// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n\t// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n\t// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\t\n\t'use strict';\n\t\n\tvar punycode = __webpack_require__(17);\n\tvar util = __webpack_require__(19);\n\t\n\texports.parse = urlParse;\n\texports.resolve = urlResolve;\n\texports.resolveObject = urlResolveObject;\n\texports.format = urlFormat;\n\t\n\texports.Url = Url;\n\t\n\tfunction Url() {\n\t this.protocol = null;\n\t this.slashes = null;\n\t this.auth = null;\n\t this.host = null;\n\t this.port = null;\n\t this.hostname = null;\n\t this.hash = null;\n\t this.search = null;\n\t this.query = null;\n\t this.pathname = null;\n\t this.path = null;\n\t this.href = null;\n\t}\n\t\n\t// Reference: RFC 3986, RFC 1808, RFC 2396\n\t\n\t// define these here so at least they only have to be\n\t// compiled once on the first module load.\n\tvar protocolPattern = /^([a-z0-9.+-]+:)/i,\n\t portPattern = /:[0-9]*$/,\n\t\n\t // Special case for a simple path URL\n\t simplePathPattern = /^(\\/\\/?(?!\\/)[^\\?\\s]*)(\\?[^\\s]*)?$/,\n\t\n\t // RFC 2396: characters reserved for delimiting URLs.\n\t // We actually just auto-escape these.\n\t delims = ['<', '>', '\"', '`', ' ', '\\r', '\\n', '\\t'],\n\t\n\t // RFC 2396: characters not allowed for various reasons.\n\t unwise = ['{', '}', '|', '\\\\', '^', '`'].concat(delims),\n\t\n\t // Allowed by RFCs, but cause of XSS attacks. Always escape these.\n\t autoEscape = ['\\''].concat(unwise),\n\t // Characters that are never ever allowed in a hostname.\n\t // Note that any invalid chars are also handled, but these\n\t // are the ones that are *expected* to be seen, so we fast-path\n\t // them.\n\t nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape),\n\t hostEndingChars = ['/', '?', '#'],\n\t hostnameMaxLen = 255,\n\t hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,\n\t hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,\n\t // protocols that can allow \"unsafe\" and \"unwise\" chars.\n\t unsafeProtocol = {\n\t 'javascript': true,\n\t 'javascript:': true\n\t },\n\t // protocols that never have a hostname.\n\t hostlessProtocol = {\n\t 'javascript': true,\n\t 'javascript:': true\n\t },\n\t // protocols that always contain a // bit.\n\t slashedProtocol = {\n\t 'http': true,\n\t 'https': true,\n\t 'ftp': true,\n\t 'gopher': true,\n\t 'file': true,\n\t 'http:': true,\n\t 'https:': true,\n\t 'ftp:': true,\n\t 'gopher:': true,\n\t 'file:': true\n\t },\n\t querystring = __webpack_require__(20);\n\t\n\tfunction urlParse(url, parseQueryString, slashesDenoteHost) {\n\t if (url && util.isObject(url) && url instanceof Url) return url;\n\t\n\t var u = new Url;\n\t u.parse(url, parseQueryString, slashesDenoteHost);\n\t return u;\n\t}\n\t\n\tUrl.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {\n\t if (!util.isString(url)) {\n\t throw new TypeError(\"Parameter 'url' must be a string, not \" + typeof url);\n\t }\n\t\n\t // Copy chrome, IE, opera backslash-handling behavior.\n\t // Back slashes before the query string get converted to forward slashes\n\t // See: https://code.google.com/p/chromium/issues/detail?id=25916\n\t var queryIndex = url.indexOf('?'),\n\t splitter =\n\t (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#',\n\t uSplit = url.split(splitter),\n\t slashRegex = /\\\\/g;\n\t uSplit[0] = uSplit[0].replace(slashRegex, '/');\n\t url = uSplit.join(splitter);\n\t\n\t var rest = url;\n\t\n\t // trim before proceeding.\n\t // This is to support parse stuff like \" http://foo.com \\n\"\n\t rest = rest.trim();\n\t\n\t if (!slashesDenoteHost && url.split('#').length === 1) {\n\t // Try fast path regexp\n\t var simplePath = simplePathPattern.exec(rest);\n\t if (simplePath) {\n\t this.path = rest;\n\t this.href = rest;\n\t this.pathname = simplePath[1];\n\t if (simplePath[2]) {\n\t this.search = simplePath[2];\n\t if (parseQueryString) {\n\t this.query = querystring.parse(this.search.substr(1));\n\t } else {\n\t this.query = this.search.substr(1);\n\t }\n\t } else if (parseQueryString) {\n\t this.search = '';\n\t this.query = {};\n\t }\n\t return this;\n\t }\n\t }\n\t\n\t var proto = protocolPattern.exec(rest);\n\t if (proto) {\n\t proto = proto[0];\n\t var lowerProto = proto.toLowerCase();\n\t this.protocol = lowerProto;\n\t rest = rest.substr(proto.length);\n\t }\n\t\n\t // figure out if it's got a host\n\t // user@server is *always* interpreted as a hostname, and url\n\t // resolution will treat //foo/bar as host=foo,path=bar because that's\n\t // how the browser resolves relative URLs.\n\t if (slashesDenoteHost || proto || rest.match(/^\\/\\/[^@\\/]+@[^@\\/]+/)) {\n\t var slashes = rest.substr(0, 2) === '//';\n\t if (slashes && !(proto && hostlessProtocol[proto])) {\n\t rest = rest.substr(2);\n\t this.slashes = true;\n\t }\n\t }\n\t\n\t if (!hostlessProtocol[proto] &&\n\t (slashes || (proto && !slashedProtocol[proto]))) {\n\t\n\t // there's a hostname.\n\t // the first instance of /, ?, ;, or # ends the host.\n\t //\n\t // If there is an @ in the hostname, then non-host chars *are* allowed\n\t // to the left of the last @ sign, unless some host-ending character\n\t // comes *before* the @-sign.\n\t // URLs are obnoxious.\n\t //\n\t // ex:\n\t // http://a@b@c/ => user:a@b host:c\n\t // http://a@b?@c => user:a host:c path:/?@c\n\t\n\t // v0.12 TODO(isaacs): This is not quite how Chrome does things.\n\t // Review our test case against browsers more comprehensively.\n\t\n\t // find the first instance of any hostEndingChars\n\t var hostEnd = -1;\n\t for (var i = 0; i < hostEndingChars.length; i++) {\n\t var hec = rest.indexOf(hostEndingChars[i]);\n\t if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n\t hostEnd = hec;\n\t }\n\t\n\t // at this point, either we have an explicit point where the\n\t // auth portion cannot go past, or the last @ char is the decider.\n\t var auth, atSign;\n\t if (hostEnd === -1) {\n\t // atSign can be anywhere.\n\t atSign = rest.lastIndexOf('@');\n\t } else {\n\t // atSign must be in auth portion.\n\t // http://a@b/c@d => host:b auth:a path:/c@d\n\t atSign = rest.lastIndexOf('@', hostEnd);\n\t }\n\t\n\t // Now we have a portion which is definitely the auth.\n\t // Pull that off.\n\t if (atSign !== -1) {\n\t auth = rest.slice(0, atSign);\n\t rest = rest.slice(atSign + 1);\n\t this.auth = decodeURIComponent(auth);\n\t }\n\t\n\t // the host is the remaining to the left of the first non-host char\n\t hostEnd = -1;\n\t for (var i = 0; i < nonHostChars.length; i++) {\n\t var hec = rest.indexOf(nonHostChars[i]);\n\t if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n\t hostEnd = hec;\n\t }\n\t // if we still have not hit it, then the entire thing is a host.\n\t if (hostEnd === -1)\n\t hostEnd = rest.length;\n\t\n\t this.host = rest.slice(0, hostEnd);\n\t rest = rest.slice(hostEnd);\n\t\n\t // pull out port.\n\t this.parseHost();\n\t\n\t // we've indicated that there is a hostname,\n\t // so even if it's empty, it has to be present.\n\t this.hostname = this.hostname || '';\n\t\n\t // if hostname begins with [ and ends with ]\n\t // assume that it's an IPv6 address.\n\t var ipv6Hostname = this.hostname[0] === '[' &&\n\t this.hostname[this.hostname.length - 1] === ']';\n\t\n\t // validate a little.\n\t if (!ipv6Hostname) {\n\t var hostparts = this.hostname.split(/\\./);\n\t for (var i = 0, l = hostparts.length; i < l; i++) {\n\t var part = hostparts[i];\n\t if (!part) continue;\n\t if (!part.match(hostnamePartPattern)) {\n\t var newpart = '';\n\t for (var j = 0, k = part.length; j < k; j++) {\n\t if (part.charCodeAt(j) > 127) {\n\t // we replace non-ASCII char with a temporary placeholder\n\t // we need this to make sure size of hostname is not\n\t // broken by replacing non-ASCII by nothing\n\t newpart += 'x';\n\t } else {\n\t newpart += part[j];\n\t }\n\t }\n\t // we test again with ASCII char only\n\t if (!newpart.match(hostnamePartPattern)) {\n\t var validParts = hostparts.slice(0, i);\n\t var notHost = hostparts.slice(i + 1);\n\t var bit = part.match(hostnamePartStart);\n\t if (bit) {\n\t validParts.push(bit[1]);\n\t notHost.unshift(bit[2]);\n\t }\n\t if (notHost.length) {\n\t rest = '/' + notHost.join('.') + rest;\n\t }\n\t this.hostname = validParts.join('.');\n\t break;\n\t }\n\t }\n\t }\n\t }\n\t\n\t if (this.hostname.length > hostnameMaxLen) {\n\t this.hostname = '';\n\t } else {\n\t // hostnames are always lower case.\n\t this.hostname = this.hostname.toLowerCase();\n\t }\n\t\n\t if (!ipv6Hostname) {\n\t // IDNA Support: Returns a punycoded representation of \"domain\".\n\t // It only converts parts of the domain name that\n\t // have non-ASCII characters, i.e. it doesn't matter if\n\t // you call it with a domain that already is ASCII-only.\n\t this.hostname = punycode.toASCII(this.hostname);\n\t }\n\t\n\t var p = this.port ? ':' + this.port : '';\n\t var h = this.hostname || '';\n\t this.host = h + p;\n\t this.href += this.host;\n\t\n\t // strip [ and ] from the hostname\n\t // the host field still retains them, though\n\t if (ipv6Hostname) {\n\t this.hostname = this.hostname.substr(1, this.hostname.length - 2);\n\t if (rest[0] !== '/') {\n\t rest = '/' + rest;\n\t }\n\t }\n\t }\n\t\n\t // now rest is set to the post-host stuff.\n\t // chop off any delim chars.\n\t if (!unsafeProtocol[lowerProto]) {\n\t\n\t // First, make 100% sure that any \"autoEscape\" chars get\n\t // escaped, even if encodeURIComponent doesn't think they\n\t // need to be.\n\t for (var i = 0, l = autoEscape.length; i < l; i++) {\n\t var ae = autoEscape[i];\n\t if (rest.indexOf(ae) === -1)\n\t continue;\n\t var esc = encodeURIComponent(ae);\n\t if (esc === ae) {\n\t esc = escape(ae);\n\t }\n\t rest = rest.split(ae).join(esc);\n\t }\n\t }\n\t\n\t\n\t // chop off from the tail first.\n\t var hash = rest.indexOf('#');\n\t if (hash !== -1) {\n\t // got a fragment string.\n\t this.hash = rest.substr(hash);\n\t rest = rest.slice(0, hash);\n\t }\n\t var qm = rest.indexOf('?');\n\t if (qm !== -1) {\n\t this.search = rest.substr(qm);\n\t this.query = rest.substr(qm + 1);\n\t if (parseQueryString) {\n\t this.query = querystring.parse(this.query);\n\t }\n\t rest = rest.slice(0, qm);\n\t } else if (parseQueryString) {\n\t // no query string, but parseQueryString still requested\n\t this.search = '';\n\t this.query = {};\n\t }\n\t if (rest) this.pathname = rest;\n\t if (slashedProtocol[lowerProto] &&\n\t this.hostname && !this.pathname) {\n\t this.pathname = '/';\n\t }\n\t\n\t //to support http.request\n\t if (this.pathname || this.search) {\n\t var p = this.pathname || '';\n\t var s = this.search || '';\n\t this.path = p + s;\n\t }\n\t\n\t // finally, reconstruct the href based on what has been validated.\n\t this.href = this.format();\n\t return this;\n\t};\n\t\n\t// format a parsed object into a url string\n\tfunction urlFormat(obj) {\n\t // ensure it's an object, and not a string url.\n\t // If it's an obj, this is a no-op.\n\t // this way, you can call url_format() on strings\n\t // to clean up potentially wonky urls.\n\t if (util.isString(obj)) obj = urlParse(obj);\n\t if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n\t return obj.format();\n\t}\n\t\n\tUrl.prototype.format = function() {\n\t var auth = this.auth || '';\n\t if (auth) {\n\t auth = encodeURIComponent(auth);\n\t auth = auth.replace(/%3A/i, ':');\n\t auth += '@';\n\t }\n\t\n\t var protocol = this.protocol || '',\n\t pathname = this.pathname || '',\n\t hash = this.hash || '',\n\t host = false,\n\t query = '';\n\t\n\t if (this.host) {\n\t host = auth + this.host;\n\t } else if (this.hostname) {\n\t host = auth + (this.hostname.indexOf(':') === -1 ?\n\t this.hostname :\n\t '[' + this.hostname + ']');\n\t if (this.port) {\n\t host += ':' + this.port;\n\t }\n\t }\n\t\n\t if (this.query &&\n\t util.isObject(this.query) &&\n\t Object.keys(this.query).length) {\n\t query = querystring.stringify(this.query);\n\t }\n\t\n\t var search = this.search || (query && ('?' + query)) || '';\n\t\n\t if (protocol && protocol.substr(-1) !== ':') protocol += ':';\n\t\n\t // only the slashedProtocols get the //. Not mailto:, xmpp:, etc.\n\t // unless they had them to begin with.\n\t if (this.slashes ||\n\t (!protocol || slashedProtocol[protocol]) && host !== false) {\n\t host = '//' + (host || '');\n\t if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname;\n\t } else if (!host) {\n\t host = '';\n\t }\n\t\n\t if (hash && hash.charAt(0) !== '#') hash = '#' + hash;\n\t if (search && search.charAt(0) !== '?') search = '?' + search;\n\t\n\t pathname = pathname.replace(/[?#]/g, function(match) {\n\t return encodeURIComponent(match);\n\t });\n\t search = search.replace('#', '%23');\n\t\n\t return protocol + host + pathname + search + hash;\n\t};\n\t\n\tfunction urlResolve(source, relative) {\n\t return urlParse(source, false, true).resolve(relative);\n\t}\n\t\n\tUrl.prototype.resolve = function(relative) {\n\t return this.resolveObject(urlParse(relative, false, true)).format();\n\t};\n\t\n\tfunction urlResolveObject(source, relative) {\n\t if (!source) return relative;\n\t return urlParse(source, false, true).resolveObject(relative);\n\t}\n\t\n\tUrl.prototype.resolveObject = function(relative) {\n\t if (util.isString(relative)) {\n\t var rel = new Url();\n\t rel.parse(relative, false, true);\n\t relative = rel;\n\t }\n\t\n\t var result = new Url();\n\t var tkeys = Object.keys(this);\n\t for (var tk = 0; tk < tkeys.length; tk++) {\n\t var tkey = tkeys[tk];\n\t result[tkey] = this[tkey];\n\t }\n\t\n\t // hash is always overridden, no matter what.\n\t // even href=\"\" will remove it.\n\t result.hash = relative.hash;\n\t\n\t // if the relative url is empty, then there's nothing left to do here.\n\t if (relative.href === '') {\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t // hrefs like //foo/bar always cut to the protocol.\n\t if (relative.slashes && !relative.protocol) {\n\t // take everything except the protocol from relative\n\t var rkeys = Object.keys(relative);\n\t for (var rk = 0; rk < rkeys.length; rk++) {\n\t var rkey = rkeys[rk];\n\t if (rkey !== 'protocol')\n\t result[rkey] = relative[rkey];\n\t }\n\t\n\t //urlParse appends trailing / to urls like http://www.example.com\n\t if (slashedProtocol[result.protocol] &&\n\t result.hostname && !result.pathname) {\n\t result.path = result.pathname = '/';\n\t }\n\t\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t if (relative.protocol && relative.protocol !== result.protocol) {\n\t // if it's a known url protocol, then changing\n\t // the protocol does weird things\n\t // first, if it's not file:, then we MUST have a host,\n\t // and if there was a path\n\t // to begin with, then we MUST have a path.\n\t // if it is file:, then the host is dropped,\n\t // because that's known to be hostless.\n\t // anything else is assumed to be absolute.\n\t if (!slashedProtocol[relative.protocol]) {\n\t var keys = Object.keys(relative);\n\t for (var v = 0; v < keys.length; v++) {\n\t var k = keys[v];\n\t result[k] = relative[k];\n\t }\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t result.protocol = relative.protocol;\n\t if (!relative.host && !hostlessProtocol[relative.protocol]) {\n\t var relPath = (relative.pathname || '').split('/');\n\t while (relPath.length && !(relative.host = relPath.shift()));\n\t if (!relative.host) relative.host = '';\n\t if (!relative.hostname) relative.hostname = '';\n\t if (relPath[0] !== '') relPath.unshift('');\n\t if (relPath.length < 2) relPath.unshift('');\n\t result.pathname = relPath.join('/');\n\t } else {\n\t result.pathname = relative.pathname;\n\t }\n\t result.search = relative.search;\n\t result.query = relative.query;\n\t result.host = relative.host || '';\n\t result.auth = relative.auth;\n\t result.hostname = relative.hostname || relative.host;\n\t result.port = relative.port;\n\t // to support http.request\n\t if (result.pathname || result.search) {\n\t var p = result.pathname || '';\n\t var s = result.search || '';\n\t result.path = p + s;\n\t }\n\t result.slashes = result.slashes || relative.slashes;\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'),\n\t isRelAbs = (\n\t relative.host ||\n\t relative.pathname && relative.pathname.charAt(0) === '/'\n\t ),\n\t mustEndAbs = (isRelAbs || isSourceAbs ||\n\t (result.host && relative.pathname)),\n\t removeAllDots = mustEndAbs,\n\t srcPath = result.pathname && result.pathname.split('/') || [],\n\t relPath = relative.pathname && relative.pathname.split('/') || [],\n\t psychotic = result.protocol && !slashedProtocol[result.protocol];\n\t\n\t // if the url is a non-slashed url, then relative\n\t // links like ../.. should be able\n\t // to crawl up to the hostname, as well. This is strange.\n\t // result.protocol has already been set by now.\n\t // Later on, put the first path part into the host field.\n\t if (psychotic) {\n\t result.hostname = '';\n\t result.port = null;\n\t if (result.host) {\n\t if (srcPath[0] === '') srcPath[0] = result.host;\n\t else srcPath.unshift(result.host);\n\t }\n\t result.host = '';\n\t if (relative.protocol) {\n\t relative.hostname = null;\n\t relative.port = null;\n\t if (relative.host) {\n\t if (relPath[0] === '') relPath[0] = relative.host;\n\t else relPath.unshift(relative.host);\n\t }\n\t relative.host = null;\n\t }\n\t mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === '');\n\t }\n\t\n\t if (isRelAbs) {\n\t // it's absolute.\n\t result.host = (relative.host || relative.host === '') ?\n\t relative.host : result.host;\n\t result.hostname = (relative.hostname || relative.hostname === '') ?\n\t relative.hostname : result.hostname;\n\t result.search = relative.search;\n\t result.query = relative.query;\n\t srcPath = relPath;\n\t // fall through to the dot-handling below.\n\t } else if (relPath.length) {\n\t // it's relative\n\t // throw away the existing file, and take the new path instead.\n\t if (!srcPath) srcPath = [];\n\t srcPath.pop();\n\t srcPath = srcPath.concat(relPath);\n\t result.search = relative.search;\n\t result.query = relative.query;\n\t } else if (!util.isNullOrUndefined(relative.search)) {\n\t // just pull out the search.\n\t // like href='https://github.com/?foo'.\n\t // Put this after the other two cases because it simplifies the booleans\n\t if (psychotic) {\n\t result.hostname = result.host = srcPath.shift();\n\t //occationaly the auth can get stuck only in host\n\t //this especially happens in cases like\n\t //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n\t var authInHost = result.host && result.host.indexOf('@') > 0 ?\n\t result.host.split('@') : false;\n\t if (authInHost) {\n\t result.auth = authInHost.shift();\n\t result.host = result.hostname = authInHost.shift();\n\t }\n\t }\n\t result.search = relative.search;\n\t result.query = relative.query;\n\t //to support http.request\n\t if (!util.isNull(result.pathname) || !util.isNull(result.search)) {\n\t result.path = (result.pathname ? result.pathname : '') +\n\t (result.search ? result.search : '');\n\t }\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t if (!srcPath.length) {\n\t // no path at all. easy.\n\t // we've already handled the other stuff above.\n\t result.pathname = null;\n\t //to support http.request\n\t if (result.search) {\n\t result.path = '/' + result.search;\n\t } else {\n\t result.path = null;\n\t }\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t // if a url ENDs in . or .., then it must get a trailing slash.\n\t // however, if it ends in anything else non-slashy,\n\t // then it must NOT get a trailing slash.\n\t var last = srcPath.slice(-1)[0];\n\t var hasTrailingSlash = (\n\t (result.host || relative.host || srcPath.length > 1) &&\n\t (last === '.' || last === '..') || last === '');\n\t\n\t // strip single dots, resolve double dots to parent dir\n\t // if the path tries to go above the root, `up` ends up > 0\n\t var up = 0;\n\t for (var i = srcPath.length; i >= 0; i--) {\n\t last = srcPath[i];\n\t if (last === '.') {\n\t srcPath.splice(i, 1);\n\t } else if (last === '..') {\n\t srcPath.splice(i, 1);\n\t up++;\n\t } else if (up) {\n\t srcPath.splice(i, 1);\n\t up--;\n\t }\n\t }\n\t\n\t // if the path is allowed to go above the root, restore leading ..s\n\t if (!mustEndAbs && !removeAllDots) {\n\t for (; up--; up) {\n\t srcPath.unshift('..');\n\t }\n\t }\n\t\n\t if (mustEndAbs && srcPath[0] !== '' &&\n\t (!srcPath[0] || srcPath[0].charAt(0) !== '/')) {\n\t srcPath.unshift('');\n\t }\n\t\n\t if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) {\n\t srcPath.push('');\n\t }\n\t\n\t var isAbsolute = srcPath[0] === '' ||\n\t (srcPath[0] && srcPath[0].charAt(0) === '/');\n\t\n\t // put the host back\n\t if (psychotic) {\n\t result.hostname = result.host = isAbsolute ? '' :\n\t srcPath.length ? srcPath.shift() : '';\n\t //occationaly the auth can get stuck only in host\n\t //this especially happens in cases like\n\t //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n\t var authInHost = result.host && result.host.indexOf('@') > 0 ?\n\t result.host.split('@') : false;\n\t if (authInHost) {\n\t result.auth = authInHost.shift();\n\t result.host = result.hostname = authInHost.shift();\n\t }\n\t }\n\t\n\t mustEndAbs = mustEndAbs || (result.host && srcPath.length);\n\t\n\t if (mustEndAbs && !isAbsolute) {\n\t srcPath.unshift('');\n\t }\n\t\n\t if (!srcPath.length) {\n\t result.pathname = null;\n\t result.path = null;\n\t } else {\n\t result.pathname = srcPath.join('/');\n\t }\n\t\n\t //to support request.http\n\t if (!util.isNull(result.pathname) || !util.isNull(result.search)) {\n\t result.path = (result.pathname ? result.pathname : '') +\n\t (result.search ? result.search : '');\n\t }\n\t result.auth = relative.auth || result.auth;\n\t result.slashes = result.slashes || relative.slashes;\n\t result.href = result.format();\n\t return result;\n\t};\n\t\n\tUrl.prototype.parseHost = function() {\n\t var host = this.host;\n\t var port = portPattern.exec(host);\n\t if (port) {\n\t port = port[0];\n\t if (port !== ':') {\n\t this.port = port.substr(1);\n\t }\n\t host = host.substr(0, host.length - port.length);\n\t }\n\t if (host) this.hostname = host;\n\t};\n\n\n/***/ },\n/* 17 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(module, global) {/*! https://mths.be/punycode v1.3.2 by @mathias */\n\t;(function(root) {\n\t\n\t\t/** Detect free variables */\n\t\tvar freeExports = typeof exports == 'object' && exports &&\n\t\t\t!exports.nodeType && exports;\n\t\tvar freeModule = typeof module == 'object' && module &&\n\t\t\t!module.nodeType && module;\n\t\tvar freeGlobal = typeof global == 'object' && global;\n\t\tif (\n\t\t\tfreeGlobal.global === freeGlobal ||\n\t\t\tfreeGlobal.window === freeGlobal ||\n\t\t\tfreeGlobal.self === freeGlobal\n\t\t) {\n\t\t\troot = freeGlobal;\n\t\t}\n\t\n\t\t/**\n\t\t * The `punycode` object.\n\t\t * @name punycode\n\t\t * @type Object\n\t\t */\n\t\tvar punycode,\n\t\n\t\t/** Highest positive signed 32-bit float value */\n\t\tmaxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1\n\t\n\t\t/** Bootstring parameters */\n\t\tbase = 36,\n\t\ttMin = 1,\n\t\ttMax = 26,\n\t\tskew = 38,\n\t\tdamp = 700,\n\t\tinitialBias = 72,\n\t\tinitialN = 128, // 0x80\n\t\tdelimiter = '-', // '\\x2D'\n\t\n\t\t/** Regular expressions */\n\t\tregexPunycode = /^xn--/,\n\t\tregexNonASCII = /[^\\x20-\\x7E]/, // unprintable ASCII chars + non-ASCII chars\n\t\tregexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g, // RFC 3490 separators\n\t\n\t\t/** Error messages */\n\t\terrors = {\n\t\t\t'overflow': 'Overflow: input needs wider integers to process',\n\t\t\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t\t\t'invalid-input': 'Invalid input'\n\t\t},\n\t\n\t\t/** Convenience shortcuts */\n\t\tbaseMinusTMin = base - tMin,\n\t\tfloor = Math.floor,\n\t\tstringFromCharCode = String.fromCharCode,\n\t\n\t\t/** Temporary variable */\n\t\tkey;\n\t\n\t\t/*--------------------------------------------------------------------------*/\n\t\n\t\t/**\n\t\t * A generic error utility function.\n\t\t * @private\n\t\t * @param {String} type The error type.\n\t\t * @returns {Error} Throws a `RangeError` with the applicable error message.\n\t\t */\n\t\tfunction error(type) {\n\t\t\tthrow RangeError(errors[type]);\n\t\t}\n\t\n\t\t/**\n\t\t * A generic `Array#map` utility function.\n\t\t * @private\n\t\t * @param {Array} array The array to iterate over.\n\t\t * @param {Function} callback The function that gets called for every array\n\t\t * item.\n\t\t * @returns {Array} A new array of values returned by the callback function.\n\t\t */\n\t\tfunction map(array, fn) {\n\t\t\tvar length = array.length;\n\t\t\tvar result = [];\n\t\t\twhile (length--) {\n\t\t\t\tresult[length] = fn(array[length]);\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\n\t\t/**\n\t\t * A simple `Array#map`-like wrapper to work with domain name strings or email\n\t\t * addresses.\n\t\t * @private\n\t\t * @param {String} domain The domain name or email address.\n\t\t * @param {Function} callback The function that gets called for every\n\t\t * character.\n\t\t * @returns {Array} A new string of characters returned by the callback\n\t\t * function.\n\t\t */\n\t\tfunction mapDomain(string, fn) {\n\t\t\tvar parts = string.split('@');\n\t\t\tvar result = '';\n\t\t\tif (parts.length > 1) {\n\t\t\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t\t\t// the local part (i.e. everything up to `@`) intact.\n\t\t\t\tresult = parts[0] + '@';\n\t\t\t\tstring = parts[1];\n\t\t\t}\n\t\t\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\t\t\tstring = string.replace(regexSeparators, '\\x2E');\n\t\t\tvar labels = string.split('.');\n\t\t\tvar encoded = map(labels, fn).join('.');\n\t\t\treturn result + encoded;\n\t\t}\n\t\n\t\t/**\n\t\t * Creates an array containing the numeric code points of each Unicode\n\t\t * character in the string. While JavaScript uses UCS-2 internally,\n\t\t * this function will convert a pair of surrogate halves (each of which\n\t\t * UCS-2 exposes as separate characters) into a single code point,\n\t\t * matching UTF-16.\n\t\t * @see `punycode.ucs2.encode`\n\t\t * @see \n\t\t * @memberOf punycode.ucs2\n\t\t * @name decode\n\t\t * @param {String} string The Unicode input string (UCS-2).\n\t\t * @returns {Array} The new array of code points.\n\t\t */\n\t\tfunction ucs2decode(string) {\n\t\t\tvar output = [],\n\t\t\t counter = 0,\n\t\t\t length = string.length,\n\t\t\t value,\n\t\t\t extra;\n\t\t\twhile (counter < length) {\n\t\t\t\tvalue = string.charCodeAt(counter++);\n\t\t\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t\t\t// high surrogate, and there is a next character\n\t\t\t\t\textra = string.charCodeAt(counter++);\n\t\t\t\t\tif ((extra & 0xFC00) == 0xDC00) { // low surrogate\n\t\t\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// unmatched surrogate; only append this code unit, in case the next\n\t\t\t\t\t\t// code unit is the high surrogate of a surrogate pair\n\t\t\t\t\t\toutput.push(value);\n\t\t\t\t\t\tcounter--;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\toutput.push(value);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn output;\n\t\t}\n\t\n\t\t/**\n\t\t * Creates a string based on an array of numeric code points.\n\t\t * @see `punycode.ucs2.decode`\n\t\t * @memberOf punycode.ucs2\n\t\t * @name encode\n\t\t * @param {Array} codePoints The array of numeric code points.\n\t\t * @returns {String} The new Unicode string (UCS-2).\n\t\t */\n\t\tfunction ucs2encode(array) {\n\t\t\treturn map(array, function(value) {\n\t\t\t\tvar output = '';\n\t\t\t\tif (value > 0xFFFF) {\n\t\t\t\t\tvalue -= 0x10000;\n\t\t\t\t\toutput += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);\n\t\t\t\t\tvalue = 0xDC00 | value & 0x3FF;\n\t\t\t\t}\n\t\t\t\toutput += stringFromCharCode(value);\n\t\t\t\treturn output;\n\t\t\t}).join('');\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a basic code point into a digit/integer.\n\t\t * @see `digitToBasic()`\n\t\t * @private\n\t\t * @param {Number} codePoint The basic numeric code point value.\n\t\t * @returns {Number} The numeric value of a basic code point (for use in\n\t\t * representing integers) in the range `0` to `base - 1`, or `base` if\n\t\t * the code point does not represent a value.\n\t\t */\n\t\tfunction basicToDigit(codePoint) {\n\t\t\tif (codePoint - 48 < 10) {\n\t\t\t\treturn codePoint - 22;\n\t\t\t}\n\t\t\tif (codePoint - 65 < 26) {\n\t\t\t\treturn codePoint - 65;\n\t\t\t}\n\t\t\tif (codePoint - 97 < 26) {\n\t\t\t\treturn codePoint - 97;\n\t\t\t}\n\t\t\treturn base;\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a digit/integer into a basic code point.\n\t\t * @see `basicToDigit()`\n\t\t * @private\n\t\t * @param {Number} digit The numeric value of a basic code point.\n\t\t * @returns {Number} The basic code point whose value (when used for\n\t\t * representing integers) is `digit`, which needs to be in the range\n\t\t * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n\t\t * used; else, the lowercase form is used. The behavior is undefined\n\t\t * if `flag` is non-zero and `digit` has no uppercase form.\n\t\t */\n\t\tfunction digitToBasic(digit, flag) {\n\t\t\t// 0..25 map to ASCII a..z or A..Z\n\t\t\t// 26..35 map to ASCII 0..9\n\t\t\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n\t\t}\n\t\n\t\t/**\n\t\t * Bias adaptation function as per section 3.4 of RFC 3492.\n\t\t * http://tools.ietf.org/html/rfc3492#section-3.4\n\t\t * @private\n\t\t */\n\t\tfunction adapt(delta, numPoints, firstTime) {\n\t\t\tvar k = 0;\n\t\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\t\tdelta += floor(delta / numPoints);\n\t\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t\t}\n\t\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n\t\t * symbols.\n\t\t * @memberOf punycode\n\t\t * @param {String} input The Punycode string of ASCII-only symbols.\n\t\t * @returns {String} The resulting string of Unicode symbols.\n\t\t */\n\t\tfunction decode(input) {\n\t\t\t// Don't use UCS-2\n\t\t\tvar output = [],\n\t\t\t inputLength = input.length,\n\t\t\t out,\n\t\t\t i = 0,\n\t\t\t n = initialN,\n\t\t\t bias = initialBias,\n\t\t\t basic,\n\t\t\t j,\n\t\t\t index,\n\t\t\t oldi,\n\t\t\t w,\n\t\t\t k,\n\t\t\t digit,\n\t\t\t t,\n\t\t\t /** Cached calculation results */\n\t\t\t baseMinusT;\n\t\n\t\t\t// Handle the basic code points: let `basic` be the number of input code\n\t\t\t// points before the last delimiter, or `0` if there is none, then copy\n\t\t\t// the first basic code points to the output.\n\t\n\t\t\tbasic = input.lastIndexOf(delimiter);\n\t\t\tif (basic < 0) {\n\t\t\t\tbasic = 0;\n\t\t\t}\n\t\n\t\t\tfor (j = 0; j < basic; ++j) {\n\t\t\t\t// if it's not a basic code point\n\t\t\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\t\t\terror('not-basic');\n\t\t\t\t}\n\t\t\t\toutput.push(input.charCodeAt(j));\n\t\t\t}\n\t\n\t\t\t// Main decoding loop: start just after the last delimiter if any basic code\n\t\t\t// points were copied; start at the beginning otherwise.\n\t\n\t\t\tfor (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\t\n\t\t\t\t// `index` is the index of the next character to be consumed.\n\t\t\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t\t\t// which gets added to `i`. The overflow checking is easier\n\t\t\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t\t\t// value at the end to obtain `delta`.\n\t\t\t\tfor (oldi = i, w = 1, k = base; /* no condition */; k += base) {\n\t\n\t\t\t\t\tif (index >= inputLength) {\n\t\t\t\t\t\terror('invalid-input');\n\t\t\t\t\t}\n\t\n\t\t\t\t\tdigit = basicToDigit(input.charCodeAt(index++));\n\t\n\t\t\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\t\t\terror('overflow');\n\t\t\t\t\t}\n\t\n\t\t\t\t\ti += digit * w;\n\t\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\n\t\t\t\t\tif (digit < t) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tbaseMinusT = base - t;\n\t\t\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\t\t\terror('overflow');\n\t\t\t\t\t}\n\t\n\t\t\t\t\tw *= baseMinusT;\n\t\n\t\t\t\t}\n\t\n\t\t\t\tout = output.length + 1;\n\t\t\t\tbias = adapt(i - oldi, out, oldi == 0);\n\t\n\t\t\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t\t\t// incrementing `n` each time, so we'll fix that now:\n\t\t\t\tif (floor(i / out) > maxInt - n) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\t\n\t\t\t\tn += floor(i / out);\n\t\t\t\ti %= out;\n\t\n\t\t\t\t// Insert `n` at position `i` of the output\n\t\t\t\toutput.splice(i++, 0, n);\n\t\n\t\t\t}\n\t\n\t\t\treturn ucs2encode(output);\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a string of Unicode symbols (e.g. a domain name label) to a\n\t\t * Punycode string of ASCII-only symbols.\n\t\t * @memberOf punycode\n\t\t * @param {String} input The string of Unicode symbols.\n\t\t * @returns {String} The resulting Punycode string of ASCII-only symbols.\n\t\t */\n\t\tfunction encode(input) {\n\t\t\tvar n,\n\t\t\t delta,\n\t\t\t handledCPCount,\n\t\t\t basicLength,\n\t\t\t bias,\n\t\t\t j,\n\t\t\t m,\n\t\t\t q,\n\t\t\t k,\n\t\t\t t,\n\t\t\t currentValue,\n\t\t\t output = [],\n\t\t\t /** `inputLength` will hold the number of code points in `input`. */\n\t\t\t inputLength,\n\t\t\t /** Cached calculation results */\n\t\t\t handledCPCountPlusOne,\n\t\t\t baseMinusT,\n\t\t\t qMinusT;\n\t\n\t\t\t// Convert the input in UCS-2 to Unicode\n\t\t\tinput = ucs2decode(input);\n\t\n\t\t\t// Cache the length\n\t\t\tinputLength = input.length;\n\t\n\t\t\t// Initialize the state\n\t\t\tn = initialN;\n\t\t\tdelta = 0;\n\t\t\tbias = initialBias;\n\t\n\t\t\t// Handle the basic code points\n\t\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\t\tcurrentValue = input[j];\n\t\t\t\tif (currentValue < 0x80) {\n\t\t\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\thandledCPCount = basicLength = output.length;\n\t\n\t\t\t// `handledCPCount` is the number of code points that have been handled;\n\t\t\t// `basicLength` is the number of basic code points.\n\t\n\t\t\t// Finish the basic string - if it is not empty - with a delimiter\n\t\t\tif (basicLength) {\n\t\t\t\toutput.push(delimiter);\n\t\t\t}\n\t\n\t\t\t// Main encoding loop:\n\t\t\twhile (handledCPCount < inputLength) {\n\t\n\t\t\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t\t\t// larger one:\n\t\t\t\tfor (m = maxInt, j = 0; j < inputLength; ++j) {\n\t\t\t\t\tcurrentValue = input[j];\n\t\t\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\t\t\tm = currentValue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\t// Increase `delta` enough to advance the decoder's state to ,\n\t\t\t\t// but guard against overflow\n\t\t\t\thandledCPCountPlusOne = handledCPCount + 1;\n\t\t\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\t\n\t\t\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\t\t\tn = m;\n\t\n\t\t\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\t\t\tcurrentValue = input[j];\n\t\n\t\t\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\t\t\terror('overflow');\n\t\t\t\t\t}\n\t\n\t\t\t\t\tif (currentValue == n) {\n\t\t\t\t\t\t// Represent delta as a generalized variable-length integer\n\t\t\t\t\t\tfor (q = delta, k = base; /* no condition */; k += base) {\n\t\t\t\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tqMinusT = q - t;\n\t\t\t\t\t\t\tbaseMinusT = base - t;\n\t\t\t\t\t\t\toutput.push(\n\t\t\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\t\t\tdelta = 0;\n\t\t\t\t\t\t++handledCPCount;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\t++delta;\n\t\t\t\t++n;\n\t\n\t\t\t}\n\t\t\treturn output.join('');\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a Punycode string representing a domain name or an email address\n\t\t * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n\t\t * it doesn't matter if you call it on a string that has already been\n\t\t * converted to Unicode.\n\t\t * @memberOf punycode\n\t\t * @param {String} input The Punycoded domain name or email address to\n\t\t * convert to Unicode.\n\t\t * @returns {String} The Unicode representation of the given Punycode\n\t\t * string.\n\t\t */\n\t\tfunction toUnicode(input) {\n\t\t\treturn mapDomain(input, function(string) {\n\t\t\t\treturn regexPunycode.test(string)\n\t\t\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t\t\t: string;\n\t\t\t});\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a Unicode string representing a domain name or an email address to\n\t\t * Punycode. Only the non-ASCII parts of the domain name will be converted,\n\t\t * i.e. it doesn't matter if you call it with a domain that's already in\n\t\t * ASCII.\n\t\t * @memberOf punycode\n\t\t * @param {String} input The domain name or email address to convert, as a\n\t\t * Unicode string.\n\t\t * @returns {String} The Punycode representation of the given domain name or\n\t\t * email address.\n\t\t */\n\t\tfunction toASCII(input) {\n\t\t\treturn mapDomain(input, function(string) {\n\t\t\t\treturn regexNonASCII.test(string)\n\t\t\t\t\t? 'xn--' + encode(string)\n\t\t\t\t\t: string;\n\t\t\t});\n\t\t}\n\t\n\t\t/*--------------------------------------------------------------------------*/\n\t\n\t\t/** Define the public API */\n\t\tpunycode = {\n\t\t\t/**\n\t\t\t * A string representing the current Punycode.js version number.\n\t\t\t * @memberOf punycode\n\t\t\t * @type String\n\t\t\t */\n\t\t\t'version': '1.3.2',\n\t\t\t/**\n\t\t\t * An object of methods to convert from JavaScript's internal character\n\t\t\t * representation (UCS-2) to Unicode code points, and back.\n\t\t\t * @see \n\t\t\t * @memberOf punycode\n\t\t\t * @type Object\n\t\t\t */\n\t\t\t'ucs2': {\n\t\t\t\t'decode': ucs2decode,\n\t\t\t\t'encode': ucs2encode\n\t\t\t},\n\t\t\t'decode': decode,\n\t\t\t'encode': encode,\n\t\t\t'toASCII': toASCII,\n\t\t\t'toUnicode': toUnicode\n\t\t};\n\t\n\t\t/** Expose `punycode` */\n\t\t// Some AMD build optimizers, like r.js, check for specific condition patterns\n\t\t// like the following:\n\t\tif (\n\t\t\ttrue\n\t\t) {\n\t\t\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function() {\n\t\t\t\treturn punycode;\n\t\t\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t\t} else if (freeExports && freeModule) {\n\t\t\tif (module.exports == freeExports) { // in Node.js or RingoJS v0.8.0+\n\t\t\t\tfreeModule.exports = punycode;\n\t\t\t} else { // in Narwhal or RingoJS v0.7.0-\n\t\t\t\tfor (key in punycode) {\n\t\t\t\t\tpunycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]);\n\t\t\t\t}\n\t\t\t}\n\t\t} else { // in Rhino or a web browser\n\t\t\troot.punycode = punycode;\n\t\t}\n\t\n\t}(this));\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(18)(module), (function() { return this; }())))\n\n/***/ },\n/* 18 */\n/***/ function(module, exports) {\n\n\tmodule.exports = function(module) {\r\n\t\tif(!module.webpackPolyfill) {\r\n\t\t\tmodule.deprecate = function() {};\r\n\t\t\tmodule.paths = [];\r\n\t\t\t// module.parent = undefined by default\r\n\t\t\tmodule.children = [];\r\n\t\t\tmodule.webpackPolyfill = 1;\r\n\t\t}\r\n\t\treturn module;\r\n\t}\r\n\n\n/***/ },\n/* 19 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = {\n\t isString: function(arg) {\n\t return typeof(arg) === 'string';\n\t },\n\t isObject: function(arg) {\n\t return typeof(arg) === 'object' && arg !== null;\n\t },\n\t isNull: function(arg) {\n\t return arg === null;\n\t },\n\t isNullOrUndefined: function(arg) {\n\t return arg == null;\n\t }\n\t};\n\n\n/***/ },\n/* 20 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\texports.decode = exports.parse = __webpack_require__(21);\n\texports.encode = exports.stringify = __webpack_require__(22);\n\n\n/***/ },\n/* 21 */\n/***/ function(module, exports) {\n\n\t// Copyright Joyent, Inc. and other Node contributors.\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a\n\t// copy of this software and associated documentation files (the\n\t// \"Software\"), to deal in the Software without restriction, including\n\t// without limitation the rights to use, copy, modify, merge, publish,\n\t// distribute, sublicense, and/or sell copies of the Software, and to permit\n\t// persons to whom the Software is furnished to do so, subject to the\n\t// following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included\n\t// in all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n\t// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\t// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n\t// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n\t// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n\t// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n\t// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\t\n\t'use strict';\n\t\n\t// If obj.hasOwnProperty has been overridden, then calling\n\t// obj.hasOwnProperty(prop) will break.\n\t// See: https://github.com/joyent/node/issues/1707\n\tfunction hasOwnProperty(obj, prop) {\n\t return Object.prototype.hasOwnProperty.call(obj, prop);\n\t}\n\t\n\tmodule.exports = function(qs, sep, eq, options) {\n\t sep = sep || '&';\n\t eq = eq || '=';\n\t var obj = {};\n\t\n\t if (typeof qs !== 'string' || qs.length === 0) {\n\t return obj;\n\t }\n\t\n\t var regexp = /\\+/g;\n\t qs = qs.split(sep);\n\t\n\t var maxKeys = 1000;\n\t if (options && typeof options.maxKeys === 'number') {\n\t maxKeys = options.maxKeys;\n\t }\n\t\n\t var len = qs.length;\n\t // maxKeys <= 0 means that we should not limit keys count\n\t if (maxKeys > 0 && len > maxKeys) {\n\t len = maxKeys;\n\t }\n\t\n\t for (var i = 0; i < len; ++i) {\n\t var x = qs[i].replace(regexp, '%20'),\n\t idx = x.indexOf(eq),\n\t kstr, vstr, k, v;\n\t\n\t if (idx >= 0) {\n\t kstr = x.substr(0, idx);\n\t vstr = x.substr(idx + 1);\n\t } else {\n\t kstr = x;\n\t vstr = '';\n\t }\n\t\n\t k = decodeURIComponent(kstr);\n\t v = decodeURIComponent(vstr);\n\t\n\t if (!hasOwnProperty(obj, k)) {\n\t obj[k] = v;\n\t } else if (Array.isArray(obj[k])) {\n\t obj[k].push(v);\n\t } else {\n\t obj[k] = [obj[k], v];\n\t }\n\t }\n\t\n\t return obj;\n\t};\n\n\n/***/ },\n/* 22 */\n/***/ function(module, exports) {\n\n\t// Copyright Joyent, Inc. and other Node contributors.\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a\n\t// copy of this software and associated documentation files (the\n\t// \"Software\"), to deal in the Software without restriction, including\n\t// without limitation the rights to use, copy, modify, merge, publish,\n\t// distribute, sublicense, and/or sell copies of the Software, and to permit\n\t// persons to whom the Software is furnished to do so, subject to the\n\t// following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included\n\t// in all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n\t// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\t// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n\t// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n\t// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n\t// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n\t// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\t\n\t'use strict';\n\t\n\tvar stringifyPrimitive = function(v) {\n\t switch (typeof v) {\n\t case 'string':\n\t return v;\n\t\n\t case 'boolean':\n\t return v ? 'true' : 'false';\n\t\n\t case 'number':\n\t return isFinite(v) ? v : '';\n\t\n\t default:\n\t return '';\n\t }\n\t};\n\t\n\tmodule.exports = function(obj, sep, eq, name) {\n\t sep = sep || '&';\n\t eq = eq || '=';\n\t if (obj === null) {\n\t obj = undefined;\n\t }\n\t\n\t if (typeof obj === 'object') {\n\t return Object.keys(obj).map(function(k) {\n\t var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;\n\t if (Array.isArray(obj[k])) {\n\t return obj[k].map(function(v) {\n\t return ks + encodeURIComponent(stringifyPrimitive(v));\n\t }).join(sep);\n\t } else {\n\t return ks + encodeURIComponent(stringifyPrimitive(obj[k]));\n\t }\n\t }).join(sep);\n\t\n\t }\n\t\n\t if (!name) return '';\n\t return encodeURIComponent(stringifyPrimitive(name)) + eq +\n\t encodeURIComponent(stringifyPrimitive(obj));\n\t};\n\n\n/***/ },\n/* 23 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"id\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"description\": \"Core schema meta-schema\",\n\t\t\"definitions\": {\n\t\t\t\"schemaArray\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"minItems\": 1,\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"positiveInteger\": {\n\t\t\t\t\"type\": \"integer\",\n\t\t\t\t\"minimum\": 0\n\t\t\t},\n\t\t\t\"positiveIntegerDefault0\": {\n\t\t\t\t\"allOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#/definitions/positiveInteger\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"default\": 0\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"simpleTypes\": {\n\t\t\t\t\"enum\": [\n\t\t\t\t\t\"array\",\n\t\t\t\t\t\"boolean\",\n\t\t\t\t\t\"integer\",\n\t\t\t\t\t\"null\",\n\t\t\t\t\t\"number\",\n\t\t\t\t\t\"object\",\n\t\t\t\t\t\"string\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"stringArray\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t},\n\t\t\t\t\"minItems\": 1,\n\t\t\t\t\"uniqueItems\": true\n\t\t\t}\n\t\t},\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"id\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"uri\"\n\t\t\t},\n\t\t\t\"$schema\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"uri\"\n\t\t\t},\n\t\t\t\"title\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"description\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"default\": {},\n\t\t\t\"multipleOf\": {\n\t\t\t\t\"type\": \"number\",\n\t\t\t\t\"minimum\": 0,\n\t\t\t\t\"exclusiveMinimum\": true\n\t\t\t},\n\t\t\t\"maximum\": {\n\t\t\t\t\"type\": \"number\"\n\t\t\t},\n\t\t\t\"exclusiveMaximum\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"minimum\": {\n\t\t\t\t\"type\": \"number\"\n\t\t\t},\n\t\t\t\"exclusiveMinimum\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"maxLength\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveInteger\"\n\t\t\t},\n\t\t\t\"minLength\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveIntegerDefault0\"\n\t\t\t},\n\t\t\t\"pattern\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"regex\"\n\t\t\t},\n\t\t\t\"additionalItems\": {\n\t\t\t\t\"anyOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"boolean\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"items\": {\n\t\t\t\t\"anyOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#/definitions/schemaArray\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"maxItems\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveInteger\"\n\t\t\t},\n\t\t\t\"minItems\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveIntegerDefault0\"\n\t\t\t},\n\t\t\t\"uniqueItems\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"maxProperties\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveInteger\"\n\t\t\t},\n\t\t\t\"minProperties\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveIntegerDefault0\"\n\t\t\t},\n\t\t\t\"required\": {\n\t\t\t\t\"$ref\": \"#/definitions/stringArray\"\n\t\t\t},\n\t\t\t\"additionalProperties\": {\n\t\t\t\t\"anyOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"boolean\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"definitions\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": {\n\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t},\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"properties\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": {\n\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t},\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"patternProperties\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": {\n\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t},\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"dependencies\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": {\n\t\t\t\t\t\"anyOf\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"$ref\": \"#/definitions/stringArray\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"enum\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"minItems\": 1,\n\t\t\t\t\"uniqueItems\": true\n\t\t\t},\n\t\t\t\"type\": {\n\t\t\t\t\"anyOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#/definitions/simpleTypes\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"array\",\n\t\t\t\t\t\t\"items\": {\n\t\t\t\t\t\t\t\"$ref\": \"#/definitions/simpleTypes\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"minItems\": 1,\n\t\t\t\t\t\t\"uniqueItems\": true\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"allOf\": {\n\t\t\t\t\"$ref\": \"#/definitions/schemaArray\"\n\t\t\t},\n\t\t\t\"anyOf\": {\n\t\t\t\t\"$ref\": \"#/definitions/schemaArray\"\n\t\t\t},\n\t\t\t\"oneOf\": {\n\t\t\t\t\"$ref\": \"#/definitions/schemaArray\"\n\t\t\t},\n\t\t\t\"not\": {\n\t\t\t\t\"$ref\": \"#\"\n\t\t\t}\n\t\t},\n\t\t\"dependencies\": {\n\t\t\t\"exclusiveMaximum\": [\n\t\t\t\t\"maximum\"\n\t\t\t],\n\t\t\t\"exclusiveMinimum\": [\n\t\t\t\t\"minimum\"\n\t\t\t]\n\t\t},\n\t\t\"default\": {}\n\t};\n\n/***/ },\n/* 24 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tvar formats = {};\n\t\n\t// reference: http://dansnetwork.com/javascript-iso8601rfc3339-date-parser/\n\tformats['date-time'] = /(\\d\\d\\d\\d)(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))/;\n\t// reference: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js#L7\n\tformats.uri = /^([a-zA-Z][a-zA-Z0-9+-.]*:){0,1}\\/\\/[^\\s]*$/;\n\t// reference: http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363\n\t// http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'willful violation')\n\tformats.email = /^[a-zA-Z0-9.!#$%&'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n\t// reference: https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html\n\tformats.ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;\n\t// reference: http://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses\n\tformats.ipv6 = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|[fF][eE]80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::([fF]{4}(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;\n\t// reference: http://stackoverflow.com/questions/106179/regular-expression-to-match-dns-hostname-or-ip-address#answer-3824105\n\tformats.hostname = /^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])(\\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]))*$/;\n\t\n\tmodule.exports = formats;\n\n/***/ },\n/* 25 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\t// Reference: https://github.com/bestiejs/punycode.js/blob/master/punycode.js#L101`\n\t// Info: https://mathiasbynens.be/notes/javascript-unicode\n\tfunction ucs2length(string) {\n\t var ucs2len = 0,\n\t counter = 0,\n\t length = string.length,\n\t value, extra;\n\t\n\t while (counter < length) {\n\t ucs2len++;\n\t value = string.charCodeAt(counter++);\n\t\n\t if (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t // It's a high surrogate, and there is a next character.\n\t extra = string.charCodeAt(counter++);\n\t\n\t if ((extra & 0xFC00) !== 0xDC00) { /* Low surrogate. */ // jshint ignore: line\n\t counter--;\n\t }\n\t }\n\t }\n\t\n\t return ucs2len;\n\t}\n\t\n\tmodule.exports = ucs2length;\n\n/***/ }\n/******/ ])\n});\n;\n//# sourceMappingURL=models.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/powerbi-models/dist/models.js\n// module id = 5\n// module chunks = 0","import { IFilterable } from './ifilterable';\r\nimport { IReportNode } from './report';\r\nimport * as models from 'powerbi-models';\r\n\r\n/**\r\n * A Page node within a report hierarchy\r\n * \r\n * @export\r\n * @interface IPageNode\r\n */\r\nexport interface IPageNode {\r\n report: IReportNode;\r\n name: string;\r\n}\r\n\r\n/**\r\n * A Power BI report page\r\n * \r\n * @export\r\n * @class Page\r\n * @implements {IPageNode}\r\n * @implements {IFilterable}\r\n */\r\nexport class Page implements IPageNode, IFilterable {\r\n /**\r\n * The parent Power BI report that this page is a member of\r\n * \r\n * @type {IReportNode}\r\n */\r\n report: IReportNode;\r\n /**\r\n * The report page name\r\n * \r\n * @type {string}\r\n */\r\n name: string;\r\n\r\n /**\r\n * The user defined display name of the report page, which is undefined if the page is created manually\r\n * \r\n * @type {string}\r\n */\r\n displayName: string;\r\n\r\n /**\r\n * Creates an instance of a Power BI report page.\r\n * \r\n * @param {IReportNode} report\r\n * @param {string} name\r\n * @param {string} [displayName]\r\n */\r\n constructor(report: IReportNode, name: string, displayName?: string) {\r\n this.report = report;\r\n this.name = name;\r\n this.displayName = displayName;\r\n }\r\n\r\n /**\r\n * Gets all page level filters within the report.\r\n * \r\n * ```javascript\r\n * page.getFilters()\r\n * .then(pages => { ... });\r\n * ```\r\n * \r\n * @returns {(Promise)}\r\n */\r\n getFilters(): Promise {\r\n return this.report.service.hpm.get(`/report/pages/${this.name}/filters`, { uid: this.report.config.uniqueId }, this.report.iframe.contentWindow)\r\n .then(response => response.body,\r\n response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Removes all filters from this page of the report.\r\n * \r\n * ```javascript\r\n * page.removeFilters();\r\n * ```\r\n * \r\n * @returns {Promise}\r\n */\r\n removeFilters(): Promise {\r\n return this.setFilters([]);\r\n }\r\n\r\n /**\r\n * Makes the current page the active page of the report.\r\n * \r\n * ```javascripot\r\n * page.setActive();\r\n * ```\r\n * \r\n * @returns {Promise}\r\n */\r\n setActive(): Promise {\r\n const page: models.IPage = {\r\n name: this.name,\r\n displayName: null\r\n };\r\n\r\n return this.report.service.hpm.put('/report/pages/active', page, { uid: this.report.config.uniqueId }, this.report.iframe.contentWindow)\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Sets all filters on the current page.\r\n * \r\n * ```javascript\r\n * page.setFilters(filters);\r\n * .catch(errors => { ... });\r\n * ```\r\n * \r\n * @param {(models.IFilter[])} filters\r\n * @returns {Promise}\r\n */\r\n setFilters(filters: models.IFilter[]): Promise {\r\n return this.report.service.hpm.put(`/report/pages/${this.name}/filters`, filters, { uid: this.report.config.uniqueId }, this.report.iframe.contentWindow)\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/page.ts","import * as service from './service';\r\nimport * as models from 'powerbi-models';\r\nimport * as embed from './embed';\r\n\r\nexport class Create extends embed.Embed {\r\n\r\n constructor(service: service.Service, element: HTMLElement, config: embed.IEmbedConfiguration) {\r\n super(service, element, config);\r\n }\r\n\r\n /**\r\n * Gets the dataset ID from the first available location: createConfig or embed url.\r\n * \r\n * @returns {string}\r\n */\r\n getId(): string {\r\n const datasetId = (this.createConfig && this.createConfig.datasetId) ? this.createConfig.datasetId : Create.findIdFromEmbedUrl(this.config.embedUrl);\r\n\r\n if (typeof datasetId !== 'string' || datasetId.length === 0) {\r\n throw new Error('Dataset id is required, but it was not found. You must provide an id either as part of embed configuration.');\r\n }\r\n\r\n return datasetId;\r\n }\r\n\r\n /**\r\n * Validate create report configuration.\r\n */\r\n validate(config: models.IReportCreateConfiguration): models.IError[] {\r\n return models.validateCreateReport(config);\r\n }\r\n\r\n /**\r\n * Adds the ability to get datasetId from url. \r\n * (e.g. http://embedded.powerbi.com/appTokenReportEmbed?datasetId=854846ed-2106-4dc2-bc58-eb77533bf2f1).\r\n * \r\n * By extracting the ID we can ensure that the ID is always explicitly provided as part of the create configuration.\r\n * \r\n * @static\r\n * @param {string} url\r\n * @returns {string}\r\n */\r\n static findIdFromEmbedUrl(url: string): string {\r\n const datasetIdRegEx = /datasetId=\"?([^&]+)\"?/\r\n const datasetIdMatch = url.match(datasetIdRegEx);\r\n\r\n let datasetId;\r\n if (datasetIdMatch) {\r\n datasetId = datasetIdMatch[1];\r\n }\r\n\r\n return datasetId;\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/create.ts","import * as service from './service';\r\nimport * as embed from './embed';\r\nimport * as models from 'powerbi-models';\r\nimport * as wpmp from 'window-post-message-proxy';\r\nimport * as hpm from 'http-post-message';\r\nimport * as utils from './util';\r\n\r\n/**\r\n * A Dashboard node within a dashboard hierarchy\r\n * \r\n * @export\r\n * @interface IDashboardNode\r\n */\r\nexport interface IDashboardNode {\r\n iframe: HTMLIFrameElement;\r\n service: service.IService;\r\n config: embed.IInternalEmbedConfiguration\r\n}\r\n\r\n/**\r\n * A Power BI Dashboard embed component\r\n * \r\n * @export\r\n * @class Dashboard\r\n * @extends {embed.Embed}\r\n * @implements {IDashboardNode}\r\n * @implements {IFilterable}\r\n */\r\nexport class Dashboard extends embed.Embed implements IDashboardNode {\r\n static allowedEvents = [\"tileClicked\", \"error\"];\r\n static dashboardIdAttribute = 'powerbi-dashboard-id';\r\n static typeAttribute = 'powerbi-type';\r\n static type = \"Dashboard\";\r\n\r\n /**\r\n * Creates an instance of a Power BI Dashboard.\r\n * \r\n * @param {service.Service} service\r\n * @param {HTMLElement} element\r\n */\r\n constructor(service: service.Service, element: HTMLElement, config: embed.IEmbedConfiguration) {\r\n super(service, element, config);\r\n this.loadPath = \"/dashboard/load\";\r\n Array.prototype.push.apply(this.allowedEvents, Dashboard.allowedEvents);\r\n }\r\n\r\n /**\r\n * This adds backwards compatibility for older config which used the dashboardId query param to specify dashboard id.\r\n * E.g. https://powerbi-df.analysis-df.windows.net/dashboardEmbedHost?dashboardId=e9363c62-edb6-4eac-92d3-2199c5ca2a9e\r\n * \r\n * By extracting the id we can ensure id is always explicitly provided as part of the load configuration.\r\n * \r\n * @static\r\n * @param {string} url\r\n * @returns {string}\r\n */\r\n static findIdFromEmbedUrl(url: string): string {\r\n const dashboardIdRegEx = /dashboardId=\"?([^&]+)\"?/\r\n const dashboardIdMatch = url.match(dashboardIdRegEx);\r\n\r\n let dashboardId;\r\n if (dashboardIdMatch) {\r\n dashboardId = dashboardIdMatch[1];\r\n }\r\n\r\n return dashboardId;\r\n }\r\n\r\n /**\r\n * Get dashboard id from first available location: options, attribute, embed url.\r\n * \r\n * @returns {string}\r\n */\r\n getId(): string {\r\n const dashboardId = this.config.id || this.element.getAttribute(Dashboard.dashboardIdAttribute) || Dashboard.findIdFromEmbedUrl(this.config.embedUrl);\r\n\r\n if (typeof dashboardId !== 'string' || dashboardId.length === 0) {\r\n throw new Error(`Dashboard id is required, but it was not found. You must provide an id either as part of embed configuration or as attribute '${Dashboard.dashboardIdAttribute}'.`);\r\n }\r\n\r\n return dashboardId;\r\n }\r\n\r\n /**\r\n * Validate load configuration.\r\n */\r\n validate(config: models.IDashboardLoadConfiguration): models.IError[] {\r\n let error = models.validateDashboardLoad(config);\r\n return error ? error : this.ValidatePageView(config.pageView);\r\n }\r\n \r\n /**\r\n * Validate that pageView has a legal value: if page view is defined it must have one of the values defined in models.PageView\r\n */\r\n private ValidatePageView(pageView: models.PageView): models.IError[] {\r\n if (pageView && pageView !== \"fitToWidth\" && pageView !== \"oneColumn\" && pageView !== \"actualSize\") {\r\n return [{message: \"pageView must be one of the followings: fitToWidth, oneColumn, actualSize\"}];\r\n }\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/dashboard.ts","import * as models from 'powerbi-models';\r\nimport { Embed } from './embed';\r\n\r\n/**\r\n * The Power BI tile embed component\r\n * \r\n * @export\r\n * @class Tile\r\n * @extends {Embed}\r\n */\r\nexport class Tile extends Embed {\r\n static type = \"Tile\";\r\n\r\n /**\r\n * The ID of the tile\r\n * \r\n * @returns {string}\r\n */\r\n getId(): string {\r\n throw new Error('Not implemented. Embedding tiles is not supported yet.');\r\n }\r\n\r\n /**\r\n * Validate load configuration.\r\n */\r\n validate(config: any): models.IError[] {\r\n throw new Error('Not implemented. Embedding tiles is not supported yet.');\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/tile.ts","/**\r\n * TODO: Need to find better place for these factory functions or refactor how we handle dependency injection\r\n */\r\nimport { IHpmFactory, IWpmpFactory, IRouterFactory } from './service';\r\nimport config from './config';\r\nimport * as wpmp from 'window-post-message-proxy';\r\nimport * as hpm from 'http-post-message';\r\nimport * as router from 'powerbi-router';\r\n\r\nexport {\r\n IHpmFactory,\r\n IWpmpFactory,\r\n IRouterFactory\r\n};\r\n\r\nexport const hpmFactory: IHpmFactory = (wpmp, defaultTargetWindow, sdkVersion = config.version, sdkType = config.type) => {\r\n return new hpm.HttpPostMessage(wpmp, {\r\n 'x-sdk-type': sdkType,\r\n 'x-sdk-version': sdkVersion\r\n }, defaultTargetWindow);\r\n};\r\n\r\nexport const wpmpFactory: IWpmpFactory = (name?: string, logMessages?: boolean, eventSourceOverrideWindow?: Window) => {\r\n return new wpmp.WindowPostMessageProxy({\r\n processTrackingProperties: {\r\n addTrackingProperties: hpm.HttpPostMessage.addTrackingProperties,\r\n getTrackingProperties: hpm.HttpPostMessage.getTrackingProperties,\r\n },\r\n isErrorMessage: hpm.HttpPostMessage.isErrorMessage,\r\n name,\r\n logMessages,\r\n eventSourceOverrideWindow\r\n });\r\n};\r\n\r\nexport const routerFactory: IRouterFactory = (wpmp) => {\r\n return new router.Router(wpmp);\r\n};\n\n\n// WEBPACK FOOTER //\n// ./src/factories.ts","const config = {\r\n version: '2.2.3',\r\n type: 'js'\r\n};\r\n\r\nexport default config;\n\n\n// WEBPACK FOOTER //\n// ./src/config.ts","/*! window-post-message-proxy v0.2.4 | (c) 2016 Microsoft Corporation MIT */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"window-post-message-proxy\"] = factory();\n\telse\n\t\troot[\"window-post-message-proxy\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\tvar WindowPostMessageProxy = (function () {\n\t function WindowPostMessageProxy(options) {\n\t var _this = this;\n\t if (options === void 0) { options = {\n\t processTrackingProperties: {\n\t addTrackingProperties: WindowPostMessageProxy.defaultAddTrackingProperties,\n\t getTrackingProperties: WindowPostMessageProxy.defaultGetTrackingProperties\n\t },\n\t isErrorMessage: WindowPostMessageProxy.defaultIsErrorMessage,\n\t receiveWindow: window,\n\t name: WindowPostMessageProxy.createRandomString()\n\t }; }\n\t this.pendingRequestPromises = {};\n\t // save options with defaults\n\t this.addTrackingProperties = (options.processTrackingProperties && options.processTrackingProperties.addTrackingProperties) || WindowPostMessageProxy.defaultAddTrackingProperties;\n\t this.getTrackingProperties = (options.processTrackingProperties && options.processTrackingProperties.getTrackingProperties) || WindowPostMessageProxy.defaultGetTrackingProperties;\n\t this.isErrorMessage = options.isErrorMessage || WindowPostMessageProxy.defaultIsErrorMessage;\n\t this.receiveWindow = options.receiveWindow || window;\n\t this.name = options.name || WindowPostMessageProxy.createRandomString();\n\t this.logMessages = options.logMessages || false;\n\t this.eventSourceOverrideWindow = options.eventSourceOverrideWindow;\n\t this.suppressWarnings = options.suppressWarnings || false;\n\t if (this.logMessages) {\n\t console.log(\"new WindowPostMessageProxy created with name: \" + this.name + \" receiving on window: \" + this.receiveWindow.document.title);\n\t }\n\t // Initialize\n\t this.handlers = [];\n\t this.windowMessageHandler = function (event) { return _this.onMessageReceived(event); };\n\t this.start();\n\t }\n\t // Static\n\t WindowPostMessageProxy.defaultAddTrackingProperties = function (message, trackingProperties) {\n\t message[WindowPostMessageProxy.messagePropertyName] = trackingProperties;\n\t return message;\n\t };\n\t WindowPostMessageProxy.defaultGetTrackingProperties = function (message) {\n\t return message[WindowPostMessageProxy.messagePropertyName];\n\t };\n\t WindowPostMessageProxy.defaultIsErrorMessage = function (message) {\n\t return !!message.error;\n\t };\n\t /**\n\t * Utility to create a deferred object.\n\t */\n\t // TODO: Look to use RSVP library instead of doing this manually.\n\t // From what I searched RSVP would work better because it has .finally and .deferred; however, it doesn't have Typings information. \n\t WindowPostMessageProxy.createDeferred = function () {\n\t var deferred = {\n\t resolve: null,\n\t reject: null,\n\t promise: null\n\t };\n\t var promise = new Promise(function (resolve, reject) {\n\t deferred.resolve = resolve;\n\t deferred.reject = reject;\n\t });\n\t deferred.promise = promise;\n\t return deferred;\n\t };\n\t /**\n\t * Utility to generate random sequence of characters used as tracking id for promises.\n\t */\n\t WindowPostMessageProxy.createRandomString = function () {\n\t return (Math.random() + 1).toString(36).substring(7);\n\t };\n\t /**\n\t * Adds handler.\n\t * If the first handler whose test method returns true will handle the message and provide a response.\n\t */\n\t WindowPostMessageProxy.prototype.addHandler = function (handler) {\n\t this.handlers.push(handler);\n\t };\n\t /**\n\t * Removes handler.\n\t * The reference must match the original object that was provided when adding the handler.\n\t */\n\t WindowPostMessageProxy.prototype.removeHandler = function (handler) {\n\t var handlerIndex = this.handlers.indexOf(handler);\n\t if (handlerIndex === -1) {\n\t throw new Error(\"You attempted to remove a handler but no matching handler was found.\");\n\t }\n\t this.handlers.splice(handlerIndex, 1);\n\t };\n\t /**\n\t * Start listening to message events.\n\t */\n\t WindowPostMessageProxy.prototype.start = function () {\n\t this.receiveWindow.addEventListener('message', this.windowMessageHandler);\n\t };\n\t /**\n\t * Stops listening to message events.\n\t */\n\t WindowPostMessageProxy.prototype.stop = function () {\n\t this.receiveWindow.removeEventListener('message', this.windowMessageHandler);\n\t };\n\t /**\n\t * Post message to target window with tracking properties added and save deferred object referenced by tracking id.\n\t */\n\t WindowPostMessageProxy.prototype.postMessage = function (targetWindow, message) {\n\t // Add tracking properties to indicate message came from this proxy\n\t var trackingProperties = { id: WindowPostMessageProxy.createRandomString() };\n\t this.addTrackingProperties(message, trackingProperties);\n\t if (this.logMessages) {\n\t console.log(this.name + \" Posting message:\");\n\t console.log(JSON.stringify(message, null, ' '));\n\t }\n\t targetWindow.postMessage(message, \"*\");\n\t var deferred = WindowPostMessageProxy.createDeferred();\n\t this.pendingRequestPromises[trackingProperties.id] = deferred;\n\t return deferred.promise;\n\t };\n\t /**\n\t * Send response message to target window.\n\t * Response messages re-use tracking properties from a previous request message.\n\t */\n\t WindowPostMessageProxy.prototype.sendResponse = function (targetWindow, message, trackingProperties) {\n\t this.addTrackingProperties(message, trackingProperties);\n\t if (this.logMessages) {\n\t console.log(this.name + \" Sending response:\");\n\t console.log(JSON.stringify(message, null, ' '));\n\t }\n\t targetWindow.postMessage(message, \"*\");\n\t };\n\t /**\n\t * Message handler.\n\t */\n\t WindowPostMessageProxy.prototype.onMessageReceived = function (event) {\n\t var _this = this;\n\t if (this.logMessages) {\n\t console.log(this.name + \" Received message:\");\n\t console.log(\"type: \" + event.type);\n\t console.log(JSON.stringify(event.data, null, ' '));\n\t }\n\t var sendingWindow = this.eventSourceOverrideWindow || event.source;\n\t var message = event.data;\n\t if (typeof message !== \"object\") {\n\t if (!this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + this.name + \"): Received message that was not an object. Discarding message\");\n\t }\n\t return;\n\t }\n\t var trackingProperties;\n\t try {\n\t trackingProperties = this.getTrackingProperties(message);\n\t }\n\t catch (e) {\n\t if (!this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + this.name + \"): Error occurred when attempting to get tracking properties from incoming message:\", JSON.stringify(message, null, ' '), \"Error: \", e);\n\t }\n\t }\n\t var deferred;\n\t if (trackingProperties) {\n\t deferred = this.pendingRequestPromises[trackingProperties.id];\n\t }\n\t // If message does not have a known ID, treat it as a request\n\t // Otherwise, treat message as response\n\t if (!deferred) {\n\t var handled = this.handlers.some(function (handler) {\n\t var canMessageBeHandled = false;\n\t try {\n\t canMessageBeHandled = handler.test(message);\n\t }\n\t catch (e) {\n\t if (!_this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + _this.name + \"): Error occurred when handler was testing incoming message:\", JSON.stringify(message, null, ' '), \"Error: \", e);\n\t }\n\t }\n\t if (canMessageBeHandled) {\n\t var responseMessagePromise = void 0;\n\t try {\n\t responseMessagePromise = Promise.resolve(handler.handle(message));\n\t }\n\t catch (e) {\n\t if (!_this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + _this.name + \"): Error occurred when handler was processing incoming message:\", JSON.stringify(message, null, ' '), \"Error: \", e);\n\t }\n\t responseMessagePromise = Promise.resolve();\n\t }\n\t responseMessagePromise\n\t .then(function (responseMessage) {\n\t if (!responseMessage) {\n\t var warningMessage = \"Handler for message: \" + JSON.stringify(message, null, ' ') + \" did not return a response message. The default response message will be returned instead.\";\n\t if (!_this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + _this.name + \"): \" + warningMessage);\n\t }\n\t responseMessage = {\n\t warning: warningMessage\n\t };\n\t }\n\t _this.sendResponse(sendingWindow, responseMessage, trackingProperties);\n\t });\n\t return true;\n\t }\n\t });\n\t /**\n\t * TODO: Consider returning an error message if nothing handled the message.\n\t * In the case of the Report receiving messages all of them should be handled,\n\t * however, in the case of the SDK receiving messages it's likely it won't register handlers\n\t * for all events. Perhaps make this an option at construction time.\n\t */\n\t if (!handled && !this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + this.name + \") did not handle message. Handlers: \" + this.handlers.length + \" Message: \" + JSON.stringify(message, null, '') + \".\");\n\t }\n\t }\n\t else {\n\t /**\n\t * If error message reject promise,\n\t * Otherwise, resolve promise\n\t */\n\t var isErrorMessage = true;\n\t try {\n\t isErrorMessage = this.isErrorMessage(message);\n\t }\n\t catch (e) {\n\t console.warn(\"Proxy(\" + this.name + \") Error occurred when trying to determine if message is consider an error response. Message: \", JSON.stringify(message, null, ''), 'Error: ', e);\n\t }\n\t if (isErrorMessage) {\n\t deferred.reject(message);\n\t }\n\t else {\n\t deferred.resolve(message);\n\t }\n\t // TODO: Move to .finally clause up where promise is created for better maitenance like original proxy code.\n\t delete this.pendingRequestPromises[trackingProperties.id];\n\t }\n\t };\n\t WindowPostMessageProxy.messagePropertyName = \"windowPostMessageProxy\";\n\t return WindowPostMessageProxy;\n\t}());\n\texports.WindowPostMessageProxy = WindowPostMessageProxy;\n\n\n/***/ }\n/******/ ])\n});\n;\n//# sourceMappingURL=windowPostMessageProxy.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/window-post-message-proxy/dist/windowPostMessageProxy.js\n// module id = 12\n// module chunks = 0","/*! http-post-message v0.2.3 | (c) 2016 Microsoft Corporation MIT */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"http-post-message\"] = factory();\n\telse\n\t\troot[\"http-post-message\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\tvar HttpPostMessage = (function () {\n\t function HttpPostMessage(windowPostMessageProxy, defaultHeaders, defaultTargetWindow) {\n\t if (defaultHeaders === void 0) { defaultHeaders = {}; }\n\t this.defaultHeaders = defaultHeaders;\n\t this.defaultTargetWindow = defaultTargetWindow;\n\t this.windowPostMessageProxy = windowPostMessageProxy;\n\t }\n\t // TODO: See if it's possible to share tracking properties interface?\n\t // The responsibility of knowing how to configure windowPostMessageProxy for http should\n\t // live in this http class, but the configuration would need ITrackingProperties\n\t // interface which lives in WindowPostMessageProxy. Use type as workaround\n\t HttpPostMessage.addTrackingProperties = function (message, trackingProperties) {\n\t message.headers = message.headers || {};\n\t if (trackingProperties && trackingProperties.id) {\n\t message.headers.id = trackingProperties.id;\n\t }\n\t return message;\n\t };\n\t HttpPostMessage.getTrackingProperties = function (message) {\n\t return {\n\t id: message.headers && message.headers.id\n\t };\n\t };\n\t HttpPostMessage.isErrorMessage = function (message) {\n\t if (typeof (message && message.statusCode) !== 'number') {\n\t return false;\n\t }\n\t return !(200 <= message.statusCode && message.statusCode < 300);\n\t };\n\t HttpPostMessage.prototype.get = function (url, headers, targetWindow) {\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"GET\",\n\t url: url,\n\t headers: headers\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.post = function (url, body, headers, targetWindow) {\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"POST\",\n\t url: url,\n\t headers: headers,\n\t body: body\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.put = function (url, body, headers, targetWindow) {\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"PUT\",\n\t url: url,\n\t headers: headers,\n\t body: body\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.patch = function (url, body, headers, targetWindow) {\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"PATCH\",\n\t url: url,\n\t headers: headers,\n\t body: body\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.delete = function (url, body, headers, targetWindow) {\n\t if (body === void 0) { body = null; }\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"DELETE\",\n\t url: url,\n\t headers: headers,\n\t body: body\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.send = function (request, targetWindow) {\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t request.headers = this.assign({}, this.defaultHeaders, request.headers);\n\t if (!targetWindow) {\n\t throw new Error(\"target window is not provided. You must either provide the target window explicitly as argument to request, or specify default target window when constructing instance of this class.\");\n\t }\n\t return this.windowPostMessageProxy.postMessage(targetWindow, request);\n\t };\n\t /**\n\t * Object.assign() polyfill\n\t * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\n\t */\n\t HttpPostMessage.prototype.assign = function (target) {\n\t var sources = [];\n\t for (var _i = 1; _i < arguments.length; _i++) {\n\t sources[_i - 1] = arguments[_i];\n\t }\n\t if (target === undefined || target === null) {\n\t throw new TypeError('Cannot convert undefined or null to object');\n\t }\n\t var output = Object(target);\n\t sources.forEach(function (source) {\n\t if (source !== undefined && source !== null) {\n\t for (var nextKey in source) {\n\t if (Object.prototype.hasOwnProperty.call(source, nextKey)) {\n\t output[nextKey] = source[nextKey];\n\t }\n\t }\n\t }\n\t });\n\t return output;\n\t };\n\t return HttpPostMessage;\n\t}());\n\texports.HttpPostMessage = HttpPostMessage;\n\n\n/***/ }\n/******/ ])\n});\n;\n//# sourceMappingURL=httpPostMessage.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/http-post-message/dist/httpPostMessage.js\n// module id = 13\n// module chunks = 0","/*! powerbi-router v0.1.5 | (c) 2016 Microsoft Corporation MIT */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"powerbi-router\"] = factory();\n\telse\n\t\troot[\"powerbi-router\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar RouteRecognizer = __webpack_require__(1);\n\tvar Router = (function () {\n\t function Router(handlers) {\n\t this.handlers = handlers;\n\t /**\n\t * TODO: look at generating the router dynamically based on list of supported http methods\n\t * instead of hardcoding the creation of these and the methods.\n\t */\n\t this.getRouteRecognizer = new RouteRecognizer();\n\t this.patchRouteRecognizer = new RouteRecognizer();\n\t this.postRouteRecognizer = new RouteRecognizer();\n\t this.putRouteRecognizer = new RouteRecognizer();\n\t this.deleteRouteRecognizer = new RouteRecognizer();\n\t }\n\t Router.prototype.get = function (url, handler) {\n\t this.registerHandler(this.getRouteRecognizer, \"GET\", url, handler);\n\t return this;\n\t };\n\t Router.prototype.patch = function (url, handler) {\n\t this.registerHandler(this.patchRouteRecognizer, \"PATCH\", url, handler);\n\t return this;\n\t };\n\t Router.prototype.post = function (url, handler) {\n\t this.registerHandler(this.postRouteRecognizer, \"POST\", url, handler);\n\t return this;\n\t };\n\t Router.prototype.put = function (url, handler) {\n\t this.registerHandler(this.putRouteRecognizer, \"PUT\", url, handler);\n\t return this;\n\t };\n\t Router.prototype.delete = function (url, handler) {\n\t this.registerHandler(this.deleteRouteRecognizer, \"DELETE\", url, handler);\n\t return this;\n\t };\n\t /**\n\t * TODO: This method could use some refactoring. There is conflict of interest between keeping clean separation of test and handle method\n\t * Test method only returns boolean indicating if request can be handled, and handle method has opportunity to modify response and return promise of it.\n\t * In the case of the router with route-recognizer where handlers are associated with routes, this already guarantees that only one handler is selected and makes the test method feel complicated\n\t * Will leave as is an investigate cleaner ways at later time.\n\t */\n\t Router.prototype.registerHandler = function (routeRecognizer, method, url, handler) {\n\t var routeRecognizerHandler = function (request) {\n\t var response = new Response();\n\t return Promise.resolve(handler(request, response))\n\t .then(function (x) { return response; });\n\t };\n\t routeRecognizer.add([\n\t { path: url, handler: routeRecognizerHandler }\n\t ]);\n\t var internalHandler = {\n\t test: function (request) {\n\t if (request.method !== method) {\n\t return false;\n\t }\n\t var matchingRoutes = routeRecognizer.recognize(request.url);\n\t if (matchingRoutes === undefined) {\n\t return false;\n\t }\n\t /**\n\t * Copy parameters from recognized route to the request so they can be used within the handler function\n\t * This isn't ideal because it is side affect which modifies the request instead of strictly testing for true or false\n\t * but I don't see a better place to put this. If we move it between the call to test and the handle it becomes part of the window post message proxy\n\t * even though it's responsibility is related to routing.\n\t */\n\t var route = matchingRoutes[0];\n\t request.params = route.params;\n\t request.queryParams = matchingRoutes.queryParams;\n\t request.handler = route.handler;\n\t return true;\n\t },\n\t handle: function (request) {\n\t return request.handler(request);\n\t }\n\t };\n\t this.handlers.addHandler(internalHandler);\n\t };\n\t return Router;\n\t}());\n\texports.Router = Router;\n\tvar Response = (function () {\n\t function Response() {\n\t this.statusCode = 200;\n\t this.headers = {};\n\t this.body = null;\n\t }\n\t Response.prototype.send = function (statusCode, body) {\n\t this.statusCode = statusCode;\n\t this.body = body;\n\t };\n\t return Response;\n\t}());\n\texports.Response = Response;\n\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(module) {(function() {\n\t \"use strict\";\n\t function $$route$recognizer$dsl$$Target(path, matcher, delegate) {\n\t this.path = path;\n\t this.matcher = matcher;\n\t this.delegate = delegate;\n\t }\n\t\n\t $$route$recognizer$dsl$$Target.prototype = {\n\t to: function(target, callback) {\n\t var delegate = this.delegate;\n\t\n\t if (delegate && delegate.willAddRoute) {\n\t target = delegate.willAddRoute(this.matcher.target, target);\n\t }\n\t\n\t this.matcher.add(this.path, target);\n\t\n\t if (callback) {\n\t if (callback.length === 0) { throw new Error(\"You must have an argument in the function passed to `to`\"); }\n\t this.matcher.addChild(this.path, target, callback, this.delegate);\n\t }\n\t return this;\n\t }\n\t };\n\t\n\t function $$route$recognizer$dsl$$Matcher(target) {\n\t this.routes = {};\n\t this.children = {};\n\t this.target = target;\n\t }\n\t\n\t $$route$recognizer$dsl$$Matcher.prototype = {\n\t add: function(path, handler) {\n\t this.routes[path] = handler;\n\t },\n\t\n\t addChild: function(path, target, callback, delegate) {\n\t var matcher = new $$route$recognizer$dsl$$Matcher(target);\n\t this.children[path] = matcher;\n\t\n\t var match = $$route$recognizer$dsl$$generateMatch(path, matcher, delegate);\n\t\n\t if (delegate && delegate.contextEntered) {\n\t delegate.contextEntered(target, match);\n\t }\n\t\n\t callback(match);\n\t }\n\t };\n\t\n\t function $$route$recognizer$dsl$$generateMatch(startingPath, matcher, delegate) {\n\t return function(path, nestedCallback) {\n\t var fullPath = startingPath + path;\n\t\n\t if (nestedCallback) {\n\t nestedCallback($$route$recognizer$dsl$$generateMatch(fullPath, matcher, delegate));\n\t } else {\n\t return new $$route$recognizer$dsl$$Target(startingPath + path, matcher, delegate);\n\t }\n\t };\n\t }\n\t\n\t function $$route$recognizer$dsl$$addRoute(routeArray, path, handler) {\n\t var len = 0;\n\t for (var i=0; i z`. For instance, \"199\" is smaller\n\t // then \"200\", even though \"y\" and \"z\" (which are both 9) are larger than \"0\" (the value\n\t // of (`b` and `c`). This is because the leading symbol, \"2\", is larger than the other\n\t // leading symbol, \"1\".\n\t // The rule is that symbols to the left carry more weight than symbols to the right\n\t // when a number is written out as a string. In the above strings, the leading digit\n\t // represents how many 100's are in the number, and it carries more weight than the middle\n\t // number which represents how many 10's are in the number.\n\t // This system of number magnitude works well for route specificity, too. A route written as\n\t // `a/b/c` will be more specific than `x/y/z` as long as `a` is more specific than\n\t // `x`, irrespective of the other parts.\n\t // Because of this similarity, we assign each type of segment a number value written as a\n\t // string. We can find the specificity of compound routes by concatenating these strings\n\t // together, from left to right. After we have looped through all of the segments,\n\t // we convert the string to a number.\n\t specificity.val = '';\n\t\n\t for (var i=0; i 2 && key.slice(keyLength -2) === '[]') {\n\t isArray = true;\n\t key = key.slice(0, keyLength - 2);\n\t if(!queryParams[key]) {\n\t queryParams[key] = [];\n\t }\n\t }\n\t value = pair[1] ? $$route$recognizer$$decodeQueryParamPart(pair[1]) : '';\n\t }\n\t if (isArray) {\n\t queryParams[key].push(value);\n\t } else {\n\t queryParams[key] = value;\n\t }\n\t }\n\t return queryParams;\n\t },\n\t\n\t recognize: function(path) {\n\t var states = [ this.rootState ],\n\t pathLen, i, l, queryStart, queryParams = {},\n\t isSlashDropped = false;\n\t\n\t queryStart = path.indexOf('?');\n\t if (queryStart !== -1) {\n\t var queryString = path.substr(queryStart + 1, path.length);\n\t path = path.substr(0, queryStart);\n\t queryParams = this.parseQueryString(queryString);\n\t }\n\t\n\t path = decodeURI(path);\n\t\n\t if (path.charAt(0) !== \"/\") { path = \"/\" + path; }\n\t\n\t pathLen = path.length;\n\t if (pathLen > 1 && path.charAt(pathLen - 1) === \"/\") {\n\t path = path.substr(0, pathLen - 1);\n\t isSlashDropped = true;\n\t }\n\t\n\t for (i=0; i';this.element.innerHTML=r,this.iframe=this.element.childNodes[0]}e?this.iframe.addEventListener("load",function(){return t.load(t.config)},!1):this.iframe.addEventListener("load",function(){return t.createReport(t.createConfig)},!1)},e.allowedEvents=["loaded","saved","rendered","saveAsTriggered","error","dataSelected"],e.accessTokenAttribute="powerbi-access-token",e.embedUrlAttribute="powerbi-embed-url",e.nameAttribute="powerbi-name",e.typeAttribute="powerbi-type",e.defaultSettings={filterPaneEnabled:!0},e}();t.Embed=i},function(e,t){function r(e,t,r){var n;"function"==typeof CustomEvent?n=new CustomEvent(t,{detail:r,bubbles:!0,cancelable:!0}):(n=document.createEvent("CustomEvent"),n.initCustomEvent(t,!0,!0,r)),e.dispatchEvent(n)}function n(e,t){if(!Array.isArray(t))throw new Error("You attempted to call find with second parameter that was not an array. You passed: "+t);var r;return t.some(function(t,n){if(e(t))return r=n,!0}),r}function i(e,t){var r=n(e,t);return t[r]}function o(e,t){var r=n(e,t);t.splice(r,1)}function s(){for(var e=[],t=0;t0&&!i)throw new Error("You shold pass the values to be filtered for each key. You passed: no values and "+o+" keys");if(0===o&&i&&i.length>0)throw new Error("You passed key values but your target object doesn't contain the keys to be filtered");for(var s=0;s2)throw new Error("AdvancedFilters may not have more than two conditions. You passed: "+i.length);if(1===s.length&&"And"!==n)throw new Error('Logical Operator must be "And" when there is only one condition provided');this.conditions=s}return d(t,e),t.prototype.toJSON=function(){var t=e.prototype.toJSON.call(this);return t.logicalOperator=this.logicalOperator,t.conditions=this.conditions,t},t.schemaUrl="http://powerbi.com/product/schema#advanced",t}(l);t.AdvancedFilter=y,function(e){e[e.Read=0]="Read",e[e.ReadWrite=1]="ReadWrite",e[e.Copy=2]="Copy",e[e.Create=4]="Create",e[e.All=7]="All"}(t.Permissions||(t.Permissions={}));t.Permissions;!function(e){e[e.View=0]="View",e[e.Edit=1]="Edit"}(t.ViewMode||(t.ViewMode={}));t.ViewMode;t.validateSaveAsParameters=i(t.saveAsParametersSchema)},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{target:{oneOf:[{type:"object",properties:{table:{type:"string"},column:{type:"string"}},required:["table","column"]},{type:"object",properties:{table:{type:"string"},hierarchy:{type:"string"},hierarchyLevel:{type:"string"}},required:["table","hierarchy","hierarchyLevel"]},{type:"object",properties:{table:{type:"string"},measure:{type:"string"}},required:["table","measure"]}]},logicalOperator:{type:"string"},conditions:{type:"array",items:{type:"object",properties:{value:{type:["string","boolean","number"]},operator:{type:"string"}},required:["value","operator"]}}},required:["target","logicalOperator","conditions"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",oneOf:[{$ref:"#basicFilter"},{$ref:"#advancedFilter"}],invalidMessage:"filter is invalid"}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{accessToken:{type:"string",messages:{type:"accessToken must be a string",required:"accessToken is required"}},id:{type:"string",messages:{type:"id must be a string",required:"id is required"}},settings:{$ref:"#settings"},pageName:{type:"string",messages:{type:"pageName must be a string"}},filters:{type:"array",items:{type:"object",oneOf:[{$ref:"#basicFilter"},{$ref:"#advancedFilter"}]},invalidMessage:"filters property is invalid"},permissions:{type:"number","enum":[0,1,2,3],"default":0,invalidMessage:"permissions property is invalid"},viewMode:{type:"number","enum":[0,1],"default":0,invalidMessage:"viewMode property is invalid"}},required:["accessToken","id"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{accessToken:{type:"string",messages:{type:"accessToken must be a string",required:"accessToken is required"}},id:{type:"string",messages:{type:"id must be a string",required:"id is required"}},pageView:{type:"string",messages:{type:'pageView must be a string with one of the following values: "actualSize", "fitToWidth", "oneColumn"'}}},required:["accessToken","id"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{name:{type:"string",messages:{type:"name must be a string",required:"name is required"}}},required:["name"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{filterPaneEnabled:{type:"boolean",messages:{type:"filterPaneEnabled must be a boolean"}},navContentPaneEnabled:{type:"boolean",messages:{type:"navContentPaneEnabled must be a boolean"}},useCustomSaveAsDialog:{type:"boolean",messages:{type:"useCustomSaveAsDialog must be a boolean"}}}}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{target:{type:"object",properties:{table:{type:"string"},column:{type:"string"},hierarchy:{type:"string"},hierarchyLevel:{type:"string"},measure:{type:"string"}},required:["table"]},operator:{type:"string"},values:{type:"array",items:{type:["string","boolean","number"]}}},required:["target","operator","values"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{accessToken:{type:"string",messages:{type:"accessToken must be a string",required:"accessToken is required"}},datasetId:{type:"string",messages:{type:"datasetId must be a string",required:"datasetId is required"}}},required:["accessToken","datasetId"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{name:{type:"string",messages:{type:"name must be a string",required:"name is required"}}},required:["name"]}},function(e,t,r){e.exports=r(11)},function(e,t,r){"use strict";function n(e){return e=e instanceof RegExp?e:new RegExp(e),A?e.toString():"/"+e.source.replace(y,"\\$&")+"/"}function i(e){return'"'+e.replace(v,"\\$1")+'"'}function o(e,t){return b.lastIndex=0,b.test(t)?e+"."+t:e+"["+i(t)+"]"}function s(e){if(void 0===e)return"undefined";var t=Object.prototype.toString.call(e);return t.substr(8,t.length-9).toLowerCase()}function a(e){return(0|e)===e}function c(e,t){k[t].type=e,k[t].keyword=t}function h(e){var t,r,n,i=Object.keys(e),o=i.indexOf("properties"),s=i.indexOf("patternProperties"),a={"enum":Array.isArray(e["enum"])&&e["enum"].length>0,type:null,allType:[],perType:{}};for(e.type&&("string"==typeof e.type?a.type=[e.type]:Array.isArray(e.type)&&e.type.length&&(a.type=e.type.slice(0))),n=0;n-1&&"required"===t||s>-1&&"additionalProperties"===t||a.perType[r.type].push(t)):a.allType.push(t)));return a}function u(e,t){var r,n,i=e.substr(4),o=i.length,s=[],a="",c=!1;for(n=0;n "+e.schema.maximum+") {"),e.error("maximum"),e.code("}"))},k.exclusiveMaximum=function(e){e.schema.exclusiveMaximum===!0&&"number"==typeof e.schema.maximum&&(e.code("if ("+e.path+" === "+e.schema.maximum+") {"),e.error("exclusiveMaximum"),e.code("}"))},k.multipleOf=function(e){if("number"==typeof e.schema.multipleOf){var t=e.schema.multipleOf,r=t.toString().length-t.toFixed(0).length-1,n=r>0?Math.pow(10,r):1,i=e.path;r>0?e.code("if (+(Math.round(("+i+" * "+n+') + "e+" + '+r+') + "e-" + '+r+") % "+t*n+" !== 0) {"):e.code("if ((("+i+" * "+n+") % "+t*n+") !== 0) {"),e.error("multipleOf"),e.code("}")}},k.minLength=function(e){a(e.schema.minLength)&&(e.code("if (ucs2length("+e.path+") < "+e.schema.minLength+") {"),e.error("minLength"),e.code("}"))},k.maxLength=function(e){a(e.schema.maxLength)&&(e.code("if (ucs2length("+e.path+") > "+e.schema.maxLength+") {"),e.error("maxLength"),e.code("}"))},k.pattern=function(e){var t=e.schema.pattern;("string"==typeof t||t instanceof RegExp)&&(e.code("if (!("+n(t)+").test("+e.path+")) {"),e.error("pattern"),e.code("}"))},k.format=function(e){"string"==typeof e.schema.format&&I[e.schema.format]&&(e.code("if (!("+I[e.schema.format]+").test("+e.path+")) {"),e.error("format"),e.code("}"))},k.minItems=function(e){a(e.schema.minItems)&&(e.code("if ("+e.path+".length < "+e.schema.minItems+") {"),e.error("minItems"),e.code("}"))},k.maxItems=function(e){a(e.schema.maxItems)&&(e.code("if ("+e.path+".length > "+e.schema.maxItems+") {"),e.error("maxItems"),e.code("}"))},k.additionalItems=function(e){e.schema.additionalItems===!1&&Array.isArray(e.schema.items)&&(e.code("if ("+e.path+".length > "+e.schema.items.length+") {"),e.error("additionalItems"),e.code("}"))},k.uniqueItems=function(e){e.schema.uniqueItems&&(e.code("if (unique("+e.path+").length !== "+e.path+".length) {"),e.error("uniqueItems"),e.code("}"))},k.items=function(e){var t=e.declare(0),r=0;if("object"===s(e.schema.items))e.code("for ("+t+" = 0; "+t+" < "+e.path+".length; "+t+"++) {"),e.descend(e.path+"["+t+"]",e.schema.items),e.code("}");else if(Array.isArray(e.schema.items)){for(;r= "+r+") {"),e.descend(e.path+"["+r+"]",e.schema.items[r]),e.code("}");"object"===s(e.schema.additionalItems)&&(e.code("for ("+t+" = "+r+"; "+t+" < "+e.path+".length; "+t+"++) {"),e.descend(e.path+"["+t+"]",e.schema.additionalItems),e.code("}"))}},k.maxProperties=function(e){a(e.schema.maxProperties)&&(e.code("if (Object.keys("+e.path+").length > "+e.schema.maxProperties+") {"),e.error("maxProperties"),e.code("}"))},k.minProperties=function(e){a(e.schema.minProperties)&&(e.code("if (Object.keys("+e.path+").length < "+e.schema.minProperties+") {"),e.error("minProperties"),e.code("}"))},k.required=function(e){if(Array.isArray(e.schema.required))for(var t=0;t-1&&(e.code("else {"),e.error("required",t),e.code("}"))},k.patternProperties=k.additionalProperties=function(e){var t,r,i,o,a,c,h,u="object"===s(e.schema.properties)?Object.keys(e.schema.properties):[],d=e.schema.patternProperties,p="object"===s(d)?Object.keys(d):[],f=e.schema.additionalProperties,l=f===!1||"object"===s(f);if(p.length||l){for(r=e.declare("[]"),i=e.declare('""'),o=e.declare(0),l&&(a=e.declare(!1)),e.code(r+" = Object.keys("+e.path+")"),e.code("for ("+o+" = 0; "+o+" < "+r+".length; "+o+"++) {")(i+" = "+r+"["+o+"]")("if ("+e.path+"["+i+"] === undefined) {")("continue")("}"),l&&e.code(a+" = false"),h=0;h -1) {")("continue")("}")),e.code("if (!"+a+") {"),f===!1?e.error("additionalProperties",void 0,i):e.descend(e.path+"["+i+"]",f),e.code("}")),e.code("}")}},k.dependencies=function(e){if("object"===s(e.schema.dependencies))for(var t,r,n=Object.keys(e.schema.dependencies),i=n.length,a=0,c=0;c1&&delete this.objects[n][r]},f.prototype.dispose=function(){this.objects.length=0,this.properties.length=0},m.prototype.clone=function(e){var t=new m({schema:e,formats:this.formats,greedy:this.greedy,resolver:this.resolver,id:this.id,funcache:this.funcache,scope:this.scope});return t},m.prototype.declare=function(e){var t=this.id();return this.code.def(t,e),t},m.prototype.cache=function(e,t){var r,n=this.funcache[e];return n||(n=this.funcache[e]={key:this.id()},r=this.clone(t),n.func=r.compile(n.key),this.scope.refs[n.key]=n.func,r.dispose()),"refs."+n.key},m.prototype.error=function(e,t,r){var n=this.schema,o=this.path,s="data"!==o||t?'(path ? path + "." : "") + '+u(o,t)+",":"path,",a=t&&n.properties&&n.properties[t]?this.resolver.resolve(n.properties[t]):null,c=a?a.requiredMessage:n.invalidMessage;c||(c=a&&a.messages&&a.messages[e]||n.messages&&n.messages[e]),this.code("errors.push({"),c&&this.code("message: "+i(c)+","),r&&this.code("additionalProperties: "+r+","),this.code("path: "+s)("keyword: "+i(e))("})"),this.greedy||this.code("return")},m.prototype.refactor=function(e,t,r){var n="data"!==e?'(path ? path + "." : "") + '+u(e):"path",i=this.cache(r,t),o=this.declare();this.code(o+" = "+i+"("+e+", "+n+", errors)"),this.greedy||this.code("if (errors.length) { return }")},m.prototype.descend=function(e,t){var r=this.path,n=this.schema;this.path=e,this.schema=t,this.generate(),this.path=r,this.schema=n},m.prototype.generate=function(){function e(e){k[e](l)}var t,r,o,a,c,u,d,p=this.path,f=this.schema,l=this,m=this.scope;if("object"===s(f)){if(void 0!==f.$ref){if(f=this.resolver.resolve(f),this.resolver.hasRef(f))return void this.refactor(p,f,this.resolver.getNormalizedRef(this.schema)||this.schema.$ref);this.schema=f}if(o=h(f),o["enum"])return void k["enum"](l);for(a=Object.keys(o.perType),d=0;d-1&&o.type.splice(c,1));o.type&&(o.type.length?(this.code((a.length?"else ":"")+"if (!("+o.type.map(function(e){return S[e]?S[e](p):"true"}).join(" || ")+")) {"),this.error("type"),this.code("}")):(this.code("else {"),this.error("type"),this.code("}"))),o.allType.forEach(function(e){k[e](l)}),f.format&&this.formats&&(r=this.formats[f.format],r&&("string"==typeof r||r instanceof RegExp?(this.code("if (!("+n(r)+").test("+p+")) {"),this.error("format"),this.code("}")):"function"==typeof r&&((m.formats||(m.formats={}))[f.format]=r,(m.schemas||(m.schemas={}))[f.format]=f,t=i(f.format),this.code("if (!formats["+t+"]("+p+", schemas["+t+"])) {"),this.error("format"),this.code("}"))))}},m.prototype.compile=function(e){return this.code=E("jsen_compiled"+(e?"_"+e:""),"data","path","errors"),this.generate(),this.code.compile(this.scope)},m.prototype.dispose=function(){for(var e in this)this[e]=void 0},g.browser=x,g.clone=d,g.equal=O,g.unique=P,g.ucs2length=C,g.SchemaResolver=j,g.resolve=j.resolvePointer,e.exports=g},function(e,t){"use strict";e.exports=function(){var e=Array.apply(null,arguments),t=e.shift(),r=" ",n="",i="",o=1,s="{[",a="}]",c=function(){for(var e=r,t=0;t++-1&&s.indexOf(r)>-1?(o--,h(e),o++):s.indexOf(r)>-1?(h(e),o++):a.indexOf(t)>-1?(o--,h(e)):h(e),u};return u.def=function(e,t){return i+=(i?",\n"+r+" ":"")+e+(void 0!==t?" = "+t:""),u},u.toSource=function(){return"function "+t+"("+e.join(", ")+") {\n"+r+'"use strict"\n'+(i?r+"var "+i+";\n":"")+n+"}"},u.compile=function(e){var t="return ("+u.toSource()+")",r=e||{},n=Object.keys(r),i=n.map(function(e){return r[e]});return Function.apply(null,n.concat(t)).apply(null,i)},u}},function(e,t){"use strict";function r(e){var t=Object.prototype.toString.call(e);return t.substr(8,t.length-9).toLowerCase()}function n(e,t){var r,n,o=Object.keys(e).sort(),s=Object.keys(t).sort();if(!i(o,s))return!1;for(r=0;r-1)throw new Error(u+" "+t);return this.refStack.push(t),r=this._resolveRef(t),this.refStack.pop(),e===this.rootSchema&&(this.resolvedRootSchema=r),r},o.prototype.hasRef=function(e){var t,r,n,i,o=Object.keys(e);if(o.indexOf("$ref")>-1)return!0;for(n=0,t=o.length;n';this.element.innerHTML=r,this.iframe=this.element.childNodes[0]}e?this.iframe.addEventListener("load",function(){return t.load(t.config)},!1):this.iframe.addEventListener("load",function(){return t.createReport(t.createConfig)},!1)},e.allowedEvents=["loaded","saved","rendered","saveAsTriggered","error","dataSelected"],e.accessTokenAttribute="powerbi-access-token",e.embedUrlAttribute="powerbi-embed-url",e.nameAttribute="powerbi-name",e.typeAttribute="powerbi-type",e.defaultSettings={filterPaneEnabled:!0},e}();t.Embed=i},function(e,t){function r(e,t,r){var n;"function"==typeof CustomEvent?n=new CustomEvent(t,{detail:r,bubbles:!0,cancelable:!0}):(n=document.createEvent("CustomEvent"),n.initCustomEvent(t,!0,!0,r)),e.dispatchEvent(n)}function n(e,t){if(!Array.isArray(t))throw new Error("You attempted to call find with second parameter that was not an array. You passed: "+t);var r;return t.some(function(t,n){if(e(t))return r=n,!0}),r}function i(e,t){var r=n(e,t);return t[r]}function o(e,t){var r=n(e,t);t.splice(r,1)}function s(){for(var e=[],t=0;t0&&!i)throw new Error("You shold pass the values to be filtered for each key. You passed: no values and "+o+" keys");if(0===o&&i&&i.length>0)throw new Error("You passed key values but your target object doesn't contain the keys to be filtered");for(var s=0;s2)throw new Error("AdvancedFilters may not have more than two conditions. You passed: "+i.length);if(1===s.length&&"And"!==n)throw new Error('Logical Operator must be "And" when there is only one condition provided');this.conditions=s}return d(t,e),t.prototype.toJSON=function(){var t=e.prototype.toJSON.call(this);return t.logicalOperator=this.logicalOperator,t.conditions=this.conditions,t},t.schemaUrl="http://powerbi.com/product/schema#advanced",t}(l);t.AdvancedFilter=y,function(e){e[e.Read=0]="Read",e[e.ReadWrite=1]="ReadWrite",e[e.Copy=2]="Copy",e[e.Create=4]="Create",e[e.All=7]="All"}(t.Permissions||(t.Permissions={}));t.Permissions;!function(e){e[e.View=0]="View",e[e.Edit=1]="Edit"}(t.ViewMode||(t.ViewMode={}));t.ViewMode;t.validateSaveAsParameters=i(t.saveAsParametersSchema)},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{target:{oneOf:[{type:"object",properties:{table:{type:"string"},column:{type:"string"}},required:["table","column"]},{type:"object",properties:{table:{type:"string"},hierarchy:{type:"string"},hierarchyLevel:{type:"string"}},required:["table","hierarchy","hierarchyLevel"]},{type:"object",properties:{table:{type:"string"},measure:{type:"string"}},required:["table","measure"]}]},logicalOperator:{type:"string"},conditions:{type:"array",items:{type:"object",properties:{value:{type:["string","boolean","number"]},operator:{type:"string"}},required:["value","operator"]}}},required:["target","logicalOperator","conditions"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",oneOf:[{$ref:"#basicFilter"},{$ref:"#advancedFilter"}],invalidMessage:"filter is invalid"}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{accessToken:{type:"string",messages:{type:"accessToken must be a string",required:"accessToken is required"}},id:{type:"string",messages:{type:"id must be a string",required:"id is required"}},settings:{$ref:"#settings"},pageName:{type:"string",messages:{type:"pageName must be a string"}},filters:{type:"array",items:{type:"object",oneOf:[{$ref:"#basicFilter"},{$ref:"#advancedFilter"}]},invalidMessage:"filters property is invalid"},permissions:{type:"number","enum":[0,1,2,4,7],"default":0,invalidMessage:"permissions property is invalid"},viewMode:{type:"number","enum":[0,1],"default":0,invalidMessage:"viewMode property is invalid"}},required:["accessToken","id"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{accessToken:{type:"string",messages:{type:"accessToken must be a string",required:"accessToken is required"}},id:{type:"string",messages:{type:"id must be a string",required:"id is required"}},pageView:{type:"string",messages:{type:'pageView must be a string with one of the following values: "actualSize", "fitToWidth", "oneColumn"'}}},required:["accessToken","id"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{name:{type:"string",messages:{type:"name must be a string",required:"name is required"}}},required:["name"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{filterPaneEnabled:{type:"boolean",messages:{type:"filterPaneEnabled must be a boolean"}},navContentPaneEnabled:{type:"boolean",messages:{type:"navContentPaneEnabled must be a boolean"}},useCustomSaveAsDialog:{type:"boolean",messages:{type:"useCustomSaveAsDialog must be a boolean"}}}}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{target:{type:"object",properties:{table:{type:"string"},column:{type:"string"},hierarchy:{type:"string"},hierarchyLevel:{type:"string"},measure:{type:"string"}},required:["table"]},operator:{type:"string"},values:{type:"array",items:{type:["string","boolean","number"]}}},required:["target","operator","values"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{accessToken:{type:"string",messages:{type:"accessToken must be a string",required:"accessToken is required"}},datasetId:{type:"string",messages:{type:"datasetId must be a string",required:"datasetId is required"}}},required:["accessToken","datasetId"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{name:{type:"string",messages:{type:"name must be a string",required:"name is required"}}},required:["name"]}},function(e,t,r){e.exports=r(11)},function(e,t,r){"use strict";function n(e){return e=e instanceof RegExp?e:new RegExp(e),A?e.toString():"/"+e.source.replace(y,"\\$&")+"/"}function i(e){return'"'+e.replace(v,"\\$1")+'"'}function o(e,t){return b.lastIndex=0,b.test(t)?e+"."+t:e+"["+i(t)+"]"}function s(e){if(void 0===e)return"undefined";var t=Object.prototype.toString.call(e);return t.substr(8,t.length-9).toLowerCase()}function a(e){return(0|e)===e}function c(e,t){k[t].type=e,k[t].keyword=t}function h(e){var t,r,n,i=Object.keys(e),o=i.indexOf("properties"),s=i.indexOf("patternProperties"),a={"enum":Array.isArray(e["enum"])&&e["enum"].length>0,type:null,allType:[],perType:{}};for(e.type&&("string"==typeof e.type?a.type=[e.type]:Array.isArray(e.type)&&e.type.length&&(a.type=e.type.slice(0))),n=0;n-1&&"required"===t||s>-1&&"additionalProperties"===t||a.perType[r.type].push(t)):a.allType.push(t)));return a}function u(e,t){var r,n,i=e.substr(4),o=i.length,s=[],a="",c=!1;for(n=0;n "+e.schema.maximum+") {"),e.error("maximum"),e.code("}"))},k.exclusiveMaximum=function(e){e.schema.exclusiveMaximum===!0&&"number"==typeof e.schema.maximum&&(e.code("if ("+e.path+" === "+e.schema.maximum+") {"),e.error("exclusiveMaximum"),e.code("}"))},k.multipleOf=function(e){if("number"==typeof e.schema.multipleOf){var t=e.schema.multipleOf,r=t.toString().length-t.toFixed(0).length-1,n=r>0?Math.pow(10,r):1,i=e.path;r>0?e.code("if (+(Math.round(("+i+" * "+n+') + "e+" + '+r+') + "e-" + '+r+") % "+t*n+" !== 0) {"):e.code("if ((("+i+" * "+n+") % "+t*n+") !== 0) {"),e.error("multipleOf"),e.code("}")}},k.minLength=function(e){a(e.schema.minLength)&&(e.code("if (ucs2length("+e.path+") < "+e.schema.minLength+") {"),e.error("minLength"),e.code("}"))},k.maxLength=function(e){a(e.schema.maxLength)&&(e.code("if (ucs2length("+e.path+") > "+e.schema.maxLength+") {"),e.error("maxLength"),e.code("}"))},k.pattern=function(e){var t=e.schema.pattern;("string"==typeof t||t instanceof RegExp)&&(e.code("if (!("+n(t)+").test("+e.path+")) {"),e.error("pattern"),e.code("}"))},k.format=function(e){"string"==typeof e.schema.format&&I[e.schema.format]&&(e.code("if (!("+I[e.schema.format]+").test("+e.path+")) {"),e.error("format"),e.code("}"))},k.minItems=function(e){a(e.schema.minItems)&&(e.code("if ("+e.path+".length < "+e.schema.minItems+") {"),e.error("minItems"),e.code("}"))},k.maxItems=function(e){a(e.schema.maxItems)&&(e.code("if ("+e.path+".length > "+e.schema.maxItems+") {"),e.error("maxItems"),e.code("}"))},k.additionalItems=function(e){e.schema.additionalItems===!1&&Array.isArray(e.schema.items)&&(e.code("if ("+e.path+".length > "+e.schema.items.length+") {"),e.error("additionalItems"),e.code("}"))},k.uniqueItems=function(e){e.schema.uniqueItems&&(e.code("if (unique("+e.path+").length !== "+e.path+".length) {"),e.error("uniqueItems"),e.code("}"))},k.items=function(e){var t=e.declare(0),r=0;if("object"===s(e.schema.items))e.code("for ("+t+" = 0; "+t+" < "+e.path+".length; "+t+"++) {"),e.descend(e.path+"["+t+"]",e.schema.items),e.code("}");else if(Array.isArray(e.schema.items)){for(;r= "+r+") {"),e.descend(e.path+"["+r+"]",e.schema.items[r]),e.code("}");"object"===s(e.schema.additionalItems)&&(e.code("for ("+t+" = "+r+"; "+t+" < "+e.path+".length; "+t+"++) {"),e.descend(e.path+"["+t+"]",e.schema.additionalItems),e.code("}"))}},k.maxProperties=function(e){a(e.schema.maxProperties)&&(e.code("if (Object.keys("+e.path+").length > "+e.schema.maxProperties+") {"),e.error("maxProperties"),e.code("}"))},k.minProperties=function(e){a(e.schema.minProperties)&&(e.code("if (Object.keys("+e.path+").length < "+e.schema.minProperties+") {"),e.error("minProperties"),e.code("}"))},k.required=function(e){if(Array.isArray(e.schema.required))for(var t=0;t-1&&(e.code("else {"),e.error("required",t),e.code("}"))},k.patternProperties=k.additionalProperties=function(e){var t,r,i,o,a,c,h,u="object"===s(e.schema.properties)?Object.keys(e.schema.properties):[],d=e.schema.patternProperties,p="object"===s(d)?Object.keys(d):[],f=e.schema.additionalProperties,l=f===!1||"object"===s(f);if(p.length||l){for(r=e.declare("[]"),i=e.declare('""'),o=e.declare(0),l&&(a=e.declare(!1)),e.code(r+" = Object.keys("+e.path+")"),e.code("for ("+o+" = 0; "+o+" < "+r+".length; "+o+"++) {")(i+" = "+r+"["+o+"]")("if ("+e.path+"["+i+"] === undefined) {")("continue")("}"),l&&e.code(a+" = false"),h=0;h -1) {")("continue")("}")),e.code("if (!"+a+") {"),f===!1?e.error("additionalProperties",void 0,i):e.descend(e.path+"["+i+"]",f),e.code("}")),e.code("}")}},k.dependencies=function(e){if("object"===s(e.schema.dependencies))for(var t,r,n=Object.keys(e.schema.dependencies),i=n.length,a=0,c=0;c1&&delete this.objects[n][r]},f.prototype.dispose=function(){this.objects.length=0,this.properties.length=0},m.prototype.clone=function(e){var t=new m({schema:e,formats:this.formats,greedy:this.greedy,resolver:this.resolver,id:this.id,funcache:this.funcache,scope:this.scope});return t},m.prototype.declare=function(e){var t=this.id();return this.code.def(t,e),t},m.prototype.cache=function(e,t){var r,n=this.funcache[e];return n||(n=this.funcache[e]={key:this.id()},r=this.clone(t),n.func=r.compile(n.key),this.scope.refs[n.key]=n.func,r.dispose()),"refs."+n.key},m.prototype.error=function(e,t,r){var n=this.schema,o=this.path,s="data"!==o||t?'(path ? path + "." : "") + '+u(o,t)+",":"path,",a=t&&n.properties&&n.properties[t]?this.resolver.resolve(n.properties[t]):null,c=a?a.requiredMessage:n.invalidMessage;c||(c=a&&a.messages&&a.messages[e]||n.messages&&n.messages[e]),this.code("errors.push({"),c&&this.code("message: "+i(c)+","),r&&this.code("additionalProperties: "+r+","),this.code("path: "+s)("keyword: "+i(e))("})"),this.greedy||this.code("return")},m.prototype.refactor=function(e,t,r){var n="data"!==e?'(path ? path + "." : "") + '+u(e):"path",i=this.cache(r,t),o=this.declare();this.code(o+" = "+i+"("+e+", "+n+", errors)"),this.greedy||this.code("if (errors.length) { return }")},m.prototype.descend=function(e,t){var r=this.path,n=this.schema;this.path=e,this.schema=t,this.generate(),this.path=r,this.schema=n},m.prototype.generate=function(){function e(e){k[e](l)}var t,r,o,a,c,u,d,p=this.path,f=this.schema,l=this,m=this.scope;if("object"===s(f)){if(void 0!==f.$ref){if(f=this.resolver.resolve(f),this.resolver.hasRef(f))return void this.refactor(p,f,this.resolver.getNormalizedRef(this.schema)||this.schema.$ref);this.schema=f}if(o=h(f),o["enum"])return void k["enum"](l);for(a=Object.keys(o.perType),d=0;d-1&&o.type.splice(c,1));o.type&&(o.type.length?(this.code((a.length?"else ":"")+"if (!("+o.type.map(function(e){return S[e]?S[e](p):"true"}).join(" || ")+")) {"),this.error("type"),this.code("}")):(this.code("else {"),this.error("type"),this.code("}"))),o.allType.forEach(function(e){k[e](l)}),f.format&&this.formats&&(r=this.formats[f.format],r&&("string"==typeof r||r instanceof RegExp?(this.code("if (!("+n(r)+").test("+p+")) {"),this.error("format"),this.code("}")):"function"==typeof r&&((m.formats||(m.formats={}))[f.format]=r,(m.schemas||(m.schemas={}))[f.format]=f,t=i(f.format),this.code("if (!formats["+t+"]("+p+", schemas["+t+"])) {"),this.error("format"),this.code("}"))))}},m.prototype.compile=function(e){return this.code=E("jsen_compiled"+(e?"_"+e:""),"data","path","errors"),this.generate(),this.code.compile(this.scope)},m.prototype.dispose=function(){for(var e in this)this[e]=void 0},g.browser=x,g.clone=d,g.equal=O,g.unique=P,g.ucs2length=C,g.SchemaResolver=j,g.resolve=j.resolvePointer,e.exports=g},function(e,t){"use strict";e.exports=function(){var e=Array.apply(null,arguments),t=e.shift(),r=" ",n="",i="",o=1,s="{[",a="}]",c=function(){for(var e=r,t=0;t++-1&&s.indexOf(r)>-1?(o--,h(e),o++):s.indexOf(r)>-1?(h(e),o++):a.indexOf(t)>-1?(o--,h(e)):h(e),u};return u.def=function(e,t){return i+=(i?",\n"+r+" ":"")+e+(void 0!==t?" = "+t:""),u},u.toSource=function(){return"function "+t+"("+e.join(", ")+") {\n"+r+'"use strict"\n'+(i?r+"var "+i+";\n":"")+n+"}"},u.compile=function(e){var t="return ("+u.toSource()+")",r=e||{},n=Object.keys(r),i=n.map(function(e){return r[e]});return Function.apply(null,n.concat(t)).apply(null,i)},u}},function(e,t){"use strict";function r(e){var t=Object.prototype.toString.call(e);return t.substr(8,t.length-9).toLowerCase()}function n(e,t){var r,n,o=Object.keys(e).sort(),s=Object.keys(t).sort();if(!i(o,s))return!1;for(r=0;r-1)throw new Error(u+" "+t);return this.refStack.push(t),r=this._resolveRef(t),this.refStack.pop(),e===this.rootSchema&&(this.resolvedRootSchema=r),r},o.prototype.hasRef=function(e){var t,r,n,i,o=Object.keys(e);if(o.indexOf("$ref")>-1)return!0;for(n=0,t=o.length;n Date: Mon, 13 Feb 2017 15:50:04 +0200 Subject: [PATCH 09/11] update package.json --- dist/powerbi.js.map | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/powerbi.js.map b/dist/powerbi.js.map index 47a16ee7..64540f17 100644 --- a/dist/powerbi.js.map +++ b/dist/powerbi.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 0db7b3dff5cee7f98e62","webpack:///./src/powerbi.ts","webpack:///./src/service.ts","webpack:///./src/embed.ts","webpack:///./src/util.ts","webpack:///./src/report.ts","webpack:///./~/powerbi-models/dist/models.js","webpack:///./src/page.ts","webpack:///./src/create.ts","webpack:///./src/dashboard.ts","webpack:///./src/tile.ts","webpack:///./src/factories.ts","webpack:///./src/config.ts","webpack:///./~/window-post-message-proxy/dist/windowPostMessageProxy.js","webpack:///./~/http-post-message/dist/httpPostMessage.js","webpack:///./~/powerbi-router/dist/router.js"],"names":[],"mappings":"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AAC;SACvB,CAAC,CAAC;cACD,KAAK,CAAC,kBAAQ;aACb,MAAM,QAAQ,CAAC,IAAI,CAAC;SACtB,CAAC,CAAC,CAAC;KACP,CAAC;KAzPM,oBAAa,GAAG,CAAC,gBAAgB,EAAE,aAAa,CAAC,CAAC;KAClD,wBAAiB,GAAG,mBAAmB,CAAC;KACxC,iCAA0B,GAAG,sCAAsC,CAAC;KACpE,qCAA8B,GAAG,2CAA2C,CAAC;KAC7E,oBAAa,GAAG,cAAc,CAAC;KAC/B,WAAI,GAAG,QAAQ,CAAC;KAqPzB,aAAC;AAAD,EAAC,CA3P2B,KAAK,CAAC,KAAK,GA2PtC;AA3PY,eAAM,SA2PlB;;;;;;;ACzRD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD,qCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;AACA,qBAAoB,sBAAsB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA,GAAE,gDAAgD;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA,0BAAyB,uBAAuB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAwB,2BAA2B;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA,0BAAyB,uBAAuB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAiD,+BAA+B,GAAG,sCAAsC;AACzH,mDAAkD,+BAA+B,GAAG,sCAAsC;AAC1H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE,kDAAkD;AACpD;AACA;AACA;AACA;AACA,GAAE,4CAA4C;AAC9C;AACA;;;AAGA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAQ;AACR;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;AACA,SAAQ;AACR;AACA;AACA,SAAQ;AACR;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;AACA,SAAQ;AACR;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA,MAAK;AACL;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA,OAAM;AACN;AACA;AACA,OAAM;AACN;AACA;AACA,OAAM;AACN;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;;AAEA,QAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAe;AACf;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,+BAA8B;AAC9B;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,uFAAsF;AACtF;AACA,qBAAoB;AACpB;;AAEA;AACA;AACA,oFAAmF;AACnF;AACA,yBAAwB;AACxB;AACA;;AAEA;AACA;AACA,sFAAqF;AACrF;AACA,yBAAwB;AACxB;AACA;;AAEA;AACA;AACA,oFAAmF;AACnF;AACA,yBAAwB;AACxB;AACA;;AAEA;AACA;AACA,sFAAqF;AACrF;AACA,yBAAwB;AACxB;AACA;;AAEA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ACA;AACA;AACA;AACA;;AAEA,iBAAgB,iBAAiB;AACjC;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAgB,SAAS;AACzB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,wCAAuC,SAAS;AAChD;AACA;AACA;AACA;AACA;AACA;;AAEA,uCAAsC,SAAS;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,2CAA0C,SAAS;AACnD;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA,iBAAgB,4BAA4B;AAC5C;AACA;;AAEA,qBAAoB,iBAAiB;AACrC;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA,qBAAoB,kBAAkB;AACtC;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,yBAAwB,qBAAqB;AAC7C;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAwB,yBAAyB;AACjD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAwB,gBAAgB;AACxC;AACA;AACA;AACA;AACA;AACA;;AAEA,qBAAoB,yBAAyB;AAC7C;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;;AAEN;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,8BAA6B;;AAE7B;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,SAAQ;;AAER;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,yCAAwC,SAAS;AACjD;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA,iBAAgB;AAChB;;AAEA;;AAEA;AACA,qCAAoC;AACpC;;AAEA,iBAAgB,qBAAqB;AACrC;;AAEA,mFAAkF;;AAElF;;AAEA,sBAAqB;;AAErB;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,4BAA2B;AAC3B,uCAAsC;AACtC;AACA;AACA,eAAc,sBAAsB;AACpC;AACA,0BAAyB;AACzB;AACA;AACA,+BAA8B,GAAG;AACjC;AACA,0BAAyB;AACzB;AACA;;AAEA;AACA;AACA,OAAM;;AAEN;AACA;;AAEA;AACA;AACA,qFAAoF;AACpF;AACA,8BAA6B;AAC7B;AACA;AACA,uDAAsD;AACtD,uDAAsD;;AAEtD;;AAEA,iHAAgH;AAChH;AACA,8BAA6B;AAC7B;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,4BAA2B,0BAA0B,EAAE;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA;AACA;AACA,wBAAuB,yBAAyB;;AAEhD;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;AAGA,QAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAgB;AAChB,iBAAgB;AAChB;AACA;AACA,qCAAoC,WAAW;AAC/C;AACA,WAAU;AACV;AACA;AACA,WAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,kEAAiE;AACjE;AACA,8CAA6C;AAC7C,wBAAuB;AACvB;;AAEA;AACA;AACA,+BAA8B;AAC9B;AACA,8CAA6C,iBAAiB,EAAE;;AAEhE;AACA;;AAEA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,iBAAgB,kBAAkB;AAClC;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,wBAAuB;AACvB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,qBAAoB,cAAc;AAClC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA,QAAO;AACP;AACA;;AAEA;;AAEA;;AAEA;AACA,uCAAsC,SAAS;AAC/C;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,OAAM;AACN;;AAEA;;AAEA,QAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAM;;AAEN;AACA;AACA;;AAEA;AACA;;AAEA;AACA,sEAAqE;AACrE;AACA;AACA;AACA;AACA;AACA,uBAAsB;AACtB;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,0BAAyB;AACzB;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,iBAAgB,iBAAiB;AACjC;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,WAAU;;AAEV;AACA,OAAM;;AAEN;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,oCAAmC,SAAS;AAC5C;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,kBAAiB,KAAK;;AAEtB;AACA;AACA;AACA;AACA;AACA;AACA,uCAAsC;AACtC;AACA;AACA,6CAA4C,KAAK;AACjD,4CAA2C,KAAK;AAChD;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;AACN;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA,SAAQ;AACR;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,sCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,qBAAoB,4BAA4B;AAChD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,qBAAoB,yBAAyB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,6CAA4C,OAAO;AACnD;AACA;AACA;AACA;AACA,4CAA2C,OAAO;AAClD;AACA;AACA;AACA;AACA;AACA,eAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,4CAA2C,OAAO;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAI;AACJ;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,oBAAmB,mBAAmB;AACtC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,sBAAqB,mBAAmB;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAsB,iBAAiB;AACvC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,gCAA+B,QAAQ;AACvC;AACA;AACA;AACA,OAAM;AACN;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA,YAAW,MAAM;AACjB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAI;AACJ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA,QAAO;AACP;AACA;;AAEA,oCAAmC,sDAAsD;AACzF,GAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,cAAa,OAAO;AACpB,gBAAe,MAAM;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAa,MAAM;AACnB,cAAa,SAAS;AACtB;AACA,gBAAe,MAAM;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB,cAAa,SAAS;AACtB;AACA,gBAAe,MAAM;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB,gBAAe,MAAM;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAsC;AACtC;AACA,OAAM;AACN,8BAA6B;AAC7B;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAa,MAAM;AACnB,gBAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;;AAEA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB,gBAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB,gBAAe,OAAO;AACtB;AACA;AACA,WAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAgC,mCAAmC;AACnE;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB,gBAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,eAAc,WAAW;AACzB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,0BAAyB;;AAEzB,2CAA0C,qBAAqB;;AAE/D;AACA;AACA;AACA;AACA;AACA,oCAAmC,oBAAoB;;AAEvD;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB,gBAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,eAAc,iBAAiB;AAC/B;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,4BAA2B,iBAAiB;AAC5C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,gBAAe,iBAAiB;AAChC;;AAEA;AACA;AACA;;AAEA;AACA;AACA,gCAA+B,oBAAoB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB;AACA,gBAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB;AACA,gBAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ,IAAG;AACH,wCAAuC;AACvC;AACA,KAAI,OAAO;AACX;AACA;AACA;AACA;AACA,IAAG,OAAO;AACV;AACA;;AAEA,GAAE;;AAEF,8BAA6B,6DAA6D,aAAa,EAAE;;AAEzG,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA,QAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;;;AAGA,QAAO;AACP;AACA;;AAEA;;AAEA;AACA;;;AAGA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,mBAAkB,SAAS;AAC3B;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,OAAM;AACN;AACA,OAAM;AACN;AACA;AACA;;AAEA;AACA;;;AAGA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV,SAAQ;AACR;AACA;AACA,OAAM;;AAEN;;AAEA;AACA;AACA;AACA;;;AAGA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ,iBAAgB;AAChB;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AA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CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAuD,uCAAuC;AAC9F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2FAA0F;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAsB;AACtB;AACA;AACA,eAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;;;AAGA;AACA;AACA,EAAC;AACD;AACA,mD;;;;;;ACtSA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD,qCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,0CAAyC,qBAAqB;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAkC,cAAc;AAChD,wCAAuC,yCAAyC;AAChF;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA,mCAAkC,cAAc;AAChD,wCAAuC,yCAAyC;AAChF;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA,mCAAkC,cAAc;AAChD,wCAAuC,yCAAyC;AAChF;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA,mCAAkC,cAAc;AAChD,wCAAuC,yCAAyC;AAChF;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA,gCAA+B,aAAa;AAC5C,mCAAkC,cAAc;AAChD,wCAAuC,yCAAyC;AAChF;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA,wCAAuC,yCAAyC;AAChF,0CAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAAyB,uBAAuB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA;AACA,GAAE;AACF;;;AAGA;AACA;AACA,EAAC;AACD;AACA,4C;;;;;;AClLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD,qCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAqC,iBAAiB,EAAE;AACxD;AACA;AACA,eAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;;;AAGA,QAAO;AACP;AACA;;AAEA,oCAAmC,8CAA8C;AACjF;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,wCAAuC,6EAA6E;AACpH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAQ;;AAER;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,WAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;AACA,qBAAoB,qBAAqB;AACzC;AACA;;AAEA;AACA,qBAAoB;AACpB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAY;AACZ;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA,iCAAgC,+BAA+B;AAC/D,gBAAe,iBAAiB;AAChC,SAAQ;AACR;;AAEA;AACA;AACA,8BAA6B,KAAK;AAClC;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,0DAAyD,sBAAsB;AAC/E;AACA;AACA;;AAEA,uBAAsB,iBAAiB;AACvC;AACA,6CAA4C,yDAAyD;AACrG;;AAEA;AACA,SAAQ;;AAER;AACA;AACA,SAAQ;;AAER;AACA;AACA;AACA;;AAEA,yDAAwD,kBAAkB;AAC1E;AACA;AACA,mCAAkC,yDAAyD;AAC3F,SAAQ;;AAER;AACA;AACA,SAAQ;;AAER;AACA;AACA;AACA;;AAEA,sDAAqD,kBAAkB;AACvE;AACA;AACA,mCAAkC,wDAAwD;AAC1F,SAAQ;;AAER;AACA;AACA,SAAQ;;AAER;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAQ;AACR,2BAA0B,WAAW,EAAE;AACvC,8BAA6B,WAAW;AACxC;;AAEA;AACA;AACA;AACA,sCAAqC,yBAAyB;;AAE9D;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,qBAAoB,mBAAmB;AACvC;;AAEA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA;AACA,WAAU;AACV;AACA;AACA,WAAU;AACV;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,uBAAsB,qBAAqB;AAC3C;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAQ;;AAER;AACA;;AAEA;AACA;AACA,2CAA0C,cAAc;;AAExD;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAQ;;AAER;AACA;AACA;AACA;;AAEA;;AAEA,uBAAsB,qBAAqB;AAC3C;;AAEA;;AAEA;AACA,6CAA4C,sBAAsB;AAClE,aAAY;AACZ,6CAA4C,sBAAsB;AAClE;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAQ;AACR;;AAEA;AACA;;AAEA,sCAAqC,KAAK;AAC1C;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;;AAEN;AACA;AACA;AACA;;AAEA;;AAEA,qBAAoB,mBAAmB;AACvC;;AAEA,uBAAsB,gBAAgB;AACtC;AACA;;AAEA,uBAAsB;AACtB;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAQ,eAAe;AACvB;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,8BAA6B;AAC7B;;AAEA;;AAEA,uBAAsB,iBAAiB;AACvC;;AAEA;;AAEA;;AAEA,yBAAwB,mBAAmB;AAC3C;;AAEA,0EAAyE,UAAU;;AAEnF;;AAEA;AACA,+CAA8C,0DAA0D;AACxG;;AAEA;AACA;AACA;AACA;AACA,2BAA0B;AAC1B;AACA;;AAEA;AACA,6CAA4C,0DAA0D;AACtG;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAQ;;AAER;AACA;;AAEA,uBAAsB,oDAAoD;;AAE1E;;AAEA,uBAAsB,yBAAyB;AAC/C;AACA;;AAEA;AACA,SAAQ;;AAER;AACA;AACA,SAAQ;;AAER;AACA;AACA,uBAAsB,oDAAoD;;AAE1E;;AAEA,uBAAsB,mBAAmB;AACzC;;AAEA,wEAAuE,UAAU;;AAEjF;AACA;AACA;;AAEA,yCAAwC,uBAAuB;;AAE/D;AACA;AACA;;AAEA;AACA,SAAQ;;AAER;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAwB,iBAAiB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA4B,kBAAkB;AAC9C;AACA;AACA;AACA,aAAY;AACZ;AACA;AACA;AACA;;AAEA,mCAAkC,WAAW;;AAE7C;AACA,SAAQ;;AAER;AACA;AACA,sBAAqB,kBAAkB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAY;AACZ;AACA;AACA;AACA;AACA,SAAQ;;AAER;AACA;AACA,yDAAwD;AACxD;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,uCAAsC,mBAAmB;;AAEzD;AACA;AACA;AACA;AACA;;AAEA,mBAAkB,eAAe;AACjC;AACA,iCAAgC,OAAO;AACvC;;AAEA;AACA,mBAAkB,iBAAiB;AACnC,qCAAoC,2BAA2B;AAC/D;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA,sDAAqD,oCAAoC,EAAE;AAC3F,OAAM;AACN;AACA,OAAM;AACN;AACA;AACA,GAAE;;AAEF;AACA,8BAA6B;;AAE7B,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA,QAAO;AACP;AACA;;AAEA,+BAA8B,mDAAmD;;;AAGjF;AACA;AACA,EAAC;AACD;AACA,mC","file":"powerbi.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"powerbi-client\"] = factory();\n\telse\n\t\troot[\"powerbi-client\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 0db7b3dff5cee7f98e62","import * as service from './service';\r\nimport * as factories from './factories';\r\nimport * as models from 'powerbi-models';\r\nimport { IFilterable } from './ifilterable';\r\n\r\nexport {\r\n IFilterable,\r\n service,\r\n factories,\r\n models\r\n};\r\nexport {\r\n Report\r\n} from './report';\r\nexport {\r\n Tile\r\n} from './tile';\r\nexport {\r\n IEmbedConfiguration,\r\n Embed\r\n} from './embed';\r\nexport {\r\n Page\r\n} from './page';\r\n\r\ndeclare var powerbi: service.Service;\r\ndeclare global {\r\n interface Window {\r\n powerbi: service.Service;\r\n }\r\n}\r\n\r\n/**\r\n * Makes Power BI available to the global object for use in applications that don't have module loading support.\r\n *\r\n * Note: create an instance of the class with the default configuration for normal usage, or save the class so that you can create an instance of the service.\r\n */\r\nvar powerbi = new service.Service(factories.hpmFactory, factories.wpmpFactory, factories.routerFactory);\r\nwindow.powerbi = powerbi;\n\n\n// WEBPACK FOOTER //\n// ./src/powerbi.ts","import * as embed from './embed';\nimport { Report } from './report';\nimport { Create } from './create';\nimport { Dashboard } from './dashboard';\nimport { Tile } from './tile';\nimport { Page } from './page';\nimport * as utils from './util';\nimport * as wpmp from 'window-post-message-proxy';\nimport * as hpm from 'http-post-message';\nimport * as router from 'powerbi-router';\nimport * as models from 'powerbi-models';\n\nexport interface IEvent {\n type: string;\n id: string;\n name: string;\n value: T;\n}\n\nexport interface ICustomEvent extends CustomEvent {\n detail: T;\n}\n\nexport interface IEventHandler {\n (event: ICustomEvent): any;\n}\n\nexport interface IHpmFactory {\n (wpmp: wpmp.WindowPostMessageProxy, targetWindow?: Window, version?: string, type?: string, origin?: string): hpm.HttpPostMessage;\n}\n\nexport interface IWpmpFactory {\n (name?: string, logMessages?: boolean, eventSourceOverrideWindow?: Window): wpmp.WindowPostMessageProxy;\n}\n\nexport interface IRouterFactory {\n (wpmp: wpmp.WindowPostMessageProxy): router.Router;\n}\n\nexport interface IPowerBiElement extends HTMLElement {\n powerBiEmbed: embed.Embed;\n}\n\nexport interface IDebugOptions {\n logMessages?: boolean;\n wpmpName?: string;\n}\n\nexport interface IServiceConfiguration extends IDebugOptions {\n autoEmbedOnContentLoaded?: boolean;\n onError?: (error: any) => any;\n version?: string;\n type?: string;\n}\n\nexport interface IService {\n hpm: hpm.HttpPostMessage;\n}\n\n/**\n * The Power BI Service embed component, which is the entry point to embed all other Power BI components into your application\n * \n * @export\n * @class Service\n * @implements {IService}\n */\nexport class Service implements IService {\n\n /**\n * A list of components that this service can embed\n */\n private static components: (typeof Report | typeof Tile | typeof Dashboard)[] = [\n Tile,\n Report,\n Dashboard\n ];\n\n /**\n * The default configuration for the service\n */\n private static defaultConfig: IServiceConfiguration = {\n autoEmbedOnContentLoaded: false,\n onError: (...args) => console.log(args[0], args.slice(1))\n };\n\n /**\n * Gets or sets the access token as the global fallback token to use when a local token is not provided for a report or tile.\n * \n * @type {string}\n */\n accessToken: string;\n\n /**The Configuration object for the service*/\n private config: IServiceConfiguration;\n\n /** A list of Dashboard, Report and Tile components that have been embedded using this service instance. */\n private embeds: embed.Embed[];\n /** TODO: Look for way to make hpm private without sacraficing ease of maitenance. This should be private but in embed needs to call methods. */\n hpm: hpm.HttpPostMessage;\n /** TODO: Look for way to make wpmp private. This is only public to allow stopping the wpmp in tests */\n wpmp: wpmp.WindowPostMessageProxy;\n private router: router.Router;\n\n /**\n * Creates an instance of a Power BI Service.\n * \n * @param {IHpmFactory} hpmFactory The http post message factory used in the postMessage communication layer\n * @param {IWpmpFactory} wpmpFactory The window post message factory used in the postMessage communication layer\n * @param {IRouterFactory} routerFactory The router factory used in the postMessage communication layer\n * @param {IServiceConfiguration} [config={}]\n */\n constructor(hpmFactory: IHpmFactory, wpmpFactory: IWpmpFactory, routerFactory: IRouterFactory, config: IServiceConfiguration = {}) {\n this.wpmp = wpmpFactory(config.wpmpName, config.logMessages);\n this.hpm = hpmFactory(this.wpmp, null, config.version, config.type);\n this.router = routerFactory(this.wpmp);\n\n /**\n * Adds handler for report events.\n */\n this.router.post(`/reports/:uniqueId/events/:eventName`, (req, res) => {\n const event: IEvent = {\n type: 'report',\n id: req.params.uniqueId,\n name: req.params.eventName,\n value: req.body\n };\n\n this.handleEvent(event);\n });\n this.router.post(`/reports/:uniqueId/pages/:pageName/events/:eventName`, (req, res) => {\n const event: IEvent = {\n type: 'report',\n id: req.params.uniqueId,\n name: req.params.eventName,\n value: req.body\n };\n\n this.handleEvent(event);\n });\n\n this.router.post(`/dashboards/:uniqueId/events/:eventName`, (req, res) => {\n const event: IEvent = {\n type: 'dashboard',\n id: req.params.uniqueId,\n name: req.params.eventName,\n value: req.body\n };\n\n this.handleEvent(event);\n });\n\n this.embeds = [];\n\n // TODO: Change when Object.assign is available.\n this.config = utils.assign({}, Service.defaultConfig, config);\n\n if (this.config.autoEmbedOnContentLoaded) {\n this.enableAutoEmbed();\n }\n }\n\n /**\n * Creates new report\n * @param {HTMLElement} element\n * @param {embed.IEmbedConfiguration} [config={}]\n * @returns {embed.Embed}\n */\n createReport(element: HTMLElement, config: embed.IEmbedConfiguration): embed.Embed {\n config.type = 'create';\n let powerBiElement = element;\n const component = new Create(this, powerBiElement, config);\n powerBiElement.powerBiEmbed = component;\n this.embeds.push(component);\n\n return component;\n }\n\n /**\n * TODO: Add a description here\n * \n * @param {HTMLElement} [container]\n * @param {embed.IEmbedConfiguration} [config=undefined]\n * @returns {embed.Embed[]}\n */\n init(container?: HTMLElement, config: embed.IEmbedConfiguration = undefined): embed.Embed[] {\n container = (container && container instanceof HTMLElement) ? container : document.body;\n\n const elements = Array.prototype.slice.call(container.querySelectorAll(`[${embed.Embed.embedUrlAttribute}]`));\n return elements.map(element => this.embed(element, config));\n }\n\n /**\n * Given a configuration based on an HTML element,\n * if the component has already been created and attached to the element, reuses the component instance and existing iframe,\n * otherwise creates a new component instance.\n * \n * @param {HTMLElement} element\n * @param {embed.IEmbedConfiguration} [config={}]\n * @returns {embed.Embed}\n */\n embed(element: HTMLElement, config: embed.IEmbedConfiguration = {}): embed.Embed {\n let component: embed.Embed;\n let powerBiElement = element;\n\n if (powerBiElement.powerBiEmbed) {\n component = this.embedExisting(powerBiElement, config);\n }\n else {\n component = this.embedNew(powerBiElement, config);\n }\n\n return component;\n }\n\n /**\n * Given a configuration based on a Power BI element, saves the component instance that reference the element for later lookup.\n * \n * @private\n * @param {IPowerBiElement} element\n * @param {embed.IEmbedConfiguration} config\n * @returns {embed.Embed}\n */\n private embedNew(element: IPowerBiElement, config: embed.IEmbedConfiguration): embed.Embed {\n const componentType = config.type || element.getAttribute(embed.Embed.typeAttribute);\n if (!componentType) {\n throw new Error(`Attempted to embed using config ${JSON.stringify(config)} on element ${element.outerHTML}, but could not determine what type of component to embed. You must specify a type in the configuration or as an attribute such as '${embed.Embed.typeAttribute}=\"${Report.type.toLowerCase()}\"'.`);\n }\n\n // Saves the type as part of the configuration so that it can be referenced later at a known location.\n config.type = componentType;\n\n const Component = utils.find(component => componentType === component.type.toLowerCase(), Service.components);\n if (!Component) {\n throw new Error(`Attempted to embed component of type: ${componentType} but did not find any matching component. Please verify the type you specified is intended.`);\n }\n\n const component = new Component(this, element, config);\n element.powerBiEmbed = component;\n this.embeds.push(component);\n\n return component;\n }\n\n /**\n * Given an element that already contains an embed component, load with a new configuration.\n * \n * @private\n * @param {IPowerBiElement} element\n * @param {embed.IEmbedConfiguration} config\n * @returns {embed.Embed}\n */\n private embedExisting(element: IPowerBiElement, config: embed.IEmbedConfiguration): embed.Embed {\n const component = utils.find(x => x.element === element, this.embeds);\n if (!component) {\n throw new Error(`Attempted to embed using config ${JSON.stringify(config)} on element ${element.outerHTML} which already has embedded comopnent associated, but could not find the existing comopnent in the list of active components. This could indicate the embeds list is out of sync with the DOM, or the component is referencing the incorrect HTML element.`);\n }\n\n /**\n * TODO: Dynamic embed type switching could be supported but there is work needed to prepare the service state and DOM cleanup.\n * remove all event handlers from the DOM, then reset the element to initial state which removes iframe, and removes from list of embeds\n * then we can call the embedNew function which would allow setting the proper embedUrl and construction of object based on the new type.\n */\n if (typeof config.type === \"string\" && config.type !== component.config.type) {\n\n /**\n * When loading report after create we want to use existing Iframe to optimize load period\n */\n if(config.type === \"report\" && component.config.type === \"create\") {\n const report = new Report(this, element, config, element.powerBiEmbed.iframe);\n report.load(config);\n element.powerBiEmbed = report;\n this.embeds.push(report);\n\n return report;\n }\n\n throw new Error(`Embedding on an existing element with a different type than the previous embed object is not supported. Attempted to embed using config ${JSON.stringify(config)} on element ${element.outerHTML}, but the existing element contains an embed of type: ${this.config.type} which does not match the new type: ${config.type}`);\n }\n\n component.load(config);\n\n return component;\n }\n\n /**\n * Adds an event handler for DOMContentLoaded, which searches the DOM for elements that have the 'powerbi-embed-url' attribute,\n * and automatically attempts to embed a powerbi component based on information from other powerbi-* attributes.\n *\n * Note: Only runs if `config.autoEmbedOnContentLoaded` is true when the service is created.\n * This handler is typically useful only for applications that are rendered on the server so that all required data is available when the handler is called.\n */\n enableAutoEmbed(): void {\n window.addEventListener('DOMContentLoaded', (event: Event) => this.init(document.body), false);\n }\n\n /**\n * Returns an instance of the component associated with the element.\n * \n * @param {HTMLElement} element\n * @returns {(Report | Tile)}\n */\n get(element: HTMLElement): Report | Tile | Dashboard {\n const powerBiElement = element;\n\n if (!powerBiElement.powerBiEmbed) {\n throw new Error(`You attempted to get an instance of powerbi component associated with element: ${element.outerHTML} but there was no associated instance.`);\n }\n\n return powerBiElement.powerBiEmbed;\n }\n\n /**\n * Finds an embed instance by the name or unique ID that is provided.\n * \n * @param {string} uniqueId\n * @returns {(Report | Tile)}\n */\n find(uniqueId: string): Report | Tile | Dashboard {\n return utils.find(x => x.config.uniqueId === uniqueId, this.embeds);\n }\n\n /**\n * Given an HTML element that has a component embedded within it, removes the component from the list of embedded components, removes the association between the element and the component, and removes the iframe.\n * \n * @param {HTMLElement} element\n * @returns {void}\n */\n reset(element: HTMLElement): void {\n const powerBiElement = element;\n\n if (!powerBiElement.powerBiEmbed) {\n return;\n }\n\n /** Removes the component from an internal list of components. */\n utils.remove(x => x === powerBiElement.powerBiEmbed, this.embeds);\n /** Deletes a property from the HTML element. */\n delete powerBiElement.powerBiEmbed;\n /** Removes the iframe from the element. */\n const iframe = element.querySelector('iframe');\n if (iframe) {\n iframe.remove();\n }\n }\n\n /**\n * Given an event object, finds the embed component with the matching type and ID, and invokes its handleEvent method with the event object.\n * \n * @private\n * @param {IEvent} event\n */\n private handleEvent(event: IEvent): void {\n const embed = utils.find(embed => {\n return (embed.config.uniqueId === event.id);\n }, this.embeds);\n\n if (embed) {\n const value = event.value;\n\n if (event.name === 'pageChanged') {\n const pageKey = 'newPage';\n const page: models.IPage = value[pageKey];\n if (!page) {\n throw new Error(`Page model not found at 'event.value.${pageKey}'.`);\n }\n value[pageKey] = new Page(embed, page.name, page.displayName);\n }\n\n utils.raiseCustomEvent(embed.element, event.name, value);\n }\n }\n}\n\n\n// WEBPACK FOOTER //\n// ./src/service.ts","import * as utils from './util';\r\nimport * as service from './service';\r\nimport * as models from 'powerbi-models';\r\nimport * as hpm from 'http-post-message';\r\n\r\ndeclare global {\r\n interface Document {\r\n // Mozilla Fullscreen\r\n mozCancelFullScreen: Function;\r\n\r\n // Ms Fullscreen\r\n msExitFullscreen: Function;\r\n }\r\n\r\n interface HTMLIFrameElement {\r\n // Mozilla Fullscreen\r\n mozRequestFullScreen: Function;\r\n\r\n // Ms Fullscreen\r\n msRequestFullscreen: Function;\r\n }\r\n}\r\n\r\n// TODO: Re-use ILoadConfiguration interface to prevent duplicating properties.\r\n// Current issue is that they are optional when embedding since they can be specificed as attributes but they are required when loading.\r\n/**\r\n * Configuration settings for Power BI embed components\r\n * \r\n * @export\r\n * @interface IEmbedConfiguration\r\n */\r\nexport interface IEmbedConfiguration {\r\n type?: string;\r\n id?: string;\r\n uniqueId?: string;\r\n embedUrl?: string;\r\n accessToken?: string;\r\n settings?: models.ISettings;\r\n pageName?: string;\r\n filters?: models.IFilter[];\r\n pageView?: models.PageView;\r\n datasetId?: string;\r\n permissions?: models.Permissions;\r\n viewMode?: models.ViewMode;\r\n}\r\n\r\nexport interface IInternalEmbedConfiguration extends models.IReportLoadConfiguration {\r\n uniqueId: string;\r\n type: string;\r\n embedUrl: string;\r\n}\r\n\r\nexport interface IInternalEventHandler {\r\n test(event: service.IEvent): boolean;\r\n handle(event: service.ICustomEvent): void;\r\n}\r\n\r\n/**\r\n * Base class for all Power BI embed components\r\n * \r\n * @export\r\n * @abstract\r\n * @class Embed\r\n */\r\nexport abstract class Embed {\r\n static allowedEvents = [\"loaded\", \"saved\", \"rendered\", \"saveAsTriggered\", \"error\", \"dataSelected\"];\r\n static accessTokenAttribute = 'powerbi-access-token';\r\n static embedUrlAttribute = 'powerbi-embed-url';\r\n static nameAttribute = 'powerbi-name';\r\n static typeAttribute = 'powerbi-type';\r\n static type: string;\r\n\r\n private static defaultSettings: models.ISettings = {\r\n filterPaneEnabled: true\r\n };\r\n\r\n allowedEvents = [];\r\n\r\n /**\r\n * Gets or sets the event handler registered for this embed component.\r\n * \r\n * @type {IInternalEventHandler[]}\r\n */\r\n eventHandlers: IInternalEventHandler[];\r\n\r\n /**\r\n * Gets or sets the Power BI embed service.\r\n * \r\n * @type {service.Service}\r\n */\r\n service: service.Service;\r\n\r\n /**\r\n * Gets or sets the HTML element that contains the Power BI embed component.\r\n * \r\n * @type {HTMLElement}\r\n */\r\n element: HTMLElement;\r\n\r\n /**\r\n * Gets or sets the HTML iframe element that renders the Power BI embed component.\r\n * \r\n * @type {HTMLIFrameElement}\r\n */\r\n iframe: HTMLIFrameElement;\r\n\r\n /**\r\n * Gets or sets the configuration settings for the Power BI embed component.\r\n * \r\n * @type {IInternalEmbedConfiguration}\r\n */\r\n config: IInternalEmbedConfiguration;\r\n\r\n /**\r\n * Gets or sets the configuration settings for creating report.\r\n * \r\n * @type {models.IReportCreateConfiguration}\r\n */\r\n createConfig: models.IReportCreateConfiguration;\r\n\r\n /**\r\n * Url used in the load request.\r\n */\r\n loadPath: string;\r\n\r\n /**\r\n * Type of embed\r\n */\r\n embeType: string;\r\n\r\n /**\r\n * Creates an instance of Embed.\r\n * \r\n * Note: there is circular reference between embeds and the service, because\r\n * the service has a list of all embeds on the host page, and each embed has a reference to the service that created it.\r\n * \r\n * @param {service.Service} service\r\n * @param {HTMLElement} element\r\n * @param {IEmbedConfiguration} config\r\n */\r\n constructor(service: service.Service, element: HTMLElement, config: IEmbedConfiguration, iframe?: HTMLIFrameElement) {\r\n Array.prototype.push.apply(this.allowedEvents, Embed.allowedEvents);\r\n this.eventHandlers = [];\r\n this.service = service;\r\n this.element = element;\r\n this.iframe = iframe;\r\n this.embeType = config.type.toLowerCase();\r\n\r\n this.populateConfig(config);\r\n \r\n if(this.embeType === 'create'){\r\n this.setIframe(false/*set EventListener to call create() on 'load' event*/);\r\n } else {\r\n this.setIframe(true/*set EventListener to call load() on 'load' event*/);\r\n }\r\n }\r\n\r\n /**\r\n * Sends createReport configuration data.\r\n * \r\n * ```javascript\r\n * createReport({\r\n * datasetId: '5dac7a4a-4452-46b3-99f6-a25915e0fe55',\r\n * accessToken: 'eyJ0eXA ... TaE2rTSbmg',\r\n * ```\r\n * \r\n * @param {models.IReportCreateConfiguration} config\r\n * @returns {Promise}\r\n */\r\n createReport(config: models.IReportCreateConfiguration): Promise {\r\n const errors = this.validate(config);\r\n if (errors) {\r\n throw errors;\r\n }\r\n \r\n return this.service.hpm.post(\"/report/create\", config, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n return response.body;\r\n },\r\n response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Saves Report.\r\n * \r\n * @returns {Promise}\r\n */\r\n save(): Promise {\r\n return this.service.hpm.post('/report/save', null, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n return response.body;\r\n })\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * SaveAs Report.\r\n * \r\n * @returns {Promise}\r\n */\r\n saveAs(saveAsParameters: models.ISaveAsParameters): Promise {\r\n return this.service.hpm.post('/report/saveAs', saveAsParameters, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n return response.body;\r\n })\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Sends load configuration data.\r\n * \r\n * ```javascript\r\n * report.load({\r\n * type: 'report',\r\n * id: '5dac7a4a-4452-46b3-99f6-a25915e0fe55',\r\n * accessToken: 'eyJ0eXA ... TaE2rTSbmg',\r\n * settings: {\r\n * navContentPaneEnabled: false\r\n * },\r\n * pageName: \"DefaultPage\",\r\n * filters: [\r\n * {\r\n * ... DefaultReportFilter ...\r\n * }\r\n * ]\r\n * })\r\n * .catch(error => { ... });\r\n * ```\r\n * \r\n * @param {models.ILoadConfiguration} config\r\n * @returns {Promise}\r\n */\r\n load(config: models.IReportLoadConfiguration | models.IDashboardLoadConfiguration): Promise {\r\n const errors = this.validate(config);\r\n if (errors) {\r\n throw errors;\r\n }\r\n\r\n return this.service.hpm.post(this.loadPath, config, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n utils.assign(this.config, config);\r\n return response.body;\r\n },\r\n response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Removes one or more event handlers from the list of handlers.\r\n * If a reference to the existing handle function is specified, remove the specific handler.\r\n * If the handler is not specified, remove all handlers for the event name specified.\r\n * \r\n * ```javascript\r\n * report.off('pageChanged')\r\n * \r\n * or \r\n * \r\n * const logHandler = function (event) {\r\n * console.log(event);\r\n * };\r\n * \r\n * report.off('pageChanged', logHandler);\r\n * ```\r\n * \r\n * @template T\r\n * @param {string} eventName\r\n * @param {service.IEventHandler} [handler]\r\n */\r\n off(eventName: string, handler?: service.IEventHandler): void {\r\n const fakeEvent: service.IEvent = { name: eventName, type: null, id: null, value: null };\r\n if (handler) {\r\n utils.remove(eventHandler => eventHandler.test(fakeEvent) && (eventHandler.handle === handler), this.eventHandlers);\r\n this.element.removeEventListener(eventName, handler);\r\n }\r\n else {\r\n const eventHandlersToRemove = this.eventHandlers\r\n .filter(eventHandler => eventHandler.test(fakeEvent));\r\n\r\n eventHandlersToRemove\r\n .forEach(eventHandlerToRemove => {\r\n utils.remove(eventHandler => eventHandler === eventHandlerToRemove, this.eventHandlers);\r\n this.element.removeEventListener(eventName, eventHandlerToRemove.handle);\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Adds an event handler for a specific event.\r\n * \r\n * ```javascript\r\n * report.on('pageChanged', (event) => {\r\n * console.log('PageChanged: ', event.page.name);\r\n * });\r\n * ```\r\n * \r\n * @template T\r\n * @param {string} eventName\r\n * @param {service.IEventHandler} handler\r\n */\r\n on(eventName: string, handler: service.IEventHandler): void {\r\n if (this.allowedEvents.indexOf(eventName) === -1) {\r\n throw new Error(`eventName is must be one of ${this.allowedEvents}. You passed: ${eventName}`);\r\n }\r\n\r\n this.eventHandlers.push({\r\n test: (event: service.IEvent) => event.name === eventName,\r\n handle: handler\r\n });\r\n\r\n this.element.addEventListener(eventName, handler)\r\n }\r\n\r\n /**\r\n * Reloads embed using existing configuration.\r\n * E.g. For reports this effectively clears all filters and makes the first page active which simulates resetting a report back to loaded state.\r\n * \r\n * ```javascript\r\n * report.reload();\r\n * ```\r\n */\r\n reload(): Promise {\r\n return this.load(this.config);\r\n }\r\n \r\n /**\r\n * Set accessToken.\r\n * \r\n * @returns {Promise}\r\n */\r\n setAccessToken(accessToken: string): Promise {\r\n return this.service.hpm.post('/report/token', accessToken, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n return response.body;\r\n })\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n \r\n /**\r\n * Gets an access token from the first available location: config, attribute, global.\r\n * \r\n * @private\r\n * @param {string} globalAccessToken\r\n * @returns {string}\r\n */\r\n private getAccessToken(globalAccessToken: string): string {\r\n const accessToken = this.config.accessToken || this.element.getAttribute(Embed.accessTokenAttribute) || globalAccessToken;\r\n\r\n if (!accessToken) {\r\n throw new Error(`No access token was found for element. You must specify an access token directly on the element using attribute '${Embed.accessTokenAttribute}' or specify a global token at: powerbi.accessToken.`);\r\n }\r\n\r\n return accessToken;\r\n }\r\n\r\n /**\r\n * Populate config for create and load\r\n * \r\n * @private\r\n * @param {IEmbedConfiguration}\r\n * @returns {void}\r\n */\r\n private populateConfig(config: IEmbedConfiguration): void {\r\n // TODO: Change when Object.assign is available.\r\n const settings = utils.assign({}, Embed.defaultSettings, config.settings);\r\n this.config = utils.assign({ settings }, config);\r\n this.config.uniqueId = this.getUniqueId();\r\n this.config.embedUrl = this.getEmbedUrl();\r\n\r\n if(this.embeType === 'create') {\r\n this.createConfig = {\r\n datasetId: config.datasetId || this.getId(),\r\n accessToken: this.getAccessToken(this.service.accessToken),\r\n settings: settings\r\n }\r\n } else {\r\n this.config.id = this.getId();\r\n this.config.accessToken = this.getAccessToken(this.service.accessToken);\r\n } \r\n }\r\n\r\n\r\n /**\r\n * Gets an embed url from the first available location: options, attribute.\r\n * \r\n * @private\r\n * @returns {string}\r\n */\r\n private getEmbedUrl(): string {\r\n const embedUrl = this.config.embedUrl || this.element.getAttribute(Embed.embedUrlAttribute);\r\n\r\n if (typeof embedUrl !== 'string' || embedUrl.length === 0) {\r\n throw new Error(`Embed Url is required, but it was not found. You must provide an embed url either as part of embed configuration or as attribute '${Embed.embedUrlAttribute}'.`);\r\n }\r\n\r\n return embedUrl;\r\n }\r\n\r\n /**\r\n * Gets a unique ID from the first available location: options, attribute.\r\n * If neither is provided generate a unique string.\r\n * \r\n * @private\r\n * @returns {string}\r\n */\r\n private getUniqueId(): string {\r\n return this.config.uniqueId || this.element.getAttribute(Embed.nameAttribute) || utils.createRandomString();\r\n }\r\n\r\n /**\r\n * Gets the report ID from the first available location: options, attribute.\r\n * \r\n * @abstract\r\n * @returns {string}\r\n */\r\n abstract getId(): string;\r\n\r\n /**\r\n * Requests the browser to render the component's iframe in fullscreen mode.\r\n */\r\n fullscreen(): void {\r\n const requestFullScreen = this.iframe.requestFullscreen || this.iframe.msRequestFullscreen || this.iframe.mozRequestFullScreen || this.iframe.webkitRequestFullscreen;\r\n requestFullScreen.call(this.iframe);\r\n }\r\n\r\n /**\r\n * Requests the browser to exit fullscreen mode.\r\n */\r\n exitFullscreen(): void {\r\n if (!this.isFullscreen(this.iframe)) {\r\n return;\r\n }\r\n\r\n const exitFullscreen = document.exitFullscreen || document.mozCancelFullScreen || document.webkitExitFullscreen || document.msExitFullscreen;\r\n exitFullscreen.call(document);\r\n }\r\n\r\n /**\r\n * Returns true if the iframe is rendered in fullscreen mode,\r\n * otherwise returns false.\r\n * \r\n * @private\r\n * @param {HTMLIFrameElement} iframe\r\n * @returns {boolean}\r\n */\r\n private isFullscreen(iframe: HTMLIFrameElement): boolean {\r\n const options = ['fullscreenElement', 'webkitFullscreenElement', 'mozFullscreenScreenElement', 'msFullscreenElement'];\r\n\r\n return options.some(option => document[option] === iframe);\r\n }\r\n \r\n /**\r\n * Validate load and create configuration.\r\n */\r\n abstract validate(config: models.IReportLoadConfiguration | models.IDashboardLoadConfiguration | models.IReportCreateConfiguration): models.IError[];\r\n\r\n /**\r\n * Sets Iframe for embed\r\n */\r\n private setIframe(isLoad: boolean): void {\r\n if(!this.iframe) {\r\n const iframeHtml = ``;\r\n this.element.innerHTML = iframeHtml;\r\n this.iframe = this.element.childNodes[0];\r\n }\r\n\r\n if(isLoad){\r\n this.iframe.addEventListener('load', () => this.load(this.config), false);\r\n } else {\r\n this.iframe.addEventListener('load', () => this.createReport(this.createConfig), false);\r\n }\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/embed.ts","\r\n/**\r\n * Raises a custom event with event data on the specified HTML element.\r\n * \r\n * @export\r\n * @param {HTMLElement} element\r\n * @param {string} eventName\r\n * @param {*} eventData\r\n */\r\nexport function raiseCustomEvent(element: HTMLElement, eventName: string, eventData: any): void {\r\n let customEvent;\r\n if (typeof CustomEvent === 'function') {\r\n customEvent = new CustomEvent(eventName, {\r\n detail: eventData,\r\n bubbles: true,\r\n cancelable: true\r\n });\r\n } else {\r\n customEvent = document.createEvent('CustomEvent');\r\n customEvent.initCustomEvent(eventName, true, true, eventData);\r\n }\r\n\r\n element.dispatchEvent(customEvent);\r\n}\r\n\r\n/**\r\n * Finds the index of the first value in an array that matches the specified predicate.\r\n * \r\n * @export\r\n * @template T\r\n * @param {(x: T) => boolean} predicate\r\n * @param {T[]} xs\r\n * @returns {number}\r\n */\r\nexport function findIndex(predicate: (x: T) => boolean, xs: T[]): number {\r\n if (!Array.isArray(xs)) {\r\n throw new Error(`You attempted to call find with second parameter that was not an array. You passed: ${xs}`);\r\n }\r\n\r\n let index;\r\n xs.some((x, i) => {\r\n if (predicate(x)) {\r\n index = i;\r\n return true;\r\n }\r\n });\r\n\r\n return index;\r\n}\r\n\r\n/**\r\n * Finds the first value in an array that matches the specified predicate.\r\n * \r\n * @export\r\n * @template T\r\n * @param {(x: T) => boolean} predicate\r\n * @param {T[]} xs\r\n * @returns {T}\r\n */\r\nexport function find(predicate: (x: T) => boolean, xs: T[]): T {\r\n const index = findIndex(predicate, xs);\r\n return xs[index];\r\n}\r\n\r\nexport function remove(predicate: (x: T) => boolean, xs: T[]): void {\r\n const index = findIndex(predicate, xs);\r\n xs.splice(index, 1);\r\n}\r\n\r\n// See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\r\n// TODO: replace in favor of using polyfill\r\n/**\r\n * Copies the values of all enumerable properties from one or more source objects to a target object, and returns the target object.\r\n * \r\n * @export\r\n * @param {any} args\r\n * @returns\r\n */\r\nexport function assign(...args) {\r\n var target = args[0];\r\n\r\n 'use strict';\r\n if (target === undefined || target === null) {\r\n throw new TypeError('Cannot convert undefined or null to object');\r\n }\r\n\r\n var output = Object(target);\r\n for (var index = 1; index < arguments.length; index++) {\r\n var source = arguments[index];\r\n if (source !== undefined && source !== null) {\r\n for (var nextKey in source) {\r\n if (source.hasOwnProperty(nextKey)) {\r\n output[nextKey] = source[nextKey];\r\n }\r\n }\r\n }\r\n }\r\n return output;\r\n}\r\n\r\n/**\r\n * Generates a random 7 character string.\r\n * \r\n * @export\r\n * @returns {string}\r\n */\r\nexport function createRandomString(): string {\r\n return (Math.random() + 1).toString(36).substring(7);\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/util.ts","import * as service from './service';\nimport * as embed from './embed';\nimport * as models from 'powerbi-models';\nimport * as wpmp from 'window-post-message-proxy';\nimport * as hpm from 'http-post-message';\nimport * as utils from './util';\nimport { IFilterable } from './ifilterable';\nimport { IPageNode, Page } from './page';\n\n/**\n * A Report node within a report hierarchy\n * \n * @export\n * @interface IReportNode\n */\nexport interface IReportNode {\n iframe: HTMLIFrameElement;\n service: service.IService;\n config: embed.IInternalEmbedConfiguration\n}\n\n/**\n * The Power BI Report embed component\n * \n * @export\n * @class Report\n * @extends {embed.Embed}\n * @implements {IReportNode}\n * @implements {IFilterable}\n */\nexport class Report extends embed.Embed implements IReportNode, IFilterable {\n static allowedEvents = [\"filtersApplied\", \"pageChanged\"];\n static reportIdAttribute = 'powerbi-report-id';\n static filterPaneEnabledAttribute = 'powerbi-settings-filter-pane-enabled';\n static navContentPaneEnabledAttribute = 'powerbi-settings-nav-content-pane-enabled';\n static typeAttribute = 'powerbi-type';\n static type = \"Report\";\n\n /**\n * Creates an instance of a Power BI Report.\n * \n * @param {service.Service} service\n * @param {HTMLElement} element\n * @param {embed.IEmbedConfiguration} config\n */\n constructor(service: service.Service, element: HTMLElement, config: embed.IEmbedConfiguration, iframe?: HTMLIFrameElement) {\n const filterPaneEnabled = (config.settings && config.settings.filterPaneEnabled) || !(element.getAttribute(Report.filterPaneEnabledAttribute) === \"false\");\n const navContentPaneEnabled = (config.settings && config.settings.navContentPaneEnabled) || !(element.getAttribute(Report.navContentPaneEnabledAttribute) === \"false\");\n const settings = utils.assign({\n filterPaneEnabled,\n navContentPaneEnabled\n }, config.settings);\n const configCopy = utils.assign({ settings }, config);\n\n super(service, element, configCopy, iframe);\n this.loadPath = \"/report/load\";\n Array.prototype.push.apply(this.allowedEvents, Report.allowedEvents);\n }\n\n /**\n * Adds backwards compatibility for the previous load configuration, which used the reportId query parameter to specify the report ID\n * (e.g. http://embedded.powerbi.com/appTokenReportEmbed?reportId=854846ed-2106-4dc2-bc58-eb77533bf2f1).\n * \n * By extracting the ID we can ensure that the ID is always explicitly provided as part of the load configuration.\n * \n * @static\n * @param {string} url\n * @returns {string}\n */\n static findIdFromEmbedUrl(url: string): string {\n const reportIdRegEx = /reportId=\"?([^&]+)\"?/\n const reportIdMatch = url.match(reportIdRegEx);\n\n let reportId;\n if (reportIdMatch) {\n reportId = reportIdMatch[1];\n }\n\n return reportId;\n }\n\n /**\n * Gets filters that are applied at the report level.\n * \n * ```javascript\n * // Get filters applied at report level\n * report.getFilters()\n * .then(filters => {\n * ...\n * });\n * ```\n * \n * @returns {Promise}\n */\n getFilters(): Promise {\n return this.service.hpm.get(`/report/filters`, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .then(response => response.body,\n response => {\n throw response.body;\n });\n }\n\n /**\n * Gets the report ID from the first available location: options, attribute, embed url.\n * \n * @returns {string}\n */\n getId(): string {\n const reportId = this.config.id || this.element.getAttribute(Report.reportIdAttribute) || Report.findIdFromEmbedUrl(this.config.embedUrl);\n\n if (typeof reportId !== 'string' || reportId.length === 0) {\n throw new Error(`Report id is required, but it was not found. You must provide an id either as part of embed configuration or as attribute '${Report.reportIdAttribute}'.`);\n }\n\n return reportId;\n }\n\n /**\n * Gets the list of pages within the report.\n * \n * ```javascript\n * report.getPages()\n * .then(pages => {\n * ...\n * });\n * ```\n * \n * @returns {Promise}\n */\n getPages(): Promise {\n return this.service.hpm.get('/report/pages', { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .then(response => {\n return response.body\n .map(page => {\n return new Page(this, page.name, page.displayName);\n });\n }, response => {\n throw response.body;\n });\n }\n\n /**\n * Creates an instance of a Page.\n * \n * Normally you would get Page objects by calling `report.getPages()`, but in the case\n * that the page name is known and you want to perform an action on a page without having to retrieve it\n * you can create it directly.\n * \n * Note: Because you are creating the page manually there is no guarantee that the page actually exists in the report, and subsequent requests could fail.\n * \n * ```javascript\n * const page = report.page('ReportSection1');\n * page.setActive();\n * ```\n * \n * @param {string} name\n * @param {string} [displayName]\n * @returns {Page}\n */\n page(name: string, displayName?: string): Page {\n return new Page(this, name, displayName);\n }\n\n /**\n * Prints the active page of the report by invoking `window.print()` on the embed iframe component.\n */\n print(): Promise {\n return this.service.hpm.post('/report/print', null, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .then(response => {\n return response.body;\n })\n .catch(response => {\n throw response.body;\n });\n }\n\n /**\n * Removes all filters at the report level.\n * \n * ```javascript\n * report.removeFilters();\n * ```\n * \n * @returns {Promise}\n */\n removeFilters(): Promise {\n return this.setFilters([]);\n }\n\n /**\n * Sets the active page of the report.\n * \n * ```javascript\n * report.setPage(\"page2\")\n * .catch(error => { ... });\n * ```\n * \n * @param {string} pageName\n * @returns {Promise}\n */\n setPage(pageName: string): Promise {\n const page: models.IPage = {\n name: pageName,\n displayName: null\n };\n\n return this.service.hpm.put('/report/pages/active', page, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .catch(response => {\n throw response.body;\n });\n }\n\n /**\n * Sets filters at the report level.\n * \n * ```javascript\n * const filters: [\n * ...\n * ];\n * \n * report.setFilters(filters)\n * .catch(errors => {\n * ...\n * });\n * ```\n * \n * @param {(models.IFilter[])} filters\n * @returns {Promise}\n */\n setFilters(filters: models.IFilter[]): Promise {\n return this.service.hpm.put(`/report/filters`, filters, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .catch(response => {\n throw response.body;\n });\n }\n\n /**\n * Updates visibility settings for the filter pane and the page navigation pane.\n * \n * ```javascript\n * const newSettings = {\n * navContentPaneEnabled: true,\n * filterPaneEnabled: false\n * };\n * \n * report.updateSettings(newSettings)\n * .catch(error => { ... });\n * ```\n * \n * @param {models.ISettings} settings\n * @returns {Promise}\n */\n updateSettings(settings: models.ISettings): Promise {\n return this.service.hpm.patch('/report/settings', settings, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .catch(response => {\n throw response.body;\n });\n }\n\n /**\n * Validate load configuration.\n */\n validate(config: models.IReportLoadConfiguration): models.IError[] {\n return models.validateReportLoad(config);\n }\n\n /**\n * Switch Report view mode.\n * \n * @returns {Promise}\n */\n switchMode(viewMode: models.ViewMode): Promise {\n let url = '/report/switchMode/' + viewMode;\n return this.service.hpm.post(url, null, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .then(response => {\n return response.body;\n })\n .catch(response => {\n throw response.body;\n });\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/report.ts","/*! powerbi-models v0.11.1 | (c) 2016 Microsoft Corporation MIT */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"powerbi-models\"] = factory();\n\telse\n\t\troot[\"powerbi-models\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __extends = (this && this.__extends) || function (d, b) {\r\n\t for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\r\n\t function __() { this.constructor = d; }\r\n\t d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n\t};\r\n\t/* tslint:disable:no-var-requires */\r\n\texports.advancedFilterSchema = __webpack_require__(1);\r\n\texports.filterSchema = __webpack_require__(2);\r\n\texports.loadSchema = __webpack_require__(3);\r\n\texports.dashboardLoadSchema = __webpack_require__(4);\r\n\texports.pageSchema = __webpack_require__(5);\r\n\texports.settingsSchema = __webpack_require__(6);\r\n\texports.basicFilterSchema = __webpack_require__(7);\r\n\texports.createReportSchema = __webpack_require__(8);\r\n\texports.saveAsParametersSchema = __webpack_require__(9);\r\n\t/* tslint:enable:no-var-requires */\r\n\tvar jsen = __webpack_require__(10);\r\n\tfunction normalizeError(error) {\r\n\t var message = error.message;\r\n\t if (!message) {\r\n\t message = error.path + \" is invalid. Not meeting \" + error.keyword + \" constraint\";\r\n\t }\r\n\t return {\r\n\t message: message\r\n\t };\r\n\t}\r\n\t/**\r\n\t * Takes in schema and returns function which can be used to validate the schema with better semantics around exposing errors\r\n\t */\r\n\tfunction validate(schema, options) {\r\n\t return function (x) {\r\n\t var validate = jsen(schema, options);\r\n\t var isValid = validate(x);\r\n\t if (isValid) {\r\n\t return undefined;\r\n\t }\r\n\t else {\r\n\t return validate.errors\r\n\t .map(normalizeError);\r\n\t }\r\n\t };\r\n\t}\r\n\texports.validateSettings = validate(exports.settingsSchema, {\r\n\t schemas: {\r\n\t basicFilter: exports.basicFilterSchema,\r\n\t advancedFilter: exports.advancedFilterSchema\r\n\t }\r\n\t});\r\n\texports.validateReportLoad = validate(exports.loadSchema, {\r\n\t schemas: {\r\n\t settings: exports.settingsSchema,\r\n\t basicFilter: exports.basicFilterSchema,\r\n\t advancedFilter: exports.advancedFilterSchema\r\n\t }\r\n\t});\r\n\texports.validateCreateReport = validate(exports.createReportSchema);\r\n\texports.validateDashboardLoad = validate(exports.dashboardLoadSchema);\r\n\texports.validatePage = validate(exports.pageSchema);\r\n\texports.validateFilter = validate(exports.filterSchema, {\r\n\t schemas: {\r\n\t basicFilter: exports.basicFilterSchema,\r\n\t advancedFilter: exports.advancedFilterSchema\r\n\t }\r\n\t});\r\n\t(function (FilterType) {\r\n\t FilterType[FilterType[\"Advanced\"] = 0] = \"Advanced\";\r\n\t FilterType[FilterType[\"Basic\"] = 1] = \"Basic\";\r\n\t FilterType[FilterType[\"Unknown\"] = 2] = \"Unknown\";\r\n\t})(exports.FilterType || (exports.FilterType = {}));\r\n\tvar FilterType = exports.FilterType;\r\n\tfunction isFilterKeyColumnsTarget(target) {\r\n\t return isColumn(target) && !!target.keys;\r\n\t}\r\n\texports.isFilterKeyColumnsTarget = isFilterKeyColumnsTarget;\r\n\tfunction isBasicFilterWithKeys(filter) {\r\n\t return getFilterType(filter) === FilterType.Basic && !!filter.keyValues;\r\n\t}\r\n\texports.isBasicFilterWithKeys = isBasicFilterWithKeys;\r\n\tfunction getFilterType(filter) {\r\n\t var basicFilter = filter;\r\n\t var advancedFilter = filter;\r\n\t if ((typeof basicFilter.operator === \"string\")\r\n\t && (Array.isArray(basicFilter.values))) {\r\n\t return FilterType.Basic;\r\n\t }\r\n\t else if ((typeof advancedFilter.logicalOperator === \"string\")\r\n\t && (Array.isArray(advancedFilter.conditions))) {\r\n\t return FilterType.Advanced;\r\n\t }\r\n\t else {\r\n\t return FilterType.Unknown;\r\n\t }\r\n\t}\r\n\texports.getFilterType = getFilterType;\r\n\tfunction isMeasure(arg) {\r\n\t return arg.table !== undefined && arg.measure !== undefined;\r\n\t}\r\n\texports.isMeasure = isMeasure;\r\n\tfunction isColumn(arg) {\r\n\t return arg.table !== undefined && arg.column !== undefined;\r\n\t}\r\n\texports.isColumn = isColumn;\r\n\tfunction isHierarchy(arg) {\r\n\t return arg.table !== undefined && arg.hierarchy !== undefined && arg.hierarchyLevel !== undefined;\r\n\t}\r\n\texports.isHierarchy = isHierarchy;\r\n\tvar Filter = (function () {\r\n\t function Filter(target) {\r\n\t this.target = target;\r\n\t }\r\n\t Filter.prototype.toJSON = function () {\r\n\t return {\r\n\t $schema: this.schemaUrl,\r\n\t target: this.target\r\n\t };\r\n\t };\r\n\t ;\r\n\t return Filter;\r\n\t}());\r\n\texports.Filter = Filter;\r\n\tvar BasicFilter = (function (_super) {\r\n\t __extends(BasicFilter, _super);\r\n\t function BasicFilter(target, operator) {\r\n\t var values = [];\r\n\t for (var _i = 2; _i < arguments.length; _i++) {\r\n\t values[_i - 2] = arguments[_i];\r\n\t }\r\n\t _super.call(this, target);\r\n\t this.operator = operator;\r\n\t this.schemaUrl = BasicFilter.schemaUrl;\r\n\t if (values.length === 0 && operator !== \"All\") {\r\n\t throw new Error(\"values must be a non-empty array unless your operator is \\\"All\\\".\");\r\n\t }\r\n\t /**\r\n\t * Accept values as array instead of as individual arguments\r\n\t * new BasicFilter('a', 'b', 1, 2);\r\n\t * new BasicFilter('a', 'b', [1,2]);\r\n\t */\r\n\t if (Array.isArray(values[0])) {\r\n\t this.values = values[0];\r\n\t }\r\n\t else {\r\n\t this.values = values;\r\n\t }\r\n\t }\r\n\t BasicFilter.prototype.toJSON = function () {\r\n\t var filter = _super.prototype.toJSON.call(this);\r\n\t filter.operator = this.operator;\r\n\t filter.values = this.values;\r\n\t return filter;\r\n\t };\r\n\t BasicFilter.schemaUrl = \"http://powerbi.com/product/schema#basic\";\r\n\t return BasicFilter;\r\n\t}(Filter));\r\n\texports.BasicFilter = BasicFilter;\r\n\tvar BasicFilterWithKeys = (function (_super) {\r\n\t __extends(BasicFilterWithKeys, _super);\r\n\t function BasicFilterWithKeys(target, operator, values, keyValues) {\r\n\t _super.call(this, target, operator, values);\r\n\t this.keyValues = keyValues;\r\n\t this.target = target;\r\n\t var numberOfKeys = target.keys ? target.keys.length : 0;\r\n\t if (numberOfKeys > 0 && !keyValues) {\r\n\t throw new Error(\"You shold pass the values to be filtered for each key. You passed: no values and \" + numberOfKeys + \" keys\");\r\n\t }\r\n\t if (numberOfKeys === 0 && keyValues && keyValues.length > 0) {\r\n\t throw new Error(\"You passed key values but your target object doesn't contain the keys to be filtered\");\r\n\t }\r\n\t for (var i = 0; i < this.keyValues.length; i++) {\r\n\t if (this.keyValues[i]) {\r\n\t var lengthOfArray = this.keyValues[i].length;\r\n\t if (lengthOfArray !== numberOfKeys) {\r\n\t throw new Error(\"Each tuple of key values should contain a value for each of the keys. You passed: \" + lengthOfArray + \" values and \" + numberOfKeys + \" keys\");\r\n\t }\r\n\t }\r\n\t }\r\n\t }\r\n\t BasicFilterWithKeys.prototype.toJSON = function () {\r\n\t var filter = _super.prototype.toJSON.call(this);\r\n\t filter.keyValues = this.keyValues;\r\n\t return filter;\r\n\t };\r\n\t return BasicFilterWithKeys;\r\n\t}(BasicFilter));\r\n\texports.BasicFilterWithKeys = BasicFilterWithKeys;\r\n\tvar AdvancedFilter = (function (_super) {\r\n\t __extends(AdvancedFilter, _super);\r\n\t function AdvancedFilter(target, logicalOperator) {\r\n\t var conditions = [];\r\n\t for (var _i = 2; _i < arguments.length; _i++) {\r\n\t conditions[_i - 2] = arguments[_i];\r\n\t }\r\n\t _super.call(this, target);\r\n\t this.schemaUrl = AdvancedFilter.schemaUrl;\r\n\t // Guard statements\r\n\t if (typeof logicalOperator !== \"string\" || logicalOperator.length === 0) {\r\n\t // TODO: It would be nicer to list out the possible logical operators.\r\n\t throw new Error(\"logicalOperator must be a valid operator, You passed: \" + logicalOperator);\r\n\t }\r\n\t this.logicalOperator = logicalOperator;\r\n\t var extractedConditions;\r\n\t /**\r\n\t * Accept conditions as array instead of as individual arguments\r\n\t * new AdvancedFilter('a', 'b', \"And\", { value: 1, operator: \"Equals\" }, { value: 2, operator: \"IsGreaterThan\" });\r\n\t * new AdvancedFilter('a', 'b', \"And\", [{ value: 1, operator: \"Equals\" }, { value: 2, operator: \"IsGreaterThan\" }]);\r\n\t */\r\n\t if (Array.isArray(conditions[0])) {\r\n\t extractedConditions = conditions[0];\r\n\t }\r\n\t else {\r\n\t extractedConditions = conditions;\r\n\t }\r\n\t if (extractedConditions.length === 0) {\r\n\t throw new Error(\"conditions must be a non-empty array. You passed: \" + conditions);\r\n\t }\r\n\t if (extractedConditions.length > 2) {\r\n\t throw new Error(\"AdvancedFilters may not have more than two conditions. You passed: \" + conditions.length);\r\n\t }\r\n\t if (extractedConditions.length === 1 && logicalOperator !== \"And\") {\r\n\t throw new Error(\"Logical Operator must be \\\"And\\\" when there is only one condition provided\");\r\n\t }\r\n\t this.conditions = extractedConditions;\r\n\t }\r\n\t AdvancedFilter.prototype.toJSON = function () {\r\n\t var filter = _super.prototype.toJSON.call(this);\r\n\t filter.logicalOperator = this.logicalOperator;\r\n\t filter.conditions = this.conditions;\r\n\t return filter;\r\n\t };\r\n\t AdvancedFilter.schemaUrl = \"http://powerbi.com/product/schema#advanced\";\r\n\t return AdvancedFilter;\r\n\t}(Filter));\r\n\texports.AdvancedFilter = AdvancedFilter;\r\n\t(function (Permissions) {\r\n\t Permissions[Permissions[\"Read\"] = 0] = \"Read\";\r\n\t Permissions[Permissions[\"ReadWrite\"] = 1] = \"ReadWrite\";\r\n\t Permissions[Permissions[\"Copy\"] = 2] = \"Copy\";\r\n\t Permissions[Permissions[\"Create\"] = 4] = \"Create\";\r\n\t Permissions[Permissions[\"All\"] = 7] = \"All\";\r\n\t})(exports.Permissions || (exports.Permissions = {}));\r\n\tvar Permissions = exports.Permissions;\r\n\t(function (ViewMode) {\r\n\t ViewMode[ViewMode[\"View\"] = 0] = \"View\";\r\n\t ViewMode[ViewMode[\"Edit\"] = 1] = \"Edit\";\r\n\t})(exports.ViewMode || (exports.ViewMode = {}));\r\n\tvar ViewMode = exports.ViewMode;\r\n\texports.validateSaveAsParameters = validate(exports.saveAsParametersSchema);\r\n\n\n/***/ },\n/* 1 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"target\": {\n\t\t\t\t\"oneOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\t\"table\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"column\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"required\": [\n\t\t\t\t\t\t\t\"table\",\n\t\t\t\t\t\t\t\"column\"\n\t\t\t\t\t\t]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\t\"table\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"hierarchy\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"hierarchyLevel\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"required\": [\n\t\t\t\t\t\t\t\"table\",\n\t\t\t\t\t\t\t\"hierarchy\",\n\t\t\t\t\t\t\t\"hierarchyLevel\"\n\t\t\t\t\t\t]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\t\"table\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"measure\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"required\": [\n\t\t\t\t\t\t\t\"table\",\n\t\t\t\t\t\t\t\"measure\"\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"logicalOperator\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"conditions\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\"value\": {\n\t\t\t\t\t\t\t\"type\": [\n\t\t\t\t\t\t\t\t\"string\",\n\t\t\t\t\t\t\t\t\"boolean\",\n\t\t\t\t\t\t\t\t\"number\"\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"operator\": {\n\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\"required\": [\n\t\t\t\t\t\t\"value\",\n\t\t\t\t\t\t\"operator\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"target\",\n\t\t\t\"logicalOperator\",\n\t\t\t\"conditions\"\n\t\t]\n\t};\n\n/***/ },\n/* 2 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"oneOf\": [\n\t\t\t{\n\t\t\t\t\"$ref\": \"#basicFilter\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"$ref\": \"#advancedFilter\"\n\t\t\t}\n\t\t],\n\t\t\"invalidMessage\": \"filter is invalid\"\n\t};\n\n/***/ },\n/* 3 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"accessToken\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"accessToken must be a string\",\n\t\t\t\t\t\"required\": \"accessToken is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"id\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"id must be a string\",\n\t\t\t\t\t\"required\": \"id is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"settings\": {\n\t\t\t\t\"$ref\": \"#settings\"\n\t\t\t},\n\t\t\t\"pageName\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"pageName must be a string\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"filters\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\"oneOf\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"$ref\": \"#basicFilter\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"$ref\": \"#advancedFilter\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t\"invalidMessage\": \"filters property is invalid\"\n\t\t\t},\n\t\t\t\"permissions\": {\n\t\t\t\t\"type\": \"number\",\n\t\t\t\t\"enum\": [\n\t\t\t\t\t0,\n\t\t\t\t\t1,\n\t\t\t\t\t2,\n\t\t\t\t\t4,\n\t\t\t\t\t7\n\t\t\t\t],\n\t\t\t\t\"default\": 0,\n\t\t\t\t\"invalidMessage\": \"permissions property is invalid\"\n\t\t\t},\n\t\t\t\"viewMode\": {\n\t\t\t\t\"type\": \"number\",\n\t\t\t\t\"enum\": [\n\t\t\t\t\t0,\n\t\t\t\t\t1\n\t\t\t\t],\n\t\t\t\t\"default\": 0,\n\t\t\t\t\"invalidMessage\": \"viewMode property is invalid\"\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"accessToken\",\n\t\t\t\"id\"\n\t\t]\n\t};\n\n/***/ },\n/* 4 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"accessToken\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"accessToken must be a string\",\n\t\t\t\t\t\"required\": \"accessToken is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"id\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"id must be a string\",\n\t\t\t\t\t\"required\": \"id is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"pageView\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"pageView must be a string with one of the following values: \\\"actualSize\\\", \\\"fitToWidth\\\", \\\"oneColumn\\\"\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"accessToken\",\n\t\t\t\"id\"\n\t\t]\n\t};\n\n/***/ },\n/* 5 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"name\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"name must be a string\",\n\t\t\t\t\t\"required\": \"name is required\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"name\"\n\t\t]\n\t};\n\n/***/ },\n/* 6 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"filterPaneEnabled\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"filterPaneEnabled must be a boolean\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"navContentPaneEnabled\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"navContentPaneEnabled must be a boolean\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"useCustomSaveAsDialog\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"useCustomSaveAsDialog must be a boolean\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n/***/ },\n/* 7 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"target\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"properties\": {\n\t\t\t\t\t\"table\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"column\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"hierarchy\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"hierarchyLevel\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"measure\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"required\": [\n\t\t\t\t\t\"table\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"operator\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"values\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"type\": [\n\t\t\t\t\t\t\"string\",\n\t\t\t\t\t\t\"boolean\",\n\t\t\t\t\t\t\"number\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"target\",\n\t\t\t\"operator\",\n\t\t\t\"values\"\n\t\t]\n\t};\n\n/***/ },\n/* 8 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"accessToken\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"accessToken must be a string\",\n\t\t\t\t\t\"required\": \"accessToken is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"datasetId\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"datasetId must be a string\",\n\t\t\t\t\t\"required\": \"datasetId is required\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"accessToken\",\n\t\t\t\"datasetId\"\n\t\t]\n\t};\n\n/***/ },\n/* 9 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"name\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"name must be a string\",\n\t\t\t\t\t\"required\": \"name is required\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"name\"\n\t\t]\n\t};\n\n/***/ },\n/* 10 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = __webpack_require__(11);\n\n/***/ },\n/* 11 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar REGEX_ESCAPE_EXPR = /[\\/]/g,\n\t STR_ESCAPE_EXPR = /(\")/gim,\n\t VALID_IDENTIFIER_EXPR = /^[a-z_$][0-9a-z]*$/gi,\n\t INVALID_SCHEMA = 'jsen: invalid schema object',\n\t browser = typeof window === 'object' && !!window.navigator, // jshint ignore: line\n\t regescape = new RegExp('/').source !== '/', // node v0.x does not properly escape '/'s in inline regex\n\t func = __webpack_require__(12),\n\t equal = __webpack_require__(13),\n\t unique = __webpack_require__(14),\n\t SchemaResolver = __webpack_require__(15),\n\t formats = __webpack_require__(24),\n\t ucs2length = __webpack_require__(25),\n\t types = {},\n\t keywords = {};\n\t\n\tfunction inlineRegex(regex) {\n\t regex = regex instanceof RegExp ? regex : new RegExp(regex);\n\t\n\t return regescape ?\n\t regex.toString() :\n\t '/' + regex.source.replace(REGEX_ESCAPE_EXPR, '\\\\$&') + '/';\n\t}\n\t\n\tfunction encodeStr(str) {\n\t return '\"' + str.replace(STR_ESCAPE_EXPR, '\\\\$1') + '\"';\n\t}\n\t\n\tfunction appendToPath(path, key) {\n\t VALID_IDENTIFIER_EXPR.lastIndex = 0;\n\t\n\t return VALID_IDENTIFIER_EXPR.test(key) ?\n\t path + '.' + key :\n\t path + '[' + encodeStr(key) + ']';\n\t}\n\t\n\tfunction type(obj) {\n\t if (obj === undefined) {\n\t return 'undefined';\n\t }\n\t\n\t var str = Object.prototype.toString.call(obj);\n\t return str.substr(8, str.length - 9).toLowerCase();\n\t}\n\t\n\tfunction isInteger(obj) {\n\t return (obj | 0) === obj; // jshint ignore: line\n\t}\n\t\n\ttypes['null'] = function (path) {\n\t return path + ' === null';\n\t};\n\t\n\ttypes.boolean = function (path) {\n\t return 'typeof ' + path + ' === \"boolean\"';\n\t};\n\t\n\ttypes.string = function (path) {\n\t return 'typeof ' + path + ' === \"string\"';\n\t};\n\t\n\ttypes.number = function (path) {\n\t return 'typeof ' + path + ' === \"number\"';\n\t};\n\t\n\ttypes.integer = function (path) {\n\t return 'typeof ' + path + ' === \"number\" && !(' + path + ' % 1)';\n\t};\n\t\n\ttypes.array = function (path) {\n\t return 'Array.isArray(' + path + ')';\n\t};\n\t\n\ttypes.object = function (path) {\n\t return 'typeof ' + path + ' === \"object\" && ' + path + ' !== null && !Array.isArray(' + path + ')';\n\t};\n\t\n\ttypes.date = function (path) {\n\t return path + ' instanceof Date';\n\t};\n\t\n\tkeywords.enum = function (context) {\n\t var arr = context.schema['enum'];\n\t\n\t context.code('if (!equalAny(' + context.path + ', ' + JSON.stringify(arr) + ')) {');\n\t context.error('enum');\n\t context.code('}');\n\t};\n\t\n\tkeywords.minimum = function (context) {\n\t if (typeof context.schema.minimum === 'number') {\n\t context.code('if (' + context.path + ' < ' + context.schema.minimum + ') {');\n\t context.error('minimum');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.exclusiveMinimum = function (context) {\n\t if (context.schema.exclusiveMinimum === true && typeof context.schema.minimum === 'number') {\n\t context.code('if (' + context.path + ' === ' + context.schema.minimum + ') {');\n\t context.error('exclusiveMinimum');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.maximum = function (context) {\n\t if (typeof context.schema.maximum === 'number') {\n\t context.code('if (' + context.path + ' > ' + context.schema.maximum + ') {');\n\t context.error('maximum');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.exclusiveMaximum = function (context) {\n\t if (context.schema.exclusiveMaximum === true && typeof context.schema.maximum === 'number') {\n\t context.code('if (' + context.path + ' === ' + context.schema.maximum + ') {');\n\t context.error('exclusiveMaximum');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.multipleOf = function (context) {\n\t if (typeof context.schema.multipleOf === 'number') {\n\t var mul = context.schema.multipleOf,\n\t decimals = mul.toString().length - mul.toFixed(0).length - 1,\n\t pow = decimals > 0 ? Math.pow(10, decimals) : 1,\n\t path = context.path;\n\t\n\t if (decimals > 0) {\n\t context.code('if (+(Math.round((' + path + ' * ' + pow + ') + \"e+\" + ' + decimals + ') + \"e-\" + ' + decimals + ') % ' + (mul * pow) + ' !== 0) {');\n\t } else {\n\t context.code('if (((' + path + ' * ' + pow + ') % ' + (mul * pow) + ') !== 0) {');\n\t }\n\t\n\t context.error('multipleOf');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.minLength = function (context) {\n\t if (isInteger(context.schema.minLength)) {\n\t context.code('if (ucs2length(' + context.path + ') < ' + context.schema.minLength + ') {');\n\t context.error('minLength');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.maxLength = function (context) {\n\t if (isInteger(context.schema.maxLength)) {\n\t context.code('if (ucs2length(' + context.path + ') > ' + context.schema.maxLength + ') {');\n\t context.error('maxLength');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.pattern = function (context) {\n\t var pattern = context.schema.pattern;\n\t\n\t if (typeof pattern === 'string' || pattern instanceof RegExp) {\n\t context.code('if (!(' + inlineRegex(pattern) + ').test(' + context.path + ')) {');\n\t context.error('pattern');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.format = function (context) {\n\t if (typeof context.schema.format !== 'string' || !formats[context.schema.format]) {\n\t return;\n\t }\n\t\n\t context.code('if (!(' + formats[context.schema.format] + ').test(' + context.path + ')) {');\n\t context.error('format');\n\t context.code('}');\n\t};\n\t\n\tkeywords.minItems = function (context) {\n\t if (isInteger(context.schema.minItems)) {\n\t context.code('if (' + context.path + '.length < ' + context.schema.minItems + ') {');\n\t context.error('minItems');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.maxItems = function (context) {\n\t if (isInteger(context.schema.maxItems)) {\n\t context.code('if (' + context.path + '.length > ' + context.schema.maxItems + ') {');\n\t context.error('maxItems');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.additionalItems = function (context) {\n\t if (context.schema.additionalItems === false && Array.isArray(context.schema.items)) {\n\t context.code('if (' + context.path + '.length > ' + context.schema.items.length + ') {');\n\t context.error('additionalItems');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.uniqueItems = function (context) {\n\t if (context.schema.uniqueItems) {\n\t context.code('if (unique(' + context.path + ').length !== ' + context.path + '.length) {');\n\t context.error('uniqueItems');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.items = function (context) {\n\t var index = context.declare(0),\n\t i = 0;\n\t\n\t if (type(context.schema.items) === 'object') {\n\t context.code('for (' + index + ' = 0; ' + index + ' < ' + context.path + '.length; ' + index + '++) {');\n\t\n\t context.descend(context.path + '[' + index + ']', context.schema.items);\n\t\n\t context.code('}');\n\t }\n\t else if (Array.isArray(context.schema.items)) {\n\t for (; i < context.schema.items.length; i++) {\n\t context.code('if (' + context.path + '.length - 1 >= ' + i + ') {');\n\t\n\t context.descend(context.path + '[' + i + ']', context.schema.items[i]);\n\t\n\t context.code('}');\n\t }\n\t\n\t if (type(context.schema.additionalItems) === 'object') {\n\t context.code('for (' + index + ' = ' + i + '; ' + index + ' < ' + context.path + '.length; ' + index + '++) {');\n\t\n\t context.descend(context.path + '[' + index + ']', context.schema.additionalItems);\n\t\n\t context.code('}');\n\t }\n\t }\n\t};\n\t\n\tkeywords.maxProperties = function (context) {\n\t if (isInteger(context.schema.maxProperties)) {\n\t context.code('if (Object.keys(' + context.path + ').length > ' + context.schema.maxProperties + ') {');\n\t context.error('maxProperties');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.minProperties = function (context) {\n\t if (isInteger(context.schema.minProperties)) {\n\t context.code('if (Object.keys(' + context.path + ').length < ' + context.schema.minProperties + ') {');\n\t context.error('minProperties');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.required = function (context) {\n\t if (!Array.isArray(context.schema.required)) {\n\t return;\n\t }\n\t\n\t for (var i = 0; i < context.schema.required.length; i++) {\n\t context.code('if (' + appendToPath(context.path, context.schema.required[i]) + ' === undefined) {');\n\t context.error('required', context.schema.required[i]);\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.properties = function (context) {\n\t var props = context.schema.properties,\n\t propKeys = type(props) === 'object' ? Object.keys(props) : [],\n\t required = Array.isArray(context.schema.required) ? context.schema.required : [],\n\t prop, i, nestedPath;\n\t\n\t if (!propKeys.length) {\n\t return;\n\t }\n\t\n\t for (i = 0; i < propKeys.length; i++) {\n\t prop = propKeys[i];\n\t nestedPath = appendToPath(context.path, prop);\n\t\n\t context.code('if (' + nestedPath + ' !== undefined) {');\n\t\n\t context.descend(nestedPath, props[prop]);\n\t\n\t context.code('}');\n\t\n\t if (required.indexOf(prop) > -1) {\n\t context.code('else {');\n\t context.error('required', prop);\n\t context.code('}');\n\t }\n\t }\n\t};\n\t\n\tkeywords.patternProperties = keywords.additionalProperties = function (context) {\n\t var propKeys = type(context.schema.properties) === 'object' ?\n\t Object.keys(context.schema.properties) : [],\n\t patProps = context.schema.patternProperties,\n\t patterns = type(patProps) === 'object' ? Object.keys(patProps) : [],\n\t addProps = context.schema.additionalProperties,\n\t addPropsCheck = addProps === false || type(addProps) === 'object',\n\t props, keys, key, n, found, pattern, i;\n\t\n\t if (!patterns.length && !addPropsCheck) {\n\t return;\n\t }\n\t\n\t keys = context.declare('[]');\n\t key = context.declare('\"\"');\n\t n = context.declare(0);\n\t\n\t if (addPropsCheck) {\n\t found = context.declare(false);\n\t }\n\t\n\t context.code(keys + ' = Object.keys(' + context.path + ')');\n\t\n\t context.code('for (' + n + ' = 0; ' + n + ' < ' + keys + '.length; ' + n + '++) {')\n\t (key + ' = ' + keys + '[' + n + ']')\n\t\n\t ('if (' + context.path + '[' + key + '] === undefined) {')\n\t ('continue')\n\t ('}');\n\t\n\t if (addPropsCheck) {\n\t context.code(found + ' = false');\n\t }\n\t\n\t // validate pattern properties\n\t for (i = 0; i < patterns.length; i++) {\n\t pattern = patterns[i];\n\t\n\t context.code('if ((' + inlineRegex(pattern) + ').test(' + key + ')) {');\n\t\n\t context.descend(context.path + '[' + key + ']', patProps[pattern]);\n\t\n\t if (addPropsCheck) {\n\t context.code(found + ' = true');\n\t }\n\t\n\t context.code('}');\n\t }\n\t\n\t // validate additional properties\n\t if (addPropsCheck) {\n\t if (propKeys.length) {\n\t props = context.declare(JSON.stringify(propKeys));\n\t\n\t // do not validate regular properties\n\t context.code('if (' + props + '.indexOf(' + key + ') > -1) {')\n\t ('continue')\n\t ('}');\n\t }\n\t\n\t context.code('if (!' + found + ') {');\n\t\n\t if (addProps === false) {\n\t // do not allow additional properties\n\t context.error('additionalProperties', undefined, key);\n\t }\n\t else {\n\t // validate additional properties\n\t context.descend(context.path + '[' + key + ']', addProps);\n\t }\n\t\n\t context.code('}');\n\t }\n\t\n\t context.code('}');\n\t};\n\t\n\tkeywords.dependencies = function (context) {\n\t if (type(context.schema.dependencies) !== 'object') {\n\t return;\n\t }\n\t\n\t var depKeys = Object.keys(context.schema.dependencies),\n\t len = depKeys.length,\n\t key, dep, i = 0, k = 0;\n\t\n\t for (; k < len; k++) {\n\t key = depKeys[k];\n\t dep = context.schema.dependencies[key];\n\t\n\t context.code('if (' + appendToPath(context.path, key) + ' !== undefined) {');\n\t\n\t if (type(dep) === 'object') {\n\t //schema dependency\n\t context.descend(context.path, dep);\n\t }\n\t else {\n\t // property dependency\n\t for (i; i < dep.length; i++) {\n\t context.code('if (' + appendToPath(context.path, dep[i]) + ' === undefined) {');\n\t context.error('dependencies', dep[i]);\n\t context.code('}');\n\t }\n\t }\n\t\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.allOf = function (context) {\n\t if (!Array.isArray(context.schema.allOf)) {\n\t return;\n\t }\n\t\n\t for (var i = 0; i < context.schema.allOf.length; i++) {\n\t context.descend(context.path, context.schema.allOf[i]);\n\t }\n\t};\n\t\n\tkeywords.anyOf = function (context) {\n\t if (!Array.isArray(context.schema.anyOf)) {\n\t return;\n\t }\n\t\n\t var greedy = context.greedy,\n\t errCount = context.declare(0),\n\t initialCount = context.declare(0),\n\t found = context.declare(false),\n\t i = 0;\n\t\n\t context.code(initialCount + ' = errors.length');\n\t\n\t for (; i < context.schema.anyOf.length; i++) {\n\t context.code('if (!' + found + ') {');\n\t\n\t context.code(errCount + ' = errors.length');\n\t\n\t context.greedy = true;\n\t\n\t context.descend(context.path, context.schema.anyOf[i]);\n\t\n\t context.code(found + ' = errors.length === ' + errCount)\n\t ('}');\n\t }\n\t\n\t context.greedy = greedy;\n\t\n\t context.code('if (!' + found + ') {');\n\t\n\t context.error('anyOf');\n\t\n\t context.code('} else {')\n\t ('errors.length = ' + initialCount)\n\t ('}');\n\t};\n\t\n\tkeywords.oneOf = function (context) {\n\t if (!Array.isArray(context.schema.oneOf)) {\n\t return;\n\t }\n\t\n\t var greedy = context.greedy,\n\t matching = context.declare(0),\n\t initialCount = context.declare(0),\n\t errCount = context.declare(0),\n\t i = 0;\n\t\n\t context.code(initialCount + ' = errors.length');\n\t context.code(matching + ' = 0');\n\t\n\t for (; i < context.schema.oneOf.length; i++) {\n\t context.code(errCount + ' = errors.length');\n\t\n\t context.greedy = true;\n\t\n\t context.descend(context.path, context.schema.oneOf[i]);\n\t\n\t context.code('if (errors.length === ' + errCount + ') {')\n\t (matching + '++')\n\t ('}');\n\t }\n\t\n\t context.greedy = greedy;\n\t\n\t context.code('if (' + matching + ' !== 1) {');\n\t\n\t context.error('oneOf');\n\t\n\t context.code('} else {')\n\t ('errors.length = ' + initialCount)\n\t ('}');\n\t};\n\t\n\tkeywords.not = function (context) {\n\t if (type(context.schema.not) !== 'object') {\n\t return;\n\t }\n\t\n\t var greedy = context.greedy,\n\t errCount = context.declare(0);\n\t\n\t context.code(errCount + ' = errors.length');\n\t\n\t context.greedy = true;\n\t\n\t context.descend(context.path, context.schema.not);\n\t\n\t context.greedy = greedy;\n\t\n\t context.code('if (errors.length === ' + errCount + ') {');\n\t\n\t context.error('not');\n\t\n\t context.code('} else {')\n\t ('errors.length = ' + errCount)\n\t ('}');\n\t};\n\t\n\tfunction decorateGenerator(type, keyword) {\n\t keywords[keyword].type = type;\n\t keywords[keyword].keyword = keyword;\n\t}\n\t\n\t['minimum', 'exclusiveMinimum', 'maximum', 'exclusiveMaximum', 'multipleOf']\n\t .forEach(decorateGenerator.bind(null, 'number'));\n\t\n\t['minLength', 'maxLength', 'pattern', 'format']\n\t .forEach(decorateGenerator.bind(null, 'string'));\n\t\n\t['minItems', 'maxItems', 'additionalItems', 'uniqueItems', 'items']\n\t .forEach(decorateGenerator.bind(null, 'array'));\n\t\n\t['maxProperties', 'minProperties', 'required', 'properties', 'patternProperties', 'additionalProperties', 'dependencies']\n\t .forEach(decorateGenerator.bind(null, 'object'));\n\t\n\t['enum', 'allOf', 'anyOf', 'oneOf', 'not']\n\t .forEach(decorateGenerator.bind(null, null));\n\t\n\tfunction groupKeywords(schema) {\n\t var keys = Object.keys(schema),\n\t propIndex = keys.indexOf('properties'),\n\t patIndex = keys.indexOf('patternProperties'),\n\t ret = {\n\t enum: Array.isArray(schema.enum) && schema.enum.length > 0,\n\t type: null,\n\t allType: [],\n\t perType: {}\n\t },\n\t key, gen, i;\n\t\n\t if (schema.type) {\n\t if (typeof schema.type === 'string') {\n\t ret.type = [schema.type];\n\t }\n\t else if (Array.isArray(schema.type) && schema.type.length) {\n\t ret.type = schema.type.slice(0);\n\t }\n\t }\n\t\n\t for (i = 0; i < keys.length; i++) {\n\t key = keys[i];\n\t\n\t if (key === 'enum' || key === 'type') {\n\t continue;\n\t }\n\t\n\t gen = keywords[key];\n\t\n\t if (!gen) {\n\t continue;\n\t }\n\t\n\t if (gen.type) {\n\t if (!ret.perType[gen.type]) {\n\t ret.perType[gen.type] = [];\n\t }\n\t\n\t if (!(propIndex > -1 && key === 'required') &&\n\t !(patIndex > -1 && key === 'additionalProperties')) {\n\t ret.perType[gen.type].push(key);\n\t }\n\t }\n\t else {\n\t ret.allType.push(key);\n\t }\n\t }\n\t\n\t return ret;\n\t}\n\t\n\tfunction getPathExpression(path, key) {\n\t var path_ = path.substr(4),\n\t len = path_.length,\n\t tokens = [],\n\t token = '',\n\t isvar = false,\n\t char, i;\n\t\n\t for (i = 0; i < len; i++) {\n\t char = path_[i];\n\t\n\t switch (char) {\n\t case '.':\n\t if (token) {\n\t token += char;\n\t }\n\t break;\n\t case '[':\n\t if (isNaN(+path_[i + 1])) {\n\t isvar = true;\n\t\n\t if (token) {\n\t tokens.push('\"' + token + '\"');\n\t token = '';\n\t }\n\t }\n\t else {\n\t isvar = false;\n\t\n\t if (token) {\n\t token += '.';\n\t }\n\t }\n\t break;\n\t case ']':\n\t tokens.push(isvar ? token : '\"' + token + '\"');\n\t token = '';\n\t break;\n\t default:\n\t token += char;\n\t }\n\t }\n\t\n\t if (token) {\n\t tokens.push('\"' + token + '\"');\n\t }\n\t\n\t if (key) {\n\t tokens.push('\"' + key + '\"');\n\t }\n\t\n\t if (tokens.length === 1 && isvar) {\n\t return '\"\" + ' + tokens[0] + ' + \"\"';\n\t }\n\t\n\t return tokens.join(' + \".\" + ') || '\"\"';\n\t}\n\t\n\tfunction clone(obj) {\n\t var cloned = obj,\n\t objType = type(obj),\n\t keys, len, key, i;\n\t\n\t if (objType === 'object') {\n\t cloned = {};\n\t keys = Object.keys(obj);\n\t\n\t for (i = 0, len = keys.length; i < len; i++) {\n\t key = keys[i];\n\t cloned[key] = clone(obj[key]);\n\t }\n\t }\n\t else if (objType === 'array') {\n\t cloned = [];\n\t\n\t for (i = 0, len = obj.length; i < len; i++) {\n\t cloned[i] = clone(obj[i]);\n\t }\n\t }\n\t else if (objType === 'regexp') {\n\t return new RegExp(obj);\n\t }\n\t else if (objType === 'date') {\n\t return new Date(obj.toJSON());\n\t }\n\t\n\t return cloned;\n\t}\n\t\n\tfunction equalAny(obj, options) {\n\t for (var i = 0, len = options.length; i < len; i++) {\n\t if (equal(obj, options[i])) {\n\t return true;\n\t }\n\t }\n\t\n\t return false;\n\t}\n\t\n\tfunction PropertyMarker() {\n\t this.objects = [];\n\t this.properties = [];\n\t}\n\t\n\tPropertyMarker.prototype.mark = function (obj, key) {\n\t var index = this.objects.indexOf(obj),\n\t prop;\n\t\n\t if (index < 0) {\n\t this.objects.push(obj);\n\t\n\t prop = {};\n\t prop[key] = 1;\n\t\n\t this.properties.push(prop);\n\t\n\t return;\n\t }\n\t\n\t prop = this.properties[index];\n\t\n\t prop[key] = prop[key] ? prop[key] + 1 : 1;\n\t};\n\t\n\tPropertyMarker.prototype.deleteDuplicates = function () {\n\t var props, keys, key, i, j;\n\t\n\t for (i = 0; i < this.properties.length; i++) {\n\t props = this.properties[i];\n\t keys = Object.keys(props);\n\t\n\t for (j = 0; j < keys.length; j++) {\n\t key = keys[j];\n\t\n\t if (props[key] > 1) {\n\t delete this.objects[i][key];\n\t }\n\t }\n\t }\n\t};\n\t\n\tPropertyMarker.prototype.dispose = function () {\n\t this.objects.length = 0;\n\t this.properties.length = 0;\n\t};\n\t\n\tfunction build(schema, def, additional, resolver, parentMarker) {\n\t var defType, defValue, key, i, propertyMarker, props, defProps;\n\t\n\t if (type(schema) !== 'object') {\n\t return def;\n\t }\n\t\n\t schema = resolver.resolve(schema);\n\t\n\t if (def === undefined && schema.hasOwnProperty('default')) {\n\t def = clone(schema['default']);\n\t }\n\t\n\t defType = type(def);\n\t\n\t if (defType === 'object' && type(schema.properties) === 'object') {\n\t props = Object.keys(schema.properties);\n\t\n\t for (i = 0; i < props.length; i++) {\n\t key = props[i];\n\t defValue = build(schema.properties[key], def[key], additional, resolver);\n\t\n\t if (defValue !== undefined) {\n\t def[key] = defValue;\n\t }\n\t }\n\t\n\t if (additional !== 'always') {\n\t defProps = Object.keys(def);\n\t\n\t for (i = 0; i < defProps.length; i++) {\n\t key = defProps[i];\n\t\n\t if (props.indexOf(key) < 0 &&\n\t (schema.additionalProperties === false ||\n\t (additional === false && !schema.additionalProperties))) {\n\t\n\t if (parentMarker) {\n\t parentMarker.mark(def, key);\n\t }\n\t else {\n\t delete def[key];\n\t }\n\t }\n\t }\n\t }\n\t }\n\t else if (defType === 'array' && schema.items) {\n\t if (type(schema.items) === 'array') {\n\t for (i = 0; i < schema.items.length; i++) {\n\t defValue = build(schema.items[i], def[i], additional, resolver);\n\t\n\t if (defValue !== undefined || i < def.length) {\n\t def[i] = defValue;\n\t }\n\t }\n\t }\n\t else if (def.length) {\n\t for (i = 0; i < def.length; i++) {\n\t def[i] = build(schema.items, def[i], additional, resolver);\n\t }\n\t }\n\t }\n\t else if (type(schema.allOf) === 'array' && schema.allOf.length) {\n\t propertyMarker = new PropertyMarker();\n\t\n\t for (i = 0; i < schema.allOf.length; i++) {\n\t def = build(schema.allOf[i], def, additional, resolver, propertyMarker);\n\t }\n\t\n\t propertyMarker.deleteDuplicates();\n\t propertyMarker.dispose();\n\t }\n\t\n\t return def;\n\t}\n\t\n\tfunction ValidationContext(options) {\n\t this.path = 'data';\n\t this.schema = options.schema;\n\t this.formats = options.formats;\n\t this.greedy = options.greedy;\n\t this.resolver = options.resolver;\n\t this.id = options.id;\n\t this.funcache = options.funcache || {};\n\t this.scope = options.scope || {\n\t equalAny: equalAny,\n\t unique: unique,\n\t ucs2length: ucs2length,\n\t refs: {}\n\t };\n\t}\n\t\n\tValidationContext.prototype.clone = function (schema) {\n\t var ctx = new ValidationContext({\n\t schema: schema,\n\t formats: this.formats,\n\t greedy: this.greedy,\n\t resolver: this.resolver,\n\t id: this.id,\n\t funcache: this.funcache,\n\t scope: this.scope\n\t });\n\t\n\t return ctx;\n\t};\n\t\n\tValidationContext.prototype.declare = function (def) {\n\t var variname = this.id();\n\t this.code.def(variname, def);\n\t return variname;\n\t};\n\t\n\tValidationContext.prototype.cache = function (cacheKey, schema) {\n\t var cached = this.funcache[cacheKey],\n\t context;\n\t\n\t if (!cached) {\n\t cached = this.funcache[cacheKey] = {\n\t key: this.id()\n\t };\n\t\n\t context = this.clone(schema);\n\t\n\t cached.func = context.compile(cached.key);\n\t\n\t this.scope.refs[cached.key] = cached.func;\n\t\n\t context.dispose();\n\t }\n\t\n\t return 'refs.' + cached.key;\n\t};\n\t\n\tValidationContext.prototype.error = function (keyword, key, additional) {\n\t var schema = this.schema,\n\t path = this.path,\n\t errorPath = path !== 'data' || key ?\n\t '(path ? path + \".\" : \"\") + ' + getPathExpression(path, key) + ',' :\n\t 'path,',\n\t res = key && schema.properties && schema.properties[key] ?\n\t this.resolver.resolve(schema.properties[key]) : null,\n\t message = res ? res.requiredMessage : schema.invalidMessage;\n\t\n\t if (!message) {\n\t message = (res && res.messages && res.messages[keyword]) ||\n\t (schema.messages && schema.messages[keyword]);\n\t }\n\t\n\t this.code('errors.push({');\n\t\n\t if (message) {\n\t this.code('message: ' + encodeStr(message) + ',');\n\t }\n\t\n\t if (additional) {\n\t this.code('additionalProperties: ' + additional + ',');\n\t }\n\t\n\t this.code('path: ' + errorPath)\n\t ('keyword: ' + encodeStr(keyword))\n\t ('})');\n\t\n\t if (!this.greedy) {\n\t this.code('return');\n\t }\n\t};\n\t\n\tValidationContext.prototype.refactor = function (path, schema, cacheKey) {\n\t var parentPathExp = path !== 'data' ?\n\t '(path ? path + \".\" : \"\") + ' + getPathExpression(path) :\n\t 'path',\n\t cachedRef = this.cache(cacheKey, schema),\n\t refErrors = this.declare();\n\t\n\t this.code(refErrors + ' = ' + cachedRef + '(' + path + ', ' + parentPathExp + ', errors)');\n\t\n\t if (!this.greedy) {\n\t this.code('if (errors.length) { return }');\n\t }\n\t};\n\t\n\tValidationContext.prototype.descend = function (path, schema) {\n\t var origPath = this.path,\n\t origSchema = this.schema;\n\t\n\t this.path = path;\n\t this.schema = schema;\n\t\n\t this.generate();\n\t\n\t this.path = origPath;\n\t this.schema = origSchema;\n\t};\n\t\n\tValidationContext.prototype.generate = function () {\n\t var path = this.path,\n\t schema = this.schema,\n\t context = this,\n\t scope = this.scope,\n\t encodedFormat,\n\t format,\n\t schemaKeys,\n\t typeKeys,\n\t typeIndex,\n\t validatedType,\n\t i;\n\t\n\t if (type(schema) !== 'object') {\n\t return;\n\t }\n\t\n\t if (schema.$ref !== undefined) {\n\t schema = this.resolver.resolve(schema);\n\t\n\t if (this.resolver.hasRef(schema)) {\n\t this.refactor(path, schema,\n\t this.resolver.getNormalizedRef(this.schema) || this.schema.$ref);\n\t\n\t return;\n\t }\n\t else {\n\t // substitute $ref schema with the resolved instance\n\t this.schema = schema;\n\t }\n\t }\n\t\n\t schemaKeys = groupKeywords(schema);\n\t\n\t if (schemaKeys.enum) {\n\t keywords.enum(context);\n\t\n\t return; // do not process the schema further\n\t }\n\t\n\t typeKeys = Object.keys(schemaKeys.perType);\n\t\n\t function generateForKeyword(keyword) {\n\t keywords[keyword](context); // jshint ignore: line\n\t }\n\t\n\t for (i = 0; i < typeKeys.length; i++) {\n\t validatedType = typeKeys[i];\n\t\n\t this.code((i ? 'else ' : '') + 'if (' + types[validatedType](path) + ') {');\n\t\n\t schemaKeys.perType[validatedType].forEach(generateForKeyword);\n\t\n\t this.code('}');\n\t\n\t if (schemaKeys.type) {\n\t typeIndex = schemaKeys.type.indexOf(validatedType);\n\t\n\t if (typeIndex > -1) {\n\t schemaKeys.type.splice(typeIndex, 1);\n\t }\n\t }\n\t }\n\t\n\t if (schemaKeys.type) { // we have types in the schema\n\t if (schemaKeys.type.length) { // case 1: we still have some left to check\n\t this.code((typeKeys.length ? 'else ' : '') + 'if (!(' + schemaKeys.type.map(function (type) {\n\t return types[type] ? types[type](path) : 'true';\n\t }).join(' || ') + ')) {');\n\t this.error('type');\n\t this.code('}');\n\t }\n\t else {\n\t this.code('else {'); // case 2: we don't have any left to check\n\t this.error('type');\n\t this.code('}');\n\t }\n\t }\n\t\n\t schemaKeys.allType.forEach(function (keyword) {\n\t keywords[keyword](context);\n\t });\n\t\n\t if (schema.format && this.formats) {\n\t format = this.formats[schema.format];\n\t\n\t if (format) {\n\t if (typeof format === 'string' || format instanceof RegExp) {\n\t this.code('if (!(' + inlineRegex(format) + ').test(' + path + ')) {');\n\t this.error('format');\n\t this.code('}');\n\t }\n\t else if (typeof format === 'function') {\n\t (scope.formats || (scope.formats = {}))[schema.format] = format;\n\t (scope.schemas || (scope.schemas = {}))[schema.format] = schema;\n\t\n\t encodedFormat = encodeStr(schema.format);\n\t\n\t this.code('if (!formats[' + encodedFormat + '](' + path + ', schemas[' + encodedFormat + '])) {');\n\t this.error('format');\n\t this.code('}');\n\t }\n\t }\n\t }\n\t};\n\t\n\tValidationContext.prototype.compile = function (id) {\n\t this.code = func('jsen_compiled' + (id ? '_' + id : ''), 'data', 'path', 'errors');\n\t this.generate();\n\t\n\t return this.code.compile(this.scope);\n\t};\n\t\n\tValidationContext.prototype.dispose = function () {\n\t for (var key in this) {\n\t this[key] = undefined;\n\t }\n\t};\n\t\n\tfunction jsen(schema, options) {\n\t if (type(schema) !== 'object') {\n\t throw new Error(INVALID_SCHEMA);\n\t }\n\t\n\t options = options || {};\n\t\n\t var counter = 0,\n\t id = function () { return 'i' + (counter++); },\n\t resolver = new SchemaResolver(schema, options.schemas, options.missing$Ref || false),\n\t context = new ValidationContext({\n\t schema: schema,\n\t resolver: resolver,\n\t id: id,\n\t schemas: options.schemas,\n\t formats: options.formats,\n\t greedy: options.greedy || false\n\t }),\n\t compiled = func('validate', 'data')\n\t ('validate.errors = []')\n\t ('gen(data, \"\", validate.errors)')\n\t ('return validate.errors.length === 0')\n\t .compile({ gen: context.compile() });\n\t\n\t context.dispose();\n\t context = null;\n\t\n\t compiled.errors = [];\n\t\n\t compiled.build = function (initial, options) {\n\t return build(\n\t schema,\n\t (options && options.copy === false ? initial : clone(initial)),\n\t options && options.additionalProperties,\n\t resolver);\n\t };\n\t\n\t return compiled;\n\t}\n\t\n\tjsen.browser = browser;\n\tjsen.clone = clone;\n\tjsen.equal = equal;\n\tjsen.unique = unique;\n\tjsen.ucs2length = ucs2length;\n\tjsen.SchemaResolver = SchemaResolver;\n\tjsen.resolve = SchemaResolver.resolvePointer;\n\t\n\tmodule.exports = jsen;\n\n\n/***/ },\n/* 12 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = function func() {\n\t var args = Array.apply(null, arguments),\n\t name = args.shift(),\n\t tab = ' ',\n\t lines = '',\n\t vars = '',\n\t ind = 1, // indentation\n\t bs = '{[', // block start\n\t be = '}]', // block end\n\t space = function () {\n\t var sp = tab, i = 0;\n\t while (i++ < ind - 1) { sp += tab; }\n\t return sp;\n\t },\n\t add = function (line) {\n\t lines += space() + line + '\\n';\n\t },\n\t builder = function (line) {\n\t var first = line[0],\n\t last = line[line.length - 1];\n\t\n\t if (be.indexOf(first) > -1 && bs.indexOf(last) > -1) {\n\t ind--;\n\t add(line);\n\t ind++;\n\t }\n\t else if (bs.indexOf(last) > -1) {\n\t add(line);\n\t ind++;\n\t }\n\t else if (be.indexOf(first) > -1) {\n\t ind--;\n\t add(line);\n\t }\n\t else {\n\t add(line);\n\t }\n\t\n\t return builder;\n\t };\n\t\n\t builder.def = function (id, def) {\n\t vars += (vars ? ',\\n' + tab + ' ' : '') + id + (def !== undefined ? ' = ' + def : '');\n\t return builder;\n\t };\n\t\n\t builder.toSource = function () {\n\t return 'function ' + name + '(' + args.join(', ') + ') {\\n' +\n\t tab + '\"use strict\"' + '\\n' +\n\t (vars ? tab + 'var ' + vars + ';\\n' : '') +\n\t lines + '}';\n\t };\n\t\n\t builder.compile = function (scope) {\n\t var src = 'return (' + builder.toSource() + ')',\n\t scp = scope || {},\n\t keys = Object.keys(scp),\n\t vals = keys.map(function (key) { return scp[key]; });\n\t\n\t return Function.apply(null, keys.concat(src)).apply(null, vals);\n\t };\n\t\n\t return builder;\n\t};\n\n/***/ },\n/* 13 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tfunction type(obj) {\n\t var str = Object.prototype.toString.call(obj);\n\t return str.substr(8, str.length - 9).toLowerCase();\n\t}\n\t\n\tfunction deepEqual(a, b) {\n\t var keysA = Object.keys(a).sort(),\n\t keysB = Object.keys(b).sort(),\n\t i, key;\n\t\n\t if (!equal(keysA, keysB)) {\n\t return false;\n\t }\n\t\n\t for (i = 0; i < keysA.length; i++) {\n\t key = keysA[i];\n\t\n\t if (!equal(a[key], b[key])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t}\n\t\n\tfunction equal(a, b) { // jshint ignore: line\n\t var typeA = typeof a,\n\t typeB = typeof b,\n\t i;\n\t\n\t // get detailed object type\n\t if (typeA === 'object') {\n\t typeA = type(a);\n\t }\n\t\n\t // get detailed object type\n\t if (typeB === 'object') {\n\t typeB = type(b);\n\t }\n\t\n\t if (typeA !== typeB) {\n\t return false;\n\t }\n\t\n\t if (typeA === 'object') {\n\t return deepEqual(a, b);\n\t }\n\t\n\t if (typeA === 'regexp') {\n\t return a.toString() === b.toString();\n\t }\n\t\n\t if (typeA === 'array') {\n\t if (a.length !== b.length) {\n\t return false;\n\t }\n\t\n\t for (i = 0; i < a.length; i++) {\n\t if (!equal(a[i], b[i])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t }\n\t\n\t return a === b;\n\t}\n\t\n\tmodule.exports = equal;\n\n/***/ },\n/* 14 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar equal = __webpack_require__(13);\n\t\n\tfunction findIndex(arr, value, comparator) {\n\t for (var i = 0, len = arr.length; i < len; i++) {\n\t if (comparator(arr[i], value)) {\n\t return i;\n\t }\n\t }\n\t\n\t return -1;\n\t}\n\t\n\tmodule.exports = function unique(arr) {\n\t return arr.filter(function uniqueOnly(value, index, self) {\n\t return findIndex(self, value, equal) === index;\n\t });\n\t};\n\t\n\tmodule.exports.findIndex = findIndex;\n\n/***/ },\n/* 15 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar url = __webpack_require__(16),\n\t metaschema = __webpack_require__(23),\n\t INVALID_SCHEMA_REFERENCE = 'jsen: invalid schema reference',\n\t DUPLICATE_SCHEMA_ID = 'jsen: duplicate schema id',\n\t CIRCULAR_SCHEMA_REFERENCE = 'jsen: circular schema reference';\n\t\n\tfunction get(obj, path) {\n\t if (!path.length) {\n\t return obj;\n\t }\n\t\n\t var key = path.shift(),\n\t val;\n\t\n\t if (obj && typeof obj === 'object' && obj.hasOwnProperty(key)) {\n\t val = obj[key];\n\t }\n\t\n\t if (path.length) {\n\t if (val && typeof val === 'object') {\n\t return get(val, path);\n\t }\n\t\n\t return undefined;\n\t }\n\t\n\t return val;\n\t}\n\t\n\tfunction refToObj(ref) {\n\t var index = ref.indexOf('#'),\n\t ret = {\n\t base: ref.substr(0, index),\n\t path: []\n\t };\n\t\n\t if (index < 0) {\n\t ret.base = ref;\n\t return ret;\n\t }\n\t\n\t ref = ref.substr(index + 1);\n\t\n\t if (!ref) {\n\t return ret;\n\t }\n\t\n\t ret.path = ref.split('/').map(function (segment) {\n\t // Reference: http://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-08#section-3\n\t return decodeURIComponent(segment)\n\t .replace(/~1/g, '/')\n\t .replace(/~0/g, '~');\n\t });\n\t\n\t if (ref[0] === '/') {\n\t ret.path.shift();\n\t }\n\t\n\t return ret;\n\t}\n\t\n\t// TODO: Can we prevent nested resolvers and combine schemas instead?\n\tfunction SchemaResolver(rootSchema, external, missing$Ref, baseId) { // jshint ignore: line\n\t this.rootSchema = rootSchema;\n\t this.resolvers = null;\n\t this.resolvedRootSchema = null;\n\t this.cache = {};\n\t this.idCache = {};\n\t this.refCache = { refs: [], schemas: [] };\n\t this.missing$Ref = missing$Ref;\n\t this.refStack = [];\n\t\n\t baseId = baseId || '';\n\t\n\t this._buildIdCache(rootSchema, baseId);\n\t\n\t // get updated base id after normalizing root schema id\n\t baseId = this.refCache.refs[this.refCache.schemas.indexOf(this.rootSchema)] || baseId;\n\t\n\t this._buildResolvers(external, baseId);\n\t}\n\t\n\tSchemaResolver.prototype._cacheId = function (id, schema, resolver) {\n\t if (this.idCache[id]) {\n\t throw new Error(DUPLICATE_SCHEMA_ID + ' ' + id);\n\t }\n\t\n\t this.idCache[id] = { resolver: resolver, schema: schema };\n\t};\n\t\n\tSchemaResolver.prototype._buildIdCache = function (schema, baseId) {\n\t var id = baseId,\n\t ref, keys, i;\n\t\n\t if (!schema || typeof schema !== 'object') {\n\t return;\n\t }\n\t\n\t if (typeof schema.id === 'string' && schema.id) {\n\t id = url.resolve(baseId, schema.id);\n\t\n\t this._cacheId(id, schema, this);\n\t }\n\t else if (schema === this.rootSchema && baseId) {\n\t this._cacheId(baseId, schema, this);\n\t }\n\t\n\t if (schema.$ref && typeof schema.$ref === 'string') {\n\t ref = url.resolve(id, schema.$ref);\n\t\n\t this.refCache.schemas.push(schema);\n\t this.refCache.refs.push(ref);\n\t }\n\t\n\t keys = Object.keys(schema);\n\t\n\t for (i = 0; i < keys.length; i++) {\n\t this._buildIdCache(schema[keys[i]], id);\n\t }\n\t};\n\t\n\tSchemaResolver.prototype._buildResolvers = function (schemas, baseId) {\n\t if (!schemas || typeof schemas !== 'object') {\n\t return;\n\t }\n\t\n\t var that = this,\n\t resolvers = {};\n\t\n\t Object.keys(schemas).forEach(function (key) {\n\t var id = url.resolve(baseId, key),\n\t resolver = new SchemaResolver(schemas[key], null, that.missing$Ref, id);\n\t\n\t that._cacheId(id, resolver.rootSchema, resolver);\n\t\n\t Object.keys(resolver.idCache).forEach(function (idKey) {\n\t that.idCache[idKey] = resolver.idCache[idKey];\n\t });\n\t\n\t resolvers[key] = resolver;\n\t });\n\t\n\t this.resolvers = resolvers;\n\t};\n\t\n\tSchemaResolver.prototype.getNormalizedRef = function (schema) {\n\t var index = this.refCache.schemas.indexOf(schema);\n\t return this.refCache.refs[index];\n\t};\n\t\n\tSchemaResolver.prototype._resolveRef = function (ref) {\n\t var err = new Error(INVALID_SCHEMA_REFERENCE + ' ' + ref),\n\t idCache = this.idCache,\n\t externalResolver, cached, descriptor, path, dest;\n\t\n\t if (!ref || typeof ref !== 'string') {\n\t throw err;\n\t }\n\t\n\t if (ref === metaschema.id) {\n\t dest = metaschema;\n\t }\n\t\n\t cached = idCache[ref];\n\t\n\t if (cached) {\n\t dest = cached.resolver.resolve(cached.schema);\n\t }\n\t\n\t if (dest === undefined) {\n\t descriptor = refToObj(ref);\n\t path = descriptor.path;\n\t\n\t if (descriptor.base) {\n\t cached = idCache[descriptor.base] || idCache[descriptor.base + '#'];\n\t\n\t if (cached) {\n\t dest = cached.resolver.resolve(get(cached.schema, path.slice(0)));\n\t }\n\t else {\n\t path.unshift(descriptor.base);\n\t }\n\t }\n\t }\n\t\n\t if (dest === undefined && this.resolvedRootSchema) {\n\t dest = get(this.resolvedRootSchema, path.slice(0));\n\t }\n\t\n\t if (dest === undefined) {\n\t dest = get(this.rootSchema, path.slice(0));\n\t }\n\t\n\t if (dest === undefined && path.length && this.resolvers) {\n\t externalResolver = get(this.resolvers, path);\n\t\n\t if (externalResolver) {\n\t dest = externalResolver.resolve(externalResolver.rootSchema);\n\t }\n\t }\n\t\n\t if (dest === undefined || typeof dest !== 'object') {\n\t if (this.missing$Ref) {\n\t dest = {};\n\t } else {\n\t throw err;\n\t }\n\t }\n\t\n\t if (this.cache[ref] === dest) {\n\t return dest;\n\t }\n\t\n\t this.cache[ref] = dest;\n\t\n\t if (dest.$ref !== undefined) {\n\t dest = this.resolve(dest);\n\t }\n\t\n\t return dest;\n\t};\n\t\n\tSchemaResolver.prototype.resolve = function (schema) {\n\t if (!schema || typeof schema !== 'object' || schema.$ref === undefined) {\n\t return schema;\n\t }\n\t\n\t var ref = this.getNormalizedRef(schema) || schema.$ref,\n\t resolved = this.cache[ref];\n\t\n\t if (resolved !== undefined) {\n\t return resolved;\n\t }\n\t\n\t if (this.refStack.indexOf(ref) > -1) {\n\t throw new Error(CIRCULAR_SCHEMA_REFERENCE + ' ' + ref);\n\t }\n\t\n\t this.refStack.push(ref);\n\t\n\t resolved = this._resolveRef(ref);\n\t\n\t this.refStack.pop();\n\t\n\t if (schema === this.rootSchema) {\n\t // cache the resolved root schema\n\t this.resolvedRootSchema = resolved;\n\t }\n\t\n\t return resolved;\n\t};\n\t\n\tSchemaResolver.prototype.hasRef = function (schema) {\n\t var keys = Object.keys(schema),\n\t len, key, i, hasChildRef;\n\t\n\t if (keys.indexOf('$ref') > -1) {\n\t return true;\n\t }\n\t\n\t for (i = 0, len = keys.length; i < len; i++) {\n\t key = keys[i];\n\t\n\t if (schema[key] && typeof schema[key] === 'object' && !Array.isArray(schema[key])) {\n\t hasChildRef = this.hasRef(schema[key]);\n\t\n\t if (hasChildRef) {\n\t return true;\n\t }\n\t }\n\t }\n\t\n\t return false;\n\t};\n\t\n\tSchemaResolver.resolvePointer = function (obj, pointer) {\n\t var descriptor = refToObj(pointer),\n\t path = descriptor.path;\n\t\n\t if (descriptor.base) {\n\t path = [descriptor.base].concat(path);\n\t }\n\t\n\t return get(obj, path);\n\t};\n\t\n\tmodule.exports = SchemaResolver;\n\n/***/ },\n/* 16 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t// Copyright Joyent, Inc. and other Node contributors.\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a\n\t// copy of this software and associated documentation files (the\n\t// \"Software\"), to deal in the Software without restriction, including\n\t// without limitation the rights to use, copy, modify, merge, publish,\n\t// distribute, sublicense, and/or sell copies of the Software, and to permit\n\t// persons to whom the Software is furnished to do so, subject to the\n\t// following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included\n\t// in all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n\t// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\t// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n\t// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n\t// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n\t// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n\t// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\t\n\t'use strict';\n\t\n\tvar punycode = __webpack_require__(17);\n\tvar util = __webpack_require__(19);\n\t\n\texports.parse = urlParse;\n\texports.resolve = urlResolve;\n\texports.resolveObject = urlResolveObject;\n\texports.format = urlFormat;\n\t\n\texports.Url = Url;\n\t\n\tfunction Url() {\n\t this.protocol = null;\n\t this.slashes = null;\n\t this.auth = null;\n\t this.host = null;\n\t this.port = null;\n\t this.hostname = null;\n\t this.hash = null;\n\t this.search = null;\n\t this.query = null;\n\t this.pathname = null;\n\t this.path = null;\n\t this.href = null;\n\t}\n\t\n\t// Reference: RFC 3986, RFC 1808, RFC 2396\n\t\n\t// define these here so at least they only have to be\n\t// compiled once on the first module load.\n\tvar protocolPattern = /^([a-z0-9.+-]+:)/i,\n\t portPattern = /:[0-9]*$/,\n\t\n\t // Special case for a simple path URL\n\t simplePathPattern = /^(\\/\\/?(?!\\/)[^\\?\\s]*)(\\?[^\\s]*)?$/,\n\t\n\t // RFC 2396: characters reserved for delimiting URLs.\n\t // We actually just auto-escape these.\n\t delims = ['<', '>', '\"', '`', ' ', '\\r', '\\n', '\\t'],\n\t\n\t // RFC 2396: characters not allowed for various reasons.\n\t unwise = ['{', '}', '|', '\\\\', '^', '`'].concat(delims),\n\t\n\t // Allowed by RFCs, but cause of XSS attacks. Always escape these.\n\t autoEscape = ['\\''].concat(unwise),\n\t // Characters that are never ever allowed in a hostname.\n\t // Note that any invalid chars are also handled, but these\n\t // are the ones that are *expected* to be seen, so we fast-path\n\t // them.\n\t nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape),\n\t hostEndingChars = ['/', '?', '#'],\n\t hostnameMaxLen = 255,\n\t hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,\n\t hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,\n\t // protocols that can allow \"unsafe\" and \"unwise\" chars.\n\t unsafeProtocol = {\n\t 'javascript': true,\n\t 'javascript:': true\n\t },\n\t // protocols that never have a hostname.\n\t hostlessProtocol = {\n\t 'javascript': true,\n\t 'javascript:': true\n\t },\n\t // protocols that always contain a // bit.\n\t slashedProtocol = {\n\t 'http': true,\n\t 'https': true,\n\t 'ftp': true,\n\t 'gopher': true,\n\t 'file': true,\n\t 'http:': true,\n\t 'https:': true,\n\t 'ftp:': true,\n\t 'gopher:': true,\n\t 'file:': true\n\t },\n\t querystring = __webpack_require__(20);\n\t\n\tfunction urlParse(url, parseQueryString, slashesDenoteHost) {\n\t if (url && util.isObject(url) && url instanceof Url) return url;\n\t\n\t var u = new Url;\n\t u.parse(url, parseQueryString, slashesDenoteHost);\n\t return u;\n\t}\n\t\n\tUrl.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {\n\t if (!util.isString(url)) {\n\t throw new TypeError(\"Parameter 'url' must be a string, not \" + typeof url);\n\t }\n\t\n\t // Copy chrome, IE, opera backslash-handling behavior.\n\t // Back slashes before the query string get converted to forward slashes\n\t // See: https://code.google.com/p/chromium/issues/detail?id=25916\n\t var queryIndex = url.indexOf('?'),\n\t splitter =\n\t (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#',\n\t uSplit = url.split(splitter),\n\t slashRegex = /\\\\/g;\n\t uSplit[0] = uSplit[0].replace(slashRegex, '/');\n\t url = uSplit.join(splitter);\n\t\n\t var rest = url;\n\t\n\t // trim before proceeding.\n\t // This is to support parse stuff like \" http://foo.com \\n\"\n\t rest = rest.trim();\n\t\n\t if (!slashesDenoteHost && url.split('#').length === 1) {\n\t // Try fast path regexp\n\t var simplePath = simplePathPattern.exec(rest);\n\t if (simplePath) {\n\t this.path = rest;\n\t this.href = rest;\n\t this.pathname = simplePath[1];\n\t if (simplePath[2]) {\n\t this.search = simplePath[2];\n\t if (parseQueryString) {\n\t this.query = querystring.parse(this.search.substr(1));\n\t } else {\n\t this.query = this.search.substr(1);\n\t }\n\t } else if (parseQueryString) {\n\t this.search = '';\n\t this.query = {};\n\t }\n\t return this;\n\t }\n\t }\n\t\n\t var proto = protocolPattern.exec(rest);\n\t if (proto) {\n\t proto = proto[0];\n\t var lowerProto = proto.toLowerCase();\n\t this.protocol = lowerProto;\n\t rest = rest.substr(proto.length);\n\t }\n\t\n\t // figure out if it's got a host\n\t // user@server is *always* interpreted as a hostname, and url\n\t // resolution will treat //foo/bar as host=foo,path=bar because that's\n\t // how the browser resolves relative URLs.\n\t if (slashesDenoteHost || proto || rest.match(/^\\/\\/[^@\\/]+@[^@\\/]+/)) {\n\t var slashes = rest.substr(0, 2) === '//';\n\t if (slashes && !(proto && hostlessProtocol[proto])) {\n\t rest = rest.substr(2);\n\t this.slashes = true;\n\t }\n\t }\n\t\n\t if (!hostlessProtocol[proto] &&\n\t (slashes || (proto && !slashedProtocol[proto]))) {\n\t\n\t // there's a hostname.\n\t // the first instance of /, ?, ;, or # ends the host.\n\t //\n\t // If there is an @ in the hostname, then non-host chars *are* allowed\n\t // to the left of the last @ sign, unless some host-ending character\n\t // comes *before* the @-sign.\n\t // URLs are obnoxious.\n\t //\n\t // ex:\n\t // http://a@b@c/ => user:a@b host:c\n\t // http://a@b?@c => user:a host:c path:/?@c\n\t\n\t // v0.12 TODO(isaacs): This is not quite how Chrome does things.\n\t // Review our test case against browsers more comprehensively.\n\t\n\t // find the first instance of any hostEndingChars\n\t var hostEnd = -1;\n\t for (var i = 0; i < hostEndingChars.length; i++) {\n\t var hec = rest.indexOf(hostEndingChars[i]);\n\t if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n\t hostEnd = hec;\n\t }\n\t\n\t // at this point, either we have an explicit point where the\n\t // auth portion cannot go past, or the last @ char is the decider.\n\t var auth, atSign;\n\t if (hostEnd === -1) {\n\t // atSign can be anywhere.\n\t atSign = rest.lastIndexOf('@');\n\t } else {\n\t // atSign must be in auth portion.\n\t // http://a@b/c@d => host:b auth:a path:/c@d\n\t atSign = rest.lastIndexOf('@', hostEnd);\n\t }\n\t\n\t // Now we have a portion which is definitely the auth.\n\t // Pull that off.\n\t if (atSign !== -1) {\n\t auth = rest.slice(0, atSign);\n\t rest = rest.slice(atSign + 1);\n\t this.auth = decodeURIComponent(auth);\n\t }\n\t\n\t // the host is the remaining to the left of the first non-host char\n\t hostEnd = -1;\n\t for (var i = 0; i < nonHostChars.length; i++) {\n\t var hec = rest.indexOf(nonHostChars[i]);\n\t if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n\t hostEnd = hec;\n\t }\n\t // if we still have not hit it, then the entire thing is a host.\n\t if (hostEnd === -1)\n\t hostEnd = rest.length;\n\t\n\t this.host = rest.slice(0, hostEnd);\n\t rest = rest.slice(hostEnd);\n\t\n\t // pull out port.\n\t this.parseHost();\n\t\n\t // we've indicated that there is a hostname,\n\t // so even if it's empty, it has to be present.\n\t this.hostname = this.hostname || '';\n\t\n\t // if hostname begins with [ and ends with ]\n\t // assume that it's an IPv6 address.\n\t var ipv6Hostname = this.hostname[0] === '[' &&\n\t this.hostname[this.hostname.length - 1] === ']';\n\t\n\t // validate a little.\n\t if (!ipv6Hostname) {\n\t var hostparts = this.hostname.split(/\\./);\n\t for (var i = 0, l = hostparts.length; i < l; i++) {\n\t var part = hostparts[i];\n\t if (!part) continue;\n\t if (!part.match(hostnamePartPattern)) {\n\t var newpart = '';\n\t for (var j = 0, k = part.length; j < k; j++) {\n\t if (part.charCodeAt(j) > 127) {\n\t // we replace non-ASCII char with a temporary placeholder\n\t // we need this to make sure size of hostname is not\n\t // broken by replacing non-ASCII by nothing\n\t newpart += 'x';\n\t } else {\n\t newpart += part[j];\n\t }\n\t }\n\t // we test again with ASCII char only\n\t if (!newpart.match(hostnamePartPattern)) {\n\t var validParts = hostparts.slice(0, i);\n\t var notHost = hostparts.slice(i + 1);\n\t var bit = part.match(hostnamePartStart);\n\t if (bit) {\n\t validParts.push(bit[1]);\n\t notHost.unshift(bit[2]);\n\t }\n\t if (notHost.length) {\n\t rest = '/' + notHost.join('.') + rest;\n\t }\n\t this.hostname = validParts.join('.');\n\t break;\n\t }\n\t }\n\t }\n\t }\n\t\n\t if (this.hostname.length > hostnameMaxLen) {\n\t this.hostname = '';\n\t } else {\n\t // hostnames are always lower case.\n\t this.hostname = this.hostname.toLowerCase();\n\t }\n\t\n\t if (!ipv6Hostname) {\n\t // IDNA Support: Returns a punycoded representation of \"domain\".\n\t // It only converts parts of the domain name that\n\t // have non-ASCII characters, i.e. it doesn't matter if\n\t // you call it with a domain that already is ASCII-only.\n\t this.hostname = punycode.toASCII(this.hostname);\n\t }\n\t\n\t var p = this.port ? ':' + this.port : '';\n\t var h = this.hostname || '';\n\t this.host = h + p;\n\t this.href += this.host;\n\t\n\t // strip [ and ] from the hostname\n\t // the host field still retains them, though\n\t if (ipv6Hostname) {\n\t this.hostname = this.hostname.substr(1, this.hostname.length - 2);\n\t if (rest[0] !== '/') {\n\t rest = '/' + rest;\n\t }\n\t }\n\t }\n\t\n\t // now rest is set to the post-host stuff.\n\t // chop off any delim chars.\n\t if (!unsafeProtocol[lowerProto]) {\n\t\n\t // First, make 100% sure that any \"autoEscape\" chars get\n\t // escaped, even if encodeURIComponent doesn't think they\n\t // need to be.\n\t for (var i = 0, l = autoEscape.length; i < l; i++) {\n\t var ae = autoEscape[i];\n\t if (rest.indexOf(ae) === -1)\n\t continue;\n\t var esc = encodeURIComponent(ae);\n\t if (esc === ae) {\n\t esc = escape(ae);\n\t }\n\t rest = rest.split(ae).join(esc);\n\t }\n\t }\n\t\n\t\n\t // chop off from the tail first.\n\t var hash = rest.indexOf('#');\n\t if (hash !== -1) {\n\t // got a fragment string.\n\t this.hash = rest.substr(hash);\n\t rest = rest.slice(0, hash);\n\t }\n\t var qm = rest.indexOf('?');\n\t if (qm !== -1) {\n\t this.search = rest.substr(qm);\n\t this.query = rest.substr(qm + 1);\n\t if (parseQueryString) {\n\t this.query = querystring.parse(this.query);\n\t }\n\t rest = rest.slice(0, qm);\n\t } else if (parseQueryString) {\n\t // no query string, but parseQueryString still requested\n\t this.search = '';\n\t this.query = {};\n\t }\n\t if (rest) this.pathname = rest;\n\t if (slashedProtocol[lowerProto] &&\n\t this.hostname && !this.pathname) {\n\t this.pathname = '/';\n\t }\n\t\n\t //to support http.request\n\t if (this.pathname || this.search) {\n\t var p = this.pathname || '';\n\t var s = this.search || '';\n\t this.path = p + s;\n\t }\n\t\n\t // finally, reconstruct the href based on what has been validated.\n\t this.href = this.format();\n\t return this;\n\t};\n\t\n\t// format a parsed object into a url string\n\tfunction urlFormat(obj) {\n\t // ensure it's an object, and not a string url.\n\t // If it's an obj, this is a no-op.\n\t // this way, you can call url_format() on strings\n\t // to clean up potentially wonky urls.\n\t if (util.isString(obj)) obj = urlParse(obj);\n\t if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n\t return obj.format();\n\t}\n\t\n\tUrl.prototype.format = function() {\n\t var auth = this.auth || '';\n\t if (auth) {\n\t auth = encodeURIComponent(auth);\n\t auth = auth.replace(/%3A/i, ':');\n\t auth += '@';\n\t }\n\t\n\t var protocol = this.protocol || '',\n\t pathname = this.pathname || '',\n\t hash = this.hash || '',\n\t host = false,\n\t query = '';\n\t\n\t if (this.host) {\n\t host = auth + this.host;\n\t } else if (this.hostname) {\n\t host = auth + (this.hostname.indexOf(':') === -1 ?\n\t this.hostname :\n\t '[' + this.hostname + ']');\n\t if (this.port) {\n\t host += ':' + this.port;\n\t }\n\t }\n\t\n\t if (this.query &&\n\t util.isObject(this.query) &&\n\t Object.keys(this.query).length) {\n\t query = querystring.stringify(this.query);\n\t }\n\t\n\t var search = this.search || (query && ('?' + query)) || '';\n\t\n\t if (protocol && protocol.substr(-1) !== ':') protocol += ':';\n\t\n\t // only the slashedProtocols get the //. Not mailto:, xmpp:, etc.\n\t // unless they had them to begin with.\n\t if (this.slashes ||\n\t (!protocol || slashedProtocol[protocol]) && host !== false) {\n\t host = '//' + (host || '');\n\t if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname;\n\t } else if (!host) {\n\t host = '';\n\t }\n\t\n\t if (hash && hash.charAt(0) !== '#') hash = '#' + hash;\n\t if (search && search.charAt(0) !== '?') search = '?' + search;\n\t\n\t pathname = pathname.replace(/[?#]/g, function(match) {\n\t return encodeURIComponent(match);\n\t });\n\t search = search.replace('#', '%23');\n\t\n\t return protocol + host + pathname + search + hash;\n\t};\n\t\n\tfunction urlResolve(source, relative) {\n\t return urlParse(source, false, true).resolve(relative);\n\t}\n\t\n\tUrl.prototype.resolve = function(relative) {\n\t return this.resolveObject(urlParse(relative, false, true)).format();\n\t};\n\t\n\tfunction urlResolveObject(source, relative) {\n\t if (!source) return relative;\n\t return urlParse(source, false, true).resolveObject(relative);\n\t}\n\t\n\tUrl.prototype.resolveObject = function(relative) {\n\t if (util.isString(relative)) {\n\t var rel = new Url();\n\t rel.parse(relative, false, true);\n\t relative = rel;\n\t }\n\t\n\t var result = new Url();\n\t var tkeys = Object.keys(this);\n\t for (var tk = 0; tk < tkeys.length; tk++) {\n\t var tkey = tkeys[tk];\n\t result[tkey] = this[tkey];\n\t }\n\t\n\t // hash is always overridden, no matter what.\n\t // even href=\"\" will remove it.\n\t result.hash = relative.hash;\n\t\n\t // if the relative url is empty, then there's nothing left to do here.\n\t if (relative.href === '') {\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t // hrefs like //foo/bar always cut to the protocol.\n\t if (relative.slashes && !relative.protocol) {\n\t // take everything except the protocol from relative\n\t var rkeys = Object.keys(relative);\n\t for (var rk = 0; rk < rkeys.length; rk++) {\n\t var rkey = rkeys[rk];\n\t if (rkey !== 'protocol')\n\t result[rkey] = relative[rkey];\n\t }\n\t\n\t //urlParse appends trailing / to urls like http://www.example.com\n\t if (slashedProtocol[result.protocol] &&\n\t result.hostname && !result.pathname) {\n\t result.path = result.pathname = '/';\n\t }\n\t\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t if (relative.protocol && relative.protocol !== result.protocol) {\n\t // if it's a known url protocol, then changing\n\t // the protocol does weird things\n\t // first, if it's not file:, then we MUST have a host,\n\t // and if there was a path\n\t // to begin with, then we MUST have a path.\n\t // if it is file:, then the host is dropped,\n\t // because that's known to be hostless.\n\t // anything else is assumed to be absolute.\n\t if (!slashedProtocol[relative.protocol]) {\n\t var keys = Object.keys(relative);\n\t for (var v = 0; v < keys.length; v++) {\n\t var k = keys[v];\n\t result[k] = relative[k];\n\t }\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t result.protocol = relative.protocol;\n\t if (!relative.host && !hostlessProtocol[relative.protocol]) {\n\t var relPath = (relative.pathname || '').split('/');\n\t while (relPath.length && !(relative.host = relPath.shift()));\n\t if (!relative.host) relative.host = '';\n\t if (!relative.hostname) relative.hostname = '';\n\t if (relPath[0] !== '') relPath.unshift('');\n\t if (relPath.length < 2) relPath.unshift('');\n\t result.pathname = relPath.join('/');\n\t } else {\n\t result.pathname = relative.pathname;\n\t }\n\t result.search = relative.search;\n\t result.query = relative.query;\n\t result.host = relative.host || '';\n\t result.auth = relative.auth;\n\t result.hostname = relative.hostname || relative.host;\n\t result.port = relative.port;\n\t // to support http.request\n\t if (result.pathname || result.search) {\n\t var p = result.pathname || '';\n\t var s = result.search || '';\n\t result.path = p + s;\n\t }\n\t result.slashes = result.slashes || relative.slashes;\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'),\n\t isRelAbs = (\n\t relative.host ||\n\t relative.pathname && relative.pathname.charAt(0) === '/'\n\t ),\n\t mustEndAbs = (isRelAbs || isSourceAbs ||\n\t (result.host && relative.pathname)),\n\t removeAllDots = mustEndAbs,\n\t srcPath = result.pathname && result.pathname.split('/') || [],\n\t relPath = relative.pathname && relative.pathname.split('/') || [],\n\t psychotic = result.protocol && !slashedProtocol[result.protocol];\n\t\n\t // if the url is a non-slashed url, then relative\n\t // links like ../.. should be able\n\t // to crawl up to the hostname, as well. This is strange.\n\t // result.protocol has already been set by now.\n\t // Later on, put the first path part into the host field.\n\t if (psychotic) {\n\t result.hostname = '';\n\t result.port = null;\n\t if (result.host) {\n\t if (srcPath[0] === '') srcPath[0] = result.host;\n\t else srcPath.unshift(result.host);\n\t }\n\t result.host = '';\n\t if (relative.protocol) {\n\t relative.hostname = null;\n\t relative.port = null;\n\t if (relative.host) {\n\t if (relPath[0] === '') relPath[0] = relative.host;\n\t else relPath.unshift(relative.host);\n\t }\n\t relative.host = null;\n\t }\n\t mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === '');\n\t }\n\t\n\t if (isRelAbs) {\n\t // it's absolute.\n\t result.host = (relative.host || relative.host === '') ?\n\t relative.host : result.host;\n\t result.hostname = (relative.hostname || relative.hostname === '') ?\n\t relative.hostname : result.hostname;\n\t result.search = relative.search;\n\t result.query = relative.query;\n\t srcPath = relPath;\n\t // fall through to the dot-handling below.\n\t } else if (relPath.length) {\n\t // it's relative\n\t // throw away the existing file, and take the new path instead.\n\t if (!srcPath) srcPath = [];\n\t srcPath.pop();\n\t srcPath = srcPath.concat(relPath);\n\t result.search = relative.search;\n\t result.query = relative.query;\n\t } else if (!util.isNullOrUndefined(relative.search)) {\n\t // just pull out the search.\n\t // like href='https://github.com/?foo'.\n\t // Put this after the other two cases because it simplifies the booleans\n\t if (psychotic) {\n\t result.hostname = result.host = srcPath.shift();\n\t //occationaly the auth can get stuck only in host\n\t //this especially happens in cases like\n\t //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n\t var authInHost = result.host && result.host.indexOf('@') > 0 ?\n\t result.host.split('@') : false;\n\t if (authInHost) {\n\t result.auth = authInHost.shift();\n\t result.host = result.hostname = authInHost.shift();\n\t }\n\t }\n\t result.search = relative.search;\n\t result.query = relative.query;\n\t //to support http.request\n\t if (!util.isNull(result.pathname) || !util.isNull(result.search)) {\n\t result.path = (result.pathname ? result.pathname : '') +\n\t (result.search ? result.search : '');\n\t }\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t if (!srcPath.length) {\n\t // no path at all. easy.\n\t // we've already handled the other stuff above.\n\t result.pathname = null;\n\t //to support http.request\n\t if (result.search) {\n\t result.path = '/' + result.search;\n\t } else {\n\t result.path = null;\n\t }\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t // if a url ENDs in . or .., then it must get a trailing slash.\n\t // however, if it ends in anything else non-slashy,\n\t // then it must NOT get a trailing slash.\n\t var last = srcPath.slice(-1)[0];\n\t var hasTrailingSlash = (\n\t (result.host || relative.host || srcPath.length > 1) &&\n\t (last === '.' || last === '..') || last === '');\n\t\n\t // strip single dots, resolve double dots to parent dir\n\t // if the path tries to go above the root, `up` ends up > 0\n\t var up = 0;\n\t for (var i = srcPath.length; i >= 0; i--) {\n\t last = srcPath[i];\n\t if (last === '.') {\n\t srcPath.splice(i, 1);\n\t } else if (last === '..') {\n\t srcPath.splice(i, 1);\n\t up++;\n\t } else if (up) {\n\t srcPath.splice(i, 1);\n\t up--;\n\t }\n\t }\n\t\n\t // if the path is allowed to go above the root, restore leading ..s\n\t if (!mustEndAbs && !removeAllDots) {\n\t for (; up--; up) {\n\t srcPath.unshift('..');\n\t }\n\t }\n\t\n\t if (mustEndAbs && srcPath[0] !== '' &&\n\t (!srcPath[0] || srcPath[0].charAt(0) !== '/')) {\n\t srcPath.unshift('');\n\t }\n\t\n\t if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) {\n\t srcPath.push('');\n\t }\n\t\n\t var isAbsolute = srcPath[0] === '' ||\n\t (srcPath[0] && srcPath[0].charAt(0) === '/');\n\t\n\t // put the host back\n\t if (psychotic) {\n\t result.hostname = result.host = isAbsolute ? '' :\n\t srcPath.length ? srcPath.shift() : '';\n\t //occationaly the auth can get stuck only in host\n\t //this especially happens in cases like\n\t //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n\t var authInHost = result.host && result.host.indexOf('@') > 0 ?\n\t result.host.split('@') : false;\n\t if (authInHost) {\n\t result.auth = authInHost.shift();\n\t result.host = result.hostname = authInHost.shift();\n\t }\n\t }\n\t\n\t mustEndAbs = mustEndAbs || (result.host && srcPath.length);\n\t\n\t if (mustEndAbs && !isAbsolute) {\n\t srcPath.unshift('');\n\t }\n\t\n\t if (!srcPath.length) {\n\t result.pathname = null;\n\t result.path = null;\n\t } else {\n\t result.pathname = srcPath.join('/');\n\t }\n\t\n\t //to support request.http\n\t if (!util.isNull(result.pathname) || !util.isNull(result.search)) {\n\t result.path = (result.pathname ? result.pathname : '') +\n\t (result.search ? result.search : '');\n\t }\n\t result.auth = relative.auth || result.auth;\n\t result.slashes = result.slashes || relative.slashes;\n\t result.href = result.format();\n\t return result;\n\t};\n\t\n\tUrl.prototype.parseHost = function() {\n\t var host = this.host;\n\t var port = portPattern.exec(host);\n\t if (port) {\n\t port = port[0];\n\t if (port !== ':') {\n\t this.port = port.substr(1);\n\t }\n\t host = host.substr(0, host.length - port.length);\n\t }\n\t if (host) this.hostname = host;\n\t};\n\n\n/***/ },\n/* 17 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(module, global) {/*! https://mths.be/punycode v1.3.2 by @mathias */\n\t;(function(root) {\n\t\n\t\t/** Detect free variables */\n\t\tvar freeExports = typeof exports == 'object' && exports &&\n\t\t\t!exports.nodeType && exports;\n\t\tvar freeModule = typeof module == 'object' && module &&\n\t\t\t!module.nodeType && module;\n\t\tvar freeGlobal = typeof global == 'object' && global;\n\t\tif (\n\t\t\tfreeGlobal.global === freeGlobal ||\n\t\t\tfreeGlobal.window === freeGlobal ||\n\t\t\tfreeGlobal.self === freeGlobal\n\t\t) {\n\t\t\troot = freeGlobal;\n\t\t}\n\t\n\t\t/**\n\t\t * The `punycode` object.\n\t\t * @name punycode\n\t\t * @type Object\n\t\t */\n\t\tvar punycode,\n\t\n\t\t/** Highest positive signed 32-bit float value */\n\t\tmaxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1\n\t\n\t\t/** Bootstring parameters */\n\t\tbase = 36,\n\t\ttMin = 1,\n\t\ttMax = 26,\n\t\tskew = 38,\n\t\tdamp = 700,\n\t\tinitialBias = 72,\n\t\tinitialN = 128, // 0x80\n\t\tdelimiter = '-', // '\\x2D'\n\t\n\t\t/** Regular expressions */\n\t\tregexPunycode = /^xn--/,\n\t\tregexNonASCII = /[^\\x20-\\x7E]/, // unprintable ASCII chars + non-ASCII chars\n\t\tregexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g, // RFC 3490 separators\n\t\n\t\t/** Error messages */\n\t\terrors = {\n\t\t\t'overflow': 'Overflow: input needs wider integers to process',\n\t\t\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t\t\t'invalid-input': 'Invalid input'\n\t\t},\n\t\n\t\t/** Convenience shortcuts */\n\t\tbaseMinusTMin = base - tMin,\n\t\tfloor = Math.floor,\n\t\tstringFromCharCode = String.fromCharCode,\n\t\n\t\t/** Temporary variable */\n\t\tkey;\n\t\n\t\t/*--------------------------------------------------------------------------*/\n\t\n\t\t/**\n\t\t * A generic error utility function.\n\t\t * @private\n\t\t * @param {String} type The error type.\n\t\t * @returns {Error} Throws a `RangeError` with the applicable error message.\n\t\t */\n\t\tfunction error(type) {\n\t\t\tthrow RangeError(errors[type]);\n\t\t}\n\t\n\t\t/**\n\t\t * A generic `Array#map` utility function.\n\t\t * @private\n\t\t * @param {Array} array The array to iterate over.\n\t\t * @param {Function} callback The function that gets called for every array\n\t\t * item.\n\t\t * @returns {Array} A new array of values returned by the callback function.\n\t\t */\n\t\tfunction map(array, fn) {\n\t\t\tvar length = array.length;\n\t\t\tvar result = [];\n\t\t\twhile (length--) {\n\t\t\t\tresult[length] = fn(array[length]);\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\n\t\t/**\n\t\t * A simple `Array#map`-like wrapper to work with domain name strings or email\n\t\t * addresses.\n\t\t * @private\n\t\t * @param {String} domain The domain name or email address.\n\t\t * @param {Function} callback The function that gets called for every\n\t\t * character.\n\t\t * @returns {Array} A new string of characters returned by the callback\n\t\t * function.\n\t\t */\n\t\tfunction mapDomain(string, fn) {\n\t\t\tvar parts = string.split('@');\n\t\t\tvar result = '';\n\t\t\tif (parts.length > 1) {\n\t\t\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t\t\t// the local part (i.e. everything up to `@`) intact.\n\t\t\t\tresult = parts[0] + '@';\n\t\t\t\tstring = parts[1];\n\t\t\t}\n\t\t\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\t\t\tstring = string.replace(regexSeparators, '\\x2E');\n\t\t\tvar labels = string.split('.');\n\t\t\tvar encoded = map(labels, fn).join('.');\n\t\t\treturn result + encoded;\n\t\t}\n\t\n\t\t/**\n\t\t * Creates an array containing the numeric code points of each Unicode\n\t\t * character in the string. While JavaScript uses UCS-2 internally,\n\t\t * this function will convert a pair of surrogate halves (each of which\n\t\t * UCS-2 exposes as separate characters) into a single code point,\n\t\t * matching UTF-16.\n\t\t * @see `punycode.ucs2.encode`\n\t\t * @see \n\t\t * @memberOf punycode.ucs2\n\t\t * @name decode\n\t\t * @param {String} string The Unicode input string (UCS-2).\n\t\t * @returns {Array} The new array of code points.\n\t\t */\n\t\tfunction ucs2decode(string) {\n\t\t\tvar output = [],\n\t\t\t counter = 0,\n\t\t\t length = string.length,\n\t\t\t value,\n\t\t\t extra;\n\t\t\twhile (counter < length) {\n\t\t\t\tvalue = string.charCodeAt(counter++);\n\t\t\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t\t\t// high surrogate, and there is a next character\n\t\t\t\t\textra = string.charCodeAt(counter++);\n\t\t\t\t\tif ((extra & 0xFC00) == 0xDC00) { // low surrogate\n\t\t\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// unmatched surrogate; only append this code unit, in case the next\n\t\t\t\t\t\t// code unit is the high surrogate of a surrogate pair\n\t\t\t\t\t\toutput.push(value);\n\t\t\t\t\t\tcounter--;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\toutput.push(value);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn output;\n\t\t}\n\t\n\t\t/**\n\t\t * Creates a string based on an array of numeric code points.\n\t\t * @see `punycode.ucs2.decode`\n\t\t * @memberOf punycode.ucs2\n\t\t * @name encode\n\t\t * @param {Array} codePoints The array of numeric code points.\n\t\t * @returns {String} The new Unicode string (UCS-2).\n\t\t */\n\t\tfunction ucs2encode(array) {\n\t\t\treturn map(array, function(value) {\n\t\t\t\tvar output = '';\n\t\t\t\tif (value > 0xFFFF) {\n\t\t\t\t\tvalue -= 0x10000;\n\t\t\t\t\toutput += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);\n\t\t\t\t\tvalue = 0xDC00 | value & 0x3FF;\n\t\t\t\t}\n\t\t\t\toutput += stringFromCharCode(value);\n\t\t\t\treturn output;\n\t\t\t}).join('');\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a basic code point into a digit/integer.\n\t\t * @see `digitToBasic()`\n\t\t * @private\n\t\t * @param {Number} codePoint The basic numeric code point value.\n\t\t * @returns {Number} The numeric value of a basic code point (for use in\n\t\t * representing integers) in the range `0` to `base - 1`, or `base` if\n\t\t * the code point does not represent a value.\n\t\t */\n\t\tfunction basicToDigit(codePoint) {\n\t\t\tif (codePoint - 48 < 10) {\n\t\t\t\treturn codePoint - 22;\n\t\t\t}\n\t\t\tif (codePoint - 65 < 26) {\n\t\t\t\treturn codePoint - 65;\n\t\t\t}\n\t\t\tif (codePoint - 97 < 26) {\n\t\t\t\treturn codePoint - 97;\n\t\t\t}\n\t\t\treturn base;\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a digit/integer into a basic code point.\n\t\t * @see `basicToDigit()`\n\t\t * @private\n\t\t * @param {Number} digit The numeric value of a basic code point.\n\t\t * @returns {Number} The basic code point whose value (when used for\n\t\t * representing integers) is `digit`, which needs to be in the range\n\t\t * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n\t\t * used; else, the lowercase form is used. The behavior is undefined\n\t\t * if `flag` is non-zero and `digit` has no uppercase form.\n\t\t */\n\t\tfunction digitToBasic(digit, flag) {\n\t\t\t// 0..25 map to ASCII a..z or A..Z\n\t\t\t// 26..35 map to ASCII 0..9\n\t\t\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n\t\t}\n\t\n\t\t/**\n\t\t * Bias adaptation function as per section 3.4 of RFC 3492.\n\t\t * http://tools.ietf.org/html/rfc3492#section-3.4\n\t\t * @private\n\t\t */\n\t\tfunction adapt(delta, numPoints, firstTime) {\n\t\t\tvar k = 0;\n\t\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\t\tdelta += floor(delta / numPoints);\n\t\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t\t}\n\t\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n\t\t * symbols.\n\t\t * @memberOf punycode\n\t\t * @param {String} input The Punycode string of ASCII-only symbols.\n\t\t * @returns {String} The resulting string of Unicode symbols.\n\t\t */\n\t\tfunction decode(input) {\n\t\t\t// Don't use UCS-2\n\t\t\tvar output = [],\n\t\t\t inputLength = input.length,\n\t\t\t out,\n\t\t\t i = 0,\n\t\t\t n = initialN,\n\t\t\t bias = initialBias,\n\t\t\t basic,\n\t\t\t j,\n\t\t\t index,\n\t\t\t oldi,\n\t\t\t w,\n\t\t\t k,\n\t\t\t digit,\n\t\t\t t,\n\t\t\t /** Cached calculation results */\n\t\t\t baseMinusT;\n\t\n\t\t\t// Handle the basic code points: let `basic` be the number of input code\n\t\t\t// points before the last delimiter, or `0` if there is none, then copy\n\t\t\t// the first basic code points to the output.\n\t\n\t\t\tbasic = input.lastIndexOf(delimiter);\n\t\t\tif (basic < 0) {\n\t\t\t\tbasic = 0;\n\t\t\t}\n\t\n\t\t\tfor (j = 0; j < basic; ++j) {\n\t\t\t\t// if it's not a basic code point\n\t\t\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\t\t\terror('not-basic');\n\t\t\t\t}\n\t\t\t\toutput.push(input.charCodeAt(j));\n\t\t\t}\n\t\n\t\t\t// Main decoding loop: start just after the last delimiter if any basic code\n\t\t\t// points were copied; start at the beginning otherwise.\n\t\n\t\t\tfor (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\t\n\t\t\t\t// `index` is the index of the next character to be consumed.\n\t\t\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t\t\t// which gets added to `i`. The overflow checking is easier\n\t\t\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t\t\t// value at the end to obtain `delta`.\n\t\t\t\tfor (oldi = i, w = 1, k = base; /* no condition */; k += base) {\n\t\n\t\t\t\t\tif (index >= inputLength) {\n\t\t\t\t\t\terror('invalid-input');\n\t\t\t\t\t}\n\t\n\t\t\t\t\tdigit = basicToDigit(input.charCodeAt(index++));\n\t\n\t\t\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\t\t\terror('overflow');\n\t\t\t\t\t}\n\t\n\t\t\t\t\ti += digit * w;\n\t\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\n\t\t\t\t\tif (digit < t) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tbaseMinusT = base - t;\n\t\t\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\t\t\terror('overflow');\n\t\t\t\t\t}\n\t\n\t\t\t\t\tw *= baseMinusT;\n\t\n\t\t\t\t}\n\t\n\t\t\t\tout = output.length + 1;\n\t\t\t\tbias = adapt(i - oldi, out, oldi == 0);\n\t\n\t\t\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t\t\t// incrementing `n` each time, so we'll fix that now:\n\t\t\t\tif (floor(i / out) > maxInt - n) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\t\n\t\t\t\tn += floor(i / out);\n\t\t\t\ti %= out;\n\t\n\t\t\t\t// Insert `n` at position `i` of the output\n\t\t\t\toutput.splice(i++, 0, n);\n\t\n\t\t\t}\n\t\n\t\t\treturn ucs2encode(output);\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a string of Unicode symbols (e.g. a domain name label) to a\n\t\t * Punycode string of ASCII-only symbols.\n\t\t * @memberOf punycode\n\t\t * @param {String} input The string of Unicode symbols.\n\t\t * @returns {String} The resulting Punycode string of ASCII-only symbols.\n\t\t */\n\t\tfunction encode(input) {\n\t\t\tvar n,\n\t\t\t delta,\n\t\t\t handledCPCount,\n\t\t\t basicLength,\n\t\t\t bias,\n\t\t\t j,\n\t\t\t m,\n\t\t\t q,\n\t\t\t k,\n\t\t\t t,\n\t\t\t currentValue,\n\t\t\t output = [],\n\t\t\t /** `inputLength` will hold the number of code points in `input`. */\n\t\t\t inputLength,\n\t\t\t /** Cached calculation results */\n\t\t\t handledCPCountPlusOne,\n\t\t\t baseMinusT,\n\t\t\t qMinusT;\n\t\n\t\t\t// Convert the input in UCS-2 to Unicode\n\t\t\tinput = ucs2decode(input);\n\t\n\t\t\t// Cache the length\n\t\t\tinputLength = input.length;\n\t\n\t\t\t// Initialize the state\n\t\t\tn = initialN;\n\t\t\tdelta = 0;\n\t\t\tbias = initialBias;\n\t\n\t\t\t// Handle the basic code points\n\t\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\t\tcurrentValue = input[j];\n\t\t\t\tif (currentValue < 0x80) {\n\t\t\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\thandledCPCount = basicLength = output.length;\n\t\n\t\t\t// `handledCPCount` is the number of code points that have been handled;\n\t\t\t// `basicLength` is the number of basic code points.\n\t\n\t\t\t// Finish the basic string - if it is not empty - with a delimiter\n\t\t\tif (basicLength) {\n\t\t\t\toutput.push(delimiter);\n\t\t\t}\n\t\n\t\t\t// Main encoding loop:\n\t\t\twhile (handledCPCount < inputLength) {\n\t\n\t\t\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t\t\t// larger one:\n\t\t\t\tfor (m = maxInt, j = 0; j < inputLength; ++j) {\n\t\t\t\t\tcurrentValue = input[j];\n\t\t\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\t\t\tm = currentValue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\t// Increase `delta` enough to advance the decoder's state to ,\n\t\t\t\t// but guard against overflow\n\t\t\t\thandledCPCountPlusOne = handledCPCount + 1;\n\t\t\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\t\n\t\t\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\t\t\tn = m;\n\t\n\t\t\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\t\t\tcurrentValue = input[j];\n\t\n\t\t\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\t\t\terror('overflow');\n\t\t\t\t\t}\n\t\n\t\t\t\t\tif (currentValue == n) {\n\t\t\t\t\t\t// Represent delta as a generalized variable-length integer\n\t\t\t\t\t\tfor (q = delta, k = base; /* no condition */; k += base) {\n\t\t\t\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tqMinusT = q - t;\n\t\t\t\t\t\t\tbaseMinusT = base - t;\n\t\t\t\t\t\t\toutput.push(\n\t\t\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\t\t\tdelta = 0;\n\t\t\t\t\t\t++handledCPCount;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\t++delta;\n\t\t\t\t++n;\n\t\n\t\t\t}\n\t\t\treturn output.join('');\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a Punycode string representing a domain name or an email address\n\t\t * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n\t\t * it doesn't matter if you call it on a string that has already been\n\t\t * converted to Unicode.\n\t\t * @memberOf punycode\n\t\t * @param {String} input The Punycoded domain name or email address to\n\t\t * convert to Unicode.\n\t\t * @returns {String} The Unicode representation of the given Punycode\n\t\t * string.\n\t\t */\n\t\tfunction toUnicode(input) {\n\t\t\treturn mapDomain(input, function(string) {\n\t\t\t\treturn regexPunycode.test(string)\n\t\t\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t\t\t: string;\n\t\t\t});\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a Unicode string representing a domain name or an email address to\n\t\t * Punycode. Only the non-ASCII parts of the domain name will be converted,\n\t\t * i.e. it doesn't matter if you call it with a domain that's already in\n\t\t * ASCII.\n\t\t * @memberOf punycode\n\t\t * @param {String} input The domain name or email address to convert, as a\n\t\t * Unicode string.\n\t\t * @returns {String} The Punycode representation of the given domain name or\n\t\t * email address.\n\t\t */\n\t\tfunction toASCII(input) {\n\t\t\treturn mapDomain(input, function(string) {\n\t\t\t\treturn regexNonASCII.test(string)\n\t\t\t\t\t? 'xn--' + encode(string)\n\t\t\t\t\t: string;\n\t\t\t});\n\t\t}\n\t\n\t\t/*--------------------------------------------------------------------------*/\n\t\n\t\t/** Define the public API */\n\t\tpunycode = {\n\t\t\t/**\n\t\t\t * A string representing the current Punycode.js version number.\n\t\t\t * @memberOf punycode\n\t\t\t * @type String\n\t\t\t */\n\t\t\t'version': '1.3.2',\n\t\t\t/**\n\t\t\t * An object of methods to convert from JavaScript's internal character\n\t\t\t * representation (UCS-2) to Unicode code points, and back.\n\t\t\t * @see \n\t\t\t * @memberOf punycode\n\t\t\t * @type Object\n\t\t\t */\n\t\t\t'ucs2': {\n\t\t\t\t'decode': ucs2decode,\n\t\t\t\t'encode': ucs2encode\n\t\t\t},\n\t\t\t'decode': decode,\n\t\t\t'encode': encode,\n\t\t\t'toASCII': toASCII,\n\t\t\t'toUnicode': toUnicode\n\t\t};\n\t\n\t\t/** Expose `punycode` */\n\t\t// Some AMD build optimizers, like r.js, check for specific condition patterns\n\t\t// like the following:\n\t\tif (\n\t\t\ttrue\n\t\t) {\n\t\t\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function() {\n\t\t\t\treturn punycode;\n\t\t\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t\t} else if (freeExports && freeModule) {\n\t\t\tif (module.exports == freeExports) { // in Node.js or RingoJS v0.8.0+\n\t\t\t\tfreeModule.exports = punycode;\n\t\t\t} else { // in Narwhal or RingoJS v0.7.0-\n\t\t\t\tfor (key in punycode) {\n\t\t\t\t\tpunycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]);\n\t\t\t\t}\n\t\t\t}\n\t\t} else { // in Rhino or a web browser\n\t\t\troot.punycode = punycode;\n\t\t}\n\t\n\t}(this));\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(18)(module), (function() { return this; }())))\n\n/***/ },\n/* 18 */\n/***/ function(module, exports) {\n\n\tmodule.exports = function(module) {\r\n\t\tif(!module.webpackPolyfill) {\r\n\t\t\tmodule.deprecate = function() {};\r\n\t\t\tmodule.paths = [];\r\n\t\t\t// module.parent = undefined by default\r\n\t\t\tmodule.children = [];\r\n\t\t\tmodule.webpackPolyfill = 1;\r\n\t\t}\r\n\t\treturn module;\r\n\t}\r\n\n\n/***/ },\n/* 19 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = {\n\t isString: function(arg) {\n\t return typeof(arg) === 'string';\n\t },\n\t isObject: function(arg) {\n\t return typeof(arg) === 'object' && arg !== null;\n\t },\n\t isNull: function(arg) {\n\t return arg === null;\n\t },\n\t isNullOrUndefined: function(arg) {\n\t return arg == null;\n\t }\n\t};\n\n\n/***/ },\n/* 20 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\texports.decode = exports.parse = __webpack_require__(21);\n\texports.encode = exports.stringify = __webpack_require__(22);\n\n\n/***/ },\n/* 21 */\n/***/ function(module, exports) {\n\n\t// Copyright Joyent, Inc. and other Node contributors.\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a\n\t// copy of this software and associated documentation files (the\n\t// \"Software\"), to deal in the Software without restriction, including\n\t// without limitation the rights to use, copy, modify, merge, publish,\n\t// distribute, sublicense, and/or sell copies of the Software, and to permit\n\t// persons to whom the Software is furnished to do so, subject to the\n\t// following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included\n\t// in all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n\t// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\t// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n\t// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n\t// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n\t// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n\t// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\t\n\t'use strict';\n\t\n\t// If obj.hasOwnProperty has been overridden, then calling\n\t// obj.hasOwnProperty(prop) will break.\n\t// See: https://github.com/joyent/node/issues/1707\n\tfunction hasOwnProperty(obj, prop) {\n\t return Object.prototype.hasOwnProperty.call(obj, prop);\n\t}\n\t\n\tmodule.exports = function(qs, sep, eq, options) {\n\t sep = sep || '&';\n\t eq = eq || '=';\n\t var obj = {};\n\t\n\t if (typeof qs !== 'string' || qs.length === 0) {\n\t return obj;\n\t }\n\t\n\t var regexp = /\\+/g;\n\t qs = qs.split(sep);\n\t\n\t var maxKeys = 1000;\n\t if (options && typeof options.maxKeys === 'number') {\n\t maxKeys = options.maxKeys;\n\t }\n\t\n\t var len = qs.length;\n\t // maxKeys <= 0 means that we should not limit keys count\n\t if (maxKeys > 0 && len > maxKeys) {\n\t len = maxKeys;\n\t }\n\t\n\t for (var i = 0; i < len; ++i) {\n\t var x = qs[i].replace(regexp, '%20'),\n\t idx = x.indexOf(eq),\n\t kstr, vstr, k, v;\n\t\n\t if (idx >= 0) {\n\t kstr = x.substr(0, idx);\n\t vstr = x.substr(idx + 1);\n\t } else {\n\t kstr = x;\n\t vstr = '';\n\t }\n\t\n\t k = decodeURIComponent(kstr);\n\t v = decodeURIComponent(vstr);\n\t\n\t if (!hasOwnProperty(obj, k)) {\n\t obj[k] = v;\n\t } else if (Array.isArray(obj[k])) {\n\t obj[k].push(v);\n\t } else {\n\t obj[k] = [obj[k], v];\n\t }\n\t }\n\t\n\t return obj;\n\t};\n\n\n/***/ },\n/* 22 */\n/***/ function(module, exports) {\n\n\t// Copyright Joyent, Inc. and other Node contributors.\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a\n\t// copy of this software and associated documentation files (the\n\t// \"Software\"), to deal in the Software without restriction, including\n\t// without limitation the rights to use, copy, modify, merge, publish,\n\t// distribute, sublicense, and/or sell copies of the Software, and to permit\n\t// persons to whom the Software is furnished to do so, subject to the\n\t// following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included\n\t// in all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n\t// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\t// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n\t// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n\t// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n\t// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n\t// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\t\n\t'use strict';\n\t\n\tvar stringifyPrimitive = function(v) {\n\t switch (typeof v) {\n\t case 'string':\n\t return v;\n\t\n\t case 'boolean':\n\t return v ? 'true' : 'false';\n\t\n\t case 'number':\n\t return isFinite(v) ? v : '';\n\t\n\t default:\n\t return '';\n\t }\n\t};\n\t\n\tmodule.exports = function(obj, sep, eq, name) {\n\t sep = sep || '&';\n\t eq = eq || '=';\n\t if (obj === null) {\n\t obj = undefined;\n\t }\n\t\n\t if (typeof obj === 'object') {\n\t return Object.keys(obj).map(function(k) {\n\t var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;\n\t if (Array.isArray(obj[k])) {\n\t return obj[k].map(function(v) {\n\t return ks + encodeURIComponent(stringifyPrimitive(v));\n\t }).join(sep);\n\t } else {\n\t return ks + encodeURIComponent(stringifyPrimitive(obj[k]));\n\t }\n\t }).join(sep);\n\t\n\t }\n\t\n\t if (!name) return '';\n\t return encodeURIComponent(stringifyPrimitive(name)) + eq +\n\t encodeURIComponent(stringifyPrimitive(obj));\n\t};\n\n\n/***/ },\n/* 23 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"id\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"description\": \"Core schema meta-schema\",\n\t\t\"definitions\": {\n\t\t\t\"schemaArray\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"minItems\": 1,\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"positiveInteger\": {\n\t\t\t\t\"type\": \"integer\",\n\t\t\t\t\"minimum\": 0\n\t\t\t},\n\t\t\t\"positiveIntegerDefault0\": {\n\t\t\t\t\"allOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#/definitions/positiveInteger\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"default\": 0\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"simpleTypes\": {\n\t\t\t\t\"enum\": [\n\t\t\t\t\t\"array\",\n\t\t\t\t\t\"boolean\",\n\t\t\t\t\t\"integer\",\n\t\t\t\t\t\"null\",\n\t\t\t\t\t\"number\",\n\t\t\t\t\t\"object\",\n\t\t\t\t\t\"string\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"stringArray\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t},\n\t\t\t\t\"minItems\": 1,\n\t\t\t\t\"uniqueItems\": true\n\t\t\t}\n\t\t},\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"id\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"uri\"\n\t\t\t},\n\t\t\t\"$schema\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"uri\"\n\t\t\t},\n\t\t\t\"title\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"description\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"default\": {},\n\t\t\t\"multipleOf\": {\n\t\t\t\t\"type\": \"number\",\n\t\t\t\t\"minimum\": 0,\n\t\t\t\t\"exclusiveMinimum\": true\n\t\t\t},\n\t\t\t\"maximum\": {\n\t\t\t\t\"type\": \"number\"\n\t\t\t},\n\t\t\t\"exclusiveMaximum\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"minimum\": {\n\t\t\t\t\"type\": \"number\"\n\t\t\t},\n\t\t\t\"exclusiveMinimum\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"maxLength\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveInteger\"\n\t\t\t},\n\t\t\t\"minLength\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveIntegerDefault0\"\n\t\t\t},\n\t\t\t\"pattern\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"regex\"\n\t\t\t},\n\t\t\t\"additionalItems\": {\n\t\t\t\t\"anyOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"boolean\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"items\": {\n\t\t\t\t\"anyOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#/definitions/schemaArray\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"maxItems\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveInteger\"\n\t\t\t},\n\t\t\t\"minItems\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveIntegerDefault0\"\n\t\t\t},\n\t\t\t\"uniqueItems\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"maxProperties\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveInteger\"\n\t\t\t},\n\t\t\t\"minProperties\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveIntegerDefault0\"\n\t\t\t},\n\t\t\t\"required\": {\n\t\t\t\t\"$ref\": \"#/definitions/stringArray\"\n\t\t\t},\n\t\t\t\"additionalProperties\": {\n\t\t\t\t\"anyOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"boolean\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"definitions\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": {\n\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t},\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"properties\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": {\n\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t},\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"patternProperties\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": {\n\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t},\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"dependencies\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": {\n\t\t\t\t\t\"anyOf\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"$ref\": \"#/definitions/stringArray\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"enum\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"minItems\": 1,\n\t\t\t\t\"uniqueItems\": true\n\t\t\t},\n\t\t\t\"type\": {\n\t\t\t\t\"anyOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#/definitions/simpleTypes\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"array\",\n\t\t\t\t\t\t\"items\": {\n\t\t\t\t\t\t\t\"$ref\": \"#/definitions/simpleTypes\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"minItems\": 1,\n\t\t\t\t\t\t\"uniqueItems\": true\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"allOf\": {\n\t\t\t\t\"$ref\": \"#/definitions/schemaArray\"\n\t\t\t},\n\t\t\t\"anyOf\": {\n\t\t\t\t\"$ref\": \"#/definitions/schemaArray\"\n\t\t\t},\n\t\t\t\"oneOf\": {\n\t\t\t\t\"$ref\": \"#/definitions/schemaArray\"\n\t\t\t},\n\t\t\t\"not\": {\n\t\t\t\t\"$ref\": \"#\"\n\t\t\t}\n\t\t},\n\t\t\"dependencies\": {\n\t\t\t\"exclusiveMaximum\": [\n\t\t\t\t\"maximum\"\n\t\t\t],\n\t\t\t\"exclusiveMinimum\": [\n\t\t\t\t\"minimum\"\n\t\t\t]\n\t\t},\n\t\t\"default\": {}\n\t};\n\n/***/ },\n/* 24 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tvar formats = {};\n\t\n\t// reference: http://dansnetwork.com/javascript-iso8601rfc3339-date-parser/\n\tformats['date-time'] = /(\\d\\d\\d\\d)(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))/;\n\t// reference: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js#L7\n\tformats.uri = /^([a-zA-Z][a-zA-Z0-9+-.]*:){0,1}\\/\\/[^\\s]*$/;\n\t// reference: http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363\n\t// http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'willful violation')\n\tformats.email = /^[a-zA-Z0-9.!#$%&'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n\t// reference: https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html\n\tformats.ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;\n\t// reference: http://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses\n\tformats.ipv6 = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|[fF][eE]80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::([fF]{4}(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;\n\t// reference: http://stackoverflow.com/questions/106179/regular-expression-to-match-dns-hostname-or-ip-address#answer-3824105\n\tformats.hostname = /^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])(\\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]))*$/;\n\t\n\tmodule.exports = formats;\n\n/***/ },\n/* 25 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\t// Reference: https://github.com/bestiejs/punycode.js/blob/master/punycode.js#L101`\n\t// Info: https://mathiasbynens.be/notes/javascript-unicode\n\tfunction ucs2length(string) {\n\t var ucs2len = 0,\n\t counter = 0,\n\t length = string.length,\n\t value, extra;\n\t\n\t while (counter < length) {\n\t ucs2len++;\n\t value = string.charCodeAt(counter++);\n\t\n\t if (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t // It's a high surrogate, and there is a next character.\n\t extra = string.charCodeAt(counter++);\n\t\n\t if ((extra & 0xFC00) !== 0xDC00) { /* Low surrogate. */ // jshint ignore: line\n\t counter--;\n\t }\n\t }\n\t }\n\t\n\t return ucs2len;\n\t}\n\t\n\tmodule.exports = ucs2length;\n\n/***/ }\n/******/ ])\n});\n;\n//# sourceMappingURL=models.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/powerbi-models/dist/models.js\n// module id = 5\n// module chunks = 0","import { IFilterable } from './ifilterable';\r\nimport { IReportNode } from './report';\r\nimport * as models from 'powerbi-models';\r\n\r\n/**\r\n * A Page node within a report hierarchy\r\n * \r\n * @export\r\n * @interface IPageNode\r\n */\r\nexport interface IPageNode {\r\n report: IReportNode;\r\n name: string;\r\n}\r\n\r\n/**\r\n * A Power BI report page\r\n * \r\n * @export\r\n * @class Page\r\n * @implements {IPageNode}\r\n * @implements {IFilterable}\r\n */\r\nexport class Page implements IPageNode, IFilterable {\r\n /**\r\n * The parent Power BI report that this page is a member of\r\n * \r\n * @type {IReportNode}\r\n */\r\n report: IReportNode;\r\n /**\r\n * The report page name\r\n * \r\n * @type {string}\r\n */\r\n name: string;\r\n\r\n /**\r\n * The user defined display name of the report page, which is undefined if the page is created manually\r\n * \r\n * @type {string}\r\n */\r\n displayName: string;\r\n\r\n /**\r\n * Creates an instance of a Power BI report page.\r\n * \r\n * @param {IReportNode} report\r\n * @param {string} name\r\n * @param {string} [displayName]\r\n */\r\n constructor(report: IReportNode, name: string, displayName?: string) {\r\n this.report = report;\r\n this.name = name;\r\n this.displayName = displayName;\r\n }\r\n\r\n /**\r\n * Gets all page level filters within the report.\r\n * \r\n * ```javascript\r\n * page.getFilters()\r\n * .then(pages => { ... });\r\n * ```\r\n * \r\n * @returns {(Promise)}\r\n */\r\n getFilters(): Promise {\r\n return this.report.service.hpm.get(`/report/pages/${this.name}/filters`, { uid: this.report.config.uniqueId }, this.report.iframe.contentWindow)\r\n .then(response => response.body,\r\n response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Removes all filters from this page of the report.\r\n * \r\n * ```javascript\r\n * page.removeFilters();\r\n * ```\r\n * \r\n * @returns {Promise}\r\n */\r\n removeFilters(): Promise {\r\n return this.setFilters([]);\r\n }\r\n\r\n /**\r\n * Makes the current page the active page of the report.\r\n * \r\n * ```javascripot\r\n * page.setActive();\r\n * ```\r\n * \r\n * @returns {Promise}\r\n */\r\n setActive(): Promise {\r\n const page: models.IPage = {\r\n name: this.name,\r\n displayName: null\r\n };\r\n\r\n return this.report.service.hpm.put('/report/pages/active', page, { uid: this.report.config.uniqueId }, this.report.iframe.contentWindow)\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Sets all filters on the current page.\r\n * \r\n * ```javascript\r\n * page.setFilters(filters);\r\n * .catch(errors => { ... });\r\n * ```\r\n * \r\n * @param {(models.IFilter[])} filters\r\n * @returns {Promise}\r\n */\r\n setFilters(filters: models.IFilter[]): Promise {\r\n return this.report.service.hpm.put(`/report/pages/${this.name}/filters`, filters, { uid: this.report.config.uniqueId }, this.report.iframe.contentWindow)\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/page.ts","import * as service from './service';\r\nimport * as models from 'powerbi-models';\r\nimport * as embed from './embed';\r\n\r\nexport class Create extends embed.Embed {\r\n\r\n constructor(service: service.Service, element: HTMLElement, config: embed.IEmbedConfiguration) {\r\n super(service, element, config);\r\n }\r\n\r\n /**\r\n * Gets the dataset ID from the first available location: createConfig or embed url.\r\n * \r\n * @returns {string}\r\n */\r\n getId(): string {\r\n const datasetId = (this.createConfig && this.createConfig.datasetId) ? this.createConfig.datasetId : Create.findIdFromEmbedUrl(this.config.embedUrl);\r\n\r\n if (typeof datasetId !== 'string' || datasetId.length === 0) {\r\n throw new Error('Dataset id is required, but it was not found. You must provide an id either as part of embed configuration.');\r\n }\r\n\r\n return datasetId;\r\n }\r\n\r\n /**\r\n * Validate create report configuration.\r\n */\r\n validate(config: models.IReportCreateConfiguration): models.IError[] {\r\n return models.validateCreateReport(config);\r\n }\r\n\r\n /**\r\n * Adds the ability to get datasetId from url. \r\n * (e.g. http://embedded.powerbi.com/appTokenReportEmbed?datasetId=854846ed-2106-4dc2-bc58-eb77533bf2f1).\r\n * \r\n * By extracting the ID we can ensure that the ID is always explicitly provided as part of the create configuration.\r\n * \r\n * @static\r\n * @param {string} url\r\n * @returns {string}\r\n */\r\n static findIdFromEmbedUrl(url: string): string {\r\n const datasetIdRegEx = /datasetId=\"?([^&]+)\"?/\r\n const datasetIdMatch = url.match(datasetIdRegEx);\r\n\r\n let datasetId;\r\n if (datasetIdMatch) {\r\n datasetId = datasetIdMatch[1];\r\n }\r\n\r\n return datasetId;\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/create.ts","import * as service from './service';\r\nimport * as embed from './embed';\r\nimport * as models from 'powerbi-models';\r\nimport * as wpmp from 'window-post-message-proxy';\r\nimport * as hpm from 'http-post-message';\r\nimport * as utils from './util';\r\n\r\n/**\r\n * A Dashboard node within a dashboard hierarchy\r\n * \r\n * @export\r\n * @interface IDashboardNode\r\n */\r\nexport interface IDashboardNode {\r\n iframe: HTMLIFrameElement;\r\n service: service.IService;\r\n config: embed.IInternalEmbedConfiguration\r\n}\r\n\r\n/**\r\n * A Power BI Dashboard embed component\r\n * \r\n * @export\r\n * @class Dashboard\r\n * @extends {embed.Embed}\r\n * @implements {IDashboardNode}\r\n * @implements {IFilterable}\r\n */\r\nexport class Dashboard extends embed.Embed implements IDashboardNode {\r\n static allowedEvents = [\"tileClicked\", \"error\"];\r\n static dashboardIdAttribute = 'powerbi-dashboard-id';\r\n static typeAttribute = 'powerbi-type';\r\n static type = \"Dashboard\";\r\n\r\n /**\r\n * Creates an instance of a Power BI Dashboard.\r\n * \r\n * @param {service.Service} service\r\n * @param {HTMLElement} element\r\n */\r\n constructor(service: service.Service, element: HTMLElement, config: embed.IEmbedConfiguration) {\r\n super(service, element, config);\r\n this.loadPath = \"/dashboard/load\";\r\n Array.prototype.push.apply(this.allowedEvents, Dashboard.allowedEvents);\r\n }\r\n\r\n /**\r\n * This adds backwards compatibility for older config which used the dashboardId query param to specify dashboard id.\r\n * E.g. https://powerbi-df.analysis-df.windows.net/dashboardEmbedHost?dashboardId=e9363c62-edb6-4eac-92d3-2199c5ca2a9e\r\n * \r\n * By extracting the id we can ensure id is always explicitly provided as part of the load configuration.\r\n * \r\n * @static\r\n * @param {string} url\r\n * @returns {string}\r\n */\r\n static findIdFromEmbedUrl(url: string): string {\r\n const dashboardIdRegEx = /dashboardId=\"?([^&]+)\"?/\r\n const dashboardIdMatch = url.match(dashboardIdRegEx);\r\n\r\n let dashboardId;\r\n if (dashboardIdMatch) {\r\n dashboardId = dashboardIdMatch[1];\r\n }\r\n\r\n return dashboardId;\r\n }\r\n\r\n /**\r\n * Get dashboard id from first available location: options, attribute, embed url.\r\n * \r\n * @returns {string}\r\n */\r\n getId(): string {\r\n const dashboardId = this.config.id || this.element.getAttribute(Dashboard.dashboardIdAttribute) || Dashboard.findIdFromEmbedUrl(this.config.embedUrl);\r\n\r\n if (typeof dashboardId !== 'string' || dashboardId.length === 0) {\r\n throw new Error(`Dashboard id is required, but it was not found. You must provide an id either as part of embed configuration or as attribute '${Dashboard.dashboardIdAttribute}'.`);\r\n }\r\n\r\n return dashboardId;\r\n }\r\n\r\n /**\r\n * Validate load configuration.\r\n */\r\n validate(config: models.IDashboardLoadConfiguration): models.IError[] {\r\n let error = models.validateDashboardLoad(config);\r\n return error ? error : this.ValidatePageView(config.pageView);\r\n }\r\n \r\n /**\r\n * Validate that pageView has a legal value: if page view is defined it must have one of the values defined in models.PageView\r\n */\r\n private ValidatePageView(pageView: models.PageView): models.IError[] {\r\n if (pageView && pageView !== \"fitToWidth\" && pageView !== \"oneColumn\" && pageView !== \"actualSize\") {\r\n return [{message: \"pageView must be one of the followings: fitToWidth, oneColumn, actualSize\"}];\r\n }\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/dashboard.ts","import * as models from 'powerbi-models';\r\nimport { Embed } from './embed';\r\n\r\n/**\r\n * The Power BI tile embed component\r\n * \r\n * @export\r\n * @class Tile\r\n * @extends {Embed}\r\n */\r\nexport class Tile extends Embed {\r\n static type = \"Tile\";\r\n\r\n /**\r\n * The ID of the tile\r\n * \r\n * @returns {string}\r\n */\r\n getId(): string {\r\n throw new Error('Not implemented. Embedding tiles is not supported yet.');\r\n }\r\n\r\n /**\r\n * Validate load configuration.\r\n */\r\n validate(config: any): models.IError[] {\r\n throw new Error('Not implemented. Embedding tiles is not supported yet.');\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/tile.ts","/**\r\n * TODO: Need to find better place for these factory functions or refactor how we handle dependency injection\r\n */\r\nimport { IHpmFactory, IWpmpFactory, IRouterFactory } from './service';\r\nimport config from './config';\r\nimport * as wpmp from 'window-post-message-proxy';\r\nimport * as hpm from 'http-post-message';\r\nimport * as router from 'powerbi-router';\r\n\r\nexport {\r\n IHpmFactory,\r\n IWpmpFactory,\r\n IRouterFactory\r\n};\r\n\r\nexport const hpmFactory: IHpmFactory = (wpmp, defaultTargetWindow, sdkVersion = config.version, sdkType = config.type) => {\r\n return new hpm.HttpPostMessage(wpmp, {\r\n 'x-sdk-type': sdkType,\r\n 'x-sdk-version': sdkVersion\r\n }, defaultTargetWindow);\r\n};\r\n\r\nexport const wpmpFactory: IWpmpFactory = (name?: string, logMessages?: boolean, eventSourceOverrideWindow?: Window) => {\r\n return new wpmp.WindowPostMessageProxy({\r\n processTrackingProperties: {\r\n addTrackingProperties: hpm.HttpPostMessage.addTrackingProperties,\r\n getTrackingProperties: hpm.HttpPostMessage.getTrackingProperties,\r\n },\r\n isErrorMessage: hpm.HttpPostMessage.isErrorMessage,\r\n name,\r\n logMessages,\r\n eventSourceOverrideWindow\r\n });\r\n};\r\n\r\nexport const routerFactory: IRouterFactory = (wpmp) => {\r\n return new router.Router(wpmp);\r\n};\n\n\n// WEBPACK FOOTER //\n// ./src/factories.ts","const config = {\r\n version: '2.2.3',\r\n type: 'js'\r\n};\r\n\r\nexport default config;\n\n\n// WEBPACK FOOTER //\n// ./src/config.ts","/*! window-post-message-proxy v0.2.4 | (c) 2016 Microsoft Corporation MIT */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"window-post-message-proxy\"] = factory();\n\telse\n\t\troot[\"window-post-message-proxy\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\tvar WindowPostMessageProxy = (function () {\n\t function WindowPostMessageProxy(options) {\n\t var _this = this;\n\t if (options === void 0) { options = {\n\t processTrackingProperties: {\n\t addTrackingProperties: WindowPostMessageProxy.defaultAddTrackingProperties,\n\t getTrackingProperties: WindowPostMessageProxy.defaultGetTrackingProperties\n\t },\n\t isErrorMessage: WindowPostMessageProxy.defaultIsErrorMessage,\n\t receiveWindow: window,\n\t name: WindowPostMessageProxy.createRandomString()\n\t }; }\n\t this.pendingRequestPromises = {};\n\t // save options with defaults\n\t this.addTrackingProperties = (options.processTrackingProperties && options.processTrackingProperties.addTrackingProperties) || WindowPostMessageProxy.defaultAddTrackingProperties;\n\t this.getTrackingProperties = (options.processTrackingProperties && options.processTrackingProperties.getTrackingProperties) || WindowPostMessageProxy.defaultGetTrackingProperties;\n\t this.isErrorMessage = options.isErrorMessage || WindowPostMessageProxy.defaultIsErrorMessage;\n\t this.receiveWindow = options.receiveWindow || window;\n\t this.name = options.name || WindowPostMessageProxy.createRandomString();\n\t this.logMessages = options.logMessages || false;\n\t this.eventSourceOverrideWindow = options.eventSourceOverrideWindow;\n\t this.suppressWarnings = options.suppressWarnings || false;\n\t if (this.logMessages) {\n\t console.log(\"new WindowPostMessageProxy created with name: \" + this.name + \" receiving on window: \" + this.receiveWindow.document.title);\n\t }\n\t // Initialize\n\t this.handlers = [];\n\t this.windowMessageHandler = function (event) { return _this.onMessageReceived(event); };\n\t this.start();\n\t }\n\t // Static\n\t WindowPostMessageProxy.defaultAddTrackingProperties = function (message, trackingProperties) {\n\t message[WindowPostMessageProxy.messagePropertyName] = trackingProperties;\n\t return message;\n\t };\n\t WindowPostMessageProxy.defaultGetTrackingProperties = function (message) {\n\t return message[WindowPostMessageProxy.messagePropertyName];\n\t };\n\t WindowPostMessageProxy.defaultIsErrorMessage = function (message) {\n\t return !!message.error;\n\t };\n\t /**\n\t * Utility to create a deferred object.\n\t */\n\t // TODO: Look to use RSVP library instead of doing this manually.\n\t // From what I searched RSVP would work better because it has .finally and .deferred; however, it doesn't have Typings information. \n\t WindowPostMessageProxy.createDeferred = function () {\n\t var deferred = {\n\t resolve: null,\n\t reject: null,\n\t promise: null\n\t };\n\t var promise = new Promise(function (resolve, reject) {\n\t deferred.resolve = resolve;\n\t deferred.reject = reject;\n\t });\n\t deferred.promise = promise;\n\t return deferred;\n\t };\n\t /**\n\t * Utility to generate random sequence of characters used as tracking id for promises.\n\t */\n\t WindowPostMessageProxy.createRandomString = function () {\n\t return (Math.random() + 1).toString(36).substring(7);\n\t };\n\t /**\n\t * Adds handler.\n\t * If the first handler whose test method returns true will handle the message and provide a response.\n\t */\n\t WindowPostMessageProxy.prototype.addHandler = function (handler) {\n\t this.handlers.push(handler);\n\t };\n\t /**\n\t * Removes handler.\n\t * The reference must match the original object that was provided when adding the handler.\n\t */\n\t WindowPostMessageProxy.prototype.removeHandler = function (handler) {\n\t var handlerIndex = this.handlers.indexOf(handler);\n\t if (handlerIndex === -1) {\n\t throw new Error(\"You attempted to remove a handler but no matching handler was found.\");\n\t }\n\t this.handlers.splice(handlerIndex, 1);\n\t };\n\t /**\n\t * Start listening to message events.\n\t */\n\t WindowPostMessageProxy.prototype.start = function () {\n\t this.receiveWindow.addEventListener('message', this.windowMessageHandler);\n\t };\n\t /**\n\t * Stops listening to message events.\n\t */\n\t WindowPostMessageProxy.prototype.stop = function () {\n\t this.receiveWindow.removeEventListener('message', this.windowMessageHandler);\n\t };\n\t /**\n\t * Post message to target window with tracking properties added and save deferred object referenced by tracking id.\n\t */\n\t WindowPostMessageProxy.prototype.postMessage = function (targetWindow, message) {\n\t // Add tracking properties to indicate message came from this proxy\n\t var trackingProperties = { id: WindowPostMessageProxy.createRandomString() };\n\t this.addTrackingProperties(message, trackingProperties);\n\t if (this.logMessages) {\n\t console.log(this.name + \" Posting message:\");\n\t console.log(JSON.stringify(message, null, ' '));\n\t }\n\t targetWindow.postMessage(message, \"*\");\n\t var deferred = WindowPostMessageProxy.createDeferred();\n\t this.pendingRequestPromises[trackingProperties.id] = deferred;\n\t return deferred.promise;\n\t };\n\t /**\n\t * Send response message to target window.\n\t * Response messages re-use tracking properties from a previous request message.\n\t */\n\t WindowPostMessageProxy.prototype.sendResponse = function (targetWindow, message, trackingProperties) {\n\t this.addTrackingProperties(message, trackingProperties);\n\t if (this.logMessages) {\n\t console.log(this.name + \" Sending response:\");\n\t console.log(JSON.stringify(message, null, ' '));\n\t }\n\t targetWindow.postMessage(message, \"*\");\n\t };\n\t /**\n\t * Message handler.\n\t */\n\t WindowPostMessageProxy.prototype.onMessageReceived = function (event) {\n\t var _this = this;\n\t if (this.logMessages) {\n\t console.log(this.name + \" Received message:\");\n\t console.log(\"type: \" + event.type);\n\t console.log(JSON.stringify(event.data, null, ' '));\n\t }\n\t var sendingWindow = this.eventSourceOverrideWindow || event.source;\n\t var message = event.data;\n\t if (typeof message !== \"object\") {\n\t if (!this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + this.name + \"): Received message that was not an object. Discarding message\");\n\t }\n\t return;\n\t }\n\t var trackingProperties;\n\t try {\n\t trackingProperties = this.getTrackingProperties(message);\n\t }\n\t catch (e) {\n\t if (!this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + this.name + \"): Error occurred when attempting to get tracking properties from incoming message:\", JSON.stringify(message, null, ' '), \"Error: \", e);\n\t }\n\t }\n\t var deferred;\n\t if (trackingProperties) {\n\t deferred = this.pendingRequestPromises[trackingProperties.id];\n\t }\n\t // If message does not have a known ID, treat it as a request\n\t // Otherwise, treat message as response\n\t if (!deferred) {\n\t var handled = this.handlers.some(function (handler) {\n\t var canMessageBeHandled = false;\n\t try {\n\t canMessageBeHandled = handler.test(message);\n\t }\n\t catch (e) {\n\t if (!_this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + _this.name + \"): Error occurred when handler was testing incoming message:\", JSON.stringify(message, null, ' '), \"Error: \", e);\n\t }\n\t }\n\t if (canMessageBeHandled) {\n\t var responseMessagePromise = void 0;\n\t try {\n\t responseMessagePromise = Promise.resolve(handler.handle(message));\n\t }\n\t catch (e) {\n\t if (!_this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + _this.name + \"): Error occurred when handler was processing incoming message:\", JSON.stringify(message, null, ' '), \"Error: \", e);\n\t }\n\t responseMessagePromise = Promise.resolve();\n\t }\n\t responseMessagePromise\n\t .then(function (responseMessage) {\n\t if (!responseMessage) {\n\t var warningMessage = \"Handler for message: \" + JSON.stringify(message, null, ' ') + \" did not return a response message. The default response message will be returned instead.\";\n\t if (!_this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + _this.name + \"): \" + warningMessage);\n\t }\n\t responseMessage = {\n\t warning: warningMessage\n\t };\n\t }\n\t _this.sendResponse(sendingWindow, responseMessage, trackingProperties);\n\t });\n\t return true;\n\t }\n\t });\n\t /**\n\t * TODO: Consider returning an error message if nothing handled the message.\n\t * In the case of the Report receiving messages all of them should be handled,\n\t * however, in the case of the SDK receiving messages it's likely it won't register handlers\n\t * for all events. Perhaps make this an option at construction time.\n\t */\n\t if (!handled && !this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + this.name + \") did not handle message. Handlers: \" + this.handlers.length + \" Message: \" + JSON.stringify(message, null, '') + \".\");\n\t }\n\t }\n\t else {\n\t /**\n\t * If error message reject promise,\n\t * Otherwise, resolve promise\n\t */\n\t var isErrorMessage = true;\n\t try {\n\t isErrorMessage = this.isErrorMessage(message);\n\t }\n\t catch (e) {\n\t console.warn(\"Proxy(\" + this.name + \") Error occurred when trying to determine if message is consider an error response. Message: \", JSON.stringify(message, null, ''), 'Error: ', e);\n\t }\n\t if (isErrorMessage) {\n\t deferred.reject(message);\n\t }\n\t else {\n\t deferred.resolve(message);\n\t }\n\t // TODO: Move to .finally clause up where promise is created for better maitenance like original proxy code.\n\t delete this.pendingRequestPromises[trackingProperties.id];\n\t }\n\t };\n\t WindowPostMessageProxy.messagePropertyName = \"windowPostMessageProxy\";\n\t return WindowPostMessageProxy;\n\t}());\n\texports.WindowPostMessageProxy = WindowPostMessageProxy;\n\n\n/***/ }\n/******/ ])\n});\n;\n//# sourceMappingURL=windowPostMessageProxy.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/window-post-message-proxy/dist/windowPostMessageProxy.js\n// module id = 12\n// module chunks = 0","/*! http-post-message v0.2.3 | (c) 2016 Microsoft Corporation MIT */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"http-post-message\"] = factory();\n\telse\n\t\troot[\"http-post-message\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\tvar HttpPostMessage = (function () {\n\t function HttpPostMessage(windowPostMessageProxy, defaultHeaders, defaultTargetWindow) {\n\t if (defaultHeaders === void 0) { defaultHeaders = {}; }\n\t this.defaultHeaders = defaultHeaders;\n\t this.defaultTargetWindow = defaultTargetWindow;\n\t this.windowPostMessageProxy = windowPostMessageProxy;\n\t }\n\t // TODO: See if it's possible to share tracking properties interface?\n\t // The responsibility of knowing how to configure windowPostMessageProxy for http should\n\t // live in this http class, but the configuration would need ITrackingProperties\n\t // interface which lives in WindowPostMessageProxy. Use type as workaround\n\t HttpPostMessage.addTrackingProperties = function (message, trackingProperties) {\n\t message.headers = message.headers || {};\n\t if (trackingProperties && trackingProperties.id) {\n\t message.headers.id = trackingProperties.id;\n\t }\n\t return message;\n\t };\n\t HttpPostMessage.getTrackingProperties = function (message) {\n\t return {\n\t id: message.headers && message.headers.id\n\t };\n\t };\n\t HttpPostMessage.isErrorMessage = function (message) {\n\t if (typeof (message && message.statusCode) !== 'number') {\n\t return false;\n\t }\n\t return !(200 <= message.statusCode && message.statusCode < 300);\n\t };\n\t HttpPostMessage.prototype.get = function (url, headers, targetWindow) {\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"GET\",\n\t url: url,\n\t headers: headers\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.post = function (url, body, headers, targetWindow) {\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"POST\",\n\t url: url,\n\t headers: headers,\n\t body: body\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.put = function (url, body, headers, targetWindow) {\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"PUT\",\n\t url: url,\n\t headers: headers,\n\t body: body\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.patch = function (url, body, headers, targetWindow) {\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"PATCH\",\n\t url: url,\n\t headers: headers,\n\t body: body\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.delete = function (url, body, headers, targetWindow) {\n\t if (body === void 0) { body = null; }\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"DELETE\",\n\t url: url,\n\t headers: headers,\n\t body: body\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.send = function (request, targetWindow) {\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t request.headers = this.assign({}, this.defaultHeaders, request.headers);\n\t if (!targetWindow) {\n\t throw new Error(\"target window is not provided. You must either provide the target window explicitly as argument to request, or specify default target window when constructing instance of this class.\");\n\t }\n\t return this.windowPostMessageProxy.postMessage(targetWindow, request);\n\t };\n\t /**\n\t * Object.assign() polyfill\n\t * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\n\t */\n\t HttpPostMessage.prototype.assign = function (target) {\n\t var sources = [];\n\t for (var _i = 1; _i < arguments.length; _i++) {\n\t sources[_i - 1] = arguments[_i];\n\t }\n\t if (target === undefined || target === null) {\n\t throw new TypeError('Cannot convert undefined or null to object');\n\t }\n\t var output = Object(target);\n\t sources.forEach(function (source) {\n\t if (source !== undefined && source !== null) {\n\t for (var nextKey in source) {\n\t if (Object.prototype.hasOwnProperty.call(source, nextKey)) {\n\t output[nextKey] = source[nextKey];\n\t }\n\t }\n\t }\n\t });\n\t return output;\n\t };\n\t return HttpPostMessage;\n\t}());\n\texports.HttpPostMessage = HttpPostMessage;\n\n\n/***/ }\n/******/ ])\n});\n;\n//# sourceMappingURL=httpPostMessage.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/http-post-message/dist/httpPostMessage.js\n// module id = 13\n// module chunks = 0","/*! powerbi-router v0.1.5 | (c) 2016 Microsoft Corporation MIT */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"powerbi-router\"] = factory();\n\telse\n\t\troot[\"powerbi-router\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar RouteRecognizer = __webpack_require__(1);\n\tvar Router = (function () {\n\t function Router(handlers) {\n\t this.handlers = handlers;\n\t /**\n\t * TODO: look at generating the router dynamically based on list of supported http methods\n\t * instead of hardcoding the creation of these and the methods.\n\t */\n\t this.getRouteRecognizer = new RouteRecognizer();\n\t this.patchRouteRecognizer = new RouteRecognizer();\n\t this.postRouteRecognizer = new RouteRecognizer();\n\t this.putRouteRecognizer = new RouteRecognizer();\n\t this.deleteRouteRecognizer = new RouteRecognizer();\n\t }\n\t Router.prototype.get = function (url, handler) {\n\t this.registerHandler(this.getRouteRecognizer, \"GET\", url, handler);\n\t return this;\n\t };\n\t Router.prototype.patch = function (url, handler) {\n\t this.registerHandler(this.patchRouteRecognizer, \"PATCH\", url, handler);\n\t return this;\n\t };\n\t Router.prototype.post = function (url, handler) {\n\t this.registerHandler(this.postRouteRecognizer, \"POST\", url, handler);\n\t return this;\n\t };\n\t Router.prototype.put = function (url, handler) {\n\t this.registerHandler(this.putRouteRecognizer, \"PUT\", url, handler);\n\t return this;\n\t };\n\t Router.prototype.delete = function (url, handler) {\n\t this.registerHandler(this.deleteRouteRecognizer, \"DELETE\", url, handler);\n\t return this;\n\t };\n\t /**\n\t * TODO: This method could use some refactoring. There is conflict of interest between keeping clean separation of test and handle method\n\t * Test method only returns boolean indicating if request can be handled, and handle method has opportunity to modify response and return promise of it.\n\t * In the case of the router with route-recognizer where handlers are associated with routes, this already guarantees that only one handler is selected and makes the test method feel complicated\n\t * Will leave as is an investigate cleaner ways at later time.\n\t */\n\t Router.prototype.registerHandler = function (routeRecognizer, method, url, handler) {\n\t var routeRecognizerHandler = function (request) {\n\t var response = new Response();\n\t return Promise.resolve(handler(request, response))\n\t .then(function (x) { return response; });\n\t };\n\t routeRecognizer.add([\n\t { path: url, handler: routeRecognizerHandler }\n\t ]);\n\t var internalHandler = {\n\t test: function (request) {\n\t if (request.method !== method) {\n\t return false;\n\t }\n\t var matchingRoutes = routeRecognizer.recognize(request.url);\n\t if (matchingRoutes === undefined) {\n\t return false;\n\t }\n\t /**\n\t * Copy parameters from recognized route to the request so they can be used within the handler function\n\t * This isn't ideal because it is side affect which modifies the request instead of strictly testing for true or false\n\t * but I don't see a better place to put this. If we move it between the call to test and the handle it becomes part of the window post message proxy\n\t * even though it's responsibility is related to routing.\n\t */\n\t var route = matchingRoutes[0];\n\t request.params = route.params;\n\t request.queryParams = matchingRoutes.queryParams;\n\t request.handler = route.handler;\n\t return true;\n\t },\n\t handle: function (request) {\n\t return request.handler(request);\n\t }\n\t };\n\t this.handlers.addHandler(internalHandler);\n\t };\n\t return Router;\n\t}());\n\texports.Router = Router;\n\tvar Response = (function () {\n\t function Response() {\n\t this.statusCode = 200;\n\t this.headers = {};\n\t this.body = null;\n\t }\n\t Response.prototype.send = function (statusCode, body) {\n\t this.statusCode = statusCode;\n\t this.body = body;\n\t };\n\t return Response;\n\t}());\n\texports.Response = Response;\n\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(module) {(function() {\n\t \"use strict\";\n\t function $$route$recognizer$dsl$$Target(path, matcher, delegate) {\n\t this.path = path;\n\t this.matcher = matcher;\n\t this.delegate = delegate;\n\t }\n\t\n\t $$route$recognizer$dsl$$Target.prototype = {\n\t to: function(target, callback) {\n\t var delegate = this.delegate;\n\t\n\t if (delegate && delegate.willAddRoute) {\n\t target = delegate.willAddRoute(this.matcher.target, target);\n\t }\n\t\n\t this.matcher.add(this.path, target);\n\t\n\t if (callback) {\n\t if (callback.length === 0) { throw new Error(\"You must have an argument in the function passed to `to`\"); }\n\t this.matcher.addChild(this.path, target, callback, this.delegate);\n\t }\n\t return this;\n\t }\n\t };\n\t\n\t function $$route$recognizer$dsl$$Matcher(target) {\n\t this.routes = {};\n\t this.children = {};\n\t this.target = target;\n\t }\n\t\n\t $$route$recognizer$dsl$$Matcher.prototype = {\n\t add: function(path, handler) {\n\t this.routes[path] = handler;\n\t },\n\t\n\t addChild: function(path, target, callback, delegate) {\n\t var matcher = new $$route$recognizer$dsl$$Matcher(target);\n\t this.children[path] = matcher;\n\t\n\t var match = $$route$recognizer$dsl$$generateMatch(path, matcher, delegate);\n\t\n\t if (delegate && delegate.contextEntered) {\n\t delegate.contextEntered(target, match);\n\t }\n\t\n\t callback(match);\n\t }\n\t };\n\t\n\t function $$route$recognizer$dsl$$generateMatch(startingPath, matcher, delegate) {\n\t return function(path, nestedCallback) {\n\t var fullPath = startingPath + path;\n\t\n\t if (nestedCallback) {\n\t nestedCallback($$route$recognizer$dsl$$generateMatch(fullPath, matcher, delegate));\n\t } else {\n\t return new $$route$recognizer$dsl$$Target(startingPath + path, matcher, delegate);\n\t }\n\t };\n\t }\n\t\n\t function $$route$recognizer$dsl$$addRoute(routeArray, path, handler) {\n\t var len = 0;\n\t for (var i=0; i z`. For instance, \"199\" is smaller\n\t // then \"200\", even though \"y\" and \"z\" (which are both 9) are larger than \"0\" (the value\n\t // of (`b` and `c`). This is because the leading symbol, \"2\", is larger than the other\n\t // leading symbol, \"1\".\n\t // The rule is that symbols to the left carry more weight than symbols to the right\n\t // when a number is written out as a string. In the above strings, the leading digit\n\t // represents how many 100's are in the number, and it carries more weight than the middle\n\t // number which represents how many 10's are in the number.\n\t // This system of number magnitude works well for route specificity, too. A route written as\n\t // `a/b/c` will be more specific than `x/y/z` as long as `a` is more specific than\n\t // `x`, irrespective of the other parts.\n\t // Because of this similarity, we assign each type of segment a number value written as a\n\t // string. We can find the specificity of compound routes by concatenating these strings\n\t // together, from left to right. After we have looped through all of the segments,\n\t // we convert the string to a number.\n\t specificity.val = '';\n\t\n\t for (var i=0; i 2 && key.slice(keyLength -2) === '[]') {\n\t isArray = true;\n\t key = key.slice(0, keyLength - 2);\n\t if(!queryParams[key]) {\n\t queryParams[key] = [];\n\t }\n\t }\n\t value = pair[1] ? $$route$recognizer$$decodeQueryParamPart(pair[1]) : '';\n\t }\n\t if (isArray) {\n\t queryParams[key].push(value);\n\t } else {\n\t queryParams[key] = value;\n\t }\n\t }\n\t return queryParams;\n\t },\n\t\n\t recognize: function(path) {\n\t var states = [ this.rootState ],\n\t pathLen, i, l, queryStart, queryParams = {},\n\t isSlashDropped = false;\n\t\n\t queryStart = path.indexOf('?');\n\t if (queryStart !== -1) {\n\t var queryString = path.substr(queryStart + 1, path.length);\n\t path = path.substr(0, queryStart);\n\t queryParams = this.parseQueryString(queryString);\n\t }\n\t\n\t path = decodeURI(path);\n\t\n\t if (path.charAt(0) !== \"/\") { path = \"/\" + path; }\n\t\n\t pathLen = path.length;\n\t if (pathLen > 1 && path.charAt(pathLen - 1) === \"/\") {\n\t path = path.substr(0, pathLen - 1);\n\t isSlashDropped = true;\n\t }\n\t\n\t for (i=0; i {\n type: string;\n id: string;\n name: string;\n value: T;\n}\n\nexport interface ICustomEvent extends CustomEvent {\n detail: T;\n}\n\nexport interface IEventHandler {\n (event: ICustomEvent): any;\n}\n\nexport interface IHpmFactory {\n (wpmp: wpmp.WindowPostMessageProxy, targetWindow?: Window, version?: string, type?: string, origin?: string): hpm.HttpPostMessage;\n}\n\nexport interface IWpmpFactory {\n (name?: string, logMessages?: boolean, eventSourceOverrideWindow?: Window): wpmp.WindowPostMessageProxy;\n}\n\nexport interface IRouterFactory {\n (wpmp: wpmp.WindowPostMessageProxy): router.Router;\n}\n\nexport interface IPowerBiElement extends HTMLElement {\n powerBiEmbed: embed.Embed;\n}\n\nexport interface IDebugOptions {\n logMessages?: boolean;\n wpmpName?: string;\n}\n\nexport interface IServiceConfiguration extends IDebugOptions {\n autoEmbedOnContentLoaded?: boolean;\n onError?: (error: any) => any;\n version?: string;\n type?: string;\n}\n\nexport interface IService {\n hpm: hpm.HttpPostMessage;\n}\n\n/**\n * The Power BI Service embed component, which is the entry point to embed all other Power BI components into your application\n * \n * @export\n * @class Service\n * @implements {IService}\n */\nexport class Service implements IService {\n\n /**\n * A list of components that this service can embed\n */\n private static components: (typeof Report | typeof Tile | typeof Dashboard)[] = [\n Tile,\n Report,\n Dashboard\n ];\n\n /**\n * The default configuration for the service\n */\n private static defaultConfig: IServiceConfiguration = {\n autoEmbedOnContentLoaded: false,\n onError: (...args) => console.log(args[0], args.slice(1))\n };\n\n /**\n * Gets or sets the access token as the global fallback token to use when a local token is not provided for a report or tile.\n * \n * @type {string}\n */\n accessToken: string;\n\n /**The Configuration object for the service*/\n private config: IServiceConfiguration;\n\n /** A list of Dashboard, Report and Tile components that have been embedded using this service instance. */\n private embeds: embed.Embed[];\n /** TODO: Look for way to make hpm private without sacraficing ease of maitenance. This should be private but in embed needs to call methods. */\n hpm: hpm.HttpPostMessage;\n /** TODO: Look for way to make wpmp private. This is only public to allow stopping the wpmp in tests */\n wpmp: wpmp.WindowPostMessageProxy;\n private router: router.Router;\n\n /**\n * Creates an instance of a Power BI Service.\n * \n * @param {IHpmFactory} hpmFactory The http post message factory used in the postMessage communication layer\n * @param {IWpmpFactory} wpmpFactory The window post message factory used in the postMessage communication layer\n * @param {IRouterFactory} routerFactory The router factory used in the postMessage communication layer\n * @param {IServiceConfiguration} [config={}]\n */\n constructor(hpmFactory: IHpmFactory, wpmpFactory: IWpmpFactory, routerFactory: IRouterFactory, config: IServiceConfiguration = {}) {\n this.wpmp = wpmpFactory(config.wpmpName, config.logMessages);\n this.hpm = hpmFactory(this.wpmp, null, config.version, config.type);\n this.router = routerFactory(this.wpmp);\n\n /**\n * Adds handler for report events.\n */\n this.router.post(`/reports/:uniqueId/events/:eventName`, (req, res) => {\n const event: IEvent = {\n type: 'report',\n id: req.params.uniqueId,\n name: req.params.eventName,\n value: req.body\n };\n\n this.handleEvent(event);\n });\n this.router.post(`/reports/:uniqueId/pages/:pageName/events/:eventName`, (req, res) => {\n const event: IEvent = {\n type: 'report',\n id: req.params.uniqueId,\n name: req.params.eventName,\n value: req.body\n };\n\n this.handleEvent(event);\n });\n\n this.router.post(`/dashboards/:uniqueId/events/:eventName`, (req, res) => {\n const event: IEvent = {\n type: 'dashboard',\n id: req.params.uniqueId,\n name: req.params.eventName,\n value: req.body\n };\n\n this.handleEvent(event);\n });\n\n this.embeds = [];\n\n // TODO: Change when Object.assign is available.\n this.config = utils.assign({}, Service.defaultConfig, config);\n\n if (this.config.autoEmbedOnContentLoaded) {\n this.enableAutoEmbed();\n }\n }\n\n /**\n * Creates new report\n * @param {HTMLElement} element\n * @param {embed.IEmbedConfiguration} [config={}]\n * @returns {embed.Embed}\n */\n createReport(element: HTMLElement, config: embed.IEmbedConfiguration): embed.Embed {\n config.type = 'create';\n let powerBiElement = element;\n const component = new Create(this, powerBiElement, config);\n powerBiElement.powerBiEmbed = component;\n this.embeds.push(component);\n\n return component;\n }\n\n /**\n * TODO: Add a description here\n * \n * @param {HTMLElement} [container]\n * @param {embed.IEmbedConfiguration} [config=undefined]\n * @returns {embed.Embed[]}\n */\n init(container?: HTMLElement, config: embed.IEmbedConfiguration = undefined): embed.Embed[] {\n container = (container && container instanceof HTMLElement) ? container : document.body;\n\n const elements = Array.prototype.slice.call(container.querySelectorAll(`[${embed.Embed.embedUrlAttribute}]`));\n return elements.map(element => this.embed(element, config));\n }\n\n /**\n * Given a configuration based on an HTML element,\n * if the component has already been created and attached to the element, reuses the component instance and existing iframe,\n * otherwise creates a new component instance.\n * \n * @param {HTMLElement} element\n * @param {embed.IEmbedConfiguration} [config={}]\n * @returns {embed.Embed}\n */\n embed(element: HTMLElement, config: embed.IEmbedConfiguration = {}): embed.Embed {\n let component: embed.Embed;\n let powerBiElement = element;\n\n if (powerBiElement.powerBiEmbed) {\n component = this.embedExisting(powerBiElement, config);\n }\n else {\n component = this.embedNew(powerBiElement, config);\n }\n\n return component;\n }\n\n /**\n * Given a configuration based on a Power BI element, saves the component instance that reference the element for later lookup.\n * \n * @private\n * @param {IPowerBiElement} element\n * @param {embed.IEmbedConfiguration} config\n * @returns {embed.Embed}\n */\n private embedNew(element: IPowerBiElement, config: embed.IEmbedConfiguration): embed.Embed {\n const componentType = config.type || element.getAttribute(embed.Embed.typeAttribute);\n if (!componentType) {\n throw new Error(`Attempted to embed using config ${JSON.stringify(config)} on element ${element.outerHTML}, but could not determine what type of component to embed. You must specify a type in the configuration or as an attribute such as '${embed.Embed.typeAttribute}=\"${Report.type.toLowerCase()}\"'.`);\n }\n\n // Saves the type as part of the configuration so that it can be referenced later at a known location.\n config.type = componentType;\n\n const Component = utils.find(component => componentType === component.type.toLowerCase(), Service.components);\n if (!Component) {\n throw new Error(`Attempted to embed component of type: ${componentType} but did not find any matching component. Please verify the type you specified is intended.`);\n }\n\n const component = new Component(this, element, config);\n element.powerBiEmbed = component;\n this.embeds.push(component);\n\n return component;\n }\n\n /**\n * Given an element that already contains an embed component, load with a new configuration.\n * \n * @private\n * @param {IPowerBiElement} element\n * @param {embed.IEmbedConfiguration} config\n * @returns {embed.Embed}\n */\n private embedExisting(element: IPowerBiElement, config: embed.IEmbedConfiguration): embed.Embed {\n const component = utils.find(x => x.element === element, this.embeds);\n if (!component) {\n throw new Error(`Attempted to embed using config ${JSON.stringify(config)} on element ${element.outerHTML} which already has embedded comopnent associated, but could not find the existing comopnent in the list of active components. This could indicate the embeds list is out of sync with the DOM, or the component is referencing the incorrect HTML element.`);\n }\n\n /**\n * TODO: Dynamic embed type switching could be supported but there is work needed to prepare the service state and DOM cleanup.\n * remove all event handlers from the DOM, then reset the element to initial state which removes iframe, and removes from list of embeds\n * then we can call the embedNew function which would allow setting the proper embedUrl and construction of object based on the new type.\n */\n if (typeof config.type === \"string\" && config.type !== component.config.type) {\n\n /**\n * When loading report after create we want to use existing Iframe to optimize load period\n */\n if(config.type === \"report\" && component.config.type === \"create\") {\n const report = new Report(this, element, config, element.powerBiEmbed.iframe);\n report.load(config);\n element.powerBiEmbed = report;\n this.embeds.push(report);\n\n return report;\n }\n\n throw new Error(`Embedding on an existing element with a different type than the previous embed object is not supported. Attempted to embed using config ${JSON.stringify(config)} on element ${element.outerHTML}, but the existing element contains an embed of type: ${this.config.type} which does not match the new type: ${config.type}`);\n }\n\n component.load(config);\n\n return component;\n }\n\n /**\n * Adds an event handler for DOMContentLoaded, which searches the DOM for elements that have the 'powerbi-embed-url' attribute,\n * and automatically attempts to embed a powerbi component based on information from other powerbi-* attributes.\n *\n * Note: Only runs if `config.autoEmbedOnContentLoaded` is true when the service is created.\n * This handler is typically useful only for applications that are rendered on the server so that all required data is available when the handler is called.\n */\n enableAutoEmbed(): void {\n window.addEventListener('DOMContentLoaded', (event: Event) => this.init(document.body), false);\n }\n\n /**\n * Returns an instance of the component associated with the element.\n * \n * @param {HTMLElement} element\n * @returns {(Report | Tile)}\n */\n get(element: HTMLElement): Report | Tile | Dashboard {\n const powerBiElement = element;\n\n if (!powerBiElement.powerBiEmbed) {\n throw new Error(`You attempted to get an instance of powerbi component associated with element: ${element.outerHTML} but there was no associated instance.`);\n }\n\n return powerBiElement.powerBiEmbed;\n }\n\n /**\n * Finds an embed instance by the name or unique ID that is provided.\n * \n * @param {string} uniqueId\n * @returns {(Report | Tile)}\n */\n find(uniqueId: string): Report | Tile | Dashboard {\n return utils.find(x => x.config.uniqueId === uniqueId, this.embeds);\n }\n\n /**\n * Given an HTML element that has a component embedded within it, removes the component from the list of embedded components, removes the association between the element and the component, and removes the iframe.\n * \n * @param {HTMLElement} element\n * @returns {void}\n */\n reset(element: HTMLElement): void {\n const powerBiElement = element;\n\n if (!powerBiElement.powerBiEmbed) {\n return;\n }\n\n /** Removes the component from an internal list of components. */\n utils.remove(x => x === powerBiElement.powerBiEmbed, this.embeds);\n /** Deletes a property from the HTML element. */\n delete powerBiElement.powerBiEmbed;\n /** Removes the iframe from the element. */\n const iframe = element.querySelector('iframe');\n if (iframe) {\n iframe.remove();\n }\n }\n\n /**\n * Given an event object, finds the embed component with the matching type and ID, and invokes its handleEvent method with the event object.\n * \n * @private\n * @param {IEvent} event\n */\n private handleEvent(event: IEvent): void {\n const embed = utils.find(embed => {\n return (embed.config.uniqueId === event.id);\n }, this.embeds);\n\n if (embed) {\n const value = event.value;\n\n if (event.name === 'pageChanged') {\n const pageKey = 'newPage';\n const page: models.IPage = value[pageKey];\n if (!page) {\n throw new Error(`Page model not found at 'event.value.${pageKey}'.`);\n }\n value[pageKey] = new Page(embed, page.name, page.displayName);\n }\n\n utils.raiseCustomEvent(embed.element, event.name, value);\n }\n }\n}\n\n\n// WEBPACK FOOTER //\n// ./src/service.ts","import * as utils from './util';\r\nimport * as service from './service';\r\nimport * as models from 'powerbi-models';\r\nimport * as hpm from 'http-post-message';\r\n\r\ndeclare global {\r\n interface Document {\r\n // Mozilla Fullscreen\r\n mozCancelFullScreen: Function;\r\n\r\n // Ms Fullscreen\r\n msExitFullscreen: Function;\r\n }\r\n\r\n interface HTMLIFrameElement {\r\n // Mozilla Fullscreen\r\n mozRequestFullScreen: Function;\r\n\r\n // Ms Fullscreen\r\n msRequestFullscreen: Function;\r\n }\r\n}\r\n\r\n// TODO: Re-use ILoadConfiguration interface to prevent duplicating properties.\r\n// Current issue is that they are optional when embedding since they can be specificed as attributes but they are required when loading.\r\n/**\r\n * Configuration settings for Power BI embed components\r\n * \r\n * @export\r\n * @interface IEmbedConfiguration\r\n */\r\nexport interface IEmbedConfiguration {\r\n type?: string;\r\n id?: string;\r\n uniqueId?: string;\r\n embedUrl?: string;\r\n accessToken?: string;\r\n settings?: models.ISettings;\r\n pageName?: string;\r\n filters?: models.IFilter[];\r\n pageView?: models.PageView;\r\n datasetId?: string;\r\n permissions?: models.Permissions;\r\n viewMode?: models.ViewMode;\r\n}\r\n\r\nexport interface IInternalEmbedConfiguration extends models.IReportLoadConfiguration {\r\n uniqueId: string;\r\n type: string;\r\n embedUrl: string;\r\n}\r\n\r\nexport interface IInternalEventHandler {\r\n test(event: service.IEvent): boolean;\r\n handle(event: service.ICustomEvent): void;\r\n}\r\n\r\n/**\r\n * Base class for all Power BI embed components\r\n * \r\n * @export\r\n * @abstract\r\n * @class Embed\r\n */\r\nexport abstract class Embed {\r\n static allowedEvents = [\"loaded\", \"saved\", \"rendered\", \"saveAsTriggered\", \"error\", \"dataSelected\"];\r\n static accessTokenAttribute = 'powerbi-access-token';\r\n static embedUrlAttribute = 'powerbi-embed-url';\r\n static nameAttribute = 'powerbi-name';\r\n static typeAttribute = 'powerbi-type';\r\n static type: string;\r\n\r\n private static defaultSettings: models.ISettings = {\r\n filterPaneEnabled: true\r\n };\r\n\r\n allowedEvents = [];\r\n\r\n /**\r\n * Gets or sets the event handler registered for this embed component.\r\n * \r\n * @type {IInternalEventHandler[]}\r\n */\r\n eventHandlers: IInternalEventHandler[];\r\n\r\n /**\r\n * Gets or sets the Power BI embed service.\r\n * \r\n * @type {service.Service}\r\n */\r\n service: service.Service;\r\n\r\n /**\r\n * Gets or sets the HTML element that contains the Power BI embed component.\r\n * \r\n * @type {HTMLElement}\r\n */\r\n element: HTMLElement;\r\n\r\n /**\r\n * Gets or sets the HTML iframe element that renders the Power BI embed component.\r\n * \r\n * @type {HTMLIFrameElement}\r\n */\r\n iframe: HTMLIFrameElement;\r\n\r\n /**\r\n * Gets or sets the configuration settings for the Power BI embed component.\r\n * \r\n * @type {IInternalEmbedConfiguration}\r\n */\r\n config: IInternalEmbedConfiguration;\r\n\r\n /**\r\n * Gets or sets the configuration settings for creating report.\r\n * \r\n * @type {models.IReportCreateConfiguration}\r\n */\r\n createConfig: models.IReportCreateConfiguration;\r\n\r\n /**\r\n * Url used in the load request.\r\n */\r\n loadPath: string;\r\n\r\n /**\r\n * Type of embed\r\n */\r\n embeType: string;\r\n\r\n /**\r\n * Creates an instance of Embed.\r\n * \r\n * Note: there is circular reference between embeds and the service, because\r\n * the service has a list of all embeds on the host page, and each embed has a reference to the service that created it.\r\n * \r\n * @param {service.Service} service\r\n * @param {HTMLElement} element\r\n * @param {IEmbedConfiguration} config\r\n */\r\n constructor(service: service.Service, element: HTMLElement, config: IEmbedConfiguration, iframe?: HTMLIFrameElement) {\r\n Array.prototype.push.apply(this.allowedEvents, Embed.allowedEvents);\r\n this.eventHandlers = [];\r\n this.service = service;\r\n this.element = element;\r\n this.iframe = iframe;\r\n this.embeType = config.type.toLowerCase();\r\n\r\n this.populateConfig(config);\r\n \r\n if(this.embeType === 'create'){\r\n this.setIframe(false/*set EventListener to call create() on 'load' event*/);\r\n } else {\r\n this.setIframe(true/*set EventListener to call load() on 'load' event*/);\r\n }\r\n }\r\n\r\n /**\r\n * Sends createReport configuration data.\r\n * \r\n * ```javascript\r\n * createReport({\r\n * datasetId: '5dac7a4a-4452-46b3-99f6-a25915e0fe55',\r\n * accessToken: 'eyJ0eXA ... TaE2rTSbmg',\r\n * ```\r\n * \r\n * @param {models.IReportCreateConfiguration} config\r\n * @returns {Promise}\r\n */\r\n createReport(config: models.IReportCreateConfiguration): Promise {\r\n const errors = this.validate(config);\r\n if (errors) {\r\n throw errors;\r\n }\r\n \r\n return this.service.hpm.post(\"/report/create\", config, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n return response.body;\r\n },\r\n response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Saves Report.\r\n * \r\n * @returns {Promise}\r\n */\r\n save(): Promise {\r\n return this.service.hpm.post('/report/save', null, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n return response.body;\r\n })\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * SaveAs Report.\r\n * \r\n * @returns {Promise}\r\n */\r\n saveAs(saveAsParameters: models.ISaveAsParameters): Promise {\r\n return this.service.hpm.post('/report/saveAs', saveAsParameters, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n return response.body;\r\n })\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Sends load configuration data.\r\n * \r\n * ```javascript\r\n * report.load({\r\n * type: 'report',\r\n * id: '5dac7a4a-4452-46b3-99f6-a25915e0fe55',\r\n * accessToken: 'eyJ0eXA ... TaE2rTSbmg',\r\n * settings: {\r\n * navContentPaneEnabled: false\r\n * },\r\n * pageName: \"DefaultPage\",\r\n * filters: [\r\n * {\r\n * ... DefaultReportFilter ...\r\n * }\r\n * ]\r\n * })\r\n * .catch(error => { ... });\r\n * ```\r\n * \r\n * @param {models.ILoadConfiguration} config\r\n * @returns {Promise}\r\n */\r\n load(config: models.IReportLoadConfiguration | models.IDashboardLoadConfiguration): Promise {\r\n const errors = this.validate(config);\r\n if (errors) {\r\n throw errors;\r\n }\r\n\r\n return this.service.hpm.post(this.loadPath, config, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n utils.assign(this.config, config);\r\n return response.body;\r\n },\r\n response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Removes one or more event handlers from the list of handlers.\r\n * If a reference to the existing handle function is specified, remove the specific handler.\r\n * If the handler is not specified, remove all handlers for the event name specified.\r\n * \r\n * ```javascript\r\n * report.off('pageChanged')\r\n * \r\n * or \r\n * \r\n * const logHandler = function (event) {\r\n * console.log(event);\r\n * };\r\n * \r\n * report.off('pageChanged', logHandler);\r\n * ```\r\n * \r\n * @template T\r\n * @param {string} eventName\r\n * @param {service.IEventHandler} [handler]\r\n */\r\n off(eventName: string, handler?: service.IEventHandler): void {\r\n const fakeEvent: service.IEvent = { name: eventName, type: null, id: null, value: null };\r\n if (handler) {\r\n utils.remove(eventHandler => eventHandler.test(fakeEvent) && (eventHandler.handle === handler), this.eventHandlers);\r\n this.element.removeEventListener(eventName, handler);\r\n }\r\n else {\r\n const eventHandlersToRemove = this.eventHandlers\r\n .filter(eventHandler => eventHandler.test(fakeEvent));\r\n\r\n eventHandlersToRemove\r\n .forEach(eventHandlerToRemove => {\r\n utils.remove(eventHandler => eventHandler === eventHandlerToRemove, this.eventHandlers);\r\n this.element.removeEventListener(eventName, eventHandlerToRemove.handle);\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Adds an event handler for a specific event.\r\n * \r\n * ```javascript\r\n * report.on('pageChanged', (event) => {\r\n * console.log('PageChanged: ', event.page.name);\r\n * });\r\n * ```\r\n * \r\n * @template T\r\n * @param {string} eventName\r\n * @param {service.IEventHandler} handler\r\n */\r\n on(eventName: string, handler: service.IEventHandler): void {\r\n if (this.allowedEvents.indexOf(eventName) === -1) {\r\n throw new Error(`eventName is must be one of ${this.allowedEvents}. You passed: ${eventName}`);\r\n }\r\n\r\n this.eventHandlers.push({\r\n test: (event: service.IEvent) => event.name === eventName,\r\n handle: handler\r\n });\r\n\r\n this.element.addEventListener(eventName, handler)\r\n }\r\n\r\n /**\r\n * Reloads embed using existing configuration.\r\n * E.g. For reports this effectively clears all filters and makes the first page active which simulates resetting a report back to loaded state.\r\n * \r\n * ```javascript\r\n * report.reload();\r\n * ```\r\n */\r\n reload(): Promise {\r\n return this.load(this.config);\r\n }\r\n \r\n /**\r\n * Set accessToken.\r\n * \r\n * @returns {Promise}\r\n */\r\n setAccessToken(accessToken: string): Promise {\r\n return this.service.hpm.post('/report/token', accessToken, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n return response.body;\r\n })\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n \r\n /**\r\n * Gets an access token from the first available location: config, attribute, global.\r\n * \r\n * @private\r\n * @param {string} globalAccessToken\r\n * @returns {string}\r\n */\r\n private getAccessToken(globalAccessToken: string): string {\r\n const accessToken = this.config.accessToken || this.element.getAttribute(Embed.accessTokenAttribute) || globalAccessToken;\r\n\r\n if (!accessToken) {\r\n throw new Error(`No access token was found for element. You must specify an access token directly on the element using attribute '${Embed.accessTokenAttribute}' or specify a global token at: powerbi.accessToken.`);\r\n }\r\n\r\n return accessToken;\r\n }\r\n\r\n /**\r\n * Populate config for create and load\r\n * \r\n * @private\r\n * @param {IEmbedConfiguration}\r\n * @returns {void}\r\n */\r\n private populateConfig(config: IEmbedConfiguration): void {\r\n // TODO: Change when Object.assign is available.\r\n const settings = utils.assign({}, Embed.defaultSettings, config.settings);\r\n this.config = utils.assign({ settings }, config);\r\n this.config.uniqueId = this.getUniqueId();\r\n this.config.embedUrl = this.getEmbedUrl();\r\n\r\n if(this.embeType === 'create') {\r\n this.createConfig = {\r\n datasetId: config.datasetId || this.getId(),\r\n accessToken: this.getAccessToken(this.service.accessToken),\r\n settings: settings\r\n }\r\n } else {\r\n this.config.id = this.getId();\r\n this.config.accessToken = this.getAccessToken(this.service.accessToken);\r\n } \r\n }\r\n\r\n\r\n /**\r\n * Gets an embed url from the first available location: options, attribute.\r\n * \r\n * @private\r\n * @returns {string}\r\n */\r\n private getEmbedUrl(): string {\r\n const embedUrl = this.config.embedUrl || this.element.getAttribute(Embed.embedUrlAttribute);\r\n\r\n if (typeof embedUrl !== 'string' || embedUrl.length === 0) {\r\n throw new Error(`Embed Url is required, but it was not found. You must provide an embed url either as part of embed configuration or as attribute '${Embed.embedUrlAttribute}'.`);\r\n }\r\n\r\n return embedUrl;\r\n }\r\n\r\n /**\r\n * Gets a unique ID from the first available location: options, attribute.\r\n * If neither is provided generate a unique string.\r\n * \r\n * @private\r\n * @returns {string}\r\n */\r\n private getUniqueId(): string {\r\n return this.config.uniqueId || this.element.getAttribute(Embed.nameAttribute) || utils.createRandomString();\r\n }\r\n\r\n /**\r\n * Gets the report ID from the first available location: options, attribute.\r\n * \r\n * @abstract\r\n * @returns {string}\r\n */\r\n abstract getId(): string;\r\n\r\n /**\r\n * Requests the browser to render the component's iframe in fullscreen mode.\r\n */\r\n fullscreen(): void {\r\n const requestFullScreen = this.iframe.requestFullscreen || this.iframe.msRequestFullscreen || this.iframe.mozRequestFullScreen || this.iframe.webkitRequestFullscreen;\r\n requestFullScreen.call(this.iframe);\r\n }\r\n\r\n /**\r\n * Requests the browser to exit fullscreen mode.\r\n */\r\n exitFullscreen(): void {\r\n if (!this.isFullscreen(this.iframe)) {\r\n return;\r\n }\r\n\r\n const exitFullscreen = document.exitFullscreen || document.mozCancelFullScreen || document.webkitExitFullscreen || document.msExitFullscreen;\r\n exitFullscreen.call(document);\r\n }\r\n\r\n /**\r\n * Returns true if the iframe is rendered in fullscreen mode,\r\n * otherwise returns false.\r\n * \r\n * @private\r\n * @param {HTMLIFrameElement} iframe\r\n * @returns {boolean}\r\n */\r\n private isFullscreen(iframe: HTMLIFrameElement): boolean {\r\n const options = ['fullscreenElement', 'webkitFullscreenElement', 'mozFullscreenScreenElement', 'msFullscreenElement'];\r\n\r\n return options.some(option => document[option] === iframe);\r\n }\r\n \r\n /**\r\n * Validate load and create configuration.\r\n */\r\n abstract validate(config: models.IReportLoadConfiguration | models.IDashboardLoadConfiguration | models.IReportCreateConfiguration): models.IError[];\r\n\r\n /**\r\n * Sets Iframe for embed\r\n */\r\n private setIframe(isLoad: boolean): void {\r\n if(!this.iframe) {\r\n const iframeHtml = ``;\r\n this.element.innerHTML = iframeHtml;\r\n this.iframe = this.element.childNodes[0];\r\n }\r\n\r\n if(isLoad){\r\n this.iframe.addEventListener('load', () => this.load(this.config), false);\r\n } else {\r\n this.iframe.addEventListener('load', () => this.createReport(this.createConfig), false);\r\n }\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/embed.ts","\r\n/**\r\n * Raises a custom event with event data on the specified HTML element.\r\n * \r\n * @export\r\n * @param {HTMLElement} element\r\n * @param {string} eventName\r\n * @param {*} eventData\r\n */\r\nexport function raiseCustomEvent(element: HTMLElement, eventName: string, eventData: any): void {\r\n let customEvent;\r\n if (typeof CustomEvent === 'function') {\r\n customEvent = new CustomEvent(eventName, {\r\n detail: eventData,\r\n bubbles: true,\r\n cancelable: true\r\n });\r\n } else {\r\n customEvent = document.createEvent('CustomEvent');\r\n customEvent.initCustomEvent(eventName, true, true, eventData);\r\n }\r\n\r\n element.dispatchEvent(customEvent);\r\n}\r\n\r\n/**\r\n * Finds the index of the first value in an array that matches the specified predicate.\r\n * \r\n * @export\r\n * @template T\r\n * @param {(x: T) => boolean} predicate\r\n * @param {T[]} xs\r\n * @returns {number}\r\n */\r\nexport function findIndex(predicate: (x: T) => boolean, xs: T[]): number {\r\n if (!Array.isArray(xs)) {\r\n throw new Error(`You attempted to call find with second parameter that was not an array. You passed: ${xs}`);\r\n }\r\n\r\n let index;\r\n xs.some((x, i) => {\r\n if (predicate(x)) {\r\n index = i;\r\n return true;\r\n }\r\n });\r\n\r\n return index;\r\n}\r\n\r\n/**\r\n * Finds the first value in an array that matches the specified predicate.\r\n * \r\n * @export\r\n * @template T\r\n * @param {(x: T) => boolean} predicate\r\n * @param {T[]} xs\r\n * @returns {T}\r\n */\r\nexport function find(predicate: (x: T) => boolean, xs: T[]): T {\r\n const index = findIndex(predicate, xs);\r\n return xs[index];\r\n}\r\n\r\nexport function remove(predicate: (x: T) => boolean, xs: T[]): void {\r\n const index = findIndex(predicate, xs);\r\n xs.splice(index, 1);\r\n}\r\n\r\n// See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\r\n// TODO: replace in favor of using polyfill\r\n/**\r\n * Copies the values of all enumerable properties from one or more source objects to a target object, and returns the target object.\r\n * \r\n * @export\r\n * @param {any} args\r\n * @returns\r\n */\r\nexport function assign(...args) {\r\n var target = args[0];\r\n\r\n 'use strict';\r\n if (target === undefined || target === null) {\r\n throw new TypeError('Cannot convert undefined or null to object');\r\n }\r\n\r\n var output = Object(target);\r\n for (var index = 1; index < arguments.length; index++) {\r\n var source = arguments[index];\r\n if (source !== undefined && source !== null) {\r\n for (var nextKey in source) {\r\n if (source.hasOwnProperty(nextKey)) {\r\n output[nextKey] = source[nextKey];\r\n }\r\n }\r\n }\r\n }\r\n return output;\r\n}\r\n\r\n/**\r\n * Generates a random 7 character string.\r\n * \r\n * @export\r\n * @returns {string}\r\n */\r\nexport function createRandomString(): string {\r\n return (Math.random() + 1).toString(36).substring(7);\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/util.ts","import * as service from './service';\nimport * as embed from './embed';\nimport * as models from 'powerbi-models';\nimport * as wpmp from 'window-post-message-proxy';\nimport * as hpm from 'http-post-message';\nimport * as utils from './util';\nimport { IFilterable } from './ifilterable';\nimport { IPageNode, Page } from './page';\n\n/**\n * A Report node within a report hierarchy\n * \n * @export\n * @interface IReportNode\n */\nexport interface IReportNode {\n iframe: HTMLIFrameElement;\n service: service.IService;\n config: embed.IInternalEmbedConfiguration\n}\n\n/**\n * The Power BI Report embed component\n * \n * @export\n * @class Report\n * @extends {embed.Embed}\n * @implements {IReportNode}\n * @implements {IFilterable}\n */\nexport class Report extends embed.Embed implements IReportNode, IFilterable {\n static allowedEvents = [\"filtersApplied\", \"pageChanged\"];\n static reportIdAttribute = 'powerbi-report-id';\n static filterPaneEnabledAttribute = 'powerbi-settings-filter-pane-enabled';\n static navContentPaneEnabledAttribute = 'powerbi-settings-nav-content-pane-enabled';\n static typeAttribute = 'powerbi-type';\n static type = \"Report\";\n\n /**\n * Creates an instance of a Power BI Report.\n * \n * @param {service.Service} service\n * @param {HTMLElement} element\n * @param {embed.IEmbedConfiguration} config\n */\n constructor(service: service.Service, element: HTMLElement, config: embed.IEmbedConfiguration, iframe?: HTMLIFrameElement) {\n const filterPaneEnabled = (config.settings && config.settings.filterPaneEnabled) || !(element.getAttribute(Report.filterPaneEnabledAttribute) === \"false\");\n const navContentPaneEnabled = (config.settings && config.settings.navContentPaneEnabled) || !(element.getAttribute(Report.navContentPaneEnabledAttribute) === \"false\");\n const settings = utils.assign({\n filterPaneEnabled,\n navContentPaneEnabled\n }, config.settings);\n const configCopy = utils.assign({ settings }, config);\n\n super(service, element, configCopy, iframe);\n this.loadPath = \"/report/load\";\n Array.prototype.push.apply(this.allowedEvents, Report.allowedEvents);\n }\n\n /**\n * Adds backwards compatibility for the previous load configuration, which used the reportId query parameter to specify the report ID\n * (e.g. http://embedded.powerbi.com/appTokenReportEmbed?reportId=854846ed-2106-4dc2-bc58-eb77533bf2f1).\n * \n * By extracting the ID we can ensure that the ID is always explicitly provided as part of the load configuration.\n * \n * @static\n * @param {string} url\n * @returns {string}\n */\n static findIdFromEmbedUrl(url: string): string {\n const reportIdRegEx = /reportId=\"?([^&]+)\"?/\n const reportIdMatch = url.match(reportIdRegEx);\n\n let reportId;\n if (reportIdMatch) {\n reportId = reportIdMatch[1];\n }\n\n return reportId;\n }\n\n /**\n * Gets filters that are applied at the report level.\n * \n * ```javascript\n * // Get filters applied at report level\n * report.getFilters()\n * .then(filters => {\n * ...\n * });\n * ```\n * \n * @returns {Promise}\n */\n getFilters(): Promise {\n return this.service.hpm.get(`/report/filters`, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .then(response => response.body,\n response => {\n throw response.body;\n });\n }\n\n /**\n * Gets the report ID from the first available location: options, attribute, embed url.\n * \n * @returns {string}\n */\n getId(): string {\n const reportId = this.config.id || this.element.getAttribute(Report.reportIdAttribute) || Report.findIdFromEmbedUrl(this.config.embedUrl);\n\n if (typeof reportId !== 'string' || reportId.length === 0) {\n throw new Error(`Report id is required, but it was not found. You must provide an id either as part of embed configuration or as attribute '${Report.reportIdAttribute}'.`);\n }\n\n return reportId;\n }\n\n /**\n * Gets the list of pages within the report.\n * \n * ```javascript\n * report.getPages()\n * .then(pages => {\n * ...\n * });\n * ```\n * \n * @returns {Promise}\n */\n getPages(): Promise {\n return this.service.hpm.get('/report/pages', { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .then(response => {\n return response.body\n .map(page => {\n return new Page(this, page.name, page.displayName);\n });\n }, response => {\n throw response.body;\n });\n }\n\n /**\n * Creates an instance of a Page.\n * \n * Normally you would get Page objects by calling `report.getPages()`, but in the case\n * that the page name is known and you want to perform an action on a page without having to retrieve it\n * you can create it directly.\n * \n * Note: Because you are creating the page manually there is no guarantee that the page actually exists in the report, and subsequent requests could fail.\n * \n * ```javascript\n * const page = report.page('ReportSection1');\n * page.setActive();\n * ```\n * \n * @param {string} name\n * @param {string} [displayName]\n * @returns {Page}\n */\n page(name: string, displayName?: string): Page {\n return new Page(this, name, displayName);\n }\n\n /**\n * Prints the active page of the report by invoking `window.print()` on the embed iframe component.\n */\n print(): Promise {\n return this.service.hpm.post('/report/print', null, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .then(response => {\n return response.body;\n })\n .catch(response => {\n throw response.body;\n });\n }\n\n /**\n * Removes all filters at the report level.\n * \n * ```javascript\n * report.removeFilters();\n * ```\n * \n * @returns {Promise}\n */\n removeFilters(): Promise {\n return this.setFilters([]);\n }\n\n /**\n * Sets the active page of the report.\n * \n * ```javascript\n * report.setPage(\"page2\")\n * .catch(error => { ... });\n * ```\n * \n * @param {string} pageName\n * @returns {Promise}\n */\n setPage(pageName: string): Promise {\n const page: models.IPage = {\n name: pageName,\n displayName: null\n };\n\n return this.service.hpm.put('/report/pages/active', page, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .catch(response => {\n throw response.body;\n });\n }\n\n /**\n * Sets filters at the report level.\n * \n * ```javascript\n * const filters: [\n * ...\n * ];\n * \n * report.setFilters(filters)\n * .catch(errors => {\n * ...\n * });\n * ```\n * \n * @param {(models.IFilter[])} filters\n * @returns {Promise}\n */\n setFilters(filters: models.IFilter[]): Promise {\n return this.service.hpm.put(`/report/filters`, filters, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .catch(response => {\n throw response.body;\n });\n }\n\n /**\n * Updates visibility settings for the filter pane and the page navigation pane.\n * \n * ```javascript\n * const newSettings = {\n * navContentPaneEnabled: true,\n * filterPaneEnabled: false\n * };\n * \n * report.updateSettings(newSettings)\n * .catch(error => { ... });\n * ```\n * \n * @param {models.ISettings} settings\n * @returns {Promise}\n */\n updateSettings(settings: models.ISettings): Promise {\n return this.service.hpm.patch('/report/settings', settings, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .catch(response => {\n throw response.body;\n });\n }\n\n /**\n * Validate load configuration.\n */\n validate(config: models.IReportLoadConfiguration): models.IError[] {\n return models.validateReportLoad(config);\n }\n\n /**\n * Switch Report view mode.\n * \n * @returns {Promise}\n */\n switchMode(viewMode: models.ViewMode): Promise {\n let url = '/report/switchMode/' + viewMode;\n return this.service.hpm.post(url, null, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .then(response => {\n return response.body;\n })\n .catch(response => {\n throw response.body;\n });\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/report.ts","/*! powerbi-models v0.11.1 | (c) 2016 Microsoft Corporation MIT */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"powerbi-models\"] = factory();\n\telse\n\t\troot[\"powerbi-models\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __extends = (this && this.__extends) || function (d, b) {\n\t for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n\t function __() { this.constructor = d; }\n\t d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n\t};\n\t/* tslint:disable:no-var-requires */\n\texports.advancedFilterSchema = __webpack_require__(1);\n\texports.filterSchema = __webpack_require__(2);\n\texports.loadSchema = __webpack_require__(3);\n\texports.dashboardLoadSchema = __webpack_require__(4);\n\texports.pageSchema = __webpack_require__(5);\n\texports.settingsSchema = __webpack_require__(6);\n\texports.basicFilterSchema = __webpack_require__(7);\n\texports.createReportSchema = __webpack_require__(8);\n\texports.saveAsParametersSchema = __webpack_require__(9);\n\t/* tslint:enable:no-var-requires */\n\tvar jsen = __webpack_require__(10);\n\tfunction normalizeError(error) {\n\t var message = error.message;\n\t if (!message) {\n\t message = error.path + \" is invalid. Not meeting \" + error.keyword + \" constraint\";\n\t }\n\t return {\n\t message: message\n\t };\n\t}\n\t/**\n\t * Takes in schema and returns function which can be used to validate the schema with better semantics around exposing errors\n\t */\n\tfunction validate(schema, options) {\n\t return function (x) {\n\t var validate = jsen(schema, options);\n\t var isValid = validate(x);\n\t if (isValid) {\n\t return undefined;\n\t }\n\t else {\n\t return validate.errors\n\t .map(normalizeError);\n\t }\n\t };\n\t}\n\texports.validateSettings = validate(exports.settingsSchema, {\n\t schemas: {\n\t basicFilter: exports.basicFilterSchema,\n\t advancedFilter: exports.advancedFilterSchema\n\t }\n\t});\n\texports.validateReportLoad = validate(exports.loadSchema, {\n\t schemas: {\n\t settings: exports.settingsSchema,\n\t basicFilter: exports.basicFilterSchema,\n\t advancedFilter: exports.advancedFilterSchema\n\t }\n\t});\n\texports.validateCreateReport = validate(exports.createReportSchema);\n\texports.validateDashboardLoad = validate(exports.dashboardLoadSchema);\n\texports.validatePage = validate(exports.pageSchema);\n\texports.validateFilter = validate(exports.filterSchema, {\n\t schemas: {\n\t basicFilter: exports.basicFilterSchema,\n\t advancedFilter: exports.advancedFilterSchema\n\t }\n\t});\n\t(function (FilterType) {\n\t FilterType[FilterType[\"Advanced\"] = 0] = \"Advanced\";\n\t FilterType[FilterType[\"Basic\"] = 1] = \"Basic\";\n\t FilterType[FilterType[\"Unknown\"] = 2] = \"Unknown\";\n\t})(exports.FilterType || (exports.FilterType = {}));\n\tvar FilterType = exports.FilterType;\n\tfunction isFilterKeyColumnsTarget(target) {\n\t return isColumn(target) && !!target.keys;\n\t}\n\texports.isFilterKeyColumnsTarget = isFilterKeyColumnsTarget;\n\tfunction isBasicFilterWithKeys(filter) {\n\t return getFilterType(filter) === FilterType.Basic && !!filter.keyValues;\n\t}\n\texports.isBasicFilterWithKeys = isBasicFilterWithKeys;\n\tfunction getFilterType(filter) {\n\t var basicFilter = filter;\n\t var advancedFilter = filter;\n\t if ((typeof basicFilter.operator === \"string\")\n\t && (Array.isArray(basicFilter.values))) {\n\t return FilterType.Basic;\n\t }\n\t else if ((typeof advancedFilter.logicalOperator === \"string\")\n\t && (Array.isArray(advancedFilter.conditions))) {\n\t return FilterType.Advanced;\n\t }\n\t else {\n\t return FilterType.Unknown;\n\t }\n\t}\n\texports.getFilterType = getFilterType;\n\tfunction isMeasure(arg) {\n\t return arg.table !== undefined && arg.measure !== undefined;\n\t}\n\texports.isMeasure = isMeasure;\n\tfunction isColumn(arg) {\n\t return arg.table !== undefined && arg.column !== undefined;\n\t}\n\texports.isColumn = isColumn;\n\tfunction isHierarchy(arg) {\n\t return arg.table !== undefined && arg.hierarchy !== undefined && arg.hierarchyLevel !== undefined;\n\t}\n\texports.isHierarchy = isHierarchy;\n\tvar Filter = (function () {\n\t function Filter(target) {\n\t this.target = target;\n\t }\n\t Filter.prototype.toJSON = function () {\n\t return {\n\t $schema: this.schemaUrl,\n\t target: this.target\n\t };\n\t };\n\t ;\n\t return Filter;\n\t}());\n\texports.Filter = Filter;\n\tvar BasicFilter = (function (_super) {\n\t __extends(BasicFilter, _super);\n\t function BasicFilter(target, operator) {\n\t var values = [];\n\t for (var _i = 2; _i < arguments.length; _i++) {\n\t values[_i - 2] = arguments[_i];\n\t }\n\t _super.call(this, target);\n\t this.operator = operator;\n\t this.schemaUrl = BasicFilter.schemaUrl;\n\t if (values.length === 0 && operator !== \"All\") {\n\t throw new Error(\"values must be a non-empty array unless your operator is \\\"All\\\".\");\n\t }\n\t /**\n\t * Accept values as array instead of as individual arguments\n\t * new BasicFilter('a', 'b', 1, 2);\n\t * new BasicFilter('a', 'b', [1,2]);\n\t */\n\t if (Array.isArray(values[0])) {\n\t this.values = values[0];\n\t }\n\t else {\n\t this.values = values;\n\t }\n\t }\n\t BasicFilter.prototype.toJSON = function () {\n\t var filter = _super.prototype.toJSON.call(this);\n\t filter.operator = this.operator;\n\t filter.values = this.values;\n\t return filter;\n\t };\n\t BasicFilter.schemaUrl = \"http://powerbi.com/product/schema#basic\";\n\t return BasicFilter;\n\t}(Filter));\n\texports.BasicFilter = BasicFilter;\n\tvar BasicFilterWithKeys = (function (_super) {\n\t __extends(BasicFilterWithKeys, _super);\n\t function BasicFilterWithKeys(target, operator, values, keyValues) {\n\t _super.call(this, target, operator, values);\n\t this.keyValues = keyValues;\n\t this.target = target;\n\t var numberOfKeys = target.keys ? target.keys.length : 0;\n\t if (numberOfKeys > 0 && !keyValues) {\n\t throw new Error(\"You shold pass the values to be filtered for each key. You passed: no values and \" + numberOfKeys + \" keys\");\n\t }\n\t if (numberOfKeys === 0 && keyValues && keyValues.length > 0) {\n\t throw new Error(\"You passed key values but your target object doesn't contain the keys to be filtered\");\n\t }\n\t for (var i = 0; i < this.keyValues.length; i++) {\n\t if (this.keyValues[i]) {\n\t var lengthOfArray = this.keyValues[i].length;\n\t if (lengthOfArray !== numberOfKeys) {\n\t throw new Error(\"Each tuple of key values should contain a value for each of the keys. You passed: \" + lengthOfArray + \" values and \" + numberOfKeys + \" keys\");\n\t }\n\t }\n\t }\n\t }\n\t BasicFilterWithKeys.prototype.toJSON = function () {\n\t var filter = _super.prototype.toJSON.call(this);\n\t filter.keyValues = this.keyValues;\n\t return filter;\n\t };\n\t return BasicFilterWithKeys;\n\t}(BasicFilter));\n\texports.BasicFilterWithKeys = BasicFilterWithKeys;\n\tvar AdvancedFilter = (function (_super) {\n\t __extends(AdvancedFilter, _super);\n\t function AdvancedFilter(target, logicalOperator) {\n\t var conditions = [];\n\t for (var _i = 2; _i < arguments.length; _i++) {\n\t conditions[_i - 2] = arguments[_i];\n\t }\n\t _super.call(this, target);\n\t this.schemaUrl = AdvancedFilter.schemaUrl;\n\t // Guard statements\n\t if (typeof logicalOperator !== \"string\" || logicalOperator.length === 0) {\n\t // TODO: It would be nicer to list out the possible logical operators.\n\t throw new Error(\"logicalOperator must be a valid operator, You passed: \" + logicalOperator);\n\t }\n\t this.logicalOperator = logicalOperator;\n\t var extractedConditions;\n\t /**\n\t * Accept conditions as array instead of as individual arguments\n\t * new AdvancedFilter('a', 'b', \"And\", { value: 1, operator: \"Equals\" }, { value: 2, operator: \"IsGreaterThan\" });\n\t * new AdvancedFilter('a', 'b', \"And\", [{ value: 1, operator: \"Equals\" }, { value: 2, operator: \"IsGreaterThan\" }]);\n\t */\n\t if (Array.isArray(conditions[0])) {\n\t extractedConditions = conditions[0];\n\t }\n\t else {\n\t extractedConditions = conditions;\n\t }\n\t if (extractedConditions.length === 0) {\n\t throw new Error(\"conditions must be a non-empty array. You passed: \" + conditions);\n\t }\n\t if (extractedConditions.length > 2) {\n\t throw new Error(\"AdvancedFilters may not have more than two conditions. You passed: \" + conditions.length);\n\t }\n\t if (extractedConditions.length === 1 && logicalOperator !== \"And\") {\n\t throw new Error(\"Logical Operator must be \\\"And\\\" when there is only one condition provided\");\n\t }\n\t this.conditions = extractedConditions;\n\t }\n\t AdvancedFilter.prototype.toJSON = function () {\n\t var filter = _super.prototype.toJSON.call(this);\n\t filter.logicalOperator = this.logicalOperator;\n\t filter.conditions = this.conditions;\n\t return filter;\n\t };\n\t AdvancedFilter.schemaUrl = \"http://powerbi.com/product/schema#advanced\";\n\t return AdvancedFilter;\n\t}(Filter));\n\texports.AdvancedFilter = AdvancedFilter;\n\t(function (Permissions) {\n\t Permissions[Permissions[\"Read\"] = 0] = \"Read\";\n\t Permissions[Permissions[\"ReadWrite\"] = 1] = \"ReadWrite\";\n\t Permissions[Permissions[\"Copy\"] = 2] = \"Copy\";\n\t Permissions[Permissions[\"Create\"] = 4] = \"Create\";\n\t Permissions[Permissions[\"All\"] = 7] = \"All\";\n\t})(exports.Permissions || (exports.Permissions = {}));\n\tvar Permissions = exports.Permissions;\n\t(function (ViewMode) {\n\t ViewMode[ViewMode[\"View\"] = 0] = \"View\";\n\t ViewMode[ViewMode[\"Edit\"] = 1] = \"Edit\";\n\t})(exports.ViewMode || (exports.ViewMode = {}));\n\tvar ViewMode = exports.ViewMode;\n\texports.validateSaveAsParameters = validate(exports.saveAsParametersSchema);\n\n\n/***/ },\n/* 1 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"target\": {\n\t\t\t\t\"oneOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\t\"table\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"column\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"required\": [\n\t\t\t\t\t\t\t\"table\",\n\t\t\t\t\t\t\t\"column\"\n\t\t\t\t\t\t]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\t\"table\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"hierarchy\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"hierarchyLevel\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"required\": [\n\t\t\t\t\t\t\t\"table\",\n\t\t\t\t\t\t\t\"hierarchy\",\n\t\t\t\t\t\t\t\"hierarchyLevel\"\n\t\t\t\t\t\t]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\t\"table\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"measure\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"required\": [\n\t\t\t\t\t\t\t\"table\",\n\t\t\t\t\t\t\t\"measure\"\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"logicalOperator\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"conditions\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\"value\": {\n\t\t\t\t\t\t\t\"type\": [\n\t\t\t\t\t\t\t\t\"string\",\n\t\t\t\t\t\t\t\t\"boolean\",\n\t\t\t\t\t\t\t\t\"number\"\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"operator\": {\n\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\"required\": [\n\t\t\t\t\t\t\"value\",\n\t\t\t\t\t\t\"operator\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"target\",\n\t\t\t\"logicalOperator\",\n\t\t\t\"conditions\"\n\t\t]\n\t};\n\n/***/ },\n/* 2 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"oneOf\": [\n\t\t\t{\n\t\t\t\t\"$ref\": \"#basicFilter\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"$ref\": \"#advancedFilter\"\n\t\t\t}\n\t\t],\n\t\t\"invalidMessage\": \"filter is invalid\"\n\t};\n\n/***/ },\n/* 3 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"accessToken\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"accessToken must be a string\",\n\t\t\t\t\t\"required\": \"accessToken is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"id\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"id must be a string\",\n\t\t\t\t\t\"required\": \"id is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"settings\": {\n\t\t\t\t\"$ref\": \"#settings\"\n\t\t\t},\n\t\t\t\"pageName\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"pageName must be a string\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"filters\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\"oneOf\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"$ref\": \"#basicFilter\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"$ref\": \"#advancedFilter\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t\"invalidMessage\": \"filters property is invalid\"\n\t\t\t},\n\t\t\t\"permissions\": {\n\t\t\t\t\"type\": \"number\",\n\t\t\t\t\"enum\": [\n\t\t\t\t\t0,\n\t\t\t\t\t1,\n\t\t\t\t\t2,\n\t\t\t\t\t4,\n\t\t\t\t\t7\n\t\t\t\t],\n\t\t\t\t\"default\": 0,\n\t\t\t\t\"invalidMessage\": \"permissions property is invalid\"\n\t\t\t},\n\t\t\t\"viewMode\": {\n\t\t\t\t\"type\": \"number\",\n\t\t\t\t\"enum\": [\n\t\t\t\t\t0,\n\t\t\t\t\t1\n\t\t\t\t],\n\t\t\t\t\"default\": 0,\n\t\t\t\t\"invalidMessage\": \"viewMode property is invalid\"\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"accessToken\",\n\t\t\t\"id\"\n\t\t]\n\t};\n\n/***/ },\n/* 4 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"accessToken\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"accessToken must be a string\",\n\t\t\t\t\t\"required\": \"accessToken is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"id\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"id must be a string\",\n\t\t\t\t\t\"required\": \"id is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"pageView\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"pageView must be a string with one of the following values: \\\"actualSize\\\", \\\"fitToWidth\\\", \\\"oneColumn\\\"\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"accessToken\",\n\t\t\t\"id\"\n\t\t]\n\t};\n\n/***/ },\n/* 5 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"name\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"name must be a string\",\n\t\t\t\t\t\"required\": \"name is required\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"name\"\n\t\t]\n\t};\n\n/***/ },\n/* 6 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"filterPaneEnabled\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"filterPaneEnabled must be a boolean\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"navContentPaneEnabled\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"navContentPaneEnabled must be a boolean\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"useCustomSaveAsDialog\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"useCustomSaveAsDialog must be a boolean\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n/***/ },\n/* 7 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"target\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"properties\": {\n\t\t\t\t\t\"table\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"column\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"hierarchy\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"hierarchyLevel\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"measure\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"required\": [\n\t\t\t\t\t\"table\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"operator\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"values\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"type\": [\n\t\t\t\t\t\t\"string\",\n\t\t\t\t\t\t\"boolean\",\n\t\t\t\t\t\t\"number\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"target\",\n\t\t\t\"operator\",\n\t\t\t\"values\"\n\t\t]\n\t};\n\n/***/ },\n/* 8 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"accessToken\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"accessToken must be a string\",\n\t\t\t\t\t\"required\": \"accessToken is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"datasetId\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"datasetId must be a string\",\n\t\t\t\t\t\"required\": \"datasetId is required\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"accessToken\",\n\t\t\t\"datasetId\"\n\t\t]\n\t};\n\n/***/ },\n/* 9 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"name\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"name must be a string\",\n\t\t\t\t\t\"required\": \"name is required\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"name\"\n\t\t]\n\t};\n\n/***/ },\n/* 10 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = __webpack_require__(11);\n\n/***/ },\n/* 11 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar REGEX_ESCAPE_EXPR = /[\\/]/g,\n\t STR_ESCAPE_EXPR = /(\")/gim,\n\t VALID_IDENTIFIER_EXPR = /^[a-z_$][0-9a-z]*$/gi,\n\t INVALID_SCHEMA = 'jsen: invalid schema object',\n\t browser = typeof window === 'object' && !!window.navigator, // jshint ignore: line\n\t regescape = new RegExp('/').source !== '/', // node v0.x does not properly escape '/'s in inline regex\n\t func = __webpack_require__(12),\n\t equal = __webpack_require__(13),\n\t unique = __webpack_require__(14),\n\t SchemaResolver = __webpack_require__(15),\n\t formats = __webpack_require__(24),\n\t ucs2length = __webpack_require__(25),\n\t types = {},\n\t keywords = {};\n\t\n\tfunction inlineRegex(regex) {\n\t regex = regex instanceof RegExp ? regex : new RegExp(regex);\n\t\n\t return regescape ?\n\t regex.toString() :\n\t '/' + regex.source.replace(REGEX_ESCAPE_EXPR, '\\\\$&') + '/';\n\t}\n\t\n\tfunction encodeStr(str) {\n\t return '\"' + str.replace(STR_ESCAPE_EXPR, '\\\\$1') + '\"';\n\t}\n\t\n\tfunction appendToPath(path, key) {\n\t VALID_IDENTIFIER_EXPR.lastIndex = 0;\n\t\n\t return VALID_IDENTIFIER_EXPR.test(key) ?\n\t path + '.' + key :\n\t path + '[' + encodeStr(key) + ']';\n\t}\n\t\n\tfunction type(obj) {\n\t if (obj === undefined) {\n\t return 'undefined';\n\t }\n\t\n\t var str = Object.prototype.toString.call(obj);\n\t return str.substr(8, str.length - 9).toLowerCase();\n\t}\n\t\n\tfunction isInteger(obj) {\n\t return (obj | 0) === obj; // jshint ignore: line\n\t}\n\t\n\ttypes['null'] = function (path) {\n\t return path + ' === null';\n\t};\n\t\n\ttypes.boolean = function (path) {\n\t return 'typeof ' + path + ' === \"boolean\"';\n\t};\n\t\n\ttypes.string = function (path) {\n\t return 'typeof ' + path + ' === \"string\"';\n\t};\n\t\n\ttypes.number = function (path) {\n\t return 'typeof ' + path + ' === \"number\"';\n\t};\n\t\n\ttypes.integer = function (path) {\n\t return 'typeof ' + path + ' === \"number\" && !(' + path + ' % 1)';\n\t};\n\t\n\ttypes.array = function (path) {\n\t return 'Array.isArray(' + path + ')';\n\t};\n\t\n\ttypes.object = function (path) {\n\t return 'typeof ' + path + ' === \"object\" && ' + path + ' !== null && !Array.isArray(' + path + ')';\n\t};\n\t\n\ttypes.date = function (path) {\n\t return path + ' instanceof Date';\n\t};\n\t\n\tkeywords.enum = function (context) {\n\t var arr = context.schema['enum'];\n\t\n\t context.code('if (!equalAny(' + context.path + ', ' + JSON.stringify(arr) + ')) {');\n\t context.error('enum');\n\t context.code('}');\n\t};\n\t\n\tkeywords.minimum = function (context) {\n\t if (typeof context.schema.minimum === 'number') {\n\t context.code('if (' + context.path + ' < ' + context.schema.minimum + ') {');\n\t context.error('minimum');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.exclusiveMinimum = function (context) {\n\t if (context.schema.exclusiveMinimum === true && typeof context.schema.minimum === 'number') {\n\t context.code('if (' + context.path + ' === ' + context.schema.minimum + ') {');\n\t context.error('exclusiveMinimum');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.maximum = function (context) {\n\t if (typeof context.schema.maximum === 'number') {\n\t context.code('if (' + context.path + ' > ' + context.schema.maximum + ') {');\n\t context.error('maximum');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.exclusiveMaximum = function (context) {\n\t if (context.schema.exclusiveMaximum === true && typeof context.schema.maximum === 'number') {\n\t context.code('if (' + context.path + ' === ' + context.schema.maximum + ') {');\n\t context.error('exclusiveMaximum');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.multipleOf = function (context) {\n\t if (typeof context.schema.multipleOf === 'number') {\n\t var mul = context.schema.multipleOf,\n\t decimals = mul.toString().length - mul.toFixed(0).length - 1,\n\t pow = decimals > 0 ? Math.pow(10, decimals) : 1,\n\t path = context.path;\n\t\n\t if (decimals > 0) {\n\t context.code('if (+(Math.round((' + path + ' * ' + pow + ') + \"e+\" + ' + decimals + ') + \"e-\" + ' + decimals + ') % ' + (mul * pow) + ' !== 0) {');\n\t } else {\n\t context.code('if (((' + path + ' * ' + pow + ') % ' + (mul * pow) + ') !== 0) {');\n\t }\n\t\n\t context.error('multipleOf');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.minLength = function (context) {\n\t if (isInteger(context.schema.minLength)) {\n\t context.code('if (ucs2length(' + context.path + ') < ' + context.schema.minLength + ') {');\n\t context.error('minLength');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.maxLength = function (context) {\n\t if (isInteger(context.schema.maxLength)) {\n\t context.code('if (ucs2length(' + context.path + ') > ' + context.schema.maxLength + ') {');\n\t context.error('maxLength');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.pattern = function (context) {\n\t var pattern = context.schema.pattern;\n\t\n\t if (typeof pattern === 'string' || pattern instanceof RegExp) {\n\t context.code('if (!(' + inlineRegex(pattern) + ').test(' + context.path + ')) {');\n\t context.error('pattern');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.format = function (context) {\n\t if (typeof context.schema.format !== 'string' || !formats[context.schema.format]) {\n\t return;\n\t }\n\t\n\t context.code('if (!(' + formats[context.schema.format] + ').test(' + context.path + ')) {');\n\t context.error('format');\n\t context.code('}');\n\t};\n\t\n\tkeywords.minItems = function (context) {\n\t if (isInteger(context.schema.minItems)) {\n\t context.code('if (' + context.path + '.length < ' + context.schema.minItems + ') {');\n\t context.error('minItems');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.maxItems = function (context) {\n\t if (isInteger(context.schema.maxItems)) {\n\t context.code('if (' + context.path + '.length > ' + context.schema.maxItems + ') {');\n\t context.error('maxItems');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.additionalItems = function (context) {\n\t if (context.schema.additionalItems === false && Array.isArray(context.schema.items)) {\n\t context.code('if (' + context.path + '.length > ' + context.schema.items.length + ') {');\n\t context.error('additionalItems');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.uniqueItems = function (context) {\n\t if (context.schema.uniqueItems) {\n\t context.code('if (unique(' + context.path + ').length !== ' + context.path + '.length) {');\n\t context.error('uniqueItems');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.items = function (context) {\n\t var index = context.declare(0),\n\t i = 0;\n\t\n\t if (type(context.schema.items) === 'object') {\n\t context.code('for (' + index + ' = 0; ' + index + ' < ' + context.path + '.length; ' + index + '++) {');\n\t\n\t context.descend(context.path + '[' + index + ']', context.schema.items);\n\t\n\t context.code('}');\n\t }\n\t else if (Array.isArray(context.schema.items)) {\n\t for (; i < context.schema.items.length; i++) {\n\t context.code('if (' + context.path + '.length - 1 >= ' + i + ') {');\n\t\n\t context.descend(context.path + '[' + i + ']', context.schema.items[i]);\n\t\n\t context.code('}');\n\t }\n\t\n\t if (type(context.schema.additionalItems) === 'object') {\n\t context.code('for (' + index + ' = ' + i + '; ' + index + ' < ' + context.path + '.length; ' + index + '++) {');\n\t\n\t context.descend(context.path + '[' + index + ']', context.schema.additionalItems);\n\t\n\t context.code('}');\n\t }\n\t }\n\t};\n\t\n\tkeywords.maxProperties = function (context) {\n\t if (isInteger(context.schema.maxProperties)) {\n\t context.code('if (Object.keys(' + context.path + ').length > ' + context.schema.maxProperties + ') {');\n\t context.error('maxProperties');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.minProperties = function (context) {\n\t if (isInteger(context.schema.minProperties)) {\n\t context.code('if (Object.keys(' + context.path + ').length < ' + context.schema.minProperties + ') {');\n\t context.error('minProperties');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.required = function (context) {\n\t if (!Array.isArray(context.schema.required)) {\n\t return;\n\t }\n\t\n\t for (var i = 0; i < context.schema.required.length; i++) {\n\t context.code('if (' + appendToPath(context.path, context.schema.required[i]) + ' === undefined) {');\n\t context.error('required', context.schema.required[i]);\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.properties = function (context) {\n\t var props = context.schema.properties,\n\t propKeys = type(props) === 'object' ? Object.keys(props) : [],\n\t required = Array.isArray(context.schema.required) ? context.schema.required : [],\n\t prop, i, nestedPath;\n\t\n\t if (!propKeys.length) {\n\t return;\n\t }\n\t\n\t for (i = 0; i < propKeys.length; i++) {\n\t prop = propKeys[i];\n\t nestedPath = appendToPath(context.path, prop);\n\t\n\t context.code('if (' + nestedPath + ' !== undefined) {');\n\t\n\t context.descend(nestedPath, props[prop]);\n\t\n\t context.code('}');\n\t\n\t if (required.indexOf(prop) > -1) {\n\t context.code('else {');\n\t context.error('required', prop);\n\t context.code('}');\n\t }\n\t }\n\t};\n\t\n\tkeywords.patternProperties = keywords.additionalProperties = function (context) {\n\t var propKeys = type(context.schema.properties) === 'object' ?\n\t Object.keys(context.schema.properties) : [],\n\t patProps = context.schema.patternProperties,\n\t patterns = type(patProps) === 'object' ? Object.keys(patProps) : [],\n\t addProps = context.schema.additionalProperties,\n\t addPropsCheck = addProps === false || type(addProps) === 'object',\n\t props, keys, key, n, found, pattern, i;\n\t\n\t if (!patterns.length && !addPropsCheck) {\n\t return;\n\t }\n\t\n\t keys = context.declare('[]');\n\t key = context.declare('\"\"');\n\t n = context.declare(0);\n\t\n\t if (addPropsCheck) {\n\t found = context.declare(false);\n\t }\n\t\n\t context.code(keys + ' = Object.keys(' + context.path + ')');\n\t\n\t context.code('for (' + n + ' = 0; ' + n + ' < ' + keys + '.length; ' + n + '++) {')\n\t (key + ' = ' + keys + '[' + n + ']')\n\t\n\t ('if (' + context.path + '[' + key + '] === undefined) {')\n\t ('continue')\n\t ('}');\n\t\n\t if (addPropsCheck) {\n\t context.code(found + ' = false');\n\t }\n\t\n\t // validate pattern properties\n\t for (i = 0; i < patterns.length; i++) {\n\t pattern = patterns[i];\n\t\n\t context.code('if ((' + inlineRegex(pattern) + ').test(' + key + ')) {');\n\t\n\t context.descend(context.path + '[' + key + ']', patProps[pattern]);\n\t\n\t if (addPropsCheck) {\n\t context.code(found + ' = true');\n\t }\n\t\n\t context.code('}');\n\t }\n\t\n\t // validate additional properties\n\t if (addPropsCheck) {\n\t if (propKeys.length) {\n\t props = context.declare(JSON.stringify(propKeys));\n\t\n\t // do not validate regular properties\n\t context.code('if (' + props + '.indexOf(' + key + ') > -1) {')\n\t ('continue')\n\t ('}');\n\t }\n\t\n\t context.code('if (!' + found + ') {');\n\t\n\t if (addProps === false) {\n\t // do not allow additional properties\n\t context.error('additionalProperties', undefined, key);\n\t }\n\t else {\n\t // validate additional properties\n\t context.descend(context.path + '[' + key + ']', addProps);\n\t }\n\t\n\t context.code('}');\n\t }\n\t\n\t context.code('}');\n\t};\n\t\n\tkeywords.dependencies = function (context) {\n\t if (type(context.schema.dependencies) !== 'object') {\n\t return;\n\t }\n\t\n\t var depKeys = Object.keys(context.schema.dependencies),\n\t len = depKeys.length,\n\t key, dep, i = 0, k = 0;\n\t\n\t for (; k < len; k++) {\n\t key = depKeys[k];\n\t dep = context.schema.dependencies[key];\n\t\n\t context.code('if (' + appendToPath(context.path, key) + ' !== undefined) {');\n\t\n\t if (type(dep) === 'object') {\n\t //schema dependency\n\t context.descend(context.path, dep);\n\t }\n\t else {\n\t // property dependency\n\t for (i; i < dep.length; i++) {\n\t context.code('if (' + appendToPath(context.path, dep[i]) + ' === undefined) {');\n\t context.error('dependencies', dep[i]);\n\t context.code('}');\n\t }\n\t }\n\t\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.allOf = function (context) {\n\t if (!Array.isArray(context.schema.allOf)) {\n\t return;\n\t }\n\t\n\t for (var i = 0; i < context.schema.allOf.length; i++) {\n\t context.descend(context.path, context.schema.allOf[i]);\n\t }\n\t};\n\t\n\tkeywords.anyOf = function (context) {\n\t if (!Array.isArray(context.schema.anyOf)) {\n\t return;\n\t }\n\t\n\t var greedy = context.greedy,\n\t errCount = context.declare(0),\n\t initialCount = context.declare(0),\n\t found = context.declare(false),\n\t i = 0;\n\t\n\t context.code(initialCount + ' = errors.length');\n\t\n\t for (; i < context.schema.anyOf.length; i++) {\n\t context.code('if (!' + found + ') {');\n\t\n\t context.code(errCount + ' = errors.length');\n\t\n\t context.greedy = true;\n\t\n\t context.descend(context.path, context.schema.anyOf[i]);\n\t\n\t context.code(found + ' = errors.length === ' + errCount)\n\t ('}');\n\t }\n\t\n\t context.greedy = greedy;\n\t\n\t context.code('if (!' + found + ') {');\n\t\n\t context.error('anyOf');\n\t\n\t context.code('} else {')\n\t ('errors.length = ' + initialCount)\n\t ('}');\n\t};\n\t\n\tkeywords.oneOf = function (context) {\n\t if (!Array.isArray(context.schema.oneOf)) {\n\t return;\n\t }\n\t\n\t var greedy = context.greedy,\n\t matching = context.declare(0),\n\t initialCount = context.declare(0),\n\t errCount = context.declare(0),\n\t i = 0;\n\t\n\t context.code(initialCount + ' = errors.length');\n\t context.code(matching + ' = 0');\n\t\n\t for (; i < context.schema.oneOf.length; i++) {\n\t context.code(errCount + ' = errors.length');\n\t\n\t context.greedy = true;\n\t\n\t context.descend(context.path, context.schema.oneOf[i]);\n\t\n\t context.code('if (errors.length === ' + errCount + ') {')\n\t (matching + '++')\n\t ('}');\n\t }\n\t\n\t context.greedy = greedy;\n\t\n\t context.code('if (' + matching + ' !== 1) {');\n\t\n\t context.error('oneOf');\n\t\n\t context.code('} else {')\n\t ('errors.length = ' + initialCount)\n\t ('}');\n\t};\n\t\n\tkeywords.not = function (context) {\n\t if (type(context.schema.not) !== 'object') {\n\t return;\n\t }\n\t\n\t var greedy = context.greedy,\n\t errCount = context.declare(0);\n\t\n\t context.code(errCount + ' = errors.length');\n\t\n\t context.greedy = true;\n\t\n\t context.descend(context.path, context.schema.not);\n\t\n\t context.greedy = greedy;\n\t\n\t context.code('if (errors.length === ' + errCount + ') {');\n\t\n\t context.error('not');\n\t\n\t context.code('} else {')\n\t ('errors.length = ' + errCount)\n\t ('}');\n\t};\n\t\n\tfunction decorateGenerator(type, keyword) {\n\t keywords[keyword].type = type;\n\t keywords[keyword].keyword = keyword;\n\t}\n\t\n\t['minimum', 'exclusiveMinimum', 'maximum', 'exclusiveMaximum', 'multipleOf']\n\t .forEach(decorateGenerator.bind(null, 'number'));\n\t\n\t['minLength', 'maxLength', 'pattern', 'format']\n\t .forEach(decorateGenerator.bind(null, 'string'));\n\t\n\t['minItems', 'maxItems', 'additionalItems', 'uniqueItems', 'items']\n\t .forEach(decorateGenerator.bind(null, 'array'));\n\t\n\t['maxProperties', 'minProperties', 'required', 'properties', 'patternProperties', 'additionalProperties', 'dependencies']\n\t .forEach(decorateGenerator.bind(null, 'object'));\n\t\n\t['enum', 'allOf', 'anyOf', 'oneOf', 'not']\n\t .forEach(decorateGenerator.bind(null, null));\n\t\n\tfunction groupKeywords(schema) {\n\t var keys = Object.keys(schema),\n\t propIndex = keys.indexOf('properties'),\n\t patIndex = keys.indexOf('patternProperties'),\n\t ret = {\n\t enum: Array.isArray(schema.enum) && schema.enum.length > 0,\n\t type: null,\n\t allType: [],\n\t perType: {}\n\t },\n\t key, gen, i;\n\t\n\t if (schema.type) {\n\t if (typeof schema.type === 'string') {\n\t ret.type = [schema.type];\n\t }\n\t else if (Array.isArray(schema.type) && schema.type.length) {\n\t ret.type = schema.type.slice(0);\n\t }\n\t }\n\t\n\t for (i = 0; i < keys.length; i++) {\n\t key = keys[i];\n\t\n\t if (key === 'enum' || key === 'type') {\n\t continue;\n\t }\n\t\n\t gen = keywords[key];\n\t\n\t if (!gen) {\n\t continue;\n\t }\n\t\n\t if (gen.type) {\n\t if (!ret.perType[gen.type]) {\n\t ret.perType[gen.type] = [];\n\t }\n\t\n\t if (!(propIndex > -1 && key === 'required') &&\n\t !(patIndex > -1 && key === 'additionalProperties')) {\n\t ret.perType[gen.type].push(key);\n\t }\n\t }\n\t else {\n\t ret.allType.push(key);\n\t }\n\t }\n\t\n\t return ret;\n\t}\n\t\n\tfunction getPathExpression(path, key) {\n\t var path_ = path.substr(4),\n\t len = path_.length,\n\t tokens = [],\n\t token = '',\n\t isvar = false,\n\t char, i;\n\t\n\t for (i = 0; i < len; i++) {\n\t char = path_[i];\n\t\n\t switch (char) {\n\t case '.':\n\t if (token) {\n\t token += char;\n\t }\n\t break;\n\t case '[':\n\t if (isNaN(+path_[i + 1])) {\n\t isvar = true;\n\t\n\t if (token) {\n\t tokens.push('\"' + token + '\"');\n\t token = '';\n\t }\n\t }\n\t else {\n\t isvar = false;\n\t\n\t if (token) {\n\t token += '.';\n\t }\n\t }\n\t break;\n\t case ']':\n\t tokens.push(isvar ? token : '\"' + token + '\"');\n\t token = '';\n\t break;\n\t default:\n\t token += char;\n\t }\n\t }\n\t\n\t if (token) {\n\t tokens.push('\"' + token + '\"');\n\t }\n\t\n\t if (key) {\n\t tokens.push('\"' + key + '\"');\n\t }\n\t\n\t if (tokens.length === 1 && isvar) {\n\t return '\"\" + ' + tokens[0] + ' + \"\"';\n\t }\n\t\n\t return tokens.join(' + \".\" + ') || '\"\"';\n\t}\n\t\n\tfunction clone(obj) {\n\t var cloned = obj,\n\t objType = type(obj),\n\t keys, len, key, i;\n\t\n\t if (objType === 'object') {\n\t cloned = {};\n\t keys = Object.keys(obj);\n\t\n\t for (i = 0, len = keys.length; i < len; i++) {\n\t key = keys[i];\n\t cloned[key] = clone(obj[key]);\n\t }\n\t }\n\t else if (objType === 'array') {\n\t cloned = [];\n\t\n\t for (i = 0, len = obj.length; i < len; i++) {\n\t cloned[i] = clone(obj[i]);\n\t }\n\t }\n\t else if (objType === 'regexp') {\n\t return new RegExp(obj);\n\t }\n\t else if (objType === 'date') {\n\t return new Date(obj.toJSON());\n\t }\n\t\n\t return cloned;\n\t}\n\t\n\tfunction equalAny(obj, options) {\n\t for (var i = 0, len = options.length; i < len; i++) {\n\t if (equal(obj, options[i])) {\n\t return true;\n\t }\n\t }\n\t\n\t return false;\n\t}\n\t\n\tfunction PropertyMarker() {\n\t this.objects = [];\n\t this.properties = [];\n\t}\n\t\n\tPropertyMarker.prototype.mark = function (obj, key) {\n\t var index = this.objects.indexOf(obj),\n\t prop;\n\t\n\t if (index < 0) {\n\t this.objects.push(obj);\n\t\n\t prop = {};\n\t prop[key] = 1;\n\t\n\t this.properties.push(prop);\n\t\n\t return;\n\t }\n\t\n\t prop = this.properties[index];\n\t\n\t prop[key] = prop[key] ? prop[key] + 1 : 1;\n\t};\n\t\n\tPropertyMarker.prototype.deleteDuplicates = function () {\n\t var props, keys, key, i, j;\n\t\n\t for (i = 0; i < this.properties.length; i++) {\n\t props = this.properties[i];\n\t keys = Object.keys(props);\n\t\n\t for (j = 0; j < keys.length; j++) {\n\t key = keys[j];\n\t\n\t if (props[key] > 1) {\n\t delete this.objects[i][key];\n\t }\n\t }\n\t }\n\t};\n\t\n\tPropertyMarker.prototype.dispose = function () {\n\t this.objects.length = 0;\n\t this.properties.length = 0;\n\t};\n\t\n\tfunction build(schema, def, additional, resolver, parentMarker) {\n\t var defType, defValue, key, i, propertyMarker, props, defProps;\n\t\n\t if (type(schema) !== 'object') {\n\t return def;\n\t }\n\t\n\t schema = resolver.resolve(schema);\n\t\n\t if (def === undefined && schema.hasOwnProperty('default')) {\n\t def = clone(schema['default']);\n\t }\n\t\n\t defType = type(def);\n\t\n\t if (defType === 'object' && type(schema.properties) === 'object') {\n\t props = Object.keys(schema.properties);\n\t\n\t for (i = 0; i < props.length; i++) {\n\t key = props[i];\n\t defValue = build(schema.properties[key], def[key], additional, resolver);\n\t\n\t if (defValue !== undefined) {\n\t def[key] = defValue;\n\t }\n\t }\n\t\n\t if (additional !== 'always') {\n\t defProps = Object.keys(def);\n\t\n\t for (i = 0; i < defProps.length; i++) {\n\t key = defProps[i];\n\t\n\t if (props.indexOf(key) < 0 &&\n\t (schema.additionalProperties === false ||\n\t (additional === false && !schema.additionalProperties))) {\n\t\n\t if (parentMarker) {\n\t parentMarker.mark(def, key);\n\t }\n\t else {\n\t delete def[key];\n\t }\n\t }\n\t }\n\t }\n\t }\n\t else if (defType === 'array' && schema.items) {\n\t if (type(schema.items) === 'array') {\n\t for (i = 0; i < schema.items.length; i++) {\n\t defValue = build(schema.items[i], def[i], additional, resolver);\n\t\n\t if (defValue !== undefined || i < def.length) {\n\t def[i] = defValue;\n\t }\n\t }\n\t }\n\t else if (def.length) {\n\t for (i = 0; i < def.length; i++) {\n\t def[i] = build(schema.items, def[i], additional, resolver);\n\t }\n\t }\n\t }\n\t else if (type(schema.allOf) === 'array' && schema.allOf.length) {\n\t propertyMarker = new PropertyMarker();\n\t\n\t for (i = 0; i < schema.allOf.length; i++) {\n\t def = build(schema.allOf[i], def, additional, resolver, propertyMarker);\n\t }\n\t\n\t propertyMarker.deleteDuplicates();\n\t propertyMarker.dispose();\n\t }\n\t\n\t return def;\n\t}\n\t\n\tfunction ValidationContext(options) {\n\t this.path = 'data';\n\t this.schema = options.schema;\n\t this.formats = options.formats;\n\t this.greedy = options.greedy;\n\t this.resolver = options.resolver;\n\t this.id = options.id;\n\t this.funcache = options.funcache || {};\n\t this.scope = options.scope || {\n\t equalAny: equalAny,\n\t unique: unique,\n\t ucs2length: ucs2length,\n\t refs: {}\n\t };\n\t}\n\t\n\tValidationContext.prototype.clone = function (schema) {\n\t var ctx = new ValidationContext({\n\t schema: schema,\n\t formats: this.formats,\n\t greedy: this.greedy,\n\t resolver: this.resolver,\n\t id: this.id,\n\t funcache: this.funcache,\n\t scope: this.scope\n\t });\n\t\n\t return ctx;\n\t};\n\t\n\tValidationContext.prototype.declare = function (def) {\n\t var variname = this.id();\n\t this.code.def(variname, def);\n\t return variname;\n\t};\n\t\n\tValidationContext.prototype.cache = function (cacheKey, schema) {\n\t var cached = this.funcache[cacheKey],\n\t context;\n\t\n\t if (!cached) {\n\t cached = this.funcache[cacheKey] = {\n\t key: this.id()\n\t };\n\t\n\t context = this.clone(schema);\n\t\n\t cached.func = context.compile(cached.key);\n\t\n\t this.scope.refs[cached.key] = cached.func;\n\t\n\t context.dispose();\n\t }\n\t\n\t return 'refs.' + cached.key;\n\t};\n\t\n\tValidationContext.prototype.error = function (keyword, key, additional) {\n\t var schema = this.schema,\n\t path = this.path,\n\t errorPath = path !== 'data' || key ?\n\t '(path ? path + \".\" : \"\") + ' + getPathExpression(path, key) + ',' :\n\t 'path,',\n\t res = key && schema.properties && schema.properties[key] ?\n\t this.resolver.resolve(schema.properties[key]) : null,\n\t message = res ? res.requiredMessage : schema.invalidMessage;\n\t\n\t if (!message) {\n\t message = (res && res.messages && res.messages[keyword]) ||\n\t (schema.messages && schema.messages[keyword]);\n\t }\n\t\n\t this.code('errors.push({');\n\t\n\t if (message) {\n\t this.code('message: ' + encodeStr(message) + ',');\n\t }\n\t\n\t if (additional) {\n\t this.code('additionalProperties: ' + additional + ',');\n\t }\n\t\n\t this.code('path: ' + errorPath)\n\t ('keyword: ' + encodeStr(keyword))\n\t ('})');\n\t\n\t if (!this.greedy) {\n\t this.code('return');\n\t }\n\t};\n\t\n\tValidationContext.prototype.refactor = function (path, schema, cacheKey) {\n\t var parentPathExp = path !== 'data' ?\n\t '(path ? path + \".\" : \"\") + ' + getPathExpression(path) :\n\t 'path',\n\t cachedRef = this.cache(cacheKey, schema),\n\t refErrors = this.declare();\n\t\n\t this.code(refErrors + ' = ' + cachedRef + '(' + path + ', ' + parentPathExp + ', errors)');\n\t\n\t if (!this.greedy) {\n\t this.code('if (errors.length) { return }');\n\t }\n\t};\n\t\n\tValidationContext.prototype.descend = function (path, schema) {\n\t var origPath = this.path,\n\t origSchema = this.schema;\n\t\n\t this.path = path;\n\t this.schema = schema;\n\t\n\t this.generate();\n\t\n\t this.path = origPath;\n\t this.schema = origSchema;\n\t};\n\t\n\tValidationContext.prototype.generate = function () {\n\t var path = this.path,\n\t schema = this.schema,\n\t context = this,\n\t scope = this.scope,\n\t encodedFormat,\n\t format,\n\t schemaKeys,\n\t typeKeys,\n\t typeIndex,\n\t validatedType,\n\t i;\n\t\n\t if (type(schema) !== 'object') {\n\t return;\n\t }\n\t\n\t if (schema.$ref !== undefined) {\n\t schema = this.resolver.resolve(schema);\n\t\n\t if (this.resolver.hasRef(schema)) {\n\t this.refactor(path, schema,\n\t this.resolver.getNormalizedRef(this.schema) || this.schema.$ref);\n\t\n\t return;\n\t }\n\t else {\n\t // substitute $ref schema with the resolved instance\n\t this.schema = schema;\n\t }\n\t }\n\t\n\t schemaKeys = groupKeywords(schema);\n\t\n\t if (schemaKeys.enum) {\n\t keywords.enum(context);\n\t\n\t return; // do not process the schema further\n\t }\n\t\n\t typeKeys = Object.keys(schemaKeys.perType);\n\t\n\t function generateForKeyword(keyword) {\n\t keywords[keyword](context); // jshint ignore: line\n\t }\n\t\n\t for (i = 0; i < typeKeys.length; i++) {\n\t validatedType = typeKeys[i];\n\t\n\t this.code((i ? 'else ' : '') + 'if (' + types[validatedType](path) + ') {');\n\t\n\t schemaKeys.perType[validatedType].forEach(generateForKeyword);\n\t\n\t this.code('}');\n\t\n\t if (schemaKeys.type) {\n\t typeIndex = schemaKeys.type.indexOf(validatedType);\n\t\n\t if (typeIndex > -1) {\n\t schemaKeys.type.splice(typeIndex, 1);\n\t }\n\t }\n\t }\n\t\n\t if (schemaKeys.type) { // we have types in the schema\n\t if (schemaKeys.type.length) { // case 1: we still have some left to check\n\t this.code((typeKeys.length ? 'else ' : '') + 'if (!(' + schemaKeys.type.map(function (type) {\n\t return types[type] ? types[type](path) : 'true';\n\t }).join(' || ') + ')) {');\n\t this.error('type');\n\t this.code('}');\n\t }\n\t else {\n\t this.code('else {'); // case 2: we don't have any left to check\n\t this.error('type');\n\t this.code('}');\n\t }\n\t }\n\t\n\t schemaKeys.allType.forEach(function (keyword) {\n\t keywords[keyword](context);\n\t });\n\t\n\t if (schema.format && this.formats) {\n\t format = this.formats[schema.format];\n\t\n\t if (format) {\n\t if (typeof format === 'string' || format instanceof RegExp) {\n\t this.code('if (!(' + inlineRegex(format) + ').test(' + path + ')) {');\n\t this.error('format');\n\t this.code('}');\n\t }\n\t else if (typeof format === 'function') {\n\t (scope.formats || (scope.formats = {}))[schema.format] = format;\n\t (scope.schemas || (scope.schemas = {}))[schema.format] = schema;\n\t\n\t encodedFormat = encodeStr(schema.format);\n\t\n\t this.code('if (!formats[' + encodedFormat + '](' + path + ', schemas[' + encodedFormat + '])) {');\n\t this.error('format');\n\t this.code('}');\n\t }\n\t }\n\t }\n\t};\n\t\n\tValidationContext.prototype.compile = function (id) {\n\t this.code = func('jsen_compiled' + (id ? '_' + id : ''), 'data', 'path', 'errors');\n\t this.generate();\n\t\n\t return this.code.compile(this.scope);\n\t};\n\t\n\tValidationContext.prototype.dispose = function () {\n\t for (var key in this) {\n\t this[key] = undefined;\n\t }\n\t};\n\t\n\tfunction jsen(schema, options) {\n\t if (type(schema) !== 'object') {\n\t throw new Error(INVALID_SCHEMA);\n\t }\n\t\n\t options = options || {};\n\t\n\t var counter = 0,\n\t id = function () { return 'i' + (counter++); },\n\t resolver = new SchemaResolver(schema, options.schemas, options.missing$Ref || false),\n\t context = new ValidationContext({\n\t schema: schema,\n\t resolver: resolver,\n\t id: id,\n\t schemas: options.schemas,\n\t formats: options.formats,\n\t greedy: options.greedy || false\n\t }),\n\t compiled = func('validate', 'data')\n\t ('validate.errors = []')\n\t ('gen(data, \"\", validate.errors)')\n\t ('return validate.errors.length === 0')\n\t .compile({ gen: context.compile() });\n\t\n\t context.dispose();\n\t context = null;\n\t\n\t compiled.errors = [];\n\t\n\t compiled.build = function (initial, options) {\n\t return build(\n\t schema,\n\t (options && options.copy === false ? initial : clone(initial)),\n\t options && options.additionalProperties,\n\t resolver);\n\t };\n\t\n\t return compiled;\n\t}\n\t\n\tjsen.browser = browser;\n\tjsen.clone = clone;\n\tjsen.equal = equal;\n\tjsen.unique = unique;\n\tjsen.ucs2length = ucs2length;\n\tjsen.SchemaResolver = SchemaResolver;\n\tjsen.resolve = SchemaResolver.resolvePointer;\n\t\n\tmodule.exports = jsen;\n\n\n/***/ },\n/* 12 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = function func() {\n\t var args = Array.apply(null, arguments),\n\t name = args.shift(),\n\t tab = ' ',\n\t lines = '',\n\t vars = '',\n\t ind = 1, // indentation\n\t bs = '{[', // block start\n\t be = '}]', // block end\n\t space = function () {\n\t var sp = tab, i = 0;\n\t while (i++ < ind - 1) { sp += tab; }\n\t return sp;\n\t },\n\t add = function (line) {\n\t lines += space() + line + '\\n';\n\t },\n\t builder = function (line) {\n\t var first = line[0],\n\t last = line[line.length - 1];\n\t\n\t if (be.indexOf(first) > -1 && bs.indexOf(last) > -1) {\n\t ind--;\n\t add(line);\n\t ind++;\n\t }\n\t else if (bs.indexOf(last) > -1) {\n\t add(line);\n\t ind++;\n\t }\n\t else if (be.indexOf(first) > -1) {\n\t ind--;\n\t add(line);\n\t }\n\t else {\n\t add(line);\n\t }\n\t\n\t return builder;\n\t };\n\t\n\t builder.def = function (id, def) {\n\t vars += (vars ? ',\\n' + tab + ' ' : '') + id + (def !== undefined ? ' = ' + def : '');\n\t return builder;\n\t };\n\t\n\t builder.toSource = function () {\n\t return 'function ' + name + '(' + args.join(', ') + ') {\\n' +\n\t tab + '\"use strict\"' + '\\n' +\n\t (vars ? tab + 'var ' + vars + ';\\n' : '') +\n\t lines + '}';\n\t };\n\t\n\t builder.compile = function (scope) {\n\t var src = 'return (' + builder.toSource() + ')',\n\t scp = scope || {},\n\t keys = Object.keys(scp),\n\t vals = keys.map(function (key) { return scp[key]; });\n\t\n\t return Function.apply(null, keys.concat(src)).apply(null, vals);\n\t };\n\t\n\t return builder;\n\t};\n\n/***/ },\n/* 13 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tfunction type(obj) {\n\t var str = Object.prototype.toString.call(obj);\n\t return str.substr(8, str.length - 9).toLowerCase();\n\t}\n\t\n\tfunction deepEqual(a, b) {\n\t var keysA = Object.keys(a).sort(),\n\t keysB = Object.keys(b).sort(),\n\t i, key;\n\t\n\t if (!equal(keysA, keysB)) {\n\t return false;\n\t }\n\t\n\t for (i = 0; i < keysA.length; i++) {\n\t key = keysA[i];\n\t\n\t if (!equal(a[key], b[key])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t}\n\t\n\tfunction equal(a, b) { // jshint ignore: line\n\t var typeA = typeof a,\n\t typeB = typeof b,\n\t i;\n\t\n\t // get detailed object type\n\t if (typeA === 'object') {\n\t typeA = type(a);\n\t }\n\t\n\t // get detailed object type\n\t if (typeB === 'object') {\n\t typeB = type(b);\n\t }\n\t\n\t if (typeA !== typeB) {\n\t return false;\n\t }\n\t\n\t if (typeA === 'object') {\n\t return deepEqual(a, b);\n\t }\n\t\n\t if (typeA === 'regexp') {\n\t return a.toString() === b.toString();\n\t }\n\t\n\t if (typeA === 'array') {\n\t if (a.length !== b.length) {\n\t return false;\n\t }\n\t\n\t for (i = 0; i < a.length; i++) {\n\t if (!equal(a[i], b[i])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t }\n\t\n\t return a === b;\n\t}\n\t\n\tmodule.exports = equal;\n\n/***/ },\n/* 14 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar equal = __webpack_require__(13);\n\t\n\tfunction findIndex(arr, value, comparator) {\n\t for (var i = 0, len = arr.length; i < len; i++) {\n\t if (comparator(arr[i], value)) {\n\t return i;\n\t }\n\t }\n\t\n\t return -1;\n\t}\n\t\n\tmodule.exports = function unique(arr) {\n\t return arr.filter(function uniqueOnly(value, index, self) {\n\t return findIndex(self, value, equal) === index;\n\t });\n\t};\n\t\n\tmodule.exports.findIndex = findIndex;\n\n/***/ },\n/* 15 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar url = __webpack_require__(16),\n\t metaschema = __webpack_require__(23),\n\t INVALID_SCHEMA_REFERENCE = 'jsen: invalid schema reference',\n\t DUPLICATE_SCHEMA_ID = 'jsen: duplicate schema id',\n\t CIRCULAR_SCHEMA_REFERENCE = 'jsen: circular schema reference';\n\t\n\tfunction get(obj, path) {\n\t if (!path.length) {\n\t return obj;\n\t }\n\t\n\t var key = path.shift(),\n\t val;\n\t\n\t if (obj && typeof obj === 'object' && obj.hasOwnProperty(key)) {\n\t val = obj[key];\n\t }\n\t\n\t if (path.length) {\n\t if (val && typeof val === 'object') {\n\t return get(val, path);\n\t }\n\t\n\t return undefined;\n\t }\n\t\n\t return val;\n\t}\n\t\n\tfunction refToObj(ref) {\n\t var index = ref.indexOf('#'),\n\t ret = {\n\t base: ref.substr(0, index),\n\t path: []\n\t };\n\t\n\t if (index < 0) {\n\t ret.base = ref;\n\t return ret;\n\t }\n\t\n\t ref = ref.substr(index + 1);\n\t\n\t if (!ref) {\n\t return ret;\n\t }\n\t\n\t ret.path = ref.split('/').map(function (segment) {\n\t // Reference: http://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-08#section-3\n\t return decodeURIComponent(segment)\n\t .replace(/~1/g, '/')\n\t .replace(/~0/g, '~');\n\t });\n\t\n\t if (ref[0] === '/') {\n\t ret.path.shift();\n\t }\n\t\n\t return ret;\n\t}\n\t\n\t// TODO: Can we prevent nested resolvers and combine schemas instead?\n\tfunction SchemaResolver(rootSchema, external, missing$Ref, baseId) { // jshint ignore: line\n\t this.rootSchema = rootSchema;\n\t this.resolvers = null;\n\t this.resolvedRootSchema = null;\n\t this.cache = {};\n\t this.idCache = {};\n\t this.refCache = { refs: [], schemas: [] };\n\t this.missing$Ref = missing$Ref;\n\t this.refStack = [];\n\t\n\t baseId = baseId || '';\n\t\n\t this._buildIdCache(rootSchema, baseId);\n\t\n\t // get updated base id after normalizing root schema id\n\t baseId = this.refCache.refs[this.refCache.schemas.indexOf(this.rootSchema)] || baseId;\n\t\n\t this._buildResolvers(external, baseId);\n\t}\n\t\n\tSchemaResolver.prototype._cacheId = function (id, schema, resolver) {\n\t if (this.idCache[id]) {\n\t throw new Error(DUPLICATE_SCHEMA_ID + ' ' + id);\n\t }\n\t\n\t this.idCache[id] = { resolver: resolver, schema: schema };\n\t};\n\t\n\tSchemaResolver.prototype._buildIdCache = function (schema, baseId) {\n\t var id = baseId,\n\t ref, keys, i;\n\t\n\t if (!schema || typeof schema !== 'object') {\n\t return;\n\t }\n\t\n\t if (typeof schema.id === 'string' && schema.id) {\n\t id = url.resolve(baseId, schema.id);\n\t\n\t this._cacheId(id, schema, this);\n\t }\n\t else if (schema === this.rootSchema && baseId) {\n\t this._cacheId(baseId, schema, this);\n\t }\n\t\n\t if (schema.$ref && typeof schema.$ref === 'string') {\n\t ref = url.resolve(id, schema.$ref);\n\t\n\t this.refCache.schemas.push(schema);\n\t this.refCache.refs.push(ref);\n\t }\n\t\n\t keys = Object.keys(schema);\n\t\n\t for (i = 0; i < keys.length; i++) {\n\t this._buildIdCache(schema[keys[i]], id);\n\t }\n\t};\n\t\n\tSchemaResolver.prototype._buildResolvers = function (schemas, baseId) {\n\t if (!schemas || typeof schemas !== 'object') {\n\t return;\n\t }\n\t\n\t var that = this,\n\t resolvers = {};\n\t\n\t Object.keys(schemas).forEach(function (key) {\n\t var id = url.resolve(baseId, key),\n\t resolver = new SchemaResolver(schemas[key], null, that.missing$Ref, id);\n\t\n\t that._cacheId(id, resolver.rootSchema, resolver);\n\t\n\t Object.keys(resolver.idCache).forEach(function (idKey) {\n\t that.idCache[idKey] = resolver.idCache[idKey];\n\t });\n\t\n\t resolvers[key] = resolver;\n\t });\n\t\n\t this.resolvers = resolvers;\n\t};\n\t\n\tSchemaResolver.prototype.getNormalizedRef = function (schema) {\n\t var index = this.refCache.schemas.indexOf(schema);\n\t return this.refCache.refs[index];\n\t};\n\t\n\tSchemaResolver.prototype._resolveRef = function (ref) {\n\t var err = new Error(INVALID_SCHEMA_REFERENCE + ' ' + ref),\n\t idCache = this.idCache,\n\t externalResolver, cached, descriptor, path, dest;\n\t\n\t if (!ref || typeof ref !== 'string') {\n\t throw err;\n\t }\n\t\n\t if (ref === metaschema.id) {\n\t dest = metaschema;\n\t }\n\t\n\t cached = idCache[ref];\n\t\n\t if (cached) {\n\t dest = cached.resolver.resolve(cached.schema);\n\t }\n\t\n\t if (dest === undefined) {\n\t descriptor = refToObj(ref);\n\t path = descriptor.path;\n\t\n\t if (descriptor.base) {\n\t cached = idCache[descriptor.base] || idCache[descriptor.base + '#'];\n\t\n\t if (cached) {\n\t dest = cached.resolver.resolve(get(cached.schema, path.slice(0)));\n\t }\n\t else {\n\t path.unshift(descriptor.base);\n\t }\n\t }\n\t }\n\t\n\t if (dest === undefined && this.resolvedRootSchema) {\n\t dest = get(this.resolvedRootSchema, path.slice(0));\n\t }\n\t\n\t if (dest === undefined) {\n\t dest = get(this.rootSchema, path.slice(0));\n\t }\n\t\n\t if (dest === undefined && path.length && this.resolvers) {\n\t externalResolver = get(this.resolvers, path);\n\t\n\t if (externalResolver) {\n\t dest = externalResolver.resolve(externalResolver.rootSchema);\n\t }\n\t }\n\t\n\t if (dest === undefined || typeof dest !== 'object') {\n\t if (this.missing$Ref) {\n\t dest = {};\n\t } else {\n\t throw err;\n\t }\n\t }\n\t\n\t if (this.cache[ref] === dest) {\n\t return dest;\n\t }\n\t\n\t this.cache[ref] = dest;\n\t\n\t if (dest.$ref !== undefined) {\n\t dest = this.resolve(dest);\n\t }\n\t\n\t return dest;\n\t};\n\t\n\tSchemaResolver.prototype.resolve = function (schema) {\n\t if (!schema || typeof schema !== 'object' || schema.$ref === undefined) {\n\t return schema;\n\t }\n\t\n\t var ref = this.getNormalizedRef(schema) || schema.$ref,\n\t resolved = this.cache[ref];\n\t\n\t if (resolved !== undefined) {\n\t return resolved;\n\t }\n\t\n\t if (this.refStack.indexOf(ref) > -1) {\n\t throw new Error(CIRCULAR_SCHEMA_REFERENCE + ' ' + ref);\n\t }\n\t\n\t this.refStack.push(ref);\n\t\n\t resolved = this._resolveRef(ref);\n\t\n\t this.refStack.pop();\n\t\n\t if (schema === this.rootSchema) {\n\t // cache the resolved root schema\n\t this.resolvedRootSchema = resolved;\n\t }\n\t\n\t return resolved;\n\t};\n\t\n\tSchemaResolver.prototype.hasRef = function (schema) {\n\t var keys = Object.keys(schema),\n\t len, key, i, hasChildRef;\n\t\n\t if (keys.indexOf('$ref') > -1) {\n\t return true;\n\t }\n\t\n\t for (i = 0, len = keys.length; i < len; i++) {\n\t key = keys[i];\n\t\n\t if (schema[key] && typeof schema[key] === 'object' && !Array.isArray(schema[key])) {\n\t hasChildRef = this.hasRef(schema[key]);\n\t\n\t if (hasChildRef) {\n\t return true;\n\t }\n\t }\n\t }\n\t\n\t return false;\n\t};\n\t\n\tSchemaResolver.resolvePointer = function (obj, pointer) {\n\t var descriptor = refToObj(pointer),\n\t path = descriptor.path;\n\t\n\t if (descriptor.base) {\n\t path = [descriptor.base].concat(path);\n\t }\n\t\n\t return get(obj, path);\n\t};\n\t\n\tmodule.exports = SchemaResolver;\n\n/***/ },\n/* 16 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t// Copyright Joyent, Inc. and other Node contributors.\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a\n\t// copy of this software and associated documentation files (the\n\t// \"Software\"), to deal in the Software without restriction, including\n\t// without limitation the rights to use, copy, modify, merge, publish,\n\t// distribute, sublicense, and/or sell copies of the Software, and to permit\n\t// persons to whom the Software is furnished to do so, subject to the\n\t// following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included\n\t// in all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n\t// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\t// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n\t// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n\t// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n\t// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n\t// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\t\n\t'use strict';\n\t\n\tvar punycode = __webpack_require__(17);\n\tvar util = __webpack_require__(19);\n\t\n\texports.parse = urlParse;\n\texports.resolve = urlResolve;\n\texports.resolveObject = urlResolveObject;\n\texports.format = urlFormat;\n\t\n\texports.Url = Url;\n\t\n\tfunction Url() {\n\t this.protocol = null;\n\t this.slashes = null;\n\t this.auth = null;\n\t this.host = null;\n\t this.port = null;\n\t this.hostname = null;\n\t this.hash = null;\n\t this.search = null;\n\t this.query = null;\n\t this.pathname = null;\n\t this.path = null;\n\t this.href = null;\n\t}\n\t\n\t// Reference: RFC 3986, RFC 1808, RFC 2396\n\t\n\t// define these here so at least they only have to be\n\t// compiled once on the first module load.\n\tvar protocolPattern = /^([a-z0-9.+-]+:)/i,\n\t portPattern = /:[0-9]*$/,\n\t\n\t // Special case for a simple path URL\n\t simplePathPattern = /^(\\/\\/?(?!\\/)[^\\?\\s]*)(\\?[^\\s]*)?$/,\n\t\n\t // RFC 2396: characters reserved for delimiting URLs.\n\t // We actually just auto-escape these.\n\t delims = ['<', '>', '\"', '`', ' ', '\\r', '\\n', '\\t'],\n\t\n\t // RFC 2396: characters not allowed for various reasons.\n\t unwise = ['{', '}', '|', '\\\\', '^', '`'].concat(delims),\n\t\n\t // Allowed by RFCs, but cause of XSS attacks. Always escape these.\n\t autoEscape = ['\\''].concat(unwise),\n\t // Characters that are never ever allowed in a hostname.\n\t // Note that any invalid chars are also handled, but these\n\t // are the ones that are *expected* to be seen, so we fast-path\n\t // them.\n\t nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape),\n\t hostEndingChars = ['/', '?', '#'],\n\t hostnameMaxLen = 255,\n\t hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,\n\t hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,\n\t // protocols that can allow \"unsafe\" and \"unwise\" chars.\n\t unsafeProtocol = {\n\t 'javascript': true,\n\t 'javascript:': true\n\t },\n\t // protocols that never have a hostname.\n\t hostlessProtocol = {\n\t 'javascript': true,\n\t 'javascript:': true\n\t },\n\t // protocols that always contain a // bit.\n\t slashedProtocol = {\n\t 'http': true,\n\t 'https': true,\n\t 'ftp': true,\n\t 'gopher': true,\n\t 'file': true,\n\t 'http:': true,\n\t 'https:': true,\n\t 'ftp:': true,\n\t 'gopher:': true,\n\t 'file:': true\n\t },\n\t querystring = __webpack_require__(20);\n\t\n\tfunction urlParse(url, parseQueryString, slashesDenoteHost) {\n\t if (url && util.isObject(url) && url instanceof Url) return url;\n\t\n\t var u = new Url;\n\t u.parse(url, parseQueryString, slashesDenoteHost);\n\t return u;\n\t}\n\t\n\tUrl.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {\n\t if (!util.isString(url)) {\n\t throw new TypeError(\"Parameter 'url' must be a string, not \" + typeof url);\n\t }\n\t\n\t // Copy chrome, IE, opera backslash-handling behavior.\n\t // Back slashes before the query string get converted to forward slashes\n\t // See: https://code.google.com/p/chromium/issues/detail?id=25916\n\t var queryIndex = url.indexOf('?'),\n\t splitter =\n\t (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#',\n\t uSplit = url.split(splitter),\n\t slashRegex = /\\\\/g;\n\t uSplit[0] = uSplit[0].replace(slashRegex, '/');\n\t url = uSplit.join(splitter);\n\t\n\t var rest = url;\n\t\n\t // trim before proceeding.\n\t // This is to support parse stuff like \" http://foo.com \\n\"\n\t rest = rest.trim();\n\t\n\t if (!slashesDenoteHost && url.split('#').length === 1) {\n\t // Try fast path regexp\n\t var simplePath = simplePathPattern.exec(rest);\n\t if (simplePath) {\n\t this.path = rest;\n\t this.href = rest;\n\t this.pathname = simplePath[1];\n\t if (simplePath[2]) {\n\t this.search = simplePath[2];\n\t if (parseQueryString) {\n\t this.query = querystring.parse(this.search.substr(1));\n\t } else {\n\t this.query = this.search.substr(1);\n\t }\n\t } else if (parseQueryString) {\n\t this.search = '';\n\t this.query = {};\n\t }\n\t return this;\n\t }\n\t }\n\t\n\t var proto = protocolPattern.exec(rest);\n\t if (proto) {\n\t proto = proto[0];\n\t var lowerProto = proto.toLowerCase();\n\t this.protocol = lowerProto;\n\t rest = rest.substr(proto.length);\n\t }\n\t\n\t // figure out if it's got a host\n\t // user@server is *always* interpreted as a hostname, and url\n\t // resolution will treat //foo/bar as host=foo,path=bar because that's\n\t // how the browser resolves relative URLs.\n\t if (slashesDenoteHost || proto || rest.match(/^\\/\\/[^@\\/]+@[^@\\/]+/)) {\n\t var slashes = rest.substr(0, 2) === '//';\n\t if (slashes && !(proto && hostlessProtocol[proto])) {\n\t rest = rest.substr(2);\n\t this.slashes = true;\n\t }\n\t }\n\t\n\t if (!hostlessProtocol[proto] &&\n\t (slashes || (proto && !slashedProtocol[proto]))) {\n\t\n\t // there's a hostname.\n\t // the first instance of /, ?, ;, or # ends the host.\n\t //\n\t // If there is an @ in the hostname, then non-host chars *are* allowed\n\t // to the left of the last @ sign, unless some host-ending character\n\t // comes *before* the @-sign.\n\t // URLs are obnoxious.\n\t //\n\t // ex:\n\t // http://a@b@c/ => user:a@b host:c\n\t // http://a@b?@c => user:a host:c path:/?@c\n\t\n\t // v0.12 TODO(isaacs): This is not quite how Chrome does things.\n\t // Review our test case against browsers more comprehensively.\n\t\n\t // find the first instance of any hostEndingChars\n\t var hostEnd = -1;\n\t for (var i = 0; i < hostEndingChars.length; i++) {\n\t var hec = rest.indexOf(hostEndingChars[i]);\n\t if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n\t hostEnd = hec;\n\t }\n\t\n\t // at this point, either we have an explicit point where the\n\t // auth portion cannot go past, or the last @ char is the decider.\n\t var auth, atSign;\n\t if (hostEnd === -1) {\n\t // atSign can be anywhere.\n\t atSign = rest.lastIndexOf('@');\n\t } else {\n\t // atSign must be in auth portion.\n\t // http://a@b/c@d => host:b auth:a path:/c@d\n\t atSign = rest.lastIndexOf('@', hostEnd);\n\t }\n\t\n\t // Now we have a portion which is definitely the auth.\n\t // Pull that off.\n\t if (atSign !== -1) {\n\t auth = rest.slice(0, atSign);\n\t rest = rest.slice(atSign + 1);\n\t this.auth = decodeURIComponent(auth);\n\t }\n\t\n\t // the host is the remaining to the left of the first non-host char\n\t hostEnd = -1;\n\t for (var i = 0; i < nonHostChars.length; i++) {\n\t var hec = rest.indexOf(nonHostChars[i]);\n\t if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n\t hostEnd = hec;\n\t }\n\t // if we still have not hit it, then the entire thing is a host.\n\t if (hostEnd === -1)\n\t hostEnd = rest.length;\n\t\n\t this.host = rest.slice(0, hostEnd);\n\t rest = rest.slice(hostEnd);\n\t\n\t // pull out port.\n\t this.parseHost();\n\t\n\t // we've indicated that there is a hostname,\n\t // so even if it's empty, it has to be present.\n\t this.hostname = this.hostname || '';\n\t\n\t // if hostname begins with [ and ends with ]\n\t // assume that it's an IPv6 address.\n\t var ipv6Hostname = this.hostname[0] === '[' &&\n\t this.hostname[this.hostname.length - 1] === ']';\n\t\n\t // validate a little.\n\t if (!ipv6Hostname) {\n\t var hostparts = this.hostname.split(/\\./);\n\t for (var i = 0, l = hostparts.length; i < l; i++) {\n\t var part = hostparts[i];\n\t if (!part) continue;\n\t if (!part.match(hostnamePartPattern)) {\n\t var newpart = '';\n\t for (var j = 0, k = part.length; j < k; j++) {\n\t if (part.charCodeAt(j) > 127) {\n\t // we replace non-ASCII char with a temporary placeholder\n\t // we need this to make sure size of hostname is not\n\t // broken by replacing non-ASCII by nothing\n\t newpart += 'x';\n\t } else {\n\t newpart += part[j];\n\t }\n\t }\n\t // we test again with ASCII char only\n\t if (!newpart.match(hostnamePartPattern)) {\n\t var validParts = hostparts.slice(0, i);\n\t var notHost = hostparts.slice(i + 1);\n\t var bit = part.match(hostnamePartStart);\n\t if (bit) {\n\t validParts.push(bit[1]);\n\t notHost.unshift(bit[2]);\n\t }\n\t if (notHost.length) {\n\t rest = '/' + notHost.join('.') + rest;\n\t }\n\t this.hostname = validParts.join('.');\n\t break;\n\t }\n\t }\n\t }\n\t }\n\t\n\t if (this.hostname.length > hostnameMaxLen) {\n\t this.hostname = '';\n\t } else {\n\t // hostnames are always lower case.\n\t this.hostname = this.hostname.toLowerCase();\n\t }\n\t\n\t if (!ipv6Hostname) {\n\t // IDNA Support: Returns a punycoded representation of \"domain\".\n\t // It only converts parts of the domain name that\n\t // have non-ASCII characters, i.e. it doesn't matter if\n\t // you call it with a domain that already is ASCII-only.\n\t this.hostname = punycode.toASCII(this.hostname);\n\t }\n\t\n\t var p = this.port ? ':' + this.port : '';\n\t var h = this.hostname || '';\n\t this.host = h + p;\n\t this.href += this.host;\n\t\n\t // strip [ and ] from the hostname\n\t // the host field still retains them, though\n\t if (ipv6Hostname) {\n\t this.hostname = this.hostname.substr(1, this.hostname.length - 2);\n\t if (rest[0] !== '/') {\n\t rest = '/' + rest;\n\t }\n\t }\n\t }\n\t\n\t // now rest is set to the post-host stuff.\n\t // chop off any delim chars.\n\t if (!unsafeProtocol[lowerProto]) {\n\t\n\t // First, make 100% sure that any \"autoEscape\" chars get\n\t // escaped, even if encodeURIComponent doesn't think they\n\t // need to be.\n\t for (var i = 0, l = autoEscape.length; i < l; i++) {\n\t var ae = autoEscape[i];\n\t if (rest.indexOf(ae) === -1)\n\t continue;\n\t var esc = encodeURIComponent(ae);\n\t if (esc === ae) {\n\t esc = escape(ae);\n\t }\n\t rest = rest.split(ae).join(esc);\n\t }\n\t }\n\t\n\t\n\t // chop off from the tail first.\n\t var hash = rest.indexOf('#');\n\t if (hash !== -1) {\n\t // got a fragment string.\n\t this.hash = rest.substr(hash);\n\t rest = rest.slice(0, hash);\n\t }\n\t var qm = rest.indexOf('?');\n\t if (qm !== -1) {\n\t this.search = rest.substr(qm);\n\t this.query = rest.substr(qm + 1);\n\t if (parseQueryString) {\n\t this.query = querystring.parse(this.query);\n\t }\n\t rest = rest.slice(0, qm);\n\t } else if (parseQueryString) {\n\t // no query string, but parseQueryString still requested\n\t this.search = '';\n\t this.query = {};\n\t }\n\t if (rest) this.pathname = rest;\n\t if (slashedProtocol[lowerProto] &&\n\t this.hostname && !this.pathname) {\n\t this.pathname = '/';\n\t }\n\t\n\t //to support http.request\n\t if (this.pathname || this.search) {\n\t var p = this.pathname || '';\n\t var s = this.search || '';\n\t this.path = p + s;\n\t }\n\t\n\t // finally, reconstruct the href based on what has been validated.\n\t this.href = this.format();\n\t return this;\n\t};\n\t\n\t// format a parsed object into a url string\n\tfunction urlFormat(obj) {\n\t // ensure it's an object, and not a string url.\n\t // If it's an obj, this is a no-op.\n\t // this way, you can call url_format() on strings\n\t // to clean up potentially wonky urls.\n\t if (util.isString(obj)) obj = urlParse(obj);\n\t if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n\t return obj.format();\n\t}\n\t\n\tUrl.prototype.format = function() {\n\t var auth = this.auth || '';\n\t if (auth) {\n\t auth = encodeURIComponent(auth);\n\t auth = auth.replace(/%3A/i, ':');\n\t auth += '@';\n\t }\n\t\n\t var protocol = this.protocol || '',\n\t pathname = this.pathname || '',\n\t hash = this.hash || '',\n\t host = false,\n\t query = '';\n\t\n\t if (this.host) {\n\t host = auth + this.host;\n\t } else if (this.hostname) {\n\t host = auth + (this.hostname.indexOf(':') === -1 ?\n\t this.hostname :\n\t '[' + this.hostname + ']');\n\t if (this.port) {\n\t host += ':' + this.port;\n\t }\n\t }\n\t\n\t if (this.query &&\n\t util.isObject(this.query) &&\n\t Object.keys(this.query).length) {\n\t query = querystring.stringify(this.query);\n\t }\n\t\n\t var search = this.search || (query && ('?' + query)) || '';\n\t\n\t if (protocol && protocol.substr(-1) !== ':') protocol += ':';\n\t\n\t // only the slashedProtocols get the //. Not mailto:, xmpp:, etc.\n\t // unless they had them to begin with.\n\t if (this.slashes ||\n\t (!protocol || slashedProtocol[protocol]) && host !== false) {\n\t host = '//' + (host || '');\n\t if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname;\n\t } else if (!host) {\n\t host = '';\n\t }\n\t\n\t if (hash && hash.charAt(0) !== '#') hash = '#' + hash;\n\t if (search && search.charAt(0) !== '?') search = '?' + search;\n\t\n\t pathname = pathname.replace(/[?#]/g, function(match) {\n\t return encodeURIComponent(match);\n\t });\n\t search = search.replace('#', '%23');\n\t\n\t return protocol + host + pathname + search + hash;\n\t};\n\t\n\tfunction urlResolve(source, relative) {\n\t return urlParse(source, false, true).resolve(relative);\n\t}\n\t\n\tUrl.prototype.resolve = function(relative) {\n\t return this.resolveObject(urlParse(relative, false, true)).format();\n\t};\n\t\n\tfunction urlResolveObject(source, relative) {\n\t if (!source) return relative;\n\t return urlParse(source, false, true).resolveObject(relative);\n\t}\n\t\n\tUrl.prototype.resolveObject = function(relative) {\n\t if (util.isString(relative)) {\n\t var rel = new Url();\n\t rel.parse(relative, false, true);\n\t relative = rel;\n\t }\n\t\n\t var result = new Url();\n\t var tkeys = Object.keys(this);\n\t for (var tk = 0; tk < tkeys.length; tk++) {\n\t var tkey = tkeys[tk];\n\t result[tkey] = this[tkey];\n\t }\n\t\n\t // hash is always overridden, no matter what.\n\t // even href=\"\" will remove it.\n\t result.hash = relative.hash;\n\t\n\t // if the relative url is empty, then there's nothing left to do here.\n\t if (relative.href === '') {\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t // hrefs like //foo/bar always cut to the protocol.\n\t if (relative.slashes && !relative.protocol) {\n\t // take everything except the protocol from relative\n\t var rkeys = Object.keys(relative);\n\t for (var rk = 0; rk < rkeys.length; rk++) {\n\t var rkey = rkeys[rk];\n\t if (rkey !== 'protocol')\n\t result[rkey] = relative[rkey];\n\t }\n\t\n\t //urlParse appends trailing / to urls like http://www.example.com\n\t if (slashedProtocol[result.protocol] &&\n\t result.hostname && !result.pathname) {\n\t result.path = result.pathname = '/';\n\t }\n\t\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t if (relative.protocol && relative.protocol !== result.protocol) {\n\t // if it's a known url protocol, then changing\n\t // the protocol does weird things\n\t // first, if it's not file:, then we MUST have a host,\n\t // and if there was a path\n\t // to begin with, then we MUST have a path.\n\t // if it is file:, then the host is dropped,\n\t // because that's known to be hostless.\n\t // anything else is assumed to be absolute.\n\t if (!slashedProtocol[relative.protocol]) {\n\t var keys = Object.keys(relative);\n\t for (var v = 0; v < keys.length; v++) {\n\t var k = keys[v];\n\t result[k] = relative[k];\n\t }\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t result.protocol = relative.protocol;\n\t if (!relative.host && !hostlessProtocol[relative.protocol]) {\n\t var relPath = (relative.pathname || '').split('/');\n\t while (relPath.length && !(relative.host = relPath.shift()));\n\t if (!relative.host) relative.host = '';\n\t if (!relative.hostname) relative.hostname = '';\n\t if (relPath[0] !== '') relPath.unshift('');\n\t if (relPath.length < 2) relPath.unshift('');\n\t result.pathname = relPath.join('/');\n\t } else {\n\t result.pathname = relative.pathname;\n\t }\n\t result.search = relative.search;\n\t result.query = relative.query;\n\t result.host = relative.host || '';\n\t result.auth = relative.auth;\n\t result.hostname = relative.hostname || relative.host;\n\t result.port = relative.port;\n\t // to support http.request\n\t if (result.pathname || result.search) {\n\t var p = result.pathname || '';\n\t var s = result.search || '';\n\t result.path = p + s;\n\t }\n\t result.slashes = result.slashes || relative.slashes;\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'),\n\t isRelAbs = (\n\t relative.host ||\n\t relative.pathname && relative.pathname.charAt(0) === '/'\n\t ),\n\t mustEndAbs = (isRelAbs || isSourceAbs ||\n\t (result.host && relative.pathname)),\n\t removeAllDots = mustEndAbs,\n\t srcPath = result.pathname && result.pathname.split('/') || [],\n\t relPath = relative.pathname && relative.pathname.split('/') || [],\n\t psychotic = result.protocol && !slashedProtocol[result.protocol];\n\t\n\t // if the url is a non-slashed url, then relative\n\t // links like ../.. should be able\n\t // to crawl up to the hostname, as well. This is strange.\n\t // result.protocol has already been set by now.\n\t // Later on, put the first path part into the host field.\n\t if (psychotic) {\n\t result.hostname = '';\n\t result.port = null;\n\t if (result.host) {\n\t if (srcPath[0] === '') srcPath[0] = result.host;\n\t else srcPath.unshift(result.host);\n\t }\n\t result.host = '';\n\t if (relative.protocol) {\n\t relative.hostname = null;\n\t relative.port = null;\n\t if (relative.host) {\n\t if (relPath[0] === '') relPath[0] = relative.host;\n\t else relPath.unshift(relative.host);\n\t }\n\t relative.host = null;\n\t }\n\t mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === '');\n\t }\n\t\n\t if (isRelAbs) {\n\t // it's absolute.\n\t result.host = (relative.host || relative.host === '') ?\n\t relative.host : result.host;\n\t result.hostname = (relative.hostname || relative.hostname === '') ?\n\t relative.hostname : result.hostname;\n\t result.search = relative.search;\n\t result.query = relative.query;\n\t srcPath = relPath;\n\t // fall through to the dot-handling below.\n\t } else if (relPath.length) {\n\t // it's relative\n\t // throw away the existing file, and take the new path instead.\n\t if (!srcPath) srcPath = [];\n\t srcPath.pop();\n\t srcPath = srcPath.concat(relPath);\n\t result.search = relative.search;\n\t result.query = relative.query;\n\t } else if (!util.isNullOrUndefined(relative.search)) {\n\t // just pull out the search.\n\t // like href='https://github.com/?foo'.\n\t // Put this after the other two cases because it simplifies the booleans\n\t if (psychotic) {\n\t result.hostname = result.host = srcPath.shift();\n\t //occationaly the auth can get stuck only in host\n\t //this especially happens in cases like\n\t //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n\t var authInHost = result.host && result.host.indexOf('@') > 0 ?\n\t result.host.split('@') : false;\n\t if (authInHost) {\n\t result.auth = authInHost.shift();\n\t result.host = result.hostname = authInHost.shift();\n\t }\n\t }\n\t result.search = relative.search;\n\t result.query = relative.query;\n\t //to support http.request\n\t if (!util.isNull(result.pathname) || !util.isNull(result.search)) {\n\t result.path = (result.pathname ? result.pathname : '') +\n\t (result.search ? result.search : '');\n\t }\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t if (!srcPath.length) {\n\t // no path at all. easy.\n\t // we've already handled the other stuff above.\n\t result.pathname = null;\n\t //to support http.request\n\t if (result.search) {\n\t result.path = '/' + result.search;\n\t } else {\n\t result.path = null;\n\t }\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t // if a url ENDs in . or .., then it must get a trailing slash.\n\t // however, if it ends in anything else non-slashy,\n\t // then it must NOT get a trailing slash.\n\t var last = srcPath.slice(-1)[0];\n\t var hasTrailingSlash = (\n\t (result.host || relative.host || srcPath.length > 1) &&\n\t (last === '.' || last === '..') || last === '');\n\t\n\t // strip single dots, resolve double dots to parent dir\n\t // if the path tries to go above the root, `up` ends up > 0\n\t var up = 0;\n\t for (var i = srcPath.length; i >= 0; i--) {\n\t last = srcPath[i];\n\t if (last === '.') {\n\t srcPath.splice(i, 1);\n\t } else if (last === '..') {\n\t srcPath.splice(i, 1);\n\t up++;\n\t } else if (up) {\n\t srcPath.splice(i, 1);\n\t up--;\n\t }\n\t }\n\t\n\t // if the path is allowed to go above the root, restore leading ..s\n\t if (!mustEndAbs && !removeAllDots) {\n\t for (; up--; up) {\n\t srcPath.unshift('..');\n\t }\n\t }\n\t\n\t if (mustEndAbs && srcPath[0] !== '' &&\n\t (!srcPath[0] || srcPath[0].charAt(0) !== '/')) {\n\t srcPath.unshift('');\n\t }\n\t\n\t if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) {\n\t srcPath.push('');\n\t }\n\t\n\t var isAbsolute = srcPath[0] === '' ||\n\t (srcPath[0] && srcPath[0].charAt(0) === '/');\n\t\n\t // put the host back\n\t if (psychotic) {\n\t result.hostname = result.host = isAbsolute ? '' :\n\t srcPath.length ? srcPath.shift() : '';\n\t //occationaly the auth can get stuck only in host\n\t //this especially happens in cases like\n\t //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n\t var authInHost = result.host && result.host.indexOf('@') > 0 ?\n\t result.host.split('@') : false;\n\t if (authInHost) {\n\t result.auth = authInHost.shift();\n\t result.host = result.hostname = authInHost.shift();\n\t }\n\t }\n\t\n\t mustEndAbs = mustEndAbs || (result.host && srcPath.length);\n\t\n\t if (mustEndAbs && !isAbsolute) {\n\t srcPath.unshift('');\n\t }\n\t\n\t if (!srcPath.length) {\n\t result.pathname = null;\n\t result.path = null;\n\t } else {\n\t result.pathname = srcPath.join('/');\n\t }\n\t\n\t //to support request.http\n\t if (!util.isNull(result.pathname) || !util.isNull(result.search)) {\n\t result.path = (result.pathname ? result.pathname : '') +\n\t (result.search ? result.search : '');\n\t }\n\t result.auth = relative.auth || result.auth;\n\t result.slashes = result.slashes || relative.slashes;\n\t result.href = result.format();\n\t return result;\n\t};\n\t\n\tUrl.prototype.parseHost = function() {\n\t var host = this.host;\n\t var port = portPattern.exec(host);\n\t if (port) {\n\t port = port[0];\n\t if (port !== ':') {\n\t this.port = port.substr(1);\n\t }\n\t host = host.substr(0, host.length - port.length);\n\t }\n\t if (host) this.hostname = host;\n\t};\n\n\n/***/ },\n/* 17 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(module, global) {/*! https://mths.be/punycode v1.3.2 by @mathias */\n\t;(function(root) {\n\t\n\t\t/** Detect free variables */\n\t\tvar freeExports = typeof exports == 'object' && exports &&\n\t\t\t!exports.nodeType && exports;\n\t\tvar freeModule = typeof module == 'object' && module &&\n\t\t\t!module.nodeType && module;\n\t\tvar freeGlobal = typeof global == 'object' && global;\n\t\tif (\n\t\t\tfreeGlobal.global === freeGlobal ||\n\t\t\tfreeGlobal.window === freeGlobal ||\n\t\t\tfreeGlobal.self === freeGlobal\n\t\t) {\n\t\t\troot = freeGlobal;\n\t\t}\n\t\n\t\t/**\n\t\t * The `punycode` object.\n\t\t * @name punycode\n\t\t * @type Object\n\t\t */\n\t\tvar punycode,\n\t\n\t\t/** Highest positive signed 32-bit float value */\n\t\tmaxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1\n\t\n\t\t/** Bootstring parameters */\n\t\tbase = 36,\n\t\ttMin = 1,\n\t\ttMax = 26,\n\t\tskew = 38,\n\t\tdamp = 700,\n\t\tinitialBias = 72,\n\t\tinitialN = 128, // 0x80\n\t\tdelimiter = '-', // '\\x2D'\n\t\n\t\t/** Regular expressions */\n\t\tregexPunycode = /^xn--/,\n\t\tregexNonASCII = /[^\\x20-\\x7E]/, // unprintable ASCII chars + non-ASCII chars\n\t\tregexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g, // RFC 3490 separators\n\t\n\t\t/** Error messages */\n\t\terrors = {\n\t\t\t'overflow': 'Overflow: input needs wider integers to process',\n\t\t\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t\t\t'invalid-input': 'Invalid input'\n\t\t},\n\t\n\t\t/** Convenience shortcuts */\n\t\tbaseMinusTMin = base - tMin,\n\t\tfloor = Math.floor,\n\t\tstringFromCharCode = String.fromCharCode,\n\t\n\t\t/** Temporary variable */\n\t\tkey;\n\t\n\t\t/*--------------------------------------------------------------------------*/\n\t\n\t\t/**\n\t\t * A generic error utility function.\n\t\t * @private\n\t\t * @param {String} type The error type.\n\t\t * @returns {Error} Throws a `RangeError` with the applicable error message.\n\t\t */\n\t\tfunction error(type) {\n\t\t\tthrow RangeError(errors[type]);\n\t\t}\n\t\n\t\t/**\n\t\t * A generic `Array#map` utility function.\n\t\t * @private\n\t\t * @param {Array} array The array to iterate over.\n\t\t * @param {Function} callback The function that gets called for every array\n\t\t * item.\n\t\t * @returns {Array} A new array of values returned by the callback function.\n\t\t */\n\t\tfunction map(array, fn) {\n\t\t\tvar length = array.length;\n\t\t\tvar result = [];\n\t\t\twhile (length--) {\n\t\t\t\tresult[length] = fn(array[length]);\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\n\t\t/**\n\t\t * A simple `Array#map`-like wrapper to work with domain name strings or email\n\t\t * addresses.\n\t\t * @private\n\t\t * @param {String} domain The domain name or email address.\n\t\t * @param {Function} callback The function that gets called for every\n\t\t * character.\n\t\t * @returns {Array} A new string of characters returned by the callback\n\t\t * function.\n\t\t */\n\t\tfunction mapDomain(string, fn) {\n\t\t\tvar parts = string.split('@');\n\t\t\tvar result = '';\n\t\t\tif (parts.length > 1) {\n\t\t\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t\t\t// the local part (i.e. everything up to `@`) intact.\n\t\t\t\tresult = parts[0] + '@';\n\t\t\t\tstring = parts[1];\n\t\t\t}\n\t\t\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\t\t\tstring = string.replace(regexSeparators, '\\x2E');\n\t\t\tvar labels = string.split('.');\n\t\t\tvar encoded = map(labels, fn).join('.');\n\t\t\treturn result + encoded;\n\t\t}\n\t\n\t\t/**\n\t\t * Creates an array containing the numeric code points of each Unicode\n\t\t * character in the string. While JavaScript uses UCS-2 internally,\n\t\t * this function will convert a pair of surrogate halves (each of which\n\t\t * UCS-2 exposes as separate characters) into a single code point,\n\t\t * matching UTF-16.\n\t\t * @see `punycode.ucs2.encode`\n\t\t * @see \n\t\t * @memberOf punycode.ucs2\n\t\t * @name decode\n\t\t * @param {String} string The Unicode input string (UCS-2).\n\t\t * @returns {Array} The new array of code points.\n\t\t */\n\t\tfunction ucs2decode(string) {\n\t\t\tvar output = [],\n\t\t\t counter = 0,\n\t\t\t length = string.length,\n\t\t\t value,\n\t\t\t extra;\n\t\t\twhile (counter < length) {\n\t\t\t\tvalue = string.charCodeAt(counter++);\n\t\t\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t\t\t// high surrogate, and there is a next character\n\t\t\t\t\textra = string.charCodeAt(counter++);\n\t\t\t\t\tif ((extra & 0xFC00) == 0xDC00) { // low surrogate\n\t\t\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// unmatched surrogate; only append this code unit, in case the next\n\t\t\t\t\t\t// code unit is the high surrogate of a surrogate pair\n\t\t\t\t\t\toutput.push(value);\n\t\t\t\t\t\tcounter--;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\toutput.push(value);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn output;\n\t\t}\n\t\n\t\t/**\n\t\t * Creates a string based on an array of numeric code points.\n\t\t * @see `punycode.ucs2.decode`\n\t\t * @memberOf punycode.ucs2\n\t\t * @name encode\n\t\t * @param {Array} codePoints The array of numeric code points.\n\t\t * @returns {String} The new Unicode string (UCS-2).\n\t\t */\n\t\tfunction ucs2encode(array) {\n\t\t\treturn map(array, function(value) {\n\t\t\t\tvar output = '';\n\t\t\t\tif (value > 0xFFFF) {\n\t\t\t\t\tvalue -= 0x10000;\n\t\t\t\t\toutput += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);\n\t\t\t\t\tvalue = 0xDC00 | value & 0x3FF;\n\t\t\t\t}\n\t\t\t\toutput += stringFromCharCode(value);\n\t\t\t\treturn output;\n\t\t\t}).join('');\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a basic code point into a digit/integer.\n\t\t * @see `digitToBasic()`\n\t\t * @private\n\t\t * @param {Number} codePoint The basic numeric code point value.\n\t\t * @returns {Number} The numeric value of a basic code point (for use in\n\t\t * representing integers) in the range `0` to `base - 1`, or `base` if\n\t\t * the code point does not represent a value.\n\t\t */\n\t\tfunction basicToDigit(codePoint) {\n\t\t\tif (codePoint - 48 < 10) {\n\t\t\t\treturn codePoint - 22;\n\t\t\t}\n\t\t\tif (codePoint - 65 < 26) {\n\t\t\t\treturn codePoint - 65;\n\t\t\t}\n\t\t\tif (codePoint - 97 < 26) {\n\t\t\t\treturn codePoint - 97;\n\t\t\t}\n\t\t\treturn base;\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a digit/integer into a basic code point.\n\t\t * @see `basicToDigit()`\n\t\t * @private\n\t\t * @param {Number} digit The numeric value of a basic code point.\n\t\t * @returns {Number} The basic code point whose value (when used for\n\t\t * representing integers) is `digit`, which needs to be in the range\n\t\t * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n\t\t * used; else, the lowercase form is used. The behavior is undefined\n\t\t * if `flag` is non-zero and `digit` has no uppercase form.\n\t\t */\n\t\tfunction digitToBasic(digit, flag) {\n\t\t\t// 0..25 map to ASCII a..z or A..Z\n\t\t\t// 26..35 map to ASCII 0..9\n\t\t\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n\t\t}\n\t\n\t\t/**\n\t\t * Bias adaptation function as per section 3.4 of RFC 3492.\n\t\t * http://tools.ietf.org/html/rfc3492#section-3.4\n\t\t * @private\n\t\t */\n\t\tfunction adapt(delta, numPoints, firstTime) {\n\t\t\tvar k = 0;\n\t\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\t\tdelta += floor(delta / numPoints);\n\t\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t\t}\n\t\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n\t\t * symbols.\n\t\t * @memberOf punycode\n\t\t * @param {String} input The Punycode string of ASCII-only symbols.\n\t\t * @returns {String} The resulting string of Unicode symbols.\n\t\t */\n\t\tfunction decode(input) {\n\t\t\t// Don't use UCS-2\n\t\t\tvar output = [],\n\t\t\t inputLength = input.length,\n\t\t\t out,\n\t\t\t i = 0,\n\t\t\t n = initialN,\n\t\t\t bias = initialBias,\n\t\t\t basic,\n\t\t\t j,\n\t\t\t index,\n\t\t\t oldi,\n\t\t\t w,\n\t\t\t k,\n\t\t\t digit,\n\t\t\t t,\n\t\t\t /** Cached calculation results */\n\t\t\t baseMinusT;\n\t\n\t\t\t// Handle the basic code points: let `basic` be the number of input code\n\t\t\t// points before the last delimiter, or `0` if there is none, then copy\n\t\t\t// the first basic code points to the output.\n\t\n\t\t\tbasic = input.lastIndexOf(delimiter);\n\t\t\tif (basic < 0) {\n\t\t\t\tbasic = 0;\n\t\t\t}\n\t\n\t\t\tfor (j = 0; j < basic; ++j) {\n\t\t\t\t// if it's not a basic code point\n\t\t\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\t\t\terror('not-basic');\n\t\t\t\t}\n\t\t\t\toutput.push(input.charCodeAt(j));\n\t\t\t}\n\t\n\t\t\t// Main decoding loop: start just after the last delimiter if any basic code\n\t\t\t// points were copied; start at the beginning otherwise.\n\t\n\t\t\tfor (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\t\n\t\t\t\t// `index` is the index of the next character to be consumed.\n\t\t\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t\t\t// which gets added to `i`. The overflow checking is easier\n\t\t\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t\t\t// value at the end to obtain `delta`.\n\t\t\t\tfor (oldi = i, w = 1, k = base; /* no condition */; k += base) {\n\t\n\t\t\t\t\tif (index >= inputLength) {\n\t\t\t\t\t\terror('invalid-input');\n\t\t\t\t\t}\n\t\n\t\t\t\t\tdigit = basicToDigit(input.charCodeAt(index++));\n\t\n\t\t\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\t\t\terror('overflow');\n\t\t\t\t\t}\n\t\n\t\t\t\t\ti += digit * w;\n\t\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\n\t\t\t\t\tif (digit < t) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tbaseMinusT = base - t;\n\t\t\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\t\t\terror('overflow');\n\t\t\t\t\t}\n\t\n\t\t\t\t\tw *= baseMinusT;\n\t\n\t\t\t\t}\n\t\n\t\t\t\tout = output.length + 1;\n\t\t\t\tbias = adapt(i - oldi, out, oldi == 0);\n\t\n\t\t\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t\t\t// incrementing `n` each time, so we'll fix that now:\n\t\t\t\tif (floor(i / out) > maxInt - n) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\t\n\t\t\t\tn += floor(i / out);\n\t\t\t\ti %= out;\n\t\n\t\t\t\t// Insert `n` at position `i` of the output\n\t\t\t\toutput.splice(i++, 0, n);\n\t\n\t\t\t}\n\t\n\t\t\treturn ucs2encode(output);\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a string of Unicode symbols (e.g. a domain name label) to a\n\t\t * Punycode string of ASCII-only symbols.\n\t\t * @memberOf punycode\n\t\t * @param {String} input The string of Unicode symbols.\n\t\t * @returns {String} The resulting Punycode string of ASCII-only symbols.\n\t\t */\n\t\tfunction encode(input) {\n\t\t\tvar n,\n\t\t\t delta,\n\t\t\t handledCPCount,\n\t\t\t basicLength,\n\t\t\t bias,\n\t\t\t j,\n\t\t\t m,\n\t\t\t q,\n\t\t\t k,\n\t\t\t t,\n\t\t\t currentValue,\n\t\t\t output = [],\n\t\t\t /** `inputLength` will hold the number of code points in `input`. */\n\t\t\t inputLength,\n\t\t\t /** Cached calculation results */\n\t\t\t handledCPCountPlusOne,\n\t\t\t baseMinusT,\n\t\t\t qMinusT;\n\t\n\t\t\t// Convert the input in UCS-2 to Unicode\n\t\t\tinput = ucs2decode(input);\n\t\n\t\t\t// Cache the length\n\t\t\tinputLength = input.length;\n\t\n\t\t\t// Initialize the state\n\t\t\tn = initialN;\n\t\t\tdelta = 0;\n\t\t\tbias = initialBias;\n\t\n\t\t\t// Handle the basic code points\n\t\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\t\tcurrentValue = input[j];\n\t\t\t\tif (currentValue < 0x80) {\n\t\t\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\thandledCPCount = basicLength = output.length;\n\t\n\t\t\t// `handledCPCount` is the number of code points that have been handled;\n\t\t\t// `basicLength` is the number of basic code points.\n\t\n\t\t\t// Finish the basic string - if it is not empty - with a delimiter\n\t\t\tif (basicLength) {\n\t\t\t\toutput.push(delimiter);\n\t\t\t}\n\t\n\t\t\t// Main encoding loop:\n\t\t\twhile (handledCPCount < inputLength) {\n\t\n\t\t\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t\t\t// larger one:\n\t\t\t\tfor (m = maxInt, j = 0; j < inputLength; ++j) {\n\t\t\t\t\tcurrentValue = input[j];\n\t\t\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\t\t\tm = currentValue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\t// Increase `delta` enough to advance the decoder's state to ,\n\t\t\t\t// but guard against overflow\n\t\t\t\thandledCPCountPlusOne = handledCPCount + 1;\n\t\t\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\t\n\t\t\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\t\t\tn = m;\n\t\n\t\t\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\t\t\tcurrentValue = input[j];\n\t\n\t\t\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\t\t\terror('overflow');\n\t\t\t\t\t}\n\t\n\t\t\t\t\tif (currentValue == n) {\n\t\t\t\t\t\t// Represent delta as a generalized variable-length integer\n\t\t\t\t\t\tfor (q = delta, k = base; /* no condition */; k += base) {\n\t\t\t\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tqMinusT = q - t;\n\t\t\t\t\t\t\tbaseMinusT = base - t;\n\t\t\t\t\t\t\toutput.push(\n\t\t\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\t\t\tdelta = 0;\n\t\t\t\t\t\t++handledCPCount;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\t++delta;\n\t\t\t\t++n;\n\t\n\t\t\t}\n\t\t\treturn output.join('');\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a Punycode string representing a domain name or an email address\n\t\t * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n\t\t * it doesn't matter if you call it on a string that has already been\n\t\t * converted to Unicode.\n\t\t * @memberOf punycode\n\t\t * @param {String} input The Punycoded domain name or email address to\n\t\t * convert to Unicode.\n\t\t * @returns {String} The Unicode representation of the given Punycode\n\t\t * string.\n\t\t */\n\t\tfunction toUnicode(input) {\n\t\t\treturn mapDomain(input, function(string) {\n\t\t\t\treturn regexPunycode.test(string)\n\t\t\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t\t\t: string;\n\t\t\t});\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a Unicode string representing a domain name or an email address to\n\t\t * Punycode. Only the non-ASCII parts of the domain name will be converted,\n\t\t * i.e. it doesn't matter if you call it with a domain that's already in\n\t\t * ASCII.\n\t\t * @memberOf punycode\n\t\t * @param {String} input The domain name or email address to convert, as a\n\t\t * Unicode string.\n\t\t * @returns {String} The Punycode representation of the given domain name or\n\t\t * email address.\n\t\t */\n\t\tfunction toASCII(input) {\n\t\t\treturn mapDomain(input, function(string) {\n\t\t\t\treturn regexNonASCII.test(string)\n\t\t\t\t\t? 'xn--' + encode(string)\n\t\t\t\t\t: string;\n\t\t\t});\n\t\t}\n\t\n\t\t/*--------------------------------------------------------------------------*/\n\t\n\t\t/** Define the public API */\n\t\tpunycode = {\n\t\t\t/**\n\t\t\t * A string representing the current Punycode.js version number.\n\t\t\t * @memberOf punycode\n\t\t\t * @type String\n\t\t\t */\n\t\t\t'version': '1.3.2',\n\t\t\t/**\n\t\t\t * An object of methods to convert from JavaScript's internal character\n\t\t\t * representation (UCS-2) to Unicode code points, and back.\n\t\t\t * @see \n\t\t\t * @memberOf punycode\n\t\t\t * @type Object\n\t\t\t */\n\t\t\t'ucs2': {\n\t\t\t\t'decode': ucs2decode,\n\t\t\t\t'encode': ucs2encode\n\t\t\t},\n\t\t\t'decode': decode,\n\t\t\t'encode': encode,\n\t\t\t'toASCII': toASCII,\n\t\t\t'toUnicode': toUnicode\n\t\t};\n\t\n\t\t/** Expose `punycode` */\n\t\t// Some AMD build optimizers, like r.js, check for specific condition patterns\n\t\t// like the following:\n\t\tif (\n\t\t\ttrue\n\t\t) {\n\t\t\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function() {\n\t\t\t\treturn punycode;\n\t\t\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t\t} else if (freeExports && freeModule) {\n\t\t\tif (module.exports == freeExports) { // in Node.js or RingoJS v0.8.0+\n\t\t\t\tfreeModule.exports = punycode;\n\t\t\t} else { // in Narwhal or RingoJS v0.7.0-\n\t\t\t\tfor (key in punycode) {\n\t\t\t\t\tpunycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]);\n\t\t\t\t}\n\t\t\t}\n\t\t} else { // in Rhino or a web browser\n\t\t\troot.punycode = punycode;\n\t\t}\n\t\n\t}(this));\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(18)(module), (function() { return this; }())))\n\n/***/ },\n/* 18 */\n/***/ function(module, exports) {\n\n\tmodule.exports = function(module) {\r\n\t\tif(!module.webpackPolyfill) {\r\n\t\t\tmodule.deprecate = function() {};\r\n\t\t\tmodule.paths = [];\r\n\t\t\t// module.parent = undefined by default\r\n\t\t\tmodule.children = [];\r\n\t\t\tmodule.webpackPolyfill = 1;\r\n\t\t}\r\n\t\treturn module;\r\n\t}\r\n\n\n/***/ },\n/* 19 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = {\n\t isString: function(arg) {\n\t return typeof(arg) === 'string';\n\t },\n\t isObject: function(arg) {\n\t return typeof(arg) === 'object' && arg !== null;\n\t },\n\t isNull: function(arg) {\n\t return arg === null;\n\t },\n\t isNullOrUndefined: function(arg) {\n\t return arg == null;\n\t }\n\t};\n\n\n/***/ },\n/* 20 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\texports.decode = exports.parse = __webpack_require__(21);\n\texports.encode = exports.stringify = __webpack_require__(22);\n\n\n/***/ },\n/* 21 */\n/***/ function(module, exports) {\n\n\t// Copyright Joyent, Inc. and other Node contributors.\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a\n\t// copy of this software and associated documentation files (the\n\t// \"Software\"), to deal in the Software without restriction, including\n\t// without limitation the rights to use, copy, modify, merge, publish,\n\t// distribute, sublicense, and/or sell copies of the Software, and to permit\n\t// persons to whom the Software is furnished to do so, subject to the\n\t// following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included\n\t// in all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n\t// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\t// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n\t// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n\t// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n\t// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n\t// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\t\n\t'use strict';\n\t\n\t// If obj.hasOwnProperty has been overridden, then calling\n\t// obj.hasOwnProperty(prop) will break.\n\t// See: https://github.com/joyent/node/issues/1707\n\tfunction hasOwnProperty(obj, prop) {\n\t return Object.prototype.hasOwnProperty.call(obj, prop);\n\t}\n\t\n\tmodule.exports = function(qs, sep, eq, options) {\n\t sep = sep || '&';\n\t eq = eq || '=';\n\t var obj = {};\n\t\n\t if (typeof qs !== 'string' || qs.length === 0) {\n\t return obj;\n\t }\n\t\n\t var regexp = /\\+/g;\n\t qs = qs.split(sep);\n\t\n\t var maxKeys = 1000;\n\t if (options && typeof options.maxKeys === 'number') {\n\t maxKeys = options.maxKeys;\n\t }\n\t\n\t var len = qs.length;\n\t // maxKeys <= 0 means that we should not limit keys count\n\t if (maxKeys > 0 && len > maxKeys) {\n\t len = maxKeys;\n\t }\n\t\n\t for (var i = 0; i < len; ++i) {\n\t var x = qs[i].replace(regexp, '%20'),\n\t idx = x.indexOf(eq),\n\t kstr, vstr, k, v;\n\t\n\t if (idx >= 0) {\n\t kstr = x.substr(0, idx);\n\t vstr = x.substr(idx + 1);\n\t } else {\n\t kstr = x;\n\t vstr = '';\n\t }\n\t\n\t k = decodeURIComponent(kstr);\n\t v = decodeURIComponent(vstr);\n\t\n\t if (!hasOwnProperty(obj, k)) {\n\t obj[k] = v;\n\t } else if (Array.isArray(obj[k])) {\n\t obj[k].push(v);\n\t } else {\n\t obj[k] = [obj[k], v];\n\t }\n\t }\n\t\n\t return obj;\n\t};\n\n\n/***/ },\n/* 22 */\n/***/ function(module, exports) {\n\n\t// Copyright Joyent, Inc. and other Node contributors.\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a\n\t// copy of this software and associated documentation files (the\n\t// \"Software\"), to deal in the Software without restriction, including\n\t// without limitation the rights to use, copy, modify, merge, publish,\n\t// distribute, sublicense, and/or sell copies of the Software, and to permit\n\t// persons to whom the Software is furnished to do so, subject to the\n\t// following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included\n\t// in all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n\t// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\t// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n\t// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n\t// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n\t// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n\t// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\t\n\t'use strict';\n\t\n\tvar stringifyPrimitive = function(v) {\n\t switch (typeof v) {\n\t case 'string':\n\t return v;\n\t\n\t case 'boolean':\n\t return v ? 'true' : 'false';\n\t\n\t case 'number':\n\t return isFinite(v) ? v : '';\n\t\n\t default:\n\t return '';\n\t }\n\t};\n\t\n\tmodule.exports = function(obj, sep, eq, name) {\n\t sep = sep || '&';\n\t eq = eq || '=';\n\t if (obj === null) {\n\t obj = undefined;\n\t }\n\t\n\t if (typeof obj === 'object') {\n\t return Object.keys(obj).map(function(k) {\n\t var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;\n\t if (Array.isArray(obj[k])) {\n\t return obj[k].map(function(v) {\n\t return ks + encodeURIComponent(stringifyPrimitive(v));\n\t }).join(sep);\n\t } else {\n\t return ks + encodeURIComponent(stringifyPrimitive(obj[k]));\n\t }\n\t }).join(sep);\n\t\n\t }\n\t\n\t if (!name) return '';\n\t return encodeURIComponent(stringifyPrimitive(name)) + eq +\n\t encodeURIComponent(stringifyPrimitive(obj));\n\t};\n\n\n/***/ },\n/* 23 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"id\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"description\": \"Core schema meta-schema\",\n\t\t\"definitions\": {\n\t\t\t\"schemaArray\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"minItems\": 1,\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"positiveInteger\": {\n\t\t\t\t\"type\": \"integer\",\n\t\t\t\t\"minimum\": 0\n\t\t\t},\n\t\t\t\"positiveIntegerDefault0\": {\n\t\t\t\t\"allOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#/definitions/positiveInteger\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"default\": 0\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"simpleTypes\": {\n\t\t\t\t\"enum\": [\n\t\t\t\t\t\"array\",\n\t\t\t\t\t\"boolean\",\n\t\t\t\t\t\"integer\",\n\t\t\t\t\t\"null\",\n\t\t\t\t\t\"number\",\n\t\t\t\t\t\"object\",\n\t\t\t\t\t\"string\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"stringArray\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t},\n\t\t\t\t\"minItems\": 1,\n\t\t\t\t\"uniqueItems\": true\n\t\t\t}\n\t\t},\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"id\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"uri\"\n\t\t\t},\n\t\t\t\"$schema\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"uri\"\n\t\t\t},\n\t\t\t\"title\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"description\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"default\": {},\n\t\t\t\"multipleOf\": {\n\t\t\t\t\"type\": \"number\",\n\t\t\t\t\"minimum\": 0,\n\t\t\t\t\"exclusiveMinimum\": true\n\t\t\t},\n\t\t\t\"maximum\": {\n\t\t\t\t\"type\": \"number\"\n\t\t\t},\n\t\t\t\"exclusiveMaximum\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"minimum\": {\n\t\t\t\t\"type\": \"number\"\n\t\t\t},\n\t\t\t\"exclusiveMinimum\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"maxLength\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveInteger\"\n\t\t\t},\n\t\t\t\"minLength\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveIntegerDefault0\"\n\t\t\t},\n\t\t\t\"pattern\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"regex\"\n\t\t\t},\n\t\t\t\"additionalItems\": {\n\t\t\t\t\"anyOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"boolean\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"items\": {\n\t\t\t\t\"anyOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#/definitions/schemaArray\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"maxItems\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveInteger\"\n\t\t\t},\n\t\t\t\"minItems\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveIntegerDefault0\"\n\t\t\t},\n\t\t\t\"uniqueItems\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"maxProperties\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveInteger\"\n\t\t\t},\n\t\t\t\"minProperties\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveIntegerDefault0\"\n\t\t\t},\n\t\t\t\"required\": {\n\t\t\t\t\"$ref\": \"#/definitions/stringArray\"\n\t\t\t},\n\t\t\t\"additionalProperties\": {\n\t\t\t\t\"anyOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"boolean\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"definitions\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": {\n\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t},\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"properties\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": {\n\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t},\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"patternProperties\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": {\n\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t},\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"dependencies\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": {\n\t\t\t\t\t\"anyOf\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"$ref\": \"#/definitions/stringArray\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"enum\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"minItems\": 1,\n\t\t\t\t\"uniqueItems\": true\n\t\t\t},\n\t\t\t\"type\": {\n\t\t\t\t\"anyOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#/definitions/simpleTypes\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"array\",\n\t\t\t\t\t\t\"items\": {\n\t\t\t\t\t\t\t\"$ref\": \"#/definitions/simpleTypes\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"minItems\": 1,\n\t\t\t\t\t\t\"uniqueItems\": true\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"allOf\": {\n\t\t\t\t\"$ref\": \"#/definitions/schemaArray\"\n\t\t\t},\n\t\t\t\"anyOf\": {\n\t\t\t\t\"$ref\": \"#/definitions/schemaArray\"\n\t\t\t},\n\t\t\t\"oneOf\": {\n\t\t\t\t\"$ref\": \"#/definitions/schemaArray\"\n\t\t\t},\n\t\t\t\"not\": {\n\t\t\t\t\"$ref\": \"#\"\n\t\t\t}\n\t\t},\n\t\t\"dependencies\": {\n\t\t\t\"exclusiveMaximum\": [\n\t\t\t\t\"maximum\"\n\t\t\t],\n\t\t\t\"exclusiveMinimum\": [\n\t\t\t\t\"minimum\"\n\t\t\t]\n\t\t},\n\t\t\"default\": {}\n\t};\n\n/***/ },\n/* 24 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tvar formats = {};\n\t\n\t// reference: http://dansnetwork.com/javascript-iso8601rfc3339-date-parser/\n\tformats['date-time'] = /(\\d\\d\\d\\d)(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))/;\n\t// reference: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js#L7\n\tformats.uri = /^([a-zA-Z][a-zA-Z0-9+-.]*:){0,1}\\/\\/[^\\s]*$/;\n\t// reference: http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363\n\t// http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'willful violation')\n\tformats.email = /^[a-zA-Z0-9.!#$%&'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n\t// reference: https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html\n\tformats.ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;\n\t// reference: http://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses\n\tformats.ipv6 = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|[fF][eE]80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::([fF]{4}(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;\n\t// reference: http://stackoverflow.com/questions/106179/regular-expression-to-match-dns-hostname-or-ip-address#answer-3824105\n\tformats.hostname = /^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])(\\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]))*$/;\n\t\n\tmodule.exports = formats;\n\n/***/ },\n/* 25 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\t// Reference: https://github.com/bestiejs/punycode.js/blob/master/punycode.js#L101`\n\t// Info: https://mathiasbynens.be/notes/javascript-unicode\n\tfunction ucs2length(string) {\n\t var ucs2len = 0,\n\t counter = 0,\n\t length = string.length,\n\t value, extra;\n\t\n\t while (counter < length) {\n\t ucs2len++;\n\t value = string.charCodeAt(counter++);\n\t\n\t if (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t // It's a high surrogate, and there is a next character.\n\t extra = string.charCodeAt(counter++);\n\t\n\t if ((extra & 0xFC00) !== 0xDC00) { /* Low surrogate. */ // jshint ignore: line\n\t counter--;\n\t }\n\t }\n\t }\n\t\n\t return ucs2len;\n\t}\n\t\n\tmodule.exports = ucs2length;\n\n/***/ }\n/******/ ])\n});\n;\n//# sourceMappingURL=models.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/powerbi-models/dist/models.js\n// module id = 5\n// module chunks = 0","import { IFilterable } from './ifilterable';\r\nimport { IReportNode } from './report';\r\nimport * as models from 'powerbi-models';\r\n\r\n/**\r\n * A Page node within a report hierarchy\r\n * \r\n * @export\r\n * @interface IPageNode\r\n */\r\nexport interface IPageNode {\r\n report: IReportNode;\r\n name: string;\r\n}\r\n\r\n/**\r\n * A Power BI report page\r\n * \r\n * @export\r\n * @class Page\r\n * @implements {IPageNode}\r\n * @implements {IFilterable}\r\n */\r\nexport class Page implements IPageNode, IFilterable {\r\n /**\r\n * The parent Power BI report that this page is a member of\r\n * \r\n * @type {IReportNode}\r\n */\r\n report: IReportNode;\r\n /**\r\n * The report page name\r\n * \r\n * @type {string}\r\n */\r\n name: string;\r\n\r\n /**\r\n * The user defined display name of the report page, which is undefined if the page is created manually\r\n * \r\n * @type {string}\r\n */\r\n displayName: string;\r\n\r\n /**\r\n * Creates an instance of a Power BI report page.\r\n * \r\n * @param {IReportNode} report\r\n * @param {string} name\r\n * @param {string} [displayName]\r\n */\r\n constructor(report: IReportNode, name: string, displayName?: string) {\r\n this.report = report;\r\n this.name = name;\r\n this.displayName = displayName;\r\n }\r\n\r\n /**\r\n * Gets all page level filters within the report.\r\n * \r\n * ```javascript\r\n * page.getFilters()\r\n * .then(pages => { ... });\r\n * ```\r\n * \r\n * @returns {(Promise)}\r\n */\r\n getFilters(): Promise {\r\n return this.report.service.hpm.get(`/report/pages/${this.name}/filters`, { uid: this.report.config.uniqueId }, this.report.iframe.contentWindow)\r\n .then(response => response.body,\r\n response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Removes all filters from this page of the report.\r\n * \r\n * ```javascript\r\n * page.removeFilters();\r\n * ```\r\n * \r\n * @returns {Promise}\r\n */\r\n removeFilters(): Promise {\r\n return this.setFilters([]);\r\n }\r\n\r\n /**\r\n * Makes the current page the active page of the report.\r\n * \r\n * ```javascripot\r\n * page.setActive();\r\n * ```\r\n * \r\n * @returns {Promise}\r\n */\r\n setActive(): Promise {\r\n const page: models.IPage = {\r\n name: this.name,\r\n displayName: null\r\n };\r\n\r\n return this.report.service.hpm.put('/report/pages/active', page, { uid: this.report.config.uniqueId }, this.report.iframe.contentWindow)\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Sets all filters on the current page.\r\n * \r\n * ```javascript\r\n * page.setFilters(filters);\r\n * .catch(errors => { ... });\r\n * ```\r\n * \r\n * @param {(models.IFilter[])} filters\r\n * @returns {Promise}\r\n */\r\n setFilters(filters: models.IFilter[]): Promise {\r\n return this.report.service.hpm.put(`/report/pages/${this.name}/filters`, filters, { uid: this.report.config.uniqueId }, this.report.iframe.contentWindow)\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/page.ts","import * as service from './service';\r\nimport * as models from 'powerbi-models';\r\nimport * as embed from './embed';\r\n\r\nexport class Create extends embed.Embed {\r\n\r\n constructor(service: service.Service, element: HTMLElement, config: embed.IEmbedConfiguration) {\r\n super(service, element, config);\r\n }\r\n\r\n /**\r\n * Gets the dataset ID from the first available location: createConfig or embed url.\r\n * \r\n * @returns {string}\r\n */\r\n getId(): string {\r\n const datasetId = (this.createConfig && this.createConfig.datasetId) ? this.createConfig.datasetId : Create.findIdFromEmbedUrl(this.config.embedUrl);\r\n\r\n if (typeof datasetId !== 'string' || datasetId.length === 0) {\r\n throw new Error('Dataset id is required, but it was not found. You must provide an id either as part of embed configuration.');\r\n }\r\n\r\n return datasetId;\r\n }\r\n\r\n /**\r\n * Validate create report configuration.\r\n */\r\n validate(config: models.IReportCreateConfiguration): models.IError[] {\r\n return models.validateCreateReport(config);\r\n }\r\n\r\n /**\r\n * Adds the ability to get datasetId from url. \r\n * (e.g. http://embedded.powerbi.com/appTokenReportEmbed?datasetId=854846ed-2106-4dc2-bc58-eb77533bf2f1).\r\n * \r\n * By extracting the ID we can ensure that the ID is always explicitly provided as part of the create configuration.\r\n * \r\n * @static\r\n * @param {string} url\r\n * @returns {string}\r\n */\r\n static findIdFromEmbedUrl(url: string): string {\r\n const datasetIdRegEx = /datasetId=\"?([^&]+)\"?/\r\n const datasetIdMatch = url.match(datasetIdRegEx);\r\n\r\n let datasetId;\r\n if (datasetIdMatch) {\r\n datasetId = datasetIdMatch[1];\r\n }\r\n\r\n return datasetId;\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/create.ts","import * as service from './service';\r\nimport * as embed from './embed';\r\nimport * as models from 'powerbi-models';\r\nimport * as wpmp from 'window-post-message-proxy';\r\nimport * as hpm from 'http-post-message';\r\nimport * as utils from './util';\r\n\r\n/**\r\n * A Dashboard node within a dashboard hierarchy\r\n * \r\n * @export\r\n * @interface IDashboardNode\r\n */\r\nexport interface IDashboardNode {\r\n iframe: HTMLIFrameElement;\r\n service: service.IService;\r\n config: embed.IInternalEmbedConfiguration\r\n}\r\n\r\n/**\r\n * A Power BI Dashboard embed component\r\n * \r\n * @export\r\n * @class Dashboard\r\n * @extends {embed.Embed}\r\n * @implements {IDashboardNode}\r\n * @implements {IFilterable}\r\n */\r\nexport class Dashboard extends embed.Embed implements IDashboardNode {\r\n static allowedEvents = [\"tileClicked\", \"error\"];\r\n static dashboardIdAttribute = 'powerbi-dashboard-id';\r\n static typeAttribute = 'powerbi-type';\r\n static type = \"Dashboard\";\r\n\r\n /**\r\n * Creates an instance of a Power BI Dashboard.\r\n * \r\n * @param {service.Service} service\r\n * @param {HTMLElement} element\r\n */\r\n constructor(service: service.Service, element: HTMLElement, config: embed.IEmbedConfiguration) {\r\n super(service, element, config);\r\n this.loadPath = \"/dashboard/load\";\r\n Array.prototype.push.apply(this.allowedEvents, Dashboard.allowedEvents);\r\n }\r\n\r\n /**\r\n * This adds backwards compatibility for older config which used the dashboardId query param to specify dashboard id.\r\n * E.g. https://powerbi-df.analysis-df.windows.net/dashboardEmbedHost?dashboardId=e9363c62-edb6-4eac-92d3-2199c5ca2a9e\r\n * \r\n * By extracting the id we can ensure id is always explicitly provided as part of the load configuration.\r\n * \r\n * @static\r\n * @param {string} url\r\n * @returns {string}\r\n */\r\n static findIdFromEmbedUrl(url: string): string {\r\n const dashboardIdRegEx = /dashboardId=\"?([^&]+)\"?/\r\n const dashboardIdMatch = url.match(dashboardIdRegEx);\r\n\r\n let dashboardId;\r\n if (dashboardIdMatch) {\r\n dashboardId = dashboardIdMatch[1];\r\n }\r\n\r\n return dashboardId;\r\n }\r\n\r\n /**\r\n * Get dashboard id from first available location: options, attribute, embed url.\r\n * \r\n * @returns {string}\r\n */\r\n getId(): string {\r\n const dashboardId = this.config.id || this.element.getAttribute(Dashboard.dashboardIdAttribute) || Dashboard.findIdFromEmbedUrl(this.config.embedUrl);\r\n\r\n if (typeof dashboardId !== 'string' || dashboardId.length === 0) {\r\n throw new Error(`Dashboard id is required, but it was not found. You must provide an id either as part of embed configuration or as attribute '${Dashboard.dashboardIdAttribute}'.`);\r\n }\r\n\r\n return dashboardId;\r\n }\r\n\r\n /**\r\n * Validate load configuration.\r\n */\r\n validate(config: models.IDashboardLoadConfiguration): models.IError[] {\r\n let error = models.validateDashboardLoad(config);\r\n return error ? error : this.ValidatePageView(config.pageView);\r\n }\r\n \r\n /**\r\n * Validate that pageView has a legal value: if page view is defined it must have one of the values defined in models.PageView\r\n */\r\n private ValidatePageView(pageView: models.PageView): models.IError[] {\r\n if (pageView && pageView !== \"fitToWidth\" && pageView !== \"oneColumn\" && pageView !== \"actualSize\") {\r\n return [{message: \"pageView must be one of the followings: fitToWidth, oneColumn, actualSize\"}];\r\n }\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/dashboard.ts","import * as models from 'powerbi-models';\r\nimport { Embed } from './embed';\r\n\r\n/**\r\n * The Power BI tile embed component\r\n * \r\n * @export\r\n * @class Tile\r\n * @extends {Embed}\r\n */\r\nexport class Tile extends Embed {\r\n static type = \"Tile\";\r\n\r\n /**\r\n * The ID of the tile\r\n * \r\n * @returns {string}\r\n */\r\n getId(): string {\r\n throw new Error('Not implemented. Embedding tiles is not supported yet.');\r\n }\r\n\r\n /**\r\n * Validate load configuration.\r\n */\r\n validate(config: any): models.IError[] {\r\n throw new Error('Not implemented. Embedding tiles is not supported yet.');\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/tile.ts","/**\r\n * TODO: Need to find better place for these factory functions or refactor how we handle dependency injection\r\n */\r\nimport { IHpmFactory, IWpmpFactory, IRouterFactory } from './service';\r\nimport config from './config';\r\nimport * as wpmp from 'window-post-message-proxy';\r\nimport * as hpm from 'http-post-message';\r\nimport * as router from 'powerbi-router';\r\n\r\nexport {\r\n IHpmFactory,\r\n IWpmpFactory,\r\n IRouterFactory\r\n};\r\n\r\nexport const hpmFactory: IHpmFactory = (wpmp, defaultTargetWindow, sdkVersion = config.version, sdkType = config.type) => {\r\n return new hpm.HttpPostMessage(wpmp, {\r\n 'x-sdk-type': sdkType,\r\n 'x-sdk-version': sdkVersion\r\n }, defaultTargetWindow);\r\n};\r\n\r\nexport const wpmpFactory: IWpmpFactory = (name?: string, logMessages?: boolean, eventSourceOverrideWindow?: Window) => {\r\n return new wpmp.WindowPostMessageProxy({\r\n processTrackingProperties: {\r\n addTrackingProperties: hpm.HttpPostMessage.addTrackingProperties,\r\n getTrackingProperties: hpm.HttpPostMessage.getTrackingProperties,\r\n },\r\n isErrorMessage: hpm.HttpPostMessage.isErrorMessage,\r\n name,\r\n logMessages,\r\n eventSourceOverrideWindow\r\n });\r\n};\r\n\r\nexport const routerFactory: IRouterFactory = (wpmp) => {\r\n return new router.Router(wpmp);\r\n};\n\n\n// WEBPACK FOOTER //\n// ./src/factories.ts","const config = {\r\n version: '2.2.3',\r\n type: 'js'\r\n};\r\n\r\nexport default config;\n\n\n// WEBPACK FOOTER //\n// ./src/config.ts","/*! window-post-message-proxy v0.2.4 | (c) 2016 Microsoft Corporation MIT */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"window-post-message-proxy\"] = factory();\n\telse\n\t\troot[\"window-post-message-proxy\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\tvar WindowPostMessageProxy = (function () {\n\t function WindowPostMessageProxy(options) {\n\t var _this = this;\n\t if (options === void 0) { options = {\n\t processTrackingProperties: {\n\t addTrackingProperties: WindowPostMessageProxy.defaultAddTrackingProperties,\n\t getTrackingProperties: WindowPostMessageProxy.defaultGetTrackingProperties\n\t },\n\t isErrorMessage: WindowPostMessageProxy.defaultIsErrorMessage,\n\t receiveWindow: window,\n\t name: WindowPostMessageProxy.createRandomString()\n\t }; }\n\t this.pendingRequestPromises = {};\n\t // save options with defaults\n\t this.addTrackingProperties = (options.processTrackingProperties && options.processTrackingProperties.addTrackingProperties) || WindowPostMessageProxy.defaultAddTrackingProperties;\n\t this.getTrackingProperties = (options.processTrackingProperties && options.processTrackingProperties.getTrackingProperties) || WindowPostMessageProxy.defaultGetTrackingProperties;\n\t this.isErrorMessage = options.isErrorMessage || WindowPostMessageProxy.defaultIsErrorMessage;\n\t this.receiveWindow = options.receiveWindow || window;\n\t this.name = options.name || WindowPostMessageProxy.createRandomString();\n\t this.logMessages = options.logMessages || false;\n\t this.eventSourceOverrideWindow = options.eventSourceOverrideWindow;\n\t this.suppressWarnings = options.suppressWarnings || false;\n\t if (this.logMessages) {\n\t console.log(\"new WindowPostMessageProxy created with name: \" + this.name + \" receiving on window: \" + this.receiveWindow.document.title);\n\t }\n\t // Initialize\n\t this.handlers = [];\n\t this.windowMessageHandler = function (event) { return _this.onMessageReceived(event); };\n\t this.start();\n\t }\n\t // Static\n\t WindowPostMessageProxy.defaultAddTrackingProperties = function (message, trackingProperties) {\n\t message[WindowPostMessageProxy.messagePropertyName] = trackingProperties;\n\t return message;\n\t };\n\t WindowPostMessageProxy.defaultGetTrackingProperties = function (message) {\n\t return message[WindowPostMessageProxy.messagePropertyName];\n\t };\n\t WindowPostMessageProxy.defaultIsErrorMessage = function (message) {\n\t return !!message.error;\n\t };\n\t /**\n\t * Utility to create a deferred object.\n\t */\n\t // TODO: Look to use RSVP library instead of doing this manually.\n\t // From what I searched RSVP would work better because it has .finally and .deferred; however, it doesn't have Typings information. \n\t WindowPostMessageProxy.createDeferred = function () {\n\t var deferred = {\n\t resolve: null,\n\t reject: null,\n\t promise: null\n\t };\n\t var promise = new Promise(function (resolve, reject) {\n\t deferred.resolve = resolve;\n\t deferred.reject = reject;\n\t });\n\t deferred.promise = promise;\n\t return deferred;\n\t };\n\t /**\n\t * Utility to generate random sequence of characters used as tracking id for promises.\n\t */\n\t WindowPostMessageProxy.createRandomString = function () {\n\t return (Math.random() + 1).toString(36).substring(7);\n\t };\n\t /**\n\t * Adds handler.\n\t * If the first handler whose test method returns true will handle the message and provide a response.\n\t */\n\t WindowPostMessageProxy.prototype.addHandler = function (handler) {\n\t this.handlers.push(handler);\n\t };\n\t /**\n\t * Removes handler.\n\t * The reference must match the original object that was provided when adding the handler.\n\t */\n\t WindowPostMessageProxy.prototype.removeHandler = function (handler) {\n\t var handlerIndex = this.handlers.indexOf(handler);\n\t if (handlerIndex === -1) {\n\t throw new Error(\"You attempted to remove a handler but no matching handler was found.\");\n\t }\n\t this.handlers.splice(handlerIndex, 1);\n\t };\n\t /**\n\t * Start listening to message events.\n\t */\n\t WindowPostMessageProxy.prototype.start = function () {\n\t this.receiveWindow.addEventListener('message', this.windowMessageHandler);\n\t };\n\t /**\n\t * Stops listening to message events.\n\t */\n\t WindowPostMessageProxy.prototype.stop = function () {\n\t this.receiveWindow.removeEventListener('message', this.windowMessageHandler);\n\t };\n\t /**\n\t * Post message to target window with tracking properties added and save deferred object referenced by tracking id.\n\t */\n\t WindowPostMessageProxy.prototype.postMessage = function (targetWindow, message) {\n\t // Add tracking properties to indicate message came from this proxy\n\t var trackingProperties = { id: WindowPostMessageProxy.createRandomString() };\n\t this.addTrackingProperties(message, trackingProperties);\n\t if (this.logMessages) {\n\t console.log(this.name + \" Posting message:\");\n\t console.log(JSON.stringify(message, null, ' '));\n\t }\n\t targetWindow.postMessage(message, \"*\");\n\t var deferred = WindowPostMessageProxy.createDeferred();\n\t this.pendingRequestPromises[trackingProperties.id] = deferred;\n\t return deferred.promise;\n\t };\n\t /**\n\t * Send response message to target window.\n\t * Response messages re-use tracking properties from a previous request message.\n\t */\n\t WindowPostMessageProxy.prototype.sendResponse = function (targetWindow, message, trackingProperties) {\n\t this.addTrackingProperties(message, trackingProperties);\n\t if (this.logMessages) {\n\t console.log(this.name + \" Sending response:\");\n\t console.log(JSON.stringify(message, null, ' '));\n\t }\n\t targetWindow.postMessage(message, \"*\");\n\t };\n\t /**\n\t * Message handler.\n\t */\n\t WindowPostMessageProxy.prototype.onMessageReceived = function (event) {\n\t var _this = this;\n\t if (this.logMessages) {\n\t console.log(this.name + \" Received message:\");\n\t console.log(\"type: \" + event.type);\n\t console.log(JSON.stringify(event.data, null, ' '));\n\t }\n\t var sendingWindow = this.eventSourceOverrideWindow || event.source;\n\t var message = event.data;\n\t if (typeof message !== \"object\") {\n\t if (!this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + this.name + \"): Received message that was not an object. Discarding message\");\n\t }\n\t return;\n\t }\n\t var trackingProperties;\n\t try {\n\t trackingProperties = this.getTrackingProperties(message);\n\t }\n\t catch (e) {\n\t if (!this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + this.name + \"): Error occurred when attempting to get tracking properties from incoming message:\", JSON.stringify(message, null, ' '), \"Error: \", e);\n\t }\n\t }\n\t var deferred;\n\t if (trackingProperties) {\n\t deferred = this.pendingRequestPromises[trackingProperties.id];\n\t }\n\t // If message does not have a known ID, treat it as a request\n\t // Otherwise, treat message as response\n\t if (!deferred) {\n\t var handled = this.handlers.some(function (handler) {\n\t var canMessageBeHandled = false;\n\t try {\n\t canMessageBeHandled = handler.test(message);\n\t }\n\t catch (e) {\n\t if (!_this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + _this.name + \"): Error occurred when handler was testing incoming message:\", JSON.stringify(message, null, ' '), \"Error: \", e);\n\t }\n\t }\n\t if (canMessageBeHandled) {\n\t var responseMessagePromise = void 0;\n\t try {\n\t responseMessagePromise = Promise.resolve(handler.handle(message));\n\t }\n\t catch (e) {\n\t if (!_this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + _this.name + \"): Error occurred when handler was processing incoming message:\", JSON.stringify(message, null, ' '), \"Error: \", e);\n\t }\n\t responseMessagePromise = Promise.resolve();\n\t }\n\t responseMessagePromise\n\t .then(function (responseMessage) {\n\t if (!responseMessage) {\n\t var warningMessage = \"Handler for message: \" + JSON.stringify(message, null, ' ') + \" did not return a response message. The default response message will be returned instead.\";\n\t if (!_this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + _this.name + \"): \" + warningMessage);\n\t }\n\t responseMessage = {\n\t warning: warningMessage\n\t };\n\t }\n\t _this.sendResponse(sendingWindow, responseMessage, trackingProperties);\n\t });\n\t return true;\n\t }\n\t });\n\t /**\n\t * TODO: Consider returning an error message if nothing handled the message.\n\t * In the case of the Report receiving messages all of them should be handled,\n\t * however, in the case of the SDK receiving messages it's likely it won't register handlers\n\t * for all events. Perhaps make this an option at construction time.\n\t */\n\t if (!handled && !this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + this.name + \") did not handle message. Handlers: \" + this.handlers.length + \" Message: \" + JSON.stringify(message, null, '') + \".\");\n\t }\n\t }\n\t else {\n\t /**\n\t * If error message reject promise,\n\t * Otherwise, resolve promise\n\t */\n\t var isErrorMessage = true;\n\t try {\n\t isErrorMessage = this.isErrorMessage(message);\n\t }\n\t catch (e) {\n\t console.warn(\"Proxy(\" + this.name + \") Error occurred when trying to determine if message is consider an error response. Message: \", JSON.stringify(message, null, ''), 'Error: ', e);\n\t }\n\t if (isErrorMessage) {\n\t deferred.reject(message);\n\t }\n\t else {\n\t deferred.resolve(message);\n\t }\n\t // TODO: Move to .finally clause up where promise is created for better maitenance like original proxy code.\n\t delete this.pendingRequestPromises[trackingProperties.id];\n\t }\n\t };\n\t WindowPostMessageProxy.messagePropertyName = \"windowPostMessageProxy\";\n\t return WindowPostMessageProxy;\n\t}());\n\texports.WindowPostMessageProxy = WindowPostMessageProxy;\n\n\n/***/ }\n/******/ ])\n});\n;\n//# sourceMappingURL=windowPostMessageProxy.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/window-post-message-proxy/dist/windowPostMessageProxy.js\n// module id = 12\n// module chunks = 0","/*! http-post-message v0.2.3 | (c) 2016 Microsoft Corporation MIT */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"http-post-message\"] = factory();\n\telse\n\t\troot[\"http-post-message\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\tvar HttpPostMessage = (function () {\n\t function HttpPostMessage(windowPostMessageProxy, defaultHeaders, defaultTargetWindow) {\n\t if (defaultHeaders === void 0) { defaultHeaders = {}; }\n\t this.defaultHeaders = defaultHeaders;\n\t this.defaultTargetWindow = defaultTargetWindow;\n\t this.windowPostMessageProxy = windowPostMessageProxy;\n\t }\n\t // TODO: See if it's possible to share tracking properties interface?\n\t // The responsibility of knowing how to configure windowPostMessageProxy for http should\n\t // live in this http class, but the configuration would need ITrackingProperties\n\t // interface which lives in WindowPostMessageProxy. Use type as workaround\n\t HttpPostMessage.addTrackingProperties = function (message, trackingProperties) {\n\t message.headers = message.headers || {};\n\t if (trackingProperties && trackingProperties.id) {\n\t message.headers.id = trackingProperties.id;\n\t }\n\t return message;\n\t };\n\t HttpPostMessage.getTrackingProperties = function (message) {\n\t return {\n\t id: message.headers && message.headers.id\n\t };\n\t };\n\t HttpPostMessage.isErrorMessage = function (message) {\n\t if (typeof (message && message.statusCode) !== 'number') {\n\t return false;\n\t }\n\t return !(200 <= message.statusCode && message.statusCode < 300);\n\t };\n\t HttpPostMessage.prototype.get = function (url, headers, targetWindow) {\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"GET\",\n\t url: url,\n\t headers: headers\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.post = function (url, body, headers, targetWindow) {\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"POST\",\n\t url: url,\n\t headers: headers,\n\t body: body\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.put = function (url, body, headers, targetWindow) {\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"PUT\",\n\t url: url,\n\t headers: headers,\n\t body: body\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.patch = function (url, body, headers, targetWindow) {\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"PATCH\",\n\t url: url,\n\t headers: headers,\n\t body: body\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.delete = function (url, body, headers, targetWindow) {\n\t if (body === void 0) { body = null; }\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"DELETE\",\n\t url: url,\n\t headers: headers,\n\t body: body\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.send = function (request, targetWindow) {\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t request.headers = this.assign({}, this.defaultHeaders, request.headers);\n\t if (!targetWindow) {\n\t throw new Error(\"target window is not provided. You must either provide the target window explicitly as argument to request, or specify default target window when constructing instance of this class.\");\n\t }\n\t return this.windowPostMessageProxy.postMessage(targetWindow, request);\n\t };\n\t /**\n\t * Object.assign() polyfill\n\t * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\n\t */\n\t HttpPostMessage.prototype.assign = function (target) {\n\t var sources = [];\n\t for (var _i = 1; _i < arguments.length; _i++) {\n\t sources[_i - 1] = arguments[_i];\n\t }\n\t if (target === undefined || target === null) {\n\t throw new TypeError('Cannot convert undefined or null to object');\n\t }\n\t var output = Object(target);\n\t sources.forEach(function (source) {\n\t if (source !== undefined && source !== null) {\n\t for (var nextKey in source) {\n\t if (Object.prototype.hasOwnProperty.call(source, nextKey)) {\n\t output[nextKey] = source[nextKey];\n\t }\n\t }\n\t }\n\t });\n\t return output;\n\t };\n\t return HttpPostMessage;\n\t}());\n\texports.HttpPostMessage = HttpPostMessage;\n\n\n/***/ }\n/******/ ])\n});\n;\n//# sourceMappingURL=httpPostMessage.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/http-post-message/dist/httpPostMessage.js\n// module id = 13\n// module chunks = 0","/*! powerbi-router v0.1.5 | (c) 2016 Microsoft Corporation MIT */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"powerbi-router\"] = factory();\n\telse\n\t\troot[\"powerbi-router\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar RouteRecognizer = __webpack_require__(1);\n\tvar Router = (function () {\n\t function Router(handlers) {\n\t this.handlers = handlers;\n\t /**\n\t * TODO: look at generating the router dynamically based on list of supported http methods\n\t * instead of hardcoding the creation of these and the methods.\n\t */\n\t this.getRouteRecognizer = new RouteRecognizer();\n\t this.patchRouteRecognizer = new RouteRecognizer();\n\t this.postRouteRecognizer = new RouteRecognizer();\n\t this.putRouteRecognizer = new RouteRecognizer();\n\t this.deleteRouteRecognizer = new RouteRecognizer();\n\t }\n\t Router.prototype.get = function (url, handler) {\n\t this.registerHandler(this.getRouteRecognizer, \"GET\", url, handler);\n\t return this;\n\t };\n\t Router.prototype.patch = function (url, handler) {\n\t this.registerHandler(this.patchRouteRecognizer, \"PATCH\", url, handler);\n\t return this;\n\t };\n\t Router.prototype.post = function (url, handler) {\n\t this.registerHandler(this.postRouteRecognizer, \"POST\", url, handler);\n\t return this;\n\t };\n\t Router.prototype.put = function (url, handler) {\n\t this.registerHandler(this.putRouteRecognizer, \"PUT\", url, handler);\n\t return this;\n\t };\n\t Router.prototype.delete = function (url, handler) {\n\t this.registerHandler(this.deleteRouteRecognizer, \"DELETE\", url, handler);\n\t return this;\n\t };\n\t /**\n\t * TODO: This method could use some refactoring. There is conflict of interest between keeping clean separation of test and handle method\n\t * Test method only returns boolean indicating if request can be handled, and handle method has opportunity to modify response and return promise of it.\n\t * In the case of the router with route-recognizer where handlers are associated with routes, this already guarantees that only one handler is selected and makes the test method feel complicated\n\t * Will leave as is an investigate cleaner ways at later time.\n\t */\n\t Router.prototype.registerHandler = function (routeRecognizer, method, url, handler) {\n\t var routeRecognizerHandler = function (request) {\n\t var response = new Response();\n\t return Promise.resolve(handler(request, response))\n\t .then(function (x) { return response; });\n\t };\n\t routeRecognizer.add([\n\t { path: url, handler: routeRecognizerHandler }\n\t ]);\n\t var internalHandler = {\n\t test: function (request) {\n\t if (request.method !== method) {\n\t return false;\n\t }\n\t var matchingRoutes = routeRecognizer.recognize(request.url);\n\t if (matchingRoutes === undefined) {\n\t return false;\n\t }\n\t /**\n\t * Copy parameters from recognized route to the request so they can be used within the handler function\n\t * This isn't ideal because it is side affect which modifies the request instead of strictly testing for true or false\n\t * but I don't see a better place to put this. If we move it between the call to test and the handle it becomes part of the window post message proxy\n\t * even though it's responsibility is related to routing.\n\t */\n\t var route = matchingRoutes[0];\n\t request.params = route.params;\n\t request.queryParams = matchingRoutes.queryParams;\n\t request.handler = route.handler;\n\t return true;\n\t },\n\t handle: function (request) {\n\t return request.handler(request);\n\t }\n\t };\n\t this.handlers.addHandler(internalHandler);\n\t };\n\t return Router;\n\t}());\n\texports.Router = Router;\n\tvar Response = (function () {\n\t function Response() {\n\t this.statusCode = 200;\n\t this.headers = {};\n\t this.body = null;\n\t }\n\t Response.prototype.send = function (statusCode, body) {\n\t this.statusCode = statusCode;\n\t this.body = body;\n\t };\n\t return Response;\n\t}());\n\texports.Response = Response;\n\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(module) {(function() {\n\t \"use strict\";\n\t function $$route$recognizer$dsl$$Target(path, matcher, delegate) {\n\t this.path = path;\n\t this.matcher = matcher;\n\t this.delegate = delegate;\n\t }\n\t\n\t $$route$recognizer$dsl$$Target.prototype = {\n\t to: function(target, callback) {\n\t var delegate = this.delegate;\n\t\n\t if (delegate && delegate.willAddRoute) {\n\t target = delegate.willAddRoute(this.matcher.target, target);\n\t }\n\t\n\t this.matcher.add(this.path, target);\n\t\n\t if (callback) {\n\t if (callback.length === 0) { throw new Error(\"You must have an argument in the function passed to `to`\"); }\n\t this.matcher.addChild(this.path, target, callback, this.delegate);\n\t }\n\t return this;\n\t }\n\t };\n\t\n\t function $$route$recognizer$dsl$$Matcher(target) {\n\t this.routes = {};\n\t this.children = {};\n\t this.target = target;\n\t }\n\t\n\t $$route$recognizer$dsl$$Matcher.prototype = {\n\t add: function(path, handler) {\n\t this.routes[path] = handler;\n\t },\n\t\n\t addChild: function(path, target, callback, delegate) {\n\t var matcher = new $$route$recognizer$dsl$$Matcher(target);\n\t this.children[path] = matcher;\n\t\n\t var match = $$route$recognizer$dsl$$generateMatch(path, matcher, delegate);\n\t\n\t if (delegate && delegate.contextEntered) {\n\t delegate.contextEntered(target, match);\n\t }\n\t\n\t callback(match);\n\t }\n\t };\n\t\n\t function $$route$recognizer$dsl$$generateMatch(startingPath, matcher, delegate) {\n\t return function(path, nestedCallback) {\n\t var fullPath = startingPath + path;\n\t\n\t if (nestedCallback) {\n\t nestedCallback($$route$recognizer$dsl$$generateMatch(fullPath, matcher, delegate));\n\t } else {\n\t return new $$route$recognizer$dsl$$Target(startingPath + path, matcher, delegate);\n\t }\n\t };\n\t }\n\t\n\t function $$route$recognizer$dsl$$addRoute(routeArray, path, handler) {\n\t var len = 0;\n\t for (var i=0; i z`. For instance, \"199\" is smaller\n\t // then \"200\", even though \"y\" and \"z\" (which are both 9) are larger than \"0\" (the value\n\t // of (`b` and `c`). This is because the leading symbol, \"2\", is larger than the other\n\t // leading symbol, \"1\".\n\t // The rule is that symbols to the left carry more weight than symbols to the right\n\t // when a number is written out as a string. In the above strings, the leading digit\n\t // represents how many 100's are in the number, and it carries more weight than the middle\n\t // number which represents how many 10's are in the number.\n\t // This system of number magnitude works well for route specificity, too. A route written as\n\t // `a/b/c` will be more specific than `x/y/z` as long as `a` is more specific than\n\t // `x`, irrespective of the other parts.\n\t // Because of this similarity, we assign each type of segment a number value written as a\n\t // string. We can find the specificity of compound routes by concatenating these strings\n\t // together, from left to right. After we have looped through all of the segments,\n\t // we convert the string to a number.\n\t specificity.val = '';\n\t\n\t for (var i=0; i 2 && key.slice(keyLength -2) === '[]') {\n\t isArray = true;\n\t key = key.slice(0, keyLength - 2);\n\t if(!queryParams[key]) {\n\t queryParams[key] = [];\n\t }\n\t }\n\t value = pair[1] ? $$route$recognizer$$decodeQueryParamPart(pair[1]) : '';\n\t }\n\t if (isArray) {\n\t queryParams[key].push(value);\n\t } else {\n\t queryParams[key] = value;\n\t }\n\t }\n\t return queryParams;\n\t },\n\t\n\t recognize: function(path) {\n\t var states = [ this.rootState ],\n\t pathLen, i, l, queryStart, queryParams = {},\n\t isSlashDropped = false;\n\t\n\t queryStart = path.indexOf('?');\n\t if (queryStart !== -1) {\n\t var queryString = path.substr(queryStart + 1, path.length);\n\t path = path.substr(0, queryStart);\n\t queryParams = this.parseQueryString(queryString);\n\t }\n\t\n\t path = decodeURI(path);\n\t\n\t if (path.charAt(0) !== \"/\") { path = \"/\" + path; }\n\t\n\t pathLen = path.length;\n\t if (pathLen > 1 && path.charAt(pathLen - 1) === \"/\") {\n\t path = path.substr(0, pathLen - 1);\n\t isSlashDropped = true;\n\t }\n\t\n\t for (i=0; i Date: Mon, 13 Feb 2017 16:29:11 +0200 Subject: [PATCH 10/11] updating powerbi-client version --- dist/config.d.ts | 2 +- dist/create.d.ts | 2 +- dist/dashboard.d.ts | 2 +- dist/embed.d.ts | 2 +- dist/factories.d.ts | 2 +- dist/ifilterable.d.ts | 2 +- dist/page.d.ts | 2 +- dist/powerbi.d.ts | 2 +- dist/powerbi.js | 4 ++-- dist/powerbi.js.map | 2 +- dist/powerbi.min.js | 4 ++-- dist/report.d.ts | 2 +- dist/service.d.ts | 2 +- dist/tile.d.ts | 2 +- dist/util.d.ts | 2 +- package.json | 2 +- src/config.ts | 2 +- 17 files changed, 19 insertions(+), 19 deletions(-) diff --git a/dist/config.d.ts b/dist/config.d.ts index 9aacee35..71b64c53 100644 --- a/dist/config.d.ts +++ b/dist/config.d.ts @@ -1,4 +1,4 @@ -/*! powerbi-client v2.2.3 | (c) 2016 Microsoft Corporation MIT */ +/*! powerbi-client v2.2.7 | (c) 2016 Microsoft Corporation MIT */ declare const config: { version: string; type: string; diff --git a/dist/create.d.ts b/dist/create.d.ts index b10b8e7b..6a11ea12 100644 --- a/dist/create.d.ts +++ b/dist/create.d.ts @@ -1,4 +1,4 @@ -/*! powerbi-client v2.2.3 | (c) 2016 Microsoft Corporation MIT */ +/*! powerbi-client v2.2.7 | (c) 2016 Microsoft Corporation MIT */ import * as service from './service'; import * as models from 'powerbi-models'; import * as embed from './embed'; diff --git a/dist/dashboard.d.ts b/dist/dashboard.d.ts index 42f63b90..b7d21cff 100644 --- a/dist/dashboard.d.ts +++ b/dist/dashboard.d.ts @@ -1,4 +1,4 @@ -/*! powerbi-client v2.2.3 | (c) 2016 Microsoft Corporation MIT */ +/*! powerbi-client v2.2.7 | (c) 2016 Microsoft Corporation MIT */ import * as service from './service'; import * as embed from './embed'; import * as models from 'powerbi-models'; diff --git a/dist/embed.d.ts b/dist/embed.d.ts index dfd74f56..6b50b0b2 100644 --- a/dist/embed.d.ts +++ b/dist/embed.d.ts @@ -1,4 +1,4 @@ -/*! powerbi-client v2.2.3 | (c) 2016 Microsoft Corporation MIT */ +/*! powerbi-client v2.2.7 | (c) 2016 Microsoft Corporation MIT */ import * as service from './service'; import * as models from 'powerbi-models'; declare global { diff --git a/dist/factories.d.ts b/dist/factories.d.ts index 480e23cb..2dfa8ff8 100644 --- a/dist/factories.d.ts +++ b/dist/factories.d.ts @@ -1,4 +1,4 @@ -/*! powerbi-client v2.2.3 | (c) 2016 Microsoft Corporation MIT */ +/*! powerbi-client v2.2.7 | (c) 2016 Microsoft Corporation MIT */ /** * TODO: Need to find better place for these factory functions or refactor how we handle dependency injection */ diff --git a/dist/ifilterable.d.ts b/dist/ifilterable.d.ts index 4fbf3453..11eddd1b 100644 --- a/dist/ifilterable.d.ts +++ b/dist/ifilterable.d.ts @@ -1,4 +1,4 @@ -/*! powerbi-client v2.2.3 | (c) 2016 Microsoft Corporation MIT */ +/*! powerbi-client v2.2.7 | (c) 2016 Microsoft Corporation MIT */ import * as models from 'powerbi-models'; /** * Decorates embed components that support filters diff --git a/dist/page.d.ts b/dist/page.d.ts index 1c7991eb..22886875 100644 --- a/dist/page.d.ts +++ b/dist/page.d.ts @@ -1,4 +1,4 @@ -/*! powerbi-client v2.2.3 | (c) 2016 Microsoft Corporation MIT */ +/*! powerbi-client v2.2.7 | (c) 2016 Microsoft Corporation MIT */ import { IFilterable } from './ifilterable'; import { IReportNode } from './report'; import * as models from 'powerbi-models'; diff --git a/dist/powerbi.d.ts b/dist/powerbi.d.ts index be45fe81..27f17ed7 100644 --- a/dist/powerbi.d.ts +++ b/dist/powerbi.d.ts @@ -1,4 +1,4 @@ -/*! powerbi-client v2.2.3 | (c) 2016 Microsoft Corporation MIT */ +/*! powerbi-client v2.2.7 | (c) 2016 Microsoft Corporation MIT */ import * as service from './service'; import * as factories from './factories'; import * as models from 'powerbi-models'; diff --git a/dist/powerbi.js b/dist/powerbi.js index 30f2a582..68c02875 100644 --- a/dist/powerbi.js +++ b/dist/powerbi.js @@ -1,4 +1,4 @@ -/*! powerbi-client v2.2.3 | (c) 2016 Microsoft Corporation MIT */ +/*! powerbi-client v2.2.7 | (c) 2016 Microsoft Corporation MIT */ (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); @@ -5410,7 +5410,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ function(module, exports) { var config = { - version: '2.2.3', + version: '2.2.7', type: 'js' }; Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/dist/powerbi.js.map b/dist/powerbi.js.map index 64540f17..a14f7e85 100644 --- a/dist/powerbi.js.map +++ b/dist/powerbi.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 1999f806a84dfdc4b8ce","webpack:///./src/powerbi.ts","webpack:///./src/service.ts","webpack:///./src/embed.ts","webpack:///./src/util.ts","webpack:///./src/report.ts","webpack:///./~/powerbi-models/dist/models.js","webpack:///./src/page.ts","webpack:///./src/create.ts","webpack:///./src/dashboard.ts","webpack:///./src/tile.ts","webpack:///./src/factories.ts","webpack:///./src/config.ts","webpack:///./~/window-post-message-proxy/dist/windowPostMessageProxy.js","webpack:///./~/http-post-message/dist/httpPostMessage.js","webpack:///./~/powerbi-router/dist/router.js"],"names":[],"mappings":"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AAC;SACvB,CAAC,CAAC;cACD,KAAK,CAAC,kBAAQ;aACb,MAAM,QAAQ,CAAC,IAAI,CAAC;SACtB,CAAC,CAAC,CAAC;KACP,CAAC;KAzPM,oBAAa,GAAG,CAAC,gBAAgB,EAAE,aAAa,CAAC,CAAC;KAClD,wBAAiB,GAAG,mBAAmB,CAAC;KACxC,iCAA0B,GAAG,sCAAsC,CAAC;KACpE,qCAA8B,GAAG,2CAA2C,CAAC;KAC7E,oBAAa,GAAG,cAAc,CAAC;KAC/B,WAAI,GAAG,QAAQ,CAAC;KAqPzB,aAAC;AAAD,EAAC,CA3P2B,KAAK,CAAC,KAAK,GA2PtC;AA3PY,eAAM,SA2PlB;;;;;;;ACzRD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD,qCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;AACA,qBAAoB,sBAAsB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA,GAAE,gDAAgD;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA,0BAAyB,uBAAuB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAwB,2BAA2B;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA,0BAAyB,uBAAuB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAiD,+BAA+B,GAAG,sCAAsC;AACzH,mDAAkD,+BAA+B,GAAG,sCAAsC;AAC1H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE,kDAAkD;AACpD;AACA;AACA;AACA;AACA,GAAE,4CAA4C;AAC9C;AACA;;;AAGA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAQ;AACR;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;AACA,SAAQ;AACR;AACA;AACA,SAAQ;AACR;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;AACA,SAAQ;AACR;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA,MAAK;AACL;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA,OAAM;AACN;AACA;AACA,OAAM;AACN;AACA;AACA,OAAM;AACN;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;;AAEA,QAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAe;AACf;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,+BAA8B;AAC9B;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,uFAAsF;AACtF;AACA,qBAAoB;AACpB;;AAEA;AACA;AACA,oFAAmF;AACnF;AACA,yBAAwB;AACxB;AACA;;AAEA;AACA;AACA,sFAAqF;AACrF;AACA,yBAAwB;AACxB;AACA;;AAEA;AACA;AACA,oFAAmF;AACnF;AACA,yBAAwB;AACxB;AACA;;AAEA;AACA;AACA,sFAAqF;AACrF;AACA,yBAAwB;AACxB;AACA;;AAEA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ACA;AACA;AACA;AACA;;AAEA,iBAAgB,iBAAiB;AACjC;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAgB,SAAS;AACzB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,wCAAuC,SAAS;AAChD;AACA;AACA;AACA;AACA;AACA;;AAEA,uCAAsC,SAAS;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,2CAA0C,SAAS;AACnD;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA,iBAAgB,4BAA4B;AAC5C;AACA;;AAEA,qBAAoB,iBAAiB;AACrC;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA,qBAAoB,kBAAkB;AACtC;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,yBAAwB,qBAAqB;AAC7C;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAwB,yBAAyB;AACjD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAwB,gBAAgB;AACxC;AACA;AACA;AACA;AACA;AACA;;AAEA,qBAAoB,yBAAyB;AAC7C;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;;AAEN;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,8BAA6B;;AAE7B;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,SAAQ;;AAER;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,yCAAwC,SAAS;AACjD;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA,iBAAgB;AAChB;;AAEA;;AAEA;AACA,qCAAoC;AACpC;;AAEA,iBAAgB,qBAAqB;AACrC;;AAEA,mFAAkF;;AAElF;;AAEA,sBAAqB;;AAErB;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,4BAA2B;AAC3B,uCAAsC;AACtC;AACA;AACA,eAAc,sBAAsB;AACpC;AACA,0BAAyB;AACzB;AACA;AACA,+BAA8B,GAAG;AACjC;AACA,0BAAyB;AACzB;AACA;;AAEA;AACA;AACA,OAAM;;AAEN;AACA;;AAEA;AACA;AACA,qFAAoF;AACpF;AACA,8BAA6B;AAC7B;AACA;AACA,uDAAsD;AACtD,uDAAsD;;AAEtD;;AAEA,iHAAgH;AAChH;AACA,8BAA6B;AAC7B;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,4BAA2B,0BAA0B,EAAE;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA;AACA;AACA,wBAAuB,yBAAyB;;AAEhD;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;AAGA,QAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAgB;AAChB,iBAAgB;AAChB;AACA;AACA,qCAAoC,WAAW;AAC/C;AACA,WAAU;AACV;AACA;AACA,WAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,kEAAiE;AACjE;AACA,8CAA6C;AAC7C,wBAAuB;AACvB;;AAEA;AACA;AACA,+BAA8B;AAC9B;AACA,8CAA6C,iBAAiB,EAAE;;AAEhE;AACA;;AAEA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,iBAAgB,kBAAkB;AAClC;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,wBAAuB;AACvB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,qBAAoB,cAAc;AAClC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA,QAAO;AACP;AACA;;AAEA;;AAEA;;AAEA;AACA,uCAAsC,SAAS;AAC/C;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,OAAM;AACN;;AAEA;;AAEA,QAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAM;;AAEN;AACA;AACA;;AAEA;AACA;;AAEA;AACA,sEAAqE;AACrE;AACA;AACA;AACA;AACA;AACA,uBAAsB;AACtB;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,0BAAyB;AACzB;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,iBAAgB,iBAAiB;AACjC;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,WAAU;;AAEV;AACA,OAAM;;AAEN;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,oCAAmC,SAAS;AAC5C;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,kBAAiB,KAAK;;AAEtB;AACA;AACA;AACA;AACA;AACA;AACA,uCAAsC;AACtC;AACA;AACA,6CAA4C,KAAK;AACjD,4CAA2C,KAAK;AAChD;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;AACN;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA,SAAQ;AACR;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,sCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,qBAAoB,4BAA4B;AAChD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,qBAAoB,yBAAyB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,6CAA4C,OAAO;AACnD;AACA;AACA;AACA;AACA,4CAA2C,OAAO;AAClD;AACA;AACA;AACA;AACA;AACA,eAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,4CAA2C,OAAO;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAI;AACJ;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,oBAAmB,mBAAmB;AACtC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,sBAAqB,mBAAmB;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAsB,iBAAiB;AACvC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,gCAA+B,QAAQ;AACvC;AACA;AACA;AACA,OAAM;AACN;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA,YAAW,MAAM;AACjB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAI;AACJ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA,QAAO;AACP;AACA;;AAEA,oCAAmC,sDAAsD;AACzF,GAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,cAAa,OAAO;AACpB,gBAAe,MAAM;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAa,MAAM;AACnB,cAAa,SAAS;AACtB;AACA,gBAAe,MAAM;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB,cAAa,SAAS;AACtB;AACA,gBAAe,MAAM;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB,gBAAe,MAAM;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAsC;AACtC;AACA,OAAM;AACN,8BAA6B;AAC7B;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAa,MAAM;AACnB,gBAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;;AAEA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB,gBAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB,gBAAe,OAAO;AACtB;AACA;AACA,WAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAgC,mCAAmC;AACnE;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB,gBAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,eAAc,WAAW;AACzB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,0BAAyB;;AAEzB,2CAA0C,qBAAqB;;AAE/D;AACA;AACA;AACA;AACA;AACA,oCAAmC,oBAAoB;;AAEvD;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB,gBAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,eAAc,iBAAiB;AAC/B;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,4BAA2B,iBAAiB;AAC5C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,gBAAe,iBAAiB;AAChC;;AAEA;AACA;AACA;;AAEA;AACA;AACA,gCAA+B,oBAAoB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB;AACA,gBAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB;AACA,gBAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ,IAAG;AACH,wCAAuC;AACvC;AACA,KAAI,OAAO;AACX;AACA;AACA;AACA;AACA,IAAG,OAAO;AACV;AACA;;AAEA,GAAE;;AAEF,8BAA6B,6DAA6D,aAAa,EAAE;;AAEzG,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA,QAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;;;AAGA,QAAO;AACP;AACA;;AAEA;;AAEA;AACA;;;AAGA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,mBAAkB,SAAS;AAC3B;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,OAAM;AACN;AACA,OAAM;AACN;AACA;AACA;;AAEA;AACA;;;AAGA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV,SAAQ;AACR;AACA;AACA,OAAM;;AAEN;;AAEA;AACA;AACA;AACA;;;AAGA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ,iBAAgB;AAChB;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AACA;AACA,KAAI;AACJ;AA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CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAuD,uCAAuC;AAC9F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2FAA0F;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAsB;AACtB;AACA;AACA,eAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;;;AAGA;AACA;AACA,EAAC;AACD;AACA,mD;;;;;;ACtSA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD,qCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,0CAAyC,qBAAqB;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAkC,cAAc;AAChD,wCAAuC,yCAAyC;AAChF;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA,mCAAkC,cAAc;AAChD,wCAAuC,yCAAyC;AAChF;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA,mCAAkC,cAAc;AAChD,wCAAuC,yCAAyC;AAChF;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA,mCAAkC,cAAc;AAChD,wCAAuC,yCAAyC;AAChF;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA,gCAA+B,aAAa;AAC5C,mCAAkC,cAAc;AAChD,wCAAuC,yCAAyC;AAChF;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA,wCAAuC,yCAAyC;AAChF,0CAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAAyB,uBAAuB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA;AACA,GAAE;AACF;;;AAGA;AACA;AACA,EAAC;AACD;AACA,4C;;;;;;AClLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD,qCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAqC,iBAAiB,EAAE;AACxD;AACA;AACA,eAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;;;AAGA,QAAO;AACP;AACA;;AAEA,oCAAmC,8CAA8C;AACjF;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,wCAAuC,6EAA6E;AACpH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAQ;;AAER;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,WAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;AACA,qBAAoB,qBAAqB;AACzC;AACA;;AAEA;AACA,qBAAoB;AACpB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAY;AACZ;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA,iCAAgC,+BAA+B;AAC/D,gBAAe,iBAAiB;AAChC,SAAQ;AACR;;AAEA;AACA;AACA,8BAA6B,KAAK;AAClC;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,0DAAyD,sBAAsB;AAC/E;AACA;AACA;;AAEA,uBAAsB,iBAAiB;AACvC;AACA,6CAA4C,yDAAyD;AACrG;;AAEA;AACA,SAAQ;;AAER;AACA;AACA,SAAQ;;AAER;AACA;AACA;AACA;;AAEA,yDAAwD,kBAAkB;AAC1E;AACA;AACA,mCAAkC,yDAAyD;AAC3F,SAAQ;;AAER;AACA;AACA,SAAQ;;AAER;AACA;AACA;AACA;;AAEA,sDAAqD,kBAAkB;AACvE;AACA;AACA,mCAAkC,wDAAwD;AAC1F,SAAQ;;AAER;AACA;AACA,SAAQ;;AAER;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAQ;AACR,2BAA0B,WAAW,EAAE;AACvC,8BAA6B,WAAW;AACxC;;AAEA;AACA;AACA;AACA,sCAAqC,yBAAyB;;AAE9D;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,qBAAoB,mBAAmB;AACvC;;AAEA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA;AACA,WAAU;AACV;AACA;AACA,WAAU;AACV;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,uBAAsB,qBAAqB;AAC3C;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAQ;;AAER;AACA;;AAEA;AACA;AACA,2CAA0C,cAAc;;AAExD;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAQ;;AAER;AACA;AACA;AACA;;AAEA;;AAEA,uBAAsB,qBAAqB;AAC3C;;AAEA;;AAEA;AACA,6CAA4C,sBAAsB;AAClE,aAAY;AACZ,6CAA4C,sBAAsB;AAClE;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAQ;AACR;;AAEA;AACA;;AAEA,sCAAqC,KAAK;AAC1C;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;;AAEN;AACA;AACA;AACA;;AAEA;;AAEA,qBAAoB,mBAAmB;AACvC;;AAEA,uBAAsB,gBAAgB;AACtC;AACA;;AAEA,uBAAsB;AACtB;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAQ,eAAe;AACvB;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,8BAA6B;AAC7B;;AAEA;;AAEA,uBAAsB,iBAAiB;AACvC;;AAEA;;AAEA;;AAEA,yBAAwB,mBAAmB;AAC3C;;AAEA,0EAAyE,UAAU;;AAEnF;;AAEA;AACA,+CAA8C,0DAA0D;AACxG;;AAEA;AACA;AACA;AACA;AACA,2BAA0B;AAC1B;AACA;;AAEA;AACA,6CAA4C,0DAA0D;AACtG;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAQ;;AAER;AACA;;AAEA,uBAAsB,oDAAoD;;AAE1E;;AAEA,uBAAsB,yBAAyB;AAC/C;AACA;;AAEA;AACA,SAAQ;;AAER;AACA;AACA,SAAQ;;AAER;AACA;AACA,uBAAsB,oDAAoD;;AAE1E;;AAEA,uBAAsB,mBAAmB;AACzC;;AAEA,wEAAuE,UAAU;;AAEjF;AACA;AACA;;AAEA,yCAAwC,uBAAuB;;AAE/D;AACA;AACA;;AAEA;AACA,SAAQ;;AAER;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAwB,iBAAiB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA4B,kBAAkB;AAC9C;AACA;AACA;AACA,aAAY;AACZ;AACA;AACA;AACA;;AAEA,mCAAkC,WAAW;;AAE7C;AACA,SAAQ;;AAER;AACA;AACA,sBAAqB,kBAAkB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAY;AACZ;AACA;AACA;AACA;AACA,SAAQ;;AAER;AACA;AACA,yDAAwD;AACxD;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,uCAAsC,mBAAmB;;AAEzD;AACA;AACA;AACA;AACA;;AAEA,mBAAkB,eAAe;AACjC;AACA,iCAAgC,OAAO;AACvC;;AAEA;AACA,mBAAkB,iBAAiB;AACnC,qCAAoC,2BAA2B;AAC/D;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA,sDAAqD,oCAAoC,EAAE;AAC3F,OAAM;AACN;AACA,OAAM;AACN;AACA;AACA,GAAE;;AAEF;AACA,8BAA6B;;AAE7B,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA,QAAO;AACP;AACA;;AAEA,+BAA8B,mDAAmD;;;AAGjF;AACA;AACA,EAAC;AACD;AACA,mC","file":"powerbi.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"powerbi-client\"] = factory();\n\telse\n\t\troot[\"powerbi-client\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 1999f806a84dfdc4b8ce","import * as service from './service';\r\nimport * as factories from './factories';\r\nimport * as models from 'powerbi-models';\r\nimport { IFilterable } from './ifilterable';\r\n\r\nexport {\r\n IFilterable,\r\n service,\r\n factories,\r\n models\r\n};\r\nexport {\r\n Report\r\n} from './report';\r\nexport {\r\n Tile\r\n} from './tile';\r\nexport {\r\n IEmbedConfiguration,\r\n Embed\r\n} from './embed';\r\nexport {\r\n Page\r\n} from './page';\r\n\r\ndeclare var powerbi: service.Service;\r\ndeclare global {\r\n interface Window {\r\n powerbi: service.Service;\r\n }\r\n}\r\n\r\n/**\r\n * Makes Power BI available to the global object for use in applications that don't have module loading support.\r\n *\r\n * Note: create an instance of the class with the default configuration for normal usage, or save the class so that you can create an instance of the service.\r\n */\r\nvar powerbi = new service.Service(factories.hpmFactory, factories.wpmpFactory, factories.routerFactory);\r\nwindow.powerbi = powerbi;\n\n\n// WEBPACK FOOTER //\n// ./src/powerbi.ts","import * as embed from './embed';\nimport { Report } from './report';\nimport { Create } from './create';\nimport { Dashboard } from './dashboard';\nimport { Tile } from './tile';\nimport { Page } from './page';\nimport * as utils from './util';\nimport * as wpmp from 'window-post-message-proxy';\nimport * as hpm from 'http-post-message';\nimport * as router from 'powerbi-router';\nimport * as models from 'powerbi-models';\n\nexport interface IEvent {\n type: string;\n id: string;\n name: string;\n value: T;\n}\n\nexport interface ICustomEvent extends CustomEvent {\n detail: T;\n}\n\nexport interface IEventHandler {\n (event: ICustomEvent): any;\n}\n\nexport interface IHpmFactory {\n (wpmp: wpmp.WindowPostMessageProxy, targetWindow?: Window, version?: string, type?: string, origin?: string): hpm.HttpPostMessage;\n}\n\nexport interface IWpmpFactory {\n (name?: string, logMessages?: boolean, eventSourceOverrideWindow?: Window): wpmp.WindowPostMessageProxy;\n}\n\nexport interface IRouterFactory {\n (wpmp: wpmp.WindowPostMessageProxy): router.Router;\n}\n\nexport interface IPowerBiElement extends HTMLElement {\n powerBiEmbed: embed.Embed;\n}\n\nexport interface IDebugOptions {\n logMessages?: boolean;\n wpmpName?: string;\n}\n\nexport interface IServiceConfiguration extends IDebugOptions {\n autoEmbedOnContentLoaded?: boolean;\n onError?: (error: any) => any;\n version?: string;\n type?: string;\n}\n\nexport interface IService {\n hpm: hpm.HttpPostMessage;\n}\n\n/**\n * The Power BI Service embed component, which is the entry point to embed all other Power BI components into your application\n * \n * @export\n * @class Service\n * @implements {IService}\n */\nexport class Service implements IService {\n\n /**\n * A list of components that this service can embed\n */\n private static components: (typeof Report | typeof Tile | typeof Dashboard)[] = [\n Tile,\n Report,\n Dashboard\n ];\n\n /**\n * The default configuration for the service\n */\n private static defaultConfig: IServiceConfiguration = {\n autoEmbedOnContentLoaded: false,\n onError: (...args) => console.log(args[0], args.slice(1))\n };\n\n /**\n * Gets or sets the access token as the global fallback token to use when a local token is not provided for a report or tile.\n * \n * @type {string}\n */\n accessToken: string;\n\n /**The Configuration object for the service*/\n private config: IServiceConfiguration;\n\n /** A list of Dashboard, Report and Tile components that have been embedded using this service instance. */\n private embeds: embed.Embed[];\n /** TODO: Look for way to make hpm private without sacraficing ease of maitenance. This should be private but in embed needs to call methods. */\n hpm: hpm.HttpPostMessage;\n /** TODO: Look for way to make wpmp private. This is only public to allow stopping the wpmp in tests */\n wpmp: wpmp.WindowPostMessageProxy;\n private router: router.Router;\n\n /**\n * Creates an instance of a Power BI Service.\n * \n * @param {IHpmFactory} hpmFactory The http post message factory used in the postMessage communication layer\n * @param {IWpmpFactory} wpmpFactory The window post message factory used in the postMessage communication layer\n * @param {IRouterFactory} routerFactory The router factory used in the postMessage communication layer\n * @param {IServiceConfiguration} [config={}]\n */\n constructor(hpmFactory: IHpmFactory, wpmpFactory: IWpmpFactory, routerFactory: IRouterFactory, config: IServiceConfiguration = {}) {\n this.wpmp = wpmpFactory(config.wpmpName, config.logMessages);\n this.hpm = hpmFactory(this.wpmp, null, config.version, config.type);\n this.router = routerFactory(this.wpmp);\n\n /**\n * Adds handler for report events.\n */\n this.router.post(`/reports/:uniqueId/events/:eventName`, (req, res) => {\n const event: IEvent = {\n type: 'report',\n id: req.params.uniqueId,\n name: req.params.eventName,\n value: req.body\n };\n\n this.handleEvent(event);\n });\n this.router.post(`/reports/:uniqueId/pages/:pageName/events/:eventName`, (req, res) => {\n const event: IEvent = {\n type: 'report',\n id: req.params.uniqueId,\n name: req.params.eventName,\n value: req.body\n };\n\n this.handleEvent(event);\n });\n\n this.router.post(`/dashboards/:uniqueId/events/:eventName`, (req, res) => {\n const event: IEvent = {\n type: 'dashboard',\n id: req.params.uniqueId,\n name: req.params.eventName,\n value: req.body\n };\n\n this.handleEvent(event);\n });\n\n this.embeds = [];\n\n // TODO: Change when Object.assign is available.\n this.config = utils.assign({}, Service.defaultConfig, config);\n\n if (this.config.autoEmbedOnContentLoaded) {\n this.enableAutoEmbed();\n }\n }\n\n /**\n * Creates new report\n * @param {HTMLElement} element\n * @param {embed.IEmbedConfiguration} [config={}]\n * @returns {embed.Embed}\n */\n createReport(element: HTMLElement, config: embed.IEmbedConfiguration): embed.Embed {\n config.type = 'create';\n let powerBiElement = element;\n const component = new Create(this, powerBiElement, config);\n powerBiElement.powerBiEmbed = component;\n this.embeds.push(component);\n\n return component;\n }\n\n /**\n * TODO: Add a description here\n * \n * @param {HTMLElement} [container]\n * @param {embed.IEmbedConfiguration} [config=undefined]\n * @returns {embed.Embed[]}\n */\n init(container?: HTMLElement, config: embed.IEmbedConfiguration = undefined): embed.Embed[] {\n container = (container && container instanceof HTMLElement) ? container : document.body;\n\n const elements = Array.prototype.slice.call(container.querySelectorAll(`[${embed.Embed.embedUrlAttribute}]`));\n return elements.map(element => this.embed(element, config));\n }\n\n /**\n * Given a configuration based on an HTML element,\n * if the component has already been created and attached to the element, reuses the component instance and existing iframe,\n * otherwise creates a new component instance.\n * \n * @param {HTMLElement} element\n * @param {embed.IEmbedConfiguration} [config={}]\n * @returns {embed.Embed}\n */\n embed(element: HTMLElement, config: embed.IEmbedConfiguration = {}): embed.Embed {\n let component: embed.Embed;\n let powerBiElement = element;\n\n if (powerBiElement.powerBiEmbed) {\n component = this.embedExisting(powerBiElement, config);\n }\n else {\n component = this.embedNew(powerBiElement, config);\n }\n\n return component;\n }\n\n /**\n * Given a configuration based on a Power BI element, saves the component instance that reference the element for later lookup.\n * \n * @private\n * @param {IPowerBiElement} element\n * @param {embed.IEmbedConfiguration} config\n * @returns {embed.Embed}\n */\n private embedNew(element: IPowerBiElement, config: embed.IEmbedConfiguration): embed.Embed {\n const componentType = config.type || element.getAttribute(embed.Embed.typeAttribute);\n if (!componentType) {\n throw new Error(`Attempted to embed using config ${JSON.stringify(config)} on element ${element.outerHTML}, but could not determine what type of component to embed. You must specify a type in the configuration or as an attribute such as '${embed.Embed.typeAttribute}=\"${Report.type.toLowerCase()}\"'.`);\n }\n\n // Saves the type as part of the configuration so that it can be referenced later at a known location.\n config.type = componentType;\n\n const Component = utils.find(component => componentType === component.type.toLowerCase(), Service.components);\n if (!Component) {\n throw new Error(`Attempted to embed component of type: ${componentType} but did not find any matching component. Please verify the type you specified is intended.`);\n }\n\n const component = new Component(this, element, config);\n element.powerBiEmbed = component;\n this.embeds.push(component);\n\n return component;\n }\n\n /**\n * Given an element that already contains an embed component, load with a new configuration.\n * \n * @private\n * @param {IPowerBiElement} element\n * @param {embed.IEmbedConfiguration} config\n * @returns {embed.Embed}\n */\n private embedExisting(element: IPowerBiElement, config: embed.IEmbedConfiguration): embed.Embed {\n const component = utils.find(x => x.element === element, this.embeds);\n if (!component) {\n throw new Error(`Attempted to embed using config ${JSON.stringify(config)} on element ${element.outerHTML} which already has embedded comopnent associated, but could not find the existing comopnent in the list of active components. This could indicate the embeds list is out of sync with the DOM, or the component is referencing the incorrect HTML element.`);\n }\n\n /**\n * TODO: Dynamic embed type switching could be supported but there is work needed to prepare the service state and DOM cleanup.\n * remove all event handlers from the DOM, then reset the element to initial state which removes iframe, and removes from list of embeds\n * then we can call the embedNew function which would allow setting the proper embedUrl and construction of object based on the new type.\n */\n if (typeof config.type === \"string\" && config.type !== component.config.type) {\n\n /**\n * When loading report after create we want to use existing Iframe to optimize load period\n */\n if(config.type === \"report\" && component.config.type === \"create\") {\n const report = new Report(this, element, config, element.powerBiEmbed.iframe);\n report.load(config);\n element.powerBiEmbed = report;\n this.embeds.push(report);\n\n return report;\n }\n\n throw new Error(`Embedding on an existing element with a different type than the previous embed object is not supported. Attempted to embed using config ${JSON.stringify(config)} on element ${element.outerHTML}, but the existing element contains an embed of type: ${this.config.type} which does not match the new type: ${config.type}`);\n }\n\n component.load(config);\n\n return component;\n }\n\n /**\n * Adds an event handler for DOMContentLoaded, which searches the DOM for elements that have the 'powerbi-embed-url' attribute,\n * and automatically attempts to embed a powerbi component based on information from other powerbi-* attributes.\n *\n * Note: Only runs if `config.autoEmbedOnContentLoaded` is true when the service is created.\n * This handler is typically useful only for applications that are rendered on the server so that all required data is available when the handler is called.\n */\n enableAutoEmbed(): void {\n window.addEventListener('DOMContentLoaded', (event: Event) => this.init(document.body), false);\n }\n\n /**\n * Returns an instance of the component associated with the element.\n * \n * @param {HTMLElement} element\n * @returns {(Report | Tile)}\n */\n get(element: HTMLElement): Report | Tile | Dashboard {\n const powerBiElement = element;\n\n if (!powerBiElement.powerBiEmbed) {\n throw new Error(`You attempted to get an instance of powerbi component associated with element: ${element.outerHTML} but there was no associated instance.`);\n }\n\n return powerBiElement.powerBiEmbed;\n }\n\n /**\n * Finds an embed instance by the name or unique ID that is provided.\n * \n * @param {string} uniqueId\n * @returns {(Report | Tile)}\n */\n find(uniqueId: string): Report | Tile | Dashboard {\n return utils.find(x => x.config.uniqueId === uniqueId, this.embeds);\n }\n\n /**\n * Given an HTML element that has a component embedded within it, removes the component from the list of embedded components, removes the association between the element and the component, and removes the iframe.\n * \n * @param {HTMLElement} element\n * @returns {void}\n */\n reset(element: HTMLElement): void {\n const powerBiElement = element;\n\n if (!powerBiElement.powerBiEmbed) {\n return;\n }\n\n /** Removes the component from an internal list of components. */\n utils.remove(x => x === powerBiElement.powerBiEmbed, this.embeds);\n /** Deletes a property from the HTML element. */\n delete powerBiElement.powerBiEmbed;\n /** Removes the iframe from the element. */\n const iframe = element.querySelector('iframe');\n if (iframe) {\n iframe.remove();\n }\n }\n\n /**\n * Given an event object, finds the embed component with the matching type and ID, and invokes its handleEvent method with the event object.\n * \n * @private\n * @param {IEvent} event\n */\n private handleEvent(event: IEvent): void {\n const embed = utils.find(embed => {\n return (embed.config.uniqueId === event.id);\n }, this.embeds);\n\n if (embed) {\n const value = event.value;\n\n if (event.name === 'pageChanged') {\n const pageKey = 'newPage';\n const page: models.IPage = value[pageKey];\n if (!page) {\n throw new Error(`Page model not found at 'event.value.${pageKey}'.`);\n }\n value[pageKey] = new Page(embed, page.name, page.displayName);\n }\n\n utils.raiseCustomEvent(embed.element, event.name, value);\n }\n }\n}\n\n\n// WEBPACK FOOTER //\n// ./src/service.ts","import * as utils from './util';\r\nimport * as service from './service';\r\nimport * as models from 'powerbi-models';\r\nimport * as hpm from 'http-post-message';\r\n\r\ndeclare global {\r\n interface Document {\r\n // Mozilla Fullscreen\r\n mozCancelFullScreen: Function;\r\n\r\n // Ms Fullscreen\r\n msExitFullscreen: Function;\r\n }\r\n\r\n interface HTMLIFrameElement {\r\n // Mozilla Fullscreen\r\n mozRequestFullScreen: Function;\r\n\r\n // Ms Fullscreen\r\n msRequestFullscreen: Function;\r\n }\r\n}\r\n\r\n// TODO: Re-use ILoadConfiguration interface to prevent duplicating properties.\r\n// Current issue is that they are optional when embedding since they can be specificed as attributes but they are required when loading.\r\n/**\r\n * Configuration settings for Power BI embed components\r\n * \r\n * @export\r\n * @interface IEmbedConfiguration\r\n */\r\nexport interface IEmbedConfiguration {\r\n type?: string;\r\n id?: string;\r\n uniqueId?: string;\r\n embedUrl?: string;\r\n accessToken?: string;\r\n settings?: models.ISettings;\r\n pageName?: string;\r\n filters?: models.IFilter[];\r\n pageView?: models.PageView;\r\n datasetId?: string;\r\n permissions?: models.Permissions;\r\n viewMode?: models.ViewMode;\r\n}\r\n\r\nexport interface IInternalEmbedConfiguration extends models.IReportLoadConfiguration {\r\n uniqueId: string;\r\n type: string;\r\n embedUrl: string;\r\n}\r\n\r\nexport interface IInternalEventHandler {\r\n test(event: service.IEvent): boolean;\r\n handle(event: service.ICustomEvent): void;\r\n}\r\n\r\n/**\r\n * Base class for all Power BI embed components\r\n * \r\n * @export\r\n * @abstract\r\n * @class Embed\r\n */\r\nexport abstract class Embed {\r\n static allowedEvents = [\"loaded\", \"saved\", \"rendered\", \"saveAsTriggered\", \"error\", \"dataSelected\"];\r\n static accessTokenAttribute = 'powerbi-access-token';\r\n static embedUrlAttribute = 'powerbi-embed-url';\r\n static nameAttribute = 'powerbi-name';\r\n static typeAttribute = 'powerbi-type';\r\n static type: string;\r\n\r\n private static defaultSettings: models.ISettings = {\r\n filterPaneEnabled: true\r\n };\r\n\r\n allowedEvents = [];\r\n\r\n /**\r\n * Gets or sets the event handler registered for this embed component.\r\n * \r\n * @type {IInternalEventHandler[]}\r\n */\r\n eventHandlers: IInternalEventHandler[];\r\n\r\n /**\r\n * Gets or sets the Power BI embed service.\r\n * \r\n * @type {service.Service}\r\n */\r\n service: service.Service;\r\n\r\n /**\r\n * Gets or sets the HTML element that contains the Power BI embed component.\r\n * \r\n * @type {HTMLElement}\r\n */\r\n element: HTMLElement;\r\n\r\n /**\r\n * Gets or sets the HTML iframe element that renders the Power BI embed component.\r\n * \r\n * @type {HTMLIFrameElement}\r\n */\r\n iframe: HTMLIFrameElement;\r\n\r\n /**\r\n * Gets or sets the configuration settings for the Power BI embed component.\r\n * \r\n * @type {IInternalEmbedConfiguration}\r\n */\r\n config: IInternalEmbedConfiguration;\r\n\r\n /**\r\n * Gets or sets the configuration settings for creating report.\r\n * \r\n * @type {models.IReportCreateConfiguration}\r\n */\r\n createConfig: models.IReportCreateConfiguration;\r\n\r\n /**\r\n * Url used in the load request.\r\n */\r\n loadPath: string;\r\n\r\n /**\r\n * Type of embed\r\n */\r\n embeType: string;\r\n\r\n /**\r\n * Creates an instance of Embed.\r\n * \r\n * Note: there is circular reference between embeds and the service, because\r\n * the service has a list of all embeds on the host page, and each embed has a reference to the service that created it.\r\n * \r\n * @param {service.Service} service\r\n * @param {HTMLElement} element\r\n * @param {IEmbedConfiguration} config\r\n */\r\n constructor(service: service.Service, element: HTMLElement, config: IEmbedConfiguration, iframe?: HTMLIFrameElement) {\r\n Array.prototype.push.apply(this.allowedEvents, Embed.allowedEvents);\r\n this.eventHandlers = [];\r\n this.service = service;\r\n this.element = element;\r\n this.iframe = iframe;\r\n this.embeType = config.type.toLowerCase();\r\n\r\n this.populateConfig(config);\r\n \r\n if(this.embeType === 'create'){\r\n this.setIframe(false/*set EventListener to call create() on 'load' event*/);\r\n } else {\r\n this.setIframe(true/*set EventListener to call load() on 'load' event*/);\r\n }\r\n }\r\n\r\n /**\r\n * Sends createReport configuration data.\r\n * \r\n * ```javascript\r\n * createReport({\r\n * datasetId: '5dac7a4a-4452-46b3-99f6-a25915e0fe55',\r\n * accessToken: 'eyJ0eXA ... TaE2rTSbmg',\r\n * ```\r\n * \r\n * @param {models.IReportCreateConfiguration} config\r\n * @returns {Promise}\r\n */\r\n createReport(config: models.IReportCreateConfiguration): Promise {\r\n const errors = this.validate(config);\r\n if (errors) {\r\n throw errors;\r\n }\r\n \r\n return this.service.hpm.post(\"/report/create\", config, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n return response.body;\r\n },\r\n response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Saves Report.\r\n * \r\n * @returns {Promise}\r\n */\r\n save(): Promise {\r\n return this.service.hpm.post('/report/save', null, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n return response.body;\r\n })\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * SaveAs Report.\r\n * \r\n * @returns {Promise}\r\n */\r\n saveAs(saveAsParameters: models.ISaveAsParameters): Promise {\r\n return this.service.hpm.post('/report/saveAs', saveAsParameters, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n return response.body;\r\n })\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Sends load configuration data.\r\n * \r\n * ```javascript\r\n * report.load({\r\n * type: 'report',\r\n * id: '5dac7a4a-4452-46b3-99f6-a25915e0fe55',\r\n * accessToken: 'eyJ0eXA ... TaE2rTSbmg',\r\n * settings: {\r\n * navContentPaneEnabled: false\r\n * },\r\n * pageName: \"DefaultPage\",\r\n * filters: [\r\n * {\r\n * ... DefaultReportFilter ...\r\n * }\r\n * ]\r\n * })\r\n * .catch(error => { ... });\r\n * ```\r\n * \r\n * @param {models.ILoadConfiguration} config\r\n * @returns {Promise}\r\n */\r\n load(config: models.IReportLoadConfiguration | models.IDashboardLoadConfiguration): Promise {\r\n const errors = this.validate(config);\r\n if (errors) {\r\n throw errors;\r\n }\r\n\r\n return this.service.hpm.post(this.loadPath, config, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n utils.assign(this.config, config);\r\n return response.body;\r\n },\r\n response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Removes one or more event handlers from the list of handlers.\r\n * If a reference to the existing handle function is specified, remove the specific handler.\r\n * If the handler is not specified, remove all handlers for the event name specified.\r\n * \r\n * ```javascript\r\n * report.off('pageChanged')\r\n * \r\n * or \r\n * \r\n * const logHandler = function (event) {\r\n * console.log(event);\r\n * };\r\n * \r\n * report.off('pageChanged', logHandler);\r\n * ```\r\n * \r\n * @template T\r\n * @param {string} eventName\r\n * @param {service.IEventHandler} [handler]\r\n */\r\n off(eventName: string, handler?: service.IEventHandler): void {\r\n const fakeEvent: service.IEvent = { name: eventName, type: null, id: null, value: null };\r\n if (handler) {\r\n utils.remove(eventHandler => eventHandler.test(fakeEvent) && (eventHandler.handle === handler), this.eventHandlers);\r\n this.element.removeEventListener(eventName, handler);\r\n }\r\n else {\r\n const eventHandlersToRemove = this.eventHandlers\r\n .filter(eventHandler => eventHandler.test(fakeEvent));\r\n\r\n eventHandlersToRemove\r\n .forEach(eventHandlerToRemove => {\r\n utils.remove(eventHandler => eventHandler === eventHandlerToRemove, this.eventHandlers);\r\n this.element.removeEventListener(eventName, eventHandlerToRemove.handle);\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Adds an event handler for a specific event.\r\n * \r\n * ```javascript\r\n * report.on('pageChanged', (event) => {\r\n * console.log('PageChanged: ', event.page.name);\r\n * });\r\n * ```\r\n * \r\n * @template T\r\n * @param {string} eventName\r\n * @param {service.IEventHandler} handler\r\n */\r\n on(eventName: string, handler: service.IEventHandler): void {\r\n if (this.allowedEvents.indexOf(eventName) === -1) {\r\n throw new Error(`eventName is must be one of ${this.allowedEvents}. You passed: ${eventName}`);\r\n }\r\n\r\n this.eventHandlers.push({\r\n test: (event: service.IEvent) => event.name === eventName,\r\n handle: handler\r\n });\r\n\r\n this.element.addEventListener(eventName, handler)\r\n }\r\n\r\n /**\r\n * Reloads embed using existing configuration.\r\n * E.g. For reports this effectively clears all filters and makes the first page active which simulates resetting a report back to loaded state.\r\n * \r\n * ```javascript\r\n * report.reload();\r\n * ```\r\n */\r\n reload(): Promise {\r\n return this.load(this.config);\r\n }\r\n \r\n /**\r\n * Set accessToken.\r\n * \r\n * @returns {Promise}\r\n */\r\n setAccessToken(accessToken: string): Promise {\r\n return this.service.hpm.post('/report/token', accessToken, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n return response.body;\r\n })\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n \r\n /**\r\n * Gets an access token from the first available location: config, attribute, global.\r\n * \r\n * @private\r\n * @param {string} globalAccessToken\r\n * @returns {string}\r\n */\r\n private getAccessToken(globalAccessToken: string): string {\r\n const accessToken = this.config.accessToken || this.element.getAttribute(Embed.accessTokenAttribute) || globalAccessToken;\r\n\r\n if (!accessToken) {\r\n throw new Error(`No access token was found for element. You must specify an access token directly on the element using attribute '${Embed.accessTokenAttribute}' or specify a global token at: powerbi.accessToken.`);\r\n }\r\n\r\n return accessToken;\r\n }\r\n\r\n /**\r\n * Populate config for create and load\r\n * \r\n * @private\r\n * @param {IEmbedConfiguration}\r\n * @returns {void}\r\n */\r\n private populateConfig(config: IEmbedConfiguration): void {\r\n // TODO: Change when Object.assign is available.\r\n const settings = utils.assign({}, Embed.defaultSettings, config.settings);\r\n this.config = utils.assign({ settings }, config);\r\n this.config.uniqueId = this.getUniqueId();\r\n this.config.embedUrl = this.getEmbedUrl();\r\n\r\n if(this.embeType === 'create') {\r\n this.createConfig = {\r\n datasetId: config.datasetId || this.getId(),\r\n accessToken: this.getAccessToken(this.service.accessToken),\r\n settings: settings\r\n }\r\n } else {\r\n this.config.id = this.getId();\r\n this.config.accessToken = this.getAccessToken(this.service.accessToken);\r\n } \r\n }\r\n\r\n\r\n /**\r\n * Gets an embed url from the first available location: options, attribute.\r\n * \r\n * @private\r\n * @returns {string}\r\n */\r\n private getEmbedUrl(): string {\r\n const embedUrl = this.config.embedUrl || this.element.getAttribute(Embed.embedUrlAttribute);\r\n\r\n if (typeof embedUrl !== 'string' || embedUrl.length === 0) {\r\n throw new Error(`Embed Url is required, but it was not found. You must provide an embed url either as part of embed configuration or as attribute '${Embed.embedUrlAttribute}'.`);\r\n }\r\n\r\n return embedUrl;\r\n }\r\n\r\n /**\r\n * Gets a unique ID from the first available location: options, attribute.\r\n * If neither is provided generate a unique string.\r\n * \r\n * @private\r\n * @returns {string}\r\n */\r\n private getUniqueId(): string {\r\n return this.config.uniqueId || this.element.getAttribute(Embed.nameAttribute) || utils.createRandomString();\r\n }\r\n\r\n /**\r\n * Gets the report ID from the first available location: options, attribute.\r\n * \r\n * @abstract\r\n * @returns {string}\r\n */\r\n abstract getId(): string;\r\n\r\n /**\r\n * Requests the browser to render the component's iframe in fullscreen mode.\r\n */\r\n fullscreen(): void {\r\n const requestFullScreen = this.iframe.requestFullscreen || this.iframe.msRequestFullscreen || this.iframe.mozRequestFullScreen || this.iframe.webkitRequestFullscreen;\r\n requestFullScreen.call(this.iframe);\r\n }\r\n\r\n /**\r\n * Requests the browser to exit fullscreen mode.\r\n */\r\n exitFullscreen(): void {\r\n if (!this.isFullscreen(this.iframe)) {\r\n return;\r\n }\r\n\r\n const exitFullscreen = document.exitFullscreen || document.mozCancelFullScreen || document.webkitExitFullscreen || document.msExitFullscreen;\r\n exitFullscreen.call(document);\r\n }\r\n\r\n /**\r\n * Returns true if the iframe is rendered in fullscreen mode,\r\n * otherwise returns false.\r\n * \r\n * @private\r\n * @param {HTMLIFrameElement} iframe\r\n * @returns {boolean}\r\n */\r\n private isFullscreen(iframe: HTMLIFrameElement): boolean {\r\n const options = ['fullscreenElement', 'webkitFullscreenElement', 'mozFullscreenScreenElement', 'msFullscreenElement'];\r\n\r\n return options.some(option => document[option] === iframe);\r\n }\r\n \r\n /**\r\n * Validate load and create configuration.\r\n */\r\n abstract validate(config: models.IReportLoadConfiguration | models.IDashboardLoadConfiguration | models.IReportCreateConfiguration): models.IError[];\r\n\r\n /**\r\n * Sets Iframe for embed\r\n */\r\n private setIframe(isLoad: boolean): void {\r\n if(!this.iframe) {\r\n const iframeHtml = ``;\r\n this.element.innerHTML = iframeHtml;\r\n this.iframe = this.element.childNodes[0];\r\n }\r\n\r\n if(isLoad){\r\n this.iframe.addEventListener('load', () => this.load(this.config), false);\r\n } else {\r\n this.iframe.addEventListener('load', () => this.createReport(this.createConfig), false);\r\n }\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/embed.ts","\r\n/**\r\n * Raises a custom event with event data on the specified HTML element.\r\n * \r\n * @export\r\n * @param {HTMLElement} element\r\n * @param {string} eventName\r\n * @param {*} eventData\r\n */\r\nexport function raiseCustomEvent(element: HTMLElement, eventName: string, eventData: any): void {\r\n let customEvent;\r\n if (typeof CustomEvent === 'function') {\r\n customEvent = new CustomEvent(eventName, {\r\n detail: eventData,\r\n bubbles: true,\r\n cancelable: true\r\n });\r\n } else {\r\n customEvent = document.createEvent('CustomEvent');\r\n customEvent.initCustomEvent(eventName, true, true, eventData);\r\n }\r\n\r\n element.dispatchEvent(customEvent);\r\n}\r\n\r\n/**\r\n * Finds the index of the first value in an array that matches the specified predicate.\r\n * \r\n * @export\r\n * @template T\r\n * @param {(x: T) => boolean} predicate\r\n * @param {T[]} xs\r\n * @returns {number}\r\n */\r\nexport function findIndex(predicate: (x: T) => boolean, xs: T[]): number {\r\n if (!Array.isArray(xs)) {\r\n throw new Error(`You attempted to call find with second parameter that was not an array. You passed: ${xs}`);\r\n }\r\n\r\n let index;\r\n xs.some((x, i) => {\r\n if (predicate(x)) {\r\n index = i;\r\n return true;\r\n }\r\n });\r\n\r\n return index;\r\n}\r\n\r\n/**\r\n * Finds the first value in an array that matches the specified predicate.\r\n * \r\n * @export\r\n * @template T\r\n * @param {(x: T) => boolean} predicate\r\n * @param {T[]} xs\r\n * @returns {T}\r\n */\r\nexport function find(predicate: (x: T) => boolean, xs: T[]): T {\r\n const index = findIndex(predicate, xs);\r\n return xs[index];\r\n}\r\n\r\nexport function remove(predicate: (x: T) => boolean, xs: T[]): void {\r\n const index = findIndex(predicate, xs);\r\n xs.splice(index, 1);\r\n}\r\n\r\n// See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\r\n// TODO: replace in favor of using polyfill\r\n/**\r\n * Copies the values of all enumerable properties from one or more source objects to a target object, and returns the target object.\r\n * \r\n * @export\r\n * @param {any} args\r\n * @returns\r\n */\r\nexport function assign(...args) {\r\n var target = args[0];\r\n\r\n 'use strict';\r\n if (target === undefined || target === null) {\r\n throw new TypeError('Cannot convert undefined or null to object');\r\n }\r\n\r\n var output = Object(target);\r\n for (var index = 1; index < arguments.length; index++) {\r\n var source = arguments[index];\r\n if (source !== undefined && source !== null) {\r\n for (var nextKey in source) {\r\n if (source.hasOwnProperty(nextKey)) {\r\n output[nextKey] = source[nextKey];\r\n }\r\n }\r\n }\r\n }\r\n return output;\r\n}\r\n\r\n/**\r\n * Generates a random 7 character string.\r\n * \r\n * @export\r\n * @returns {string}\r\n */\r\nexport function createRandomString(): string {\r\n return (Math.random() + 1).toString(36).substring(7);\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/util.ts","import * as service from './service';\nimport * as embed from './embed';\nimport * as models from 'powerbi-models';\nimport * as wpmp from 'window-post-message-proxy';\nimport * as hpm from 'http-post-message';\nimport * as utils from './util';\nimport { IFilterable } from './ifilterable';\nimport { IPageNode, Page } from './page';\n\n/**\n * A Report node within a report hierarchy\n * \n * @export\n * @interface IReportNode\n */\nexport interface IReportNode {\n iframe: HTMLIFrameElement;\n service: service.IService;\n config: embed.IInternalEmbedConfiguration\n}\n\n/**\n * The Power BI Report embed component\n * \n * @export\n * @class Report\n * @extends {embed.Embed}\n * @implements {IReportNode}\n * @implements {IFilterable}\n */\nexport class Report extends embed.Embed implements IReportNode, IFilterable {\n static allowedEvents = [\"filtersApplied\", \"pageChanged\"];\n static reportIdAttribute = 'powerbi-report-id';\n static filterPaneEnabledAttribute = 'powerbi-settings-filter-pane-enabled';\n static navContentPaneEnabledAttribute = 'powerbi-settings-nav-content-pane-enabled';\n static typeAttribute = 'powerbi-type';\n static type = \"Report\";\n\n /**\n * Creates an instance of a Power BI Report.\n * \n * @param {service.Service} service\n * @param {HTMLElement} element\n * @param {embed.IEmbedConfiguration} config\n */\n constructor(service: service.Service, element: HTMLElement, config: embed.IEmbedConfiguration, iframe?: HTMLIFrameElement) {\n const filterPaneEnabled = (config.settings && config.settings.filterPaneEnabled) || !(element.getAttribute(Report.filterPaneEnabledAttribute) === \"false\");\n const navContentPaneEnabled = (config.settings && config.settings.navContentPaneEnabled) || !(element.getAttribute(Report.navContentPaneEnabledAttribute) === \"false\");\n const settings = utils.assign({\n filterPaneEnabled,\n navContentPaneEnabled\n }, config.settings);\n const configCopy = utils.assign({ settings }, config);\n\n super(service, element, configCopy, iframe);\n this.loadPath = \"/report/load\";\n Array.prototype.push.apply(this.allowedEvents, Report.allowedEvents);\n }\n\n /**\n * Adds backwards compatibility for the previous load configuration, which used the reportId query parameter to specify the report ID\n * (e.g. http://embedded.powerbi.com/appTokenReportEmbed?reportId=854846ed-2106-4dc2-bc58-eb77533bf2f1).\n * \n * By extracting the ID we can ensure that the ID is always explicitly provided as part of the load configuration.\n * \n * @static\n * @param {string} url\n * @returns {string}\n */\n static findIdFromEmbedUrl(url: string): string {\n const reportIdRegEx = /reportId=\"?([^&]+)\"?/\n const reportIdMatch = url.match(reportIdRegEx);\n\n let reportId;\n if (reportIdMatch) {\n reportId = reportIdMatch[1];\n }\n\n return reportId;\n }\n\n /**\n * Gets filters that are applied at the report level.\n * \n * ```javascript\n * // Get filters applied at report level\n * report.getFilters()\n * .then(filters => {\n * ...\n * });\n * ```\n * \n * @returns {Promise}\n */\n getFilters(): Promise {\n return this.service.hpm.get(`/report/filters`, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .then(response => response.body,\n response => {\n throw response.body;\n });\n }\n\n /**\n * Gets the report ID from the first available location: options, attribute, embed url.\n * \n * @returns {string}\n */\n getId(): string {\n const reportId = this.config.id || this.element.getAttribute(Report.reportIdAttribute) || Report.findIdFromEmbedUrl(this.config.embedUrl);\n\n if (typeof reportId !== 'string' || reportId.length === 0) {\n throw new Error(`Report id is required, but it was not found. You must provide an id either as part of embed configuration or as attribute '${Report.reportIdAttribute}'.`);\n }\n\n return reportId;\n }\n\n /**\n * Gets the list of pages within the report.\n * \n * ```javascript\n * report.getPages()\n * .then(pages => {\n * ...\n * });\n * ```\n * \n * @returns {Promise}\n */\n getPages(): Promise {\n return this.service.hpm.get('/report/pages', { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .then(response => {\n return response.body\n .map(page => {\n return new Page(this, page.name, page.displayName);\n });\n }, response => {\n throw response.body;\n });\n }\n\n /**\n * Creates an instance of a Page.\n * \n * Normally you would get Page objects by calling `report.getPages()`, but in the case\n * that the page name is known and you want to perform an action on a page without having to retrieve it\n * you can create it directly.\n * \n * Note: Because you are creating the page manually there is no guarantee that the page actually exists in the report, and subsequent requests could fail.\n * \n * ```javascript\n * const page = report.page('ReportSection1');\n * page.setActive();\n * ```\n * \n * @param {string} name\n * @param {string} [displayName]\n * @returns {Page}\n */\n page(name: string, displayName?: string): Page {\n return new Page(this, name, displayName);\n }\n\n /**\n * Prints the active page of the report by invoking `window.print()` on the embed iframe component.\n */\n print(): Promise {\n return this.service.hpm.post('/report/print', null, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .then(response => {\n return response.body;\n })\n .catch(response => {\n throw response.body;\n });\n }\n\n /**\n * Removes all filters at the report level.\n * \n * ```javascript\n * report.removeFilters();\n * ```\n * \n * @returns {Promise}\n */\n removeFilters(): Promise {\n return this.setFilters([]);\n }\n\n /**\n * Sets the active page of the report.\n * \n * ```javascript\n * report.setPage(\"page2\")\n * .catch(error => { ... });\n * ```\n * \n * @param {string} pageName\n * @returns {Promise}\n */\n setPage(pageName: string): Promise {\n const page: models.IPage = {\n name: pageName,\n displayName: null\n };\n\n return this.service.hpm.put('/report/pages/active', page, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .catch(response => {\n throw response.body;\n });\n }\n\n /**\n * Sets filters at the report level.\n * \n * ```javascript\n * const filters: [\n * ...\n * ];\n * \n * report.setFilters(filters)\n * .catch(errors => {\n * ...\n * });\n * ```\n * \n * @param {(models.IFilter[])} filters\n * @returns {Promise}\n */\n setFilters(filters: models.IFilter[]): Promise {\n return this.service.hpm.put(`/report/filters`, filters, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .catch(response => {\n throw response.body;\n });\n }\n\n /**\n * Updates visibility settings for the filter pane and the page navigation pane.\n * \n * ```javascript\n * const newSettings = {\n * navContentPaneEnabled: true,\n * filterPaneEnabled: false\n * };\n * \n * report.updateSettings(newSettings)\n * .catch(error => { ... });\n * ```\n * \n * @param {models.ISettings} settings\n * @returns {Promise}\n */\n updateSettings(settings: models.ISettings): Promise {\n return this.service.hpm.patch('/report/settings', settings, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .catch(response => {\n throw response.body;\n });\n }\n\n /**\n * Validate load configuration.\n */\n validate(config: models.IReportLoadConfiguration): models.IError[] {\n return models.validateReportLoad(config);\n }\n\n /**\n * Switch Report view mode.\n * \n * @returns {Promise}\n */\n switchMode(viewMode: models.ViewMode): Promise {\n let url = '/report/switchMode/' + viewMode;\n return this.service.hpm.post(url, null, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .then(response => {\n return response.body;\n })\n .catch(response => {\n throw response.body;\n });\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/report.ts","/*! powerbi-models v0.11.1 | (c) 2016 Microsoft Corporation MIT */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"powerbi-models\"] = factory();\n\telse\n\t\troot[\"powerbi-models\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __extends = (this && this.__extends) || function (d, b) {\n\t for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n\t function __() { this.constructor = d; }\n\t d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n\t};\n\t/* tslint:disable:no-var-requires */\n\texports.advancedFilterSchema = __webpack_require__(1);\n\texports.filterSchema = __webpack_require__(2);\n\texports.loadSchema = __webpack_require__(3);\n\texports.dashboardLoadSchema = __webpack_require__(4);\n\texports.pageSchema = __webpack_require__(5);\n\texports.settingsSchema = __webpack_require__(6);\n\texports.basicFilterSchema = __webpack_require__(7);\n\texports.createReportSchema = __webpack_require__(8);\n\texports.saveAsParametersSchema = __webpack_require__(9);\n\t/* tslint:enable:no-var-requires */\n\tvar jsen = __webpack_require__(10);\n\tfunction normalizeError(error) {\n\t var message = error.message;\n\t if (!message) {\n\t message = error.path + \" is invalid. Not meeting \" + error.keyword + \" constraint\";\n\t }\n\t return {\n\t message: message\n\t };\n\t}\n\t/**\n\t * Takes in schema and returns function which can be used to validate the schema with better semantics around exposing errors\n\t */\n\tfunction validate(schema, options) {\n\t return function (x) {\n\t var validate = jsen(schema, options);\n\t var isValid = validate(x);\n\t if (isValid) {\n\t return undefined;\n\t }\n\t else {\n\t return validate.errors\n\t .map(normalizeError);\n\t }\n\t };\n\t}\n\texports.validateSettings = validate(exports.settingsSchema, {\n\t schemas: {\n\t basicFilter: exports.basicFilterSchema,\n\t advancedFilter: exports.advancedFilterSchema\n\t }\n\t});\n\texports.validateReportLoad = validate(exports.loadSchema, {\n\t schemas: {\n\t settings: exports.settingsSchema,\n\t basicFilter: exports.basicFilterSchema,\n\t advancedFilter: exports.advancedFilterSchema\n\t }\n\t});\n\texports.validateCreateReport = validate(exports.createReportSchema);\n\texports.validateDashboardLoad = validate(exports.dashboardLoadSchema);\n\texports.validatePage = validate(exports.pageSchema);\n\texports.validateFilter = validate(exports.filterSchema, {\n\t schemas: {\n\t basicFilter: exports.basicFilterSchema,\n\t advancedFilter: exports.advancedFilterSchema\n\t }\n\t});\n\t(function (FilterType) {\n\t FilterType[FilterType[\"Advanced\"] = 0] = \"Advanced\";\n\t FilterType[FilterType[\"Basic\"] = 1] = \"Basic\";\n\t FilterType[FilterType[\"Unknown\"] = 2] = \"Unknown\";\n\t})(exports.FilterType || (exports.FilterType = {}));\n\tvar FilterType = exports.FilterType;\n\tfunction isFilterKeyColumnsTarget(target) {\n\t return isColumn(target) && !!target.keys;\n\t}\n\texports.isFilterKeyColumnsTarget = isFilterKeyColumnsTarget;\n\tfunction isBasicFilterWithKeys(filter) {\n\t return getFilterType(filter) === FilterType.Basic && !!filter.keyValues;\n\t}\n\texports.isBasicFilterWithKeys = isBasicFilterWithKeys;\n\tfunction getFilterType(filter) {\n\t var basicFilter = filter;\n\t var advancedFilter = filter;\n\t if ((typeof basicFilter.operator === \"string\")\n\t && (Array.isArray(basicFilter.values))) {\n\t return FilterType.Basic;\n\t }\n\t else if ((typeof advancedFilter.logicalOperator === \"string\")\n\t && (Array.isArray(advancedFilter.conditions))) {\n\t return FilterType.Advanced;\n\t }\n\t else {\n\t return FilterType.Unknown;\n\t }\n\t}\n\texports.getFilterType = getFilterType;\n\tfunction isMeasure(arg) {\n\t return arg.table !== undefined && arg.measure !== undefined;\n\t}\n\texports.isMeasure = isMeasure;\n\tfunction isColumn(arg) {\n\t return arg.table !== undefined && arg.column !== undefined;\n\t}\n\texports.isColumn = isColumn;\n\tfunction isHierarchy(arg) {\n\t return arg.table !== undefined && arg.hierarchy !== undefined && arg.hierarchyLevel !== undefined;\n\t}\n\texports.isHierarchy = isHierarchy;\n\tvar Filter = (function () {\n\t function Filter(target) {\n\t this.target = target;\n\t }\n\t Filter.prototype.toJSON = function () {\n\t return {\n\t $schema: this.schemaUrl,\n\t target: this.target\n\t };\n\t };\n\t ;\n\t return Filter;\n\t}());\n\texports.Filter = Filter;\n\tvar BasicFilter = (function (_super) {\n\t __extends(BasicFilter, _super);\n\t function BasicFilter(target, operator) {\n\t var values = [];\n\t for (var _i = 2; _i < arguments.length; _i++) {\n\t values[_i - 2] = arguments[_i];\n\t }\n\t _super.call(this, target);\n\t this.operator = operator;\n\t this.schemaUrl = BasicFilter.schemaUrl;\n\t if (values.length === 0 && operator !== \"All\") {\n\t throw new Error(\"values must be a non-empty array unless your operator is \\\"All\\\".\");\n\t }\n\t /**\n\t * Accept values as array instead of as individual arguments\n\t * new BasicFilter('a', 'b', 1, 2);\n\t * new BasicFilter('a', 'b', [1,2]);\n\t */\n\t if (Array.isArray(values[0])) {\n\t this.values = values[0];\n\t }\n\t else {\n\t this.values = values;\n\t }\n\t }\n\t BasicFilter.prototype.toJSON = function () {\n\t var filter = _super.prototype.toJSON.call(this);\n\t filter.operator = this.operator;\n\t filter.values = this.values;\n\t return filter;\n\t };\n\t BasicFilter.schemaUrl = \"http://powerbi.com/product/schema#basic\";\n\t return BasicFilter;\n\t}(Filter));\n\texports.BasicFilter = BasicFilter;\n\tvar BasicFilterWithKeys = (function (_super) {\n\t __extends(BasicFilterWithKeys, _super);\n\t function BasicFilterWithKeys(target, operator, values, keyValues) {\n\t _super.call(this, target, operator, values);\n\t this.keyValues = keyValues;\n\t this.target = target;\n\t var numberOfKeys = target.keys ? target.keys.length : 0;\n\t if (numberOfKeys > 0 && !keyValues) {\n\t throw new Error(\"You shold pass the values to be filtered for each key. You passed: no values and \" + numberOfKeys + \" keys\");\n\t }\n\t if (numberOfKeys === 0 && keyValues && keyValues.length > 0) {\n\t throw new Error(\"You passed key values but your target object doesn't contain the keys to be filtered\");\n\t }\n\t for (var i = 0; i < this.keyValues.length; i++) {\n\t if (this.keyValues[i]) {\n\t var lengthOfArray = this.keyValues[i].length;\n\t if (lengthOfArray !== numberOfKeys) {\n\t throw new Error(\"Each tuple of key values should contain a value for each of the keys. You passed: \" + lengthOfArray + \" values and \" + numberOfKeys + \" keys\");\n\t }\n\t }\n\t }\n\t }\n\t BasicFilterWithKeys.prototype.toJSON = function () {\n\t var filter = _super.prototype.toJSON.call(this);\n\t filter.keyValues = this.keyValues;\n\t return filter;\n\t };\n\t return BasicFilterWithKeys;\n\t}(BasicFilter));\n\texports.BasicFilterWithKeys = BasicFilterWithKeys;\n\tvar AdvancedFilter = (function (_super) {\n\t __extends(AdvancedFilter, _super);\n\t function AdvancedFilter(target, logicalOperator) {\n\t var conditions = [];\n\t for (var _i = 2; _i < arguments.length; _i++) {\n\t conditions[_i - 2] = arguments[_i];\n\t }\n\t _super.call(this, target);\n\t this.schemaUrl = AdvancedFilter.schemaUrl;\n\t // Guard statements\n\t if (typeof logicalOperator !== \"string\" || logicalOperator.length === 0) {\n\t // TODO: It would be nicer to list out the possible logical operators.\n\t throw new Error(\"logicalOperator must be a valid operator, You passed: \" + logicalOperator);\n\t }\n\t this.logicalOperator = logicalOperator;\n\t var extractedConditions;\n\t /**\n\t * Accept conditions as array instead of as individual arguments\n\t * new AdvancedFilter('a', 'b', \"And\", { value: 1, operator: \"Equals\" }, { value: 2, operator: \"IsGreaterThan\" });\n\t * new AdvancedFilter('a', 'b', \"And\", [{ value: 1, operator: \"Equals\" }, { value: 2, operator: \"IsGreaterThan\" }]);\n\t */\n\t if (Array.isArray(conditions[0])) {\n\t extractedConditions = conditions[0];\n\t }\n\t else {\n\t extractedConditions = conditions;\n\t }\n\t if (extractedConditions.length === 0) {\n\t throw new Error(\"conditions must be a non-empty array. You passed: \" + conditions);\n\t }\n\t if (extractedConditions.length > 2) {\n\t throw new Error(\"AdvancedFilters may not have more than two conditions. You passed: \" + conditions.length);\n\t }\n\t if (extractedConditions.length === 1 && logicalOperator !== \"And\") {\n\t throw new Error(\"Logical Operator must be \\\"And\\\" when there is only one condition provided\");\n\t }\n\t this.conditions = extractedConditions;\n\t }\n\t AdvancedFilter.prototype.toJSON = function () {\n\t var filter = _super.prototype.toJSON.call(this);\n\t filter.logicalOperator = this.logicalOperator;\n\t filter.conditions = this.conditions;\n\t return filter;\n\t };\n\t AdvancedFilter.schemaUrl = \"http://powerbi.com/product/schema#advanced\";\n\t return AdvancedFilter;\n\t}(Filter));\n\texports.AdvancedFilter = AdvancedFilter;\n\t(function (Permissions) {\n\t Permissions[Permissions[\"Read\"] = 0] = \"Read\";\n\t Permissions[Permissions[\"ReadWrite\"] = 1] = \"ReadWrite\";\n\t Permissions[Permissions[\"Copy\"] = 2] = \"Copy\";\n\t Permissions[Permissions[\"Create\"] = 4] = \"Create\";\n\t Permissions[Permissions[\"All\"] = 7] = \"All\";\n\t})(exports.Permissions || (exports.Permissions = {}));\n\tvar Permissions = exports.Permissions;\n\t(function (ViewMode) {\n\t ViewMode[ViewMode[\"View\"] = 0] = \"View\";\n\t ViewMode[ViewMode[\"Edit\"] = 1] = \"Edit\";\n\t})(exports.ViewMode || (exports.ViewMode = {}));\n\tvar ViewMode = exports.ViewMode;\n\texports.validateSaveAsParameters = validate(exports.saveAsParametersSchema);\n\n\n/***/ },\n/* 1 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"target\": {\n\t\t\t\t\"oneOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\t\"table\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"column\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"required\": [\n\t\t\t\t\t\t\t\"table\",\n\t\t\t\t\t\t\t\"column\"\n\t\t\t\t\t\t]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\t\"table\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"hierarchy\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"hierarchyLevel\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"required\": [\n\t\t\t\t\t\t\t\"table\",\n\t\t\t\t\t\t\t\"hierarchy\",\n\t\t\t\t\t\t\t\"hierarchyLevel\"\n\t\t\t\t\t\t]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\t\"table\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"measure\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"required\": [\n\t\t\t\t\t\t\t\"table\",\n\t\t\t\t\t\t\t\"measure\"\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"logicalOperator\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"conditions\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\"value\": {\n\t\t\t\t\t\t\t\"type\": [\n\t\t\t\t\t\t\t\t\"string\",\n\t\t\t\t\t\t\t\t\"boolean\",\n\t\t\t\t\t\t\t\t\"number\"\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"operator\": {\n\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\"required\": [\n\t\t\t\t\t\t\"value\",\n\t\t\t\t\t\t\"operator\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"target\",\n\t\t\t\"logicalOperator\",\n\t\t\t\"conditions\"\n\t\t]\n\t};\n\n/***/ },\n/* 2 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"oneOf\": [\n\t\t\t{\n\t\t\t\t\"$ref\": \"#basicFilter\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"$ref\": \"#advancedFilter\"\n\t\t\t}\n\t\t],\n\t\t\"invalidMessage\": \"filter is invalid\"\n\t};\n\n/***/ },\n/* 3 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"accessToken\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"accessToken must be a string\",\n\t\t\t\t\t\"required\": \"accessToken is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"id\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"id must be a string\",\n\t\t\t\t\t\"required\": \"id is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"settings\": {\n\t\t\t\t\"$ref\": \"#settings\"\n\t\t\t},\n\t\t\t\"pageName\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"pageName must be a string\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"filters\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\"oneOf\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"$ref\": \"#basicFilter\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"$ref\": \"#advancedFilter\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t\"invalidMessage\": \"filters property is invalid\"\n\t\t\t},\n\t\t\t\"permissions\": {\n\t\t\t\t\"type\": \"number\",\n\t\t\t\t\"enum\": [\n\t\t\t\t\t0,\n\t\t\t\t\t1,\n\t\t\t\t\t2,\n\t\t\t\t\t4,\n\t\t\t\t\t7\n\t\t\t\t],\n\t\t\t\t\"default\": 0,\n\t\t\t\t\"invalidMessage\": \"permissions property is invalid\"\n\t\t\t},\n\t\t\t\"viewMode\": {\n\t\t\t\t\"type\": \"number\",\n\t\t\t\t\"enum\": [\n\t\t\t\t\t0,\n\t\t\t\t\t1\n\t\t\t\t],\n\t\t\t\t\"default\": 0,\n\t\t\t\t\"invalidMessage\": \"viewMode property is invalid\"\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"accessToken\",\n\t\t\t\"id\"\n\t\t]\n\t};\n\n/***/ },\n/* 4 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"accessToken\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"accessToken must be a string\",\n\t\t\t\t\t\"required\": \"accessToken is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"id\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"id must be a string\",\n\t\t\t\t\t\"required\": \"id is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"pageView\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"pageView must be a string with one of the following values: \\\"actualSize\\\", \\\"fitToWidth\\\", \\\"oneColumn\\\"\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"accessToken\",\n\t\t\t\"id\"\n\t\t]\n\t};\n\n/***/ },\n/* 5 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"name\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"name must be a string\",\n\t\t\t\t\t\"required\": \"name is required\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"name\"\n\t\t]\n\t};\n\n/***/ },\n/* 6 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"filterPaneEnabled\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"filterPaneEnabled must be a boolean\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"navContentPaneEnabled\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"navContentPaneEnabled must be a boolean\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"useCustomSaveAsDialog\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"useCustomSaveAsDialog must be a boolean\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n/***/ },\n/* 7 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"target\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"properties\": {\n\t\t\t\t\t\"table\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"column\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"hierarchy\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"hierarchyLevel\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"measure\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"required\": [\n\t\t\t\t\t\"table\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"operator\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"values\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"type\": [\n\t\t\t\t\t\t\"string\",\n\t\t\t\t\t\t\"boolean\",\n\t\t\t\t\t\t\"number\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"target\",\n\t\t\t\"operator\",\n\t\t\t\"values\"\n\t\t]\n\t};\n\n/***/ },\n/* 8 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"accessToken\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"accessToken must be a string\",\n\t\t\t\t\t\"required\": \"accessToken is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"datasetId\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"datasetId must be a string\",\n\t\t\t\t\t\"required\": \"datasetId is required\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"accessToken\",\n\t\t\t\"datasetId\"\n\t\t]\n\t};\n\n/***/ },\n/* 9 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"name\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"name must be a string\",\n\t\t\t\t\t\"required\": \"name is required\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"name\"\n\t\t]\n\t};\n\n/***/ },\n/* 10 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = __webpack_require__(11);\n\n/***/ },\n/* 11 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar REGEX_ESCAPE_EXPR = /[\\/]/g,\n\t STR_ESCAPE_EXPR = /(\")/gim,\n\t VALID_IDENTIFIER_EXPR = /^[a-z_$][0-9a-z]*$/gi,\n\t INVALID_SCHEMA = 'jsen: invalid schema object',\n\t browser = typeof window === 'object' && !!window.navigator, // jshint ignore: line\n\t regescape = new RegExp('/').source !== '/', // node v0.x does not properly escape '/'s in inline regex\n\t func = __webpack_require__(12),\n\t equal = __webpack_require__(13),\n\t unique = __webpack_require__(14),\n\t SchemaResolver = __webpack_require__(15),\n\t formats = __webpack_require__(24),\n\t ucs2length = __webpack_require__(25),\n\t types = {},\n\t keywords = {};\n\t\n\tfunction inlineRegex(regex) {\n\t regex = regex instanceof RegExp ? regex : new RegExp(regex);\n\t\n\t return regescape ?\n\t regex.toString() :\n\t '/' + regex.source.replace(REGEX_ESCAPE_EXPR, '\\\\$&') + '/';\n\t}\n\t\n\tfunction encodeStr(str) {\n\t return '\"' + str.replace(STR_ESCAPE_EXPR, '\\\\$1') + '\"';\n\t}\n\t\n\tfunction appendToPath(path, key) {\n\t VALID_IDENTIFIER_EXPR.lastIndex = 0;\n\t\n\t return VALID_IDENTIFIER_EXPR.test(key) ?\n\t path + '.' + key :\n\t path + '[' + encodeStr(key) + ']';\n\t}\n\t\n\tfunction type(obj) {\n\t if (obj === undefined) {\n\t return 'undefined';\n\t }\n\t\n\t var str = Object.prototype.toString.call(obj);\n\t return str.substr(8, str.length - 9).toLowerCase();\n\t}\n\t\n\tfunction isInteger(obj) {\n\t return (obj | 0) === obj; // jshint ignore: line\n\t}\n\t\n\ttypes['null'] = function (path) {\n\t return path + ' === null';\n\t};\n\t\n\ttypes.boolean = function (path) {\n\t return 'typeof ' + path + ' === \"boolean\"';\n\t};\n\t\n\ttypes.string = function (path) {\n\t return 'typeof ' + path + ' === \"string\"';\n\t};\n\t\n\ttypes.number = function (path) {\n\t return 'typeof ' + path + ' === \"number\"';\n\t};\n\t\n\ttypes.integer = function (path) {\n\t return 'typeof ' + path + ' === \"number\" && !(' + path + ' % 1)';\n\t};\n\t\n\ttypes.array = function (path) {\n\t return 'Array.isArray(' + path + ')';\n\t};\n\t\n\ttypes.object = function (path) {\n\t return 'typeof ' + path + ' === \"object\" && ' + path + ' !== null && !Array.isArray(' + path + ')';\n\t};\n\t\n\ttypes.date = function (path) {\n\t return path + ' instanceof Date';\n\t};\n\t\n\tkeywords.enum = function (context) {\n\t var arr = context.schema['enum'];\n\t\n\t context.code('if (!equalAny(' + context.path + ', ' + JSON.stringify(arr) + ')) {');\n\t context.error('enum');\n\t context.code('}');\n\t};\n\t\n\tkeywords.minimum = function (context) {\n\t if (typeof context.schema.minimum === 'number') {\n\t context.code('if (' + context.path + ' < ' + context.schema.minimum + ') {');\n\t context.error('minimum');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.exclusiveMinimum = function (context) {\n\t if (context.schema.exclusiveMinimum === true && typeof context.schema.minimum === 'number') {\n\t context.code('if (' + context.path + ' === ' + context.schema.minimum + ') {');\n\t context.error('exclusiveMinimum');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.maximum = function (context) {\n\t if (typeof context.schema.maximum === 'number') {\n\t context.code('if (' + context.path + ' > ' + context.schema.maximum + ') {');\n\t context.error('maximum');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.exclusiveMaximum = function (context) {\n\t if (context.schema.exclusiveMaximum === true && typeof context.schema.maximum === 'number') {\n\t context.code('if (' + context.path + ' === ' + context.schema.maximum + ') {');\n\t context.error('exclusiveMaximum');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.multipleOf = function (context) {\n\t if (typeof context.schema.multipleOf === 'number') {\n\t var mul = context.schema.multipleOf,\n\t decimals = mul.toString().length - mul.toFixed(0).length - 1,\n\t pow = decimals > 0 ? Math.pow(10, decimals) : 1,\n\t path = context.path;\n\t\n\t if (decimals > 0) {\n\t context.code('if (+(Math.round((' + path + ' * ' + pow + ') + \"e+\" + ' + decimals + ') + \"e-\" + ' + decimals + ') % ' + (mul * pow) + ' !== 0) {');\n\t } else {\n\t context.code('if (((' + path + ' * ' + pow + ') % ' + (mul * pow) + ') !== 0) {');\n\t }\n\t\n\t context.error('multipleOf');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.minLength = function (context) {\n\t if (isInteger(context.schema.minLength)) {\n\t context.code('if (ucs2length(' + context.path + ') < ' + context.schema.minLength + ') {');\n\t context.error('minLength');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.maxLength = function (context) {\n\t if (isInteger(context.schema.maxLength)) {\n\t context.code('if (ucs2length(' + context.path + ') > ' + context.schema.maxLength + ') {');\n\t context.error('maxLength');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.pattern = function (context) {\n\t var pattern = context.schema.pattern;\n\t\n\t if (typeof pattern === 'string' || pattern instanceof RegExp) {\n\t context.code('if (!(' + inlineRegex(pattern) + ').test(' + context.path + ')) {');\n\t context.error('pattern');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.format = function (context) {\n\t if (typeof context.schema.format !== 'string' || !formats[context.schema.format]) {\n\t return;\n\t }\n\t\n\t context.code('if (!(' + formats[context.schema.format] + ').test(' + context.path + ')) {');\n\t context.error('format');\n\t context.code('}');\n\t};\n\t\n\tkeywords.minItems = function (context) {\n\t if (isInteger(context.schema.minItems)) {\n\t context.code('if (' + context.path + '.length < ' + context.schema.minItems + ') {');\n\t context.error('minItems');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.maxItems = function (context) {\n\t if (isInteger(context.schema.maxItems)) {\n\t context.code('if (' + context.path + '.length > ' + context.schema.maxItems + ') {');\n\t context.error('maxItems');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.additionalItems = function (context) {\n\t if (context.schema.additionalItems === false && Array.isArray(context.schema.items)) {\n\t context.code('if (' + context.path + '.length > ' + context.schema.items.length + ') {');\n\t context.error('additionalItems');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.uniqueItems = function (context) {\n\t if (context.schema.uniqueItems) {\n\t context.code('if (unique(' + context.path + ').length !== ' + context.path + '.length) {');\n\t context.error('uniqueItems');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.items = function (context) {\n\t var index = context.declare(0),\n\t i = 0;\n\t\n\t if (type(context.schema.items) === 'object') {\n\t context.code('for (' + index + ' = 0; ' + index + ' < ' + context.path + '.length; ' + index + '++) {');\n\t\n\t context.descend(context.path + '[' + index + ']', context.schema.items);\n\t\n\t context.code('}');\n\t }\n\t else if (Array.isArray(context.schema.items)) {\n\t for (; i < context.schema.items.length; i++) {\n\t context.code('if (' + context.path + '.length - 1 >= ' + i + ') {');\n\t\n\t context.descend(context.path + '[' + i + ']', context.schema.items[i]);\n\t\n\t context.code('}');\n\t }\n\t\n\t if (type(context.schema.additionalItems) === 'object') {\n\t context.code('for (' + index + ' = ' + i + '; ' + index + ' < ' + context.path + '.length; ' + index + '++) {');\n\t\n\t context.descend(context.path + '[' + index + ']', context.schema.additionalItems);\n\t\n\t context.code('}');\n\t }\n\t }\n\t};\n\t\n\tkeywords.maxProperties = function (context) {\n\t if (isInteger(context.schema.maxProperties)) {\n\t context.code('if (Object.keys(' + context.path + ').length > ' + context.schema.maxProperties + ') {');\n\t context.error('maxProperties');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.minProperties = function (context) {\n\t if (isInteger(context.schema.minProperties)) {\n\t context.code('if (Object.keys(' + context.path + ').length < ' + context.schema.minProperties + ') {');\n\t context.error('minProperties');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.required = function (context) {\n\t if (!Array.isArray(context.schema.required)) {\n\t return;\n\t }\n\t\n\t for (var i = 0; i < context.schema.required.length; i++) {\n\t context.code('if (' + appendToPath(context.path, context.schema.required[i]) + ' === undefined) {');\n\t context.error('required', context.schema.required[i]);\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.properties = function (context) {\n\t var props = context.schema.properties,\n\t propKeys = type(props) === 'object' ? Object.keys(props) : [],\n\t required = Array.isArray(context.schema.required) ? context.schema.required : [],\n\t prop, i, nestedPath;\n\t\n\t if (!propKeys.length) {\n\t return;\n\t }\n\t\n\t for (i = 0; i < propKeys.length; i++) {\n\t prop = propKeys[i];\n\t nestedPath = appendToPath(context.path, prop);\n\t\n\t context.code('if (' + nestedPath + ' !== undefined) {');\n\t\n\t context.descend(nestedPath, props[prop]);\n\t\n\t context.code('}');\n\t\n\t if (required.indexOf(prop) > -1) {\n\t context.code('else {');\n\t context.error('required', prop);\n\t context.code('}');\n\t }\n\t }\n\t};\n\t\n\tkeywords.patternProperties = keywords.additionalProperties = function (context) {\n\t var propKeys = type(context.schema.properties) === 'object' ?\n\t Object.keys(context.schema.properties) : [],\n\t patProps = context.schema.patternProperties,\n\t patterns = type(patProps) === 'object' ? Object.keys(patProps) : [],\n\t addProps = context.schema.additionalProperties,\n\t addPropsCheck = addProps === false || type(addProps) === 'object',\n\t props, keys, key, n, found, pattern, i;\n\t\n\t if (!patterns.length && !addPropsCheck) {\n\t return;\n\t }\n\t\n\t keys = context.declare('[]');\n\t key = context.declare('\"\"');\n\t n = context.declare(0);\n\t\n\t if (addPropsCheck) {\n\t found = context.declare(false);\n\t }\n\t\n\t context.code(keys + ' = Object.keys(' + context.path + ')');\n\t\n\t context.code('for (' + n + ' = 0; ' + n + ' < ' + keys + '.length; ' + n + '++) {')\n\t (key + ' = ' + keys + '[' + n + ']')\n\t\n\t ('if (' + context.path + '[' + key + '] === undefined) {')\n\t ('continue')\n\t ('}');\n\t\n\t if (addPropsCheck) {\n\t context.code(found + ' = false');\n\t }\n\t\n\t // validate pattern properties\n\t for (i = 0; i < patterns.length; i++) {\n\t pattern = patterns[i];\n\t\n\t context.code('if ((' + inlineRegex(pattern) + ').test(' + key + ')) {');\n\t\n\t context.descend(context.path + '[' + key + ']', patProps[pattern]);\n\t\n\t if (addPropsCheck) {\n\t context.code(found + ' = true');\n\t }\n\t\n\t context.code('}');\n\t }\n\t\n\t // validate additional properties\n\t if (addPropsCheck) {\n\t if (propKeys.length) {\n\t props = context.declare(JSON.stringify(propKeys));\n\t\n\t // do not validate regular properties\n\t context.code('if (' + props + '.indexOf(' + key + ') > -1) {')\n\t ('continue')\n\t ('}');\n\t }\n\t\n\t context.code('if (!' + found + ') {');\n\t\n\t if (addProps === false) {\n\t // do not allow additional properties\n\t context.error('additionalProperties', undefined, key);\n\t }\n\t else {\n\t // validate additional properties\n\t context.descend(context.path + '[' + key + ']', addProps);\n\t }\n\t\n\t context.code('}');\n\t }\n\t\n\t context.code('}');\n\t};\n\t\n\tkeywords.dependencies = function (context) {\n\t if (type(context.schema.dependencies) !== 'object') {\n\t return;\n\t }\n\t\n\t var depKeys = Object.keys(context.schema.dependencies),\n\t len = depKeys.length,\n\t key, dep, i = 0, k = 0;\n\t\n\t for (; k < len; k++) {\n\t key = depKeys[k];\n\t dep = context.schema.dependencies[key];\n\t\n\t context.code('if (' + appendToPath(context.path, key) + ' !== undefined) {');\n\t\n\t if (type(dep) === 'object') {\n\t //schema dependency\n\t context.descend(context.path, dep);\n\t }\n\t else {\n\t // property dependency\n\t for (i; i < dep.length; i++) {\n\t context.code('if (' + appendToPath(context.path, dep[i]) + ' === undefined) {');\n\t context.error('dependencies', dep[i]);\n\t context.code('}');\n\t }\n\t }\n\t\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.allOf = function (context) {\n\t if (!Array.isArray(context.schema.allOf)) {\n\t return;\n\t }\n\t\n\t for (var i = 0; i < context.schema.allOf.length; i++) {\n\t context.descend(context.path, context.schema.allOf[i]);\n\t }\n\t};\n\t\n\tkeywords.anyOf = function (context) {\n\t if (!Array.isArray(context.schema.anyOf)) {\n\t return;\n\t }\n\t\n\t var greedy = context.greedy,\n\t errCount = context.declare(0),\n\t initialCount = context.declare(0),\n\t found = context.declare(false),\n\t i = 0;\n\t\n\t context.code(initialCount + ' = errors.length');\n\t\n\t for (; i < context.schema.anyOf.length; i++) {\n\t context.code('if (!' + found + ') {');\n\t\n\t context.code(errCount + ' = errors.length');\n\t\n\t context.greedy = true;\n\t\n\t context.descend(context.path, context.schema.anyOf[i]);\n\t\n\t context.code(found + ' = errors.length === ' + errCount)\n\t ('}');\n\t }\n\t\n\t context.greedy = greedy;\n\t\n\t context.code('if (!' + found + ') {');\n\t\n\t context.error('anyOf');\n\t\n\t context.code('} else {')\n\t ('errors.length = ' + initialCount)\n\t ('}');\n\t};\n\t\n\tkeywords.oneOf = function (context) {\n\t if (!Array.isArray(context.schema.oneOf)) {\n\t return;\n\t }\n\t\n\t var greedy = context.greedy,\n\t matching = context.declare(0),\n\t initialCount = context.declare(0),\n\t errCount = context.declare(0),\n\t i = 0;\n\t\n\t context.code(initialCount + ' = errors.length');\n\t context.code(matching + ' = 0');\n\t\n\t for (; i < context.schema.oneOf.length; i++) {\n\t context.code(errCount + ' = errors.length');\n\t\n\t context.greedy = true;\n\t\n\t context.descend(context.path, context.schema.oneOf[i]);\n\t\n\t context.code('if (errors.length === ' + errCount + ') {')\n\t (matching + '++')\n\t ('}');\n\t }\n\t\n\t context.greedy = greedy;\n\t\n\t context.code('if (' + matching + ' !== 1) {');\n\t\n\t context.error('oneOf');\n\t\n\t context.code('} else {')\n\t ('errors.length = ' + initialCount)\n\t ('}');\n\t};\n\t\n\tkeywords.not = function (context) {\n\t if (type(context.schema.not) !== 'object') {\n\t return;\n\t }\n\t\n\t var greedy = context.greedy,\n\t errCount = context.declare(0);\n\t\n\t context.code(errCount + ' = errors.length');\n\t\n\t context.greedy = true;\n\t\n\t context.descend(context.path, context.schema.not);\n\t\n\t context.greedy = greedy;\n\t\n\t context.code('if (errors.length === ' + errCount + ') {');\n\t\n\t context.error('not');\n\t\n\t context.code('} else {')\n\t ('errors.length = ' + errCount)\n\t ('}');\n\t};\n\t\n\tfunction decorateGenerator(type, keyword) {\n\t keywords[keyword].type = type;\n\t keywords[keyword].keyword = keyword;\n\t}\n\t\n\t['minimum', 'exclusiveMinimum', 'maximum', 'exclusiveMaximum', 'multipleOf']\n\t .forEach(decorateGenerator.bind(null, 'number'));\n\t\n\t['minLength', 'maxLength', 'pattern', 'format']\n\t .forEach(decorateGenerator.bind(null, 'string'));\n\t\n\t['minItems', 'maxItems', 'additionalItems', 'uniqueItems', 'items']\n\t .forEach(decorateGenerator.bind(null, 'array'));\n\t\n\t['maxProperties', 'minProperties', 'required', 'properties', 'patternProperties', 'additionalProperties', 'dependencies']\n\t .forEach(decorateGenerator.bind(null, 'object'));\n\t\n\t['enum', 'allOf', 'anyOf', 'oneOf', 'not']\n\t .forEach(decorateGenerator.bind(null, null));\n\t\n\tfunction groupKeywords(schema) {\n\t var keys = Object.keys(schema),\n\t propIndex = keys.indexOf('properties'),\n\t patIndex = keys.indexOf('patternProperties'),\n\t ret = {\n\t enum: Array.isArray(schema.enum) && schema.enum.length > 0,\n\t type: null,\n\t allType: [],\n\t perType: {}\n\t },\n\t key, gen, i;\n\t\n\t if (schema.type) {\n\t if (typeof schema.type === 'string') {\n\t ret.type = [schema.type];\n\t }\n\t else if (Array.isArray(schema.type) && schema.type.length) {\n\t ret.type = schema.type.slice(0);\n\t }\n\t }\n\t\n\t for (i = 0; i < keys.length; i++) {\n\t key = keys[i];\n\t\n\t if (key === 'enum' || key === 'type') {\n\t continue;\n\t }\n\t\n\t gen = keywords[key];\n\t\n\t if (!gen) {\n\t continue;\n\t }\n\t\n\t if (gen.type) {\n\t if (!ret.perType[gen.type]) {\n\t ret.perType[gen.type] = [];\n\t }\n\t\n\t if (!(propIndex > -1 && key === 'required') &&\n\t !(patIndex > -1 && key === 'additionalProperties')) {\n\t ret.perType[gen.type].push(key);\n\t }\n\t }\n\t else {\n\t ret.allType.push(key);\n\t }\n\t }\n\t\n\t return ret;\n\t}\n\t\n\tfunction getPathExpression(path, key) {\n\t var path_ = path.substr(4),\n\t len = path_.length,\n\t tokens = [],\n\t token = '',\n\t isvar = false,\n\t char, i;\n\t\n\t for (i = 0; i < len; i++) {\n\t char = path_[i];\n\t\n\t switch (char) {\n\t case '.':\n\t if (token) {\n\t token += char;\n\t }\n\t break;\n\t case '[':\n\t if (isNaN(+path_[i + 1])) {\n\t isvar = true;\n\t\n\t if (token) {\n\t tokens.push('\"' + token + '\"');\n\t token = '';\n\t }\n\t }\n\t else {\n\t isvar = false;\n\t\n\t if (token) {\n\t token += '.';\n\t }\n\t }\n\t break;\n\t case ']':\n\t tokens.push(isvar ? token : '\"' + token + '\"');\n\t token = '';\n\t break;\n\t default:\n\t token += char;\n\t }\n\t }\n\t\n\t if (token) {\n\t tokens.push('\"' + token + '\"');\n\t }\n\t\n\t if (key) {\n\t tokens.push('\"' + key + '\"');\n\t }\n\t\n\t if (tokens.length === 1 && isvar) {\n\t return '\"\" + ' + tokens[0] + ' + \"\"';\n\t }\n\t\n\t return tokens.join(' + \".\" + ') || '\"\"';\n\t}\n\t\n\tfunction clone(obj) {\n\t var cloned = obj,\n\t objType = type(obj),\n\t keys, len, key, i;\n\t\n\t if (objType === 'object') {\n\t cloned = {};\n\t keys = Object.keys(obj);\n\t\n\t for (i = 0, len = keys.length; i < len; i++) {\n\t key = keys[i];\n\t cloned[key] = clone(obj[key]);\n\t }\n\t }\n\t else if (objType === 'array') {\n\t cloned = [];\n\t\n\t for (i = 0, len = obj.length; i < len; i++) {\n\t cloned[i] = clone(obj[i]);\n\t }\n\t }\n\t else if (objType === 'regexp') {\n\t return new RegExp(obj);\n\t }\n\t else if (objType === 'date') {\n\t return new Date(obj.toJSON());\n\t }\n\t\n\t return cloned;\n\t}\n\t\n\tfunction equalAny(obj, options) {\n\t for (var i = 0, len = options.length; i < len; i++) {\n\t if (equal(obj, options[i])) {\n\t return true;\n\t }\n\t }\n\t\n\t return false;\n\t}\n\t\n\tfunction PropertyMarker() {\n\t this.objects = [];\n\t this.properties = [];\n\t}\n\t\n\tPropertyMarker.prototype.mark = function (obj, key) {\n\t var index = this.objects.indexOf(obj),\n\t prop;\n\t\n\t if (index < 0) {\n\t this.objects.push(obj);\n\t\n\t prop = {};\n\t prop[key] = 1;\n\t\n\t this.properties.push(prop);\n\t\n\t return;\n\t }\n\t\n\t prop = this.properties[index];\n\t\n\t prop[key] = prop[key] ? prop[key] + 1 : 1;\n\t};\n\t\n\tPropertyMarker.prototype.deleteDuplicates = function () {\n\t var props, keys, key, i, j;\n\t\n\t for (i = 0; i < this.properties.length; i++) {\n\t props = this.properties[i];\n\t keys = Object.keys(props);\n\t\n\t for (j = 0; j < keys.length; j++) {\n\t key = keys[j];\n\t\n\t if (props[key] > 1) {\n\t delete this.objects[i][key];\n\t }\n\t }\n\t }\n\t};\n\t\n\tPropertyMarker.prototype.dispose = function () {\n\t this.objects.length = 0;\n\t this.properties.length = 0;\n\t};\n\t\n\tfunction build(schema, def, additional, resolver, parentMarker) {\n\t var defType, defValue, key, i, propertyMarker, props, defProps;\n\t\n\t if (type(schema) !== 'object') {\n\t return def;\n\t }\n\t\n\t schema = resolver.resolve(schema);\n\t\n\t if (def === undefined && schema.hasOwnProperty('default')) {\n\t def = clone(schema['default']);\n\t }\n\t\n\t defType = type(def);\n\t\n\t if (defType === 'object' && type(schema.properties) === 'object') {\n\t props = Object.keys(schema.properties);\n\t\n\t for (i = 0; i < props.length; i++) {\n\t key = props[i];\n\t defValue = build(schema.properties[key], def[key], additional, resolver);\n\t\n\t if (defValue !== undefined) {\n\t def[key] = defValue;\n\t }\n\t }\n\t\n\t if (additional !== 'always') {\n\t defProps = Object.keys(def);\n\t\n\t for (i = 0; i < defProps.length; i++) {\n\t key = defProps[i];\n\t\n\t if (props.indexOf(key) < 0 &&\n\t (schema.additionalProperties === false ||\n\t (additional === false && !schema.additionalProperties))) {\n\t\n\t if (parentMarker) {\n\t parentMarker.mark(def, key);\n\t }\n\t else {\n\t delete def[key];\n\t }\n\t }\n\t }\n\t }\n\t }\n\t else if (defType === 'array' && schema.items) {\n\t if (type(schema.items) === 'array') {\n\t for (i = 0; i < schema.items.length; i++) {\n\t defValue = build(schema.items[i], def[i], additional, resolver);\n\t\n\t if (defValue !== undefined || i < def.length) {\n\t def[i] = defValue;\n\t }\n\t }\n\t }\n\t else if (def.length) {\n\t for (i = 0; i < def.length; i++) {\n\t def[i] = build(schema.items, def[i], additional, resolver);\n\t }\n\t }\n\t }\n\t else if (type(schema.allOf) === 'array' && schema.allOf.length) {\n\t propertyMarker = new PropertyMarker();\n\t\n\t for (i = 0; i < schema.allOf.length; i++) {\n\t def = build(schema.allOf[i], def, additional, resolver, propertyMarker);\n\t }\n\t\n\t propertyMarker.deleteDuplicates();\n\t propertyMarker.dispose();\n\t }\n\t\n\t return def;\n\t}\n\t\n\tfunction ValidationContext(options) {\n\t this.path = 'data';\n\t this.schema = options.schema;\n\t this.formats = options.formats;\n\t this.greedy = options.greedy;\n\t this.resolver = options.resolver;\n\t this.id = options.id;\n\t this.funcache = options.funcache || {};\n\t this.scope = options.scope || {\n\t equalAny: equalAny,\n\t unique: unique,\n\t ucs2length: ucs2length,\n\t refs: {}\n\t };\n\t}\n\t\n\tValidationContext.prototype.clone = function (schema) {\n\t var ctx = new ValidationContext({\n\t schema: schema,\n\t formats: this.formats,\n\t greedy: this.greedy,\n\t resolver: this.resolver,\n\t id: this.id,\n\t funcache: this.funcache,\n\t scope: this.scope\n\t });\n\t\n\t return ctx;\n\t};\n\t\n\tValidationContext.prototype.declare = function (def) {\n\t var variname = this.id();\n\t this.code.def(variname, def);\n\t return variname;\n\t};\n\t\n\tValidationContext.prototype.cache = function (cacheKey, schema) {\n\t var cached = this.funcache[cacheKey],\n\t context;\n\t\n\t if (!cached) {\n\t cached = this.funcache[cacheKey] = {\n\t key: this.id()\n\t };\n\t\n\t context = this.clone(schema);\n\t\n\t cached.func = context.compile(cached.key);\n\t\n\t this.scope.refs[cached.key] = cached.func;\n\t\n\t context.dispose();\n\t }\n\t\n\t return 'refs.' + cached.key;\n\t};\n\t\n\tValidationContext.prototype.error = function (keyword, key, additional) {\n\t var schema = this.schema,\n\t path = this.path,\n\t errorPath = path !== 'data' || key ?\n\t '(path ? path + \".\" : \"\") + ' + getPathExpression(path, key) + ',' :\n\t 'path,',\n\t res = key && schema.properties && schema.properties[key] ?\n\t this.resolver.resolve(schema.properties[key]) : null,\n\t message = res ? res.requiredMessage : schema.invalidMessage;\n\t\n\t if (!message) {\n\t message = (res && res.messages && res.messages[keyword]) ||\n\t (schema.messages && schema.messages[keyword]);\n\t }\n\t\n\t this.code('errors.push({');\n\t\n\t if (message) {\n\t this.code('message: ' + encodeStr(message) + ',');\n\t }\n\t\n\t if (additional) {\n\t this.code('additionalProperties: ' + additional + ',');\n\t }\n\t\n\t this.code('path: ' + errorPath)\n\t ('keyword: ' + encodeStr(keyword))\n\t ('})');\n\t\n\t if (!this.greedy) {\n\t this.code('return');\n\t }\n\t};\n\t\n\tValidationContext.prototype.refactor = function (path, schema, cacheKey) {\n\t var parentPathExp = path !== 'data' ?\n\t '(path ? path + \".\" : \"\") + ' + getPathExpression(path) :\n\t 'path',\n\t cachedRef = this.cache(cacheKey, schema),\n\t refErrors = this.declare();\n\t\n\t this.code(refErrors + ' = ' + cachedRef + '(' + path + ', ' + parentPathExp + ', errors)');\n\t\n\t if (!this.greedy) {\n\t this.code('if (errors.length) { return }');\n\t }\n\t};\n\t\n\tValidationContext.prototype.descend = function (path, schema) {\n\t var origPath = this.path,\n\t origSchema = this.schema;\n\t\n\t this.path = path;\n\t this.schema = schema;\n\t\n\t this.generate();\n\t\n\t this.path = origPath;\n\t this.schema = origSchema;\n\t};\n\t\n\tValidationContext.prototype.generate = function () {\n\t var path = this.path,\n\t schema = this.schema,\n\t context = this,\n\t scope = this.scope,\n\t encodedFormat,\n\t format,\n\t schemaKeys,\n\t typeKeys,\n\t typeIndex,\n\t validatedType,\n\t i;\n\t\n\t if (type(schema) !== 'object') {\n\t return;\n\t }\n\t\n\t if (schema.$ref !== undefined) {\n\t schema = this.resolver.resolve(schema);\n\t\n\t if (this.resolver.hasRef(schema)) {\n\t this.refactor(path, schema,\n\t this.resolver.getNormalizedRef(this.schema) || this.schema.$ref);\n\t\n\t return;\n\t }\n\t else {\n\t // substitute $ref schema with the resolved instance\n\t this.schema = schema;\n\t }\n\t }\n\t\n\t schemaKeys = groupKeywords(schema);\n\t\n\t if (schemaKeys.enum) {\n\t keywords.enum(context);\n\t\n\t return; // do not process the schema further\n\t }\n\t\n\t typeKeys = Object.keys(schemaKeys.perType);\n\t\n\t function generateForKeyword(keyword) {\n\t keywords[keyword](context); // jshint ignore: line\n\t }\n\t\n\t for (i = 0; i < typeKeys.length; i++) {\n\t validatedType = typeKeys[i];\n\t\n\t this.code((i ? 'else ' : '') + 'if (' + types[validatedType](path) + ') {');\n\t\n\t schemaKeys.perType[validatedType].forEach(generateForKeyword);\n\t\n\t this.code('}');\n\t\n\t if (schemaKeys.type) {\n\t typeIndex = schemaKeys.type.indexOf(validatedType);\n\t\n\t if (typeIndex > -1) {\n\t schemaKeys.type.splice(typeIndex, 1);\n\t }\n\t }\n\t }\n\t\n\t if (schemaKeys.type) { // we have types in the schema\n\t if (schemaKeys.type.length) { // case 1: we still have some left to check\n\t this.code((typeKeys.length ? 'else ' : '') + 'if (!(' + schemaKeys.type.map(function (type) {\n\t return types[type] ? types[type](path) : 'true';\n\t }).join(' || ') + ')) {');\n\t this.error('type');\n\t this.code('}');\n\t }\n\t else {\n\t this.code('else {'); // case 2: we don't have any left to check\n\t this.error('type');\n\t this.code('}');\n\t }\n\t }\n\t\n\t schemaKeys.allType.forEach(function (keyword) {\n\t keywords[keyword](context);\n\t });\n\t\n\t if (schema.format && this.formats) {\n\t format = this.formats[schema.format];\n\t\n\t if (format) {\n\t if (typeof format === 'string' || format instanceof RegExp) {\n\t this.code('if (!(' + inlineRegex(format) + ').test(' + path + ')) {');\n\t this.error('format');\n\t this.code('}');\n\t }\n\t else if (typeof format === 'function') {\n\t (scope.formats || (scope.formats = {}))[schema.format] = format;\n\t (scope.schemas || (scope.schemas = {}))[schema.format] = schema;\n\t\n\t encodedFormat = encodeStr(schema.format);\n\t\n\t this.code('if (!formats[' + encodedFormat + '](' + path + ', schemas[' + encodedFormat + '])) {');\n\t this.error('format');\n\t this.code('}');\n\t }\n\t }\n\t }\n\t};\n\t\n\tValidationContext.prototype.compile = function (id) {\n\t this.code = func('jsen_compiled' + (id ? '_' + id : ''), 'data', 'path', 'errors');\n\t this.generate();\n\t\n\t return this.code.compile(this.scope);\n\t};\n\t\n\tValidationContext.prototype.dispose = function () {\n\t for (var key in this) {\n\t this[key] = undefined;\n\t }\n\t};\n\t\n\tfunction jsen(schema, options) {\n\t if (type(schema) !== 'object') {\n\t throw new Error(INVALID_SCHEMA);\n\t }\n\t\n\t options = options || {};\n\t\n\t var counter = 0,\n\t id = function () { return 'i' + (counter++); },\n\t resolver = new SchemaResolver(schema, options.schemas, options.missing$Ref || false),\n\t context = new ValidationContext({\n\t schema: schema,\n\t resolver: resolver,\n\t id: id,\n\t schemas: options.schemas,\n\t formats: options.formats,\n\t greedy: options.greedy || false\n\t }),\n\t compiled = func('validate', 'data')\n\t ('validate.errors = []')\n\t ('gen(data, \"\", validate.errors)')\n\t ('return validate.errors.length === 0')\n\t .compile({ gen: context.compile() });\n\t\n\t context.dispose();\n\t context = null;\n\t\n\t compiled.errors = [];\n\t\n\t compiled.build = function (initial, options) {\n\t return build(\n\t schema,\n\t (options && options.copy === false ? initial : clone(initial)),\n\t options && options.additionalProperties,\n\t resolver);\n\t };\n\t\n\t return compiled;\n\t}\n\t\n\tjsen.browser = browser;\n\tjsen.clone = clone;\n\tjsen.equal = equal;\n\tjsen.unique = unique;\n\tjsen.ucs2length = ucs2length;\n\tjsen.SchemaResolver = SchemaResolver;\n\tjsen.resolve = SchemaResolver.resolvePointer;\n\t\n\tmodule.exports = jsen;\n\n\n/***/ },\n/* 12 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = function func() {\n\t var args = Array.apply(null, arguments),\n\t name = args.shift(),\n\t tab = ' ',\n\t lines = '',\n\t vars = '',\n\t ind = 1, // indentation\n\t bs = '{[', // block start\n\t be = '}]', // block end\n\t space = function () {\n\t var sp = tab, i = 0;\n\t while (i++ < ind - 1) { sp += tab; }\n\t return sp;\n\t },\n\t add = function (line) {\n\t lines += space() + line + '\\n';\n\t },\n\t builder = function (line) {\n\t var first = line[0],\n\t last = line[line.length - 1];\n\t\n\t if (be.indexOf(first) > -1 && bs.indexOf(last) > -1) {\n\t ind--;\n\t add(line);\n\t ind++;\n\t }\n\t else if (bs.indexOf(last) > -1) {\n\t add(line);\n\t ind++;\n\t }\n\t else if (be.indexOf(first) > -1) {\n\t ind--;\n\t add(line);\n\t }\n\t else {\n\t add(line);\n\t }\n\t\n\t return builder;\n\t };\n\t\n\t builder.def = function (id, def) {\n\t vars += (vars ? ',\\n' + tab + ' ' : '') + id + (def !== undefined ? ' = ' + def : '');\n\t return builder;\n\t };\n\t\n\t builder.toSource = function () {\n\t return 'function ' + name + '(' + args.join(', ') + ') {\\n' +\n\t tab + '\"use strict\"' + '\\n' +\n\t (vars ? tab + 'var ' + vars + ';\\n' : '') +\n\t lines + '}';\n\t };\n\t\n\t builder.compile = function (scope) {\n\t var src = 'return (' + builder.toSource() + ')',\n\t scp = scope || {},\n\t keys = Object.keys(scp),\n\t vals = keys.map(function (key) { return scp[key]; });\n\t\n\t return Function.apply(null, keys.concat(src)).apply(null, vals);\n\t };\n\t\n\t return builder;\n\t};\n\n/***/ },\n/* 13 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tfunction type(obj) {\n\t var str = Object.prototype.toString.call(obj);\n\t return str.substr(8, str.length - 9).toLowerCase();\n\t}\n\t\n\tfunction deepEqual(a, b) {\n\t var keysA = Object.keys(a).sort(),\n\t keysB = Object.keys(b).sort(),\n\t i, key;\n\t\n\t if (!equal(keysA, keysB)) {\n\t return false;\n\t }\n\t\n\t for (i = 0; i < keysA.length; i++) {\n\t key = keysA[i];\n\t\n\t if (!equal(a[key], b[key])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t}\n\t\n\tfunction equal(a, b) { // jshint ignore: line\n\t var typeA = typeof a,\n\t typeB = typeof b,\n\t i;\n\t\n\t // get detailed object type\n\t if (typeA === 'object') {\n\t typeA = type(a);\n\t }\n\t\n\t // get detailed object type\n\t if (typeB === 'object') {\n\t typeB = type(b);\n\t }\n\t\n\t if (typeA !== typeB) {\n\t return false;\n\t }\n\t\n\t if (typeA === 'object') {\n\t return deepEqual(a, b);\n\t }\n\t\n\t if (typeA === 'regexp') {\n\t return a.toString() === b.toString();\n\t }\n\t\n\t if (typeA === 'array') {\n\t if (a.length !== b.length) {\n\t return false;\n\t }\n\t\n\t for (i = 0; i < a.length; i++) {\n\t if (!equal(a[i], b[i])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t }\n\t\n\t return a === b;\n\t}\n\t\n\tmodule.exports = equal;\n\n/***/ },\n/* 14 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar equal = __webpack_require__(13);\n\t\n\tfunction findIndex(arr, value, comparator) {\n\t for (var i = 0, len = arr.length; i < len; i++) {\n\t if (comparator(arr[i], value)) {\n\t return i;\n\t }\n\t }\n\t\n\t return -1;\n\t}\n\t\n\tmodule.exports = function unique(arr) {\n\t return arr.filter(function uniqueOnly(value, index, self) {\n\t return findIndex(self, value, equal) === index;\n\t });\n\t};\n\t\n\tmodule.exports.findIndex = findIndex;\n\n/***/ },\n/* 15 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar url = __webpack_require__(16),\n\t metaschema = __webpack_require__(23),\n\t INVALID_SCHEMA_REFERENCE = 'jsen: invalid schema reference',\n\t DUPLICATE_SCHEMA_ID = 'jsen: duplicate schema id',\n\t CIRCULAR_SCHEMA_REFERENCE = 'jsen: circular schema reference';\n\t\n\tfunction get(obj, path) {\n\t if (!path.length) {\n\t return obj;\n\t }\n\t\n\t var key = path.shift(),\n\t val;\n\t\n\t if (obj && typeof obj === 'object' && obj.hasOwnProperty(key)) {\n\t val = obj[key];\n\t }\n\t\n\t if (path.length) {\n\t if (val && typeof val === 'object') {\n\t return get(val, path);\n\t }\n\t\n\t return undefined;\n\t }\n\t\n\t return val;\n\t}\n\t\n\tfunction refToObj(ref) {\n\t var index = ref.indexOf('#'),\n\t ret = {\n\t base: ref.substr(0, index),\n\t path: []\n\t };\n\t\n\t if (index < 0) {\n\t ret.base = ref;\n\t return ret;\n\t }\n\t\n\t ref = ref.substr(index + 1);\n\t\n\t if (!ref) {\n\t return ret;\n\t }\n\t\n\t ret.path = ref.split('/').map(function (segment) {\n\t // Reference: http://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-08#section-3\n\t return decodeURIComponent(segment)\n\t .replace(/~1/g, '/')\n\t .replace(/~0/g, '~');\n\t });\n\t\n\t if (ref[0] === '/') {\n\t ret.path.shift();\n\t }\n\t\n\t return ret;\n\t}\n\t\n\t// TODO: Can we prevent nested resolvers and combine schemas instead?\n\tfunction SchemaResolver(rootSchema, external, missing$Ref, baseId) { // jshint ignore: line\n\t this.rootSchema = rootSchema;\n\t this.resolvers = null;\n\t this.resolvedRootSchema = null;\n\t this.cache = {};\n\t this.idCache = {};\n\t this.refCache = { refs: [], schemas: [] };\n\t this.missing$Ref = missing$Ref;\n\t this.refStack = [];\n\t\n\t baseId = baseId || '';\n\t\n\t this._buildIdCache(rootSchema, baseId);\n\t\n\t // get updated base id after normalizing root schema id\n\t baseId = this.refCache.refs[this.refCache.schemas.indexOf(this.rootSchema)] || baseId;\n\t\n\t this._buildResolvers(external, baseId);\n\t}\n\t\n\tSchemaResolver.prototype._cacheId = function (id, schema, resolver) {\n\t if (this.idCache[id]) {\n\t throw new Error(DUPLICATE_SCHEMA_ID + ' ' + id);\n\t }\n\t\n\t this.idCache[id] = { resolver: resolver, schema: schema };\n\t};\n\t\n\tSchemaResolver.prototype._buildIdCache = function (schema, baseId) {\n\t var id = baseId,\n\t ref, keys, i;\n\t\n\t if (!schema || typeof schema !== 'object') {\n\t return;\n\t }\n\t\n\t if (typeof schema.id === 'string' && schema.id) {\n\t id = url.resolve(baseId, schema.id);\n\t\n\t this._cacheId(id, schema, this);\n\t }\n\t else if (schema === this.rootSchema && baseId) {\n\t this._cacheId(baseId, schema, this);\n\t }\n\t\n\t if (schema.$ref && typeof schema.$ref === 'string') {\n\t ref = url.resolve(id, schema.$ref);\n\t\n\t this.refCache.schemas.push(schema);\n\t this.refCache.refs.push(ref);\n\t }\n\t\n\t keys = Object.keys(schema);\n\t\n\t for (i = 0; i < keys.length; i++) {\n\t this._buildIdCache(schema[keys[i]], id);\n\t }\n\t};\n\t\n\tSchemaResolver.prototype._buildResolvers = function (schemas, baseId) {\n\t if (!schemas || typeof schemas !== 'object') {\n\t return;\n\t }\n\t\n\t var that = this,\n\t resolvers = {};\n\t\n\t Object.keys(schemas).forEach(function (key) {\n\t var id = url.resolve(baseId, key),\n\t resolver = new SchemaResolver(schemas[key], null, that.missing$Ref, id);\n\t\n\t that._cacheId(id, resolver.rootSchema, resolver);\n\t\n\t Object.keys(resolver.idCache).forEach(function (idKey) {\n\t that.idCache[idKey] = resolver.idCache[idKey];\n\t });\n\t\n\t resolvers[key] = resolver;\n\t });\n\t\n\t this.resolvers = resolvers;\n\t};\n\t\n\tSchemaResolver.prototype.getNormalizedRef = function (schema) {\n\t var index = this.refCache.schemas.indexOf(schema);\n\t return this.refCache.refs[index];\n\t};\n\t\n\tSchemaResolver.prototype._resolveRef = function (ref) {\n\t var err = new Error(INVALID_SCHEMA_REFERENCE + ' ' + ref),\n\t idCache = this.idCache,\n\t externalResolver, cached, descriptor, path, dest;\n\t\n\t if (!ref || typeof ref !== 'string') {\n\t throw err;\n\t }\n\t\n\t if (ref === metaschema.id) {\n\t dest = metaschema;\n\t }\n\t\n\t cached = idCache[ref];\n\t\n\t if (cached) {\n\t dest = cached.resolver.resolve(cached.schema);\n\t }\n\t\n\t if (dest === undefined) {\n\t descriptor = refToObj(ref);\n\t path = descriptor.path;\n\t\n\t if (descriptor.base) {\n\t cached = idCache[descriptor.base] || idCache[descriptor.base + '#'];\n\t\n\t if (cached) {\n\t dest = cached.resolver.resolve(get(cached.schema, path.slice(0)));\n\t }\n\t else {\n\t path.unshift(descriptor.base);\n\t }\n\t }\n\t }\n\t\n\t if (dest === undefined && this.resolvedRootSchema) {\n\t dest = get(this.resolvedRootSchema, path.slice(0));\n\t }\n\t\n\t if (dest === undefined) {\n\t dest = get(this.rootSchema, path.slice(0));\n\t }\n\t\n\t if (dest === undefined && path.length && this.resolvers) {\n\t externalResolver = get(this.resolvers, path);\n\t\n\t if (externalResolver) {\n\t dest = externalResolver.resolve(externalResolver.rootSchema);\n\t }\n\t }\n\t\n\t if (dest === undefined || typeof dest !== 'object') {\n\t if (this.missing$Ref) {\n\t dest = {};\n\t } else {\n\t throw err;\n\t }\n\t }\n\t\n\t if (this.cache[ref] === dest) {\n\t return dest;\n\t }\n\t\n\t this.cache[ref] = dest;\n\t\n\t if (dest.$ref !== undefined) {\n\t dest = this.resolve(dest);\n\t }\n\t\n\t return dest;\n\t};\n\t\n\tSchemaResolver.prototype.resolve = function (schema) {\n\t if (!schema || typeof schema !== 'object' || schema.$ref === undefined) {\n\t return schema;\n\t }\n\t\n\t var ref = this.getNormalizedRef(schema) || schema.$ref,\n\t resolved = this.cache[ref];\n\t\n\t if (resolved !== undefined) {\n\t return resolved;\n\t }\n\t\n\t if (this.refStack.indexOf(ref) > -1) {\n\t throw new Error(CIRCULAR_SCHEMA_REFERENCE + ' ' + ref);\n\t }\n\t\n\t this.refStack.push(ref);\n\t\n\t resolved = this._resolveRef(ref);\n\t\n\t this.refStack.pop();\n\t\n\t if (schema === this.rootSchema) {\n\t // cache the resolved root schema\n\t this.resolvedRootSchema = resolved;\n\t }\n\t\n\t return resolved;\n\t};\n\t\n\tSchemaResolver.prototype.hasRef = function (schema) {\n\t var keys = Object.keys(schema),\n\t len, key, i, hasChildRef;\n\t\n\t if (keys.indexOf('$ref') > -1) {\n\t return true;\n\t }\n\t\n\t for (i = 0, len = keys.length; i < len; i++) {\n\t key = keys[i];\n\t\n\t if (schema[key] && typeof schema[key] === 'object' && !Array.isArray(schema[key])) {\n\t hasChildRef = this.hasRef(schema[key]);\n\t\n\t if (hasChildRef) {\n\t return true;\n\t }\n\t }\n\t }\n\t\n\t return false;\n\t};\n\t\n\tSchemaResolver.resolvePointer = function (obj, pointer) {\n\t var descriptor = refToObj(pointer),\n\t path = descriptor.path;\n\t\n\t if (descriptor.base) {\n\t path = [descriptor.base].concat(path);\n\t }\n\t\n\t return get(obj, path);\n\t};\n\t\n\tmodule.exports = SchemaResolver;\n\n/***/ },\n/* 16 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t// Copyright Joyent, Inc. and other Node contributors.\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a\n\t// copy of this software and associated documentation files (the\n\t// \"Software\"), to deal in the Software without restriction, including\n\t// without limitation the rights to use, copy, modify, merge, publish,\n\t// distribute, sublicense, and/or sell copies of the Software, and to permit\n\t// persons to whom the Software is furnished to do so, subject to the\n\t// following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included\n\t// in all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n\t// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\t// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n\t// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n\t// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n\t// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n\t// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\t\n\t'use strict';\n\t\n\tvar punycode = __webpack_require__(17);\n\tvar util = __webpack_require__(19);\n\t\n\texports.parse = urlParse;\n\texports.resolve = urlResolve;\n\texports.resolveObject = urlResolveObject;\n\texports.format = urlFormat;\n\t\n\texports.Url = Url;\n\t\n\tfunction Url() {\n\t this.protocol = null;\n\t this.slashes = null;\n\t this.auth = null;\n\t this.host = null;\n\t this.port = null;\n\t this.hostname = null;\n\t this.hash = null;\n\t this.search = null;\n\t this.query = null;\n\t this.pathname = null;\n\t this.path = null;\n\t this.href = null;\n\t}\n\t\n\t// Reference: RFC 3986, RFC 1808, RFC 2396\n\t\n\t// define these here so at least they only have to be\n\t// compiled once on the first module load.\n\tvar protocolPattern = /^([a-z0-9.+-]+:)/i,\n\t portPattern = /:[0-9]*$/,\n\t\n\t // Special case for a simple path URL\n\t simplePathPattern = /^(\\/\\/?(?!\\/)[^\\?\\s]*)(\\?[^\\s]*)?$/,\n\t\n\t // RFC 2396: characters reserved for delimiting URLs.\n\t // We actually just auto-escape these.\n\t delims = ['<', '>', '\"', '`', ' ', '\\r', '\\n', '\\t'],\n\t\n\t // RFC 2396: characters not allowed for various reasons.\n\t unwise = ['{', '}', '|', '\\\\', '^', '`'].concat(delims),\n\t\n\t // Allowed by RFCs, but cause of XSS attacks. Always escape these.\n\t autoEscape = ['\\''].concat(unwise),\n\t // Characters that are never ever allowed in a hostname.\n\t // Note that any invalid chars are also handled, but these\n\t // are the ones that are *expected* to be seen, so we fast-path\n\t // them.\n\t nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape),\n\t hostEndingChars = ['/', '?', '#'],\n\t hostnameMaxLen = 255,\n\t hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,\n\t hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,\n\t // protocols that can allow \"unsafe\" and \"unwise\" chars.\n\t unsafeProtocol = {\n\t 'javascript': true,\n\t 'javascript:': true\n\t },\n\t // protocols that never have a hostname.\n\t hostlessProtocol = {\n\t 'javascript': true,\n\t 'javascript:': true\n\t },\n\t // protocols that always contain a // bit.\n\t slashedProtocol = {\n\t 'http': true,\n\t 'https': true,\n\t 'ftp': true,\n\t 'gopher': true,\n\t 'file': true,\n\t 'http:': true,\n\t 'https:': true,\n\t 'ftp:': true,\n\t 'gopher:': true,\n\t 'file:': true\n\t },\n\t querystring = __webpack_require__(20);\n\t\n\tfunction urlParse(url, parseQueryString, slashesDenoteHost) {\n\t if (url && util.isObject(url) && url instanceof Url) return url;\n\t\n\t var u = new Url;\n\t u.parse(url, parseQueryString, slashesDenoteHost);\n\t return u;\n\t}\n\t\n\tUrl.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {\n\t if (!util.isString(url)) {\n\t throw new TypeError(\"Parameter 'url' must be a string, not \" + typeof url);\n\t }\n\t\n\t // Copy chrome, IE, opera backslash-handling behavior.\n\t // Back slashes before the query string get converted to forward slashes\n\t // See: https://code.google.com/p/chromium/issues/detail?id=25916\n\t var queryIndex = url.indexOf('?'),\n\t splitter =\n\t (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#',\n\t uSplit = url.split(splitter),\n\t slashRegex = /\\\\/g;\n\t uSplit[0] = uSplit[0].replace(slashRegex, '/');\n\t url = uSplit.join(splitter);\n\t\n\t var rest = url;\n\t\n\t // trim before proceeding.\n\t // This is to support parse stuff like \" http://foo.com \\n\"\n\t rest = rest.trim();\n\t\n\t if (!slashesDenoteHost && url.split('#').length === 1) {\n\t // Try fast path regexp\n\t var simplePath = simplePathPattern.exec(rest);\n\t if (simplePath) {\n\t this.path = rest;\n\t this.href = rest;\n\t this.pathname = simplePath[1];\n\t if (simplePath[2]) {\n\t this.search = simplePath[2];\n\t if (parseQueryString) {\n\t this.query = querystring.parse(this.search.substr(1));\n\t } else {\n\t this.query = this.search.substr(1);\n\t }\n\t } else if (parseQueryString) {\n\t this.search = '';\n\t this.query = {};\n\t }\n\t return this;\n\t }\n\t }\n\t\n\t var proto = protocolPattern.exec(rest);\n\t if (proto) {\n\t proto = proto[0];\n\t var lowerProto = proto.toLowerCase();\n\t this.protocol = lowerProto;\n\t rest = rest.substr(proto.length);\n\t }\n\t\n\t // figure out if it's got a host\n\t // user@server is *always* interpreted as a hostname, and url\n\t // resolution will treat //foo/bar as host=foo,path=bar because that's\n\t // how the browser resolves relative URLs.\n\t if (slashesDenoteHost || proto || rest.match(/^\\/\\/[^@\\/]+@[^@\\/]+/)) {\n\t var slashes = rest.substr(0, 2) === '//';\n\t if (slashes && !(proto && hostlessProtocol[proto])) {\n\t rest = rest.substr(2);\n\t this.slashes = true;\n\t }\n\t }\n\t\n\t if (!hostlessProtocol[proto] &&\n\t (slashes || (proto && !slashedProtocol[proto]))) {\n\t\n\t // there's a hostname.\n\t // the first instance of /, ?, ;, or # ends the host.\n\t //\n\t // If there is an @ in the hostname, then non-host chars *are* allowed\n\t // to the left of the last @ sign, unless some host-ending character\n\t // comes *before* the @-sign.\n\t // URLs are obnoxious.\n\t //\n\t // ex:\n\t // http://a@b@c/ => user:a@b host:c\n\t // http://a@b?@c => user:a host:c path:/?@c\n\t\n\t // v0.12 TODO(isaacs): This is not quite how Chrome does things.\n\t // Review our test case against browsers more comprehensively.\n\t\n\t // find the first instance of any hostEndingChars\n\t var hostEnd = -1;\n\t for (var i = 0; i < hostEndingChars.length; i++) {\n\t var hec = rest.indexOf(hostEndingChars[i]);\n\t if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n\t hostEnd = hec;\n\t }\n\t\n\t // at this point, either we have an explicit point where the\n\t // auth portion cannot go past, or the last @ char is the decider.\n\t var auth, atSign;\n\t if (hostEnd === -1) {\n\t // atSign can be anywhere.\n\t atSign = rest.lastIndexOf('@');\n\t } else {\n\t // atSign must be in auth portion.\n\t // http://a@b/c@d => host:b auth:a path:/c@d\n\t atSign = rest.lastIndexOf('@', hostEnd);\n\t }\n\t\n\t // Now we have a portion which is definitely the auth.\n\t // Pull that off.\n\t if (atSign !== -1) {\n\t auth = rest.slice(0, atSign);\n\t rest = rest.slice(atSign + 1);\n\t this.auth = decodeURIComponent(auth);\n\t }\n\t\n\t // the host is the remaining to the left of the first non-host char\n\t hostEnd = -1;\n\t for (var i = 0; i < nonHostChars.length; i++) {\n\t var hec = rest.indexOf(nonHostChars[i]);\n\t if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n\t hostEnd = hec;\n\t }\n\t // if we still have not hit it, then the entire thing is a host.\n\t if (hostEnd === -1)\n\t hostEnd = rest.length;\n\t\n\t this.host = rest.slice(0, hostEnd);\n\t rest = rest.slice(hostEnd);\n\t\n\t // pull out port.\n\t this.parseHost();\n\t\n\t // we've indicated that there is a hostname,\n\t // so even if it's empty, it has to be present.\n\t this.hostname = this.hostname || '';\n\t\n\t // if hostname begins with [ and ends with ]\n\t // assume that it's an IPv6 address.\n\t var ipv6Hostname = this.hostname[0] === '[' &&\n\t this.hostname[this.hostname.length - 1] === ']';\n\t\n\t // validate a little.\n\t if (!ipv6Hostname) {\n\t var hostparts = this.hostname.split(/\\./);\n\t for (var i = 0, l = hostparts.length; i < l; i++) {\n\t var part = hostparts[i];\n\t if (!part) continue;\n\t if (!part.match(hostnamePartPattern)) {\n\t var newpart = '';\n\t for (var j = 0, k = part.length; j < k; j++) {\n\t if (part.charCodeAt(j) > 127) {\n\t // we replace non-ASCII char with a temporary placeholder\n\t // we need this to make sure size of hostname is not\n\t // broken by replacing non-ASCII by nothing\n\t newpart += 'x';\n\t } else {\n\t newpart += part[j];\n\t }\n\t }\n\t // we test again with ASCII char only\n\t if (!newpart.match(hostnamePartPattern)) {\n\t var validParts = hostparts.slice(0, i);\n\t var notHost = hostparts.slice(i + 1);\n\t var bit = part.match(hostnamePartStart);\n\t if (bit) {\n\t validParts.push(bit[1]);\n\t notHost.unshift(bit[2]);\n\t }\n\t if (notHost.length) {\n\t rest = '/' + notHost.join('.') + rest;\n\t }\n\t this.hostname = validParts.join('.');\n\t break;\n\t }\n\t }\n\t }\n\t }\n\t\n\t if (this.hostname.length > hostnameMaxLen) {\n\t this.hostname = '';\n\t } else {\n\t // hostnames are always lower case.\n\t this.hostname = this.hostname.toLowerCase();\n\t }\n\t\n\t if (!ipv6Hostname) {\n\t // IDNA Support: Returns a punycoded representation of \"domain\".\n\t // It only converts parts of the domain name that\n\t // have non-ASCII characters, i.e. it doesn't matter if\n\t // you call it with a domain that already is ASCII-only.\n\t this.hostname = punycode.toASCII(this.hostname);\n\t }\n\t\n\t var p = this.port ? ':' + this.port : '';\n\t var h = this.hostname || '';\n\t this.host = h + p;\n\t this.href += this.host;\n\t\n\t // strip [ and ] from the hostname\n\t // the host field still retains them, though\n\t if (ipv6Hostname) {\n\t this.hostname = this.hostname.substr(1, this.hostname.length - 2);\n\t if (rest[0] !== '/') {\n\t rest = '/' + rest;\n\t }\n\t }\n\t }\n\t\n\t // now rest is set to the post-host stuff.\n\t // chop off any delim chars.\n\t if (!unsafeProtocol[lowerProto]) {\n\t\n\t // First, make 100% sure that any \"autoEscape\" chars get\n\t // escaped, even if encodeURIComponent doesn't think they\n\t // need to be.\n\t for (var i = 0, l = autoEscape.length; i < l; i++) {\n\t var ae = autoEscape[i];\n\t if (rest.indexOf(ae) === -1)\n\t continue;\n\t var esc = encodeURIComponent(ae);\n\t if (esc === ae) {\n\t esc = escape(ae);\n\t }\n\t rest = rest.split(ae).join(esc);\n\t }\n\t }\n\t\n\t\n\t // chop off from the tail first.\n\t var hash = rest.indexOf('#');\n\t if (hash !== -1) {\n\t // got a fragment string.\n\t this.hash = rest.substr(hash);\n\t rest = rest.slice(0, hash);\n\t }\n\t var qm = rest.indexOf('?');\n\t if (qm !== -1) {\n\t this.search = rest.substr(qm);\n\t this.query = rest.substr(qm + 1);\n\t if (parseQueryString) {\n\t this.query = querystring.parse(this.query);\n\t }\n\t rest = rest.slice(0, qm);\n\t } else if (parseQueryString) {\n\t // no query string, but parseQueryString still requested\n\t this.search = '';\n\t this.query = {};\n\t }\n\t if (rest) this.pathname = rest;\n\t if (slashedProtocol[lowerProto] &&\n\t this.hostname && !this.pathname) {\n\t this.pathname = '/';\n\t }\n\t\n\t //to support http.request\n\t if (this.pathname || this.search) {\n\t var p = this.pathname || '';\n\t var s = this.search || '';\n\t this.path = p + s;\n\t }\n\t\n\t // finally, reconstruct the href based on what has been validated.\n\t this.href = this.format();\n\t return this;\n\t};\n\t\n\t// format a parsed object into a url string\n\tfunction urlFormat(obj) {\n\t // ensure it's an object, and not a string url.\n\t // If it's an obj, this is a no-op.\n\t // this way, you can call url_format() on strings\n\t // to clean up potentially wonky urls.\n\t if (util.isString(obj)) obj = urlParse(obj);\n\t if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n\t return obj.format();\n\t}\n\t\n\tUrl.prototype.format = function() {\n\t var auth = this.auth || '';\n\t if (auth) {\n\t auth = encodeURIComponent(auth);\n\t auth = auth.replace(/%3A/i, ':');\n\t auth += '@';\n\t }\n\t\n\t var protocol = this.protocol || '',\n\t pathname = this.pathname || '',\n\t hash = this.hash || '',\n\t host = false,\n\t query = '';\n\t\n\t if (this.host) {\n\t host = auth + this.host;\n\t } else if (this.hostname) {\n\t host = auth + (this.hostname.indexOf(':') === -1 ?\n\t this.hostname :\n\t '[' + this.hostname + ']');\n\t if (this.port) {\n\t host += ':' + this.port;\n\t }\n\t }\n\t\n\t if (this.query &&\n\t util.isObject(this.query) &&\n\t Object.keys(this.query).length) {\n\t query = querystring.stringify(this.query);\n\t }\n\t\n\t var search = this.search || (query && ('?' + query)) || '';\n\t\n\t if (protocol && protocol.substr(-1) !== ':') protocol += ':';\n\t\n\t // only the slashedProtocols get the //. Not mailto:, xmpp:, etc.\n\t // unless they had them to begin with.\n\t if (this.slashes ||\n\t (!protocol || slashedProtocol[protocol]) && host !== false) {\n\t host = '//' + (host || '');\n\t if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname;\n\t } else if (!host) {\n\t host = '';\n\t }\n\t\n\t if (hash && hash.charAt(0) !== '#') hash = '#' + hash;\n\t if (search && search.charAt(0) !== '?') search = '?' + search;\n\t\n\t pathname = pathname.replace(/[?#]/g, function(match) {\n\t return encodeURIComponent(match);\n\t });\n\t search = search.replace('#', '%23');\n\t\n\t return protocol + host + pathname + search + hash;\n\t};\n\t\n\tfunction urlResolve(source, relative) {\n\t return urlParse(source, false, true).resolve(relative);\n\t}\n\t\n\tUrl.prototype.resolve = function(relative) {\n\t return this.resolveObject(urlParse(relative, false, true)).format();\n\t};\n\t\n\tfunction urlResolveObject(source, relative) {\n\t if (!source) return relative;\n\t return urlParse(source, false, true).resolveObject(relative);\n\t}\n\t\n\tUrl.prototype.resolveObject = function(relative) {\n\t if (util.isString(relative)) {\n\t var rel = new Url();\n\t rel.parse(relative, false, true);\n\t relative = rel;\n\t }\n\t\n\t var result = new Url();\n\t var tkeys = Object.keys(this);\n\t for (var tk = 0; tk < tkeys.length; tk++) {\n\t var tkey = tkeys[tk];\n\t result[tkey] = this[tkey];\n\t }\n\t\n\t // hash is always overridden, no matter what.\n\t // even href=\"\" will remove it.\n\t result.hash = relative.hash;\n\t\n\t // if the relative url is empty, then there's nothing left to do here.\n\t if (relative.href === '') {\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t // hrefs like //foo/bar always cut to the protocol.\n\t if (relative.slashes && !relative.protocol) {\n\t // take everything except the protocol from relative\n\t var rkeys = Object.keys(relative);\n\t for (var rk = 0; rk < rkeys.length; rk++) {\n\t var rkey = rkeys[rk];\n\t if (rkey !== 'protocol')\n\t result[rkey] = relative[rkey];\n\t }\n\t\n\t //urlParse appends trailing / to urls like http://www.example.com\n\t if (slashedProtocol[result.protocol] &&\n\t result.hostname && !result.pathname) {\n\t result.path = result.pathname = '/';\n\t }\n\t\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t if (relative.protocol && relative.protocol !== result.protocol) {\n\t // if it's a known url protocol, then changing\n\t // the protocol does weird things\n\t // first, if it's not file:, then we MUST have a host,\n\t // and if there was a path\n\t // to begin with, then we MUST have a path.\n\t // if it is file:, then the host is dropped,\n\t // because that's known to be hostless.\n\t // anything else is assumed to be absolute.\n\t if (!slashedProtocol[relative.protocol]) {\n\t var keys = Object.keys(relative);\n\t for (var v = 0; v < keys.length; v++) {\n\t var k = keys[v];\n\t result[k] = relative[k];\n\t }\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t result.protocol = relative.protocol;\n\t if (!relative.host && !hostlessProtocol[relative.protocol]) {\n\t var relPath = (relative.pathname || '').split('/');\n\t while (relPath.length && !(relative.host = relPath.shift()));\n\t if (!relative.host) relative.host = '';\n\t if (!relative.hostname) relative.hostname = '';\n\t if (relPath[0] !== '') relPath.unshift('');\n\t if (relPath.length < 2) relPath.unshift('');\n\t result.pathname = relPath.join('/');\n\t } else {\n\t result.pathname = relative.pathname;\n\t }\n\t result.search = relative.search;\n\t result.query = relative.query;\n\t result.host = relative.host || '';\n\t result.auth = relative.auth;\n\t result.hostname = relative.hostname || relative.host;\n\t result.port = relative.port;\n\t // to support http.request\n\t if (result.pathname || result.search) {\n\t var p = result.pathname || '';\n\t var s = result.search || '';\n\t result.path = p + s;\n\t }\n\t result.slashes = result.slashes || relative.slashes;\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'),\n\t isRelAbs = (\n\t relative.host ||\n\t relative.pathname && relative.pathname.charAt(0) === '/'\n\t ),\n\t mustEndAbs = (isRelAbs || isSourceAbs ||\n\t (result.host && relative.pathname)),\n\t removeAllDots = mustEndAbs,\n\t srcPath = result.pathname && result.pathname.split('/') || [],\n\t relPath = relative.pathname && relative.pathname.split('/') || [],\n\t psychotic = result.protocol && !slashedProtocol[result.protocol];\n\t\n\t // if the url is a non-slashed url, then relative\n\t // links like ../.. should be able\n\t // to crawl up to the hostname, as well. This is strange.\n\t // result.protocol has already been set by now.\n\t // Later on, put the first path part into the host field.\n\t if (psychotic) {\n\t result.hostname = '';\n\t result.port = null;\n\t if (result.host) {\n\t if (srcPath[0] === '') srcPath[0] = result.host;\n\t else srcPath.unshift(result.host);\n\t }\n\t result.host = '';\n\t if (relative.protocol) {\n\t relative.hostname = null;\n\t relative.port = null;\n\t if (relative.host) {\n\t if (relPath[0] === '') relPath[0] = relative.host;\n\t else relPath.unshift(relative.host);\n\t }\n\t relative.host = null;\n\t }\n\t mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === '');\n\t }\n\t\n\t if (isRelAbs) {\n\t // it's absolute.\n\t result.host = (relative.host || relative.host === '') ?\n\t relative.host : result.host;\n\t result.hostname = (relative.hostname || relative.hostname === '') ?\n\t relative.hostname : result.hostname;\n\t result.search = relative.search;\n\t result.query = relative.query;\n\t srcPath = relPath;\n\t // fall through to the dot-handling below.\n\t } else if (relPath.length) {\n\t // it's relative\n\t // throw away the existing file, and take the new path instead.\n\t if (!srcPath) srcPath = [];\n\t srcPath.pop();\n\t srcPath = srcPath.concat(relPath);\n\t result.search = relative.search;\n\t result.query = relative.query;\n\t } else if (!util.isNullOrUndefined(relative.search)) {\n\t // just pull out the search.\n\t // like href='https://github.com/?foo'.\n\t // Put this after the other two cases because it simplifies the booleans\n\t if (psychotic) {\n\t result.hostname = result.host = srcPath.shift();\n\t //occationaly the auth can get stuck only in host\n\t //this especially happens in cases like\n\t //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n\t var authInHost = result.host && result.host.indexOf('@') > 0 ?\n\t result.host.split('@') : false;\n\t if (authInHost) {\n\t result.auth = authInHost.shift();\n\t result.host = result.hostname = authInHost.shift();\n\t }\n\t }\n\t result.search = relative.search;\n\t result.query = relative.query;\n\t //to support http.request\n\t if (!util.isNull(result.pathname) || !util.isNull(result.search)) {\n\t result.path = (result.pathname ? result.pathname : '') +\n\t (result.search ? result.search : '');\n\t }\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t if (!srcPath.length) {\n\t // no path at all. easy.\n\t // we've already handled the other stuff above.\n\t result.pathname = null;\n\t //to support http.request\n\t if (result.search) {\n\t result.path = '/' + result.search;\n\t } else {\n\t result.path = null;\n\t }\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t // if a url ENDs in . or .., then it must get a trailing slash.\n\t // however, if it ends in anything else non-slashy,\n\t // then it must NOT get a trailing slash.\n\t var last = srcPath.slice(-1)[0];\n\t var hasTrailingSlash = (\n\t (result.host || relative.host || srcPath.length > 1) &&\n\t (last === '.' || last === '..') || last === '');\n\t\n\t // strip single dots, resolve double dots to parent dir\n\t // if the path tries to go above the root, `up` ends up > 0\n\t var up = 0;\n\t for (var i = srcPath.length; i >= 0; i--) {\n\t last = srcPath[i];\n\t if (last === '.') {\n\t srcPath.splice(i, 1);\n\t } else if (last === '..') {\n\t srcPath.splice(i, 1);\n\t up++;\n\t } else if (up) {\n\t srcPath.splice(i, 1);\n\t up--;\n\t }\n\t }\n\t\n\t // if the path is allowed to go above the root, restore leading ..s\n\t if (!mustEndAbs && !removeAllDots) {\n\t for (; up--; up) {\n\t srcPath.unshift('..');\n\t }\n\t }\n\t\n\t if (mustEndAbs && srcPath[0] !== '' &&\n\t (!srcPath[0] || srcPath[0].charAt(0) !== '/')) {\n\t srcPath.unshift('');\n\t }\n\t\n\t if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) {\n\t srcPath.push('');\n\t }\n\t\n\t var isAbsolute = srcPath[0] === '' ||\n\t (srcPath[0] && srcPath[0].charAt(0) === '/');\n\t\n\t // put the host back\n\t if (psychotic) {\n\t result.hostname = result.host = isAbsolute ? '' :\n\t srcPath.length ? srcPath.shift() : '';\n\t //occationaly the auth can get stuck only in host\n\t //this especially happens in cases like\n\t //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n\t var authInHost = result.host && result.host.indexOf('@') > 0 ?\n\t result.host.split('@') : false;\n\t if (authInHost) {\n\t result.auth = authInHost.shift();\n\t result.host = result.hostname = authInHost.shift();\n\t }\n\t }\n\t\n\t mustEndAbs = mustEndAbs || (result.host && srcPath.length);\n\t\n\t if (mustEndAbs && !isAbsolute) {\n\t srcPath.unshift('');\n\t }\n\t\n\t if (!srcPath.length) {\n\t result.pathname = null;\n\t result.path = null;\n\t } else {\n\t result.pathname = srcPath.join('/');\n\t }\n\t\n\t //to support request.http\n\t if (!util.isNull(result.pathname) || !util.isNull(result.search)) {\n\t result.path = (result.pathname ? result.pathname : '') +\n\t (result.search ? result.search : '');\n\t }\n\t result.auth = relative.auth || result.auth;\n\t result.slashes = result.slashes || relative.slashes;\n\t result.href = result.format();\n\t return result;\n\t};\n\t\n\tUrl.prototype.parseHost = function() {\n\t var host = this.host;\n\t var port = portPattern.exec(host);\n\t if (port) {\n\t port = port[0];\n\t if (port !== ':') {\n\t this.port = port.substr(1);\n\t }\n\t host = host.substr(0, host.length - port.length);\n\t }\n\t if (host) this.hostname = host;\n\t};\n\n\n/***/ },\n/* 17 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(module, global) {/*! https://mths.be/punycode v1.3.2 by @mathias */\n\t;(function(root) {\n\t\n\t\t/** Detect free variables */\n\t\tvar freeExports = typeof exports == 'object' && exports &&\n\t\t\t!exports.nodeType && exports;\n\t\tvar freeModule = typeof module == 'object' && module &&\n\t\t\t!module.nodeType && module;\n\t\tvar freeGlobal = typeof global == 'object' && global;\n\t\tif (\n\t\t\tfreeGlobal.global === freeGlobal ||\n\t\t\tfreeGlobal.window === freeGlobal ||\n\t\t\tfreeGlobal.self === freeGlobal\n\t\t) {\n\t\t\troot = freeGlobal;\n\t\t}\n\t\n\t\t/**\n\t\t * The `punycode` object.\n\t\t * @name punycode\n\t\t * @type Object\n\t\t */\n\t\tvar punycode,\n\t\n\t\t/** Highest positive signed 32-bit float value */\n\t\tmaxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1\n\t\n\t\t/** Bootstring parameters */\n\t\tbase = 36,\n\t\ttMin = 1,\n\t\ttMax = 26,\n\t\tskew = 38,\n\t\tdamp = 700,\n\t\tinitialBias = 72,\n\t\tinitialN = 128, // 0x80\n\t\tdelimiter = '-', // '\\x2D'\n\t\n\t\t/** Regular expressions */\n\t\tregexPunycode = /^xn--/,\n\t\tregexNonASCII = /[^\\x20-\\x7E]/, // unprintable ASCII chars + non-ASCII chars\n\t\tregexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g, // RFC 3490 separators\n\t\n\t\t/** Error messages */\n\t\terrors = {\n\t\t\t'overflow': 'Overflow: input needs wider integers to process',\n\t\t\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t\t\t'invalid-input': 'Invalid input'\n\t\t},\n\t\n\t\t/** Convenience shortcuts */\n\t\tbaseMinusTMin = base - tMin,\n\t\tfloor = Math.floor,\n\t\tstringFromCharCode = String.fromCharCode,\n\t\n\t\t/** Temporary variable */\n\t\tkey;\n\t\n\t\t/*--------------------------------------------------------------------------*/\n\t\n\t\t/**\n\t\t * A generic error utility function.\n\t\t * @private\n\t\t * @param {String} type The error type.\n\t\t * @returns {Error} Throws a `RangeError` with the applicable error message.\n\t\t */\n\t\tfunction error(type) {\n\t\t\tthrow RangeError(errors[type]);\n\t\t}\n\t\n\t\t/**\n\t\t * A generic `Array#map` utility function.\n\t\t * @private\n\t\t * @param {Array} array The array to iterate over.\n\t\t * @param {Function} callback The function that gets called for every array\n\t\t * item.\n\t\t * @returns {Array} A new array of values returned by the callback function.\n\t\t */\n\t\tfunction map(array, fn) {\n\t\t\tvar length = array.length;\n\t\t\tvar result = [];\n\t\t\twhile (length--) {\n\t\t\t\tresult[length] = fn(array[length]);\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\n\t\t/**\n\t\t * A simple `Array#map`-like wrapper to work with domain name strings or email\n\t\t * addresses.\n\t\t * @private\n\t\t * @param {String} domain The domain name or email address.\n\t\t * @param {Function} callback The function that gets called for every\n\t\t * character.\n\t\t * @returns {Array} A new string of characters returned by the callback\n\t\t * function.\n\t\t */\n\t\tfunction mapDomain(string, fn) {\n\t\t\tvar parts = string.split('@');\n\t\t\tvar result = '';\n\t\t\tif (parts.length > 1) {\n\t\t\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t\t\t// the local part (i.e. everything up to `@`) intact.\n\t\t\t\tresult = parts[0] + '@';\n\t\t\t\tstring = parts[1];\n\t\t\t}\n\t\t\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\t\t\tstring = string.replace(regexSeparators, '\\x2E');\n\t\t\tvar labels = string.split('.');\n\t\t\tvar encoded = map(labels, fn).join('.');\n\t\t\treturn result + encoded;\n\t\t}\n\t\n\t\t/**\n\t\t * Creates an array containing the numeric code points of each Unicode\n\t\t * character in the string. While JavaScript uses UCS-2 internally,\n\t\t * this function will convert a pair of surrogate halves (each of which\n\t\t * UCS-2 exposes as separate characters) into a single code point,\n\t\t * matching UTF-16.\n\t\t * @see `punycode.ucs2.encode`\n\t\t * @see \n\t\t * @memberOf punycode.ucs2\n\t\t * @name decode\n\t\t * @param {String} string The Unicode input string (UCS-2).\n\t\t * @returns {Array} The new array of code points.\n\t\t */\n\t\tfunction ucs2decode(string) {\n\t\t\tvar output = [],\n\t\t\t counter = 0,\n\t\t\t length = string.length,\n\t\t\t value,\n\t\t\t extra;\n\t\t\twhile (counter < length) {\n\t\t\t\tvalue = string.charCodeAt(counter++);\n\t\t\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t\t\t// high surrogate, and there is a next character\n\t\t\t\t\textra = string.charCodeAt(counter++);\n\t\t\t\t\tif ((extra & 0xFC00) == 0xDC00) { // low surrogate\n\t\t\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// unmatched surrogate; only append this code unit, in case the next\n\t\t\t\t\t\t// code unit is the high surrogate of a surrogate pair\n\t\t\t\t\t\toutput.push(value);\n\t\t\t\t\t\tcounter--;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\toutput.push(value);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn output;\n\t\t}\n\t\n\t\t/**\n\t\t * Creates a string based on an array of numeric code points.\n\t\t * @see `punycode.ucs2.decode`\n\t\t * @memberOf punycode.ucs2\n\t\t * @name encode\n\t\t * @param {Array} codePoints The array of numeric code points.\n\t\t * @returns {String} The new Unicode string (UCS-2).\n\t\t */\n\t\tfunction ucs2encode(array) {\n\t\t\treturn map(array, function(value) {\n\t\t\t\tvar output = '';\n\t\t\t\tif (value > 0xFFFF) {\n\t\t\t\t\tvalue -= 0x10000;\n\t\t\t\t\toutput += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);\n\t\t\t\t\tvalue = 0xDC00 | value & 0x3FF;\n\t\t\t\t}\n\t\t\t\toutput += stringFromCharCode(value);\n\t\t\t\treturn output;\n\t\t\t}).join('');\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a basic code point into a digit/integer.\n\t\t * @see `digitToBasic()`\n\t\t * @private\n\t\t * @param {Number} codePoint The basic numeric code point value.\n\t\t * @returns {Number} The numeric value of a basic code point (for use in\n\t\t * representing integers) in the range `0` to `base - 1`, or `base` if\n\t\t * the code point does not represent a value.\n\t\t */\n\t\tfunction basicToDigit(codePoint) {\n\t\t\tif (codePoint - 48 < 10) {\n\t\t\t\treturn codePoint - 22;\n\t\t\t}\n\t\t\tif (codePoint - 65 < 26) {\n\t\t\t\treturn codePoint - 65;\n\t\t\t}\n\t\t\tif (codePoint - 97 < 26) {\n\t\t\t\treturn codePoint - 97;\n\t\t\t}\n\t\t\treturn base;\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a digit/integer into a basic code point.\n\t\t * @see `basicToDigit()`\n\t\t * @private\n\t\t * @param {Number} digit The numeric value of a basic code point.\n\t\t * @returns {Number} The basic code point whose value (when used for\n\t\t * representing integers) is `digit`, which needs to be in the range\n\t\t * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n\t\t * used; else, the lowercase form is used. The behavior is undefined\n\t\t * if `flag` is non-zero and `digit` has no uppercase form.\n\t\t */\n\t\tfunction digitToBasic(digit, flag) {\n\t\t\t// 0..25 map to ASCII a..z or A..Z\n\t\t\t// 26..35 map to ASCII 0..9\n\t\t\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n\t\t}\n\t\n\t\t/**\n\t\t * Bias adaptation function as per section 3.4 of RFC 3492.\n\t\t * http://tools.ietf.org/html/rfc3492#section-3.4\n\t\t * @private\n\t\t */\n\t\tfunction adapt(delta, numPoints, firstTime) {\n\t\t\tvar k = 0;\n\t\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\t\tdelta += floor(delta / numPoints);\n\t\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t\t}\n\t\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n\t\t * symbols.\n\t\t * @memberOf punycode\n\t\t * @param {String} input The Punycode string of ASCII-only symbols.\n\t\t * @returns {String} The resulting string of Unicode symbols.\n\t\t */\n\t\tfunction decode(input) {\n\t\t\t// Don't use UCS-2\n\t\t\tvar output = [],\n\t\t\t inputLength = input.length,\n\t\t\t out,\n\t\t\t i = 0,\n\t\t\t n = initialN,\n\t\t\t bias = initialBias,\n\t\t\t basic,\n\t\t\t j,\n\t\t\t index,\n\t\t\t oldi,\n\t\t\t w,\n\t\t\t k,\n\t\t\t digit,\n\t\t\t t,\n\t\t\t /** Cached calculation results */\n\t\t\t baseMinusT;\n\t\n\t\t\t// Handle the basic code points: let `basic` be the number of input code\n\t\t\t// points before the last delimiter, or `0` if there is none, then copy\n\t\t\t// the first basic code points to the output.\n\t\n\t\t\tbasic = input.lastIndexOf(delimiter);\n\t\t\tif (basic < 0) {\n\t\t\t\tbasic = 0;\n\t\t\t}\n\t\n\t\t\tfor (j = 0; j < basic; ++j) {\n\t\t\t\t// if it's not a basic code point\n\t\t\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\t\t\terror('not-basic');\n\t\t\t\t}\n\t\t\t\toutput.push(input.charCodeAt(j));\n\t\t\t}\n\t\n\t\t\t// Main decoding loop: start just after the last delimiter if any basic code\n\t\t\t// points were copied; start at the beginning otherwise.\n\t\n\t\t\tfor (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\t\n\t\t\t\t// `index` is the index of the next character to be consumed.\n\t\t\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t\t\t// which gets added to `i`. The overflow checking is easier\n\t\t\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t\t\t// value at the end to obtain `delta`.\n\t\t\t\tfor (oldi = i, w = 1, k = base; /* no condition */; k += base) {\n\t\n\t\t\t\t\tif (index >= inputLength) {\n\t\t\t\t\t\terror('invalid-input');\n\t\t\t\t\t}\n\t\n\t\t\t\t\tdigit = basicToDigit(input.charCodeAt(index++));\n\t\n\t\t\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\t\t\terror('overflow');\n\t\t\t\t\t}\n\t\n\t\t\t\t\ti += digit * w;\n\t\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\n\t\t\t\t\tif (digit < t) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tbaseMinusT = base - t;\n\t\t\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\t\t\terror('overflow');\n\t\t\t\t\t}\n\t\n\t\t\t\t\tw *= baseMinusT;\n\t\n\t\t\t\t}\n\t\n\t\t\t\tout = output.length + 1;\n\t\t\t\tbias = adapt(i - oldi, out, oldi == 0);\n\t\n\t\t\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t\t\t// incrementing `n` each time, so we'll fix that now:\n\t\t\t\tif (floor(i / out) > maxInt - n) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\t\n\t\t\t\tn += floor(i / out);\n\t\t\t\ti %= out;\n\t\n\t\t\t\t// Insert `n` at position `i` of the output\n\t\t\t\toutput.splice(i++, 0, n);\n\t\n\t\t\t}\n\t\n\t\t\treturn ucs2encode(output);\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a string of Unicode symbols (e.g. a domain name label) to a\n\t\t * Punycode string of ASCII-only symbols.\n\t\t * @memberOf punycode\n\t\t * @param {String} input The string of Unicode symbols.\n\t\t * @returns {String} The resulting Punycode string of ASCII-only symbols.\n\t\t */\n\t\tfunction encode(input) {\n\t\t\tvar n,\n\t\t\t delta,\n\t\t\t handledCPCount,\n\t\t\t basicLength,\n\t\t\t bias,\n\t\t\t j,\n\t\t\t m,\n\t\t\t q,\n\t\t\t k,\n\t\t\t t,\n\t\t\t currentValue,\n\t\t\t output = [],\n\t\t\t /** `inputLength` will hold the number of code points in `input`. */\n\t\t\t inputLength,\n\t\t\t /** Cached calculation results */\n\t\t\t handledCPCountPlusOne,\n\t\t\t baseMinusT,\n\t\t\t qMinusT;\n\t\n\t\t\t// Convert the input in UCS-2 to Unicode\n\t\t\tinput = ucs2decode(input);\n\t\n\t\t\t// Cache the length\n\t\t\tinputLength = input.length;\n\t\n\t\t\t// Initialize the state\n\t\t\tn = initialN;\n\t\t\tdelta = 0;\n\t\t\tbias = initialBias;\n\t\n\t\t\t// Handle the basic code points\n\t\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\t\tcurrentValue = input[j];\n\t\t\t\tif (currentValue < 0x80) {\n\t\t\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\thandledCPCount = basicLength = output.length;\n\t\n\t\t\t// `handledCPCount` is the number of code points that have been handled;\n\t\t\t// `basicLength` is the number of basic code points.\n\t\n\t\t\t// Finish the basic string - if it is not empty - with a delimiter\n\t\t\tif (basicLength) {\n\t\t\t\toutput.push(delimiter);\n\t\t\t}\n\t\n\t\t\t// Main encoding loop:\n\t\t\twhile (handledCPCount < inputLength) {\n\t\n\t\t\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t\t\t// larger one:\n\t\t\t\tfor (m = maxInt, j = 0; j < inputLength; ++j) {\n\t\t\t\t\tcurrentValue = input[j];\n\t\t\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\t\t\tm = currentValue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\t// Increase `delta` enough to advance the decoder's state to ,\n\t\t\t\t// but guard against overflow\n\t\t\t\thandledCPCountPlusOne = handledCPCount + 1;\n\t\t\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\t\n\t\t\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\t\t\tn = m;\n\t\n\t\t\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\t\t\tcurrentValue = input[j];\n\t\n\t\t\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\t\t\terror('overflow');\n\t\t\t\t\t}\n\t\n\t\t\t\t\tif (currentValue == n) {\n\t\t\t\t\t\t// Represent delta as a generalized variable-length integer\n\t\t\t\t\t\tfor (q = delta, k = base; /* no condition */; k += base) {\n\t\t\t\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tqMinusT = q - t;\n\t\t\t\t\t\t\tbaseMinusT = base - t;\n\t\t\t\t\t\t\toutput.push(\n\t\t\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\t\t\tdelta = 0;\n\t\t\t\t\t\t++handledCPCount;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\t++delta;\n\t\t\t\t++n;\n\t\n\t\t\t}\n\t\t\treturn output.join('');\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a Punycode string representing a domain name or an email address\n\t\t * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n\t\t * it doesn't matter if you call it on a string that has already been\n\t\t * converted to Unicode.\n\t\t * @memberOf punycode\n\t\t * @param {String} input The Punycoded domain name or email address to\n\t\t * convert to Unicode.\n\t\t * @returns {String} The Unicode representation of the given Punycode\n\t\t * string.\n\t\t */\n\t\tfunction toUnicode(input) {\n\t\t\treturn mapDomain(input, function(string) {\n\t\t\t\treturn regexPunycode.test(string)\n\t\t\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t\t\t: string;\n\t\t\t});\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a Unicode string representing a domain name or an email address to\n\t\t * Punycode. Only the non-ASCII parts of the domain name will be converted,\n\t\t * i.e. it doesn't matter if you call it with a domain that's already in\n\t\t * ASCII.\n\t\t * @memberOf punycode\n\t\t * @param {String} input The domain name or email address to convert, as a\n\t\t * Unicode string.\n\t\t * @returns {String} The Punycode representation of the given domain name or\n\t\t * email address.\n\t\t */\n\t\tfunction toASCII(input) {\n\t\t\treturn mapDomain(input, function(string) {\n\t\t\t\treturn regexNonASCII.test(string)\n\t\t\t\t\t? 'xn--' + encode(string)\n\t\t\t\t\t: string;\n\t\t\t});\n\t\t}\n\t\n\t\t/*--------------------------------------------------------------------------*/\n\t\n\t\t/** Define the public API */\n\t\tpunycode = {\n\t\t\t/**\n\t\t\t * A string representing the current Punycode.js version number.\n\t\t\t * @memberOf punycode\n\t\t\t * @type String\n\t\t\t */\n\t\t\t'version': '1.3.2',\n\t\t\t/**\n\t\t\t * An object of methods to convert from JavaScript's internal character\n\t\t\t * representation (UCS-2) to Unicode code points, and back.\n\t\t\t * @see \n\t\t\t * @memberOf punycode\n\t\t\t * @type Object\n\t\t\t */\n\t\t\t'ucs2': {\n\t\t\t\t'decode': ucs2decode,\n\t\t\t\t'encode': ucs2encode\n\t\t\t},\n\t\t\t'decode': decode,\n\t\t\t'encode': encode,\n\t\t\t'toASCII': toASCII,\n\t\t\t'toUnicode': toUnicode\n\t\t};\n\t\n\t\t/** Expose `punycode` */\n\t\t// Some AMD build optimizers, like r.js, check for specific condition patterns\n\t\t// like the following:\n\t\tif (\n\t\t\ttrue\n\t\t) {\n\t\t\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function() {\n\t\t\t\treturn punycode;\n\t\t\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t\t} else if (freeExports && freeModule) {\n\t\t\tif (module.exports == freeExports) { // in Node.js or RingoJS v0.8.0+\n\t\t\t\tfreeModule.exports = punycode;\n\t\t\t} else { // in Narwhal or RingoJS v0.7.0-\n\t\t\t\tfor (key in punycode) {\n\t\t\t\t\tpunycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]);\n\t\t\t\t}\n\t\t\t}\n\t\t} else { // in Rhino or a web browser\n\t\t\troot.punycode = punycode;\n\t\t}\n\t\n\t}(this));\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(18)(module), (function() { return this; }())))\n\n/***/ },\n/* 18 */\n/***/ function(module, exports) {\n\n\tmodule.exports = function(module) {\r\n\t\tif(!module.webpackPolyfill) {\r\n\t\t\tmodule.deprecate = function() {};\r\n\t\t\tmodule.paths = [];\r\n\t\t\t// module.parent = undefined by default\r\n\t\t\tmodule.children = [];\r\n\t\t\tmodule.webpackPolyfill = 1;\r\n\t\t}\r\n\t\treturn module;\r\n\t}\r\n\n\n/***/ },\n/* 19 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = {\n\t isString: function(arg) {\n\t return typeof(arg) === 'string';\n\t },\n\t isObject: function(arg) {\n\t return typeof(arg) === 'object' && arg !== null;\n\t },\n\t isNull: function(arg) {\n\t return arg === null;\n\t },\n\t isNullOrUndefined: function(arg) {\n\t return arg == null;\n\t }\n\t};\n\n\n/***/ },\n/* 20 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\texports.decode = exports.parse = __webpack_require__(21);\n\texports.encode = exports.stringify = __webpack_require__(22);\n\n\n/***/ },\n/* 21 */\n/***/ function(module, exports) {\n\n\t// Copyright Joyent, Inc. and other Node contributors.\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a\n\t// copy of this software and associated documentation files (the\n\t// \"Software\"), to deal in the Software without restriction, including\n\t// without limitation the rights to use, copy, modify, merge, publish,\n\t// distribute, sublicense, and/or sell copies of the Software, and to permit\n\t// persons to whom the Software is furnished to do so, subject to the\n\t// following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included\n\t// in all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n\t// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\t// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n\t// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n\t// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n\t// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n\t// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\t\n\t'use strict';\n\t\n\t// If obj.hasOwnProperty has been overridden, then calling\n\t// obj.hasOwnProperty(prop) will break.\n\t// See: https://github.com/joyent/node/issues/1707\n\tfunction hasOwnProperty(obj, prop) {\n\t return Object.prototype.hasOwnProperty.call(obj, prop);\n\t}\n\t\n\tmodule.exports = function(qs, sep, eq, options) {\n\t sep = sep || '&';\n\t eq = eq || '=';\n\t var obj = {};\n\t\n\t if (typeof qs !== 'string' || qs.length === 0) {\n\t return obj;\n\t }\n\t\n\t var regexp = /\\+/g;\n\t qs = qs.split(sep);\n\t\n\t var maxKeys = 1000;\n\t if (options && typeof options.maxKeys === 'number') {\n\t maxKeys = options.maxKeys;\n\t }\n\t\n\t var len = qs.length;\n\t // maxKeys <= 0 means that we should not limit keys count\n\t if (maxKeys > 0 && len > maxKeys) {\n\t len = maxKeys;\n\t }\n\t\n\t for (var i = 0; i < len; ++i) {\n\t var x = qs[i].replace(regexp, '%20'),\n\t idx = x.indexOf(eq),\n\t kstr, vstr, k, v;\n\t\n\t if (idx >= 0) {\n\t kstr = x.substr(0, idx);\n\t vstr = x.substr(idx + 1);\n\t } else {\n\t kstr = x;\n\t vstr = '';\n\t }\n\t\n\t k = decodeURIComponent(kstr);\n\t v = decodeURIComponent(vstr);\n\t\n\t if (!hasOwnProperty(obj, k)) {\n\t obj[k] = v;\n\t } else if (Array.isArray(obj[k])) {\n\t obj[k].push(v);\n\t } else {\n\t obj[k] = [obj[k], v];\n\t }\n\t }\n\t\n\t return obj;\n\t};\n\n\n/***/ },\n/* 22 */\n/***/ function(module, exports) {\n\n\t// Copyright Joyent, Inc. and other Node contributors.\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a\n\t// copy of this software and associated documentation files (the\n\t// \"Software\"), to deal in the Software without restriction, including\n\t// without limitation the rights to use, copy, modify, merge, publish,\n\t// distribute, sublicense, and/or sell copies of the Software, and to permit\n\t// persons to whom the Software is furnished to do so, subject to the\n\t// following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included\n\t// in all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n\t// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\t// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n\t// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n\t// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n\t// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n\t// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\t\n\t'use strict';\n\t\n\tvar stringifyPrimitive = function(v) {\n\t switch (typeof v) {\n\t case 'string':\n\t return v;\n\t\n\t case 'boolean':\n\t return v ? 'true' : 'false';\n\t\n\t case 'number':\n\t return isFinite(v) ? v : '';\n\t\n\t default:\n\t return '';\n\t }\n\t};\n\t\n\tmodule.exports = function(obj, sep, eq, name) {\n\t sep = sep || '&';\n\t eq = eq || '=';\n\t if (obj === null) {\n\t obj = undefined;\n\t }\n\t\n\t if (typeof obj === 'object') {\n\t return Object.keys(obj).map(function(k) {\n\t var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;\n\t if (Array.isArray(obj[k])) {\n\t return obj[k].map(function(v) {\n\t return ks + encodeURIComponent(stringifyPrimitive(v));\n\t }).join(sep);\n\t } else {\n\t return ks + encodeURIComponent(stringifyPrimitive(obj[k]));\n\t }\n\t }).join(sep);\n\t\n\t }\n\t\n\t if (!name) return '';\n\t return encodeURIComponent(stringifyPrimitive(name)) + eq +\n\t encodeURIComponent(stringifyPrimitive(obj));\n\t};\n\n\n/***/ },\n/* 23 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"id\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"description\": \"Core schema meta-schema\",\n\t\t\"definitions\": {\n\t\t\t\"schemaArray\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"minItems\": 1,\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"positiveInteger\": {\n\t\t\t\t\"type\": \"integer\",\n\t\t\t\t\"minimum\": 0\n\t\t\t},\n\t\t\t\"positiveIntegerDefault0\": {\n\t\t\t\t\"allOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#/definitions/positiveInteger\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"default\": 0\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"simpleTypes\": {\n\t\t\t\t\"enum\": [\n\t\t\t\t\t\"array\",\n\t\t\t\t\t\"boolean\",\n\t\t\t\t\t\"integer\",\n\t\t\t\t\t\"null\",\n\t\t\t\t\t\"number\",\n\t\t\t\t\t\"object\",\n\t\t\t\t\t\"string\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"stringArray\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t},\n\t\t\t\t\"minItems\": 1,\n\t\t\t\t\"uniqueItems\": true\n\t\t\t}\n\t\t},\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"id\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"uri\"\n\t\t\t},\n\t\t\t\"$schema\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"uri\"\n\t\t\t},\n\t\t\t\"title\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"description\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"default\": {},\n\t\t\t\"multipleOf\": {\n\t\t\t\t\"type\": \"number\",\n\t\t\t\t\"minimum\": 0,\n\t\t\t\t\"exclusiveMinimum\": true\n\t\t\t},\n\t\t\t\"maximum\": {\n\t\t\t\t\"type\": \"number\"\n\t\t\t},\n\t\t\t\"exclusiveMaximum\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"minimum\": {\n\t\t\t\t\"type\": \"number\"\n\t\t\t},\n\t\t\t\"exclusiveMinimum\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"maxLength\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveInteger\"\n\t\t\t},\n\t\t\t\"minLength\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveIntegerDefault0\"\n\t\t\t},\n\t\t\t\"pattern\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"regex\"\n\t\t\t},\n\t\t\t\"additionalItems\": {\n\t\t\t\t\"anyOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"boolean\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"items\": {\n\t\t\t\t\"anyOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#/definitions/schemaArray\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"maxItems\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveInteger\"\n\t\t\t},\n\t\t\t\"minItems\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveIntegerDefault0\"\n\t\t\t},\n\t\t\t\"uniqueItems\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"maxProperties\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveInteger\"\n\t\t\t},\n\t\t\t\"minProperties\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveIntegerDefault0\"\n\t\t\t},\n\t\t\t\"required\": {\n\t\t\t\t\"$ref\": \"#/definitions/stringArray\"\n\t\t\t},\n\t\t\t\"additionalProperties\": {\n\t\t\t\t\"anyOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"boolean\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"definitions\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": {\n\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t},\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"properties\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": {\n\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t},\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"patternProperties\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": {\n\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t},\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"dependencies\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": {\n\t\t\t\t\t\"anyOf\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"$ref\": \"#/definitions/stringArray\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"enum\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"minItems\": 1,\n\t\t\t\t\"uniqueItems\": true\n\t\t\t},\n\t\t\t\"type\": {\n\t\t\t\t\"anyOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#/definitions/simpleTypes\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"array\",\n\t\t\t\t\t\t\"items\": {\n\t\t\t\t\t\t\t\"$ref\": \"#/definitions/simpleTypes\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"minItems\": 1,\n\t\t\t\t\t\t\"uniqueItems\": true\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"allOf\": {\n\t\t\t\t\"$ref\": \"#/definitions/schemaArray\"\n\t\t\t},\n\t\t\t\"anyOf\": {\n\t\t\t\t\"$ref\": \"#/definitions/schemaArray\"\n\t\t\t},\n\t\t\t\"oneOf\": {\n\t\t\t\t\"$ref\": \"#/definitions/schemaArray\"\n\t\t\t},\n\t\t\t\"not\": {\n\t\t\t\t\"$ref\": \"#\"\n\t\t\t}\n\t\t},\n\t\t\"dependencies\": {\n\t\t\t\"exclusiveMaximum\": [\n\t\t\t\t\"maximum\"\n\t\t\t],\n\t\t\t\"exclusiveMinimum\": [\n\t\t\t\t\"minimum\"\n\t\t\t]\n\t\t},\n\t\t\"default\": {}\n\t};\n\n/***/ },\n/* 24 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tvar formats = {};\n\t\n\t// reference: http://dansnetwork.com/javascript-iso8601rfc3339-date-parser/\n\tformats['date-time'] = /(\\d\\d\\d\\d)(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))/;\n\t// reference: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js#L7\n\tformats.uri = /^([a-zA-Z][a-zA-Z0-9+-.]*:){0,1}\\/\\/[^\\s]*$/;\n\t// reference: http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363\n\t// http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'willful violation')\n\tformats.email = /^[a-zA-Z0-9.!#$%&'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n\t// reference: https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html\n\tformats.ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;\n\t// reference: http://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses\n\tformats.ipv6 = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|[fF][eE]80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::([fF]{4}(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;\n\t// reference: http://stackoverflow.com/questions/106179/regular-expression-to-match-dns-hostname-or-ip-address#answer-3824105\n\tformats.hostname = /^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])(\\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]))*$/;\n\t\n\tmodule.exports = formats;\n\n/***/ },\n/* 25 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\t// Reference: https://github.com/bestiejs/punycode.js/blob/master/punycode.js#L101`\n\t// Info: https://mathiasbynens.be/notes/javascript-unicode\n\tfunction ucs2length(string) {\n\t var ucs2len = 0,\n\t counter = 0,\n\t length = string.length,\n\t value, extra;\n\t\n\t while (counter < length) {\n\t ucs2len++;\n\t value = string.charCodeAt(counter++);\n\t\n\t if (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t // It's a high surrogate, and there is a next character.\n\t extra = string.charCodeAt(counter++);\n\t\n\t if ((extra & 0xFC00) !== 0xDC00) { /* Low surrogate. */ // jshint ignore: line\n\t counter--;\n\t }\n\t }\n\t }\n\t\n\t return ucs2len;\n\t}\n\t\n\tmodule.exports = ucs2length;\n\n/***/ }\n/******/ ])\n});\n;\n//# sourceMappingURL=models.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/powerbi-models/dist/models.js\n// module id = 5\n// module chunks = 0","import { IFilterable } from './ifilterable';\r\nimport { IReportNode } from './report';\r\nimport * as models from 'powerbi-models';\r\n\r\n/**\r\n * A Page node within a report hierarchy\r\n * \r\n * @export\r\n * @interface IPageNode\r\n */\r\nexport interface IPageNode {\r\n report: IReportNode;\r\n name: string;\r\n}\r\n\r\n/**\r\n * A Power BI report page\r\n * \r\n * @export\r\n * @class Page\r\n * @implements {IPageNode}\r\n * @implements {IFilterable}\r\n */\r\nexport class Page implements IPageNode, IFilterable {\r\n /**\r\n * The parent Power BI report that this page is a member of\r\n * \r\n * @type {IReportNode}\r\n */\r\n report: IReportNode;\r\n /**\r\n * The report page name\r\n * \r\n * @type {string}\r\n */\r\n name: string;\r\n\r\n /**\r\n * The user defined display name of the report page, which is undefined if the page is created manually\r\n * \r\n * @type {string}\r\n */\r\n displayName: string;\r\n\r\n /**\r\n * Creates an instance of a Power BI report page.\r\n * \r\n * @param {IReportNode} report\r\n * @param {string} name\r\n * @param {string} [displayName]\r\n */\r\n constructor(report: IReportNode, name: string, displayName?: string) {\r\n this.report = report;\r\n this.name = name;\r\n this.displayName = displayName;\r\n }\r\n\r\n /**\r\n * Gets all page level filters within the report.\r\n * \r\n * ```javascript\r\n * page.getFilters()\r\n * .then(pages => { ... });\r\n * ```\r\n * \r\n * @returns {(Promise)}\r\n */\r\n getFilters(): Promise {\r\n return this.report.service.hpm.get(`/report/pages/${this.name}/filters`, { uid: this.report.config.uniqueId }, this.report.iframe.contentWindow)\r\n .then(response => response.body,\r\n response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Removes all filters from this page of the report.\r\n * \r\n * ```javascript\r\n * page.removeFilters();\r\n * ```\r\n * \r\n * @returns {Promise}\r\n */\r\n removeFilters(): Promise {\r\n return this.setFilters([]);\r\n }\r\n\r\n /**\r\n * Makes the current page the active page of the report.\r\n * \r\n * ```javascripot\r\n * page.setActive();\r\n * ```\r\n * \r\n * @returns {Promise}\r\n */\r\n setActive(): Promise {\r\n const page: models.IPage = {\r\n name: this.name,\r\n displayName: null\r\n };\r\n\r\n return this.report.service.hpm.put('/report/pages/active', page, { uid: this.report.config.uniqueId }, this.report.iframe.contentWindow)\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Sets all filters on the current page.\r\n * \r\n * ```javascript\r\n * page.setFilters(filters);\r\n * .catch(errors => { ... });\r\n * ```\r\n * \r\n * @param {(models.IFilter[])} filters\r\n * @returns {Promise}\r\n */\r\n setFilters(filters: models.IFilter[]): Promise {\r\n return this.report.service.hpm.put(`/report/pages/${this.name}/filters`, filters, { uid: this.report.config.uniqueId }, this.report.iframe.contentWindow)\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/page.ts","import * as service from './service';\r\nimport * as models from 'powerbi-models';\r\nimport * as embed from './embed';\r\n\r\nexport class Create extends embed.Embed {\r\n\r\n constructor(service: service.Service, element: HTMLElement, config: embed.IEmbedConfiguration) {\r\n super(service, element, config);\r\n }\r\n\r\n /**\r\n * Gets the dataset ID from the first available location: createConfig or embed url.\r\n * \r\n * @returns {string}\r\n */\r\n getId(): string {\r\n const datasetId = (this.createConfig && this.createConfig.datasetId) ? this.createConfig.datasetId : Create.findIdFromEmbedUrl(this.config.embedUrl);\r\n\r\n if (typeof datasetId !== 'string' || datasetId.length === 0) {\r\n throw new Error('Dataset id is required, but it was not found. You must provide an id either as part of embed configuration.');\r\n }\r\n\r\n return datasetId;\r\n }\r\n\r\n /**\r\n * Validate create report configuration.\r\n */\r\n validate(config: models.IReportCreateConfiguration): models.IError[] {\r\n return models.validateCreateReport(config);\r\n }\r\n\r\n /**\r\n * Adds the ability to get datasetId from url. \r\n * (e.g. http://embedded.powerbi.com/appTokenReportEmbed?datasetId=854846ed-2106-4dc2-bc58-eb77533bf2f1).\r\n * \r\n * By extracting the ID we can ensure that the ID is always explicitly provided as part of the create configuration.\r\n * \r\n * @static\r\n * @param {string} url\r\n * @returns {string}\r\n */\r\n static findIdFromEmbedUrl(url: string): string {\r\n const datasetIdRegEx = /datasetId=\"?([^&]+)\"?/\r\n const datasetIdMatch = url.match(datasetIdRegEx);\r\n\r\n let datasetId;\r\n if (datasetIdMatch) {\r\n datasetId = datasetIdMatch[1];\r\n }\r\n\r\n return datasetId;\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/create.ts","import * as service from './service';\r\nimport * as embed from './embed';\r\nimport * as models from 'powerbi-models';\r\nimport * as wpmp from 'window-post-message-proxy';\r\nimport * as hpm from 'http-post-message';\r\nimport * as utils from './util';\r\n\r\n/**\r\n * A Dashboard node within a dashboard hierarchy\r\n * \r\n * @export\r\n * @interface IDashboardNode\r\n */\r\nexport interface IDashboardNode {\r\n iframe: HTMLIFrameElement;\r\n service: service.IService;\r\n config: embed.IInternalEmbedConfiguration\r\n}\r\n\r\n/**\r\n * A Power BI Dashboard embed component\r\n * \r\n * @export\r\n * @class Dashboard\r\n * @extends {embed.Embed}\r\n * @implements {IDashboardNode}\r\n * @implements {IFilterable}\r\n */\r\nexport class Dashboard extends embed.Embed implements IDashboardNode {\r\n static allowedEvents = [\"tileClicked\", \"error\"];\r\n static dashboardIdAttribute = 'powerbi-dashboard-id';\r\n static typeAttribute = 'powerbi-type';\r\n static type = \"Dashboard\";\r\n\r\n /**\r\n * Creates an instance of a Power BI Dashboard.\r\n * \r\n * @param {service.Service} service\r\n * @param {HTMLElement} element\r\n */\r\n constructor(service: service.Service, element: HTMLElement, config: embed.IEmbedConfiguration) {\r\n super(service, element, config);\r\n this.loadPath = \"/dashboard/load\";\r\n Array.prototype.push.apply(this.allowedEvents, Dashboard.allowedEvents);\r\n }\r\n\r\n /**\r\n * This adds backwards compatibility for older config which used the dashboardId query param to specify dashboard id.\r\n * E.g. https://powerbi-df.analysis-df.windows.net/dashboardEmbedHost?dashboardId=e9363c62-edb6-4eac-92d3-2199c5ca2a9e\r\n * \r\n * By extracting the id we can ensure id is always explicitly provided as part of the load configuration.\r\n * \r\n * @static\r\n * @param {string} url\r\n * @returns {string}\r\n */\r\n static findIdFromEmbedUrl(url: string): string {\r\n const dashboardIdRegEx = /dashboardId=\"?([^&]+)\"?/\r\n const dashboardIdMatch = url.match(dashboardIdRegEx);\r\n\r\n let dashboardId;\r\n if (dashboardIdMatch) {\r\n dashboardId = dashboardIdMatch[1];\r\n }\r\n\r\n return dashboardId;\r\n }\r\n\r\n /**\r\n * Get dashboard id from first available location: options, attribute, embed url.\r\n * \r\n * @returns {string}\r\n */\r\n getId(): string {\r\n const dashboardId = this.config.id || this.element.getAttribute(Dashboard.dashboardIdAttribute) || Dashboard.findIdFromEmbedUrl(this.config.embedUrl);\r\n\r\n if (typeof dashboardId !== 'string' || dashboardId.length === 0) {\r\n throw new Error(`Dashboard id is required, but it was not found. You must provide an id either as part of embed configuration or as attribute '${Dashboard.dashboardIdAttribute}'.`);\r\n }\r\n\r\n return dashboardId;\r\n }\r\n\r\n /**\r\n * Validate load configuration.\r\n */\r\n validate(config: models.IDashboardLoadConfiguration): models.IError[] {\r\n let error = models.validateDashboardLoad(config);\r\n return error ? error : this.ValidatePageView(config.pageView);\r\n }\r\n \r\n /**\r\n * Validate that pageView has a legal value: if page view is defined it must have one of the values defined in models.PageView\r\n */\r\n private ValidatePageView(pageView: models.PageView): models.IError[] {\r\n if (pageView && pageView !== \"fitToWidth\" && pageView !== \"oneColumn\" && pageView !== \"actualSize\") {\r\n return [{message: \"pageView must be one of the followings: fitToWidth, oneColumn, actualSize\"}];\r\n }\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/dashboard.ts","import * as models from 'powerbi-models';\r\nimport { Embed } from './embed';\r\n\r\n/**\r\n * The Power BI tile embed component\r\n * \r\n * @export\r\n * @class Tile\r\n * @extends {Embed}\r\n */\r\nexport class Tile extends Embed {\r\n static type = \"Tile\";\r\n\r\n /**\r\n * The ID of the tile\r\n * \r\n * @returns {string}\r\n */\r\n getId(): string {\r\n throw new Error('Not implemented. Embedding tiles is not supported yet.');\r\n }\r\n\r\n /**\r\n * Validate load configuration.\r\n */\r\n validate(config: any): models.IError[] {\r\n throw new Error('Not implemented. Embedding tiles is not supported yet.');\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/tile.ts","/**\r\n * TODO: Need to find better place for these factory functions or refactor how we handle dependency injection\r\n */\r\nimport { IHpmFactory, IWpmpFactory, IRouterFactory } from './service';\r\nimport config from './config';\r\nimport * as wpmp from 'window-post-message-proxy';\r\nimport * as hpm from 'http-post-message';\r\nimport * as router from 'powerbi-router';\r\n\r\nexport {\r\n IHpmFactory,\r\n IWpmpFactory,\r\n IRouterFactory\r\n};\r\n\r\nexport const hpmFactory: IHpmFactory = (wpmp, defaultTargetWindow, sdkVersion = config.version, sdkType = config.type) => {\r\n return new hpm.HttpPostMessage(wpmp, {\r\n 'x-sdk-type': sdkType,\r\n 'x-sdk-version': sdkVersion\r\n }, defaultTargetWindow);\r\n};\r\n\r\nexport const wpmpFactory: IWpmpFactory = (name?: string, logMessages?: boolean, eventSourceOverrideWindow?: Window) => {\r\n return new wpmp.WindowPostMessageProxy({\r\n processTrackingProperties: {\r\n addTrackingProperties: hpm.HttpPostMessage.addTrackingProperties,\r\n getTrackingProperties: hpm.HttpPostMessage.getTrackingProperties,\r\n },\r\n isErrorMessage: hpm.HttpPostMessage.isErrorMessage,\r\n name,\r\n logMessages,\r\n eventSourceOverrideWindow\r\n });\r\n};\r\n\r\nexport const routerFactory: IRouterFactory = (wpmp) => {\r\n return new router.Router(wpmp);\r\n};\n\n\n// WEBPACK FOOTER //\n// ./src/factories.ts","const config = {\r\n version: '2.2.3',\r\n type: 'js'\r\n};\r\n\r\nexport default config;\n\n\n// WEBPACK FOOTER //\n// ./src/config.ts","/*! window-post-message-proxy v0.2.4 | (c) 2016 Microsoft Corporation MIT */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"window-post-message-proxy\"] = factory();\n\telse\n\t\troot[\"window-post-message-proxy\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\tvar WindowPostMessageProxy = (function () {\n\t function WindowPostMessageProxy(options) {\n\t var _this = this;\n\t if (options === void 0) { options = {\n\t processTrackingProperties: {\n\t addTrackingProperties: WindowPostMessageProxy.defaultAddTrackingProperties,\n\t getTrackingProperties: WindowPostMessageProxy.defaultGetTrackingProperties\n\t },\n\t isErrorMessage: WindowPostMessageProxy.defaultIsErrorMessage,\n\t receiveWindow: window,\n\t name: WindowPostMessageProxy.createRandomString()\n\t }; }\n\t this.pendingRequestPromises = {};\n\t // save options with defaults\n\t this.addTrackingProperties = (options.processTrackingProperties && options.processTrackingProperties.addTrackingProperties) || WindowPostMessageProxy.defaultAddTrackingProperties;\n\t this.getTrackingProperties = (options.processTrackingProperties && options.processTrackingProperties.getTrackingProperties) || WindowPostMessageProxy.defaultGetTrackingProperties;\n\t this.isErrorMessage = options.isErrorMessage || WindowPostMessageProxy.defaultIsErrorMessage;\n\t this.receiveWindow = options.receiveWindow || window;\n\t this.name = options.name || WindowPostMessageProxy.createRandomString();\n\t this.logMessages = options.logMessages || false;\n\t this.eventSourceOverrideWindow = options.eventSourceOverrideWindow;\n\t this.suppressWarnings = options.suppressWarnings || false;\n\t if (this.logMessages) {\n\t console.log(\"new WindowPostMessageProxy created with name: \" + this.name + \" receiving on window: \" + this.receiveWindow.document.title);\n\t }\n\t // Initialize\n\t this.handlers = [];\n\t this.windowMessageHandler = function (event) { return _this.onMessageReceived(event); };\n\t this.start();\n\t }\n\t // Static\n\t WindowPostMessageProxy.defaultAddTrackingProperties = function (message, trackingProperties) {\n\t message[WindowPostMessageProxy.messagePropertyName] = trackingProperties;\n\t return message;\n\t };\n\t WindowPostMessageProxy.defaultGetTrackingProperties = function (message) {\n\t return message[WindowPostMessageProxy.messagePropertyName];\n\t };\n\t WindowPostMessageProxy.defaultIsErrorMessage = function (message) {\n\t return !!message.error;\n\t };\n\t /**\n\t * Utility to create a deferred object.\n\t */\n\t // TODO: Look to use RSVP library instead of doing this manually.\n\t // From what I searched RSVP would work better because it has .finally and .deferred; however, it doesn't have Typings information. \n\t WindowPostMessageProxy.createDeferred = function () {\n\t var deferred = {\n\t resolve: null,\n\t reject: null,\n\t promise: null\n\t };\n\t var promise = new Promise(function (resolve, reject) {\n\t deferred.resolve = resolve;\n\t deferred.reject = reject;\n\t });\n\t deferred.promise = promise;\n\t return deferred;\n\t };\n\t /**\n\t * Utility to generate random sequence of characters used as tracking id for promises.\n\t */\n\t WindowPostMessageProxy.createRandomString = function () {\n\t return (Math.random() + 1).toString(36).substring(7);\n\t };\n\t /**\n\t * Adds handler.\n\t * If the first handler whose test method returns true will handle the message and provide a response.\n\t */\n\t WindowPostMessageProxy.prototype.addHandler = function (handler) {\n\t this.handlers.push(handler);\n\t };\n\t /**\n\t * Removes handler.\n\t * The reference must match the original object that was provided when adding the handler.\n\t */\n\t WindowPostMessageProxy.prototype.removeHandler = function (handler) {\n\t var handlerIndex = this.handlers.indexOf(handler);\n\t if (handlerIndex === -1) {\n\t throw new Error(\"You attempted to remove a handler but no matching handler was found.\");\n\t }\n\t this.handlers.splice(handlerIndex, 1);\n\t };\n\t /**\n\t * Start listening to message events.\n\t */\n\t WindowPostMessageProxy.prototype.start = function () {\n\t this.receiveWindow.addEventListener('message', this.windowMessageHandler);\n\t };\n\t /**\n\t * Stops listening to message events.\n\t */\n\t WindowPostMessageProxy.prototype.stop = function () {\n\t this.receiveWindow.removeEventListener('message', this.windowMessageHandler);\n\t };\n\t /**\n\t * Post message to target window with tracking properties added and save deferred object referenced by tracking id.\n\t */\n\t WindowPostMessageProxy.prototype.postMessage = function (targetWindow, message) {\n\t // Add tracking properties to indicate message came from this proxy\n\t var trackingProperties = { id: WindowPostMessageProxy.createRandomString() };\n\t this.addTrackingProperties(message, trackingProperties);\n\t if (this.logMessages) {\n\t console.log(this.name + \" Posting message:\");\n\t console.log(JSON.stringify(message, null, ' '));\n\t }\n\t targetWindow.postMessage(message, \"*\");\n\t var deferred = WindowPostMessageProxy.createDeferred();\n\t this.pendingRequestPromises[trackingProperties.id] = deferred;\n\t return deferred.promise;\n\t };\n\t /**\n\t * Send response message to target window.\n\t * Response messages re-use tracking properties from a previous request message.\n\t */\n\t WindowPostMessageProxy.prototype.sendResponse = function (targetWindow, message, trackingProperties) {\n\t this.addTrackingProperties(message, trackingProperties);\n\t if (this.logMessages) {\n\t console.log(this.name + \" Sending response:\");\n\t console.log(JSON.stringify(message, null, ' '));\n\t }\n\t targetWindow.postMessage(message, \"*\");\n\t };\n\t /**\n\t * Message handler.\n\t */\n\t WindowPostMessageProxy.prototype.onMessageReceived = function (event) {\n\t var _this = this;\n\t if (this.logMessages) {\n\t console.log(this.name + \" Received message:\");\n\t console.log(\"type: \" + event.type);\n\t console.log(JSON.stringify(event.data, null, ' '));\n\t }\n\t var sendingWindow = this.eventSourceOverrideWindow || event.source;\n\t var message = event.data;\n\t if (typeof message !== \"object\") {\n\t if (!this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + this.name + \"): Received message that was not an object. Discarding message\");\n\t }\n\t return;\n\t }\n\t var trackingProperties;\n\t try {\n\t trackingProperties = this.getTrackingProperties(message);\n\t }\n\t catch (e) {\n\t if (!this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + this.name + \"): Error occurred when attempting to get tracking properties from incoming message:\", JSON.stringify(message, null, ' '), \"Error: \", e);\n\t }\n\t }\n\t var deferred;\n\t if (trackingProperties) {\n\t deferred = this.pendingRequestPromises[trackingProperties.id];\n\t }\n\t // If message does not have a known ID, treat it as a request\n\t // Otherwise, treat message as response\n\t if (!deferred) {\n\t var handled = this.handlers.some(function (handler) {\n\t var canMessageBeHandled = false;\n\t try {\n\t canMessageBeHandled = handler.test(message);\n\t }\n\t catch (e) {\n\t if (!_this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + _this.name + \"): Error occurred when handler was testing incoming message:\", JSON.stringify(message, null, ' '), \"Error: \", e);\n\t }\n\t }\n\t if (canMessageBeHandled) {\n\t var responseMessagePromise = void 0;\n\t try {\n\t responseMessagePromise = Promise.resolve(handler.handle(message));\n\t }\n\t catch (e) {\n\t if (!_this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + _this.name + \"): Error occurred when handler was processing incoming message:\", JSON.stringify(message, null, ' '), \"Error: \", e);\n\t }\n\t responseMessagePromise = Promise.resolve();\n\t }\n\t responseMessagePromise\n\t .then(function (responseMessage) {\n\t if (!responseMessage) {\n\t var warningMessage = \"Handler for message: \" + JSON.stringify(message, null, ' ') + \" did not return a response message. The default response message will be returned instead.\";\n\t if (!_this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + _this.name + \"): \" + warningMessage);\n\t }\n\t responseMessage = {\n\t warning: warningMessage\n\t };\n\t }\n\t _this.sendResponse(sendingWindow, responseMessage, trackingProperties);\n\t });\n\t return true;\n\t }\n\t });\n\t /**\n\t * TODO: Consider returning an error message if nothing handled the message.\n\t * In the case of the Report receiving messages all of them should be handled,\n\t * however, in the case of the SDK receiving messages it's likely it won't register handlers\n\t * for all events. Perhaps make this an option at construction time.\n\t */\n\t if (!handled && !this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + this.name + \") did not handle message. Handlers: \" + this.handlers.length + \" Message: \" + JSON.stringify(message, null, '') + \".\");\n\t }\n\t }\n\t else {\n\t /**\n\t * If error message reject promise,\n\t * Otherwise, resolve promise\n\t */\n\t var isErrorMessage = true;\n\t try {\n\t isErrorMessage = this.isErrorMessage(message);\n\t }\n\t catch (e) {\n\t console.warn(\"Proxy(\" + this.name + \") Error occurred when trying to determine if message is consider an error response. Message: \", JSON.stringify(message, null, ''), 'Error: ', e);\n\t }\n\t if (isErrorMessage) {\n\t deferred.reject(message);\n\t }\n\t else {\n\t deferred.resolve(message);\n\t }\n\t // TODO: Move to .finally clause up where promise is created for better maitenance like original proxy code.\n\t delete this.pendingRequestPromises[trackingProperties.id];\n\t }\n\t };\n\t WindowPostMessageProxy.messagePropertyName = \"windowPostMessageProxy\";\n\t return WindowPostMessageProxy;\n\t}());\n\texports.WindowPostMessageProxy = WindowPostMessageProxy;\n\n\n/***/ }\n/******/ ])\n});\n;\n//# sourceMappingURL=windowPostMessageProxy.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/window-post-message-proxy/dist/windowPostMessageProxy.js\n// module id = 12\n// module chunks = 0","/*! http-post-message v0.2.3 | (c) 2016 Microsoft Corporation MIT */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"http-post-message\"] = factory();\n\telse\n\t\troot[\"http-post-message\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\tvar HttpPostMessage = (function () {\n\t function HttpPostMessage(windowPostMessageProxy, defaultHeaders, defaultTargetWindow) {\n\t if (defaultHeaders === void 0) { defaultHeaders = {}; }\n\t this.defaultHeaders = defaultHeaders;\n\t this.defaultTargetWindow = defaultTargetWindow;\n\t this.windowPostMessageProxy = windowPostMessageProxy;\n\t }\n\t // TODO: See if it's possible to share tracking properties interface?\n\t // The responsibility of knowing how to configure windowPostMessageProxy for http should\n\t // live in this http class, but the configuration would need ITrackingProperties\n\t // interface which lives in WindowPostMessageProxy. Use type as workaround\n\t HttpPostMessage.addTrackingProperties = function (message, trackingProperties) {\n\t message.headers = message.headers || {};\n\t if (trackingProperties && trackingProperties.id) {\n\t message.headers.id = trackingProperties.id;\n\t }\n\t return message;\n\t };\n\t HttpPostMessage.getTrackingProperties = function (message) {\n\t return {\n\t id: message.headers && message.headers.id\n\t };\n\t };\n\t HttpPostMessage.isErrorMessage = function (message) {\n\t if (typeof (message && message.statusCode) !== 'number') {\n\t return false;\n\t }\n\t return !(200 <= message.statusCode && message.statusCode < 300);\n\t };\n\t HttpPostMessage.prototype.get = function (url, headers, targetWindow) {\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"GET\",\n\t url: url,\n\t headers: headers\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.post = function (url, body, headers, targetWindow) {\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"POST\",\n\t url: url,\n\t headers: headers,\n\t body: body\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.put = function (url, body, headers, targetWindow) {\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"PUT\",\n\t url: url,\n\t headers: headers,\n\t body: body\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.patch = function (url, body, headers, targetWindow) {\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"PATCH\",\n\t url: url,\n\t headers: headers,\n\t body: body\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.delete = function (url, body, headers, targetWindow) {\n\t if (body === void 0) { body = null; }\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"DELETE\",\n\t url: url,\n\t headers: headers,\n\t body: body\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.send = function (request, targetWindow) {\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t request.headers = this.assign({}, this.defaultHeaders, request.headers);\n\t if (!targetWindow) {\n\t throw new Error(\"target window is not provided. You must either provide the target window explicitly as argument to request, or specify default target window when constructing instance of this class.\");\n\t }\n\t return this.windowPostMessageProxy.postMessage(targetWindow, request);\n\t };\n\t /**\n\t * Object.assign() polyfill\n\t * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\n\t */\n\t HttpPostMessage.prototype.assign = function (target) {\n\t var sources = [];\n\t for (var _i = 1; _i < arguments.length; _i++) {\n\t sources[_i - 1] = arguments[_i];\n\t }\n\t if (target === undefined || target === null) {\n\t throw new TypeError('Cannot convert undefined or null to object');\n\t }\n\t var output = Object(target);\n\t sources.forEach(function (source) {\n\t if (source !== undefined && source !== null) {\n\t for (var nextKey in source) {\n\t if (Object.prototype.hasOwnProperty.call(source, nextKey)) {\n\t output[nextKey] = source[nextKey];\n\t }\n\t }\n\t }\n\t });\n\t return output;\n\t };\n\t return HttpPostMessage;\n\t}());\n\texports.HttpPostMessage = HttpPostMessage;\n\n\n/***/ }\n/******/ ])\n});\n;\n//# sourceMappingURL=httpPostMessage.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/http-post-message/dist/httpPostMessage.js\n// module id = 13\n// module chunks = 0","/*! powerbi-router v0.1.5 | (c) 2016 Microsoft Corporation MIT */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"powerbi-router\"] = factory();\n\telse\n\t\troot[\"powerbi-router\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar RouteRecognizer = __webpack_require__(1);\n\tvar Router = (function () {\n\t function Router(handlers) {\n\t this.handlers = handlers;\n\t /**\n\t * TODO: look at generating the router dynamically based on list of supported http methods\n\t * instead of hardcoding the creation of these and the methods.\n\t */\n\t this.getRouteRecognizer = new RouteRecognizer();\n\t this.patchRouteRecognizer = new RouteRecognizer();\n\t this.postRouteRecognizer = new RouteRecognizer();\n\t this.putRouteRecognizer = new RouteRecognizer();\n\t this.deleteRouteRecognizer = new RouteRecognizer();\n\t }\n\t Router.prototype.get = function (url, handler) {\n\t this.registerHandler(this.getRouteRecognizer, \"GET\", url, handler);\n\t return this;\n\t };\n\t Router.prototype.patch = function (url, handler) {\n\t this.registerHandler(this.patchRouteRecognizer, \"PATCH\", url, handler);\n\t return this;\n\t };\n\t Router.prototype.post = function (url, handler) {\n\t this.registerHandler(this.postRouteRecognizer, \"POST\", url, handler);\n\t return this;\n\t };\n\t Router.prototype.put = function (url, handler) {\n\t this.registerHandler(this.putRouteRecognizer, \"PUT\", url, handler);\n\t return this;\n\t };\n\t Router.prototype.delete = function (url, handler) {\n\t this.registerHandler(this.deleteRouteRecognizer, \"DELETE\", url, handler);\n\t return this;\n\t };\n\t /**\n\t * TODO: This method could use some refactoring. There is conflict of interest between keeping clean separation of test and handle method\n\t * Test method only returns boolean indicating if request can be handled, and handle method has opportunity to modify response and return promise of it.\n\t * In the case of the router with route-recognizer where handlers are associated with routes, this already guarantees that only one handler is selected and makes the test method feel complicated\n\t * Will leave as is an investigate cleaner ways at later time.\n\t */\n\t Router.prototype.registerHandler = function (routeRecognizer, method, url, handler) {\n\t var routeRecognizerHandler = function (request) {\n\t var response = new Response();\n\t return Promise.resolve(handler(request, response))\n\t .then(function (x) { return response; });\n\t };\n\t routeRecognizer.add([\n\t { path: url, handler: routeRecognizerHandler }\n\t ]);\n\t var internalHandler = {\n\t test: function (request) {\n\t if (request.method !== method) {\n\t return false;\n\t }\n\t var matchingRoutes = routeRecognizer.recognize(request.url);\n\t if (matchingRoutes === undefined) {\n\t return false;\n\t }\n\t /**\n\t * Copy parameters from recognized route to the request so they can be used within the handler function\n\t * This isn't ideal because it is side affect which modifies the request instead of strictly testing for true or false\n\t * but I don't see a better place to put this. If we move it between the call to test and the handle it becomes part of the window post message proxy\n\t * even though it's responsibility is related to routing.\n\t */\n\t var route = matchingRoutes[0];\n\t request.params = route.params;\n\t request.queryParams = matchingRoutes.queryParams;\n\t request.handler = route.handler;\n\t return true;\n\t },\n\t handle: function (request) {\n\t return request.handler(request);\n\t }\n\t };\n\t this.handlers.addHandler(internalHandler);\n\t };\n\t return Router;\n\t}());\n\texports.Router = Router;\n\tvar Response = (function () {\n\t function Response() {\n\t this.statusCode = 200;\n\t this.headers = {};\n\t this.body = null;\n\t }\n\t Response.prototype.send = function (statusCode, body) {\n\t this.statusCode = statusCode;\n\t this.body = body;\n\t };\n\t return Response;\n\t}());\n\texports.Response = Response;\n\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(module) {(function() {\n\t \"use strict\";\n\t function $$route$recognizer$dsl$$Target(path, matcher, delegate) {\n\t this.path = path;\n\t this.matcher = matcher;\n\t this.delegate = delegate;\n\t }\n\t\n\t $$route$recognizer$dsl$$Target.prototype = {\n\t to: function(target, callback) {\n\t var delegate = this.delegate;\n\t\n\t if (delegate && delegate.willAddRoute) {\n\t target = delegate.willAddRoute(this.matcher.target, target);\n\t }\n\t\n\t this.matcher.add(this.path, target);\n\t\n\t if (callback) {\n\t if (callback.length === 0) { throw new Error(\"You must have an argument in the function passed to `to`\"); }\n\t this.matcher.addChild(this.path, target, callback, this.delegate);\n\t }\n\t return this;\n\t }\n\t };\n\t\n\t function $$route$recognizer$dsl$$Matcher(target) {\n\t this.routes = {};\n\t this.children = {};\n\t this.target = target;\n\t }\n\t\n\t $$route$recognizer$dsl$$Matcher.prototype = {\n\t add: function(path, handler) {\n\t this.routes[path] = handler;\n\t },\n\t\n\t addChild: function(path, target, callback, delegate) {\n\t var matcher = new $$route$recognizer$dsl$$Matcher(target);\n\t this.children[path] = matcher;\n\t\n\t var match = $$route$recognizer$dsl$$generateMatch(path, matcher, delegate);\n\t\n\t if (delegate && delegate.contextEntered) {\n\t delegate.contextEntered(target, match);\n\t }\n\t\n\t callback(match);\n\t }\n\t };\n\t\n\t function $$route$recognizer$dsl$$generateMatch(startingPath, matcher, delegate) {\n\t return function(path, nestedCallback) {\n\t var fullPath = startingPath + path;\n\t\n\t if (nestedCallback) {\n\t nestedCallback($$route$recognizer$dsl$$generateMatch(fullPath, matcher, delegate));\n\t } else {\n\t return new $$route$recognizer$dsl$$Target(startingPath + path, matcher, delegate);\n\t }\n\t };\n\t }\n\t\n\t function $$route$recognizer$dsl$$addRoute(routeArray, path, handler) {\n\t var len = 0;\n\t for (var i=0; i z`. For instance, \"199\" is smaller\n\t // then \"200\", even though \"y\" and \"z\" (which are both 9) are larger than \"0\" (the value\n\t // of (`b` and `c`). This is because the leading symbol, \"2\", is larger than the other\n\t // leading symbol, \"1\".\n\t // The rule is that symbols to the left carry more weight than symbols to the right\n\t // when a number is written out as a string. In the above strings, the leading digit\n\t // represents how many 100's are in the number, and it carries more weight than the middle\n\t // number which represents how many 10's are in the number.\n\t // This system of number magnitude works well for route specificity, too. A route written as\n\t // `a/b/c` will be more specific than `x/y/z` as long as `a` is more specific than\n\t // `x`, irrespective of the other parts.\n\t // Because of this similarity, we assign each type of segment a number value written as a\n\t // string. We can find the specificity of compound routes by concatenating these strings\n\t // together, from left to right. After we have looped through all of the segments,\n\t // we convert the string to a number.\n\t specificity.val = '';\n\t\n\t for (var i=0; i 2 && key.slice(keyLength -2) === '[]') {\n\t isArray = true;\n\t key = key.slice(0, keyLength - 2);\n\t if(!queryParams[key]) {\n\t queryParams[key] = [];\n\t }\n\t }\n\t value = pair[1] ? $$route$recognizer$$decodeQueryParamPart(pair[1]) : '';\n\t }\n\t if (isArray) {\n\t queryParams[key].push(value);\n\t } else {\n\t queryParams[key] = value;\n\t }\n\t }\n\t return queryParams;\n\t },\n\t\n\t recognize: function(path) {\n\t var states = [ this.rootState ],\n\t pathLen, i, l, queryStart, queryParams = {},\n\t isSlashDropped = false;\n\t\n\t queryStart = path.indexOf('?');\n\t if (queryStart !== -1) {\n\t var queryString = path.substr(queryStart + 1, path.length);\n\t path = path.substr(0, queryStart);\n\t queryParams = this.parseQueryString(queryString);\n\t }\n\t\n\t path = decodeURI(path);\n\t\n\t if (path.charAt(0) !== \"/\") { path = \"/\" + path; }\n\t\n\t pathLen = path.length;\n\t if (pathLen > 1 && path.charAt(pathLen - 1) === \"/\") {\n\t path = path.substr(0, pathLen - 1);\n\t isSlashDropped = true;\n\t }\n\t\n\t for (i=0; i {\n type: string;\n id: string;\n name: string;\n value: T;\n}\n\nexport interface ICustomEvent extends CustomEvent {\n detail: T;\n}\n\nexport interface IEventHandler {\n (event: ICustomEvent): any;\n}\n\nexport interface IHpmFactory {\n (wpmp: wpmp.WindowPostMessageProxy, targetWindow?: Window, version?: string, type?: string, origin?: string): hpm.HttpPostMessage;\n}\n\nexport interface IWpmpFactory {\n (name?: string, logMessages?: boolean, eventSourceOverrideWindow?: Window): wpmp.WindowPostMessageProxy;\n}\n\nexport interface IRouterFactory {\n (wpmp: wpmp.WindowPostMessageProxy): router.Router;\n}\n\nexport interface IPowerBiElement extends HTMLElement {\n powerBiEmbed: embed.Embed;\n}\n\nexport interface IDebugOptions {\n logMessages?: boolean;\n wpmpName?: string;\n}\n\nexport interface IServiceConfiguration extends IDebugOptions {\n autoEmbedOnContentLoaded?: boolean;\n onError?: (error: any) => any;\n version?: string;\n type?: string;\n}\n\nexport interface IService {\n hpm: hpm.HttpPostMessage;\n}\n\n/**\n * The Power BI Service embed component, which is the entry point to embed all other Power BI components into your application\n * \n * @export\n * @class Service\n * @implements {IService}\n */\nexport class Service implements IService {\n\n /**\n * A list of components that this service can embed\n */\n private static components: (typeof Report | typeof Tile | typeof Dashboard)[] = [\n Tile,\n Report,\n Dashboard\n ];\n\n /**\n * The default configuration for the service\n */\n private static defaultConfig: IServiceConfiguration = {\n autoEmbedOnContentLoaded: false,\n onError: (...args) => console.log(args[0], args.slice(1))\n };\n\n /**\n * Gets or sets the access token as the global fallback token to use when a local token is not provided for a report or tile.\n * \n * @type {string}\n */\n accessToken: string;\n\n /**The Configuration object for the service*/\n private config: IServiceConfiguration;\n\n /** A list of Dashboard, Report and Tile components that have been embedded using this service instance. */\n private embeds: embed.Embed[];\n /** TODO: Look for way to make hpm private without sacraficing ease of maitenance. This should be private but in embed needs to call methods. */\n hpm: hpm.HttpPostMessage;\n /** TODO: Look for way to make wpmp private. This is only public to allow stopping the wpmp in tests */\n wpmp: wpmp.WindowPostMessageProxy;\n private router: router.Router;\n\n /**\n * Creates an instance of a Power BI Service.\n * \n * @param {IHpmFactory} hpmFactory The http post message factory used in the postMessage communication layer\n * @param {IWpmpFactory} wpmpFactory The window post message factory used in the postMessage communication layer\n * @param {IRouterFactory} routerFactory The router factory used in the postMessage communication layer\n * @param {IServiceConfiguration} [config={}]\n */\n constructor(hpmFactory: IHpmFactory, wpmpFactory: IWpmpFactory, routerFactory: IRouterFactory, config: IServiceConfiguration = {}) {\n this.wpmp = wpmpFactory(config.wpmpName, config.logMessages);\n this.hpm = hpmFactory(this.wpmp, null, config.version, config.type);\n this.router = routerFactory(this.wpmp);\n\n /**\n * Adds handler for report events.\n */\n this.router.post(`/reports/:uniqueId/events/:eventName`, (req, res) => {\n const event: IEvent = {\n type: 'report',\n id: req.params.uniqueId,\n name: req.params.eventName,\n value: req.body\n };\n\n this.handleEvent(event);\n });\n this.router.post(`/reports/:uniqueId/pages/:pageName/events/:eventName`, (req, res) => {\n const event: IEvent = {\n type: 'report',\n id: req.params.uniqueId,\n name: req.params.eventName,\n value: req.body\n };\n\n this.handleEvent(event);\n });\n\n this.router.post(`/dashboards/:uniqueId/events/:eventName`, (req, res) => {\n const event: IEvent = {\n type: 'dashboard',\n id: req.params.uniqueId,\n name: req.params.eventName,\n value: req.body\n };\n\n this.handleEvent(event);\n });\n\n this.embeds = [];\n\n // TODO: Change when Object.assign is available.\n this.config = utils.assign({}, Service.defaultConfig, config);\n\n if (this.config.autoEmbedOnContentLoaded) {\n this.enableAutoEmbed();\n }\n }\n\n /**\n * Creates new report\n * @param {HTMLElement} element\n * @param {embed.IEmbedConfiguration} [config={}]\n * @returns {embed.Embed}\n */\n createReport(element: HTMLElement, config: embed.IEmbedConfiguration): embed.Embed {\n config.type = 'create';\n let powerBiElement = element;\n const component = new Create(this, powerBiElement, config);\n powerBiElement.powerBiEmbed = component;\n this.embeds.push(component);\n\n return component;\n }\n\n /**\n * TODO: Add a description here\n * \n * @param {HTMLElement} [container]\n * @param {embed.IEmbedConfiguration} [config=undefined]\n * @returns {embed.Embed[]}\n */\n init(container?: HTMLElement, config: embed.IEmbedConfiguration = undefined): embed.Embed[] {\n container = (container && container instanceof HTMLElement) ? container : document.body;\n\n const elements = Array.prototype.slice.call(container.querySelectorAll(`[${embed.Embed.embedUrlAttribute}]`));\n return elements.map(element => this.embed(element, config));\n }\n\n /**\n * Given a configuration based on an HTML element,\n * if the component has already been created and attached to the element, reuses the component instance and existing iframe,\n * otherwise creates a new component instance.\n * \n * @param {HTMLElement} element\n * @param {embed.IEmbedConfiguration} [config={}]\n * @returns {embed.Embed}\n */\n embed(element: HTMLElement, config: embed.IEmbedConfiguration = {}): embed.Embed {\n let component: embed.Embed;\n let powerBiElement = element;\n\n if (powerBiElement.powerBiEmbed) {\n component = this.embedExisting(powerBiElement, config);\n }\n else {\n component = this.embedNew(powerBiElement, config);\n }\n\n return component;\n }\n\n /**\n * Given a configuration based on a Power BI element, saves the component instance that reference the element for later lookup.\n * \n * @private\n * @param {IPowerBiElement} element\n * @param {embed.IEmbedConfiguration} config\n * @returns {embed.Embed}\n */\n private embedNew(element: IPowerBiElement, config: embed.IEmbedConfiguration): embed.Embed {\n const componentType = config.type || element.getAttribute(embed.Embed.typeAttribute);\n if (!componentType) {\n throw new Error(`Attempted to embed using config ${JSON.stringify(config)} on element ${element.outerHTML}, but could not determine what type of component to embed. You must specify a type in the configuration or as an attribute such as '${embed.Embed.typeAttribute}=\"${Report.type.toLowerCase()}\"'.`);\n }\n\n // Saves the type as part of the configuration so that it can be referenced later at a known location.\n config.type = componentType;\n\n const Component = utils.find(component => componentType === component.type.toLowerCase(), Service.components);\n if (!Component) {\n throw new Error(`Attempted to embed component of type: ${componentType} but did not find any matching component. Please verify the type you specified is intended.`);\n }\n\n const component = new Component(this, element, config);\n element.powerBiEmbed = component;\n this.embeds.push(component);\n\n return component;\n }\n\n /**\n * Given an element that already contains an embed component, load with a new configuration.\n * \n * @private\n * @param {IPowerBiElement} element\n * @param {embed.IEmbedConfiguration} config\n * @returns {embed.Embed}\n */\n private embedExisting(element: IPowerBiElement, config: embed.IEmbedConfiguration): embed.Embed {\n const component = utils.find(x => x.element === element, this.embeds);\n if (!component) {\n throw new Error(`Attempted to embed using config ${JSON.stringify(config)} on element ${element.outerHTML} which already has embedded comopnent associated, but could not find the existing comopnent in the list of active components. This could indicate the embeds list is out of sync with the DOM, or the component is referencing the incorrect HTML element.`);\n }\n\n /**\n * TODO: Dynamic embed type switching could be supported but there is work needed to prepare the service state and DOM cleanup.\n * remove all event handlers from the DOM, then reset the element to initial state which removes iframe, and removes from list of embeds\n * then we can call the embedNew function which would allow setting the proper embedUrl and construction of object based on the new type.\n */\n if (typeof config.type === \"string\" && config.type !== component.config.type) {\n\n /**\n * When loading report after create we want to use existing Iframe to optimize load period\n */\n if(config.type === \"report\" && component.config.type === \"create\") {\n const report = new Report(this, element, config, element.powerBiEmbed.iframe);\n report.load(config);\n element.powerBiEmbed = report;\n this.embeds.push(report);\n\n return report;\n }\n\n throw new Error(`Embedding on an existing element with a different type than the previous embed object is not supported. Attempted to embed using config ${JSON.stringify(config)} on element ${element.outerHTML}, but the existing element contains an embed of type: ${this.config.type} which does not match the new type: ${config.type}`);\n }\n\n component.load(config);\n\n return component;\n }\n\n /**\n * Adds an event handler for DOMContentLoaded, which searches the DOM for elements that have the 'powerbi-embed-url' attribute,\n * and automatically attempts to embed a powerbi component based on information from other powerbi-* attributes.\n *\n * Note: Only runs if `config.autoEmbedOnContentLoaded` is true when the service is created.\n * This handler is typically useful only for applications that are rendered on the server so that all required data is available when the handler is called.\n */\n enableAutoEmbed(): void {\n window.addEventListener('DOMContentLoaded', (event: Event) => this.init(document.body), false);\n }\n\n /**\n * Returns an instance of the component associated with the element.\n * \n * @param {HTMLElement} element\n * @returns {(Report | Tile)}\n */\n get(element: HTMLElement): Report | Tile | Dashboard {\n const powerBiElement = element;\n\n if (!powerBiElement.powerBiEmbed) {\n throw new Error(`You attempted to get an instance of powerbi component associated with element: ${element.outerHTML} but there was no associated instance.`);\n }\n\n return powerBiElement.powerBiEmbed;\n }\n\n /**\n * Finds an embed instance by the name or unique ID that is provided.\n * \n * @param {string} uniqueId\n * @returns {(Report | Tile)}\n */\n find(uniqueId: string): Report | Tile | Dashboard {\n return utils.find(x => x.config.uniqueId === uniqueId, this.embeds);\n }\n\n /**\n * Given an HTML element that has a component embedded within it, removes the component from the list of embedded components, removes the association between the element and the component, and removes the iframe.\n * \n * @param {HTMLElement} element\n * @returns {void}\n */\n reset(element: HTMLElement): void {\n const powerBiElement = element;\n\n if (!powerBiElement.powerBiEmbed) {\n return;\n }\n\n /** Removes the component from an internal list of components. */\n utils.remove(x => x === powerBiElement.powerBiEmbed, this.embeds);\n /** Deletes a property from the HTML element. */\n delete powerBiElement.powerBiEmbed;\n /** Removes the iframe from the element. */\n const iframe = element.querySelector('iframe');\n if (iframe) {\n iframe.remove();\n }\n }\n\n /**\n * Given an event object, finds the embed component with the matching type and ID, and invokes its handleEvent method with the event object.\n * \n * @private\n * @param {IEvent} event\n */\n private handleEvent(event: IEvent): void {\n const embed = utils.find(embed => {\n return (embed.config.uniqueId === event.id);\n }, this.embeds);\n\n if (embed) {\n const value = event.value;\n\n if (event.name === 'pageChanged') {\n const pageKey = 'newPage';\n const page: models.IPage = value[pageKey];\n if (!page) {\n throw new Error(`Page model not found at 'event.value.${pageKey}'.`);\n }\n value[pageKey] = new Page(embed, page.name, page.displayName);\n }\n\n utils.raiseCustomEvent(embed.element, event.name, value);\n }\n }\n}\n\n\n// WEBPACK FOOTER //\n// ./src/service.ts","import * as utils from './util';\r\nimport * as service from './service';\r\nimport * as models from 'powerbi-models';\r\nimport * as hpm from 'http-post-message';\r\n\r\ndeclare global {\r\n interface Document {\r\n // Mozilla Fullscreen\r\n mozCancelFullScreen: Function;\r\n\r\n // Ms Fullscreen\r\n msExitFullscreen: Function;\r\n }\r\n\r\n interface HTMLIFrameElement {\r\n // Mozilla Fullscreen\r\n mozRequestFullScreen: Function;\r\n\r\n // Ms Fullscreen\r\n msRequestFullscreen: Function;\r\n }\r\n}\r\n\r\n// TODO: Re-use ILoadConfiguration interface to prevent duplicating properties.\r\n// Current issue is that they are optional when embedding since they can be specificed as attributes but they are required when loading.\r\n/**\r\n * Configuration settings for Power BI embed components\r\n * \r\n * @export\r\n * @interface IEmbedConfiguration\r\n */\r\nexport interface IEmbedConfiguration {\r\n type?: string;\r\n id?: string;\r\n uniqueId?: string;\r\n embedUrl?: string;\r\n accessToken?: string;\r\n settings?: models.ISettings;\r\n pageName?: string;\r\n filters?: models.IFilter[];\r\n pageView?: models.PageView;\r\n datasetId?: string;\r\n permissions?: models.Permissions;\r\n viewMode?: models.ViewMode;\r\n}\r\n\r\nexport interface IInternalEmbedConfiguration extends models.IReportLoadConfiguration {\r\n uniqueId: string;\r\n type: string;\r\n embedUrl: string;\r\n}\r\n\r\nexport interface IInternalEventHandler {\r\n test(event: service.IEvent): boolean;\r\n handle(event: service.ICustomEvent): void;\r\n}\r\n\r\n/**\r\n * Base class for all Power BI embed components\r\n * \r\n * @export\r\n * @abstract\r\n * @class Embed\r\n */\r\nexport abstract class Embed {\r\n static allowedEvents = [\"loaded\", \"saved\", \"rendered\", \"saveAsTriggered\", \"error\", \"dataSelected\"];\r\n static accessTokenAttribute = 'powerbi-access-token';\r\n static embedUrlAttribute = 'powerbi-embed-url';\r\n static nameAttribute = 'powerbi-name';\r\n static typeAttribute = 'powerbi-type';\r\n static type: string;\r\n\r\n private static defaultSettings: models.ISettings = {\r\n filterPaneEnabled: true\r\n };\r\n\r\n allowedEvents = [];\r\n\r\n /**\r\n * Gets or sets the event handler registered for this embed component.\r\n * \r\n * @type {IInternalEventHandler[]}\r\n */\r\n eventHandlers: IInternalEventHandler[];\r\n\r\n /**\r\n * Gets or sets the Power BI embed service.\r\n * \r\n * @type {service.Service}\r\n */\r\n service: service.Service;\r\n\r\n /**\r\n * Gets or sets the HTML element that contains the Power BI embed component.\r\n * \r\n * @type {HTMLElement}\r\n */\r\n element: HTMLElement;\r\n\r\n /**\r\n * Gets or sets the HTML iframe element that renders the Power BI embed component.\r\n * \r\n * @type {HTMLIFrameElement}\r\n */\r\n iframe: HTMLIFrameElement;\r\n\r\n /**\r\n * Gets or sets the configuration settings for the Power BI embed component.\r\n * \r\n * @type {IInternalEmbedConfiguration}\r\n */\r\n config: IInternalEmbedConfiguration;\r\n\r\n /**\r\n * Gets or sets the configuration settings for creating report.\r\n * \r\n * @type {models.IReportCreateConfiguration}\r\n */\r\n createConfig: models.IReportCreateConfiguration;\r\n\r\n /**\r\n * Url used in the load request.\r\n */\r\n loadPath: string;\r\n\r\n /**\r\n * Type of embed\r\n */\r\n embeType: string;\r\n\r\n /**\r\n * Creates an instance of Embed.\r\n * \r\n * Note: there is circular reference between embeds and the service, because\r\n * the service has a list of all embeds on the host page, and each embed has a reference to the service that created it.\r\n * \r\n * @param {service.Service} service\r\n * @param {HTMLElement} element\r\n * @param {IEmbedConfiguration} config\r\n */\r\n constructor(service: service.Service, element: HTMLElement, config: IEmbedConfiguration, iframe?: HTMLIFrameElement) {\r\n Array.prototype.push.apply(this.allowedEvents, Embed.allowedEvents);\r\n this.eventHandlers = [];\r\n this.service = service;\r\n this.element = element;\r\n this.iframe = iframe;\r\n this.embeType = config.type.toLowerCase();\r\n\r\n this.populateConfig(config);\r\n \r\n if(this.embeType === 'create'){\r\n this.setIframe(false/*set EventListener to call create() on 'load' event*/);\r\n } else {\r\n this.setIframe(true/*set EventListener to call load() on 'load' event*/);\r\n }\r\n }\r\n\r\n /**\r\n * Sends createReport configuration data.\r\n * \r\n * ```javascript\r\n * createReport({\r\n * datasetId: '5dac7a4a-4452-46b3-99f6-a25915e0fe55',\r\n * accessToken: 'eyJ0eXA ... TaE2rTSbmg',\r\n * ```\r\n * \r\n * @param {models.IReportCreateConfiguration} config\r\n * @returns {Promise}\r\n */\r\n createReport(config: models.IReportCreateConfiguration): Promise {\r\n const errors = this.validate(config);\r\n if (errors) {\r\n throw errors;\r\n }\r\n \r\n return this.service.hpm.post(\"/report/create\", config, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n return response.body;\r\n },\r\n response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Saves Report.\r\n * \r\n * @returns {Promise}\r\n */\r\n save(): Promise {\r\n return this.service.hpm.post('/report/save', null, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n return response.body;\r\n })\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * SaveAs Report.\r\n * \r\n * @returns {Promise}\r\n */\r\n saveAs(saveAsParameters: models.ISaveAsParameters): Promise {\r\n return this.service.hpm.post('/report/saveAs', saveAsParameters, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n return response.body;\r\n })\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Sends load configuration data.\r\n * \r\n * ```javascript\r\n * report.load({\r\n * type: 'report',\r\n * id: '5dac7a4a-4452-46b3-99f6-a25915e0fe55',\r\n * accessToken: 'eyJ0eXA ... TaE2rTSbmg',\r\n * settings: {\r\n * navContentPaneEnabled: false\r\n * },\r\n * pageName: \"DefaultPage\",\r\n * filters: [\r\n * {\r\n * ... DefaultReportFilter ...\r\n * }\r\n * ]\r\n * })\r\n * .catch(error => { ... });\r\n * ```\r\n * \r\n * @param {models.ILoadConfiguration} config\r\n * @returns {Promise}\r\n */\r\n load(config: models.IReportLoadConfiguration | models.IDashboardLoadConfiguration): Promise {\r\n const errors = this.validate(config);\r\n if (errors) {\r\n throw errors;\r\n }\r\n\r\n return this.service.hpm.post(this.loadPath, config, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n utils.assign(this.config, config);\r\n return response.body;\r\n },\r\n response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Removes one or more event handlers from the list of handlers.\r\n * If a reference to the existing handle function is specified, remove the specific handler.\r\n * If the handler is not specified, remove all handlers for the event name specified.\r\n * \r\n * ```javascript\r\n * report.off('pageChanged')\r\n * \r\n * or \r\n * \r\n * const logHandler = function (event) {\r\n * console.log(event);\r\n * };\r\n * \r\n * report.off('pageChanged', logHandler);\r\n * ```\r\n * \r\n * @template T\r\n * @param {string} eventName\r\n * @param {service.IEventHandler} [handler]\r\n */\r\n off(eventName: string, handler?: service.IEventHandler): void {\r\n const fakeEvent: service.IEvent = { name: eventName, type: null, id: null, value: null };\r\n if (handler) {\r\n utils.remove(eventHandler => eventHandler.test(fakeEvent) && (eventHandler.handle === handler), this.eventHandlers);\r\n this.element.removeEventListener(eventName, handler);\r\n }\r\n else {\r\n const eventHandlersToRemove = this.eventHandlers\r\n .filter(eventHandler => eventHandler.test(fakeEvent));\r\n\r\n eventHandlersToRemove\r\n .forEach(eventHandlerToRemove => {\r\n utils.remove(eventHandler => eventHandler === eventHandlerToRemove, this.eventHandlers);\r\n this.element.removeEventListener(eventName, eventHandlerToRemove.handle);\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Adds an event handler for a specific event.\r\n * \r\n * ```javascript\r\n * report.on('pageChanged', (event) => {\r\n * console.log('PageChanged: ', event.page.name);\r\n * });\r\n * ```\r\n * \r\n * @template T\r\n * @param {string} eventName\r\n * @param {service.IEventHandler} handler\r\n */\r\n on(eventName: string, handler: service.IEventHandler): void {\r\n if (this.allowedEvents.indexOf(eventName) === -1) {\r\n throw new Error(`eventName is must be one of ${this.allowedEvents}. You passed: ${eventName}`);\r\n }\r\n\r\n this.eventHandlers.push({\r\n test: (event: service.IEvent) => event.name === eventName,\r\n handle: handler\r\n });\r\n\r\n this.element.addEventListener(eventName, handler)\r\n }\r\n\r\n /**\r\n * Reloads embed using existing configuration.\r\n * E.g. For reports this effectively clears all filters and makes the first page active which simulates resetting a report back to loaded state.\r\n * \r\n * ```javascript\r\n * report.reload();\r\n * ```\r\n */\r\n reload(): Promise {\r\n return this.load(this.config);\r\n }\r\n \r\n /**\r\n * Set accessToken.\r\n * \r\n * @returns {Promise}\r\n */\r\n setAccessToken(accessToken: string): Promise {\r\n return this.service.hpm.post('/report/token', accessToken, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n return response.body;\r\n })\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n \r\n /**\r\n * Gets an access token from the first available location: config, attribute, global.\r\n * \r\n * @private\r\n * @param {string} globalAccessToken\r\n * @returns {string}\r\n */\r\n private getAccessToken(globalAccessToken: string): string {\r\n const accessToken = this.config.accessToken || this.element.getAttribute(Embed.accessTokenAttribute) || globalAccessToken;\r\n\r\n if (!accessToken) {\r\n throw new Error(`No access token was found for element. You must specify an access token directly on the element using attribute '${Embed.accessTokenAttribute}' or specify a global token at: powerbi.accessToken.`);\r\n }\r\n\r\n return accessToken;\r\n }\r\n\r\n /**\r\n * Populate config for create and load\r\n * \r\n * @private\r\n * @param {IEmbedConfiguration}\r\n * @returns {void}\r\n */\r\n private populateConfig(config: IEmbedConfiguration): void {\r\n // TODO: Change when Object.assign is available.\r\n const settings = utils.assign({}, Embed.defaultSettings, config.settings);\r\n this.config = utils.assign({ settings }, config);\r\n this.config.uniqueId = this.getUniqueId();\r\n this.config.embedUrl = this.getEmbedUrl();\r\n\r\n if(this.embeType === 'create') {\r\n this.createConfig = {\r\n datasetId: config.datasetId || this.getId(),\r\n accessToken: this.getAccessToken(this.service.accessToken),\r\n settings: settings\r\n }\r\n } else {\r\n this.config.id = this.getId();\r\n this.config.accessToken = this.getAccessToken(this.service.accessToken);\r\n } \r\n }\r\n\r\n\r\n /**\r\n * Gets an embed url from the first available location: options, attribute.\r\n * \r\n * @private\r\n * @returns {string}\r\n */\r\n private getEmbedUrl(): string {\r\n const embedUrl = this.config.embedUrl || this.element.getAttribute(Embed.embedUrlAttribute);\r\n\r\n if (typeof embedUrl !== 'string' || embedUrl.length === 0) {\r\n throw new Error(`Embed Url is required, but it was not found. You must provide an embed url either as part of embed configuration or as attribute '${Embed.embedUrlAttribute}'.`);\r\n }\r\n\r\n return embedUrl;\r\n }\r\n\r\n /**\r\n * Gets a unique ID from the first available location: options, attribute.\r\n * If neither is provided generate a unique string.\r\n * \r\n * @private\r\n * @returns {string}\r\n */\r\n private getUniqueId(): string {\r\n return this.config.uniqueId || this.element.getAttribute(Embed.nameAttribute) || utils.createRandomString();\r\n }\r\n\r\n /**\r\n * Gets the report ID from the first available location: options, attribute.\r\n * \r\n * @abstract\r\n * @returns {string}\r\n */\r\n abstract getId(): string;\r\n\r\n /**\r\n * Requests the browser to render the component's iframe in fullscreen mode.\r\n */\r\n fullscreen(): void {\r\n const requestFullScreen = this.iframe.requestFullscreen || this.iframe.msRequestFullscreen || this.iframe.mozRequestFullScreen || this.iframe.webkitRequestFullscreen;\r\n requestFullScreen.call(this.iframe);\r\n }\r\n\r\n /**\r\n * Requests the browser to exit fullscreen mode.\r\n */\r\n exitFullscreen(): void {\r\n if (!this.isFullscreen(this.iframe)) {\r\n return;\r\n }\r\n\r\n const exitFullscreen = document.exitFullscreen || document.mozCancelFullScreen || document.webkitExitFullscreen || document.msExitFullscreen;\r\n exitFullscreen.call(document);\r\n }\r\n\r\n /**\r\n * Returns true if the iframe is rendered in fullscreen mode,\r\n * otherwise returns false.\r\n * \r\n * @private\r\n * @param {HTMLIFrameElement} iframe\r\n * @returns {boolean}\r\n */\r\n private isFullscreen(iframe: HTMLIFrameElement): boolean {\r\n const options = ['fullscreenElement', 'webkitFullscreenElement', 'mozFullscreenScreenElement', 'msFullscreenElement'];\r\n\r\n return options.some(option => document[option] === iframe);\r\n }\r\n \r\n /**\r\n * Validate load and create configuration.\r\n */\r\n abstract validate(config: models.IReportLoadConfiguration | models.IDashboardLoadConfiguration | models.IReportCreateConfiguration): models.IError[];\r\n\r\n /**\r\n * Sets Iframe for embed\r\n */\r\n private setIframe(isLoad: boolean): void {\r\n if(!this.iframe) {\r\n const iframeHtml = ``;\r\n this.element.innerHTML = iframeHtml;\r\n this.iframe = this.element.childNodes[0];\r\n }\r\n\r\n if(isLoad){\r\n this.iframe.addEventListener('load', () => this.load(this.config), false);\r\n } else {\r\n this.iframe.addEventListener('load', () => this.createReport(this.createConfig), false);\r\n }\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/embed.ts","\r\n/**\r\n * Raises a custom event with event data on the specified HTML element.\r\n * \r\n * @export\r\n * @param {HTMLElement} element\r\n * @param {string} eventName\r\n * @param {*} eventData\r\n */\r\nexport function raiseCustomEvent(element: HTMLElement, eventName: string, eventData: any): void {\r\n let customEvent;\r\n if (typeof CustomEvent === 'function') {\r\n customEvent = new CustomEvent(eventName, {\r\n detail: eventData,\r\n bubbles: true,\r\n cancelable: true\r\n });\r\n } else {\r\n customEvent = document.createEvent('CustomEvent');\r\n customEvent.initCustomEvent(eventName, true, true, eventData);\r\n }\r\n\r\n element.dispatchEvent(customEvent);\r\n}\r\n\r\n/**\r\n * Finds the index of the first value in an array that matches the specified predicate.\r\n * \r\n * @export\r\n * @template T\r\n * @param {(x: T) => boolean} predicate\r\n * @param {T[]} xs\r\n * @returns {number}\r\n */\r\nexport function findIndex(predicate: (x: T) => boolean, xs: T[]): number {\r\n if (!Array.isArray(xs)) {\r\n throw new Error(`You attempted to call find with second parameter that was not an array. You passed: ${xs}`);\r\n }\r\n\r\n let index;\r\n xs.some((x, i) => {\r\n if (predicate(x)) {\r\n index = i;\r\n return true;\r\n }\r\n });\r\n\r\n return index;\r\n}\r\n\r\n/**\r\n * Finds the first value in an array that matches the specified predicate.\r\n * \r\n * @export\r\n * @template T\r\n * @param {(x: T) => boolean} predicate\r\n * @param {T[]} xs\r\n * @returns {T}\r\n */\r\nexport function find(predicate: (x: T) => boolean, xs: T[]): T {\r\n const index = findIndex(predicate, xs);\r\n return xs[index];\r\n}\r\n\r\nexport function remove(predicate: (x: T) => boolean, xs: T[]): void {\r\n const index = findIndex(predicate, xs);\r\n xs.splice(index, 1);\r\n}\r\n\r\n// See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\r\n// TODO: replace in favor of using polyfill\r\n/**\r\n * Copies the values of all enumerable properties from one or more source objects to a target object, and returns the target object.\r\n * \r\n * @export\r\n * @param {any} args\r\n * @returns\r\n */\r\nexport function assign(...args) {\r\n var target = args[0];\r\n\r\n 'use strict';\r\n if (target === undefined || target === null) {\r\n throw new TypeError('Cannot convert undefined or null to object');\r\n }\r\n\r\n var output = Object(target);\r\n for (var index = 1; index < arguments.length; index++) {\r\n var source = arguments[index];\r\n if (source !== undefined && source !== null) {\r\n for (var nextKey in source) {\r\n if (source.hasOwnProperty(nextKey)) {\r\n output[nextKey] = source[nextKey];\r\n }\r\n }\r\n }\r\n }\r\n return output;\r\n}\r\n\r\n/**\r\n * Generates a random 7 character string.\r\n * \r\n * @export\r\n * @returns {string}\r\n */\r\nexport function createRandomString(): string {\r\n return (Math.random() + 1).toString(36).substring(7);\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/util.ts","import * as service from './service';\nimport * as embed from './embed';\nimport * as models from 'powerbi-models';\nimport * as wpmp from 'window-post-message-proxy';\nimport * as hpm from 'http-post-message';\nimport * as utils from './util';\nimport { IFilterable } from './ifilterable';\nimport { IPageNode, Page } from './page';\n\n/**\n * A Report node within a report hierarchy\n * \n * @export\n * @interface IReportNode\n */\nexport interface IReportNode {\n iframe: HTMLIFrameElement;\n service: service.IService;\n config: embed.IInternalEmbedConfiguration\n}\n\n/**\n * The Power BI Report embed component\n * \n * @export\n * @class Report\n * @extends {embed.Embed}\n * @implements {IReportNode}\n * @implements {IFilterable}\n */\nexport class Report extends embed.Embed implements IReportNode, IFilterable {\n static allowedEvents = [\"filtersApplied\", \"pageChanged\"];\n static reportIdAttribute = 'powerbi-report-id';\n static filterPaneEnabledAttribute = 'powerbi-settings-filter-pane-enabled';\n static navContentPaneEnabledAttribute = 'powerbi-settings-nav-content-pane-enabled';\n static typeAttribute = 'powerbi-type';\n static type = \"Report\";\n\n /**\n * Creates an instance of a Power BI Report.\n * \n * @param {service.Service} service\n * @param {HTMLElement} element\n * @param {embed.IEmbedConfiguration} config\n */\n constructor(service: service.Service, element: HTMLElement, config: embed.IEmbedConfiguration, iframe?: HTMLIFrameElement) {\n const filterPaneEnabled = (config.settings && config.settings.filterPaneEnabled) || !(element.getAttribute(Report.filterPaneEnabledAttribute) === \"false\");\n const navContentPaneEnabled = (config.settings && config.settings.navContentPaneEnabled) || !(element.getAttribute(Report.navContentPaneEnabledAttribute) === \"false\");\n const settings = utils.assign({\n filterPaneEnabled,\n navContentPaneEnabled\n }, config.settings);\n const configCopy = utils.assign({ settings }, config);\n\n super(service, element, configCopy, iframe);\n this.loadPath = \"/report/load\";\n Array.prototype.push.apply(this.allowedEvents, Report.allowedEvents);\n }\n\n /**\n * Adds backwards compatibility for the previous load configuration, which used the reportId query parameter to specify the report ID\n * (e.g. http://embedded.powerbi.com/appTokenReportEmbed?reportId=854846ed-2106-4dc2-bc58-eb77533bf2f1).\n * \n * By extracting the ID we can ensure that the ID is always explicitly provided as part of the load configuration.\n * \n * @static\n * @param {string} url\n * @returns {string}\n */\n static findIdFromEmbedUrl(url: string): string {\n const reportIdRegEx = /reportId=\"?([^&]+)\"?/\n const reportIdMatch = url.match(reportIdRegEx);\n\n let reportId;\n if (reportIdMatch) {\n reportId = reportIdMatch[1];\n }\n\n return reportId;\n }\n\n /**\n * Gets filters that are applied at the report level.\n * \n * ```javascript\n * // Get filters applied at report level\n * report.getFilters()\n * .then(filters => {\n * ...\n * });\n * ```\n * \n * @returns {Promise}\n */\n getFilters(): Promise {\n return this.service.hpm.get(`/report/filters`, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .then(response => response.body,\n response => {\n throw response.body;\n });\n }\n\n /**\n * Gets the report ID from the first available location: options, attribute, embed url.\n * \n * @returns {string}\n */\n getId(): string {\n const reportId = this.config.id || this.element.getAttribute(Report.reportIdAttribute) || Report.findIdFromEmbedUrl(this.config.embedUrl);\n\n if (typeof reportId !== 'string' || reportId.length === 0) {\n throw new Error(`Report id is required, but it was not found. You must provide an id either as part of embed configuration or as attribute '${Report.reportIdAttribute}'.`);\n }\n\n return reportId;\n }\n\n /**\n * Gets the list of pages within the report.\n * \n * ```javascript\n * report.getPages()\n * .then(pages => {\n * ...\n * });\n * ```\n * \n * @returns {Promise}\n */\n getPages(): Promise {\n return this.service.hpm.get('/report/pages', { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .then(response => {\n return response.body\n .map(page => {\n return new Page(this, page.name, page.displayName);\n });\n }, response => {\n throw response.body;\n });\n }\n\n /**\n * Creates an instance of a Page.\n * \n * Normally you would get Page objects by calling `report.getPages()`, but in the case\n * that the page name is known and you want to perform an action on a page without having to retrieve it\n * you can create it directly.\n * \n * Note: Because you are creating the page manually there is no guarantee that the page actually exists in the report, and subsequent requests could fail.\n * \n * ```javascript\n * const page = report.page('ReportSection1');\n * page.setActive();\n * ```\n * \n * @param {string} name\n * @param {string} [displayName]\n * @returns {Page}\n */\n page(name: string, displayName?: string): Page {\n return new Page(this, name, displayName);\n }\n\n /**\n * Prints the active page of the report by invoking `window.print()` on the embed iframe component.\n */\n print(): Promise {\n return this.service.hpm.post('/report/print', null, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .then(response => {\n return response.body;\n })\n .catch(response => {\n throw response.body;\n });\n }\n\n /**\n * Removes all filters at the report level.\n * \n * ```javascript\n * report.removeFilters();\n * ```\n * \n * @returns {Promise}\n */\n removeFilters(): Promise {\n return this.setFilters([]);\n }\n\n /**\n * Sets the active page of the report.\n * \n * ```javascript\n * report.setPage(\"page2\")\n * .catch(error => { ... });\n * ```\n * \n * @param {string} pageName\n * @returns {Promise}\n */\n setPage(pageName: string): Promise {\n const page: models.IPage = {\n name: pageName,\n displayName: null\n };\n\n return this.service.hpm.put('/report/pages/active', page, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .catch(response => {\n throw response.body;\n });\n }\n\n /**\n * Sets filters at the report level.\n * \n * ```javascript\n * const filters: [\n * ...\n * ];\n * \n * report.setFilters(filters)\n * .catch(errors => {\n * ...\n * });\n * ```\n * \n * @param {(models.IFilter[])} filters\n * @returns {Promise}\n */\n setFilters(filters: models.IFilter[]): Promise {\n return this.service.hpm.put(`/report/filters`, filters, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .catch(response => {\n throw response.body;\n });\n }\n\n /**\n * Updates visibility settings for the filter pane and the page navigation pane.\n * \n * ```javascript\n * const newSettings = {\n * navContentPaneEnabled: true,\n * filterPaneEnabled: false\n * };\n * \n * report.updateSettings(newSettings)\n * .catch(error => { ... });\n * ```\n * \n * @param {models.ISettings} settings\n * @returns {Promise}\n */\n updateSettings(settings: models.ISettings): Promise {\n return this.service.hpm.patch('/report/settings', settings, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .catch(response => {\n throw response.body;\n });\n }\n\n /**\n * Validate load configuration.\n */\n validate(config: models.IReportLoadConfiguration): models.IError[] {\n return models.validateReportLoad(config);\n }\n\n /**\n * Switch Report view mode.\n * \n * @returns {Promise}\n */\n switchMode(viewMode: models.ViewMode): Promise {\n let url = '/report/switchMode/' + viewMode;\n return this.service.hpm.post(url, null, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .then(response => {\n return response.body;\n })\n .catch(response => {\n throw response.body;\n });\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/report.ts","/*! powerbi-models v0.11.1 | (c) 2016 Microsoft Corporation MIT */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"powerbi-models\"] = factory();\n\telse\n\t\troot[\"powerbi-models\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __extends = (this && this.__extends) || function (d, b) {\n\t for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n\t function __() { this.constructor = d; }\n\t d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n\t};\n\t/* tslint:disable:no-var-requires */\n\texports.advancedFilterSchema = __webpack_require__(1);\n\texports.filterSchema = __webpack_require__(2);\n\texports.loadSchema = __webpack_require__(3);\n\texports.dashboardLoadSchema = __webpack_require__(4);\n\texports.pageSchema = __webpack_require__(5);\n\texports.settingsSchema = __webpack_require__(6);\n\texports.basicFilterSchema = __webpack_require__(7);\n\texports.createReportSchema = __webpack_require__(8);\n\texports.saveAsParametersSchema = __webpack_require__(9);\n\t/* tslint:enable:no-var-requires */\n\tvar jsen = __webpack_require__(10);\n\tfunction normalizeError(error) {\n\t var message = error.message;\n\t if (!message) {\n\t message = error.path + \" is invalid. Not meeting \" + error.keyword + \" constraint\";\n\t }\n\t return {\n\t message: message\n\t };\n\t}\n\t/**\n\t * Takes in schema and returns function which can be used to validate the schema with better semantics around exposing errors\n\t */\n\tfunction validate(schema, options) {\n\t return function (x) {\n\t var validate = jsen(schema, options);\n\t var isValid = validate(x);\n\t if (isValid) {\n\t return undefined;\n\t }\n\t else {\n\t return validate.errors\n\t .map(normalizeError);\n\t }\n\t };\n\t}\n\texports.validateSettings = validate(exports.settingsSchema, {\n\t schemas: {\n\t basicFilter: exports.basicFilterSchema,\n\t advancedFilter: exports.advancedFilterSchema\n\t }\n\t});\n\texports.validateReportLoad = validate(exports.loadSchema, {\n\t schemas: {\n\t settings: exports.settingsSchema,\n\t basicFilter: exports.basicFilterSchema,\n\t advancedFilter: exports.advancedFilterSchema\n\t }\n\t});\n\texports.validateCreateReport = validate(exports.createReportSchema);\n\texports.validateDashboardLoad = validate(exports.dashboardLoadSchema);\n\texports.validatePage = validate(exports.pageSchema);\n\texports.validateFilter = validate(exports.filterSchema, {\n\t schemas: {\n\t basicFilter: exports.basicFilterSchema,\n\t advancedFilter: exports.advancedFilterSchema\n\t }\n\t});\n\t(function (FilterType) {\n\t FilterType[FilterType[\"Advanced\"] = 0] = \"Advanced\";\n\t FilterType[FilterType[\"Basic\"] = 1] = \"Basic\";\n\t FilterType[FilterType[\"Unknown\"] = 2] = \"Unknown\";\n\t})(exports.FilterType || (exports.FilterType = {}));\n\tvar FilterType = exports.FilterType;\n\tfunction isFilterKeyColumnsTarget(target) {\n\t return isColumn(target) && !!target.keys;\n\t}\n\texports.isFilterKeyColumnsTarget = isFilterKeyColumnsTarget;\n\tfunction isBasicFilterWithKeys(filter) {\n\t return getFilterType(filter) === FilterType.Basic && !!filter.keyValues;\n\t}\n\texports.isBasicFilterWithKeys = isBasicFilterWithKeys;\n\tfunction getFilterType(filter) {\n\t var basicFilter = filter;\n\t var advancedFilter = filter;\n\t if ((typeof basicFilter.operator === \"string\")\n\t && (Array.isArray(basicFilter.values))) {\n\t return FilterType.Basic;\n\t }\n\t else if ((typeof advancedFilter.logicalOperator === \"string\")\n\t && (Array.isArray(advancedFilter.conditions))) {\n\t return FilterType.Advanced;\n\t }\n\t else {\n\t return FilterType.Unknown;\n\t }\n\t}\n\texports.getFilterType = getFilterType;\n\tfunction isMeasure(arg) {\n\t return arg.table !== undefined && arg.measure !== undefined;\n\t}\n\texports.isMeasure = isMeasure;\n\tfunction isColumn(arg) {\n\t return arg.table !== undefined && arg.column !== undefined;\n\t}\n\texports.isColumn = isColumn;\n\tfunction isHierarchy(arg) {\n\t return arg.table !== undefined && arg.hierarchy !== undefined && arg.hierarchyLevel !== undefined;\n\t}\n\texports.isHierarchy = isHierarchy;\n\tvar Filter = (function () {\n\t function Filter(target) {\n\t this.target = target;\n\t }\n\t Filter.prototype.toJSON = function () {\n\t return {\n\t $schema: this.schemaUrl,\n\t target: this.target\n\t };\n\t };\n\t ;\n\t return Filter;\n\t}());\n\texports.Filter = Filter;\n\tvar BasicFilter = (function (_super) {\n\t __extends(BasicFilter, _super);\n\t function BasicFilter(target, operator) {\n\t var values = [];\n\t for (var _i = 2; _i < arguments.length; _i++) {\n\t values[_i - 2] = arguments[_i];\n\t }\n\t _super.call(this, target);\n\t this.operator = operator;\n\t this.schemaUrl = BasicFilter.schemaUrl;\n\t if (values.length === 0 && operator !== \"All\") {\n\t throw new Error(\"values must be a non-empty array unless your operator is \\\"All\\\".\");\n\t }\n\t /**\n\t * Accept values as array instead of as individual arguments\n\t * new BasicFilter('a', 'b', 1, 2);\n\t * new BasicFilter('a', 'b', [1,2]);\n\t */\n\t if (Array.isArray(values[0])) {\n\t this.values = values[0];\n\t }\n\t else {\n\t this.values = values;\n\t }\n\t }\n\t BasicFilter.prototype.toJSON = function () {\n\t var filter = _super.prototype.toJSON.call(this);\n\t filter.operator = this.operator;\n\t filter.values = this.values;\n\t return filter;\n\t };\n\t BasicFilter.schemaUrl = \"http://powerbi.com/product/schema#basic\";\n\t return BasicFilter;\n\t}(Filter));\n\texports.BasicFilter = BasicFilter;\n\tvar BasicFilterWithKeys = (function (_super) {\n\t __extends(BasicFilterWithKeys, _super);\n\t function BasicFilterWithKeys(target, operator, values, keyValues) {\n\t _super.call(this, target, operator, values);\n\t this.keyValues = keyValues;\n\t this.target = target;\n\t var numberOfKeys = target.keys ? target.keys.length : 0;\n\t if (numberOfKeys > 0 && !keyValues) {\n\t throw new Error(\"You shold pass the values to be filtered for each key. You passed: no values and \" + numberOfKeys + \" keys\");\n\t }\n\t if (numberOfKeys === 0 && keyValues && keyValues.length > 0) {\n\t throw new Error(\"You passed key values but your target object doesn't contain the keys to be filtered\");\n\t }\n\t for (var i = 0; i < this.keyValues.length; i++) {\n\t if (this.keyValues[i]) {\n\t var lengthOfArray = this.keyValues[i].length;\n\t if (lengthOfArray !== numberOfKeys) {\n\t throw new Error(\"Each tuple of key values should contain a value for each of the keys. You passed: \" + lengthOfArray + \" values and \" + numberOfKeys + \" keys\");\n\t }\n\t }\n\t }\n\t }\n\t BasicFilterWithKeys.prototype.toJSON = function () {\n\t var filter = _super.prototype.toJSON.call(this);\n\t filter.keyValues = this.keyValues;\n\t return filter;\n\t };\n\t return BasicFilterWithKeys;\n\t}(BasicFilter));\n\texports.BasicFilterWithKeys = BasicFilterWithKeys;\n\tvar AdvancedFilter = (function (_super) {\n\t __extends(AdvancedFilter, _super);\n\t function AdvancedFilter(target, logicalOperator) {\n\t var conditions = [];\n\t for (var _i = 2; _i < arguments.length; _i++) {\n\t conditions[_i - 2] = arguments[_i];\n\t }\n\t _super.call(this, target);\n\t this.schemaUrl = AdvancedFilter.schemaUrl;\n\t // Guard statements\n\t if (typeof logicalOperator !== \"string\" || logicalOperator.length === 0) {\n\t // TODO: It would be nicer to list out the possible logical operators.\n\t throw new Error(\"logicalOperator must be a valid operator, You passed: \" + logicalOperator);\n\t }\n\t this.logicalOperator = logicalOperator;\n\t var extractedConditions;\n\t /**\n\t * Accept conditions as array instead of as individual arguments\n\t * new AdvancedFilter('a', 'b', \"And\", { value: 1, operator: \"Equals\" }, { value: 2, operator: \"IsGreaterThan\" });\n\t * new AdvancedFilter('a', 'b', \"And\", [{ value: 1, operator: \"Equals\" }, { value: 2, operator: \"IsGreaterThan\" }]);\n\t */\n\t if (Array.isArray(conditions[0])) {\n\t extractedConditions = conditions[0];\n\t }\n\t else {\n\t extractedConditions = conditions;\n\t }\n\t if (extractedConditions.length === 0) {\n\t throw new Error(\"conditions must be a non-empty array. You passed: \" + conditions);\n\t }\n\t if (extractedConditions.length > 2) {\n\t throw new Error(\"AdvancedFilters may not have more than two conditions. You passed: \" + conditions.length);\n\t }\n\t if (extractedConditions.length === 1 && logicalOperator !== \"And\") {\n\t throw new Error(\"Logical Operator must be \\\"And\\\" when there is only one condition provided\");\n\t }\n\t this.conditions = extractedConditions;\n\t }\n\t AdvancedFilter.prototype.toJSON = function () {\n\t var filter = _super.prototype.toJSON.call(this);\n\t filter.logicalOperator = this.logicalOperator;\n\t filter.conditions = this.conditions;\n\t return filter;\n\t };\n\t AdvancedFilter.schemaUrl = \"http://powerbi.com/product/schema#advanced\";\n\t return AdvancedFilter;\n\t}(Filter));\n\texports.AdvancedFilter = AdvancedFilter;\n\t(function (Permissions) {\n\t Permissions[Permissions[\"Read\"] = 0] = \"Read\";\n\t Permissions[Permissions[\"ReadWrite\"] = 1] = \"ReadWrite\";\n\t Permissions[Permissions[\"Copy\"] = 2] = \"Copy\";\n\t Permissions[Permissions[\"Create\"] = 4] = \"Create\";\n\t Permissions[Permissions[\"All\"] = 7] = \"All\";\n\t})(exports.Permissions || (exports.Permissions = {}));\n\tvar Permissions = exports.Permissions;\n\t(function (ViewMode) {\n\t ViewMode[ViewMode[\"View\"] = 0] = \"View\";\n\t ViewMode[ViewMode[\"Edit\"] = 1] = \"Edit\";\n\t})(exports.ViewMode || (exports.ViewMode = {}));\n\tvar ViewMode = exports.ViewMode;\n\texports.validateSaveAsParameters = validate(exports.saveAsParametersSchema);\n\n\n/***/ },\n/* 1 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"target\": {\n\t\t\t\t\"oneOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\t\"table\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"column\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"required\": [\n\t\t\t\t\t\t\t\"table\",\n\t\t\t\t\t\t\t\"column\"\n\t\t\t\t\t\t]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\t\"table\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"hierarchy\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"hierarchyLevel\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"required\": [\n\t\t\t\t\t\t\t\"table\",\n\t\t\t\t\t\t\t\"hierarchy\",\n\t\t\t\t\t\t\t\"hierarchyLevel\"\n\t\t\t\t\t\t]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\t\"table\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"measure\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"required\": [\n\t\t\t\t\t\t\t\"table\",\n\t\t\t\t\t\t\t\"measure\"\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"logicalOperator\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"conditions\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\"value\": {\n\t\t\t\t\t\t\t\"type\": [\n\t\t\t\t\t\t\t\t\"string\",\n\t\t\t\t\t\t\t\t\"boolean\",\n\t\t\t\t\t\t\t\t\"number\"\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"operator\": {\n\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\"required\": [\n\t\t\t\t\t\t\"value\",\n\t\t\t\t\t\t\"operator\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"target\",\n\t\t\t\"logicalOperator\",\n\t\t\t\"conditions\"\n\t\t]\n\t};\n\n/***/ },\n/* 2 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"oneOf\": [\n\t\t\t{\n\t\t\t\t\"$ref\": \"#basicFilter\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"$ref\": \"#advancedFilter\"\n\t\t\t}\n\t\t],\n\t\t\"invalidMessage\": \"filter is invalid\"\n\t};\n\n/***/ },\n/* 3 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"accessToken\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"accessToken must be a string\",\n\t\t\t\t\t\"required\": \"accessToken is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"id\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"id must be a string\",\n\t\t\t\t\t\"required\": \"id is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"settings\": {\n\t\t\t\t\"$ref\": \"#settings\"\n\t\t\t},\n\t\t\t\"pageName\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"pageName must be a string\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"filters\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\"oneOf\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"$ref\": \"#basicFilter\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"$ref\": \"#advancedFilter\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t\"invalidMessage\": \"filters property is invalid\"\n\t\t\t},\n\t\t\t\"permissions\": {\n\t\t\t\t\"type\": \"number\",\n\t\t\t\t\"enum\": [\n\t\t\t\t\t0,\n\t\t\t\t\t1,\n\t\t\t\t\t2,\n\t\t\t\t\t4,\n\t\t\t\t\t7\n\t\t\t\t],\n\t\t\t\t\"default\": 0,\n\t\t\t\t\"invalidMessage\": \"permissions property is invalid\"\n\t\t\t},\n\t\t\t\"viewMode\": {\n\t\t\t\t\"type\": \"number\",\n\t\t\t\t\"enum\": [\n\t\t\t\t\t0,\n\t\t\t\t\t1\n\t\t\t\t],\n\t\t\t\t\"default\": 0,\n\t\t\t\t\"invalidMessage\": \"viewMode property is invalid\"\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"accessToken\",\n\t\t\t\"id\"\n\t\t]\n\t};\n\n/***/ },\n/* 4 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"accessToken\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"accessToken must be a string\",\n\t\t\t\t\t\"required\": \"accessToken is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"id\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"id must be a string\",\n\t\t\t\t\t\"required\": \"id is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"pageView\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"pageView must be a string with one of the following values: \\\"actualSize\\\", \\\"fitToWidth\\\", \\\"oneColumn\\\"\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"accessToken\",\n\t\t\t\"id\"\n\t\t]\n\t};\n\n/***/ },\n/* 5 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"name\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"name must be a string\",\n\t\t\t\t\t\"required\": \"name is required\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"name\"\n\t\t]\n\t};\n\n/***/ },\n/* 6 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"filterPaneEnabled\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"filterPaneEnabled must be a boolean\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"navContentPaneEnabled\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"navContentPaneEnabled must be a boolean\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"useCustomSaveAsDialog\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"useCustomSaveAsDialog must be a boolean\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n/***/ },\n/* 7 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"target\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"properties\": {\n\t\t\t\t\t\"table\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"column\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"hierarchy\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"hierarchyLevel\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"measure\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"required\": [\n\t\t\t\t\t\"table\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"operator\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"values\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"type\": [\n\t\t\t\t\t\t\"string\",\n\t\t\t\t\t\t\"boolean\",\n\t\t\t\t\t\t\"number\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"target\",\n\t\t\t\"operator\",\n\t\t\t\"values\"\n\t\t]\n\t};\n\n/***/ },\n/* 8 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"accessToken\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"accessToken must be a string\",\n\t\t\t\t\t\"required\": \"accessToken is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"datasetId\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"datasetId must be a string\",\n\t\t\t\t\t\"required\": \"datasetId is required\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"accessToken\",\n\t\t\t\"datasetId\"\n\t\t]\n\t};\n\n/***/ },\n/* 9 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"name\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"name must be a string\",\n\t\t\t\t\t\"required\": \"name is required\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"name\"\n\t\t]\n\t};\n\n/***/ },\n/* 10 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = __webpack_require__(11);\n\n/***/ },\n/* 11 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar REGEX_ESCAPE_EXPR = /[\\/]/g,\n\t STR_ESCAPE_EXPR = /(\")/gim,\n\t VALID_IDENTIFIER_EXPR = /^[a-z_$][0-9a-z]*$/gi,\n\t INVALID_SCHEMA = 'jsen: invalid schema object',\n\t browser = typeof window === 'object' && !!window.navigator, // jshint ignore: line\n\t regescape = new RegExp('/').source !== '/', // node v0.x does not properly escape '/'s in inline regex\n\t func = __webpack_require__(12),\n\t equal = __webpack_require__(13),\n\t unique = __webpack_require__(14),\n\t SchemaResolver = __webpack_require__(15),\n\t formats = __webpack_require__(24),\n\t ucs2length = __webpack_require__(25),\n\t types = {},\n\t keywords = {};\n\t\n\tfunction inlineRegex(regex) {\n\t regex = regex instanceof RegExp ? regex : new RegExp(regex);\n\t\n\t return regescape ?\n\t regex.toString() :\n\t '/' + regex.source.replace(REGEX_ESCAPE_EXPR, '\\\\$&') + '/';\n\t}\n\t\n\tfunction encodeStr(str) {\n\t return '\"' + str.replace(STR_ESCAPE_EXPR, '\\\\$1') + '\"';\n\t}\n\t\n\tfunction appendToPath(path, key) {\n\t VALID_IDENTIFIER_EXPR.lastIndex = 0;\n\t\n\t return VALID_IDENTIFIER_EXPR.test(key) ?\n\t path + '.' + key :\n\t path + '[' + encodeStr(key) + ']';\n\t}\n\t\n\tfunction type(obj) {\n\t if (obj === undefined) {\n\t return 'undefined';\n\t }\n\t\n\t var str = Object.prototype.toString.call(obj);\n\t return str.substr(8, str.length - 9).toLowerCase();\n\t}\n\t\n\tfunction isInteger(obj) {\n\t return (obj | 0) === obj; // jshint ignore: line\n\t}\n\t\n\ttypes['null'] = function (path) {\n\t return path + ' === null';\n\t};\n\t\n\ttypes.boolean = function (path) {\n\t return 'typeof ' + path + ' === \"boolean\"';\n\t};\n\t\n\ttypes.string = function (path) {\n\t return 'typeof ' + path + ' === \"string\"';\n\t};\n\t\n\ttypes.number = function (path) {\n\t return 'typeof ' + path + ' === \"number\"';\n\t};\n\t\n\ttypes.integer = function (path) {\n\t return 'typeof ' + path + ' === \"number\" && !(' + path + ' % 1)';\n\t};\n\t\n\ttypes.array = function (path) {\n\t return 'Array.isArray(' + path + ')';\n\t};\n\t\n\ttypes.object = function (path) {\n\t return 'typeof ' + path + ' === \"object\" && ' + path + ' !== null && !Array.isArray(' + path + ')';\n\t};\n\t\n\ttypes.date = function (path) {\n\t return path + ' instanceof Date';\n\t};\n\t\n\tkeywords.enum = function (context) {\n\t var arr = context.schema['enum'];\n\t\n\t context.code('if (!equalAny(' + context.path + ', ' + JSON.stringify(arr) + ')) {');\n\t context.error('enum');\n\t context.code('}');\n\t};\n\t\n\tkeywords.minimum = function (context) {\n\t if (typeof context.schema.minimum === 'number') {\n\t context.code('if (' + context.path + ' < ' + context.schema.minimum + ') {');\n\t context.error('minimum');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.exclusiveMinimum = function (context) {\n\t if (context.schema.exclusiveMinimum === true && typeof context.schema.minimum === 'number') {\n\t context.code('if (' + context.path + ' === ' + context.schema.minimum + ') {');\n\t context.error('exclusiveMinimum');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.maximum = function (context) {\n\t if (typeof context.schema.maximum === 'number') {\n\t context.code('if (' + context.path + ' > ' + context.schema.maximum + ') {');\n\t context.error('maximum');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.exclusiveMaximum = function (context) {\n\t if (context.schema.exclusiveMaximum === true && typeof context.schema.maximum === 'number') {\n\t context.code('if (' + context.path + ' === ' + context.schema.maximum + ') {');\n\t context.error('exclusiveMaximum');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.multipleOf = function (context) {\n\t if (typeof context.schema.multipleOf === 'number') {\n\t var mul = context.schema.multipleOf,\n\t decimals = mul.toString().length - mul.toFixed(0).length - 1,\n\t pow = decimals > 0 ? Math.pow(10, decimals) : 1,\n\t path = context.path;\n\t\n\t if (decimals > 0) {\n\t context.code('if (+(Math.round((' + path + ' * ' + pow + ') + \"e+\" + ' + decimals + ') + \"e-\" + ' + decimals + ') % ' + (mul * pow) + ' !== 0) {');\n\t } else {\n\t context.code('if (((' + path + ' * ' + pow + ') % ' + (mul * pow) + ') !== 0) {');\n\t }\n\t\n\t context.error('multipleOf');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.minLength = function (context) {\n\t if (isInteger(context.schema.minLength)) {\n\t context.code('if (ucs2length(' + context.path + ') < ' + context.schema.minLength + ') {');\n\t context.error('minLength');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.maxLength = function (context) {\n\t if (isInteger(context.schema.maxLength)) {\n\t context.code('if (ucs2length(' + context.path + ') > ' + context.schema.maxLength + ') {');\n\t context.error('maxLength');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.pattern = function (context) {\n\t var pattern = context.schema.pattern;\n\t\n\t if (typeof pattern === 'string' || pattern instanceof RegExp) {\n\t context.code('if (!(' + inlineRegex(pattern) + ').test(' + context.path + ')) {');\n\t context.error('pattern');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.format = function (context) {\n\t if (typeof context.schema.format !== 'string' || !formats[context.schema.format]) {\n\t return;\n\t }\n\t\n\t context.code('if (!(' + formats[context.schema.format] + ').test(' + context.path + ')) {');\n\t context.error('format');\n\t context.code('}');\n\t};\n\t\n\tkeywords.minItems = function (context) {\n\t if (isInteger(context.schema.minItems)) {\n\t context.code('if (' + context.path + '.length < ' + context.schema.minItems + ') {');\n\t context.error('minItems');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.maxItems = function (context) {\n\t if (isInteger(context.schema.maxItems)) {\n\t context.code('if (' + context.path + '.length > ' + context.schema.maxItems + ') {');\n\t context.error('maxItems');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.additionalItems = function (context) {\n\t if (context.schema.additionalItems === false && Array.isArray(context.schema.items)) {\n\t context.code('if (' + context.path + '.length > ' + context.schema.items.length + ') {');\n\t context.error('additionalItems');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.uniqueItems = function (context) {\n\t if (context.schema.uniqueItems) {\n\t context.code('if (unique(' + context.path + ').length !== ' + context.path + '.length) {');\n\t context.error('uniqueItems');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.items = function (context) {\n\t var index = context.declare(0),\n\t i = 0;\n\t\n\t if (type(context.schema.items) === 'object') {\n\t context.code('for (' + index + ' = 0; ' + index + ' < ' + context.path + '.length; ' + index + '++) {');\n\t\n\t context.descend(context.path + '[' + index + ']', context.schema.items);\n\t\n\t context.code('}');\n\t }\n\t else if (Array.isArray(context.schema.items)) {\n\t for (; i < context.schema.items.length; i++) {\n\t context.code('if (' + context.path + '.length - 1 >= ' + i + ') {');\n\t\n\t context.descend(context.path + '[' + i + ']', context.schema.items[i]);\n\t\n\t context.code('}');\n\t }\n\t\n\t if (type(context.schema.additionalItems) === 'object') {\n\t context.code('for (' + index + ' = ' + i + '; ' + index + ' < ' + context.path + '.length; ' + index + '++) {');\n\t\n\t context.descend(context.path + '[' + index + ']', context.schema.additionalItems);\n\t\n\t context.code('}');\n\t }\n\t }\n\t};\n\t\n\tkeywords.maxProperties = function (context) {\n\t if (isInteger(context.schema.maxProperties)) {\n\t context.code('if (Object.keys(' + context.path + ').length > ' + context.schema.maxProperties + ') {');\n\t context.error('maxProperties');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.minProperties = function (context) {\n\t if (isInteger(context.schema.minProperties)) {\n\t context.code('if (Object.keys(' + context.path + ').length < ' + context.schema.minProperties + ') {');\n\t context.error('minProperties');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.required = function (context) {\n\t if (!Array.isArray(context.schema.required)) {\n\t return;\n\t }\n\t\n\t for (var i = 0; i < context.schema.required.length; i++) {\n\t context.code('if (' + appendToPath(context.path, context.schema.required[i]) + ' === undefined) {');\n\t context.error('required', context.schema.required[i]);\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.properties = function (context) {\n\t var props = context.schema.properties,\n\t propKeys = type(props) === 'object' ? Object.keys(props) : [],\n\t required = Array.isArray(context.schema.required) ? context.schema.required : [],\n\t prop, i, nestedPath;\n\t\n\t if (!propKeys.length) {\n\t return;\n\t }\n\t\n\t for (i = 0; i < propKeys.length; i++) {\n\t prop = propKeys[i];\n\t nestedPath = appendToPath(context.path, prop);\n\t\n\t context.code('if (' + nestedPath + ' !== undefined) {');\n\t\n\t context.descend(nestedPath, props[prop]);\n\t\n\t context.code('}');\n\t\n\t if (required.indexOf(prop) > -1) {\n\t context.code('else {');\n\t context.error('required', prop);\n\t context.code('}');\n\t }\n\t }\n\t};\n\t\n\tkeywords.patternProperties = keywords.additionalProperties = function (context) {\n\t var propKeys = type(context.schema.properties) === 'object' ?\n\t Object.keys(context.schema.properties) : [],\n\t patProps = context.schema.patternProperties,\n\t patterns = type(patProps) === 'object' ? Object.keys(patProps) : [],\n\t addProps = context.schema.additionalProperties,\n\t addPropsCheck = addProps === false || type(addProps) === 'object',\n\t props, keys, key, n, found, pattern, i;\n\t\n\t if (!patterns.length && !addPropsCheck) {\n\t return;\n\t }\n\t\n\t keys = context.declare('[]');\n\t key = context.declare('\"\"');\n\t n = context.declare(0);\n\t\n\t if (addPropsCheck) {\n\t found = context.declare(false);\n\t }\n\t\n\t context.code(keys + ' = Object.keys(' + context.path + ')');\n\t\n\t context.code('for (' + n + ' = 0; ' + n + ' < ' + keys + '.length; ' + n + '++) {')\n\t (key + ' = ' + keys + '[' + n + ']')\n\t\n\t ('if (' + context.path + '[' + key + '] === undefined) {')\n\t ('continue')\n\t ('}');\n\t\n\t if (addPropsCheck) {\n\t context.code(found + ' = false');\n\t }\n\t\n\t // validate pattern properties\n\t for (i = 0; i < patterns.length; i++) {\n\t pattern = patterns[i];\n\t\n\t context.code('if ((' + inlineRegex(pattern) + ').test(' + key + ')) {');\n\t\n\t context.descend(context.path + '[' + key + ']', patProps[pattern]);\n\t\n\t if (addPropsCheck) {\n\t context.code(found + ' = true');\n\t }\n\t\n\t context.code('}');\n\t }\n\t\n\t // validate additional properties\n\t if (addPropsCheck) {\n\t if (propKeys.length) {\n\t props = context.declare(JSON.stringify(propKeys));\n\t\n\t // do not validate regular properties\n\t context.code('if (' + props + '.indexOf(' + key + ') > -1) {')\n\t ('continue')\n\t ('}');\n\t }\n\t\n\t context.code('if (!' + found + ') {');\n\t\n\t if (addProps === false) {\n\t // do not allow additional properties\n\t context.error('additionalProperties', undefined, key);\n\t }\n\t else {\n\t // validate additional properties\n\t context.descend(context.path + '[' + key + ']', addProps);\n\t }\n\t\n\t context.code('}');\n\t }\n\t\n\t context.code('}');\n\t};\n\t\n\tkeywords.dependencies = function (context) {\n\t if (type(context.schema.dependencies) !== 'object') {\n\t return;\n\t }\n\t\n\t var depKeys = Object.keys(context.schema.dependencies),\n\t len = depKeys.length,\n\t key, dep, i = 0, k = 0;\n\t\n\t for (; k < len; k++) {\n\t key = depKeys[k];\n\t dep = context.schema.dependencies[key];\n\t\n\t context.code('if (' + appendToPath(context.path, key) + ' !== undefined) {');\n\t\n\t if (type(dep) === 'object') {\n\t //schema dependency\n\t context.descend(context.path, dep);\n\t }\n\t else {\n\t // property dependency\n\t for (i; i < dep.length; i++) {\n\t context.code('if (' + appendToPath(context.path, dep[i]) + ' === undefined) {');\n\t context.error('dependencies', dep[i]);\n\t context.code('}');\n\t }\n\t }\n\t\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.allOf = function (context) {\n\t if (!Array.isArray(context.schema.allOf)) {\n\t return;\n\t }\n\t\n\t for (var i = 0; i < context.schema.allOf.length; i++) {\n\t context.descend(context.path, context.schema.allOf[i]);\n\t }\n\t};\n\t\n\tkeywords.anyOf = function (context) {\n\t if (!Array.isArray(context.schema.anyOf)) {\n\t return;\n\t }\n\t\n\t var greedy = context.greedy,\n\t errCount = context.declare(0),\n\t initialCount = context.declare(0),\n\t found = context.declare(false),\n\t i = 0;\n\t\n\t context.code(initialCount + ' = errors.length');\n\t\n\t for (; i < context.schema.anyOf.length; i++) {\n\t context.code('if (!' + found + ') {');\n\t\n\t context.code(errCount + ' = errors.length');\n\t\n\t context.greedy = true;\n\t\n\t context.descend(context.path, context.schema.anyOf[i]);\n\t\n\t context.code(found + ' = errors.length === ' + errCount)\n\t ('}');\n\t }\n\t\n\t context.greedy = greedy;\n\t\n\t context.code('if (!' + found + ') {');\n\t\n\t context.error('anyOf');\n\t\n\t context.code('} else {')\n\t ('errors.length = ' + initialCount)\n\t ('}');\n\t};\n\t\n\tkeywords.oneOf = function (context) {\n\t if (!Array.isArray(context.schema.oneOf)) {\n\t return;\n\t }\n\t\n\t var greedy = context.greedy,\n\t matching = context.declare(0),\n\t initialCount = context.declare(0),\n\t errCount = context.declare(0),\n\t i = 0;\n\t\n\t context.code(initialCount + ' = errors.length');\n\t context.code(matching + ' = 0');\n\t\n\t for (; i < context.schema.oneOf.length; i++) {\n\t context.code(errCount + ' = errors.length');\n\t\n\t context.greedy = true;\n\t\n\t context.descend(context.path, context.schema.oneOf[i]);\n\t\n\t context.code('if (errors.length === ' + errCount + ') {')\n\t (matching + '++')\n\t ('}');\n\t }\n\t\n\t context.greedy = greedy;\n\t\n\t context.code('if (' + matching + ' !== 1) {');\n\t\n\t context.error('oneOf');\n\t\n\t context.code('} else {')\n\t ('errors.length = ' + initialCount)\n\t ('}');\n\t};\n\t\n\tkeywords.not = function (context) {\n\t if (type(context.schema.not) !== 'object') {\n\t return;\n\t }\n\t\n\t var greedy = context.greedy,\n\t errCount = context.declare(0);\n\t\n\t context.code(errCount + ' = errors.length');\n\t\n\t context.greedy = true;\n\t\n\t context.descend(context.path, context.schema.not);\n\t\n\t context.greedy = greedy;\n\t\n\t context.code('if (errors.length === ' + errCount + ') {');\n\t\n\t context.error('not');\n\t\n\t context.code('} else {')\n\t ('errors.length = ' + errCount)\n\t ('}');\n\t};\n\t\n\tfunction decorateGenerator(type, keyword) {\n\t keywords[keyword].type = type;\n\t keywords[keyword].keyword = keyword;\n\t}\n\t\n\t['minimum', 'exclusiveMinimum', 'maximum', 'exclusiveMaximum', 'multipleOf']\n\t .forEach(decorateGenerator.bind(null, 'number'));\n\t\n\t['minLength', 'maxLength', 'pattern', 'format']\n\t .forEach(decorateGenerator.bind(null, 'string'));\n\t\n\t['minItems', 'maxItems', 'additionalItems', 'uniqueItems', 'items']\n\t .forEach(decorateGenerator.bind(null, 'array'));\n\t\n\t['maxProperties', 'minProperties', 'required', 'properties', 'patternProperties', 'additionalProperties', 'dependencies']\n\t .forEach(decorateGenerator.bind(null, 'object'));\n\t\n\t['enum', 'allOf', 'anyOf', 'oneOf', 'not']\n\t .forEach(decorateGenerator.bind(null, null));\n\t\n\tfunction groupKeywords(schema) {\n\t var keys = Object.keys(schema),\n\t propIndex = keys.indexOf('properties'),\n\t patIndex = keys.indexOf('patternProperties'),\n\t ret = {\n\t enum: Array.isArray(schema.enum) && schema.enum.length > 0,\n\t type: null,\n\t allType: [],\n\t perType: {}\n\t },\n\t key, gen, i;\n\t\n\t if (schema.type) {\n\t if (typeof schema.type === 'string') {\n\t ret.type = [schema.type];\n\t }\n\t else if (Array.isArray(schema.type) && schema.type.length) {\n\t ret.type = schema.type.slice(0);\n\t }\n\t }\n\t\n\t for (i = 0; i < keys.length; i++) {\n\t key = keys[i];\n\t\n\t if (key === 'enum' || key === 'type') {\n\t continue;\n\t }\n\t\n\t gen = keywords[key];\n\t\n\t if (!gen) {\n\t continue;\n\t }\n\t\n\t if (gen.type) {\n\t if (!ret.perType[gen.type]) {\n\t ret.perType[gen.type] = [];\n\t }\n\t\n\t if (!(propIndex > -1 && key === 'required') &&\n\t !(patIndex > -1 && key === 'additionalProperties')) {\n\t ret.perType[gen.type].push(key);\n\t }\n\t }\n\t else {\n\t ret.allType.push(key);\n\t }\n\t }\n\t\n\t return ret;\n\t}\n\t\n\tfunction getPathExpression(path, key) {\n\t var path_ = path.substr(4),\n\t len = path_.length,\n\t tokens = [],\n\t token = '',\n\t isvar = false,\n\t char, i;\n\t\n\t for (i = 0; i < len; i++) {\n\t char = path_[i];\n\t\n\t switch (char) {\n\t case '.':\n\t if (token) {\n\t token += char;\n\t }\n\t break;\n\t case '[':\n\t if (isNaN(+path_[i + 1])) {\n\t isvar = true;\n\t\n\t if (token) {\n\t tokens.push('\"' + token + '\"');\n\t token = '';\n\t }\n\t }\n\t else {\n\t isvar = false;\n\t\n\t if (token) {\n\t token += '.';\n\t }\n\t }\n\t break;\n\t case ']':\n\t tokens.push(isvar ? token : '\"' + token + '\"');\n\t token = '';\n\t break;\n\t default:\n\t token += char;\n\t }\n\t }\n\t\n\t if (token) {\n\t tokens.push('\"' + token + '\"');\n\t }\n\t\n\t if (key) {\n\t tokens.push('\"' + key + '\"');\n\t }\n\t\n\t if (tokens.length === 1 && isvar) {\n\t return '\"\" + ' + tokens[0] + ' + \"\"';\n\t }\n\t\n\t return tokens.join(' + \".\" + ') || '\"\"';\n\t}\n\t\n\tfunction clone(obj) {\n\t var cloned = obj,\n\t objType = type(obj),\n\t keys, len, key, i;\n\t\n\t if (objType === 'object') {\n\t cloned = {};\n\t keys = Object.keys(obj);\n\t\n\t for (i = 0, len = keys.length; i < len; i++) {\n\t key = keys[i];\n\t cloned[key] = clone(obj[key]);\n\t }\n\t }\n\t else if (objType === 'array') {\n\t cloned = [];\n\t\n\t for (i = 0, len = obj.length; i < len; i++) {\n\t cloned[i] = clone(obj[i]);\n\t }\n\t }\n\t else if (objType === 'regexp') {\n\t return new RegExp(obj);\n\t }\n\t else if (objType === 'date') {\n\t return new Date(obj.toJSON());\n\t }\n\t\n\t return cloned;\n\t}\n\t\n\tfunction equalAny(obj, options) {\n\t for (var i = 0, len = options.length; i < len; i++) {\n\t if (equal(obj, options[i])) {\n\t return true;\n\t }\n\t }\n\t\n\t return false;\n\t}\n\t\n\tfunction PropertyMarker() {\n\t this.objects = [];\n\t this.properties = [];\n\t}\n\t\n\tPropertyMarker.prototype.mark = function (obj, key) {\n\t var index = this.objects.indexOf(obj),\n\t prop;\n\t\n\t if (index < 0) {\n\t this.objects.push(obj);\n\t\n\t prop = {};\n\t prop[key] = 1;\n\t\n\t this.properties.push(prop);\n\t\n\t return;\n\t }\n\t\n\t prop = this.properties[index];\n\t\n\t prop[key] = prop[key] ? prop[key] + 1 : 1;\n\t};\n\t\n\tPropertyMarker.prototype.deleteDuplicates = function () {\n\t var props, keys, key, i, j;\n\t\n\t for (i = 0; i < this.properties.length; i++) {\n\t props = this.properties[i];\n\t keys = Object.keys(props);\n\t\n\t for (j = 0; j < keys.length; j++) {\n\t key = keys[j];\n\t\n\t if (props[key] > 1) {\n\t delete this.objects[i][key];\n\t }\n\t }\n\t }\n\t};\n\t\n\tPropertyMarker.prototype.dispose = function () {\n\t this.objects.length = 0;\n\t this.properties.length = 0;\n\t};\n\t\n\tfunction build(schema, def, additional, resolver, parentMarker) {\n\t var defType, defValue, key, i, propertyMarker, props, defProps;\n\t\n\t if (type(schema) !== 'object') {\n\t return def;\n\t }\n\t\n\t schema = resolver.resolve(schema);\n\t\n\t if (def === undefined && schema.hasOwnProperty('default')) {\n\t def = clone(schema['default']);\n\t }\n\t\n\t defType = type(def);\n\t\n\t if (defType === 'object' && type(schema.properties) === 'object') {\n\t props = Object.keys(schema.properties);\n\t\n\t for (i = 0; i < props.length; i++) {\n\t key = props[i];\n\t defValue = build(schema.properties[key], def[key], additional, resolver);\n\t\n\t if (defValue !== undefined) {\n\t def[key] = defValue;\n\t }\n\t }\n\t\n\t if (additional !== 'always') {\n\t defProps = Object.keys(def);\n\t\n\t for (i = 0; i < defProps.length; i++) {\n\t key = defProps[i];\n\t\n\t if (props.indexOf(key) < 0 &&\n\t (schema.additionalProperties === false ||\n\t (additional === false && !schema.additionalProperties))) {\n\t\n\t if (parentMarker) {\n\t parentMarker.mark(def, key);\n\t }\n\t else {\n\t delete def[key];\n\t }\n\t }\n\t }\n\t }\n\t }\n\t else if (defType === 'array' && schema.items) {\n\t if (type(schema.items) === 'array') {\n\t for (i = 0; i < schema.items.length; i++) {\n\t defValue = build(schema.items[i], def[i], additional, resolver);\n\t\n\t if (defValue !== undefined || i < def.length) {\n\t def[i] = defValue;\n\t }\n\t }\n\t }\n\t else if (def.length) {\n\t for (i = 0; i < def.length; i++) {\n\t def[i] = build(schema.items, def[i], additional, resolver);\n\t }\n\t }\n\t }\n\t else if (type(schema.allOf) === 'array' && schema.allOf.length) {\n\t propertyMarker = new PropertyMarker();\n\t\n\t for (i = 0; i < schema.allOf.length; i++) {\n\t def = build(schema.allOf[i], def, additional, resolver, propertyMarker);\n\t }\n\t\n\t propertyMarker.deleteDuplicates();\n\t propertyMarker.dispose();\n\t }\n\t\n\t return def;\n\t}\n\t\n\tfunction ValidationContext(options) {\n\t this.path = 'data';\n\t this.schema = options.schema;\n\t this.formats = options.formats;\n\t this.greedy = options.greedy;\n\t this.resolver = options.resolver;\n\t this.id = options.id;\n\t this.funcache = options.funcache || {};\n\t this.scope = options.scope || {\n\t equalAny: equalAny,\n\t unique: unique,\n\t ucs2length: ucs2length,\n\t refs: {}\n\t };\n\t}\n\t\n\tValidationContext.prototype.clone = function (schema) {\n\t var ctx = new ValidationContext({\n\t schema: schema,\n\t formats: this.formats,\n\t greedy: this.greedy,\n\t resolver: this.resolver,\n\t id: this.id,\n\t funcache: this.funcache,\n\t scope: this.scope\n\t });\n\t\n\t return ctx;\n\t};\n\t\n\tValidationContext.prototype.declare = function (def) {\n\t var variname = this.id();\n\t this.code.def(variname, def);\n\t return variname;\n\t};\n\t\n\tValidationContext.prototype.cache = function (cacheKey, schema) {\n\t var cached = this.funcache[cacheKey],\n\t context;\n\t\n\t if (!cached) {\n\t cached = this.funcache[cacheKey] = {\n\t key: this.id()\n\t };\n\t\n\t context = this.clone(schema);\n\t\n\t cached.func = context.compile(cached.key);\n\t\n\t this.scope.refs[cached.key] = cached.func;\n\t\n\t context.dispose();\n\t }\n\t\n\t return 'refs.' + cached.key;\n\t};\n\t\n\tValidationContext.prototype.error = function (keyword, key, additional) {\n\t var schema = this.schema,\n\t path = this.path,\n\t errorPath = path !== 'data' || key ?\n\t '(path ? path + \".\" : \"\") + ' + getPathExpression(path, key) + ',' :\n\t 'path,',\n\t res = key && schema.properties && schema.properties[key] ?\n\t this.resolver.resolve(schema.properties[key]) : null,\n\t message = res ? res.requiredMessage : schema.invalidMessage;\n\t\n\t if (!message) {\n\t message = (res && res.messages && res.messages[keyword]) ||\n\t (schema.messages && schema.messages[keyword]);\n\t }\n\t\n\t this.code('errors.push({');\n\t\n\t if (message) {\n\t this.code('message: ' + encodeStr(message) + ',');\n\t }\n\t\n\t if (additional) {\n\t this.code('additionalProperties: ' + additional + ',');\n\t }\n\t\n\t this.code('path: ' + errorPath)\n\t ('keyword: ' + encodeStr(keyword))\n\t ('})');\n\t\n\t if (!this.greedy) {\n\t this.code('return');\n\t }\n\t};\n\t\n\tValidationContext.prototype.refactor = function (path, schema, cacheKey) {\n\t var parentPathExp = path !== 'data' ?\n\t '(path ? path + \".\" : \"\") + ' + getPathExpression(path) :\n\t 'path',\n\t cachedRef = this.cache(cacheKey, schema),\n\t refErrors = this.declare();\n\t\n\t this.code(refErrors + ' = ' + cachedRef + '(' + path + ', ' + parentPathExp + ', errors)');\n\t\n\t if (!this.greedy) {\n\t this.code('if (errors.length) { return }');\n\t }\n\t};\n\t\n\tValidationContext.prototype.descend = function (path, schema) {\n\t var origPath = this.path,\n\t origSchema = this.schema;\n\t\n\t this.path = path;\n\t this.schema = schema;\n\t\n\t this.generate();\n\t\n\t this.path = origPath;\n\t this.schema = origSchema;\n\t};\n\t\n\tValidationContext.prototype.generate = function () {\n\t var path = this.path,\n\t schema = this.schema,\n\t context = this,\n\t scope = this.scope,\n\t encodedFormat,\n\t format,\n\t schemaKeys,\n\t typeKeys,\n\t typeIndex,\n\t validatedType,\n\t i;\n\t\n\t if (type(schema) !== 'object') {\n\t return;\n\t }\n\t\n\t if (schema.$ref !== undefined) {\n\t schema = this.resolver.resolve(schema);\n\t\n\t if (this.resolver.hasRef(schema)) {\n\t this.refactor(path, schema,\n\t this.resolver.getNormalizedRef(this.schema) || this.schema.$ref);\n\t\n\t return;\n\t }\n\t else {\n\t // substitute $ref schema with the resolved instance\n\t this.schema = schema;\n\t }\n\t }\n\t\n\t schemaKeys = groupKeywords(schema);\n\t\n\t if (schemaKeys.enum) {\n\t keywords.enum(context);\n\t\n\t return; // do not process the schema further\n\t }\n\t\n\t typeKeys = Object.keys(schemaKeys.perType);\n\t\n\t function generateForKeyword(keyword) {\n\t keywords[keyword](context); // jshint ignore: line\n\t }\n\t\n\t for (i = 0; i < typeKeys.length; i++) {\n\t validatedType = typeKeys[i];\n\t\n\t this.code((i ? 'else ' : '') + 'if (' + types[validatedType](path) + ') {');\n\t\n\t schemaKeys.perType[validatedType].forEach(generateForKeyword);\n\t\n\t this.code('}');\n\t\n\t if (schemaKeys.type) {\n\t typeIndex = schemaKeys.type.indexOf(validatedType);\n\t\n\t if (typeIndex > -1) {\n\t schemaKeys.type.splice(typeIndex, 1);\n\t }\n\t }\n\t }\n\t\n\t if (schemaKeys.type) { // we have types in the schema\n\t if (schemaKeys.type.length) { // case 1: we still have some left to check\n\t this.code((typeKeys.length ? 'else ' : '') + 'if (!(' + schemaKeys.type.map(function (type) {\n\t return types[type] ? types[type](path) : 'true';\n\t }).join(' || ') + ')) {');\n\t this.error('type');\n\t this.code('}');\n\t }\n\t else {\n\t this.code('else {'); // case 2: we don't have any left to check\n\t this.error('type');\n\t this.code('}');\n\t }\n\t }\n\t\n\t schemaKeys.allType.forEach(function (keyword) {\n\t keywords[keyword](context);\n\t });\n\t\n\t if (schema.format && this.formats) {\n\t format = this.formats[schema.format];\n\t\n\t if (format) {\n\t if (typeof format === 'string' || format instanceof RegExp) {\n\t this.code('if (!(' + inlineRegex(format) + ').test(' + path + ')) {');\n\t this.error('format');\n\t this.code('}');\n\t }\n\t else if (typeof format === 'function') {\n\t (scope.formats || (scope.formats = {}))[schema.format] = format;\n\t (scope.schemas || (scope.schemas = {}))[schema.format] = schema;\n\t\n\t encodedFormat = encodeStr(schema.format);\n\t\n\t this.code('if (!formats[' + encodedFormat + '](' + path + ', schemas[' + encodedFormat + '])) {');\n\t this.error('format');\n\t this.code('}');\n\t }\n\t }\n\t }\n\t};\n\t\n\tValidationContext.prototype.compile = function (id) {\n\t this.code = func('jsen_compiled' + (id ? '_' + id : ''), 'data', 'path', 'errors');\n\t this.generate();\n\t\n\t return this.code.compile(this.scope);\n\t};\n\t\n\tValidationContext.prototype.dispose = function () {\n\t for (var key in this) {\n\t this[key] = undefined;\n\t }\n\t};\n\t\n\tfunction jsen(schema, options) {\n\t if (type(schema) !== 'object') {\n\t throw new Error(INVALID_SCHEMA);\n\t }\n\t\n\t options = options || {};\n\t\n\t var counter = 0,\n\t id = function () { return 'i' + (counter++); },\n\t resolver = new SchemaResolver(schema, options.schemas, options.missing$Ref || false),\n\t context = new ValidationContext({\n\t schema: schema,\n\t resolver: resolver,\n\t id: id,\n\t schemas: options.schemas,\n\t formats: options.formats,\n\t greedy: options.greedy || false\n\t }),\n\t compiled = func('validate', 'data')\n\t ('validate.errors = []')\n\t ('gen(data, \"\", validate.errors)')\n\t ('return validate.errors.length === 0')\n\t .compile({ gen: context.compile() });\n\t\n\t context.dispose();\n\t context = null;\n\t\n\t compiled.errors = [];\n\t\n\t compiled.build = function (initial, options) {\n\t return build(\n\t schema,\n\t (options && options.copy === false ? initial : clone(initial)),\n\t options && options.additionalProperties,\n\t resolver);\n\t };\n\t\n\t return compiled;\n\t}\n\t\n\tjsen.browser = browser;\n\tjsen.clone = clone;\n\tjsen.equal = equal;\n\tjsen.unique = unique;\n\tjsen.ucs2length = ucs2length;\n\tjsen.SchemaResolver = SchemaResolver;\n\tjsen.resolve = SchemaResolver.resolvePointer;\n\t\n\tmodule.exports = jsen;\n\n\n/***/ },\n/* 12 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = function func() {\n\t var args = Array.apply(null, arguments),\n\t name = args.shift(),\n\t tab = ' ',\n\t lines = '',\n\t vars = '',\n\t ind = 1, // indentation\n\t bs = '{[', // block start\n\t be = '}]', // block end\n\t space = function () {\n\t var sp = tab, i = 0;\n\t while (i++ < ind - 1) { sp += tab; }\n\t return sp;\n\t },\n\t add = function (line) {\n\t lines += space() + line + '\\n';\n\t },\n\t builder = function (line) {\n\t var first = line[0],\n\t last = line[line.length - 1];\n\t\n\t if (be.indexOf(first) > -1 && bs.indexOf(last) > -1) {\n\t ind--;\n\t add(line);\n\t ind++;\n\t }\n\t else if (bs.indexOf(last) > -1) {\n\t add(line);\n\t ind++;\n\t }\n\t else if (be.indexOf(first) > -1) {\n\t ind--;\n\t add(line);\n\t }\n\t else {\n\t add(line);\n\t }\n\t\n\t return builder;\n\t };\n\t\n\t builder.def = function (id, def) {\n\t vars += (vars ? ',\\n' + tab + ' ' : '') + id + (def !== undefined ? ' = ' + def : '');\n\t return builder;\n\t };\n\t\n\t builder.toSource = function () {\n\t return 'function ' + name + '(' + args.join(', ') + ') {\\n' +\n\t tab + '\"use strict\"' + '\\n' +\n\t (vars ? tab + 'var ' + vars + ';\\n' : '') +\n\t lines + '}';\n\t };\n\t\n\t builder.compile = function (scope) {\n\t var src = 'return (' + builder.toSource() + ')',\n\t scp = scope || {},\n\t keys = Object.keys(scp),\n\t vals = keys.map(function (key) { return scp[key]; });\n\t\n\t return Function.apply(null, keys.concat(src)).apply(null, vals);\n\t };\n\t\n\t return builder;\n\t};\n\n/***/ },\n/* 13 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tfunction type(obj) {\n\t var str = Object.prototype.toString.call(obj);\n\t return str.substr(8, str.length - 9).toLowerCase();\n\t}\n\t\n\tfunction deepEqual(a, b) {\n\t var keysA = Object.keys(a).sort(),\n\t keysB = Object.keys(b).sort(),\n\t i, key;\n\t\n\t if (!equal(keysA, keysB)) {\n\t return false;\n\t }\n\t\n\t for (i = 0; i < keysA.length; i++) {\n\t key = keysA[i];\n\t\n\t if (!equal(a[key], b[key])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t}\n\t\n\tfunction equal(a, b) { // jshint ignore: line\n\t var typeA = typeof a,\n\t typeB = typeof b,\n\t i;\n\t\n\t // get detailed object type\n\t if (typeA === 'object') {\n\t typeA = type(a);\n\t }\n\t\n\t // get detailed object type\n\t if (typeB === 'object') {\n\t typeB = type(b);\n\t }\n\t\n\t if (typeA !== typeB) {\n\t return false;\n\t }\n\t\n\t if (typeA === 'object') {\n\t return deepEqual(a, b);\n\t }\n\t\n\t if (typeA === 'regexp') {\n\t return a.toString() === b.toString();\n\t }\n\t\n\t if (typeA === 'array') {\n\t if (a.length !== b.length) {\n\t return false;\n\t }\n\t\n\t for (i = 0; i < a.length; i++) {\n\t if (!equal(a[i], b[i])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t }\n\t\n\t return a === b;\n\t}\n\t\n\tmodule.exports = equal;\n\n/***/ },\n/* 14 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar equal = __webpack_require__(13);\n\t\n\tfunction findIndex(arr, value, comparator) {\n\t for (var i = 0, len = arr.length; i < len; i++) {\n\t if (comparator(arr[i], value)) {\n\t return i;\n\t }\n\t }\n\t\n\t return -1;\n\t}\n\t\n\tmodule.exports = function unique(arr) {\n\t return arr.filter(function uniqueOnly(value, index, self) {\n\t return findIndex(self, value, equal) === index;\n\t });\n\t};\n\t\n\tmodule.exports.findIndex = findIndex;\n\n/***/ },\n/* 15 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar url = __webpack_require__(16),\n\t metaschema = __webpack_require__(23),\n\t INVALID_SCHEMA_REFERENCE = 'jsen: invalid schema reference',\n\t DUPLICATE_SCHEMA_ID = 'jsen: duplicate schema id',\n\t CIRCULAR_SCHEMA_REFERENCE = 'jsen: circular schema reference';\n\t\n\tfunction get(obj, path) {\n\t if (!path.length) {\n\t return obj;\n\t }\n\t\n\t var key = path.shift(),\n\t val;\n\t\n\t if (obj && typeof obj === 'object' && obj.hasOwnProperty(key)) {\n\t val = obj[key];\n\t }\n\t\n\t if (path.length) {\n\t if (val && typeof val === 'object') {\n\t return get(val, path);\n\t }\n\t\n\t return undefined;\n\t }\n\t\n\t return val;\n\t}\n\t\n\tfunction refToObj(ref) {\n\t var index = ref.indexOf('#'),\n\t ret = {\n\t base: ref.substr(0, index),\n\t path: []\n\t };\n\t\n\t if (index < 0) {\n\t ret.base = ref;\n\t return ret;\n\t }\n\t\n\t ref = ref.substr(index + 1);\n\t\n\t if (!ref) {\n\t return ret;\n\t }\n\t\n\t ret.path = ref.split('/').map(function (segment) {\n\t // Reference: http://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-08#section-3\n\t return decodeURIComponent(segment)\n\t .replace(/~1/g, '/')\n\t .replace(/~0/g, '~');\n\t });\n\t\n\t if (ref[0] === '/') {\n\t ret.path.shift();\n\t }\n\t\n\t return ret;\n\t}\n\t\n\t// TODO: Can we prevent nested resolvers and combine schemas instead?\n\tfunction SchemaResolver(rootSchema, external, missing$Ref, baseId) { // jshint ignore: line\n\t this.rootSchema = rootSchema;\n\t this.resolvers = null;\n\t this.resolvedRootSchema = null;\n\t this.cache = {};\n\t this.idCache = {};\n\t this.refCache = { refs: [], schemas: [] };\n\t this.missing$Ref = missing$Ref;\n\t this.refStack = [];\n\t\n\t baseId = baseId || '';\n\t\n\t this._buildIdCache(rootSchema, baseId);\n\t\n\t // get updated base id after normalizing root schema id\n\t baseId = this.refCache.refs[this.refCache.schemas.indexOf(this.rootSchema)] || baseId;\n\t\n\t this._buildResolvers(external, baseId);\n\t}\n\t\n\tSchemaResolver.prototype._cacheId = function (id, schema, resolver) {\n\t if (this.idCache[id]) {\n\t throw new Error(DUPLICATE_SCHEMA_ID + ' ' + id);\n\t }\n\t\n\t this.idCache[id] = { resolver: resolver, schema: schema };\n\t};\n\t\n\tSchemaResolver.prototype._buildIdCache = function (schema, baseId) {\n\t var id = baseId,\n\t ref, keys, i;\n\t\n\t if (!schema || typeof schema !== 'object') {\n\t return;\n\t }\n\t\n\t if (typeof schema.id === 'string' && schema.id) {\n\t id = url.resolve(baseId, schema.id);\n\t\n\t this._cacheId(id, schema, this);\n\t }\n\t else if (schema === this.rootSchema && baseId) {\n\t this._cacheId(baseId, schema, this);\n\t }\n\t\n\t if (schema.$ref && typeof schema.$ref === 'string') {\n\t ref = url.resolve(id, schema.$ref);\n\t\n\t this.refCache.schemas.push(schema);\n\t this.refCache.refs.push(ref);\n\t }\n\t\n\t keys = Object.keys(schema);\n\t\n\t for (i = 0; i < keys.length; i++) {\n\t this._buildIdCache(schema[keys[i]], id);\n\t }\n\t};\n\t\n\tSchemaResolver.prototype._buildResolvers = function (schemas, baseId) {\n\t if (!schemas || typeof schemas !== 'object') {\n\t return;\n\t }\n\t\n\t var that = this,\n\t resolvers = {};\n\t\n\t Object.keys(schemas).forEach(function (key) {\n\t var id = url.resolve(baseId, key),\n\t resolver = new SchemaResolver(schemas[key], null, that.missing$Ref, id);\n\t\n\t that._cacheId(id, resolver.rootSchema, resolver);\n\t\n\t Object.keys(resolver.idCache).forEach(function (idKey) {\n\t that.idCache[idKey] = resolver.idCache[idKey];\n\t });\n\t\n\t resolvers[key] = resolver;\n\t });\n\t\n\t this.resolvers = resolvers;\n\t};\n\t\n\tSchemaResolver.prototype.getNormalizedRef = function (schema) {\n\t var index = this.refCache.schemas.indexOf(schema);\n\t return this.refCache.refs[index];\n\t};\n\t\n\tSchemaResolver.prototype._resolveRef = function (ref) {\n\t var err = new Error(INVALID_SCHEMA_REFERENCE + ' ' + ref),\n\t idCache = this.idCache,\n\t externalResolver, cached, descriptor, path, dest;\n\t\n\t if (!ref || typeof ref !== 'string') {\n\t throw err;\n\t }\n\t\n\t if (ref === metaschema.id) {\n\t dest = metaschema;\n\t }\n\t\n\t cached = idCache[ref];\n\t\n\t if (cached) {\n\t dest = cached.resolver.resolve(cached.schema);\n\t }\n\t\n\t if (dest === undefined) {\n\t descriptor = refToObj(ref);\n\t path = descriptor.path;\n\t\n\t if (descriptor.base) {\n\t cached = idCache[descriptor.base] || idCache[descriptor.base + '#'];\n\t\n\t if (cached) {\n\t dest = cached.resolver.resolve(get(cached.schema, path.slice(0)));\n\t }\n\t else {\n\t path.unshift(descriptor.base);\n\t }\n\t }\n\t }\n\t\n\t if (dest === undefined && this.resolvedRootSchema) {\n\t dest = get(this.resolvedRootSchema, path.slice(0));\n\t }\n\t\n\t if (dest === undefined) {\n\t dest = get(this.rootSchema, path.slice(0));\n\t }\n\t\n\t if (dest === undefined && path.length && this.resolvers) {\n\t externalResolver = get(this.resolvers, path);\n\t\n\t if (externalResolver) {\n\t dest = externalResolver.resolve(externalResolver.rootSchema);\n\t }\n\t }\n\t\n\t if (dest === undefined || typeof dest !== 'object') {\n\t if (this.missing$Ref) {\n\t dest = {};\n\t } else {\n\t throw err;\n\t }\n\t }\n\t\n\t if (this.cache[ref] === dest) {\n\t return dest;\n\t }\n\t\n\t this.cache[ref] = dest;\n\t\n\t if (dest.$ref !== undefined) {\n\t dest = this.resolve(dest);\n\t }\n\t\n\t return dest;\n\t};\n\t\n\tSchemaResolver.prototype.resolve = function (schema) {\n\t if (!schema || typeof schema !== 'object' || schema.$ref === undefined) {\n\t return schema;\n\t }\n\t\n\t var ref = this.getNormalizedRef(schema) || schema.$ref,\n\t resolved = this.cache[ref];\n\t\n\t if (resolved !== undefined) {\n\t return resolved;\n\t }\n\t\n\t if (this.refStack.indexOf(ref) > -1) {\n\t throw new Error(CIRCULAR_SCHEMA_REFERENCE + ' ' + ref);\n\t }\n\t\n\t this.refStack.push(ref);\n\t\n\t resolved = this._resolveRef(ref);\n\t\n\t this.refStack.pop();\n\t\n\t if (schema === this.rootSchema) {\n\t // cache the resolved root schema\n\t this.resolvedRootSchema = resolved;\n\t }\n\t\n\t return resolved;\n\t};\n\t\n\tSchemaResolver.prototype.hasRef = function (schema) {\n\t var keys = Object.keys(schema),\n\t len, key, i, hasChildRef;\n\t\n\t if (keys.indexOf('$ref') > -1) {\n\t return true;\n\t }\n\t\n\t for (i = 0, len = keys.length; i < len; i++) {\n\t key = keys[i];\n\t\n\t if (schema[key] && typeof schema[key] === 'object' && !Array.isArray(schema[key])) {\n\t hasChildRef = this.hasRef(schema[key]);\n\t\n\t if (hasChildRef) {\n\t return true;\n\t }\n\t }\n\t }\n\t\n\t return false;\n\t};\n\t\n\tSchemaResolver.resolvePointer = function (obj, pointer) {\n\t var descriptor = refToObj(pointer),\n\t path = descriptor.path;\n\t\n\t if (descriptor.base) {\n\t path = [descriptor.base].concat(path);\n\t }\n\t\n\t return get(obj, path);\n\t};\n\t\n\tmodule.exports = SchemaResolver;\n\n/***/ },\n/* 16 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t// Copyright Joyent, Inc. and other Node contributors.\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a\n\t// copy of this software and associated documentation files (the\n\t// \"Software\"), to deal in the Software without restriction, including\n\t// without limitation the rights to use, copy, modify, merge, publish,\n\t// distribute, sublicense, and/or sell copies of the Software, and to permit\n\t// persons to whom the Software is furnished to do so, subject to the\n\t// following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included\n\t// in all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n\t// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\t// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n\t// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n\t// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n\t// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n\t// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\t\n\t'use strict';\n\t\n\tvar punycode = __webpack_require__(17);\n\tvar util = __webpack_require__(19);\n\t\n\texports.parse = urlParse;\n\texports.resolve = urlResolve;\n\texports.resolveObject = urlResolveObject;\n\texports.format = urlFormat;\n\t\n\texports.Url = Url;\n\t\n\tfunction Url() {\n\t this.protocol = null;\n\t this.slashes = null;\n\t this.auth = null;\n\t this.host = null;\n\t this.port = null;\n\t this.hostname = null;\n\t this.hash = null;\n\t this.search = null;\n\t this.query = null;\n\t this.pathname = null;\n\t this.path = null;\n\t this.href = null;\n\t}\n\t\n\t// Reference: RFC 3986, RFC 1808, RFC 2396\n\t\n\t// define these here so at least they only have to be\n\t// compiled once on the first module load.\n\tvar protocolPattern = /^([a-z0-9.+-]+:)/i,\n\t portPattern = /:[0-9]*$/,\n\t\n\t // Special case for a simple path URL\n\t simplePathPattern = /^(\\/\\/?(?!\\/)[^\\?\\s]*)(\\?[^\\s]*)?$/,\n\t\n\t // RFC 2396: characters reserved for delimiting URLs.\n\t // We actually just auto-escape these.\n\t delims = ['<', '>', '\"', '`', ' ', '\\r', '\\n', '\\t'],\n\t\n\t // RFC 2396: characters not allowed for various reasons.\n\t unwise = ['{', '}', '|', '\\\\', '^', '`'].concat(delims),\n\t\n\t // Allowed by RFCs, but cause of XSS attacks. Always escape these.\n\t autoEscape = ['\\''].concat(unwise),\n\t // Characters that are never ever allowed in a hostname.\n\t // Note that any invalid chars are also handled, but these\n\t // are the ones that are *expected* to be seen, so we fast-path\n\t // them.\n\t nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape),\n\t hostEndingChars = ['/', '?', '#'],\n\t hostnameMaxLen = 255,\n\t hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,\n\t hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,\n\t // protocols that can allow \"unsafe\" and \"unwise\" chars.\n\t unsafeProtocol = {\n\t 'javascript': true,\n\t 'javascript:': true\n\t },\n\t // protocols that never have a hostname.\n\t hostlessProtocol = {\n\t 'javascript': true,\n\t 'javascript:': true\n\t },\n\t // protocols that always contain a // bit.\n\t slashedProtocol = {\n\t 'http': true,\n\t 'https': true,\n\t 'ftp': true,\n\t 'gopher': true,\n\t 'file': true,\n\t 'http:': true,\n\t 'https:': true,\n\t 'ftp:': true,\n\t 'gopher:': true,\n\t 'file:': true\n\t },\n\t querystring = __webpack_require__(20);\n\t\n\tfunction urlParse(url, parseQueryString, slashesDenoteHost) {\n\t if (url && util.isObject(url) && url instanceof Url) return url;\n\t\n\t var u = new Url;\n\t u.parse(url, parseQueryString, slashesDenoteHost);\n\t return u;\n\t}\n\t\n\tUrl.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {\n\t if (!util.isString(url)) {\n\t throw new TypeError(\"Parameter 'url' must be a string, not \" + typeof url);\n\t }\n\t\n\t // Copy chrome, IE, opera backslash-handling behavior.\n\t // Back slashes before the query string get converted to forward slashes\n\t // See: https://code.google.com/p/chromium/issues/detail?id=25916\n\t var queryIndex = url.indexOf('?'),\n\t splitter =\n\t (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#',\n\t uSplit = url.split(splitter),\n\t slashRegex = /\\\\/g;\n\t uSplit[0] = uSplit[0].replace(slashRegex, '/');\n\t url = uSplit.join(splitter);\n\t\n\t var rest = url;\n\t\n\t // trim before proceeding.\n\t // This is to support parse stuff like \" http://foo.com \\n\"\n\t rest = rest.trim();\n\t\n\t if (!slashesDenoteHost && url.split('#').length === 1) {\n\t // Try fast path regexp\n\t var simplePath = simplePathPattern.exec(rest);\n\t if (simplePath) {\n\t this.path = rest;\n\t this.href = rest;\n\t this.pathname = simplePath[1];\n\t if (simplePath[2]) {\n\t this.search = simplePath[2];\n\t if (parseQueryString) {\n\t this.query = querystring.parse(this.search.substr(1));\n\t } else {\n\t this.query = this.search.substr(1);\n\t }\n\t } else if (parseQueryString) {\n\t this.search = '';\n\t this.query = {};\n\t }\n\t return this;\n\t }\n\t }\n\t\n\t var proto = protocolPattern.exec(rest);\n\t if (proto) {\n\t proto = proto[0];\n\t var lowerProto = proto.toLowerCase();\n\t this.protocol = lowerProto;\n\t rest = rest.substr(proto.length);\n\t }\n\t\n\t // figure out if it's got a host\n\t // user@server is *always* interpreted as a hostname, and url\n\t // resolution will treat //foo/bar as host=foo,path=bar because that's\n\t // how the browser resolves relative URLs.\n\t if (slashesDenoteHost || proto || rest.match(/^\\/\\/[^@\\/]+@[^@\\/]+/)) {\n\t var slashes = rest.substr(0, 2) === '//';\n\t if (slashes && !(proto && hostlessProtocol[proto])) {\n\t rest = rest.substr(2);\n\t this.slashes = true;\n\t }\n\t }\n\t\n\t if (!hostlessProtocol[proto] &&\n\t (slashes || (proto && !slashedProtocol[proto]))) {\n\t\n\t // there's a hostname.\n\t // the first instance of /, ?, ;, or # ends the host.\n\t //\n\t // If there is an @ in the hostname, then non-host chars *are* allowed\n\t // to the left of the last @ sign, unless some host-ending character\n\t // comes *before* the @-sign.\n\t // URLs are obnoxious.\n\t //\n\t // ex:\n\t // http://a@b@c/ => user:a@b host:c\n\t // http://a@b?@c => user:a host:c path:/?@c\n\t\n\t // v0.12 TODO(isaacs): This is not quite how Chrome does things.\n\t // Review our test case against browsers more comprehensively.\n\t\n\t // find the first instance of any hostEndingChars\n\t var hostEnd = -1;\n\t for (var i = 0; i < hostEndingChars.length; i++) {\n\t var hec = rest.indexOf(hostEndingChars[i]);\n\t if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n\t hostEnd = hec;\n\t }\n\t\n\t // at this point, either we have an explicit point where the\n\t // auth portion cannot go past, or the last @ char is the decider.\n\t var auth, atSign;\n\t if (hostEnd === -1) {\n\t // atSign can be anywhere.\n\t atSign = rest.lastIndexOf('@');\n\t } else {\n\t // atSign must be in auth portion.\n\t // http://a@b/c@d => host:b auth:a path:/c@d\n\t atSign = rest.lastIndexOf('@', hostEnd);\n\t }\n\t\n\t // Now we have a portion which is definitely the auth.\n\t // Pull that off.\n\t if (atSign !== -1) {\n\t auth = rest.slice(0, atSign);\n\t rest = rest.slice(atSign + 1);\n\t this.auth = decodeURIComponent(auth);\n\t }\n\t\n\t // the host is the remaining to the left of the first non-host char\n\t hostEnd = -1;\n\t for (var i = 0; i < nonHostChars.length; i++) {\n\t var hec = rest.indexOf(nonHostChars[i]);\n\t if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n\t hostEnd = hec;\n\t }\n\t // if we still have not hit it, then the entire thing is a host.\n\t if (hostEnd === -1)\n\t hostEnd = rest.length;\n\t\n\t this.host = rest.slice(0, hostEnd);\n\t rest = rest.slice(hostEnd);\n\t\n\t // pull out port.\n\t this.parseHost();\n\t\n\t // we've indicated that there is a hostname,\n\t // so even if it's empty, it has to be present.\n\t this.hostname = this.hostname || '';\n\t\n\t // if hostname begins with [ and ends with ]\n\t // assume that it's an IPv6 address.\n\t var ipv6Hostname = this.hostname[0] === '[' &&\n\t this.hostname[this.hostname.length - 1] === ']';\n\t\n\t // validate a little.\n\t if (!ipv6Hostname) {\n\t var hostparts = this.hostname.split(/\\./);\n\t for (var i = 0, l = hostparts.length; i < l; i++) {\n\t var part = hostparts[i];\n\t if (!part) continue;\n\t if (!part.match(hostnamePartPattern)) {\n\t var newpart = '';\n\t for (var j = 0, k = part.length; j < k; j++) {\n\t if (part.charCodeAt(j) > 127) {\n\t // we replace non-ASCII char with a temporary placeholder\n\t // we need this to make sure size of hostname is not\n\t // broken by replacing non-ASCII by nothing\n\t newpart += 'x';\n\t } else {\n\t newpart += part[j];\n\t }\n\t }\n\t // we test again with ASCII char only\n\t if (!newpart.match(hostnamePartPattern)) {\n\t var validParts = hostparts.slice(0, i);\n\t var notHost = hostparts.slice(i + 1);\n\t var bit = part.match(hostnamePartStart);\n\t if (bit) {\n\t validParts.push(bit[1]);\n\t notHost.unshift(bit[2]);\n\t }\n\t if (notHost.length) {\n\t rest = '/' + notHost.join('.') + rest;\n\t }\n\t this.hostname = validParts.join('.');\n\t break;\n\t }\n\t }\n\t }\n\t }\n\t\n\t if (this.hostname.length > hostnameMaxLen) {\n\t this.hostname = '';\n\t } else {\n\t // hostnames are always lower case.\n\t this.hostname = this.hostname.toLowerCase();\n\t }\n\t\n\t if (!ipv6Hostname) {\n\t // IDNA Support: Returns a punycoded representation of \"domain\".\n\t // It only converts parts of the domain name that\n\t // have non-ASCII characters, i.e. it doesn't matter if\n\t // you call it with a domain that already is ASCII-only.\n\t this.hostname = punycode.toASCII(this.hostname);\n\t }\n\t\n\t var p = this.port ? ':' + this.port : '';\n\t var h = this.hostname || '';\n\t this.host = h + p;\n\t this.href += this.host;\n\t\n\t // strip [ and ] from the hostname\n\t // the host field still retains them, though\n\t if (ipv6Hostname) {\n\t this.hostname = this.hostname.substr(1, this.hostname.length - 2);\n\t if (rest[0] !== '/') {\n\t rest = '/' + rest;\n\t }\n\t }\n\t }\n\t\n\t // now rest is set to the post-host stuff.\n\t // chop off any delim chars.\n\t if (!unsafeProtocol[lowerProto]) {\n\t\n\t // First, make 100% sure that any \"autoEscape\" chars get\n\t // escaped, even if encodeURIComponent doesn't think they\n\t // need to be.\n\t for (var i = 0, l = autoEscape.length; i < l; i++) {\n\t var ae = autoEscape[i];\n\t if (rest.indexOf(ae) === -1)\n\t continue;\n\t var esc = encodeURIComponent(ae);\n\t if (esc === ae) {\n\t esc = escape(ae);\n\t }\n\t rest = rest.split(ae).join(esc);\n\t }\n\t }\n\t\n\t\n\t // chop off from the tail first.\n\t var hash = rest.indexOf('#');\n\t if (hash !== -1) {\n\t // got a fragment string.\n\t this.hash = rest.substr(hash);\n\t rest = rest.slice(0, hash);\n\t }\n\t var qm = rest.indexOf('?');\n\t if (qm !== -1) {\n\t this.search = rest.substr(qm);\n\t this.query = rest.substr(qm + 1);\n\t if (parseQueryString) {\n\t this.query = querystring.parse(this.query);\n\t }\n\t rest = rest.slice(0, qm);\n\t } else if (parseQueryString) {\n\t // no query string, but parseQueryString still requested\n\t this.search = '';\n\t this.query = {};\n\t }\n\t if (rest) this.pathname = rest;\n\t if (slashedProtocol[lowerProto] &&\n\t this.hostname && !this.pathname) {\n\t this.pathname = '/';\n\t }\n\t\n\t //to support http.request\n\t if (this.pathname || this.search) {\n\t var p = this.pathname || '';\n\t var s = this.search || '';\n\t this.path = p + s;\n\t }\n\t\n\t // finally, reconstruct the href based on what has been validated.\n\t this.href = this.format();\n\t return this;\n\t};\n\t\n\t// format a parsed object into a url string\n\tfunction urlFormat(obj) {\n\t // ensure it's an object, and not a string url.\n\t // If it's an obj, this is a no-op.\n\t // this way, you can call url_format() on strings\n\t // to clean up potentially wonky urls.\n\t if (util.isString(obj)) obj = urlParse(obj);\n\t if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n\t return obj.format();\n\t}\n\t\n\tUrl.prototype.format = function() {\n\t var auth = this.auth || '';\n\t if (auth) {\n\t auth = encodeURIComponent(auth);\n\t auth = auth.replace(/%3A/i, ':');\n\t auth += '@';\n\t }\n\t\n\t var protocol = this.protocol || '',\n\t pathname = this.pathname || '',\n\t hash = this.hash || '',\n\t host = false,\n\t query = '';\n\t\n\t if (this.host) {\n\t host = auth + this.host;\n\t } else if (this.hostname) {\n\t host = auth + (this.hostname.indexOf(':') === -1 ?\n\t this.hostname :\n\t '[' + this.hostname + ']');\n\t if (this.port) {\n\t host += ':' + this.port;\n\t }\n\t }\n\t\n\t if (this.query &&\n\t util.isObject(this.query) &&\n\t Object.keys(this.query).length) {\n\t query = querystring.stringify(this.query);\n\t }\n\t\n\t var search = this.search || (query && ('?' + query)) || '';\n\t\n\t if (protocol && protocol.substr(-1) !== ':') protocol += ':';\n\t\n\t // only the slashedProtocols get the //. Not mailto:, xmpp:, etc.\n\t // unless they had them to begin with.\n\t if (this.slashes ||\n\t (!protocol || slashedProtocol[protocol]) && host !== false) {\n\t host = '//' + (host || '');\n\t if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname;\n\t } else if (!host) {\n\t host = '';\n\t }\n\t\n\t if (hash && hash.charAt(0) !== '#') hash = '#' + hash;\n\t if (search && search.charAt(0) !== '?') search = '?' + search;\n\t\n\t pathname = pathname.replace(/[?#]/g, function(match) {\n\t return encodeURIComponent(match);\n\t });\n\t search = search.replace('#', '%23');\n\t\n\t return protocol + host + pathname + search + hash;\n\t};\n\t\n\tfunction urlResolve(source, relative) {\n\t return urlParse(source, false, true).resolve(relative);\n\t}\n\t\n\tUrl.prototype.resolve = function(relative) {\n\t return this.resolveObject(urlParse(relative, false, true)).format();\n\t};\n\t\n\tfunction urlResolveObject(source, relative) {\n\t if (!source) return relative;\n\t return urlParse(source, false, true).resolveObject(relative);\n\t}\n\t\n\tUrl.prototype.resolveObject = function(relative) {\n\t if (util.isString(relative)) {\n\t var rel = new Url();\n\t rel.parse(relative, false, true);\n\t relative = rel;\n\t }\n\t\n\t var result = new Url();\n\t var tkeys = Object.keys(this);\n\t for (var tk = 0; tk < tkeys.length; tk++) {\n\t var tkey = tkeys[tk];\n\t result[tkey] = this[tkey];\n\t }\n\t\n\t // hash is always overridden, no matter what.\n\t // even href=\"\" will remove it.\n\t result.hash = relative.hash;\n\t\n\t // if the relative url is empty, then there's nothing left to do here.\n\t if (relative.href === '') {\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t // hrefs like //foo/bar always cut to the protocol.\n\t if (relative.slashes && !relative.protocol) {\n\t // take everything except the protocol from relative\n\t var rkeys = Object.keys(relative);\n\t for (var rk = 0; rk < rkeys.length; rk++) {\n\t var rkey = rkeys[rk];\n\t if (rkey !== 'protocol')\n\t result[rkey] = relative[rkey];\n\t }\n\t\n\t //urlParse appends trailing / to urls like http://www.example.com\n\t if (slashedProtocol[result.protocol] &&\n\t result.hostname && !result.pathname) {\n\t result.path = result.pathname = '/';\n\t }\n\t\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t if (relative.protocol && relative.protocol !== result.protocol) {\n\t // if it's a known url protocol, then changing\n\t // the protocol does weird things\n\t // first, if it's not file:, then we MUST have a host,\n\t // and if there was a path\n\t // to begin with, then we MUST have a path.\n\t // if it is file:, then the host is dropped,\n\t // because that's known to be hostless.\n\t // anything else is assumed to be absolute.\n\t if (!slashedProtocol[relative.protocol]) {\n\t var keys = Object.keys(relative);\n\t for (var v = 0; v < keys.length; v++) {\n\t var k = keys[v];\n\t result[k] = relative[k];\n\t }\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t result.protocol = relative.protocol;\n\t if (!relative.host && !hostlessProtocol[relative.protocol]) {\n\t var relPath = (relative.pathname || '').split('/');\n\t while (relPath.length && !(relative.host = relPath.shift()));\n\t if (!relative.host) relative.host = '';\n\t if (!relative.hostname) relative.hostname = '';\n\t if (relPath[0] !== '') relPath.unshift('');\n\t if (relPath.length < 2) relPath.unshift('');\n\t result.pathname = relPath.join('/');\n\t } else {\n\t result.pathname = relative.pathname;\n\t }\n\t result.search = relative.search;\n\t result.query = relative.query;\n\t result.host = relative.host || '';\n\t result.auth = relative.auth;\n\t result.hostname = relative.hostname || relative.host;\n\t result.port = relative.port;\n\t // to support http.request\n\t if (result.pathname || result.search) {\n\t var p = result.pathname || '';\n\t var s = result.search || '';\n\t result.path = p + s;\n\t }\n\t result.slashes = result.slashes || relative.slashes;\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'),\n\t isRelAbs = (\n\t relative.host ||\n\t relative.pathname && relative.pathname.charAt(0) === '/'\n\t ),\n\t mustEndAbs = (isRelAbs || isSourceAbs ||\n\t (result.host && relative.pathname)),\n\t removeAllDots = mustEndAbs,\n\t srcPath = result.pathname && result.pathname.split('/') || [],\n\t relPath = relative.pathname && relative.pathname.split('/') || [],\n\t psychotic = result.protocol && !slashedProtocol[result.protocol];\n\t\n\t // if the url is a non-slashed url, then relative\n\t // links like ../.. should be able\n\t // to crawl up to the hostname, as well. This is strange.\n\t // result.protocol has already been set by now.\n\t // Later on, put the first path part into the host field.\n\t if (psychotic) {\n\t result.hostname = '';\n\t result.port = null;\n\t if (result.host) {\n\t if (srcPath[0] === '') srcPath[0] = result.host;\n\t else srcPath.unshift(result.host);\n\t }\n\t result.host = '';\n\t if (relative.protocol) {\n\t relative.hostname = null;\n\t relative.port = null;\n\t if (relative.host) {\n\t if (relPath[0] === '') relPath[0] = relative.host;\n\t else relPath.unshift(relative.host);\n\t }\n\t relative.host = null;\n\t }\n\t mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === '');\n\t }\n\t\n\t if (isRelAbs) {\n\t // it's absolute.\n\t result.host = (relative.host || relative.host === '') ?\n\t relative.host : result.host;\n\t result.hostname = (relative.hostname || relative.hostname === '') ?\n\t relative.hostname : result.hostname;\n\t result.search = relative.search;\n\t result.query = relative.query;\n\t srcPath = relPath;\n\t // fall through to the dot-handling below.\n\t } else if (relPath.length) {\n\t // it's relative\n\t // throw away the existing file, and take the new path instead.\n\t if (!srcPath) srcPath = [];\n\t srcPath.pop();\n\t srcPath = srcPath.concat(relPath);\n\t result.search = relative.search;\n\t result.query = relative.query;\n\t } else if (!util.isNullOrUndefined(relative.search)) {\n\t // just pull out the search.\n\t // like href='https://github.com/?foo'.\n\t // Put this after the other two cases because it simplifies the booleans\n\t if (psychotic) {\n\t result.hostname = result.host = srcPath.shift();\n\t //occationaly the auth can get stuck only in host\n\t //this especially happens in cases like\n\t //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n\t var authInHost = result.host && result.host.indexOf('@') > 0 ?\n\t result.host.split('@') : false;\n\t if (authInHost) {\n\t result.auth = authInHost.shift();\n\t result.host = result.hostname = authInHost.shift();\n\t }\n\t }\n\t result.search = relative.search;\n\t result.query = relative.query;\n\t //to support http.request\n\t if (!util.isNull(result.pathname) || !util.isNull(result.search)) {\n\t result.path = (result.pathname ? result.pathname : '') +\n\t (result.search ? result.search : '');\n\t }\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t if (!srcPath.length) {\n\t // no path at all. easy.\n\t // we've already handled the other stuff above.\n\t result.pathname = null;\n\t //to support http.request\n\t if (result.search) {\n\t result.path = '/' + result.search;\n\t } else {\n\t result.path = null;\n\t }\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t // if a url ENDs in . or .., then it must get a trailing slash.\n\t // however, if it ends in anything else non-slashy,\n\t // then it must NOT get a trailing slash.\n\t var last = srcPath.slice(-1)[0];\n\t var hasTrailingSlash = (\n\t (result.host || relative.host || srcPath.length > 1) &&\n\t (last === '.' || last === '..') || last === '');\n\t\n\t // strip single dots, resolve double dots to parent dir\n\t // if the path tries to go above the root, `up` ends up > 0\n\t var up = 0;\n\t for (var i = srcPath.length; i >= 0; i--) {\n\t last = srcPath[i];\n\t if (last === '.') {\n\t srcPath.splice(i, 1);\n\t } else if (last === '..') {\n\t srcPath.splice(i, 1);\n\t up++;\n\t } else if (up) {\n\t srcPath.splice(i, 1);\n\t up--;\n\t }\n\t }\n\t\n\t // if the path is allowed to go above the root, restore leading ..s\n\t if (!mustEndAbs && !removeAllDots) {\n\t for (; up--; up) {\n\t srcPath.unshift('..');\n\t }\n\t }\n\t\n\t if (mustEndAbs && srcPath[0] !== '' &&\n\t (!srcPath[0] || srcPath[0].charAt(0) !== '/')) {\n\t srcPath.unshift('');\n\t }\n\t\n\t if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) {\n\t srcPath.push('');\n\t }\n\t\n\t var isAbsolute = srcPath[0] === '' ||\n\t (srcPath[0] && srcPath[0].charAt(0) === '/');\n\t\n\t // put the host back\n\t if (psychotic) {\n\t result.hostname = result.host = isAbsolute ? '' :\n\t srcPath.length ? srcPath.shift() : '';\n\t //occationaly the auth can get stuck only in host\n\t //this especially happens in cases like\n\t //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n\t var authInHost = result.host && result.host.indexOf('@') > 0 ?\n\t result.host.split('@') : false;\n\t if (authInHost) {\n\t result.auth = authInHost.shift();\n\t result.host = result.hostname = authInHost.shift();\n\t }\n\t }\n\t\n\t mustEndAbs = mustEndAbs || (result.host && srcPath.length);\n\t\n\t if (mustEndAbs && !isAbsolute) {\n\t srcPath.unshift('');\n\t }\n\t\n\t if (!srcPath.length) {\n\t result.pathname = null;\n\t result.path = null;\n\t } else {\n\t result.pathname = srcPath.join('/');\n\t }\n\t\n\t //to support request.http\n\t if (!util.isNull(result.pathname) || !util.isNull(result.search)) {\n\t result.path = (result.pathname ? result.pathname : '') +\n\t (result.search ? result.search : '');\n\t }\n\t result.auth = relative.auth || result.auth;\n\t result.slashes = result.slashes || relative.slashes;\n\t result.href = result.format();\n\t return result;\n\t};\n\t\n\tUrl.prototype.parseHost = function() {\n\t var host = this.host;\n\t var port = portPattern.exec(host);\n\t if (port) {\n\t port = port[0];\n\t if (port !== ':') {\n\t this.port = port.substr(1);\n\t }\n\t host = host.substr(0, host.length - port.length);\n\t }\n\t if (host) this.hostname = host;\n\t};\n\n\n/***/ },\n/* 17 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(module, global) {/*! https://mths.be/punycode v1.3.2 by @mathias */\n\t;(function(root) {\n\t\n\t\t/** Detect free variables */\n\t\tvar freeExports = typeof exports == 'object' && exports &&\n\t\t\t!exports.nodeType && exports;\n\t\tvar freeModule = typeof module == 'object' && module &&\n\t\t\t!module.nodeType && module;\n\t\tvar freeGlobal = typeof global == 'object' && global;\n\t\tif (\n\t\t\tfreeGlobal.global === freeGlobal ||\n\t\t\tfreeGlobal.window === freeGlobal ||\n\t\t\tfreeGlobal.self === freeGlobal\n\t\t) {\n\t\t\troot = freeGlobal;\n\t\t}\n\t\n\t\t/**\n\t\t * The `punycode` object.\n\t\t * @name punycode\n\t\t * @type Object\n\t\t */\n\t\tvar punycode,\n\t\n\t\t/** Highest positive signed 32-bit float value */\n\t\tmaxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1\n\t\n\t\t/** Bootstring parameters */\n\t\tbase = 36,\n\t\ttMin = 1,\n\t\ttMax = 26,\n\t\tskew = 38,\n\t\tdamp = 700,\n\t\tinitialBias = 72,\n\t\tinitialN = 128, // 0x80\n\t\tdelimiter = '-', // '\\x2D'\n\t\n\t\t/** Regular expressions */\n\t\tregexPunycode = /^xn--/,\n\t\tregexNonASCII = /[^\\x20-\\x7E]/, // unprintable ASCII chars + non-ASCII chars\n\t\tregexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g, // RFC 3490 separators\n\t\n\t\t/** Error messages */\n\t\terrors = {\n\t\t\t'overflow': 'Overflow: input needs wider integers to process',\n\t\t\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t\t\t'invalid-input': 'Invalid input'\n\t\t},\n\t\n\t\t/** Convenience shortcuts */\n\t\tbaseMinusTMin = base - tMin,\n\t\tfloor = Math.floor,\n\t\tstringFromCharCode = String.fromCharCode,\n\t\n\t\t/** Temporary variable */\n\t\tkey;\n\t\n\t\t/*--------------------------------------------------------------------------*/\n\t\n\t\t/**\n\t\t * A generic error utility function.\n\t\t * @private\n\t\t * @param {String} type The error type.\n\t\t * @returns {Error} Throws a `RangeError` with the applicable error message.\n\t\t */\n\t\tfunction error(type) {\n\t\t\tthrow RangeError(errors[type]);\n\t\t}\n\t\n\t\t/**\n\t\t * A generic `Array#map` utility function.\n\t\t * @private\n\t\t * @param {Array} array The array to iterate over.\n\t\t * @param {Function} callback The function that gets called for every array\n\t\t * item.\n\t\t * @returns {Array} A new array of values returned by the callback function.\n\t\t */\n\t\tfunction map(array, fn) {\n\t\t\tvar length = array.length;\n\t\t\tvar result = [];\n\t\t\twhile (length--) {\n\t\t\t\tresult[length] = fn(array[length]);\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\n\t\t/**\n\t\t * A simple `Array#map`-like wrapper to work with domain name strings or email\n\t\t * addresses.\n\t\t * @private\n\t\t * @param {String} domain The domain name or email address.\n\t\t * @param {Function} callback The function that gets called for every\n\t\t * character.\n\t\t * @returns {Array} A new string of characters returned by the callback\n\t\t * function.\n\t\t */\n\t\tfunction mapDomain(string, fn) {\n\t\t\tvar parts = string.split('@');\n\t\t\tvar result = '';\n\t\t\tif (parts.length > 1) {\n\t\t\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t\t\t// the local part (i.e. everything up to `@`) intact.\n\t\t\t\tresult = parts[0] + '@';\n\t\t\t\tstring = parts[1];\n\t\t\t}\n\t\t\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\t\t\tstring = string.replace(regexSeparators, '\\x2E');\n\t\t\tvar labels = string.split('.');\n\t\t\tvar encoded = map(labels, fn).join('.');\n\t\t\treturn result + encoded;\n\t\t}\n\t\n\t\t/**\n\t\t * Creates an array containing the numeric code points of each Unicode\n\t\t * character in the string. While JavaScript uses UCS-2 internally,\n\t\t * this function will convert a pair of surrogate halves (each of which\n\t\t * UCS-2 exposes as separate characters) into a single code point,\n\t\t * matching UTF-16.\n\t\t * @see `punycode.ucs2.encode`\n\t\t * @see \n\t\t * @memberOf punycode.ucs2\n\t\t * @name decode\n\t\t * @param {String} string The Unicode input string (UCS-2).\n\t\t * @returns {Array} The new array of code points.\n\t\t */\n\t\tfunction ucs2decode(string) {\n\t\t\tvar output = [],\n\t\t\t counter = 0,\n\t\t\t length = string.length,\n\t\t\t value,\n\t\t\t extra;\n\t\t\twhile (counter < length) {\n\t\t\t\tvalue = string.charCodeAt(counter++);\n\t\t\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t\t\t// high surrogate, and there is a next character\n\t\t\t\t\textra = string.charCodeAt(counter++);\n\t\t\t\t\tif ((extra & 0xFC00) == 0xDC00) { // low surrogate\n\t\t\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// unmatched surrogate; only append this code unit, in case the next\n\t\t\t\t\t\t// code unit is the high surrogate of a surrogate pair\n\t\t\t\t\t\toutput.push(value);\n\t\t\t\t\t\tcounter--;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\toutput.push(value);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn output;\n\t\t}\n\t\n\t\t/**\n\t\t * Creates a string based on an array of numeric code points.\n\t\t * @see `punycode.ucs2.decode`\n\t\t * @memberOf punycode.ucs2\n\t\t * @name encode\n\t\t * @param {Array} codePoints The array of numeric code points.\n\t\t * @returns {String} The new Unicode string (UCS-2).\n\t\t */\n\t\tfunction ucs2encode(array) {\n\t\t\treturn map(array, function(value) {\n\t\t\t\tvar output = '';\n\t\t\t\tif (value > 0xFFFF) {\n\t\t\t\t\tvalue -= 0x10000;\n\t\t\t\t\toutput += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);\n\t\t\t\t\tvalue = 0xDC00 | value & 0x3FF;\n\t\t\t\t}\n\t\t\t\toutput += stringFromCharCode(value);\n\t\t\t\treturn output;\n\t\t\t}).join('');\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a basic code point into a digit/integer.\n\t\t * @see `digitToBasic()`\n\t\t * @private\n\t\t * @param {Number} codePoint The basic numeric code point value.\n\t\t * @returns {Number} The numeric value of a basic code point (for use in\n\t\t * representing integers) in the range `0` to `base - 1`, or `base` if\n\t\t * the code point does not represent a value.\n\t\t */\n\t\tfunction basicToDigit(codePoint) {\n\t\t\tif (codePoint - 48 < 10) {\n\t\t\t\treturn codePoint - 22;\n\t\t\t}\n\t\t\tif (codePoint - 65 < 26) {\n\t\t\t\treturn codePoint - 65;\n\t\t\t}\n\t\t\tif (codePoint - 97 < 26) {\n\t\t\t\treturn codePoint - 97;\n\t\t\t}\n\t\t\treturn base;\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a digit/integer into a basic code point.\n\t\t * @see `basicToDigit()`\n\t\t * @private\n\t\t * @param {Number} digit The numeric value of a basic code point.\n\t\t * @returns {Number} The basic code point whose value (when used for\n\t\t * representing integers) is `digit`, which needs to be in the range\n\t\t * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n\t\t * used; else, the lowercase form is used. The behavior is undefined\n\t\t * if `flag` is non-zero and `digit` has no uppercase form.\n\t\t */\n\t\tfunction digitToBasic(digit, flag) {\n\t\t\t// 0..25 map to ASCII a..z or A..Z\n\t\t\t// 26..35 map to ASCII 0..9\n\t\t\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n\t\t}\n\t\n\t\t/**\n\t\t * Bias adaptation function as per section 3.4 of RFC 3492.\n\t\t * http://tools.ietf.org/html/rfc3492#section-3.4\n\t\t * @private\n\t\t */\n\t\tfunction adapt(delta, numPoints, firstTime) {\n\t\t\tvar k = 0;\n\t\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\t\tdelta += floor(delta / numPoints);\n\t\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t\t}\n\t\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n\t\t * symbols.\n\t\t * @memberOf punycode\n\t\t * @param {String} input The Punycode string of ASCII-only symbols.\n\t\t * @returns {String} The resulting string of Unicode symbols.\n\t\t */\n\t\tfunction decode(input) {\n\t\t\t// Don't use UCS-2\n\t\t\tvar output = [],\n\t\t\t inputLength = input.length,\n\t\t\t out,\n\t\t\t i = 0,\n\t\t\t n = initialN,\n\t\t\t bias = initialBias,\n\t\t\t basic,\n\t\t\t j,\n\t\t\t index,\n\t\t\t oldi,\n\t\t\t w,\n\t\t\t k,\n\t\t\t digit,\n\t\t\t t,\n\t\t\t /** Cached calculation results */\n\t\t\t baseMinusT;\n\t\n\t\t\t// Handle the basic code points: let `basic` be the number of input code\n\t\t\t// points before the last delimiter, or `0` if there is none, then copy\n\t\t\t// the first basic code points to the output.\n\t\n\t\t\tbasic = input.lastIndexOf(delimiter);\n\t\t\tif (basic < 0) {\n\t\t\t\tbasic = 0;\n\t\t\t}\n\t\n\t\t\tfor (j = 0; j < basic; ++j) {\n\t\t\t\t// if it's not a basic code point\n\t\t\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\t\t\terror('not-basic');\n\t\t\t\t}\n\t\t\t\toutput.push(input.charCodeAt(j));\n\t\t\t}\n\t\n\t\t\t// Main decoding loop: start just after the last delimiter if any basic code\n\t\t\t// points were copied; start at the beginning otherwise.\n\t\n\t\t\tfor (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\t\n\t\t\t\t// `index` is the index of the next character to be consumed.\n\t\t\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t\t\t// which gets added to `i`. The overflow checking is easier\n\t\t\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t\t\t// value at the end to obtain `delta`.\n\t\t\t\tfor (oldi = i, w = 1, k = base; /* no condition */; k += base) {\n\t\n\t\t\t\t\tif (index >= inputLength) {\n\t\t\t\t\t\terror('invalid-input');\n\t\t\t\t\t}\n\t\n\t\t\t\t\tdigit = basicToDigit(input.charCodeAt(index++));\n\t\n\t\t\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\t\t\terror('overflow');\n\t\t\t\t\t}\n\t\n\t\t\t\t\ti += digit * w;\n\t\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\n\t\t\t\t\tif (digit < t) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tbaseMinusT = base - t;\n\t\t\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\t\t\terror('overflow');\n\t\t\t\t\t}\n\t\n\t\t\t\t\tw *= baseMinusT;\n\t\n\t\t\t\t}\n\t\n\t\t\t\tout = output.length + 1;\n\t\t\t\tbias = adapt(i - oldi, out, oldi == 0);\n\t\n\t\t\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t\t\t// incrementing `n` each time, so we'll fix that now:\n\t\t\t\tif (floor(i / out) > maxInt - n) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\t\n\t\t\t\tn += floor(i / out);\n\t\t\t\ti %= out;\n\t\n\t\t\t\t// Insert `n` at position `i` of the output\n\t\t\t\toutput.splice(i++, 0, n);\n\t\n\t\t\t}\n\t\n\t\t\treturn ucs2encode(output);\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a string of Unicode symbols (e.g. a domain name label) to a\n\t\t * Punycode string of ASCII-only symbols.\n\t\t * @memberOf punycode\n\t\t * @param {String} input The string of Unicode symbols.\n\t\t * @returns {String} The resulting Punycode string of ASCII-only symbols.\n\t\t */\n\t\tfunction encode(input) {\n\t\t\tvar n,\n\t\t\t delta,\n\t\t\t handledCPCount,\n\t\t\t basicLength,\n\t\t\t bias,\n\t\t\t j,\n\t\t\t m,\n\t\t\t q,\n\t\t\t k,\n\t\t\t t,\n\t\t\t currentValue,\n\t\t\t output = [],\n\t\t\t /** `inputLength` will hold the number of code points in `input`. */\n\t\t\t inputLength,\n\t\t\t /** Cached calculation results */\n\t\t\t handledCPCountPlusOne,\n\t\t\t baseMinusT,\n\t\t\t qMinusT;\n\t\n\t\t\t// Convert the input in UCS-2 to Unicode\n\t\t\tinput = ucs2decode(input);\n\t\n\t\t\t// Cache the length\n\t\t\tinputLength = input.length;\n\t\n\t\t\t// Initialize the state\n\t\t\tn = initialN;\n\t\t\tdelta = 0;\n\t\t\tbias = initialBias;\n\t\n\t\t\t// Handle the basic code points\n\t\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\t\tcurrentValue = input[j];\n\t\t\t\tif (currentValue < 0x80) {\n\t\t\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\thandledCPCount = basicLength = output.length;\n\t\n\t\t\t// `handledCPCount` is the number of code points that have been handled;\n\t\t\t// `basicLength` is the number of basic code points.\n\t\n\t\t\t// Finish the basic string - if it is not empty - with a delimiter\n\t\t\tif (basicLength) {\n\t\t\t\toutput.push(delimiter);\n\t\t\t}\n\t\n\t\t\t// Main encoding loop:\n\t\t\twhile (handledCPCount < inputLength) {\n\t\n\t\t\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t\t\t// larger one:\n\t\t\t\tfor (m = maxInt, j = 0; j < inputLength; ++j) {\n\t\t\t\t\tcurrentValue = input[j];\n\t\t\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\t\t\tm = currentValue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\t// Increase `delta` enough to advance the decoder's state to ,\n\t\t\t\t// but guard against overflow\n\t\t\t\thandledCPCountPlusOne = handledCPCount + 1;\n\t\t\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\t\n\t\t\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\t\t\tn = m;\n\t\n\t\t\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\t\t\tcurrentValue = input[j];\n\t\n\t\t\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\t\t\terror('overflow');\n\t\t\t\t\t}\n\t\n\t\t\t\t\tif (currentValue == n) {\n\t\t\t\t\t\t// Represent delta as a generalized variable-length integer\n\t\t\t\t\t\tfor (q = delta, k = base; /* no condition */; k += base) {\n\t\t\t\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tqMinusT = q - t;\n\t\t\t\t\t\t\tbaseMinusT = base - t;\n\t\t\t\t\t\t\toutput.push(\n\t\t\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\t\t\tdelta = 0;\n\t\t\t\t\t\t++handledCPCount;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\t++delta;\n\t\t\t\t++n;\n\t\n\t\t\t}\n\t\t\treturn output.join('');\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a Punycode string representing a domain name or an email address\n\t\t * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n\t\t * it doesn't matter if you call it on a string that has already been\n\t\t * converted to Unicode.\n\t\t * @memberOf punycode\n\t\t * @param {String} input The Punycoded domain name or email address to\n\t\t * convert to Unicode.\n\t\t * @returns {String} The Unicode representation of the given Punycode\n\t\t * string.\n\t\t */\n\t\tfunction toUnicode(input) {\n\t\t\treturn mapDomain(input, function(string) {\n\t\t\t\treturn regexPunycode.test(string)\n\t\t\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t\t\t: string;\n\t\t\t});\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a Unicode string representing a domain name or an email address to\n\t\t * Punycode. Only the non-ASCII parts of the domain name will be converted,\n\t\t * i.e. it doesn't matter if you call it with a domain that's already in\n\t\t * ASCII.\n\t\t * @memberOf punycode\n\t\t * @param {String} input The domain name or email address to convert, as a\n\t\t * Unicode string.\n\t\t * @returns {String} The Punycode representation of the given domain name or\n\t\t * email address.\n\t\t */\n\t\tfunction toASCII(input) {\n\t\t\treturn mapDomain(input, function(string) {\n\t\t\t\treturn regexNonASCII.test(string)\n\t\t\t\t\t? 'xn--' + encode(string)\n\t\t\t\t\t: string;\n\t\t\t});\n\t\t}\n\t\n\t\t/*--------------------------------------------------------------------------*/\n\t\n\t\t/** Define the public API */\n\t\tpunycode = {\n\t\t\t/**\n\t\t\t * A string representing the current Punycode.js version number.\n\t\t\t * @memberOf punycode\n\t\t\t * @type String\n\t\t\t */\n\t\t\t'version': '1.3.2',\n\t\t\t/**\n\t\t\t * An object of methods to convert from JavaScript's internal character\n\t\t\t * representation (UCS-2) to Unicode code points, and back.\n\t\t\t * @see \n\t\t\t * @memberOf punycode\n\t\t\t * @type Object\n\t\t\t */\n\t\t\t'ucs2': {\n\t\t\t\t'decode': ucs2decode,\n\t\t\t\t'encode': ucs2encode\n\t\t\t},\n\t\t\t'decode': decode,\n\t\t\t'encode': encode,\n\t\t\t'toASCII': toASCII,\n\t\t\t'toUnicode': toUnicode\n\t\t};\n\t\n\t\t/** Expose `punycode` */\n\t\t// Some AMD build optimizers, like r.js, check for specific condition patterns\n\t\t// like the following:\n\t\tif (\n\t\t\ttrue\n\t\t) {\n\t\t\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function() {\n\t\t\t\treturn punycode;\n\t\t\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t\t} else if (freeExports && freeModule) {\n\t\t\tif (module.exports == freeExports) { // in Node.js or RingoJS v0.8.0+\n\t\t\t\tfreeModule.exports = punycode;\n\t\t\t} else { // in Narwhal or RingoJS v0.7.0-\n\t\t\t\tfor (key in punycode) {\n\t\t\t\t\tpunycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]);\n\t\t\t\t}\n\t\t\t}\n\t\t} else { // in Rhino or a web browser\n\t\t\troot.punycode = punycode;\n\t\t}\n\t\n\t}(this));\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(18)(module), (function() { return this; }())))\n\n/***/ },\n/* 18 */\n/***/ function(module, exports) {\n\n\tmodule.exports = function(module) {\r\n\t\tif(!module.webpackPolyfill) {\r\n\t\t\tmodule.deprecate = function() {};\r\n\t\t\tmodule.paths = [];\r\n\t\t\t// module.parent = undefined by default\r\n\t\t\tmodule.children = [];\r\n\t\t\tmodule.webpackPolyfill = 1;\r\n\t\t}\r\n\t\treturn module;\r\n\t}\r\n\n\n/***/ },\n/* 19 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = {\n\t isString: function(arg) {\n\t return typeof(arg) === 'string';\n\t },\n\t isObject: function(arg) {\n\t return typeof(arg) === 'object' && arg !== null;\n\t },\n\t isNull: function(arg) {\n\t return arg === null;\n\t },\n\t isNullOrUndefined: function(arg) {\n\t return arg == null;\n\t }\n\t};\n\n\n/***/ },\n/* 20 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\texports.decode = exports.parse = __webpack_require__(21);\n\texports.encode = exports.stringify = __webpack_require__(22);\n\n\n/***/ },\n/* 21 */\n/***/ function(module, exports) {\n\n\t// Copyright Joyent, Inc. and other Node contributors.\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a\n\t// copy of this software and associated documentation files (the\n\t// \"Software\"), to deal in the Software without restriction, including\n\t// without limitation the rights to use, copy, modify, merge, publish,\n\t// distribute, sublicense, and/or sell copies of the Software, and to permit\n\t// persons to whom the Software is furnished to do so, subject to the\n\t// following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included\n\t// in all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n\t// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\t// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n\t// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n\t// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n\t// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n\t// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\t\n\t'use strict';\n\t\n\t// If obj.hasOwnProperty has been overridden, then calling\n\t// obj.hasOwnProperty(prop) will break.\n\t// See: https://github.com/joyent/node/issues/1707\n\tfunction hasOwnProperty(obj, prop) {\n\t return Object.prototype.hasOwnProperty.call(obj, prop);\n\t}\n\t\n\tmodule.exports = function(qs, sep, eq, options) {\n\t sep = sep || '&';\n\t eq = eq || '=';\n\t var obj = {};\n\t\n\t if (typeof qs !== 'string' || qs.length === 0) {\n\t return obj;\n\t }\n\t\n\t var regexp = /\\+/g;\n\t qs = qs.split(sep);\n\t\n\t var maxKeys = 1000;\n\t if (options && typeof options.maxKeys === 'number') {\n\t maxKeys = options.maxKeys;\n\t }\n\t\n\t var len = qs.length;\n\t // maxKeys <= 0 means that we should not limit keys count\n\t if (maxKeys > 0 && len > maxKeys) {\n\t len = maxKeys;\n\t }\n\t\n\t for (var i = 0; i < len; ++i) {\n\t var x = qs[i].replace(regexp, '%20'),\n\t idx = x.indexOf(eq),\n\t kstr, vstr, k, v;\n\t\n\t if (idx >= 0) {\n\t kstr = x.substr(0, idx);\n\t vstr = x.substr(idx + 1);\n\t } else {\n\t kstr = x;\n\t vstr = '';\n\t }\n\t\n\t k = decodeURIComponent(kstr);\n\t v = decodeURIComponent(vstr);\n\t\n\t if (!hasOwnProperty(obj, k)) {\n\t obj[k] = v;\n\t } else if (Array.isArray(obj[k])) {\n\t obj[k].push(v);\n\t } else {\n\t obj[k] = [obj[k], v];\n\t }\n\t }\n\t\n\t return obj;\n\t};\n\n\n/***/ },\n/* 22 */\n/***/ function(module, exports) {\n\n\t// Copyright Joyent, Inc. and other Node contributors.\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a\n\t// copy of this software and associated documentation files (the\n\t// \"Software\"), to deal in the Software without restriction, including\n\t// without limitation the rights to use, copy, modify, merge, publish,\n\t// distribute, sublicense, and/or sell copies of the Software, and to permit\n\t// persons to whom the Software is furnished to do so, subject to the\n\t// following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included\n\t// in all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n\t// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\t// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n\t// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n\t// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n\t// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n\t// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\t\n\t'use strict';\n\t\n\tvar stringifyPrimitive = function(v) {\n\t switch (typeof v) {\n\t case 'string':\n\t return v;\n\t\n\t case 'boolean':\n\t return v ? 'true' : 'false';\n\t\n\t case 'number':\n\t return isFinite(v) ? v : '';\n\t\n\t default:\n\t return '';\n\t }\n\t};\n\t\n\tmodule.exports = function(obj, sep, eq, name) {\n\t sep = sep || '&';\n\t eq = eq || '=';\n\t if (obj === null) {\n\t obj = undefined;\n\t }\n\t\n\t if (typeof obj === 'object') {\n\t return Object.keys(obj).map(function(k) {\n\t var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;\n\t if (Array.isArray(obj[k])) {\n\t return obj[k].map(function(v) {\n\t return ks + encodeURIComponent(stringifyPrimitive(v));\n\t }).join(sep);\n\t } else {\n\t return ks + encodeURIComponent(stringifyPrimitive(obj[k]));\n\t }\n\t }).join(sep);\n\t\n\t }\n\t\n\t if (!name) return '';\n\t return encodeURIComponent(stringifyPrimitive(name)) + eq +\n\t encodeURIComponent(stringifyPrimitive(obj));\n\t};\n\n\n/***/ },\n/* 23 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"id\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"description\": \"Core schema meta-schema\",\n\t\t\"definitions\": {\n\t\t\t\"schemaArray\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"minItems\": 1,\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"positiveInteger\": {\n\t\t\t\t\"type\": \"integer\",\n\t\t\t\t\"minimum\": 0\n\t\t\t},\n\t\t\t\"positiveIntegerDefault0\": {\n\t\t\t\t\"allOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#/definitions/positiveInteger\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"default\": 0\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"simpleTypes\": {\n\t\t\t\t\"enum\": [\n\t\t\t\t\t\"array\",\n\t\t\t\t\t\"boolean\",\n\t\t\t\t\t\"integer\",\n\t\t\t\t\t\"null\",\n\t\t\t\t\t\"number\",\n\t\t\t\t\t\"object\",\n\t\t\t\t\t\"string\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"stringArray\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t},\n\t\t\t\t\"minItems\": 1,\n\t\t\t\t\"uniqueItems\": true\n\t\t\t}\n\t\t},\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"id\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"uri\"\n\t\t\t},\n\t\t\t\"$schema\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"uri\"\n\t\t\t},\n\t\t\t\"title\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"description\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"default\": {},\n\t\t\t\"multipleOf\": {\n\t\t\t\t\"type\": \"number\",\n\t\t\t\t\"minimum\": 0,\n\t\t\t\t\"exclusiveMinimum\": true\n\t\t\t},\n\t\t\t\"maximum\": {\n\t\t\t\t\"type\": \"number\"\n\t\t\t},\n\t\t\t\"exclusiveMaximum\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"minimum\": {\n\t\t\t\t\"type\": \"number\"\n\t\t\t},\n\t\t\t\"exclusiveMinimum\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"maxLength\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveInteger\"\n\t\t\t},\n\t\t\t\"minLength\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveIntegerDefault0\"\n\t\t\t},\n\t\t\t\"pattern\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"regex\"\n\t\t\t},\n\t\t\t\"additionalItems\": {\n\t\t\t\t\"anyOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"boolean\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"items\": {\n\t\t\t\t\"anyOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#/definitions/schemaArray\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"maxItems\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveInteger\"\n\t\t\t},\n\t\t\t\"minItems\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveIntegerDefault0\"\n\t\t\t},\n\t\t\t\"uniqueItems\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"maxProperties\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveInteger\"\n\t\t\t},\n\t\t\t\"minProperties\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveIntegerDefault0\"\n\t\t\t},\n\t\t\t\"required\": {\n\t\t\t\t\"$ref\": \"#/definitions/stringArray\"\n\t\t\t},\n\t\t\t\"additionalProperties\": {\n\t\t\t\t\"anyOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"boolean\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"definitions\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": {\n\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t},\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"properties\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": {\n\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t},\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"patternProperties\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": {\n\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t},\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"dependencies\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": {\n\t\t\t\t\t\"anyOf\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"$ref\": \"#/definitions/stringArray\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"enum\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"minItems\": 1,\n\t\t\t\t\"uniqueItems\": true\n\t\t\t},\n\t\t\t\"type\": {\n\t\t\t\t\"anyOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#/definitions/simpleTypes\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"array\",\n\t\t\t\t\t\t\"items\": {\n\t\t\t\t\t\t\t\"$ref\": \"#/definitions/simpleTypes\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"minItems\": 1,\n\t\t\t\t\t\t\"uniqueItems\": true\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"allOf\": {\n\t\t\t\t\"$ref\": \"#/definitions/schemaArray\"\n\t\t\t},\n\t\t\t\"anyOf\": {\n\t\t\t\t\"$ref\": \"#/definitions/schemaArray\"\n\t\t\t},\n\t\t\t\"oneOf\": {\n\t\t\t\t\"$ref\": \"#/definitions/schemaArray\"\n\t\t\t},\n\t\t\t\"not\": {\n\t\t\t\t\"$ref\": \"#\"\n\t\t\t}\n\t\t},\n\t\t\"dependencies\": {\n\t\t\t\"exclusiveMaximum\": [\n\t\t\t\t\"maximum\"\n\t\t\t],\n\t\t\t\"exclusiveMinimum\": [\n\t\t\t\t\"minimum\"\n\t\t\t]\n\t\t},\n\t\t\"default\": {}\n\t};\n\n/***/ },\n/* 24 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tvar formats = {};\n\t\n\t// reference: http://dansnetwork.com/javascript-iso8601rfc3339-date-parser/\n\tformats['date-time'] = /(\\d\\d\\d\\d)(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))/;\n\t// reference: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js#L7\n\tformats.uri = /^([a-zA-Z][a-zA-Z0-9+-.]*:){0,1}\\/\\/[^\\s]*$/;\n\t// reference: http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363\n\t// http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'willful violation')\n\tformats.email = /^[a-zA-Z0-9.!#$%&'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n\t// reference: https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html\n\tformats.ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;\n\t// reference: http://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses\n\tformats.ipv6 = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|[fF][eE]80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::([fF]{4}(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;\n\t// reference: http://stackoverflow.com/questions/106179/regular-expression-to-match-dns-hostname-or-ip-address#answer-3824105\n\tformats.hostname = /^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])(\\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]))*$/;\n\t\n\tmodule.exports = formats;\n\n/***/ },\n/* 25 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\t// Reference: https://github.com/bestiejs/punycode.js/blob/master/punycode.js#L101`\n\t// Info: https://mathiasbynens.be/notes/javascript-unicode\n\tfunction ucs2length(string) {\n\t var ucs2len = 0,\n\t counter = 0,\n\t length = string.length,\n\t value, extra;\n\t\n\t while (counter < length) {\n\t ucs2len++;\n\t value = string.charCodeAt(counter++);\n\t\n\t if (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t // It's a high surrogate, and there is a next character.\n\t extra = string.charCodeAt(counter++);\n\t\n\t if ((extra & 0xFC00) !== 0xDC00) { /* Low surrogate. */ // jshint ignore: line\n\t counter--;\n\t }\n\t }\n\t }\n\t\n\t return ucs2len;\n\t}\n\t\n\tmodule.exports = ucs2length;\n\n/***/ }\n/******/ ])\n});\n;\n//# sourceMappingURL=models.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/powerbi-models/dist/models.js\n// module id = 5\n// module chunks = 0","import { IFilterable } from './ifilterable';\r\nimport { IReportNode } from './report';\r\nimport * as models from 'powerbi-models';\r\n\r\n/**\r\n * A Page node within a report hierarchy\r\n * \r\n * @export\r\n * @interface IPageNode\r\n */\r\nexport interface IPageNode {\r\n report: IReportNode;\r\n name: string;\r\n}\r\n\r\n/**\r\n * A Power BI report page\r\n * \r\n * @export\r\n * @class Page\r\n * @implements {IPageNode}\r\n * @implements {IFilterable}\r\n */\r\nexport class Page implements IPageNode, IFilterable {\r\n /**\r\n * The parent Power BI report that this page is a member of\r\n * \r\n * @type {IReportNode}\r\n */\r\n report: IReportNode;\r\n /**\r\n * The report page name\r\n * \r\n * @type {string}\r\n */\r\n name: string;\r\n\r\n /**\r\n * The user defined display name of the report page, which is undefined if the page is created manually\r\n * \r\n * @type {string}\r\n */\r\n displayName: string;\r\n\r\n /**\r\n * Creates an instance of a Power BI report page.\r\n * \r\n * @param {IReportNode} report\r\n * @param {string} name\r\n * @param {string} [displayName]\r\n */\r\n constructor(report: IReportNode, name: string, displayName?: string) {\r\n this.report = report;\r\n this.name = name;\r\n this.displayName = displayName;\r\n }\r\n\r\n /**\r\n * Gets all page level filters within the report.\r\n * \r\n * ```javascript\r\n * page.getFilters()\r\n * .then(pages => { ... });\r\n * ```\r\n * \r\n * @returns {(Promise)}\r\n */\r\n getFilters(): Promise {\r\n return this.report.service.hpm.get(`/report/pages/${this.name}/filters`, { uid: this.report.config.uniqueId }, this.report.iframe.contentWindow)\r\n .then(response => response.body,\r\n response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Removes all filters from this page of the report.\r\n * \r\n * ```javascript\r\n * page.removeFilters();\r\n * ```\r\n * \r\n * @returns {Promise}\r\n */\r\n removeFilters(): Promise {\r\n return this.setFilters([]);\r\n }\r\n\r\n /**\r\n * Makes the current page the active page of the report.\r\n * \r\n * ```javascripot\r\n * page.setActive();\r\n * ```\r\n * \r\n * @returns {Promise}\r\n */\r\n setActive(): Promise {\r\n const page: models.IPage = {\r\n name: this.name,\r\n displayName: null\r\n };\r\n\r\n return this.report.service.hpm.put('/report/pages/active', page, { uid: this.report.config.uniqueId }, this.report.iframe.contentWindow)\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Sets all filters on the current page.\r\n * \r\n * ```javascript\r\n * page.setFilters(filters);\r\n * .catch(errors => { ... });\r\n * ```\r\n * \r\n * @param {(models.IFilter[])} filters\r\n * @returns {Promise}\r\n */\r\n setFilters(filters: models.IFilter[]): Promise {\r\n return this.report.service.hpm.put(`/report/pages/${this.name}/filters`, filters, { uid: this.report.config.uniqueId }, this.report.iframe.contentWindow)\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/page.ts","import * as service from './service';\r\nimport * as models from 'powerbi-models';\r\nimport * as embed from './embed';\r\n\r\nexport class Create extends embed.Embed {\r\n\r\n constructor(service: service.Service, element: HTMLElement, config: embed.IEmbedConfiguration) {\r\n super(service, element, config);\r\n }\r\n\r\n /**\r\n * Gets the dataset ID from the first available location: createConfig or embed url.\r\n * \r\n * @returns {string}\r\n */\r\n getId(): string {\r\n const datasetId = (this.createConfig && this.createConfig.datasetId) ? this.createConfig.datasetId : Create.findIdFromEmbedUrl(this.config.embedUrl);\r\n\r\n if (typeof datasetId !== 'string' || datasetId.length === 0) {\r\n throw new Error('Dataset id is required, but it was not found. You must provide an id either as part of embed configuration.');\r\n }\r\n\r\n return datasetId;\r\n }\r\n\r\n /**\r\n * Validate create report configuration.\r\n */\r\n validate(config: models.IReportCreateConfiguration): models.IError[] {\r\n return models.validateCreateReport(config);\r\n }\r\n\r\n /**\r\n * Adds the ability to get datasetId from url. \r\n * (e.g. http://embedded.powerbi.com/appTokenReportEmbed?datasetId=854846ed-2106-4dc2-bc58-eb77533bf2f1).\r\n * \r\n * By extracting the ID we can ensure that the ID is always explicitly provided as part of the create configuration.\r\n * \r\n * @static\r\n * @param {string} url\r\n * @returns {string}\r\n */\r\n static findIdFromEmbedUrl(url: string): string {\r\n const datasetIdRegEx = /datasetId=\"?([^&]+)\"?/\r\n const datasetIdMatch = url.match(datasetIdRegEx);\r\n\r\n let datasetId;\r\n if (datasetIdMatch) {\r\n datasetId = datasetIdMatch[1];\r\n }\r\n\r\n return datasetId;\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/create.ts","import * as service from './service';\r\nimport * as embed from './embed';\r\nimport * as models from 'powerbi-models';\r\nimport * as wpmp from 'window-post-message-proxy';\r\nimport * as hpm from 'http-post-message';\r\nimport * as utils from './util';\r\n\r\n/**\r\n * A Dashboard node within a dashboard hierarchy\r\n * \r\n * @export\r\n * @interface IDashboardNode\r\n */\r\nexport interface IDashboardNode {\r\n iframe: HTMLIFrameElement;\r\n service: service.IService;\r\n config: embed.IInternalEmbedConfiguration\r\n}\r\n\r\n/**\r\n * A Power BI Dashboard embed component\r\n * \r\n * @export\r\n * @class Dashboard\r\n * @extends {embed.Embed}\r\n * @implements {IDashboardNode}\r\n * @implements {IFilterable}\r\n */\r\nexport class Dashboard extends embed.Embed implements IDashboardNode {\r\n static allowedEvents = [\"tileClicked\", \"error\"];\r\n static dashboardIdAttribute = 'powerbi-dashboard-id';\r\n static typeAttribute = 'powerbi-type';\r\n static type = \"Dashboard\";\r\n\r\n /**\r\n * Creates an instance of a Power BI Dashboard.\r\n * \r\n * @param {service.Service} service\r\n * @param {HTMLElement} element\r\n */\r\n constructor(service: service.Service, element: HTMLElement, config: embed.IEmbedConfiguration) {\r\n super(service, element, config);\r\n this.loadPath = \"/dashboard/load\";\r\n Array.prototype.push.apply(this.allowedEvents, Dashboard.allowedEvents);\r\n }\r\n\r\n /**\r\n * This adds backwards compatibility for older config which used the dashboardId query param to specify dashboard id.\r\n * E.g. https://powerbi-df.analysis-df.windows.net/dashboardEmbedHost?dashboardId=e9363c62-edb6-4eac-92d3-2199c5ca2a9e\r\n * \r\n * By extracting the id we can ensure id is always explicitly provided as part of the load configuration.\r\n * \r\n * @static\r\n * @param {string} url\r\n * @returns {string}\r\n */\r\n static findIdFromEmbedUrl(url: string): string {\r\n const dashboardIdRegEx = /dashboardId=\"?([^&]+)\"?/\r\n const dashboardIdMatch = url.match(dashboardIdRegEx);\r\n\r\n let dashboardId;\r\n if (dashboardIdMatch) {\r\n dashboardId = dashboardIdMatch[1];\r\n }\r\n\r\n return dashboardId;\r\n }\r\n\r\n /**\r\n * Get dashboard id from first available location: options, attribute, embed url.\r\n * \r\n * @returns {string}\r\n */\r\n getId(): string {\r\n const dashboardId = this.config.id || this.element.getAttribute(Dashboard.dashboardIdAttribute) || Dashboard.findIdFromEmbedUrl(this.config.embedUrl);\r\n\r\n if (typeof dashboardId !== 'string' || dashboardId.length === 0) {\r\n throw new Error(`Dashboard id is required, but it was not found. You must provide an id either as part of embed configuration or as attribute '${Dashboard.dashboardIdAttribute}'.`);\r\n }\r\n\r\n return dashboardId;\r\n }\r\n\r\n /**\r\n * Validate load configuration.\r\n */\r\n validate(config: models.IDashboardLoadConfiguration): models.IError[] {\r\n let error = models.validateDashboardLoad(config);\r\n return error ? error : this.ValidatePageView(config.pageView);\r\n }\r\n \r\n /**\r\n * Validate that pageView has a legal value: if page view is defined it must have one of the values defined in models.PageView\r\n */\r\n private ValidatePageView(pageView: models.PageView): models.IError[] {\r\n if (pageView && pageView !== \"fitToWidth\" && pageView !== \"oneColumn\" && pageView !== \"actualSize\") {\r\n return [{message: \"pageView must be one of the followings: fitToWidth, oneColumn, actualSize\"}];\r\n }\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/dashboard.ts","import * as models from 'powerbi-models';\r\nimport { Embed } from './embed';\r\n\r\n/**\r\n * The Power BI tile embed component\r\n * \r\n * @export\r\n * @class Tile\r\n * @extends {Embed}\r\n */\r\nexport class Tile extends Embed {\r\n static type = \"Tile\";\r\n\r\n /**\r\n * The ID of the tile\r\n * \r\n * @returns {string}\r\n */\r\n getId(): string {\r\n throw new Error('Not implemented. Embedding tiles is not supported yet.');\r\n }\r\n\r\n /**\r\n * Validate load configuration.\r\n */\r\n validate(config: any): models.IError[] {\r\n throw new Error('Not implemented. Embedding tiles is not supported yet.');\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/tile.ts","/**\r\n * TODO: Need to find better place for these factory functions or refactor how we handle dependency injection\r\n */\r\nimport { IHpmFactory, IWpmpFactory, IRouterFactory } from './service';\r\nimport config from './config';\r\nimport * as wpmp from 'window-post-message-proxy';\r\nimport * as hpm from 'http-post-message';\r\nimport * as router from 'powerbi-router';\r\n\r\nexport {\r\n IHpmFactory,\r\n IWpmpFactory,\r\n IRouterFactory\r\n};\r\n\r\nexport const hpmFactory: IHpmFactory = (wpmp, defaultTargetWindow, sdkVersion = config.version, sdkType = config.type) => {\r\n return new hpm.HttpPostMessage(wpmp, {\r\n 'x-sdk-type': sdkType,\r\n 'x-sdk-version': sdkVersion\r\n }, defaultTargetWindow);\r\n};\r\n\r\nexport const wpmpFactory: IWpmpFactory = (name?: string, logMessages?: boolean, eventSourceOverrideWindow?: Window) => {\r\n return new wpmp.WindowPostMessageProxy({\r\n processTrackingProperties: {\r\n addTrackingProperties: hpm.HttpPostMessage.addTrackingProperties,\r\n getTrackingProperties: hpm.HttpPostMessage.getTrackingProperties,\r\n },\r\n isErrorMessage: hpm.HttpPostMessage.isErrorMessage,\r\n name,\r\n logMessages,\r\n eventSourceOverrideWindow\r\n });\r\n};\r\n\r\nexport const routerFactory: IRouterFactory = (wpmp) => {\r\n return new router.Router(wpmp);\r\n};\n\n\n// WEBPACK FOOTER //\n// ./src/factories.ts","const config = {\r\n version: '2.2.7',\r\n type: 'js'\r\n};\r\n\r\nexport default config;\n\n\n// WEBPACK FOOTER //\n// ./src/config.ts","/*! window-post-message-proxy v0.2.4 | (c) 2016 Microsoft Corporation MIT */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"window-post-message-proxy\"] = factory();\n\telse\n\t\troot[\"window-post-message-proxy\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\tvar WindowPostMessageProxy = (function () {\n\t function WindowPostMessageProxy(options) {\n\t var _this = this;\n\t if (options === void 0) { options = {\n\t processTrackingProperties: {\n\t addTrackingProperties: WindowPostMessageProxy.defaultAddTrackingProperties,\n\t getTrackingProperties: WindowPostMessageProxy.defaultGetTrackingProperties\n\t },\n\t isErrorMessage: WindowPostMessageProxy.defaultIsErrorMessage,\n\t receiveWindow: window,\n\t name: WindowPostMessageProxy.createRandomString()\n\t }; }\n\t this.pendingRequestPromises = {};\n\t // save options with defaults\n\t this.addTrackingProperties = (options.processTrackingProperties && options.processTrackingProperties.addTrackingProperties) || WindowPostMessageProxy.defaultAddTrackingProperties;\n\t this.getTrackingProperties = (options.processTrackingProperties && options.processTrackingProperties.getTrackingProperties) || WindowPostMessageProxy.defaultGetTrackingProperties;\n\t this.isErrorMessage = options.isErrorMessage || WindowPostMessageProxy.defaultIsErrorMessage;\n\t this.receiveWindow = options.receiveWindow || window;\n\t this.name = options.name || WindowPostMessageProxy.createRandomString();\n\t this.logMessages = options.logMessages || false;\n\t this.eventSourceOverrideWindow = options.eventSourceOverrideWindow;\n\t this.suppressWarnings = options.suppressWarnings || false;\n\t if (this.logMessages) {\n\t console.log(\"new WindowPostMessageProxy created with name: \" + this.name + \" receiving on window: \" + this.receiveWindow.document.title);\n\t }\n\t // Initialize\n\t this.handlers = [];\n\t this.windowMessageHandler = function (event) { return _this.onMessageReceived(event); };\n\t this.start();\n\t }\n\t // Static\n\t WindowPostMessageProxy.defaultAddTrackingProperties = function (message, trackingProperties) {\n\t message[WindowPostMessageProxy.messagePropertyName] = trackingProperties;\n\t return message;\n\t };\n\t WindowPostMessageProxy.defaultGetTrackingProperties = function (message) {\n\t return message[WindowPostMessageProxy.messagePropertyName];\n\t };\n\t WindowPostMessageProxy.defaultIsErrorMessage = function (message) {\n\t return !!message.error;\n\t };\n\t /**\n\t * Utility to create a deferred object.\n\t */\n\t // TODO: Look to use RSVP library instead of doing this manually.\n\t // From what I searched RSVP would work better because it has .finally and .deferred; however, it doesn't have Typings information. \n\t WindowPostMessageProxy.createDeferred = function () {\n\t var deferred = {\n\t resolve: null,\n\t reject: null,\n\t promise: null\n\t };\n\t var promise = new Promise(function (resolve, reject) {\n\t deferred.resolve = resolve;\n\t deferred.reject = reject;\n\t });\n\t deferred.promise = promise;\n\t return deferred;\n\t };\n\t /**\n\t * Utility to generate random sequence of characters used as tracking id for promises.\n\t */\n\t WindowPostMessageProxy.createRandomString = function () {\n\t return (Math.random() + 1).toString(36).substring(7);\n\t };\n\t /**\n\t * Adds handler.\n\t * If the first handler whose test method returns true will handle the message and provide a response.\n\t */\n\t WindowPostMessageProxy.prototype.addHandler = function (handler) {\n\t this.handlers.push(handler);\n\t };\n\t /**\n\t * Removes handler.\n\t * The reference must match the original object that was provided when adding the handler.\n\t */\n\t WindowPostMessageProxy.prototype.removeHandler = function (handler) {\n\t var handlerIndex = this.handlers.indexOf(handler);\n\t if (handlerIndex === -1) {\n\t throw new Error(\"You attempted to remove a handler but no matching handler was found.\");\n\t }\n\t this.handlers.splice(handlerIndex, 1);\n\t };\n\t /**\n\t * Start listening to message events.\n\t */\n\t WindowPostMessageProxy.prototype.start = function () {\n\t this.receiveWindow.addEventListener('message', this.windowMessageHandler);\n\t };\n\t /**\n\t * Stops listening to message events.\n\t */\n\t WindowPostMessageProxy.prototype.stop = function () {\n\t this.receiveWindow.removeEventListener('message', this.windowMessageHandler);\n\t };\n\t /**\n\t * Post message to target window with tracking properties added and save deferred object referenced by tracking id.\n\t */\n\t WindowPostMessageProxy.prototype.postMessage = function (targetWindow, message) {\n\t // Add tracking properties to indicate message came from this proxy\n\t var trackingProperties = { id: WindowPostMessageProxy.createRandomString() };\n\t this.addTrackingProperties(message, trackingProperties);\n\t if (this.logMessages) {\n\t console.log(this.name + \" Posting message:\");\n\t console.log(JSON.stringify(message, null, ' '));\n\t }\n\t targetWindow.postMessage(message, \"*\");\n\t var deferred = WindowPostMessageProxy.createDeferred();\n\t this.pendingRequestPromises[trackingProperties.id] = deferred;\n\t return deferred.promise;\n\t };\n\t /**\n\t * Send response message to target window.\n\t * Response messages re-use tracking properties from a previous request message.\n\t */\n\t WindowPostMessageProxy.prototype.sendResponse = function (targetWindow, message, trackingProperties) {\n\t this.addTrackingProperties(message, trackingProperties);\n\t if (this.logMessages) {\n\t console.log(this.name + \" Sending response:\");\n\t console.log(JSON.stringify(message, null, ' '));\n\t }\n\t targetWindow.postMessage(message, \"*\");\n\t };\n\t /**\n\t * Message handler.\n\t */\n\t WindowPostMessageProxy.prototype.onMessageReceived = function (event) {\n\t var _this = this;\n\t if (this.logMessages) {\n\t console.log(this.name + \" Received message:\");\n\t console.log(\"type: \" + event.type);\n\t console.log(JSON.stringify(event.data, null, ' '));\n\t }\n\t var sendingWindow = this.eventSourceOverrideWindow || event.source;\n\t var message = event.data;\n\t if (typeof message !== \"object\") {\n\t if (!this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + this.name + \"): Received message that was not an object. Discarding message\");\n\t }\n\t return;\n\t }\n\t var trackingProperties;\n\t try {\n\t trackingProperties = this.getTrackingProperties(message);\n\t }\n\t catch (e) {\n\t if (!this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + this.name + \"): Error occurred when attempting to get tracking properties from incoming message:\", JSON.stringify(message, null, ' '), \"Error: \", e);\n\t }\n\t }\n\t var deferred;\n\t if (trackingProperties) {\n\t deferred = this.pendingRequestPromises[trackingProperties.id];\n\t }\n\t // If message does not have a known ID, treat it as a request\n\t // Otherwise, treat message as response\n\t if (!deferred) {\n\t var handled = this.handlers.some(function (handler) {\n\t var canMessageBeHandled = false;\n\t try {\n\t canMessageBeHandled = handler.test(message);\n\t }\n\t catch (e) {\n\t if (!_this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + _this.name + \"): Error occurred when handler was testing incoming message:\", JSON.stringify(message, null, ' '), \"Error: \", e);\n\t }\n\t }\n\t if (canMessageBeHandled) {\n\t var responseMessagePromise = void 0;\n\t try {\n\t responseMessagePromise = Promise.resolve(handler.handle(message));\n\t }\n\t catch (e) {\n\t if (!_this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + _this.name + \"): Error occurred when handler was processing incoming message:\", JSON.stringify(message, null, ' '), \"Error: \", e);\n\t }\n\t responseMessagePromise = Promise.resolve();\n\t }\n\t responseMessagePromise\n\t .then(function (responseMessage) {\n\t if (!responseMessage) {\n\t var warningMessage = \"Handler for message: \" + JSON.stringify(message, null, ' ') + \" did not return a response message. The default response message will be returned instead.\";\n\t if (!_this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + _this.name + \"): \" + warningMessage);\n\t }\n\t responseMessage = {\n\t warning: warningMessage\n\t };\n\t }\n\t _this.sendResponse(sendingWindow, responseMessage, trackingProperties);\n\t });\n\t return true;\n\t }\n\t });\n\t /**\n\t * TODO: Consider returning an error message if nothing handled the message.\n\t * In the case of the Report receiving messages all of them should be handled,\n\t * however, in the case of the SDK receiving messages it's likely it won't register handlers\n\t * for all events. Perhaps make this an option at construction time.\n\t */\n\t if (!handled && !this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + this.name + \") did not handle message. Handlers: \" + this.handlers.length + \" Message: \" + JSON.stringify(message, null, '') + \".\");\n\t }\n\t }\n\t else {\n\t /**\n\t * If error message reject promise,\n\t * Otherwise, resolve promise\n\t */\n\t var isErrorMessage = true;\n\t try {\n\t isErrorMessage = this.isErrorMessage(message);\n\t }\n\t catch (e) {\n\t console.warn(\"Proxy(\" + this.name + \") Error occurred when trying to determine if message is consider an error response. Message: \", JSON.stringify(message, null, ''), 'Error: ', e);\n\t }\n\t if (isErrorMessage) {\n\t deferred.reject(message);\n\t }\n\t else {\n\t deferred.resolve(message);\n\t }\n\t // TODO: Move to .finally clause up where promise is created for better maitenance like original proxy code.\n\t delete this.pendingRequestPromises[trackingProperties.id];\n\t }\n\t };\n\t WindowPostMessageProxy.messagePropertyName = \"windowPostMessageProxy\";\n\t return WindowPostMessageProxy;\n\t}());\n\texports.WindowPostMessageProxy = WindowPostMessageProxy;\n\n\n/***/ }\n/******/ ])\n});\n;\n//# sourceMappingURL=windowPostMessageProxy.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/window-post-message-proxy/dist/windowPostMessageProxy.js\n// module id = 12\n// module chunks = 0","/*! http-post-message v0.2.3 | (c) 2016 Microsoft Corporation MIT */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"http-post-message\"] = factory();\n\telse\n\t\troot[\"http-post-message\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\tvar HttpPostMessage = (function () {\n\t function HttpPostMessage(windowPostMessageProxy, defaultHeaders, defaultTargetWindow) {\n\t if (defaultHeaders === void 0) { defaultHeaders = {}; }\n\t this.defaultHeaders = defaultHeaders;\n\t this.defaultTargetWindow = defaultTargetWindow;\n\t this.windowPostMessageProxy = windowPostMessageProxy;\n\t }\n\t // TODO: See if it's possible to share tracking properties interface?\n\t // The responsibility of knowing how to configure windowPostMessageProxy for http should\n\t // live in this http class, but the configuration would need ITrackingProperties\n\t // interface which lives in WindowPostMessageProxy. Use type as workaround\n\t HttpPostMessage.addTrackingProperties = function (message, trackingProperties) {\n\t message.headers = message.headers || {};\n\t if (trackingProperties && trackingProperties.id) {\n\t message.headers.id = trackingProperties.id;\n\t }\n\t return message;\n\t };\n\t HttpPostMessage.getTrackingProperties = function (message) {\n\t return {\n\t id: message.headers && message.headers.id\n\t };\n\t };\n\t HttpPostMessage.isErrorMessage = function (message) {\n\t if (typeof (message && message.statusCode) !== 'number') {\n\t return false;\n\t }\n\t return !(200 <= message.statusCode && message.statusCode < 300);\n\t };\n\t HttpPostMessage.prototype.get = function (url, headers, targetWindow) {\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"GET\",\n\t url: url,\n\t headers: headers\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.post = function (url, body, headers, targetWindow) {\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"POST\",\n\t url: url,\n\t headers: headers,\n\t body: body\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.put = function (url, body, headers, targetWindow) {\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"PUT\",\n\t url: url,\n\t headers: headers,\n\t body: body\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.patch = function (url, body, headers, targetWindow) {\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"PATCH\",\n\t url: url,\n\t headers: headers,\n\t body: body\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.delete = function (url, body, headers, targetWindow) {\n\t if (body === void 0) { body = null; }\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"DELETE\",\n\t url: url,\n\t headers: headers,\n\t body: body\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.send = function (request, targetWindow) {\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t request.headers = this.assign({}, this.defaultHeaders, request.headers);\n\t if (!targetWindow) {\n\t throw new Error(\"target window is not provided. You must either provide the target window explicitly as argument to request, or specify default target window when constructing instance of this class.\");\n\t }\n\t return this.windowPostMessageProxy.postMessage(targetWindow, request);\n\t };\n\t /**\n\t * Object.assign() polyfill\n\t * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\n\t */\n\t HttpPostMessage.prototype.assign = function (target) {\n\t var sources = [];\n\t for (var _i = 1; _i < arguments.length; _i++) {\n\t sources[_i - 1] = arguments[_i];\n\t }\n\t if (target === undefined || target === null) {\n\t throw new TypeError('Cannot convert undefined or null to object');\n\t }\n\t var output = Object(target);\n\t sources.forEach(function (source) {\n\t if (source !== undefined && source !== null) {\n\t for (var nextKey in source) {\n\t if (Object.prototype.hasOwnProperty.call(source, nextKey)) {\n\t output[nextKey] = source[nextKey];\n\t }\n\t }\n\t }\n\t });\n\t return output;\n\t };\n\t return HttpPostMessage;\n\t}());\n\texports.HttpPostMessage = HttpPostMessage;\n\n\n/***/ }\n/******/ ])\n});\n;\n//# sourceMappingURL=httpPostMessage.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/http-post-message/dist/httpPostMessage.js\n// module id = 13\n// module chunks = 0","/*! powerbi-router v0.1.5 | (c) 2016 Microsoft Corporation MIT */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"powerbi-router\"] = factory();\n\telse\n\t\troot[\"powerbi-router\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar RouteRecognizer = __webpack_require__(1);\n\tvar Router = (function () {\n\t function Router(handlers) {\n\t this.handlers = handlers;\n\t /**\n\t * TODO: look at generating the router dynamically based on list of supported http methods\n\t * instead of hardcoding the creation of these and the methods.\n\t */\n\t this.getRouteRecognizer = new RouteRecognizer();\n\t this.patchRouteRecognizer = new RouteRecognizer();\n\t this.postRouteRecognizer = new RouteRecognizer();\n\t this.putRouteRecognizer = new RouteRecognizer();\n\t this.deleteRouteRecognizer = new RouteRecognizer();\n\t }\n\t Router.prototype.get = function (url, handler) {\n\t this.registerHandler(this.getRouteRecognizer, \"GET\", url, handler);\n\t return this;\n\t };\n\t Router.prototype.patch = function (url, handler) {\n\t this.registerHandler(this.patchRouteRecognizer, \"PATCH\", url, handler);\n\t return this;\n\t };\n\t Router.prototype.post = function (url, handler) {\n\t this.registerHandler(this.postRouteRecognizer, \"POST\", url, handler);\n\t return this;\n\t };\n\t Router.prototype.put = function (url, handler) {\n\t this.registerHandler(this.putRouteRecognizer, \"PUT\", url, handler);\n\t return this;\n\t };\n\t Router.prototype.delete = function (url, handler) {\n\t this.registerHandler(this.deleteRouteRecognizer, \"DELETE\", url, handler);\n\t return this;\n\t };\n\t /**\n\t * TODO: This method could use some refactoring. There is conflict of interest between keeping clean separation of test and handle method\n\t * Test method only returns boolean indicating if request can be handled, and handle method has opportunity to modify response and return promise of it.\n\t * In the case of the router with route-recognizer where handlers are associated with routes, this already guarantees that only one handler is selected and makes the test method feel complicated\n\t * Will leave as is an investigate cleaner ways at later time.\n\t */\n\t Router.prototype.registerHandler = function (routeRecognizer, method, url, handler) {\n\t var routeRecognizerHandler = function (request) {\n\t var response = new Response();\n\t return Promise.resolve(handler(request, response))\n\t .then(function (x) { return response; });\n\t };\n\t routeRecognizer.add([\n\t { path: url, handler: routeRecognizerHandler }\n\t ]);\n\t var internalHandler = {\n\t test: function (request) {\n\t if (request.method !== method) {\n\t return false;\n\t }\n\t var matchingRoutes = routeRecognizer.recognize(request.url);\n\t if (matchingRoutes === undefined) {\n\t return false;\n\t }\n\t /**\n\t * Copy parameters from recognized route to the request so they can be used within the handler function\n\t * This isn't ideal because it is side affect which modifies the request instead of strictly testing for true or false\n\t * but I don't see a better place to put this. If we move it between the call to test and the handle it becomes part of the window post message proxy\n\t * even though it's responsibility is related to routing.\n\t */\n\t var route = matchingRoutes[0];\n\t request.params = route.params;\n\t request.queryParams = matchingRoutes.queryParams;\n\t request.handler = route.handler;\n\t return true;\n\t },\n\t handle: function (request) {\n\t return request.handler(request);\n\t }\n\t };\n\t this.handlers.addHandler(internalHandler);\n\t };\n\t return Router;\n\t}());\n\texports.Router = Router;\n\tvar Response = (function () {\n\t function Response() {\n\t this.statusCode = 200;\n\t this.headers = {};\n\t this.body = null;\n\t }\n\t Response.prototype.send = function (statusCode, body) {\n\t this.statusCode = statusCode;\n\t this.body = body;\n\t };\n\t return Response;\n\t}());\n\texports.Response = Response;\n\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(module) {(function() {\n\t \"use strict\";\n\t function $$route$recognizer$dsl$$Target(path, matcher, delegate) {\n\t this.path = path;\n\t this.matcher = matcher;\n\t this.delegate = delegate;\n\t }\n\t\n\t $$route$recognizer$dsl$$Target.prototype = {\n\t to: function(target, callback) {\n\t var delegate = this.delegate;\n\t\n\t if (delegate && delegate.willAddRoute) {\n\t target = delegate.willAddRoute(this.matcher.target, target);\n\t }\n\t\n\t this.matcher.add(this.path, target);\n\t\n\t if (callback) {\n\t if (callback.length === 0) { throw new Error(\"You must have an argument in the function passed to `to`\"); }\n\t this.matcher.addChild(this.path, target, callback, this.delegate);\n\t }\n\t return this;\n\t }\n\t };\n\t\n\t function $$route$recognizer$dsl$$Matcher(target) {\n\t this.routes = {};\n\t this.children = {};\n\t this.target = target;\n\t }\n\t\n\t $$route$recognizer$dsl$$Matcher.prototype = {\n\t add: function(path, handler) {\n\t this.routes[path] = handler;\n\t },\n\t\n\t addChild: function(path, target, callback, delegate) {\n\t var matcher = new $$route$recognizer$dsl$$Matcher(target);\n\t this.children[path] = matcher;\n\t\n\t var match = $$route$recognizer$dsl$$generateMatch(path, matcher, delegate);\n\t\n\t if (delegate && delegate.contextEntered) {\n\t delegate.contextEntered(target, match);\n\t }\n\t\n\t callback(match);\n\t }\n\t };\n\t\n\t function $$route$recognizer$dsl$$generateMatch(startingPath, matcher, delegate) {\n\t return function(path, nestedCallback) {\n\t var fullPath = startingPath + path;\n\t\n\t if (nestedCallback) {\n\t nestedCallback($$route$recognizer$dsl$$generateMatch(fullPath, matcher, delegate));\n\t } else {\n\t return new $$route$recognizer$dsl$$Target(startingPath + path, matcher, delegate);\n\t }\n\t };\n\t }\n\t\n\t function $$route$recognizer$dsl$$addRoute(routeArray, path, handler) {\n\t var len = 0;\n\t for (var i=0; i z`. For instance, \"199\" is smaller\n\t // then \"200\", even though \"y\" and \"z\" (which are both 9) are larger than \"0\" (the value\n\t // of (`b` and `c`). This is because the leading symbol, \"2\", is larger than the other\n\t // leading symbol, \"1\".\n\t // The rule is that symbols to the left carry more weight than symbols to the right\n\t // when a number is written out as a string. In the above strings, the leading digit\n\t // represents how many 100's are in the number, and it carries more weight than the middle\n\t // number which represents how many 10's are in the number.\n\t // This system of number magnitude works well for route specificity, too. A route written as\n\t // `a/b/c` will be more specific than `x/y/z` as long as `a` is more specific than\n\t // `x`, irrespective of the other parts.\n\t // Because of this similarity, we assign each type of segment a number value written as a\n\t // string. We can find the specificity of compound routes by concatenating these strings\n\t // together, from left to right. After we have looped through all of the segments,\n\t // we convert the string to a number.\n\t specificity.val = '';\n\t\n\t for (var i=0; i 2 && key.slice(keyLength -2) === '[]') {\n\t isArray = true;\n\t key = key.slice(0, keyLength - 2);\n\t if(!queryParams[key]) {\n\t queryParams[key] = [];\n\t }\n\t }\n\t value = pair[1] ? $$route$recognizer$$decodeQueryParamPart(pair[1]) : '';\n\t }\n\t if (isArray) {\n\t queryParams[key].push(value);\n\t } else {\n\t queryParams[key] = value;\n\t }\n\t }\n\t return queryParams;\n\t },\n\t\n\t recognize: function(path) {\n\t var states = [ this.rootState ],\n\t pathLen, i, l, queryStart, queryParams = {},\n\t isSlashDropped = false;\n\t\n\t queryStart = path.indexOf('?');\n\t if (queryStart !== -1) {\n\t var queryString = path.substr(queryStart + 1, path.length);\n\t path = path.substr(0, queryStart);\n\t queryParams = this.parseQueryString(queryString);\n\t }\n\t\n\t path = decodeURI(path);\n\t\n\t if (path.charAt(0) !== \"/\") { path = \"/\" + path; }\n\t\n\t pathLen = path.length;\n\t if (pathLen > 1 && path.charAt(pathLen - 1) === \"/\") {\n\t path = path.substr(0, pathLen - 1);\n\t isSlashDropped = true;\n\t }\n\t\n\t for (i=0; i';this.element.innerHTML=r,this.iframe=this.element.childNodes[0]}e?this.iframe.addEventListener("load",function(){return t.load(t.config)},!1):this.iframe.addEventListener("load",function(){return t.createReport(t.createConfig)},!1)},e.allowedEvents=["loaded","saved","rendered","saveAsTriggered","error","dataSelected"],e.accessTokenAttribute="powerbi-access-token",e.embedUrlAttribute="powerbi-embed-url",e.nameAttribute="powerbi-name",e.typeAttribute="powerbi-type",e.defaultSettings={filterPaneEnabled:!0},e}();t.Embed=i},function(e,t){function r(e,t,r){var n;"function"==typeof CustomEvent?n=new CustomEvent(t,{detail:r,bubbles:!0,cancelable:!0}):(n=document.createEvent("CustomEvent"),n.initCustomEvent(t,!0,!0,r)),e.dispatchEvent(n)}function n(e,t){if(!Array.isArray(t))throw new Error("You attempted to call find with second parameter that was not an array. You passed: "+t);var r;return t.some(function(t,n){if(e(t))return r=n,!0}),r}function i(e,t){var r=n(e,t);return t[r]}function o(e,t){var r=n(e,t);t.splice(r,1)}function s(){for(var e=[],t=0;t0&&!i)throw new Error("You shold pass the values to be filtered for each key. You passed: no values and "+o+" keys");if(0===o&&i&&i.length>0)throw new Error("You passed key values but your target object doesn't contain the keys to be filtered");for(var s=0;s2)throw new Error("AdvancedFilters may not have more than two conditions. You passed: "+i.length);if(1===s.length&&"And"!==n)throw new Error('Logical Operator must be "And" when there is only one condition provided');this.conditions=s}return d(t,e),t.prototype.toJSON=function(){var t=e.prototype.toJSON.call(this);return t.logicalOperator=this.logicalOperator,t.conditions=this.conditions,t},t.schemaUrl="http://powerbi.com/product/schema#advanced",t}(l);t.AdvancedFilter=y,function(e){e[e.Read=0]="Read",e[e.ReadWrite=1]="ReadWrite",e[e.Copy=2]="Copy",e[e.Create=4]="Create",e[e.All=7]="All"}(t.Permissions||(t.Permissions={}));t.Permissions;!function(e){e[e.View=0]="View",e[e.Edit=1]="Edit"}(t.ViewMode||(t.ViewMode={}));t.ViewMode;t.validateSaveAsParameters=i(t.saveAsParametersSchema)},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{target:{oneOf:[{type:"object",properties:{table:{type:"string"},column:{type:"string"}},required:["table","column"]},{type:"object",properties:{table:{type:"string"},hierarchy:{type:"string"},hierarchyLevel:{type:"string"}},required:["table","hierarchy","hierarchyLevel"]},{type:"object",properties:{table:{type:"string"},measure:{type:"string"}},required:["table","measure"]}]},logicalOperator:{type:"string"},conditions:{type:"array",items:{type:"object",properties:{value:{type:["string","boolean","number"]},operator:{type:"string"}},required:["value","operator"]}}},required:["target","logicalOperator","conditions"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",oneOf:[{$ref:"#basicFilter"},{$ref:"#advancedFilter"}],invalidMessage:"filter is invalid"}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{accessToken:{type:"string",messages:{type:"accessToken must be a string",required:"accessToken is required"}},id:{type:"string",messages:{type:"id must be a string",required:"id is required"}},settings:{$ref:"#settings"},pageName:{type:"string",messages:{type:"pageName must be a string"}},filters:{type:"array",items:{type:"object",oneOf:[{$ref:"#basicFilter"},{$ref:"#advancedFilter"}]},invalidMessage:"filters property is invalid"},permissions:{type:"number","enum":[0,1,2,4,7],"default":0,invalidMessage:"permissions property is invalid"},viewMode:{type:"number","enum":[0,1],"default":0,invalidMessage:"viewMode property is invalid"}},required:["accessToken","id"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{accessToken:{type:"string",messages:{type:"accessToken must be a string",required:"accessToken is required"}},id:{type:"string",messages:{type:"id must be a string",required:"id is required"}},pageView:{type:"string",messages:{type:'pageView must be a string with one of the following values: "actualSize", "fitToWidth", "oneColumn"'}}},required:["accessToken","id"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{name:{type:"string",messages:{type:"name must be a string",required:"name is required"}}},required:["name"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{filterPaneEnabled:{type:"boolean",messages:{type:"filterPaneEnabled must be a boolean"}},navContentPaneEnabled:{type:"boolean",messages:{type:"navContentPaneEnabled must be a boolean"}},useCustomSaveAsDialog:{type:"boolean",messages:{type:"useCustomSaveAsDialog must be a boolean"}}}}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{target:{type:"object",properties:{table:{type:"string"},column:{type:"string"},hierarchy:{type:"string"},hierarchyLevel:{type:"string"},measure:{type:"string"}},required:["table"]},operator:{type:"string"},values:{type:"array",items:{type:["string","boolean","number"]}}},required:["target","operator","values"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{accessToken:{type:"string",messages:{type:"accessToken must be a string",required:"accessToken is required"}},datasetId:{type:"string",messages:{type:"datasetId must be a string",required:"datasetId is required"}}},required:["accessToken","datasetId"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{name:{type:"string",messages:{type:"name must be a string",required:"name is required"}}},required:["name"]}},function(e,t,r){e.exports=r(11)},function(e,t,r){"use strict";function n(e){return e=e instanceof RegExp?e:new RegExp(e),A?e.toString():"/"+e.source.replace(y,"\\$&")+"/"}function i(e){return'"'+e.replace(v,"\\$1")+'"'}function o(e,t){return b.lastIndex=0,b.test(t)?e+"."+t:e+"["+i(t)+"]"}function s(e){if(void 0===e)return"undefined";var t=Object.prototype.toString.call(e);return t.substr(8,t.length-9).toLowerCase()}function a(e){return(0|e)===e}function c(e,t){k[t].type=e,k[t].keyword=t}function h(e){var t,r,n,i=Object.keys(e),o=i.indexOf("properties"),s=i.indexOf("patternProperties"),a={"enum":Array.isArray(e["enum"])&&e["enum"].length>0,type:null,allType:[],perType:{}};for(e.type&&("string"==typeof e.type?a.type=[e.type]:Array.isArray(e.type)&&e.type.length&&(a.type=e.type.slice(0))),n=0;n-1&&"required"===t||s>-1&&"additionalProperties"===t||a.perType[r.type].push(t)):a.allType.push(t)));return a}function u(e,t){var r,n,i=e.substr(4),o=i.length,s=[],a="",c=!1;for(n=0;n "+e.schema.maximum+") {"),e.error("maximum"),e.code("}"))},k.exclusiveMaximum=function(e){e.schema.exclusiveMaximum===!0&&"number"==typeof e.schema.maximum&&(e.code("if ("+e.path+" === "+e.schema.maximum+") {"),e.error("exclusiveMaximum"),e.code("}"))},k.multipleOf=function(e){if("number"==typeof e.schema.multipleOf){var t=e.schema.multipleOf,r=t.toString().length-t.toFixed(0).length-1,n=r>0?Math.pow(10,r):1,i=e.path;r>0?e.code("if (+(Math.round(("+i+" * "+n+') + "e+" + '+r+') + "e-" + '+r+") % "+t*n+" !== 0) {"):e.code("if ((("+i+" * "+n+") % "+t*n+") !== 0) {"),e.error("multipleOf"),e.code("}")}},k.minLength=function(e){a(e.schema.minLength)&&(e.code("if (ucs2length("+e.path+") < "+e.schema.minLength+") {"),e.error("minLength"),e.code("}"))},k.maxLength=function(e){a(e.schema.maxLength)&&(e.code("if (ucs2length("+e.path+") > "+e.schema.maxLength+") {"),e.error("maxLength"),e.code("}"))},k.pattern=function(e){var t=e.schema.pattern;("string"==typeof t||t instanceof RegExp)&&(e.code("if (!("+n(t)+").test("+e.path+")) {"),e.error("pattern"),e.code("}"))},k.format=function(e){"string"==typeof e.schema.format&&I[e.schema.format]&&(e.code("if (!("+I[e.schema.format]+").test("+e.path+")) {"),e.error("format"),e.code("}"))},k.minItems=function(e){a(e.schema.minItems)&&(e.code("if ("+e.path+".length < "+e.schema.minItems+") {"),e.error("minItems"),e.code("}"))},k.maxItems=function(e){a(e.schema.maxItems)&&(e.code("if ("+e.path+".length > "+e.schema.maxItems+") {"),e.error("maxItems"),e.code("}"))},k.additionalItems=function(e){e.schema.additionalItems===!1&&Array.isArray(e.schema.items)&&(e.code("if ("+e.path+".length > "+e.schema.items.length+") {"),e.error("additionalItems"),e.code("}"))},k.uniqueItems=function(e){e.schema.uniqueItems&&(e.code("if (unique("+e.path+").length !== "+e.path+".length) {"),e.error("uniqueItems"),e.code("}"))},k.items=function(e){var t=e.declare(0),r=0;if("object"===s(e.schema.items))e.code("for ("+t+" = 0; "+t+" < "+e.path+".length; "+t+"++) {"),e.descend(e.path+"["+t+"]",e.schema.items),e.code("}");else if(Array.isArray(e.schema.items)){for(;r= "+r+") {"),e.descend(e.path+"["+r+"]",e.schema.items[r]),e.code("}");"object"===s(e.schema.additionalItems)&&(e.code("for ("+t+" = "+r+"; "+t+" < "+e.path+".length; "+t+"++) {"),e.descend(e.path+"["+t+"]",e.schema.additionalItems),e.code("}"))}},k.maxProperties=function(e){a(e.schema.maxProperties)&&(e.code("if (Object.keys("+e.path+").length > "+e.schema.maxProperties+") {"),e.error("maxProperties"),e.code("}"))},k.minProperties=function(e){a(e.schema.minProperties)&&(e.code("if (Object.keys("+e.path+").length < "+e.schema.minProperties+") {"),e.error("minProperties"),e.code("}"))},k.required=function(e){if(Array.isArray(e.schema.required))for(var t=0;t-1&&(e.code("else {"),e.error("required",t),e.code("}"))},k.patternProperties=k.additionalProperties=function(e){var t,r,i,o,a,c,h,u="object"===s(e.schema.properties)?Object.keys(e.schema.properties):[],d=e.schema.patternProperties,p="object"===s(d)?Object.keys(d):[],f=e.schema.additionalProperties,l=f===!1||"object"===s(f);if(p.length||l){for(r=e.declare("[]"),i=e.declare('""'),o=e.declare(0),l&&(a=e.declare(!1)),e.code(r+" = Object.keys("+e.path+")"),e.code("for ("+o+" = 0; "+o+" < "+r+".length; "+o+"++) {")(i+" = "+r+"["+o+"]")("if ("+e.path+"["+i+"] === undefined) {")("continue")("}"),l&&e.code(a+" = false"),h=0;h -1) {")("continue")("}")),e.code("if (!"+a+") {"),f===!1?e.error("additionalProperties",void 0,i):e.descend(e.path+"["+i+"]",f),e.code("}")),e.code("}")}},k.dependencies=function(e){if("object"===s(e.schema.dependencies))for(var t,r,n=Object.keys(e.schema.dependencies),i=n.length,a=0,c=0;c1&&delete this.objects[n][r]},f.prototype.dispose=function(){this.objects.length=0,this.properties.length=0},m.prototype.clone=function(e){var t=new m({schema:e,formats:this.formats,greedy:this.greedy,resolver:this.resolver,id:this.id,funcache:this.funcache,scope:this.scope});return t},m.prototype.declare=function(e){var t=this.id();return this.code.def(t,e),t},m.prototype.cache=function(e,t){var r,n=this.funcache[e];return n||(n=this.funcache[e]={key:this.id()},r=this.clone(t),n.func=r.compile(n.key),this.scope.refs[n.key]=n.func,r.dispose()),"refs."+n.key},m.prototype.error=function(e,t,r){var n=this.schema,o=this.path,s="data"!==o||t?'(path ? path + "." : "") + '+u(o,t)+",":"path,",a=t&&n.properties&&n.properties[t]?this.resolver.resolve(n.properties[t]):null,c=a?a.requiredMessage:n.invalidMessage;c||(c=a&&a.messages&&a.messages[e]||n.messages&&n.messages[e]),this.code("errors.push({"),c&&this.code("message: "+i(c)+","),r&&this.code("additionalProperties: "+r+","),this.code("path: "+s)("keyword: "+i(e))("})"),this.greedy||this.code("return")},m.prototype.refactor=function(e,t,r){var n="data"!==e?'(path ? path + "." : "") + '+u(e):"path",i=this.cache(r,t),o=this.declare();this.code(o+" = "+i+"("+e+", "+n+", errors)"),this.greedy||this.code("if (errors.length) { return }")},m.prototype.descend=function(e,t){var r=this.path,n=this.schema;this.path=e,this.schema=t,this.generate(),this.path=r,this.schema=n},m.prototype.generate=function(){function e(e){k[e](l)}var t,r,o,a,c,u,d,p=this.path,f=this.schema,l=this,m=this.scope;if("object"===s(f)){if(void 0!==f.$ref){if(f=this.resolver.resolve(f),this.resolver.hasRef(f))return void this.refactor(p,f,this.resolver.getNormalizedRef(this.schema)||this.schema.$ref);this.schema=f}if(o=h(f),o["enum"])return void k["enum"](l);for(a=Object.keys(o.perType),d=0;d-1&&o.type.splice(c,1));o.type&&(o.type.length?(this.code((a.length?"else ":"")+"if (!("+o.type.map(function(e){return S[e]?S[e](p):"true"}).join(" || ")+")) {"),this.error("type"),this.code("}")):(this.code("else {"),this.error("type"),this.code("}"))),o.allType.forEach(function(e){k[e](l)}),f.format&&this.formats&&(r=this.formats[f.format],r&&("string"==typeof r||r instanceof RegExp?(this.code("if (!("+n(r)+").test("+p+")) {"),this.error("format"),this.code("}")):"function"==typeof r&&((m.formats||(m.formats={}))[f.format]=r,(m.schemas||(m.schemas={}))[f.format]=f,t=i(f.format),this.code("if (!formats["+t+"]("+p+", schemas["+t+"])) {"),this.error("format"),this.code("}"))))}},m.prototype.compile=function(e){return this.code=E("jsen_compiled"+(e?"_"+e:""),"data","path","errors"),this.generate(),this.code.compile(this.scope)},m.prototype.dispose=function(){for(var e in this)this[e]=void 0},g.browser=x,g.clone=d,g.equal=O,g.unique=P,g.ucs2length=C,g.SchemaResolver=j,g.resolve=j.resolvePointer,e.exports=g},function(e,t){"use strict";e.exports=function(){var e=Array.apply(null,arguments),t=e.shift(),r=" ",n="",i="",o=1,s="{[",a="}]",c=function(){for(var e=r,t=0;t++-1&&s.indexOf(r)>-1?(o--,h(e),o++):s.indexOf(r)>-1?(h(e),o++):a.indexOf(t)>-1?(o--,h(e)):h(e),u};return u.def=function(e,t){return i+=(i?",\n"+r+" ":"")+e+(void 0!==t?" = "+t:""),u},u.toSource=function(){return"function "+t+"("+e.join(", ")+") {\n"+r+'"use strict"\n'+(i?r+"var "+i+";\n":"")+n+"}"},u.compile=function(e){var t="return ("+u.toSource()+")",r=e||{},n=Object.keys(r),i=n.map(function(e){return r[e]});return Function.apply(null,n.concat(t)).apply(null,i)},u}},function(e,t){"use strict";function r(e){var t=Object.prototype.toString.call(e);return t.substr(8,t.length-9).toLowerCase()}function n(e,t){var r,n,o=Object.keys(e).sort(),s=Object.keys(t).sort();if(!i(o,s))return!1;for(r=0;r-1)throw new Error(u+" "+t);return this.refStack.push(t),r=this._resolveRef(t),this.refStack.pop(),e===this.rootSchema&&(this.resolvedRootSchema=r),r},o.prototype.hasRef=function(e){var t,r,n,i,o=Object.keys(e);if(o.indexOf("$ref")>-1)return!0;for(n=0,t=o.length;n=55296&&t<=56319&&i=55296&&t<=56319&&i2&&"[]"===s.slice(a-2)&&(c=!0,s=s.slice(0,a-2),r[s]||(r[s]=[])),i=o[1]?w(o[1]):""),c?r[s].push(i):r[s]=i}return r},recognize:function(e){var t,r,n,i=[this.rootState],o={},s=!1;if(n=e.indexOf("?"),n!==-1){var a=e.substr(n+1,e.length);e=e.substr(0,n),o=this.parseQueryString(a)}for(e=decodeURI(e),"/"!==e.charAt(0)&&(e="/"+e),t=e.length,t>1&&"/"===e.charAt(t-1)&&(e=e.substr(0,t-1),s=!0),r=0;r Date: Mon, 13 Feb 2017 17:32:03 +0200 Subject: [PATCH 11/11] delet dist --- dist/config.d.ts | 6 - dist/create.d.ts | 28 - dist/dashboard.d.ts | 62 - dist/embed.d.ts | 278 -- dist/factories.d.ts | 9 - dist/ifilterable.d.ts | 30 - dist/page.d.ts | 93 - dist/powerbi.d.ts | 15 - dist/powerbi.js | 6731 ----------------------------------------- dist/powerbi.js.map | 1 - dist/powerbi.min.js | 69 - dist/report.d.ts | 176 -- dist/service.d.ts | 165 - dist/tile.d.ts | 23 - dist/util.d.ts | 46 - 15 files changed, 7732 deletions(-) delete mode 100644 dist/config.d.ts delete mode 100644 dist/create.d.ts delete mode 100644 dist/dashboard.d.ts delete mode 100644 dist/embed.d.ts delete mode 100644 dist/factories.d.ts delete mode 100644 dist/ifilterable.d.ts delete mode 100644 dist/page.d.ts delete mode 100644 dist/powerbi.d.ts delete mode 100644 dist/powerbi.js delete mode 100644 dist/powerbi.js.map delete mode 100644 dist/powerbi.min.js delete mode 100644 dist/report.d.ts delete mode 100644 dist/service.d.ts delete mode 100644 dist/tile.d.ts delete mode 100644 dist/util.d.ts diff --git a/dist/config.d.ts b/dist/config.d.ts deleted file mode 100644 index 71b64c53..00000000 --- a/dist/config.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -/*! powerbi-client v2.2.7 | (c) 2016 Microsoft Corporation MIT */ -declare const config: { - version: string; - type: string; -}; -export default config; diff --git a/dist/create.d.ts b/dist/create.d.ts deleted file mode 100644 index 6a11ea12..00000000 --- a/dist/create.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -/*! powerbi-client v2.2.7 | (c) 2016 Microsoft Corporation MIT */ -import * as service from './service'; -import * as models from 'powerbi-models'; -import * as embed from './embed'; -export declare class Create extends embed.Embed { - constructor(service: service.Service, element: HTMLElement, config: embed.IEmbedConfiguration); - /** - * Gets the dataset ID from the first available location: createConfig or embed url. - * - * @returns {string} - */ - getId(): string; - /** - * Validate create report configuration. - */ - validate(config: models.IReportCreateConfiguration): models.IError[]; - /** - * Adds the ability to get datasetId from url. - * (e.g. http://embedded.powerbi.com/appTokenReportEmbed?datasetId=854846ed-2106-4dc2-bc58-eb77533bf2f1). - * - * By extracting the ID we can ensure that the ID is always explicitly provided as part of the create configuration. - * - * @static - * @param {string} url - * @returns {string} - */ - static findIdFromEmbedUrl(url: string): string; -} diff --git a/dist/dashboard.d.ts b/dist/dashboard.d.ts deleted file mode 100644 index b7d21cff..00000000 --- a/dist/dashboard.d.ts +++ /dev/null @@ -1,62 +0,0 @@ -/*! powerbi-client v2.2.7 | (c) 2016 Microsoft Corporation MIT */ -import * as service from './service'; -import * as embed from './embed'; -import * as models from 'powerbi-models'; -/** - * A Dashboard node within a dashboard hierarchy - * - * @export - * @interface IDashboardNode - */ -export interface IDashboardNode { - iframe: HTMLIFrameElement; - service: service.IService; - config: embed.IInternalEmbedConfiguration; -} -/** - * A Power BI Dashboard embed component - * - * @export - * @class Dashboard - * @extends {embed.Embed} - * @implements {IDashboardNode} - * @implements {IFilterable} - */ -export declare class Dashboard extends embed.Embed implements IDashboardNode { - static allowedEvents: string[]; - static dashboardIdAttribute: string; - static typeAttribute: string; - static type: string; - /** - * Creates an instance of a Power BI Dashboard. - * - * @param {service.Service} service - * @param {HTMLElement} element - */ - constructor(service: service.Service, element: HTMLElement, config: embed.IEmbedConfiguration); - /** - * This adds backwards compatibility for older config which used the dashboardId query param to specify dashboard id. - * E.g. https://powerbi-df.analysis-df.windows.net/dashboardEmbedHost?dashboardId=e9363c62-edb6-4eac-92d3-2199c5ca2a9e - * - * By extracting the id we can ensure id is always explicitly provided as part of the load configuration. - * - * @static - * @param {string} url - * @returns {string} - */ - static findIdFromEmbedUrl(url: string): string; - /** - * Get dashboard id from first available location: options, attribute, embed url. - * - * @returns {string} - */ - getId(): string; - /** - * Validate load configuration. - */ - validate(config: models.IDashboardLoadConfiguration): models.IError[]; - /** - * Validate that pageView has a legal value: if page view is defined it must have one of the values defined in models.PageView - */ - private ValidatePageView(pageView); -} diff --git a/dist/embed.d.ts b/dist/embed.d.ts deleted file mode 100644 index 6b50b0b2..00000000 --- a/dist/embed.d.ts +++ /dev/null @@ -1,278 +0,0 @@ -/*! powerbi-client v2.2.7 | (c) 2016 Microsoft Corporation MIT */ -import * as service from './service'; -import * as models from 'powerbi-models'; -declare global { - interface Document { - mozCancelFullScreen: Function; - msExitFullscreen: Function; - } - interface HTMLIFrameElement { - mozRequestFullScreen: Function; - msRequestFullscreen: Function; - } -} -/** - * Configuration settings for Power BI embed components - * - * @export - * @interface IEmbedConfiguration - */ -export interface IEmbedConfiguration { - type?: string; - id?: string; - uniqueId?: string; - embedUrl?: string; - accessToken?: string; - settings?: models.ISettings; - pageName?: string; - filters?: models.IFilter[]; - pageView?: models.PageView; - datasetId?: string; - permissions?: models.Permissions; - viewMode?: models.ViewMode; -} -export interface IInternalEmbedConfiguration extends models.IReportLoadConfiguration { - uniqueId: string; - type: string; - embedUrl: string; -} -export interface IInternalEventHandler { - test(event: service.IEvent): boolean; - handle(event: service.ICustomEvent): void; -} -/** - * Base class for all Power BI embed components - * - * @export - * @abstract - * @class Embed - */ -export declare abstract class Embed { - static allowedEvents: string[]; - static accessTokenAttribute: string; - static embedUrlAttribute: string; - static nameAttribute: string; - static typeAttribute: string; - static type: string; - private static defaultSettings; - allowedEvents: any[]; - /** - * Gets or sets the event handler registered for this embed component. - * - * @type {IInternalEventHandler[]} - */ - eventHandlers: IInternalEventHandler[]; - /** - * Gets or sets the Power BI embed service. - * - * @type {service.Service} - */ - service: service.Service; - /** - * Gets or sets the HTML element that contains the Power BI embed component. - * - * @type {HTMLElement} - */ - element: HTMLElement; - /** - * Gets or sets the HTML iframe element that renders the Power BI embed component. - * - * @type {HTMLIFrameElement} - */ - iframe: HTMLIFrameElement; - /** - * Gets or sets the configuration settings for the Power BI embed component. - * - * @type {IInternalEmbedConfiguration} - */ - config: IInternalEmbedConfiguration; - /** - * Gets or sets the configuration settings for creating report. - * - * @type {models.IReportCreateConfiguration} - */ - createConfig: models.IReportCreateConfiguration; - /** - * Url used in the load request. - */ - loadPath: string; - /** - * Type of embed - */ - embeType: string; - /** - * Creates an instance of Embed. - * - * Note: there is circular reference between embeds and the service, because - * the service has a list of all embeds on the host page, and each embed has a reference to the service that created it. - * - * @param {service.Service} service - * @param {HTMLElement} element - * @param {IEmbedConfiguration} config - */ - constructor(service: service.Service, element: HTMLElement, config: IEmbedConfiguration, iframe?: HTMLIFrameElement); - /** - * Sends createReport configuration data. - * - * ```javascript - * createReport({ - * datasetId: '5dac7a4a-4452-46b3-99f6-a25915e0fe55', - * accessToken: 'eyJ0eXA ... TaE2rTSbmg', - * ``` - * - * @param {models.IReportCreateConfiguration} config - * @returns {Promise} - */ - createReport(config: models.IReportCreateConfiguration): Promise; - /** - * Saves Report. - * - * @returns {Promise} - */ - save(): Promise; - /** - * SaveAs Report. - * - * @returns {Promise} - */ - saveAs(saveAsParameters: models.ISaveAsParameters): Promise; - /** - * Sends load configuration data. - * - * ```javascript - * report.load({ - * type: 'report', - * id: '5dac7a4a-4452-46b3-99f6-a25915e0fe55', - * accessToken: 'eyJ0eXA ... TaE2rTSbmg', - * settings: { - * navContentPaneEnabled: false - * }, - * pageName: "DefaultPage", - * filters: [ - * { - * ... DefaultReportFilter ... - * } - * ] - * }) - * .catch(error => { ... }); - * ``` - * - * @param {models.ILoadConfiguration} config - * @returns {Promise} - */ - load(config: models.IReportLoadConfiguration | models.IDashboardLoadConfiguration): Promise; - /** - * Removes one or more event handlers from the list of handlers. - * If a reference to the existing handle function is specified, remove the specific handler. - * If the handler is not specified, remove all handlers for the event name specified. - * - * ```javascript - * report.off('pageChanged') - * - * or - * - * const logHandler = function (event) { - * console.log(event); - * }; - * - * report.off('pageChanged', logHandler); - * ``` - * - * @template T - * @param {string} eventName - * @param {service.IEventHandler} [handler] - */ - off(eventName: string, handler?: service.IEventHandler): void; - /** - * Adds an event handler for a specific event. - * - * ```javascript - * report.on('pageChanged', (event) => { - * console.log('PageChanged: ', event.page.name); - * }); - * ``` - * - * @template T - * @param {string} eventName - * @param {service.IEventHandler} handler - */ - on(eventName: string, handler: service.IEventHandler): void; - /** - * Reloads embed using existing configuration. - * E.g. For reports this effectively clears all filters and makes the first page active which simulates resetting a report back to loaded state. - * - * ```javascript - * report.reload(); - * ``` - */ - reload(): Promise; - /** - * Set accessToken. - * - * @returns {Promise} - */ - setAccessToken(accessToken: string): Promise; - /** - * Gets an access token from the first available location: config, attribute, global. - * - * @private - * @param {string} globalAccessToken - * @returns {string} - */ - private getAccessToken(globalAccessToken); - /** - * Populate config for create and load - * - * @private - * @param {IEmbedConfiguration} - * @returns {void} - */ - private populateConfig(config); - /** - * Gets an embed url from the first available location: options, attribute. - * - * @private - * @returns {string} - */ - private getEmbedUrl(); - /** - * Gets a unique ID from the first available location: options, attribute. - * If neither is provided generate a unique string. - * - * @private - * @returns {string} - */ - private getUniqueId(); - /** - * Gets the report ID from the first available location: options, attribute. - * - * @abstract - * @returns {string} - */ - abstract getId(): string; - /** - * Requests the browser to render the component's iframe in fullscreen mode. - */ - fullscreen(): void; - /** - * Requests the browser to exit fullscreen mode. - */ - exitFullscreen(): void; - /** - * Returns true if the iframe is rendered in fullscreen mode, - * otherwise returns false. - * - * @private - * @param {HTMLIFrameElement} iframe - * @returns {boolean} - */ - private isFullscreen(iframe); - /** - * Validate load and create configuration. - */ - abstract validate(config: models.IReportLoadConfiguration | models.IDashboardLoadConfiguration | models.IReportCreateConfiguration): models.IError[]; - /** - * Sets Iframe for embed - */ - private setIframe(isLoad); -} diff --git a/dist/factories.d.ts b/dist/factories.d.ts deleted file mode 100644 index 2dfa8ff8..00000000 --- a/dist/factories.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/*! powerbi-client v2.2.7 | (c) 2016 Microsoft Corporation MIT */ -/** - * TODO: Need to find better place for these factory functions or refactor how we handle dependency injection - */ -import { IHpmFactory, IWpmpFactory, IRouterFactory } from './service'; -export { IHpmFactory, IWpmpFactory, IRouterFactory }; -export declare const hpmFactory: IHpmFactory; -export declare const wpmpFactory: IWpmpFactory; -export declare const routerFactory: IRouterFactory; diff --git a/dist/ifilterable.d.ts b/dist/ifilterable.d.ts deleted file mode 100644 index 11eddd1b..00000000 --- a/dist/ifilterable.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -/*! powerbi-client v2.2.7 | (c) 2016 Microsoft Corporation MIT */ -import * as models from 'powerbi-models'; -/** - * Decorates embed components that support filters - * Examples include reports and pages - * - * @export - * @interface IFilterable - */ -export interface IFilterable { - /** - * Gets the filters currently applied to the object. - * - * @returns {(Promise)} - */ - getFilters(): Promise; - /** - * Replaces all filters on the current object with the specified filter values. - * - * @param {(models.IFilter[])} filters - * @returns {Promise} - */ - setFilters(filters: models.IFilter[]): Promise; - /** - * Removes all filters from the current object. - * - * @returns {Promise} - */ - removeFilters(): Promise; -} diff --git a/dist/page.d.ts b/dist/page.d.ts deleted file mode 100644 index 22886875..00000000 --- a/dist/page.d.ts +++ /dev/null @@ -1,93 +0,0 @@ -/*! powerbi-client v2.2.7 | (c) 2016 Microsoft Corporation MIT */ -import { IFilterable } from './ifilterable'; -import { IReportNode } from './report'; -import * as models from 'powerbi-models'; -/** - * A Page node within a report hierarchy - * - * @export - * @interface IPageNode - */ -export interface IPageNode { - report: IReportNode; - name: string; -} -/** - * A Power BI report page - * - * @export - * @class Page - * @implements {IPageNode} - * @implements {IFilterable} - */ -export declare class Page implements IPageNode, IFilterable { - /** - * The parent Power BI report that this page is a member of - * - * @type {IReportNode} - */ - report: IReportNode; - /** - * The report page name - * - * @type {string} - */ - name: string; - /** - * The user defined display name of the report page, which is undefined if the page is created manually - * - * @type {string} - */ - displayName: string; - /** - * Creates an instance of a Power BI report page. - * - * @param {IReportNode} report - * @param {string} name - * @param {string} [displayName] - */ - constructor(report: IReportNode, name: string, displayName?: string); - /** - * Gets all page level filters within the report. - * - * ```javascript - * page.getFilters() - * .then(pages => { ... }); - * ``` - * - * @returns {(Promise)} - */ - getFilters(): Promise; - /** - * Removes all filters from this page of the report. - * - * ```javascript - * page.removeFilters(); - * ``` - * - * @returns {Promise} - */ - removeFilters(): Promise; - /** - * Makes the current page the active page of the report. - * - * ```javascripot - * page.setActive(); - * ``` - * - * @returns {Promise} - */ - setActive(): Promise; - /** - * Sets all filters on the current page. - * - * ```javascript - * page.setFilters(filters); - * .catch(errors => { ... }); - * ``` - * - * @param {(models.IFilter[])} filters - * @returns {Promise} - */ - setFilters(filters: models.IFilter[]): Promise; -} diff --git a/dist/powerbi.d.ts b/dist/powerbi.d.ts deleted file mode 100644 index 27f17ed7..00000000 --- a/dist/powerbi.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -/*! powerbi-client v2.2.7 | (c) 2016 Microsoft Corporation MIT */ -import * as service from './service'; -import * as factories from './factories'; -import * as models from 'powerbi-models'; -import { IFilterable } from './ifilterable'; -export { IFilterable, service, factories, models }; -export { Report } from './report'; -export { Tile } from './tile'; -export { IEmbedConfiguration, Embed } from './embed'; -export { Page } from './page'; -declare global { - interface Window { - powerbi: service.Service; - } -} diff --git a/dist/powerbi.js b/dist/powerbi.js deleted file mode 100644 index 68c02875..00000000 --- a/dist/powerbi.js +++ /dev/null @@ -1,6731 +0,0 @@ -/*! powerbi-client v2.2.7 | (c) 2016 Microsoft Corporation MIT */ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define([], factory); - else if(typeof exports === 'object') - exports["powerbi-client"] = factory(); - else - root["powerbi-client"] = factory(); -})(this, function() { -return /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) -/******/ return installedModules[moduleId].exports; -/******/ -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ exports: {}, -/******/ id: moduleId, -/******/ loaded: false -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.loaded = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(0); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ function(module, exports, __webpack_require__) { - - var service = __webpack_require__(1); - exports.service = service; - var factories = __webpack_require__(10); - exports.factories = factories; - var models = __webpack_require__(5); - exports.models = models; - var report_1 = __webpack_require__(4); - exports.Report = report_1.Report; - var tile_1 = __webpack_require__(9); - exports.Tile = tile_1.Tile; - var embed_1 = __webpack_require__(2); - exports.Embed = embed_1.Embed; - var page_1 = __webpack_require__(6); - exports.Page = page_1.Page; - /** - * Makes Power BI available to the global object for use in applications that don't have module loading support. - * - * Note: create an instance of the class with the default configuration for normal usage, or save the class so that you can create an instance of the service. - */ - var powerbi = new service.Service(factories.hpmFactory, factories.wpmpFactory, factories.routerFactory); - window.powerbi = powerbi; - - -/***/ }, -/* 1 */ -/***/ function(module, exports, __webpack_require__) { - - var embed = __webpack_require__(2); - var report_1 = __webpack_require__(4); - var create_1 = __webpack_require__(7); - var dashboard_1 = __webpack_require__(8); - var tile_1 = __webpack_require__(9); - var page_1 = __webpack_require__(6); - var utils = __webpack_require__(3); - /** - * The Power BI Service embed component, which is the entry point to embed all other Power BI components into your application - * - * @export - * @class Service - * @implements {IService} - */ - var Service = (function () { - /** - * Creates an instance of a Power BI Service. - * - * @param {IHpmFactory} hpmFactory The http post message factory used in the postMessage communication layer - * @param {IWpmpFactory} wpmpFactory The window post message factory used in the postMessage communication layer - * @param {IRouterFactory} routerFactory The router factory used in the postMessage communication layer - * @param {IServiceConfiguration} [config={}] - */ - function Service(hpmFactory, wpmpFactory, routerFactory, config) { - var _this = this; - if (config === void 0) { config = {}; } - this.wpmp = wpmpFactory(config.wpmpName, config.logMessages); - this.hpm = hpmFactory(this.wpmp, null, config.version, config.type); - this.router = routerFactory(this.wpmp); - /** - * Adds handler for report events. - */ - this.router.post("/reports/:uniqueId/events/:eventName", function (req, res) { - var event = { - type: 'report', - id: req.params.uniqueId, - name: req.params.eventName, - value: req.body - }; - _this.handleEvent(event); - }); - this.router.post("/reports/:uniqueId/pages/:pageName/events/:eventName", function (req, res) { - var event = { - type: 'report', - id: req.params.uniqueId, - name: req.params.eventName, - value: req.body - }; - _this.handleEvent(event); - }); - this.router.post("/dashboards/:uniqueId/events/:eventName", function (req, res) { - var event = { - type: 'dashboard', - id: req.params.uniqueId, - name: req.params.eventName, - value: req.body - }; - _this.handleEvent(event); - }); - this.embeds = []; - // TODO: Change when Object.assign is available. - this.config = utils.assign({}, Service.defaultConfig, config); - if (this.config.autoEmbedOnContentLoaded) { - this.enableAutoEmbed(); - } - } - /** - * Creates new report - * @param {HTMLElement} element - * @param {embed.IEmbedConfiguration} [config={}] - * @returns {embed.Embed} - */ - Service.prototype.createReport = function (element, config) { - config.type = 'create'; - var powerBiElement = element; - var component = new create_1.Create(this, powerBiElement, config); - powerBiElement.powerBiEmbed = component; - this.embeds.push(component); - return component; - }; - /** - * TODO: Add a description here - * - * @param {HTMLElement} [container] - * @param {embed.IEmbedConfiguration} [config=undefined] - * @returns {embed.Embed[]} - */ - Service.prototype.init = function (container, config) { - var _this = this; - if (config === void 0) { config = undefined; } - container = (container && container instanceof HTMLElement) ? container : document.body; - var elements = Array.prototype.slice.call(container.querySelectorAll("[" + embed.Embed.embedUrlAttribute + "]")); - return elements.map(function (element) { return _this.embed(element, config); }); - }; - /** - * Given a configuration based on an HTML element, - * if the component has already been created and attached to the element, reuses the component instance and existing iframe, - * otherwise creates a new component instance. - * - * @param {HTMLElement} element - * @param {embed.IEmbedConfiguration} [config={}] - * @returns {embed.Embed} - */ - Service.prototype.embed = function (element, config) { - if (config === void 0) { config = {}; } - var component; - var powerBiElement = element; - if (powerBiElement.powerBiEmbed) { - component = this.embedExisting(powerBiElement, config); - } - else { - component = this.embedNew(powerBiElement, config); - } - return component; - }; - /** - * Given a configuration based on a Power BI element, saves the component instance that reference the element for later lookup. - * - * @private - * @param {IPowerBiElement} element - * @param {embed.IEmbedConfiguration} config - * @returns {embed.Embed} - */ - Service.prototype.embedNew = function (element, config) { - var componentType = config.type || element.getAttribute(embed.Embed.typeAttribute); - if (!componentType) { - throw new Error("Attempted to embed using config " + JSON.stringify(config) + " on element " + element.outerHTML + ", but could not determine what type of component to embed. You must specify a type in the configuration or as an attribute such as '" + embed.Embed.typeAttribute + "=\"" + report_1.Report.type.toLowerCase() + "\"'."); - } - // Saves the type as part of the configuration so that it can be referenced later at a known location. - config.type = componentType; - var Component = utils.find(function (component) { return componentType === component.type.toLowerCase(); }, Service.components); - if (!Component) { - throw new Error("Attempted to embed component of type: " + componentType + " but did not find any matching component. Please verify the type you specified is intended."); - } - var component = new Component(this, element, config); - element.powerBiEmbed = component; - this.embeds.push(component); - return component; - }; - /** - * Given an element that already contains an embed component, load with a new configuration. - * - * @private - * @param {IPowerBiElement} element - * @param {embed.IEmbedConfiguration} config - * @returns {embed.Embed} - */ - Service.prototype.embedExisting = function (element, config) { - var component = utils.find(function (x) { return x.element === element; }, this.embeds); - if (!component) { - throw new Error("Attempted to embed using config " + JSON.stringify(config) + " on element " + element.outerHTML + " which already has embedded comopnent associated, but could not find the existing comopnent in the list of active components. This could indicate the embeds list is out of sync with the DOM, or the component is referencing the incorrect HTML element."); - } - /** - * TODO: Dynamic embed type switching could be supported but there is work needed to prepare the service state and DOM cleanup. - * remove all event handlers from the DOM, then reset the element to initial state which removes iframe, and removes from list of embeds - * then we can call the embedNew function which would allow setting the proper embedUrl and construction of object based on the new type. - */ - if (typeof config.type === "string" && config.type !== component.config.type) { - /** - * When loading report after create we want to use existing Iframe to optimize load period - */ - if (config.type === "report" && component.config.type === "create") { - var report = new report_1.Report(this, element, config, element.powerBiEmbed.iframe); - report.load(config); - element.powerBiEmbed = report; - this.embeds.push(report); - return report; - } - throw new Error("Embedding on an existing element with a different type than the previous embed object is not supported. Attempted to embed using config " + JSON.stringify(config) + " on element " + element.outerHTML + ", but the existing element contains an embed of type: " + this.config.type + " which does not match the new type: " + config.type); - } - component.load(config); - return component; - }; - /** - * Adds an event handler for DOMContentLoaded, which searches the DOM for elements that have the 'powerbi-embed-url' attribute, - * and automatically attempts to embed a powerbi component based on information from other powerbi-* attributes. - * - * Note: Only runs if `config.autoEmbedOnContentLoaded` is true when the service is created. - * This handler is typically useful only for applications that are rendered on the server so that all required data is available when the handler is called. - */ - Service.prototype.enableAutoEmbed = function () { - var _this = this; - window.addEventListener('DOMContentLoaded', function (event) { return _this.init(document.body); }, false); - }; - /** - * Returns an instance of the component associated with the element. - * - * @param {HTMLElement} element - * @returns {(Report | Tile)} - */ - Service.prototype.get = function (element) { - var powerBiElement = element; - if (!powerBiElement.powerBiEmbed) { - throw new Error("You attempted to get an instance of powerbi component associated with element: " + element.outerHTML + " but there was no associated instance."); - } - return powerBiElement.powerBiEmbed; - }; - /** - * Finds an embed instance by the name or unique ID that is provided. - * - * @param {string} uniqueId - * @returns {(Report | Tile)} - */ - Service.prototype.find = function (uniqueId) { - return utils.find(function (x) { return x.config.uniqueId === uniqueId; }, this.embeds); - }; - /** - * Given an HTML element that has a component embedded within it, removes the component from the list of embedded components, removes the association between the element and the component, and removes the iframe. - * - * @param {HTMLElement} element - * @returns {void} - */ - Service.prototype.reset = function (element) { - var powerBiElement = element; - if (!powerBiElement.powerBiEmbed) { - return; - } - /** Removes the component from an internal list of components. */ - utils.remove(function (x) { return x === powerBiElement.powerBiEmbed; }, this.embeds); - /** Deletes a property from the HTML element. */ - delete powerBiElement.powerBiEmbed; - /** Removes the iframe from the element. */ - var iframe = element.querySelector('iframe'); - if (iframe) { - iframe.remove(); - } - }; - /** - * Given an event object, finds the embed component with the matching type and ID, and invokes its handleEvent method with the event object. - * - * @private - * @param {IEvent} event - */ - Service.prototype.handleEvent = function (event) { - var embed = utils.find(function (embed) { - return (embed.config.uniqueId === event.id); - }, this.embeds); - if (embed) { - var value = event.value; - if (event.name === 'pageChanged') { - var pageKey = 'newPage'; - var page = value[pageKey]; - if (!page) { - throw new Error("Page model not found at 'event.value." + pageKey + "'."); - } - value[pageKey] = new page_1.Page(embed, page.name, page.displayName); - } - utils.raiseCustomEvent(embed.element, event.name, value); - } - }; - /** - * A list of components that this service can embed - */ - Service.components = [ - tile_1.Tile, - report_1.Report, - dashboard_1.Dashboard - ]; - /** - * The default configuration for the service - */ - Service.defaultConfig = { - autoEmbedOnContentLoaded: false, - onError: function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i - 0] = arguments[_i]; - } - return console.log(args[0], args.slice(1)); - } - }; - return Service; - }()); - exports.Service = Service; - - -/***/ }, -/* 2 */ -/***/ function(module, exports, __webpack_require__) { - - var utils = __webpack_require__(3); - /** - * Base class for all Power BI embed components - * - * @export - * @abstract - * @class Embed - */ - var Embed = (function () { - /** - * Creates an instance of Embed. - * - * Note: there is circular reference between embeds and the service, because - * the service has a list of all embeds on the host page, and each embed has a reference to the service that created it. - * - * @param {service.Service} service - * @param {HTMLElement} element - * @param {IEmbedConfiguration} config - */ - function Embed(service, element, config, iframe) { - this.allowedEvents = []; - Array.prototype.push.apply(this.allowedEvents, Embed.allowedEvents); - this.eventHandlers = []; - this.service = service; - this.element = element; - this.iframe = iframe; - this.embeType = config.type.toLowerCase(); - this.populateConfig(config); - if (this.embeType === 'create') { - this.setIframe(false /*set EventListener to call create() on 'load' event*/); - } - else { - this.setIframe(true /*set EventListener to call load() on 'load' event*/); - } - } - /** - * Sends createReport configuration data. - * - * ```javascript - * createReport({ - * datasetId: '5dac7a4a-4452-46b3-99f6-a25915e0fe55', - * accessToken: 'eyJ0eXA ... TaE2rTSbmg', - * ``` - * - * @param {models.IReportCreateConfiguration} config - * @returns {Promise} - */ - Embed.prototype.createReport = function (config) { - var errors = this.validate(config); - if (errors) { - throw errors; - } - return this.service.hpm.post("/report/create", config, { uid: this.config.uniqueId }, this.iframe.contentWindow) - .then(function (response) { - return response.body; - }, function (response) { - throw response.body; - }); - }; - /** - * Saves Report. - * - * @returns {Promise} - */ - Embed.prototype.save = function () { - return this.service.hpm.post('/report/save', null, { uid: this.config.uniqueId }, this.iframe.contentWindow) - .then(function (response) { - return response.body; - }) - .catch(function (response) { - throw response.body; - }); - }; - /** - * SaveAs Report. - * - * @returns {Promise} - */ - Embed.prototype.saveAs = function (saveAsParameters) { - return this.service.hpm.post('/report/saveAs', saveAsParameters, { uid: this.config.uniqueId }, this.iframe.contentWindow) - .then(function (response) { - return response.body; - }) - .catch(function (response) { - throw response.body; - }); - }; - /** - * Sends load configuration data. - * - * ```javascript - * report.load({ - * type: 'report', - * id: '5dac7a4a-4452-46b3-99f6-a25915e0fe55', - * accessToken: 'eyJ0eXA ... TaE2rTSbmg', - * settings: { - * navContentPaneEnabled: false - * }, - * pageName: "DefaultPage", - * filters: [ - * { - * ... DefaultReportFilter ... - * } - * ] - * }) - * .catch(error => { ... }); - * ``` - * - * @param {models.ILoadConfiguration} config - * @returns {Promise} - */ - Embed.prototype.load = function (config) { - var _this = this; - var errors = this.validate(config); - if (errors) { - throw errors; - } - return this.service.hpm.post(this.loadPath, config, { uid: this.config.uniqueId }, this.iframe.contentWindow) - .then(function (response) { - utils.assign(_this.config, config); - return response.body; - }, function (response) { - throw response.body; - }); - }; - /** - * Removes one or more event handlers from the list of handlers. - * If a reference to the existing handle function is specified, remove the specific handler. - * If the handler is not specified, remove all handlers for the event name specified. - * - * ```javascript - * report.off('pageChanged') - * - * or - * - * const logHandler = function (event) { - * console.log(event); - * }; - * - * report.off('pageChanged', logHandler); - * ``` - * - * @template T - * @param {string} eventName - * @param {service.IEventHandler} [handler] - */ - Embed.prototype.off = function (eventName, handler) { - var _this = this; - var fakeEvent = { name: eventName, type: null, id: null, value: null }; - if (handler) { - utils.remove(function (eventHandler) { return eventHandler.test(fakeEvent) && (eventHandler.handle === handler); }, this.eventHandlers); - this.element.removeEventListener(eventName, handler); - } - else { - var eventHandlersToRemove = this.eventHandlers - .filter(function (eventHandler) { return eventHandler.test(fakeEvent); }); - eventHandlersToRemove - .forEach(function (eventHandlerToRemove) { - utils.remove(function (eventHandler) { return eventHandler === eventHandlerToRemove; }, _this.eventHandlers); - _this.element.removeEventListener(eventName, eventHandlerToRemove.handle); - }); - } - }; - /** - * Adds an event handler for a specific event. - * - * ```javascript - * report.on('pageChanged', (event) => { - * console.log('PageChanged: ', event.page.name); - * }); - * ``` - * - * @template T - * @param {string} eventName - * @param {service.IEventHandler} handler - */ - Embed.prototype.on = function (eventName, handler) { - if (this.allowedEvents.indexOf(eventName) === -1) { - throw new Error("eventName is must be one of " + this.allowedEvents + ". You passed: " + eventName); - } - this.eventHandlers.push({ - test: function (event) { return event.name === eventName; }, - handle: handler - }); - this.element.addEventListener(eventName, handler); - }; - /** - * Reloads embed using existing configuration. - * E.g. For reports this effectively clears all filters and makes the first page active which simulates resetting a report back to loaded state. - * - * ```javascript - * report.reload(); - * ``` - */ - Embed.prototype.reload = function () { - return this.load(this.config); - }; - /** - * Set accessToken. - * - * @returns {Promise} - */ - Embed.prototype.setAccessToken = function (accessToken) { - return this.service.hpm.post('/report/token', accessToken, { uid: this.config.uniqueId }, this.iframe.contentWindow) - .then(function (response) { - return response.body; - }) - .catch(function (response) { - throw response.body; - }); - }; - /** - * Gets an access token from the first available location: config, attribute, global. - * - * @private - * @param {string} globalAccessToken - * @returns {string} - */ - Embed.prototype.getAccessToken = function (globalAccessToken) { - var accessToken = this.config.accessToken || this.element.getAttribute(Embed.accessTokenAttribute) || globalAccessToken; - if (!accessToken) { - throw new Error("No access token was found for element. You must specify an access token directly on the element using attribute '" + Embed.accessTokenAttribute + "' or specify a global token at: powerbi.accessToken."); - } - return accessToken; - }; - /** - * Populate config for create and load - * - * @private - * @param {IEmbedConfiguration} - * @returns {void} - */ - Embed.prototype.populateConfig = function (config) { - // TODO: Change when Object.assign is available. - var settings = utils.assign({}, Embed.defaultSettings, config.settings); - this.config = utils.assign({ settings: settings }, config); - this.config.uniqueId = this.getUniqueId(); - this.config.embedUrl = this.getEmbedUrl(); - if (this.embeType === 'create') { - this.createConfig = { - datasetId: config.datasetId || this.getId(), - accessToken: this.getAccessToken(this.service.accessToken), - settings: settings - }; - } - else { - this.config.id = this.getId(); - this.config.accessToken = this.getAccessToken(this.service.accessToken); - } - }; - /** - * Gets an embed url from the first available location: options, attribute. - * - * @private - * @returns {string} - */ - Embed.prototype.getEmbedUrl = function () { - var embedUrl = this.config.embedUrl || this.element.getAttribute(Embed.embedUrlAttribute); - if (typeof embedUrl !== 'string' || embedUrl.length === 0) { - throw new Error("Embed Url is required, but it was not found. You must provide an embed url either as part of embed configuration or as attribute '" + Embed.embedUrlAttribute + "'."); - } - return embedUrl; - }; - /** - * Gets a unique ID from the first available location: options, attribute. - * If neither is provided generate a unique string. - * - * @private - * @returns {string} - */ - Embed.prototype.getUniqueId = function () { - return this.config.uniqueId || this.element.getAttribute(Embed.nameAttribute) || utils.createRandomString(); - }; - /** - * Requests the browser to render the component's iframe in fullscreen mode. - */ - Embed.prototype.fullscreen = function () { - var requestFullScreen = this.iframe.requestFullscreen || this.iframe.msRequestFullscreen || this.iframe.mozRequestFullScreen || this.iframe.webkitRequestFullscreen; - requestFullScreen.call(this.iframe); - }; - /** - * Requests the browser to exit fullscreen mode. - */ - Embed.prototype.exitFullscreen = function () { - if (!this.isFullscreen(this.iframe)) { - return; - } - var exitFullscreen = document.exitFullscreen || document.mozCancelFullScreen || document.webkitExitFullscreen || document.msExitFullscreen; - exitFullscreen.call(document); - }; - /** - * Returns true if the iframe is rendered in fullscreen mode, - * otherwise returns false. - * - * @private - * @param {HTMLIFrameElement} iframe - * @returns {boolean} - */ - Embed.prototype.isFullscreen = function (iframe) { - var options = ['fullscreenElement', 'webkitFullscreenElement', 'mozFullscreenScreenElement', 'msFullscreenElement']; - return options.some(function (option) { return document[option] === iframe; }); - }; - /** - * Sets Iframe for embed - */ - Embed.prototype.setIframe = function (isLoad) { - var _this = this; - if (!this.iframe) { - var iframeHtml = ""; - this.element.innerHTML = iframeHtml; - this.iframe = this.element.childNodes[0]; - } - if (isLoad) { - this.iframe.addEventListener('load', function () { return _this.load(_this.config); }, false); - } - else { - this.iframe.addEventListener('load', function () { return _this.createReport(_this.createConfig); }, false); - } - }; - Embed.allowedEvents = ["loaded", "saved", "rendered", "saveAsTriggered", "error", "dataSelected"]; - Embed.accessTokenAttribute = 'powerbi-access-token'; - Embed.embedUrlAttribute = 'powerbi-embed-url'; - Embed.nameAttribute = 'powerbi-name'; - Embed.typeAttribute = 'powerbi-type'; - Embed.defaultSettings = { - filterPaneEnabled: true - }; - return Embed; - }()); - exports.Embed = Embed; - - -/***/ }, -/* 3 */ -/***/ function(module, exports) { - - /** - * Raises a custom event with event data on the specified HTML element. - * - * @export - * @param {HTMLElement} element - * @param {string} eventName - * @param {*} eventData - */ - function raiseCustomEvent(element, eventName, eventData) { - var customEvent; - if (typeof CustomEvent === 'function') { - customEvent = new CustomEvent(eventName, { - detail: eventData, - bubbles: true, - cancelable: true - }); - } - else { - customEvent = document.createEvent('CustomEvent'); - customEvent.initCustomEvent(eventName, true, true, eventData); - } - element.dispatchEvent(customEvent); - } - exports.raiseCustomEvent = raiseCustomEvent; - /** - * Finds the index of the first value in an array that matches the specified predicate. - * - * @export - * @template T - * @param {(x: T) => boolean} predicate - * @param {T[]} xs - * @returns {number} - */ - function findIndex(predicate, xs) { - if (!Array.isArray(xs)) { - throw new Error("You attempted to call find with second parameter that was not an array. You passed: " + xs); - } - var index; - xs.some(function (x, i) { - if (predicate(x)) { - index = i; - return true; - } - }); - return index; - } - exports.findIndex = findIndex; - /** - * Finds the first value in an array that matches the specified predicate. - * - * @export - * @template T - * @param {(x: T) => boolean} predicate - * @param {T[]} xs - * @returns {T} - */ - function find(predicate, xs) { - var index = findIndex(predicate, xs); - return xs[index]; - } - exports.find = find; - function remove(predicate, xs) { - var index = findIndex(predicate, xs); - xs.splice(index, 1); - } - exports.remove = remove; - // See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign - // TODO: replace in favor of using polyfill - /** - * Copies the values of all enumerable properties from one or more source objects to a target object, and returns the target object. - * - * @export - * @param {any} args - * @returns - */ - function assign() { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i - 0] = arguments[_i]; - } - var target = args[0]; - 'use strict'; - if (target === undefined || target === null) { - throw new TypeError('Cannot convert undefined or null to object'); - } - var output = Object(target); - for (var index = 1; index < arguments.length; index++) { - var source = arguments[index]; - if (source !== undefined && source !== null) { - for (var nextKey in source) { - if (source.hasOwnProperty(nextKey)) { - output[nextKey] = source[nextKey]; - } - } - } - } - return output; - } - exports.assign = assign; - /** - * Generates a random 7 character string. - * - * @export - * @returns {string} - */ - function createRandomString() { - return (Math.random() + 1).toString(36).substring(7); - } - exports.createRandomString = createRandomString; - - -/***/ }, -/* 4 */ -/***/ function(module, exports, __webpack_require__) { - - var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var embed = __webpack_require__(2); - var models = __webpack_require__(5); - var utils = __webpack_require__(3); - var page_1 = __webpack_require__(6); - /** - * The Power BI Report embed component - * - * @export - * @class Report - * @extends {embed.Embed} - * @implements {IReportNode} - * @implements {IFilterable} - */ - var Report = (function (_super) { - __extends(Report, _super); - /** - * Creates an instance of a Power BI Report. - * - * @param {service.Service} service - * @param {HTMLElement} element - * @param {embed.IEmbedConfiguration} config - */ - function Report(service, element, config, iframe) { - var filterPaneEnabled = (config.settings && config.settings.filterPaneEnabled) || !(element.getAttribute(Report.filterPaneEnabledAttribute) === "false"); - var navContentPaneEnabled = (config.settings && config.settings.navContentPaneEnabled) || !(element.getAttribute(Report.navContentPaneEnabledAttribute) === "false"); - var settings = utils.assign({ - filterPaneEnabled: filterPaneEnabled, - navContentPaneEnabled: navContentPaneEnabled - }, config.settings); - var configCopy = utils.assign({ settings: settings }, config); - _super.call(this, service, element, configCopy, iframe); - this.loadPath = "/report/load"; - Array.prototype.push.apply(this.allowedEvents, Report.allowedEvents); - } - /** - * Adds backwards compatibility for the previous load configuration, which used the reportId query parameter to specify the report ID - * (e.g. http://embedded.powerbi.com/appTokenReportEmbed?reportId=854846ed-2106-4dc2-bc58-eb77533bf2f1). - * - * By extracting the ID we can ensure that the ID is always explicitly provided as part of the load configuration. - * - * @static - * @param {string} url - * @returns {string} - */ - Report.findIdFromEmbedUrl = function (url) { - var reportIdRegEx = /reportId="?([^&]+)"?/; - var reportIdMatch = url.match(reportIdRegEx); - var reportId; - if (reportIdMatch) { - reportId = reportIdMatch[1]; - } - return reportId; - }; - /** - * Gets filters that are applied at the report level. - * - * ```javascript - * // Get filters applied at report level - * report.getFilters() - * .then(filters => { - * ... - * }); - * ``` - * - * @returns {Promise} - */ - Report.prototype.getFilters = function () { - return this.service.hpm.get("/report/filters", { uid: this.config.uniqueId }, this.iframe.contentWindow) - .then(function (response) { return response.body; }, function (response) { - throw response.body; - }); - }; - /** - * Gets the report ID from the first available location: options, attribute, embed url. - * - * @returns {string} - */ - Report.prototype.getId = function () { - var reportId = this.config.id || this.element.getAttribute(Report.reportIdAttribute) || Report.findIdFromEmbedUrl(this.config.embedUrl); - if (typeof reportId !== 'string' || reportId.length === 0) { - throw new Error("Report id is required, but it was not found. You must provide an id either as part of embed configuration or as attribute '" + Report.reportIdAttribute + "'."); - } - return reportId; - }; - /** - * Gets the list of pages within the report. - * - * ```javascript - * report.getPages() - * .then(pages => { - * ... - * }); - * ``` - * - * @returns {Promise} - */ - Report.prototype.getPages = function () { - var _this = this; - return this.service.hpm.get('/report/pages', { uid: this.config.uniqueId }, this.iframe.contentWindow) - .then(function (response) { - return response.body - .map(function (page) { - return new page_1.Page(_this, page.name, page.displayName); - }); - }, function (response) { - throw response.body; - }); - }; - /** - * Creates an instance of a Page. - * - * Normally you would get Page objects by calling `report.getPages()`, but in the case - * that the page name is known and you want to perform an action on a page without having to retrieve it - * you can create it directly. - * - * Note: Because you are creating the page manually there is no guarantee that the page actually exists in the report, and subsequent requests could fail. - * - * ```javascript - * const page = report.page('ReportSection1'); - * page.setActive(); - * ``` - * - * @param {string} name - * @param {string} [displayName] - * @returns {Page} - */ - Report.prototype.page = function (name, displayName) { - return new page_1.Page(this, name, displayName); - }; - /** - * Prints the active page of the report by invoking `window.print()` on the embed iframe component. - */ - Report.prototype.print = function () { - return this.service.hpm.post('/report/print', null, { uid: this.config.uniqueId }, this.iframe.contentWindow) - .then(function (response) { - return response.body; - }) - .catch(function (response) { - throw response.body; - }); - }; - /** - * Removes all filters at the report level. - * - * ```javascript - * report.removeFilters(); - * ``` - * - * @returns {Promise} - */ - Report.prototype.removeFilters = function () { - return this.setFilters([]); - }; - /** - * Sets the active page of the report. - * - * ```javascript - * report.setPage("page2") - * .catch(error => { ... }); - * ``` - * - * @param {string} pageName - * @returns {Promise} - */ - Report.prototype.setPage = function (pageName) { - var page = { - name: pageName, - displayName: null - }; - return this.service.hpm.put('/report/pages/active', page, { uid: this.config.uniqueId }, this.iframe.contentWindow) - .catch(function (response) { - throw response.body; - }); - }; - /** - * Sets filters at the report level. - * - * ```javascript - * const filters: [ - * ... - * ]; - * - * report.setFilters(filters) - * .catch(errors => { - * ... - * }); - * ``` - * - * @param {(models.IFilter[])} filters - * @returns {Promise} - */ - Report.prototype.setFilters = function (filters) { - return this.service.hpm.put("/report/filters", filters, { uid: this.config.uniqueId }, this.iframe.contentWindow) - .catch(function (response) { - throw response.body; - }); - }; - /** - * Updates visibility settings for the filter pane and the page navigation pane. - * - * ```javascript - * const newSettings = { - * navContentPaneEnabled: true, - * filterPaneEnabled: false - * }; - * - * report.updateSettings(newSettings) - * .catch(error => { ... }); - * ``` - * - * @param {models.ISettings} settings - * @returns {Promise} - */ - Report.prototype.updateSettings = function (settings) { - return this.service.hpm.patch('/report/settings', settings, { uid: this.config.uniqueId }, this.iframe.contentWindow) - .catch(function (response) { - throw response.body; - }); - }; - /** - * Validate load configuration. - */ - Report.prototype.validate = function (config) { - return models.validateReportLoad(config); - }; - /** - * Switch Report view mode. - * - * @returns {Promise} - */ - Report.prototype.switchMode = function (viewMode) { - var url = '/report/switchMode/' + viewMode; - return this.service.hpm.post(url, null, { uid: this.config.uniqueId }, this.iframe.contentWindow) - .then(function (response) { - return response.body; - }) - .catch(function (response) { - throw response.body; - }); - }; - Report.allowedEvents = ["filtersApplied", "pageChanged"]; - Report.reportIdAttribute = 'powerbi-report-id'; - Report.filterPaneEnabledAttribute = 'powerbi-settings-filter-pane-enabled'; - Report.navContentPaneEnabledAttribute = 'powerbi-settings-nav-content-pane-enabled'; - Report.typeAttribute = 'powerbi-type'; - Report.type = "Report"; - return Report; - }(embed.Embed)); - exports.Report = Report; - - -/***/ }, -/* 5 */ -/***/ function(module, exports, __webpack_require__) { - - /*! powerbi-models v0.11.1 | (c) 2016 Microsoft Corporation MIT */ - (function webpackUniversalModuleDefinition(root, factory) { - if(true) - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define([], factory); - else if(typeof exports === 'object') - exports["powerbi-models"] = factory(); - else - root["powerbi-models"] = factory(); - })(this, function() { - return /******/ (function(modules) { // webpackBootstrap - /******/ // The module cache - /******/ var installedModules = {}; - /******/ - /******/ // The require function - /******/ function __webpack_require__(moduleId) { - /******/ - /******/ // Check if module is in cache - /******/ if(installedModules[moduleId]) - /******/ return installedModules[moduleId].exports; - /******/ - /******/ // Create a new module (and put it into the cache) - /******/ var module = installedModules[moduleId] = { - /******/ exports: {}, - /******/ id: moduleId, - /******/ loaded: false - /******/ }; - /******/ - /******/ // Execute the module function - /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); - /******/ - /******/ // Flag the module as loaded - /******/ module.loaded = true; - /******/ - /******/ // Return the exports of the module - /******/ return module.exports; - /******/ } - /******/ - /******/ - /******/ // expose the modules object (__webpack_modules__) - /******/ __webpack_require__.m = modules; - /******/ - /******/ // expose the module cache - /******/ __webpack_require__.c = installedModules; - /******/ - /******/ // __webpack_public_path__ - /******/ __webpack_require__.p = ""; - /******/ - /******/ // Load entry module and return exports - /******/ return __webpack_require__(0); - /******/ }) - /************************************************************************/ - /******/ ([ - /* 0 */ - /***/ function(module, exports, __webpack_require__) { - - var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - /* tslint:disable:no-var-requires */ - exports.advancedFilterSchema = __webpack_require__(1); - exports.filterSchema = __webpack_require__(2); - exports.loadSchema = __webpack_require__(3); - exports.dashboardLoadSchema = __webpack_require__(4); - exports.pageSchema = __webpack_require__(5); - exports.settingsSchema = __webpack_require__(6); - exports.basicFilterSchema = __webpack_require__(7); - exports.createReportSchema = __webpack_require__(8); - exports.saveAsParametersSchema = __webpack_require__(9); - /* tslint:enable:no-var-requires */ - var jsen = __webpack_require__(10); - function normalizeError(error) { - var message = error.message; - if (!message) { - message = error.path + " is invalid. Not meeting " + error.keyword + " constraint"; - } - return { - message: message - }; - } - /** - * Takes in schema and returns function which can be used to validate the schema with better semantics around exposing errors - */ - function validate(schema, options) { - return function (x) { - var validate = jsen(schema, options); - var isValid = validate(x); - if (isValid) { - return undefined; - } - else { - return validate.errors - .map(normalizeError); - } - }; - } - exports.validateSettings = validate(exports.settingsSchema, { - schemas: { - basicFilter: exports.basicFilterSchema, - advancedFilter: exports.advancedFilterSchema - } - }); - exports.validateReportLoad = validate(exports.loadSchema, { - schemas: { - settings: exports.settingsSchema, - basicFilter: exports.basicFilterSchema, - advancedFilter: exports.advancedFilterSchema - } - }); - exports.validateCreateReport = validate(exports.createReportSchema); - exports.validateDashboardLoad = validate(exports.dashboardLoadSchema); - exports.validatePage = validate(exports.pageSchema); - exports.validateFilter = validate(exports.filterSchema, { - schemas: { - basicFilter: exports.basicFilterSchema, - advancedFilter: exports.advancedFilterSchema - } - }); - (function (FilterType) { - FilterType[FilterType["Advanced"] = 0] = "Advanced"; - FilterType[FilterType["Basic"] = 1] = "Basic"; - FilterType[FilterType["Unknown"] = 2] = "Unknown"; - })(exports.FilterType || (exports.FilterType = {})); - var FilterType = exports.FilterType; - function isFilterKeyColumnsTarget(target) { - return isColumn(target) && !!target.keys; - } - exports.isFilterKeyColumnsTarget = isFilterKeyColumnsTarget; - function isBasicFilterWithKeys(filter) { - return getFilterType(filter) === FilterType.Basic && !!filter.keyValues; - } - exports.isBasicFilterWithKeys = isBasicFilterWithKeys; - function getFilterType(filter) { - var basicFilter = filter; - var advancedFilter = filter; - if ((typeof basicFilter.operator === "string") - && (Array.isArray(basicFilter.values))) { - return FilterType.Basic; - } - else if ((typeof advancedFilter.logicalOperator === "string") - && (Array.isArray(advancedFilter.conditions))) { - return FilterType.Advanced; - } - else { - return FilterType.Unknown; - } - } - exports.getFilterType = getFilterType; - function isMeasure(arg) { - return arg.table !== undefined && arg.measure !== undefined; - } - exports.isMeasure = isMeasure; - function isColumn(arg) { - return arg.table !== undefined && arg.column !== undefined; - } - exports.isColumn = isColumn; - function isHierarchy(arg) { - return arg.table !== undefined && arg.hierarchy !== undefined && arg.hierarchyLevel !== undefined; - } - exports.isHierarchy = isHierarchy; - var Filter = (function () { - function Filter(target) { - this.target = target; - } - Filter.prototype.toJSON = function () { - return { - $schema: this.schemaUrl, - target: this.target - }; - }; - ; - return Filter; - }()); - exports.Filter = Filter; - var BasicFilter = (function (_super) { - __extends(BasicFilter, _super); - function BasicFilter(target, operator) { - var values = []; - for (var _i = 2; _i < arguments.length; _i++) { - values[_i - 2] = arguments[_i]; - } - _super.call(this, target); - this.operator = operator; - this.schemaUrl = BasicFilter.schemaUrl; - if (values.length === 0 && operator !== "All") { - throw new Error("values must be a non-empty array unless your operator is \"All\"."); - } - /** - * Accept values as array instead of as individual arguments - * new BasicFilter('a', 'b', 1, 2); - * new BasicFilter('a', 'b', [1,2]); - */ - if (Array.isArray(values[0])) { - this.values = values[0]; - } - else { - this.values = values; - } - } - BasicFilter.prototype.toJSON = function () { - var filter = _super.prototype.toJSON.call(this); - filter.operator = this.operator; - filter.values = this.values; - return filter; - }; - BasicFilter.schemaUrl = "http://powerbi.com/product/schema#basic"; - return BasicFilter; - }(Filter)); - exports.BasicFilter = BasicFilter; - var BasicFilterWithKeys = (function (_super) { - __extends(BasicFilterWithKeys, _super); - function BasicFilterWithKeys(target, operator, values, keyValues) { - _super.call(this, target, operator, values); - this.keyValues = keyValues; - this.target = target; - var numberOfKeys = target.keys ? target.keys.length : 0; - if (numberOfKeys > 0 && !keyValues) { - throw new Error("You shold pass the values to be filtered for each key. You passed: no values and " + numberOfKeys + " keys"); - } - if (numberOfKeys === 0 && keyValues && keyValues.length > 0) { - throw new Error("You passed key values but your target object doesn't contain the keys to be filtered"); - } - for (var i = 0; i < this.keyValues.length; i++) { - if (this.keyValues[i]) { - var lengthOfArray = this.keyValues[i].length; - if (lengthOfArray !== numberOfKeys) { - throw new Error("Each tuple of key values should contain a value for each of the keys. You passed: " + lengthOfArray + " values and " + numberOfKeys + " keys"); - } - } - } - } - BasicFilterWithKeys.prototype.toJSON = function () { - var filter = _super.prototype.toJSON.call(this); - filter.keyValues = this.keyValues; - return filter; - }; - return BasicFilterWithKeys; - }(BasicFilter)); - exports.BasicFilterWithKeys = BasicFilterWithKeys; - var AdvancedFilter = (function (_super) { - __extends(AdvancedFilter, _super); - function AdvancedFilter(target, logicalOperator) { - var conditions = []; - for (var _i = 2; _i < arguments.length; _i++) { - conditions[_i - 2] = arguments[_i]; - } - _super.call(this, target); - this.schemaUrl = AdvancedFilter.schemaUrl; - // Guard statements - if (typeof logicalOperator !== "string" || logicalOperator.length === 0) { - // TODO: It would be nicer to list out the possible logical operators. - throw new Error("logicalOperator must be a valid operator, You passed: " + logicalOperator); - } - this.logicalOperator = logicalOperator; - var extractedConditions; - /** - * Accept conditions as array instead of as individual arguments - * new AdvancedFilter('a', 'b', "And", { value: 1, operator: "Equals" }, { value: 2, operator: "IsGreaterThan" }); - * new AdvancedFilter('a', 'b', "And", [{ value: 1, operator: "Equals" }, { value: 2, operator: "IsGreaterThan" }]); - */ - if (Array.isArray(conditions[0])) { - extractedConditions = conditions[0]; - } - else { - extractedConditions = conditions; - } - if (extractedConditions.length === 0) { - throw new Error("conditions must be a non-empty array. You passed: " + conditions); - } - if (extractedConditions.length > 2) { - throw new Error("AdvancedFilters may not have more than two conditions. You passed: " + conditions.length); - } - if (extractedConditions.length === 1 && logicalOperator !== "And") { - throw new Error("Logical Operator must be \"And\" when there is only one condition provided"); - } - this.conditions = extractedConditions; - } - AdvancedFilter.prototype.toJSON = function () { - var filter = _super.prototype.toJSON.call(this); - filter.logicalOperator = this.logicalOperator; - filter.conditions = this.conditions; - return filter; - }; - AdvancedFilter.schemaUrl = "http://powerbi.com/product/schema#advanced"; - return AdvancedFilter; - }(Filter)); - exports.AdvancedFilter = AdvancedFilter; - (function (Permissions) { - Permissions[Permissions["Read"] = 0] = "Read"; - Permissions[Permissions["ReadWrite"] = 1] = "ReadWrite"; - Permissions[Permissions["Copy"] = 2] = "Copy"; - Permissions[Permissions["Create"] = 4] = "Create"; - Permissions[Permissions["All"] = 7] = "All"; - })(exports.Permissions || (exports.Permissions = {})); - var Permissions = exports.Permissions; - (function (ViewMode) { - ViewMode[ViewMode["View"] = 0] = "View"; - ViewMode[ViewMode["Edit"] = 1] = "Edit"; - })(exports.ViewMode || (exports.ViewMode = {})); - var ViewMode = exports.ViewMode; - exports.validateSaveAsParameters = validate(exports.saveAsParametersSchema); - - - /***/ }, - /* 1 */ - /***/ function(module, exports) { - - module.exports = { - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "object", - "properties": { - "target": { - "oneOf": [ - { - "type": "object", - "properties": { - "table": { - "type": "string" - }, - "column": { - "type": "string" - } - }, - "required": [ - "table", - "column" - ] - }, - { - "type": "object", - "properties": { - "table": { - "type": "string" - }, - "hierarchy": { - "type": "string" - }, - "hierarchyLevel": { - "type": "string" - } - }, - "required": [ - "table", - "hierarchy", - "hierarchyLevel" - ] - }, - { - "type": "object", - "properties": { - "table": { - "type": "string" - }, - "measure": { - "type": "string" - } - }, - "required": [ - "table", - "measure" - ] - } - ] - }, - "logicalOperator": { - "type": "string" - }, - "conditions": { - "type": "array", - "items": { - "type": "object", - "properties": { - "value": { - "type": [ - "string", - "boolean", - "number" - ] - }, - "operator": { - "type": "string" - } - }, - "required": [ - "value", - "operator" - ] - } - } - }, - "required": [ - "target", - "logicalOperator", - "conditions" - ] - }; - - /***/ }, - /* 2 */ - /***/ function(module, exports) { - - module.exports = { - "$schema": "http://json-schema.org/draft-04/schema#", - "oneOf": [ - { - "$ref": "#basicFilter" - }, - { - "$ref": "#advancedFilter" - } - ], - "invalidMessage": "filter is invalid" - }; - - /***/ }, - /* 3 */ - /***/ function(module, exports) { - - module.exports = { - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "object", - "properties": { - "accessToken": { - "type": "string", - "messages": { - "type": "accessToken must be a string", - "required": "accessToken is required" - } - }, - "id": { - "type": "string", - "messages": { - "type": "id must be a string", - "required": "id is required" - } - }, - "settings": { - "$ref": "#settings" - }, - "pageName": { - "type": "string", - "messages": { - "type": "pageName must be a string" - } - }, - "filters": { - "type": "array", - "items": { - "type": "object", - "oneOf": [ - { - "$ref": "#basicFilter" - }, - { - "$ref": "#advancedFilter" - } - ] - }, - "invalidMessage": "filters property is invalid" - }, - "permissions": { - "type": "number", - "enum": [ - 0, - 1, - 2, - 4, - 7 - ], - "default": 0, - "invalidMessage": "permissions property is invalid" - }, - "viewMode": { - "type": "number", - "enum": [ - 0, - 1 - ], - "default": 0, - "invalidMessage": "viewMode property is invalid" - } - }, - "required": [ - "accessToken", - "id" - ] - }; - - /***/ }, - /* 4 */ - /***/ function(module, exports) { - - module.exports = { - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "object", - "properties": { - "accessToken": { - "type": "string", - "messages": { - "type": "accessToken must be a string", - "required": "accessToken is required" - } - }, - "id": { - "type": "string", - "messages": { - "type": "id must be a string", - "required": "id is required" - } - }, - "pageView": { - "type": "string", - "messages": { - "type": "pageView must be a string with one of the following values: \"actualSize\", \"fitToWidth\", \"oneColumn\"" - } - } - }, - "required": [ - "accessToken", - "id" - ] - }; - - /***/ }, - /* 5 */ - /***/ function(module, exports) { - - module.exports = { - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "object", - "properties": { - "name": { - "type": "string", - "messages": { - "type": "name must be a string", - "required": "name is required" - } - } - }, - "required": [ - "name" - ] - }; - - /***/ }, - /* 6 */ - /***/ function(module, exports) { - - module.exports = { - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "object", - "properties": { - "filterPaneEnabled": { - "type": "boolean", - "messages": { - "type": "filterPaneEnabled must be a boolean" - } - }, - "navContentPaneEnabled": { - "type": "boolean", - "messages": { - "type": "navContentPaneEnabled must be a boolean" - } - }, - "useCustomSaveAsDialog": { - "type": "boolean", - "messages": { - "type": "useCustomSaveAsDialog must be a boolean" - } - } - } - }; - - /***/ }, - /* 7 */ - /***/ function(module, exports) { - - module.exports = { - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "object", - "properties": { - "target": { - "type": "object", - "properties": { - "table": { - "type": "string" - }, - "column": { - "type": "string" - }, - "hierarchy": { - "type": "string" - }, - "hierarchyLevel": { - "type": "string" - }, - "measure": { - "type": "string" - } - }, - "required": [ - "table" - ] - }, - "operator": { - "type": "string" - }, - "values": { - "type": "array", - "items": { - "type": [ - "string", - "boolean", - "number" - ] - } - } - }, - "required": [ - "target", - "operator", - "values" - ] - }; - - /***/ }, - /* 8 */ - /***/ function(module, exports) { - - module.exports = { - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "object", - "properties": { - "accessToken": { - "type": "string", - "messages": { - "type": "accessToken must be a string", - "required": "accessToken is required" - } - }, - "datasetId": { - "type": "string", - "messages": { - "type": "datasetId must be a string", - "required": "datasetId is required" - } - } - }, - "required": [ - "accessToken", - "datasetId" - ] - }; - - /***/ }, - /* 9 */ - /***/ function(module, exports) { - - module.exports = { - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "object", - "properties": { - "name": { - "type": "string", - "messages": { - "type": "name must be a string", - "required": "name is required" - } - } - }, - "required": [ - "name" - ] - }; - - /***/ }, - /* 10 */ - /***/ function(module, exports, __webpack_require__) { - - module.exports = __webpack_require__(11); - - /***/ }, - /* 11 */ - /***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var REGEX_ESCAPE_EXPR = /[\/]/g, - STR_ESCAPE_EXPR = /(")/gim, - VALID_IDENTIFIER_EXPR = /^[a-z_$][0-9a-z]*$/gi, - INVALID_SCHEMA = 'jsen: invalid schema object', - browser = typeof window === 'object' && !!window.navigator, // jshint ignore: line - regescape = new RegExp('/').source !== '/', // node v0.x does not properly escape '/'s in inline regex - func = __webpack_require__(12), - equal = __webpack_require__(13), - unique = __webpack_require__(14), - SchemaResolver = __webpack_require__(15), - formats = __webpack_require__(24), - ucs2length = __webpack_require__(25), - types = {}, - keywords = {}; - - function inlineRegex(regex) { - regex = regex instanceof RegExp ? regex : new RegExp(regex); - - return regescape ? - regex.toString() : - '/' + regex.source.replace(REGEX_ESCAPE_EXPR, '\\$&') + '/'; - } - - function encodeStr(str) { - return '"' + str.replace(STR_ESCAPE_EXPR, '\\$1') + '"'; - } - - function appendToPath(path, key) { - VALID_IDENTIFIER_EXPR.lastIndex = 0; - - return VALID_IDENTIFIER_EXPR.test(key) ? - path + '.' + key : - path + '[' + encodeStr(key) + ']'; - } - - function type(obj) { - if (obj === undefined) { - return 'undefined'; - } - - var str = Object.prototype.toString.call(obj); - return str.substr(8, str.length - 9).toLowerCase(); - } - - function isInteger(obj) { - return (obj | 0) === obj; // jshint ignore: line - } - - types['null'] = function (path) { - return path + ' === null'; - }; - - types.boolean = function (path) { - return 'typeof ' + path + ' === "boolean"'; - }; - - types.string = function (path) { - return 'typeof ' + path + ' === "string"'; - }; - - types.number = function (path) { - return 'typeof ' + path + ' === "number"'; - }; - - types.integer = function (path) { - return 'typeof ' + path + ' === "number" && !(' + path + ' % 1)'; - }; - - types.array = function (path) { - return 'Array.isArray(' + path + ')'; - }; - - types.object = function (path) { - return 'typeof ' + path + ' === "object" && ' + path + ' !== null && !Array.isArray(' + path + ')'; - }; - - types.date = function (path) { - return path + ' instanceof Date'; - }; - - keywords.enum = function (context) { - var arr = context.schema['enum']; - - context.code('if (!equalAny(' + context.path + ', ' + JSON.stringify(arr) + ')) {'); - context.error('enum'); - context.code('}'); - }; - - keywords.minimum = function (context) { - if (typeof context.schema.minimum === 'number') { - context.code('if (' + context.path + ' < ' + context.schema.minimum + ') {'); - context.error('minimum'); - context.code('}'); - } - }; - - keywords.exclusiveMinimum = function (context) { - if (context.schema.exclusiveMinimum === true && typeof context.schema.minimum === 'number') { - context.code('if (' + context.path + ' === ' + context.schema.minimum + ') {'); - context.error('exclusiveMinimum'); - context.code('}'); - } - }; - - keywords.maximum = function (context) { - if (typeof context.schema.maximum === 'number') { - context.code('if (' + context.path + ' > ' + context.schema.maximum + ') {'); - context.error('maximum'); - context.code('}'); - } - }; - - keywords.exclusiveMaximum = function (context) { - if (context.schema.exclusiveMaximum === true && typeof context.schema.maximum === 'number') { - context.code('if (' + context.path + ' === ' + context.schema.maximum + ') {'); - context.error('exclusiveMaximum'); - context.code('}'); - } - }; - - keywords.multipleOf = function (context) { - if (typeof context.schema.multipleOf === 'number') { - var mul = context.schema.multipleOf, - decimals = mul.toString().length - mul.toFixed(0).length - 1, - pow = decimals > 0 ? Math.pow(10, decimals) : 1, - path = context.path; - - if (decimals > 0) { - context.code('if (+(Math.round((' + path + ' * ' + pow + ') + "e+" + ' + decimals + ') + "e-" + ' + decimals + ') % ' + (mul * pow) + ' !== 0) {'); - } else { - context.code('if (((' + path + ' * ' + pow + ') % ' + (mul * pow) + ') !== 0) {'); - } - - context.error('multipleOf'); - context.code('}'); - } - }; - - keywords.minLength = function (context) { - if (isInteger(context.schema.minLength)) { - context.code('if (ucs2length(' + context.path + ') < ' + context.schema.minLength + ') {'); - context.error('minLength'); - context.code('}'); - } - }; - - keywords.maxLength = function (context) { - if (isInteger(context.schema.maxLength)) { - context.code('if (ucs2length(' + context.path + ') > ' + context.schema.maxLength + ') {'); - context.error('maxLength'); - context.code('}'); - } - }; - - keywords.pattern = function (context) { - var pattern = context.schema.pattern; - - if (typeof pattern === 'string' || pattern instanceof RegExp) { - context.code('if (!(' + inlineRegex(pattern) + ').test(' + context.path + ')) {'); - context.error('pattern'); - context.code('}'); - } - }; - - keywords.format = function (context) { - if (typeof context.schema.format !== 'string' || !formats[context.schema.format]) { - return; - } - - context.code('if (!(' + formats[context.schema.format] + ').test(' + context.path + ')) {'); - context.error('format'); - context.code('}'); - }; - - keywords.minItems = function (context) { - if (isInteger(context.schema.minItems)) { - context.code('if (' + context.path + '.length < ' + context.schema.minItems + ') {'); - context.error('minItems'); - context.code('}'); - } - }; - - keywords.maxItems = function (context) { - if (isInteger(context.schema.maxItems)) { - context.code('if (' + context.path + '.length > ' + context.schema.maxItems + ') {'); - context.error('maxItems'); - context.code('}'); - } - }; - - keywords.additionalItems = function (context) { - if (context.schema.additionalItems === false && Array.isArray(context.schema.items)) { - context.code('if (' + context.path + '.length > ' + context.schema.items.length + ') {'); - context.error('additionalItems'); - context.code('}'); - } - }; - - keywords.uniqueItems = function (context) { - if (context.schema.uniqueItems) { - context.code('if (unique(' + context.path + ').length !== ' + context.path + '.length) {'); - context.error('uniqueItems'); - context.code('}'); - } - }; - - keywords.items = function (context) { - var index = context.declare(0), - i = 0; - - if (type(context.schema.items) === 'object') { - context.code('for (' + index + ' = 0; ' + index + ' < ' + context.path + '.length; ' + index + '++) {'); - - context.descend(context.path + '[' + index + ']', context.schema.items); - - context.code('}'); - } - else if (Array.isArray(context.schema.items)) { - for (; i < context.schema.items.length; i++) { - context.code('if (' + context.path + '.length - 1 >= ' + i + ') {'); - - context.descend(context.path + '[' + i + ']', context.schema.items[i]); - - context.code('}'); - } - - if (type(context.schema.additionalItems) === 'object') { - context.code('for (' + index + ' = ' + i + '; ' + index + ' < ' + context.path + '.length; ' + index + '++) {'); - - context.descend(context.path + '[' + index + ']', context.schema.additionalItems); - - context.code('}'); - } - } - }; - - keywords.maxProperties = function (context) { - if (isInteger(context.schema.maxProperties)) { - context.code('if (Object.keys(' + context.path + ').length > ' + context.schema.maxProperties + ') {'); - context.error('maxProperties'); - context.code('}'); - } - }; - - keywords.minProperties = function (context) { - if (isInteger(context.schema.minProperties)) { - context.code('if (Object.keys(' + context.path + ').length < ' + context.schema.minProperties + ') {'); - context.error('minProperties'); - context.code('}'); - } - }; - - keywords.required = function (context) { - if (!Array.isArray(context.schema.required)) { - return; - } - - for (var i = 0; i < context.schema.required.length; i++) { - context.code('if (' + appendToPath(context.path, context.schema.required[i]) + ' === undefined) {'); - context.error('required', context.schema.required[i]); - context.code('}'); - } - }; - - keywords.properties = function (context) { - var props = context.schema.properties, - propKeys = type(props) === 'object' ? Object.keys(props) : [], - required = Array.isArray(context.schema.required) ? context.schema.required : [], - prop, i, nestedPath; - - if (!propKeys.length) { - return; - } - - for (i = 0; i < propKeys.length; i++) { - prop = propKeys[i]; - nestedPath = appendToPath(context.path, prop); - - context.code('if (' + nestedPath + ' !== undefined) {'); - - context.descend(nestedPath, props[prop]); - - context.code('}'); - - if (required.indexOf(prop) > -1) { - context.code('else {'); - context.error('required', prop); - context.code('}'); - } - } - }; - - keywords.patternProperties = keywords.additionalProperties = function (context) { - var propKeys = type(context.schema.properties) === 'object' ? - Object.keys(context.schema.properties) : [], - patProps = context.schema.patternProperties, - patterns = type(patProps) === 'object' ? Object.keys(patProps) : [], - addProps = context.schema.additionalProperties, - addPropsCheck = addProps === false || type(addProps) === 'object', - props, keys, key, n, found, pattern, i; - - if (!patterns.length && !addPropsCheck) { - return; - } - - keys = context.declare('[]'); - key = context.declare('""'); - n = context.declare(0); - - if (addPropsCheck) { - found = context.declare(false); - } - - context.code(keys + ' = Object.keys(' + context.path + ')'); - - context.code('for (' + n + ' = 0; ' + n + ' < ' + keys + '.length; ' + n + '++) {') - (key + ' = ' + keys + '[' + n + ']') - - ('if (' + context.path + '[' + key + '] === undefined) {') - ('continue') - ('}'); - - if (addPropsCheck) { - context.code(found + ' = false'); - } - - // validate pattern properties - for (i = 0; i < patterns.length; i++) { - pattern = patterns[i]; - - context.code('if ((' + inlineRegex(pattern) + ').test(' + key + ')) {'); - - context.descend(context.path + '[' + key + ']', patProps[pattern]); - - if (addPropsCheck) { - context.code(found + ' = true'); - } - - context.code('}'); - } - - // validate additional properties - if (addPropsCheck) { - if (propKeys.length) { - props = context.declare(JSON.stringify(propKeys)); - - // do not validate regular properties - context.code('if (' + props + '.indexOf(' + key + ') > -1) {') - ('continue') - ('}'); - } - - context.code('if (!' + found + ') {'); - - if (addProps === false) { - // do not allow additional properties - context.error('additionalProperties', undefined, key); - } - else { - // validate additional properties - context.descend(context.path + '[' + key + ']', addProps); - } - - context.code('}'); - } - - context.code('}'); - }; - - keywords.dependencies = function (context) { - if (type(context.schema.dependencies) !== 'object') { - return; - } - - var depKeys = Object.keys(context.schema.dependencies), - len = depKeys.length, - key, dep, i = 0, k = 0; - - for (; k < len; k++) { - key = depKeys[k]; - dep = context.schema.dependencies[key]; - - context.code('if (' + appendToPath(context.path, key) + ' !== undefined) {'); - - if (type(dep) === 'object') { - //schema dependency - context.descend(context.path, dep); - } - else { - // property dependency - for (i; i < dep.length; i++) { - context.code('if (' + appendToPath(context.path, dep[i]) + ' === undefined) {'); - context.error('dependencies', dep[i]); - context.code('}'); - } - } - - context.code('}'); - } - }; - - keywords.allOf = function (context) { - if (!Array.isArray(context.schema.allOf)) { - return; - } - - for (var i = 0; i < context.schema.allOf.length; i++) { - context.descend(context.path, context.schema.allOf[i]); - } - }; - - keywords.anyOf = function (context) { - if (!Array.isArray(context.schema.anyOf)) { - return; - } - - var greedy = context.greedy, - errCount = context.declare(0), - initialCount = context.declare(0), - found = context.declare(false), - i = 0; - - context.code(initialCount + ' = errors.length'); - - for (; i < context.schema.anyOf.length; i++) { - context.code('if (!' + found + ') {'); - - context.code(errCount + ' = errors.length'); - - context.greedy = true; - - context.descend(context.path, context.schema.anyOf[i]); - - context.code(found + ' = errors.length === ' + errCount) - ('}'); - } - - context.greedy = greedy; - - context.code('if (!' + found + ') {'); - - context.error('anyOf'); - - context.code('} else {') - ('errors.length = ' + initialCount) - ('}'); - }; - - keywords.oneOf = function (context) { - if (!Array.isArray(context.schema.oneOf)) { - return; - } - - var greedy = context.greedy, - matching = context.declare(0), - initialCount = context.declare(0), - errCount = context.declare(0), - i = 0; - - context.code(initialCount + ' = errors.length'); - context.code(matching + ' = 0'); - - for (; i < context.schema.oneOf.length; i++) { - context.code(errCount + ' = errors.length'); - - context.greedy = true; - - context.descend(context.path, context.schema.oneOf[i]); - - context.code('if (errors.length === ' + errCount + ') {') - (matching + '++') - ('}'); - } - - context.greedy = greedy; - - context.code('if (' + matching + ' !== 1) {'); - - context.error('oneOf'); - - context.code('} else {') - ('errors.length = ' + initialCount) - ('}'); - }; - - keywords.not = function (context) { - if (type(context.schema.not) !== 'object') { - return; - } - - var greedy = context.greedy, - errCount = context.declare(0); - - context.code(errCount + ' = errors.length'); - - context.greedy = true; - - context.descend(context.path, context.schema.not); - - context.greedy = greedy; - - context.code('if (errors.length === ' + errCount + ') {'); - - context.error('not'); - - context.code('} else {') - ('errors.length = ' + errCount) - ('}'); - }; - - function decorateGenerator(type, keyword) { - keywords[keyword].type = type; - keywords[keyword].keyword = keyword; - } - - ['minimum', 'exclusiveMinimum', 'maximum', 'exclusiveMaximum', 'multipleOf'] - .forEach(decorateGenerator.bind(null, 'number')); - - ['minLength', 'maxLength', 'pattern', 'format'] - .forEach(decorateGenerator.bind(null, 'string')); - - ['minItems', 'maxItems', 'additionalItems', 'uniqueItems', 'items'] - .forEach(decorateGenerator.bind(null, 'array')); - - ['maxProperties', 'minProperties', 'required', 'properties', 'patternProperties', 'additionalProperties', 'dependencies'] - .forEach(decorateGenerator.bind(null, 'object')); - - ['enum', 'allOf', 'anyOf', 'oneOf', 'not'] - .forEach(decorateGenerator.bind(null, null)); - - function groupKeywords(schema) { - var keys = Object.keys(schema), - propIndex = keys.indexOf('properties'), - patIndex = keys.indexOf('patternProperties'), - ret = { - enum: Array.isArray(schema.enum) && schema.enum.length > 0, - type: null, - allType: [], - perType: {} - }, - key, gen, i; - - if (schema.type) { - if (typeof schema.type === 'string') { - ret.type = [schema.type]; - } - else if (Array.isArray(schema.type) && schema.type.length) { - ret.type = schema.type.slice(0); - } - } - - for (i = 0; i < keys.length; i++) { - key = keys[i]; - - if (key === 'enum' || key === 'type') { - continue; - } - - gen = keywords[key]; - - if (!gen) { - continue; - } - - if (gen.type) { - if (!ret.perType[gen.type]) { - ret.perType[gen.type] = []; - } - - if (!(propIndex > -1 && key === 'required') && - !(patIndex > -1 && key === 'additionalProperties')) { - ret.perType[gen.type].push(key); - } - } - else { - ret.allType.push(key); - } - } - - return ret; - } - - function getPathExpression(path, key) { - var path_ = path.substr(4), - len = path_.length, - tokens = [], - token = '', - isvar = false, - char, i; - - for (i = 0; i < len; i++) { - char = path_[i]; - - switch (char) { - case '.': - if (token) { - token += char; - } - break; - case '[': - if (isNaN(+path_[i + 1])) { - isvar = true; - - if (token) { - tokens.push('"' + token + '"'); - token = ''; - } - } - else { - isvar = false; - - if (token) { - token += '.'; - } - } - break; - case ']': - tokens.push(isvar ? token : '"' + token + '"'); - token = ''; - break; - default: - token += char; - } - } - - if (token) { - tokens.push('"' + token + '"'); - } - - if (key) { - tokens.push('"' + key + '"'); - } - - if (tokens.length === 1 && isvar) { - return '"" + ' + tokens[0] + ' + ""'; - } - - return tokens.join(' + "." + ') || '""'; - } - - function clone(obj) { - var cloned = obj, - objType = type(obj), - keys, len, key, i; - - if (objType === 'object') { - cloned = {}; - keys = Object.keys(obj); - - for (i = 0, len = keys.length; i < len; i++) { - key = keys[i]; - cloned[key] = clone(obj[key]); - } - } - else if (objType === 'array') { - cloned = []; - - for (i = 0, len = obj.length; i < len; i++) { - cloned[i] = clone(obj[i]); - } - } - else if (objType === 'regexp') { - return new RegExp(obj); - } - else if (objType === 'date') { - return new Date(obj.toJSON()); - } - - return cloned; - } - - function equalAny(obj, options) { - for (var i = 0, len = options.length; i < len; i++) { - if (equal(obj, options[i])) { - return true; - } - } - - return false; - } - - function PropertyMarker() { - this.objects = []; - this.properties = []; - } - - PropertyMarker.prototype.mark = function (obj, key) { - var index = this.objects.indexOf(obj), - prop; - - if (index < 0) { - this.objects.push(obj); - - prop = {}; - prop[key] = 1; - - this.properties.push(prop); - - return; - } - - prop = this.properties[index]; - - prop[key] = prop[key] ? prop[key] + 1 : 1; - }; - - PropertyMarker.prototype.deleteDuplicates = function () { - var props, keys, key, i, j; - - for (i = 0; i < this.properties.length; i++) { - props = this.properties[i]; - keys = Object.keys(props); - - for (j = 0; j < keys.length; j++) { - key = keys[j]; - - if (props[key] > 1) { - delete this.objects[i][key]; - } - } - } - }; - - PropertyMarker.prototype.dispose = function () { - this.objects.length = 0; - this.properties.length = 0; - }; - - function build(schema, def, additional, resolver, parentMarker) { - var defType, defValue, key, i, propertyMarker, props, defProps; - - if (type(schema) !== 'object') { - return def; - } - - schema = resolver.resolve(schema); - - if (def === undefined && schema.hasOwnProperty('default')) { - def = clone(schema['default']); - } - - defType = type(def); - - if (defType === 'object' && type(schema.properties) === 'object') { - props = Object.keys(schema.properties); - - for (i = 0; i < props.length; i++) { - key = props[i]; - defValue = build(schema.properties[key], def[key], additional, resolver); - - if (defValue !== undefined) { - def[key] = defValue; - } - } - - if (additional !== 'always') { - defProps = Object.keys(def); - - for (i = 0; i < defProps.length; i++) { - key = defProps[i]; - - if (props.indexOf(key) < 0 && - (schema.additionalProperties === false || - (additional === false && !schema.additionalProperties))) { - - if (parentMarker) { - parentMarker.mark(def, key); - } - else { - delete def[key]; - } - } - } - } - } - else if (defType === 'array' && schema.items) { - if (type(schema.items) === 'array') { - for (i = 0; i < schema.items.length; i++) { - defValue = build(schema.items[i], def[i], additional, resolver); - - if (defValue !== undefined || i < def.length) { - def[i] = defValue; - } - } - } - else if (def.length) { - for (i = 0; i < def.length; i++) { - def[i] = build(schema.items, def[i], additional, resolver); - } - } - } - else if (type(schema.allOf) === 'array' && schema.allOf.length) { - propertyMarker = new PropertyMarker(); - - for (i = 0; i < schema.allOf.length; i++) { - def = build(schema.allOf[i], def, additional, resolver, propertyMarker); - } - - propertyMarker.deleteDuplicates(); - propertyMarker.dispose(); - } - - return def; - } - - function ValidationContext(options) { - this.path = 'data'; - this.schema = options.schema; - this.formats = options.formats; - this.greedy = options.greedy; - this.resolver = options.resolver; - this.id = options.id; - this.funcache = options.funcache || {}; - this.scope = options.scope || { - equalAny: equalAny, - unique: unique, - ucs2length: ucs2length, - refs: {} - }; - } - - ValidationContext.prototype.clone = function (schema) { - var ctx = new ValidationContext({ - schema: schema, - formats: this.formats, - greedy: this.greedy, - resolver: this.resolver, - id: this.id, - funcache: this.funcache, - scope: this.scope - }); - - return ctx; - }; - - ValidationContext.prototype.declare = function (def) { - var variname = this.id(); - this.code.def(variname, def); - return variname; - }; - - ValidationContext.prototype.cache = function (cacheKey, schema) { - var cached = this.funcache[cacheKey], - context; - - if (!cached) { - cached = this.funcache[cacheKey] = { - key: this.id() - }; - - context = this.clone(schema); - - cached.func = context.compile(cached.key); - - this.scope.refs[cached.key] = cached.func; - - context.dispose(); - } - - return 'refs.' + cached.key; - }; - - ValidationContext.prototype.error = function (keyword, key, additional) { - var schema = this.schema, - path = this.path, - errorPath = path !== 'data' || key ? - '(path ? path + "." : "") + ' + getPathExpression(path, key) + ',' : - 'path,', - res = key && schema.properties && schema.properties[key] ? - this.resolver.resolve(schema.properties[key]) : null, - message = res ? res.requiredMessage : schema.invalidMessage; - - if (!message) { - message = (res && res.messages && res.messages[keyword]) || - (schema.messages && schema.messages[keyword]); - } - - this.code('errors.push({'); - - if (message) { - this.code('message: ' + encodeStr(message) + ','); - } - - if (additional) { - this.code('additionalProperties: ' + additional + ','); - } - - this.code('path: ' + errorPath) - ('keyword: ' + encodeStr(keyword)) - ('})'); - - if (!this.greedy) { - this.code('return'); - } - }; - - ValidationContext.prototype.refactor = function (path, schema, cacheKey) { - var parentPathExp = path !== 'data' ? - '(path ? path + "." : "") + ' + getPathExpression(path) : - 'path', - cachedRef = this.cache(cacheKey, schema), - refErrors = this.declare(); - - this.code(refErrors + ' = ' + cachedRef + '(' + path + ', ' + parentPathExp + ', errors)'); - - if (!this.greedy) { - this.code('if (errors.length) { return }'); - } - }; - - ValidationContext.prototype.descend = function (path, schema) { - var origPath = this.path, - origSchema = this.schema; - - this.path = path; - this.schema = schema; - - this.generate(); - - this.path = origPath; - this.schema = origSchema; - }; - - ValidationContext.prototype.generate = function () { - var path = this.path, - schema = this.schema, - context = this, - scope = this.scope, - encodedFormat, - format, - schemaKeys, - typeKeys, - typeIndex, - validatedType, - i; - - if (type(schema) !== 'object') { - return; - } - - if (schema.$ref !== undefined) { - schema = this.resolver.resolve(schema); - - if (this.resolver.hasRef(schema)) { - this.refactor(path, schema, - this.resolver.getNormalizedRef(this.schema) || this.schema.$ref); - - return; - } - else { - // substitute $ref schema with the resolved instance - this.schema = schema; - } - } - - schemaKeys = groupKeywords(schema); - - if (schemaKeys.enum) { - keywords.enum(context); - - return; // do not process the schema further - } - - typeKeys = Object.keys(schemaKeys.perType); - - function generateForKeyword(keyword) { - keywords[keyword](context); // jshint ignore: line - } - - for (i = 0; i < typeKeys.length; i++) { - validatedType = typeKeys[i]; - - this.code((i ? 'else ' : '') + 'if (' + types[validatedType](path) + ') {'); - - schemaKeys.perType[validatedType].forEach(generateForKeyword); - - this.code('}'); - - if (schemaKeys.type) { - typeIndex = schemaKeys.type.indexOf(validatedType); - - if (typeIndex > -1) { - schemaKeys.type.splice(typeIndex, 1); - } - } - } - - if (schemaKeys.type) { // we have types in the schema - if (schemaKeys.type.length) { // case 1: we still have some left to check - this.code((typeKeys.length ? 'else ' : '') + 'if (!(' + schemaKeys.type.map(function (type) { - return types[type] ? types[type](path) : 'true'; - }).join(' || ') + ')) {'); - this.error('type'); - this.code('}'); - } - else { - this.code('else {'); // case 2: we don't have any left to check - this.error('type'); - this.code('}'); - } - } - - schemaKeys.allType.forEach(function (keyword) { - keywords[keyword](context); - }); - - if (schema.format && this.formats) { - format = this.formats[schema.format]; - - if (format) { - if (typeof format === 'string' || format instanceof RegExp) { - this.code('if (!(' + inlineRegex(format) + ').test(' + path + ')) {'); - this.error('format'); - this.code('}'); - } - else if (typeof format === 'function') { - (scope.formats || (scope.formats = {}))[schema.format] = format; - (scope.schemas || (scope.schemas = {}))[schema.format] = schema; - - encodedFormat = encodeStr(schema.format); - - this.code('if (!formats[' + encodedFormat + '](' + path + ', schemas[' + encodedFormat + '])) {'); - this.error('format'); - this.code('}'); - } - } - } - }; - - ValidationContext.prototype.compile = function (id) { - this.code = func('jsen_compiled' + (id ? '_' + id : ''), 'data', 'path', 'errors'); - this.generate(); - - return this.code.compile(this.scope); - }; - - ValidationContext.prototype.dispose = function () { - for (var key in this) { - this[key] = undefined; - } - }; - - function jsen(schema, options) { - if (type(schema) !== 'object') { - throw new Error(INVALID_SCHEMA); - } - - options = options || {}; - - var counter = 0, - id = function () { return 'i' + (counter++); }, - resolver = new SchemaResolver(schema, options.schemas, options.missing$Ref || false), - context = new ValidationContext({ - schema: schema, - resolver: resolver, - id: id, - schemas: options.schemas, - formats: options.formats, - greedy: options.greedy || false - }), - compiled = func('validate', 'data') - ('validate.errors = []') - ('gen(data, "", validate.errors)') - ('return validate.errors.length === 0') - .compile({ gen: context.compile() }); - - context.dispose(); - context = null; - - compiled.errors = []; - - compiled.build = function (initial, options) { - return build( - schema, - (options && options.copy === false ? initial : clone(initial)), - options && options.additionalProperties, - resolver); - }; - - return compiled; - } - - jsen.browser = browser; - jsen.clone = clone; - jsen.equal = equal; - jsen.unique = unique; - jsen.ucs2length = ucs2length; - jsen.SchemaResolver = SchemaResolver; - jsen.resolve = SchemaResolver.resolvePointer; - - module.exports = jsen; - - - /***/ }, - /* 12 */ - /***/ function(module, exports) { - - 'use strict'; - - module.exports = function func() { - var args = Array.apply(null, arguments), - name = args.shift(), - tab = ' ', - lines = '', - vars = '', - ind = 1, // indentation - bs = '{[', // block start - be = '}]', // block end - space = function () { - var sp = tab, i = 0; - while (i++ < ind - 1) { sp += tab; } - return sp; - }, - add = function (line) { - lines += space() + line + '\n'; - }, - builder = function (line) { - var first = line[0], - last = line[line.length - 1]; - - if (be.indexOf(first) > -1 && bs.indexOf(last) > -1) { - ind--; - add(line); - ind++; - } - else if (bs.indexOf(last) > -1) { - add(line); - ind++; - } - else if (be.indexOf(first) > -1) { - ind--; - add(line); - } - else { - add(line); - } - - return builder; - }; - - builder.def = function (id, def) { - vars += (vars ? ',\n' + tab + ' ' : '') + id + (def !== undefined ? ' = ' + def : ''); - return builder; - }; - - builder.toSource = function () { - return 'function ' + name + '(' + args.join(', ') + ') {\n' + - tab + '"use strict"' + '\n' + - (vars ? tab + 'var ' + vars + ';\n' : '') + - lines + '}'; - }; - - builder.compile = function (scope) { - var src = 'return (' + builder.toSource() + ')', - scp = scope || {}, - keys = Object.keys(scp), - vals = keys.map(function (key) { return scp[key]; }); - - return Function.apply(null, keys.concat(src)).apply(null, vals); - }; - - return builder; - }; - - /***/ }, - /* 13 */ - /***/ function(module, exports) { - - 'use strict'; - - function type(obj) { - var str = Object.prototype.toString.call(obj); - return str.substr(8, str.length - 9).toLowerCase(); - } - - function deepEqual(a, b) { - var keysA = Object.keys(a).sort(), - keysB = Object.keys(b).sort(), - i, key; - - if (!equal(keysA, keysB)) { - return false; - } - - for (i = 0; i < keysA.length; i++) { - key = keysA[i]; - - if (!equal(a[key], b[key])) { - return false; - } - } - - return true; - } - - function equal(a, b) { // jshint ignore: line - var typeA = typeof a, - typeB = typeof b, - i; - - // get detailed object type - if (typeA === 'object') { - typeA = type(a); - } - - // get detailed object type - if (typeB === 'object') { - typeB = type(b); - } - - if (typeA !== typeB) { - return false; - } - - if (typeA === 'object') { - return deepEqual(a, b); - } - - if (typeA === 'regexp') { - return a.toString() === b.toString(); - } - - if (typeA === 'array') { - if (a.length !== b.length) { - return false; - } - - for (i = 0; i < a.length; i++) { - if (!equal(a[i], b[i])) { - return false; - } - } - - return true; - } - - return a === b; - } - - module.exports = equal; - - /***/ }, - /* 14 */ - /***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var equal = __webpack_require__(13); - - function findIndex(arr, value, comparator) { - for (var i = 0, len = arr.length; i < len; i++) { - if (comparator(arr[i], value)) { - return i; - } - } - - return -1; - } - - module.exports = function unique(arr) { - return arr.filter(function uniqueOnly(value, index, self) { - return findIndex(self, value, equal) === index; - }); - }; - - module.exports.findIndex = findIndex; - - /***/ }, - /* 15 */ - /***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var url = __webpack_require__(16), - metaschema = __webpack_require__(23), - INVALID_SCHEMA_REFERENCE = 'jsen: invalid schema reference', - DUPLICATE_SCHEMA_ID = 'jsen: duplicate schema id', - CIRCULAR_SCHEMA_REFERENCE = 'jsen: circular schema reference'; - - function get(obj, path) { - if (!path.length) { - return obj; - } - - var key = path.shift(), - val; - - if (obj && typeof obj === 'object' && obj.hasOwnProperty(key)) { - val = obj[key]; - } - - if (path.length) { - if (val && typeof val === 'object') { - return get(val, path); - } - - return undefined; - } - - return val; - } - - function refToObj(ref) { - var index = ref.indexOf('#'), - ret = { - base: ref.substr(0, index), - path: [] - }; - - if (index < 0) { - ret.base = ref; - return ret; - } - - ref = ref.substr(index + 1); - - if (!ref) { - return ret; - } - - ret.path = ref.split('/').map(function (segment) { - // Reference: http://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-08#section-3 - return decodeURIComponent(segment) - .replace(/~1/g, '/') - .replace(/~0/g, '~'); - }); - - if (ref[0] === '/') { - ret.path.shift(); - } - - return ret; - } - - // TODO: Can we prevent nested resolvers and combine schemas instead? - function SchemaResolver(rootSchema, external, missing$Ref, baseId) { // jshint ignore: line - this.rootSchema = rootSchema; - this.resolvers = null; - this.resolvedRootSchema = null; - this.cache = {}; - this.idCache = {}; - this.refCache = { refs: [], schemas: [] }; - this.missing$Ref = missing$Ref; - this.refStack = []; - - baseId = baseId || ''; - - this._buildIdCache(rootSchema, baseId); - - // get updated base id after normalizing root schema id - baseId = this.refCache.refs[this.refCache.schemas.indexOf(this.rootSchema)] || baseId; - - this._buildResolvers(external, baseId); - } - - SchemaResolver.prototype._cacheId = function (id, schema, resolver) { - if (this.idCache[id]) { - throw new Error(DUPLICATE_SCHEMA_ID + ' ' + id); - } - - this.idCache[id] = { resolver: resolver, schema: schema }; - }; - - SchemaResolver.prototype._buildIdCache = function (schema, baseId) { - var id = baseId, - ref, keys, i; - - if (!schema || typeof schema !== 'object') { - return; - } - - if (typeof schema.id === 'string' && schema.id) { - id = url.resolve(baseId, schema.id); - - this._cacheId(id, schema, this); - } - else if (schema === this.rootSchema && baseId) { - this._cacheId(baseId, schema, this); - } - - if (schema.$ref && typeof schema.$ref === 'string') { - ref = url.resolve(id, schema.$ref); - - this.refCache.schemas.push(schema); - this.refCache.refs.push(ref); - } - - keys = Object.keys(schema); - - for (i = 0; i < keys.length; i++) { - this._buildIdCache(schema[keys[i]], id); - } - }; - - SchemaResolver.prototype._buildResolvers = function (schemas, baseId) { - if (!schemas || typeof schemas !== 'object') { - return; - } - - var that = this, - resolvers = {}; - - Object.keys(schemas).forEach(function (key) { - var id = url.resolve(baseId, key), - resolver = new SchemaResolver(schemas[key], null, that.missing$Ref, id); - - that._cacheId(id, resolver.rootSchema, resolver); - - Object.keys(resolver.idCache).forEach(function (idKey) { - that.idCache[idKey] = resolver.idCache[idKey]; - }); - - resolvers[key] = resolver; - }); - - this.resolvers = resolvers; - }; - - SchemaResolver.prototype.getNormalizedRef = function (schema) { - var index = this.refCache.schemas.indexOf(schema); - return this.refCache.refs[index]; - }; - - SchemaResolver.prototype._resolveRef = function (ref) { - var err = new Error(INVALID_SCHEMA_REFERENCE + ' ' + ref), - idCache = this.idCache, - externalResolver, cached, descriptor, path, dest; - - if (!ref || typeof ref !== 'string') { - throw err; - } - - if (ref === metaschema.id) { - dest = metaschema; - } - - cached = idCache[ref]; - - if (cached) { - dest = cached.resolver.resolve(cached.schema); - } - - if (dest === undefined) { - descriptor = refToObj(ref); - path = descriptor.path; - - if (descriptor.base) { - cached = idCache[descriptor.base] || idCache[descriptor.base + '#']; - - if (cached) { - dest = cached.resolver.resolve(get(cached.schema, path.slice(0))); - } - else { - path.unshift(descriptor.base); - } - } - } - - if (dest === undefined && this.resolvedRootSchema) { - dest = get(this.resolvedRootSchema, path.slice(0)); - } - - if (dest === undefined) { - dest = get(this.rootSchema, path.slice(0)); - } - - if (dest === undefined && path.length && this.resolvers) { - externalResolver = get(this.resolvers, path); - - if (externalResolver) { - dest = externalResolver.resolve(externalResolver.rootSchema); - } - } - - if (dest === undefined || typeof dest !== 'object') { - if (this.missing$Ref) { - dest = {}; - } else { - throw err; - } - } - - if (this.cache[ref] === dest) { - return dest; - } - - this.cache[ref] = dest; - - if (dest.$ref !== undefined) { - dest = this.resolve(dest); - } - - return dest; - }; - - SchemaResolver.prototype.resolve = function (schema) { - if (!schema || typeof schema !== 'object' || schema.$ref === undefined) { - return schema; - } - - var ref = this.getNormalizedRef(schema) || schema.$ref, - resolved = this.cache[ref]; - - if (resolved !== undefined) { - return resolved; - } - - if (this.refStack.indexOf(ref) > -1) { - throw new Error(CIRCULAR_SCHEMA_REFERENCE + ' ' + ref); - } - - this.refStack.push(ref); - - resolved = this._resolveRef(ref); - - this.refStack.pop(); - - if (schema === this.rootSchema) { - // cache the resolved root schema - this.resolvedRootSchema = resolved; - } - - return resolved; - }; - - SchemaResolver.prototype.hasRef = function (schema) { - var keys = Object.keys(schema), - len, key, i, hasChildRef; - - if (keys.indexOf('$ref') > -1) { - return true; - } - - for (i = 0, len = keys.length; i < len; i++) { - key = keys[i]; - - if (schema[key] && typeof schema[key] === 'object' && !Array.isArray(schema[key])) { - hasChildRef = this.hasRef(schema[key]); - - if (hasChildRef) { - return true; - } - } - } - - return false; - }; - - SchemaResolver.resolvePointer = function (obj, pointer) { - var descriptor = refToObj(pointer), - path = descriptor.path; - - if (descriptor.base) { - path = [descriptor.base].concat(path); - } - - return get(obj, path); - }; - - module.exports = SchemaResolver; - - /***/ }, - /* 16 */ - /***/ function(module, exports, __webpack_require__) { - - // Copyright Joyent, Inc. and other Node contributors. - // - // Permission is hereby granted, free of charge, to any person obtaining a - // copy of this software and associated documentation files (the - // "Software"), to deal in the Software without restriction, including - // without limitation the rights to use, copy, modify, merge, publish, - // distribute, sublicense, and/or sell copies of the Software, and to permit - // persons to whom the Software is furnished to do so, subject to the - // following conditions: - // - // The above copyright notice and this permission notice shall be included - // in all copies or substantial portions of the Software. - // - // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE - // USE OR OTHER DEALINGS IN THE SOFTWARE. - - 'use strict'; - - var punycode = __webpack_require__(17); - var util = __webpack_require__(19); - - exports.parse = urlParse; - exports.resolve = urlResolve; - exports.resolveObject = urlResolveObject; - exports.format = urlFormat; - - exports.Url = Url; - - function Url() { - this.protocol = null; - this.slashes = null; - this.auth = null; - this.host = null; - this.port = null; - this.hostname = null; - this.hash = null; - this.search = null; - this.query = null; - this.pathname = null; - this.path = null; - this.href = null; - } - - // Reference: RFC 3986, RFC 1808, RFC 2396 - - // define these here so at least they only have to be - // compiled once on the first module load. - var protocolPattern = /^([a-z0-9.+-]+:)/i, - portPattern = /:[0-9]*$/, - - // Special case for a simple path URL - simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/, - - // RFC 2396: characters reserved for delimiting URLs. - // We actually just auto-escape these. - delims = ['<', '>', '"', '`', ' ', '\r', '\n', '\t'], - - // RFC 2396: characters not allowed for various reasons. - unwise = ['{', '}', '|', '\\', '^', '`'].concat(delims), - - // Allowed by RFCs, but cause of XSS attacks. Always escape these. - autoEscape = ['\''].concat(unwise), - // Characters that are never ever allowed in a hostname. - // Note that any invalid chars are also handled, but these - // are the ones that are *expected* to be seen, so we fast-path - // them. - nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape), - hostEndingChars = ['/', '?', '#'], - hostnameMaxLen = 255, - hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/, - hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, - // protocols that can allow "unsafe" and "unwise" chars. - unsafeProtocol = { - 'javascript': true, - 'javascript:': true - }, - // protocols that never have a hostname. - hostlessProtocol = { - 'javascript': true, - 'javascript:': true - }, - // protocols that always contain a // bit. - slashedProtocol = { - 'http': true, - 'https': true, - 'ftp': true, - 'gopher': true, - 'file': true, - 'http:': true, - 'https:': true, - 'ftp:': true, - 'gopher:': true, - 'file:': true - }, - querystring = __webpack_require__(20); - - function urlParse(url, parseQueryString, slashesDenoteHost) { - if (url && util.isObject(url) && url instanceof Url) return url; - - var u = new Url; - u.parse(url, parseQueryString, slashesDenoteHost); - return u; - } - - Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { - if (!util.isString(url)) { - throw new TypeError("Parameter 'url' must be a string, not " + typeof url); - } - - // Copy chrome, IE, opera backslash-handling behavior. - // Back slashes before the query string get converted to forward slashes - // See: https://code.google.com/p/chromium/issues/detail?id=25916 - var queryIndex = url.indexOf('?'), - splitter = - (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#', - uSplit = url.split(splitter), - slashRegex = /\\/g; - uSplit[0] = uSplit[0].replace(slashRegex, '/'); - url = uSplit.join(splitter); - - var rest = url; - - // trim before proceeding. - // This is to support parse stuff like " http://foo.com \n" - rest = rest.trim(); - - if (!slashesDenoteHost && url.split('#').length === 1) { - // Try fast path regexp - var simplePath = simplePathPattern.exec(rest); - if (simplePath) { - this.path = rest; - this.href = rest; - this.pathname = simplePath[1]; - if (simplePath[2]) { - this.search = simplePath[2]; - if (parseQueryString) { - this.query = querystring.parse(this.search.substr(1)); - } else { - this.query = this.search.substr(1); - } - } else if (parseQueryString) { - this.search = ''; - this.query = {}; - } - return this; - } - } - - var proto = protocolPattern.exec(rest); - if (proto) { - proto = proto[0]; - var lowerProto = proto.toLowerCase(); - this.protocol = lowerProto; - rest = rest.substr(proto.length); - } - - // figure out if it's got a host - // user@server is *always* interpreted as a hostname, and url - // resolution will treat //foo/bar as host=foo,path=bar because that's - // how the browser resolves relative URLs. - if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) { - var slashes = rest.substr(0, 2) === '//'; - if (slashes && !(proto && hostlessProtocol[proto])) { - rest = rest.substr(2); - this.slashes = true; - } - } - - if (!hostlessProtocol[proto] && - (slashes || (proto && !slashedProtocol[proto]))) { - - // there's a hostname. - // the first instance of /, ?, ;, or # ends the host. - // - // If there is an @ in the hostname, then non-host chars *are* allowed - // to the left of the last @ sign, unless some host-ending character - // comes *before* the @-sign. - // URLs are obnoxious. - // - // ex: - // http://a@b@c/ => user:a@b host:c - // http://a@b?@c => user:a host:c path:/?@c - - // v0.12 TODO(isaacs): This is not quite how Chrome does things. - // Review our test case against browsers more comprehensively. - - // find the first instance of any hostEndingChars - var hostEnd = -1; - for (var i = 0; i < hostEndingChars.length; i++) { - var hec = rest.indexOf(hostEndingChars[i]); - if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) - hostEnd = hec; - } - - // at this point, either we have an explicit point where the - // auth portion cannot go past, or the last @ char is the decider. - var auth, atSign; - if (hostEnd === -1) { - // atSign can be anywhere. - atSign = rest.lastIndexOf('@'); - } else { - // atSign must be in auth portion. - // http://a@b/c@d => host:b auth:a path:/c@d - atSign = rest.lastIndexOf('@', hostEnd); - } - - // Now we have a portion which is definitely the auth. - // Pull that off. - if (atSign !== -1) { - auth = rest.slice(0, atSign); - rest = rest.slice(atSign + 1); - this.auth = decodeURIComponent(auth); - } - - // the host is the remaining to the left of the first non-host char - hostEnd = -1; - for (var i = 0; i < nonHostChars.length; i++) { - var hec = rest.indexOf(nonHostChars[i]); - if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) - hostEnd = hec; - } - // if we still have not hit it, then the entire thing is a host. - if (hostEnd === -1) - hostEnd = rest.length; - - this.host = rest.slice(0, hostEnd); - rest = rest.slice(hostEnd); - - // pull out port. - this.parseHost(); - - // we've indicated that there is a hostname, - // so even if it's empty, it has to be present. - this.hostname = this.hostname || ''; - - // if hostname begins with [ and ends with ] - // assume that it's an IPv6 address. - var ipv6Hostname = this.hostname[0] === '[' && - this.hostname[this.hostname.length - 1] === ']'; - - // validate a little. - if (!ipv6Hostname) { - var hostparts = this.hostname.split(/\./); - for (var i = 0, l = hostparts.length; i < l; i++) { - var part = hostparts[i]; - if (!part) continue; - if (!part.match(hostnamePartPattern)) { - var newpart = ''; - for (var j = 0, k = part.length; j < k; j++) { - if (part.charCodeAt(j) > 127) { - // we replace non-ASCII char with a temporary placeholder - // we need this to make sure size of hostname is not - // broken by replacing non-ASCII by nothing - newpart += 'x'; - } else { - newpart += part[j]; - } - } - // we test again with ASCII char only - if (!newpart.match(hostnamePartPattern)) { - var validParts = hostparts.slice(0, i); - var notHost = hostparts.slice(i + 1); - var bit = part.match(hostnamePartStart); - if (bit) { - validParts.push(bit[1]); - notHost.unshift(bit[2]); - } - if (notHost.length) { - rest = '/' + notHost.join('.') + rest; - } - this.hostname = validParts.join('.'); - break; - } - } - } - } - - if (this.hostname.length > hostnameMaxLen) { - this.hostname = ''; - } else { - // hostnames are always lower case. - this.hostname = this.hostname.toLowerCase(); - } - - if (!ipv6Hostname) { - // IDNA Support: Returns a punycoded representation of "domain". - // It only converts parts of the domain name that - // have non-ASCII characters, i.e. it doesn't matter if - // you call it with a domain that already is ASCII-only. - this.hostname = punycode.toASCII(this.hostname); - } - - var p = this.port ? ':' + this.port : ''; - var h = this.hostname || ''; - this.host = h + p; - this.href += this.host; - - // strip [ and ] from the hostname - // the host field still retains them, though - if (ipv6Hostname) { - this.hostname = this.hostname.substr(1, this.hostname.length - 2); - if (rest[0] !== '/') { - rest = '/' + rest; - } - } - } - - // now rest is set to the post-host stuff. - // chop off any delim chars. - if (!unsafeProtocol[lowerProto]) { - - // First, make 100% sure that any "autoEscape" chars get - // escaped, even if encodeURIComponent doesn't think they - // need to be. - for (var i = 0, l = autoEscape.length; i < l; i++) { - var ae = autoEscape[i]; - if (rest.indexOf(ae) === -1) - continue; - var esc = encodeURIComponent(ae); - if (esc === ae) { - esc = escape(ae); - } - rest = rest.split(ae).join(esc); - } - } - - - // chop off from the tail first. - var hash = rest.indexOf('#'); - if (hash !== -1) { - // got a fragment string. - this.hash = rest.substr(hash); - rest = rest.slice(0, hash); - } - var qm = rest.indexOf('?'); - if (qm !== -1) { - this.search = rest.substr(qm); - this.query = rest.substr(qm + 1); - if (parseQueryString) { - this.query = querystring.parse(this.query); - } - rest = rest.slice(0, qm); - } else if (parseQueryString) { - // no query string, but parseQueryString still requested - this.search = ''; - this.query = {}; - } - if (rest) this.pathname = rest; - if (slashedProtocol[lowerProto] && - this.hostname && !this.pathname) { - this.pathname = '/'; - } - - //to support http.request - if (this.pathname || this.search) { - var p = this.pathname || ''; - var s = this.search || ''; - this.path = p + s; - } - - // finally, reconstruct the href based on what has been validated. - this.href = this.format(); - return this; - }; - - // format a parsed object into a url string - function urlFormat(obj) { - // ensure it's an object, and not a string url. - // If it's an obj, this is a no-op. - // this way, you can call url_format() on strings - // to clean up potentially wonky urls. - if (util.isString(obj)) obj = urlParse(obj); - if (!(obj instanceof Url)) return Url.prototype.format.call(obj); - return obj.format(); - } - - Url.prototype.format = function() { - var auth = this.auth || ''; - if (auth) { - auth = encodeURIComponent(auth); - auth = auth.replace(/%3A/i, ':'); - auth += '@'; - } - - var protocol = this.protocol || '', - pathname = this.pathname || '', - hash = this.hash || '', - host = false, - query = ''; - - if (this.host) { - host = auth + this.host; - } else if (this.hostname) { - host = auth + (this.hostname.indexOf(':') === -1 ? - this.hostname : - '[' + this.hostname + ']'); - if (this.port) { - host += ':' + this.port; - } - } - - if (this.query && - util.isObject(this.query) && - Object.keys(this.query).length) { - query = querystring.stringify(this.query); - } - - var search = this.search || (query && ('?' + query)) || ''; - - if (protocol && protocol.substr(-1) !== ':') protocol += ':'; - - // only the slashedProtocols get the //. Not mailto:, xmpp:, etc. - // unless they had them to begin with. - if (this.slashes || - (!protocol || slashedProtocol[protocol]) && host !== false) { - host = '//' + (host || ''); - if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname; - } else if (!host) { - host = ''; - } - - if (hash && hash.charAt(0) !== '#') hash = '#' + hash; - if (search && search.charAt(0) !== '?') search = '?' + search; - - pathname = pathname.replace(/[?#]/g, function(match) { - return encodeURIComponent(match); - }); - search = search.replace('#', '%23'); - - return protocol + host + pathname + search + hash; - }; - - function urlResolve(source, relative) { - return urlParse(source, false, true).resolve(relative); - } - - Url.prototype.resolve = function(relative) { - return this.resolveObject(urlParse(relative, false, true)).format(); - }; - - function urlResolveObject(source, relative) { - if (!source) return relative; - return urlParse(source, false, true).resolveObject(relative); - } - - Url.prototype.resolveObject = function(relative) { - if (util.isString(relative)) { - var rel = new Url(); - rel.parse(relative, false, true); - relative = rel; - } - - var result = new Url(); - var tkeys = Object.keys(this); - for (var tk = 0; tk < tkeys.length; tk++) { - var tkey = tkeys[tk]; - result[tkey] = this[tkey]; - } - - // hash is always overridden, no matter what. - // even href="" will remove it. - result.hash = relative.hash; - - // if the relative url is empty, then there's nothing left to do here. - if (relative.href === '') { - result.href = result.format(); - return result; - } - - // hrefs like //foo/bar always cut to the protocol. - if (relative.slashes && !relative.protocol) { - // take everything except the protocol from relative - var rkeys = Object.keys(relative); - for (var rk = 0; rk < rkeys.length; rk++) { - var rkey = rkeys[rk]; - if (rkey !== 'protocol') - result[rkey] = relative[rkey]; - } - - //urlParse appends trailing / to urls like http://www.example.com - if (slashedProtocol[result.protocol] && - result.hostname && !result.pathname) { - result.path = result.pathname = '/'; - } - - result.href = result.format(); - return result; - } - - if (relative.protocol && relative.protocol !== result.protocol) { - // if it's a known url protocol, then changing - // the protocol does weird things - // first, if it's not file:, then we MUST have a host, - // and if there was a path - // to begin with, then we MUST have a path. - // if it is file:, then the host is dropped, - // because that's known to be hostless. - // anything else is assumed to be absolute. - if (!slashedProtocol[relative.protocol]) { - var keys = Object.keys(relative); - for (var v = 0; v < keys.length; v++) { - var k = keys[v]; - result[k] = relative[k]; - } - result.href = result.format(); - return result; - } - - result.protocol = relative.protocol; - if (!relative.host && !hostlessProtocol[relative.protocol]) { - var relPath = (relative.pathname || '').split('/'); - while (relPath.length && !(relative.host = relPath.shift())); - if (!relative.host) relative.host = ''; - if (!relative.hostname) relative.hostname = ''; - if (relPath[0] !== '') relPath.unshift(''); - if (relPath.length < 2) relPath.unshift(''); - result.pathname = relPath.join('/'); - } else { - result.pathname = relative.pathname; - } - result.search = relative.search; - result.query = relative.query; - result.host = relative.host || ''; - result.auth = relative.auth; - result.hostname = relative.hostname || relative.host; - result.port = relative.port; - // to support http.request - if (result.pathname || result.search) { - var p = result.pathname || ''; - var s = result.search || ''; - result.path = p + s; - } - result.slashes = result.slashes || relative.slashes; - result.href = result.format(); - return result; - } - - var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'), - isRelAbs = ( - relative.host || - relative.pathname && relative.pathname.charAt(0) === '/' - ), - mustEndAbs = (isRelAbs || isSourceAbs || - (result.host && relative.pathname)), - removeAllDots = mustEndAbs, - srcPath = result.pathname && result.pathname.split('/') || [], - relPath = relative.pathname && relative.pathname.split('/') || [], - psychotic = result.protocol && !slashedProtocol[result.protocol]; - - // if the url is a non-slashed url, then relative - // links like ../.. should be able - // to crawl up to the hostname, as well. This is strange. - // result.protocol has already been set by now. - // Later on, put the first path part into the host field. - if (psychotic) { - result.hostname = ''; - result.port = null; - if (result.host) { - if (srcPath[0] === '') srcPath[0] = result.host; - else srcPath.unshift(result.host); - } - result.host = ''; - if (relative.protocol) { - relative.hostname = null; - relative.port = null; - if (relative.host) { - if (relPath[0] === '') relPath[0] = relative.host; - else relPath.unshift(relative.host); - } - relative.host = null; - } - mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === ''); - } - - if (isRelAbs) { - // it's absolute. - result.host = (relative.host || relative.host === '') ? - relative.host : result.host; - result.hostname = (relative.hostname || relative.hostname === '') ? - relative.hostname : result.hostname; - result.search = relative.search; - result.query = relative.query; - srcPath = relPath; - // fall through to the dot-handling below. - } else if (relPath.length) { - // it's relative - // throw away the existing file, and take the new path instead. - if (!srcPath) srcPath = []; - srcPath.pop(); - srcPath = srcPath.concat(relPath); - result.search = relative.search; - result.query = relative.query; - } else if (!util.isNullOrUndefined(relative.search)) { - // just pull out the search. - // like href='https://github.com/?foo'. - // Put this after the other two cases because it simplifies the booleans - if (psychotic) { - result.hostname = result.host = srcPath.shift(); - //occationaly the auth can get stuck only in host - //this especially happens in cases like - //url.resolveObject('mailto:local1@domain1', 'local2@domain2') - var authInHost = result.host && result.host.indexOf('@') > 0 ? - result.host.split('@') : false; - if (authInHost) { - result.auth = authInHost.shift(); - result.host = result.hostname = authInHost.shift(); - } - } - result.search = relative.search; - result.query = relative.query; - //to support http.request - if (!util.isNull(result.pathname) || !util.isNull(result.search)) { - result.path = (result.pathname ? result.pathname : '') + - (result.search ? result.search : ''); - } - result.href = result.format(); - return result; - } - - if (!srcPath.length) { - // no path at all. easy. - // we've already handled the other stuff above. - result.pathname = null; - //to support http.request - if (result.search) { - result.path = '/' + result.search; - } else { - result.path = null; - } - result.href = result.format(); - return result; - } - - // if a url ENDs in . or .., then it must get a trailing slash. - // however, if it ends in anything else non-slashy, - // then it must NOT get a trailing slash. - var last = srcPath.slice(-1)[0]; - var hasTrailingSlash = ( - (result.host || relative.host || srcPath.length > 1) && - (last === '.' || last === '..') || last === ''); - - // strip single dots, resolve double dots to parent dir - // if the path tries to go above the root, `up` ends up > 0 - var up = 0; - for (var i = srcPath.length; i >= 0; i--) { - last = srcPath[i]; - if (last === '.') { - srcPath.splice(i, 1); - } else if (last === '..') { - srcPath.splice(i, 1); - up++; - } else if (up) { - srcPath.splice(i, 1); - up--; - } - } - - // if the path is allowed to go above the root, restore leading ..s - if (!mustEndAbs && !removeAllDots) { - for (; up--; up) { - srcPath.unshift('..'); - } - } - - if (mustEndAbs && srcPath[0] !== '' && - (!srcPath[0] || srcPath[0].charAt(0) !== '/')) { - srcPath.unshift(''); - } - - if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) { - srcPath.push(''); - } - - var isAbsolute = srcPath[0] === '' || - (srcPath[0] && srcPath[0].charAt(0) === '/'); - - // put the host back - if (psychotic) { - result.hostname = result.host = isAbsolute ? '' : - srcPath.length ? srcPath.shift() : ''; - //occationaly the auth can get stuck only in host - //this especially happens in cases like - //url.resolveObject('mailto:local1@domain1', 'local2@domain2') - var authInHost = result.host && result.host.indexOf('@') > 0 ? - result.host.split('@') : false; - if (authInHost) { - result.auth = authInHost.shift(); - result.host = result.hostname = authInHost.shift(); - } - } - - mustEndAbs = mustEndAbs || (result.host && srcPath.length); - - if (mustEndAbs && !isAbsolute) { - srcPath.unshift(''); - } - - if (!srcPath.length) { - result.pathname = null; - result.path = null; - } else { - result.pathname = srcPath.join('/'); - } - - //to support request.http - if (!util.isNull(result.pathname) || !util.isNull(result.search)) { - result.path = (result.pathname ? result.pathname : '') + - (result.search ? result.search : ''); - } - result.auth = relative.auth || result.auth; - result.slashes = result.slashes || relative.slashes; - result.href = result.format(); - return result; - }; - - Url.prototype.parseHost = function() { - var host = this.host; - var port = portPattern.exec(host); - if (port) { - port = port[0]; - if (port !== ':') { - this.port = port.substr(1); - } - host = host.substr(0, host.length - port.length); - } - if (host) this.hostname = host; - }; - - - /***/ }, - /* 17 */ - /***/ function(module, exports, __webpack_require__) { - - var __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(module, global) {/*! https://mths.be/punycode v1.3.2 by @mathias */ - ;(function(root) { - - /** Detect free variables */ - var freeExports = typeof exports == 'object' && exports && - !exports.nodeType && exports; - var freeModule = typeof module == 'object' && module && - !module.nodeType && module; - var freeGlobal = typeof global == 'object' && global; - if ( - freeGlobal.global === freeGlobal || - freeGlobal.window === freeGlobal || - freeGlobal.self === freeGlobal - ) { - root = freeGlobal; - } - - /** - * The `punycode` object. - * @name punycode - * @type Object - */ - var punycode, - - /** Highest positive signed 32-bit float value */ - maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1 - - /** Bootstring parameters */ - base = 36, - tMin = 1, - tMax = 26, - skew = 38, - damp = 700, - initialBias = 72, - initialN = 128, // 0x80 - delimiter = '-', // '\x2D' - - /** Regular expressions */ - regexPunycode = /^xn--/, - regexNonASCII = /[^\x20-\x7E]/, // unprintable ASCII chars + non-ASCII chars - regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, // RFC 3490 separators - - /** Error messages */ - errors = { - 'overflow': 'Overflow: input needs wider integers to process', - 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', - 'invalid-input': 'Invalid input' - }, - - /** Convenience shortcuts */ - baseMinusTMin = base - tMin, - floor = Math.floor, - stringFromCharCode = String.fromCharCode, - - /** Temporary variable */ - key; - - /*--------------------------------------------------------------------------*/ - - /** - * A generic error utility function. - * @private - * @param {String} type The error type. - * @returns {Error} Throws a `RangeError` with the applicable error message. - */ - function error(type) { - throw RangeError(errors[type]); - } - - /** - * A generic `Array#map` utility function. - * @private - * @param {Array} array The array to iterate over. - * @param {Function} callback The function that gets called for every array - * item. - * @returns {Array} A new array of values returned by the callback function. - */ - function map(array, fn) { - var length = array.length; - var result = []; - while (length--) { - result[length] = fn(array[length]); - } - return result; - } - - /** - * A simple `Array#map`-like wrapper to work with domain name strings or email - * addresses. - * @private - * @param {String} domain The domain name or email address. - * @param {Function} callback The function that gets called for every - * character. - * @returns {Array} A new string of characters returned by the callback - * function. - */ - function mapDomain(string, fn) { - var parts = string.split('@'); - var result = ''; - if (parts.length > 1) { - // In email addresses, only the domain name should be punycoded. Leave - // the local part (i.e. everything up to `@`) intact. - result = parts[0] + '@'; - string = parts[1]; - } - // Avoid `split(regex)` for IE8 compatibility. See #17. - string = string.replace(regexSeparators, '\x2E'); - var labels = string.split('.'); - var encoded = map(labels, fn).join('.'); - return result + encoded; - } - - /** - * Creates an array containing the numeric code points of each Unicode - * character in the string. While JavaScript uses UCS-2 internally, - * this function will convert a pair of surrogate halves (each of which - * UCS-2 exposes as separate characters) into a single code point, - * matching UTF-16. - * @see `punycode.ucs2.encode` - * @see - * @memberOf punycode.ucs2 - * @name decode - * @param {String} string The Unicode input string (UCS-2). - * @returns {Array} The new array of code points. - */ - function ucs2decode(string) { - var output = [], - counter = 0, - length = string.length, - value, - extra; - while (counter < length) { - value = string.charCodeAt(counter++); - if (value >= 0xD800 && value <= 0xDBFF && counter < length) { - // high surrogate, and there is a next character - extra = string.charCodeAt(counter++); - if ((extra & 0xFC00) == 0xDC00) { // low surrogate - output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); - } else { - // unmatched surrogate; only append this code unit, in case the next - // code unit is the high surrogate of a surrogate pair - output.push(value); - counter--; - } - } else { - output.push(value); - } - } - return output; - } - - /** - * Creates a string based on an array of numeric code points. - * @see `punycode.ucs2.decode` - * @memberOf punycode.ucs2 - * @name encode - * @param {Array} codePoints The array of numeric code points. - * @returns {String} The new Unicode string (UCS-2). - */ - function ucs2encode(array) { - return map(array, function(value) { - var output = ''; - if (value > 0xFFFF) { - value -= 0x10000; - output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800); - value = 0xDC00 | value & 0x3FF; - } - output += stringFromCharCode(value); - return output; - }).join(''); - } - - /** - * Converts a basic code point into a digit/integer. - * @see `digitToBasic()` - * @private - * @param {Number} codePoint The basic numeric code point value. - * @returns {Number} The numeric value of a basic code point (for use in - * representing integers) in the range `0` to `base - 1`, or `base` if - * the code point does not represent a value. - */ - function basicToDigit(codePoint) { - if (codePoint - 48 < 10) { - return codePoint - 22; - } - if (codePoint - 65 < 26) { - return codePoint - 65; - } - if (codePoint - 97 < 26) { - return codePoint - 97; - } - return base; - } - - /** - * Converts a digit/integer into a basic code point. - * @see `basicToDigit()` - * @private - * @param {Number} digit The numeric value of a basic code point. - * @returns {Number} The basic code point whose value (when used for - * representing integers) is `digit`, which needs to be in the range - * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is - * used; else, the lowercase form is used. The behavior is undefined - * if `flag` is non-zero and `digit` has no uppercase form. - */ - function digitToBasic(digit, flag) { - // 0..25 map to ASCII a..z or A..Z - // 26..35 map to ASCII 0..9 - return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); - } - - /** - * Bias adaptation function as per section 3.4 of RFC 3492. - * http://tools.ietf.org/html/rfc3492#section-3.4 - * @private - */ - function adapt(delta, numPoints, firstTime) { - var k = 0; - delta = firstTime ? floor(delta / damp) : delta >> 1; - delta += floor(delta / numPoints); - for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { - delta = floor(delta / baseMinusTMin); - } - return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); - } - - /** - * Converts a Punycode string of ASCII-only symbols to a string of Unicode - * symbols. - * @memberOf punycode - * @param {String} input The Punycode string of ASCII-only symbols. - * @returns {String} The resulting string of Unicode symbols. - */ - function decode(input) { - // Don't use UCS-2 - var output = [], - inputLength = input.length, - out, - i = 0, - n = initialN, - bias = initialBias, - basic, - j, - index, - oldi, - w, - k, - digit, - t, - /** Cached calculation results */ - baseMinusT; - - // Handle the basic code points: let `basic` be the number of input code - // points before the last delimiter, or `0` if there is none, then copy - // the first basic code points to the output. - - basic = input.lastIndexOf(delimiter); - if (basic < 0) { - basic = 0; - } - - for (j = 0; j < basic; ++j) { - // if it's not a basic code point - if (input.charCodeAt(j) >= 0x80) { - error('not-basic'); - } - output.push(input.charCodeAt(j)); - } - - // Main decoding loop: start just after the last delimiter if any basic code - // points were copied; start at the beginning otherwise. - - for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) { - - // `index` is the index of the next character to be consumed. - // Decode a generalized variable-length integer into `delta`, - // which gets added to `i`. The overflow checking is easier - // if we increase `i` as we go, then subtract off its starting - // value at the end to obtain `delta`. - for (oldi = i, w = 1, k = base; /* no condition */; k += base) { - - if (index >= inputLength) { - error('invalid-input'); - } - - digit = basicToDigit(input.charCodeAt(index++)); - - if (digit >= base || digit > floor((maxInt - i) / w)) { - error('overflow'); - } - - i += digit * w; - t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); - - if (digit < t) { - break; - } - - baseMinusT = base - t; - if (w > floor(maxInt / baseMinusT)) { - error('overflow'); - } - - w *= baseMinusT; - - } - - out = output.length + 1; - bias = adapt(i - oldi, out, oldi == 0); - - // `i` was supposed to wrap around from `out` to `0`, - // incrementing `n` each time, so we'll fix that now: - if (floor(i / out) > maxInt - n) { - error('overflow'); - } - - n += floor(i / out); - i %= out; - - // Insert `n` at position `i` of the output - output.splice(i++, 0, n); - - } - - return ucs2encode(output); - } - - /** - * Converts a string of Unicode symbols (e.g. a domain name label) to a - * Punycode string of ASCII-only symbols. - * @memberOf punycode - * @param {String} input The string of Unicode symbols. - * @returns {String} The resulting Punycode string of ASCII-only symbols. - */ - function encode(input) { - var n, - delta, - handledCPCount, - basicLength, - bias, - j, - m, - q, - k, - t, - currentValue, - output = [], - /** `inputLength` will hold the number of code points in `input`. */ - inputLength, - /** Cached calculation results */ - handledCPCountPlusOne, - baseMinusT, - qMinusT; - - // Convert the input in UCS-2 to Unicode - input = ucs2decode(input); - - // Cache the length - inputLength = input.length; - - // Initialize the state - n = initialN; - delta = 0; - bias = initialBias; - - // Handle the basic code points - for (j = 0; j < inputLength; ++j) { - currentValue = input[j]; - if (currentValue < 0x80) { - output.push(stringFromCharCode(currentValue)); - } - } - - handledCPCount = basicLength = output.length; - - // `handledCPCount` is the number of code points that have been handled; - // `basicLength` is the number of basic code points. - - // Finish the basic string - if it is not empty - with a delimiter - if (basicLength) { - output.push(delimiter); - } - - // Main encoding loop: - while (handledCPCount < inputLength) { - - // All non-basic code points < n have been handled already. Find the next - // larger one: - for (m = maxInt, j = 0; j < inputLength; ++j) { - currentValue = input[j]; - if (currentValue >= n && currentValue < m) { - m = currentValue; - } - } - - // Increase `delta` enough to advance the decoder's state to , - // but guard against overflow - handledCPCountPlusOne = handledCPCount + 1; - if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { - error('overflow'); - } - - delta += (m - n) * handledCPCountPlusOne; - n = m; - - for (j = 0; j < inputLength; ++j) { - currentValue = input[j]; - - if (currentValue < n && ++delta > maxInt) { - error('overflow'); - } - - if (currentValue == n) { - // Represent delta as a generalized variable-length integer - for (q = delta, k = base; /* no condition */; k += base) { - t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); - if (q < t) { - break; - } - qMinusT = q - t; - baseMinusT = base - t; - output.push( - stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) - ); - q = floor(qMinusT / baseMinusT); - } - - output.push(stringFromCharCode(digitToBasic(q, 0))); - bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); - delta = 0; - ++handledCPCount; - } - } - - ++delta; - ++n; - - } - return output.join(''); - } - - /** - * Converts a Punycode string representing a domain name or an email address - * to Unicode. Only the Punycoded parts of the input will be converted, i.e. - * it doesn't matter if you call it on a string that has already been - * converted to Unicode. - * @memberOf punycode - * @param {String} input The Punycoded domain name or email address to - * convert to Unicode. - * @returns {String} The Unicode representation of the given Punycode - * string. - */ - function toUnicode(input) { - return mapDomain(input, function(string) { - return regexPunycode.test(string) - ? decode(string.slice(4).toLowerCase()) - : string; - }); - } - - /** - * Converts a Unicode string representing a domain name or an email address to - * Punycode. Only the non-ASCII parts of the domain name will be converted, - * i.e. it doesn't matter if you call it with a domain that's already in - * ASCII. - * @memberOf punycode - * @param {String} input The domain name or email address to convert, as a - * Unicode string. - * @returns {String} The Punycode representation of the given domain name or - * email address. - */ - function toASCII(input) { - return mapDomain(input, function(string) { - return regexNonASCII.test(string) - ? 'xn--' + encode(string) - : string; - }); - } - - /*--------------------------------------------------------------------------*/ - - /** Define the public API */ - punycode = { - /** - * A string representing the current Punycode.js version number. - * @memberOf punycode - * @type String - */ - 'version': '1.3.2', - /** - * An object of methods to convert from JavaScript's internal character - * representation (UCS-2) to Unicode code points, and back. - * @see - * @memberOf punycode - * @type Object - */ - 'ucs2': { - 'decode': ucs2decode, - 'encode': ucs2encode - }, - 'decode': decode, - 'encode': encode, - 'toASCII': toASCII, - 'toUnicode': toUnicode - }; - - /** Expose `punycode` */ - // Some AMD build optimizers, like r.js, check for specific condition patterns - // like the following: - if ( - true - ) { - !(__WEBPACK_AMD_DEFINE_RESULT__ = function() { - return punycode; - }.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else if (freeExports && freeModule) { - if (module.exports == freeExports) { // in Node.js or RingoJS v0.8.0+ - freeModule.exports = punycode; - } else { // in Narwhal or RingoJS v0.7.0- - for (key in punycode) { - punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]); - } - } - } else { // in Rhino or a web browser - root.punycode = punycode; - } - - }(this)); - - /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(18)(module), (function() { return this; }()))) - - /***/ }, - /* 18 */ - /***/ function(module, exports) { - - module.exports = function(module) { - if(!module.webpackPolyfill) { - module.deprecate = function() {}; - module.paths = []; - // module.parent = undefined by default - module.children = []; - module.webpackPolyfill = 1; - } - return module; - } - - - /***/ }, - /* 19 */ - /***/ function(module, exports) { - - 'use strict'; - - module.exports = { - isString: function(arg) { - return typeof(arg) === 'string'; - }, - isObject: function(arg) { - return typeof(arg) === 'object' && arg !== null; - }, - isNull: function(arg) { - return arg === null; - }, - isNullOrUndefined: function(arg) { - return arg == null; - } - }; - - - /***/ }, - /* 20 */ - /***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - exports.decode = exports.parse = __webpack_require__(21); - exports.encode = exports.stringify = __webpack_require__(22); - - - /***/ }, - /* 21 */ - /***/ function(module, exports) { - - // Copyright Joyent, Inc. and other Node contributors. - // - // Permission is hereby granted, free of charge, to any person obtaining a - // copy of this software and associated documentation files (the - // "Software"), to deal in the Software without restriction, including - // without limitation the rights to use, copy, modify, merge, publish, - // distribute, sublicense, and/or sell copies of the Software, and to permit - // persons to whom the Software is furnished to do so, subject to the - // following conditions: - // - // The above copyright notice and this permission notice shall be included - // in all copies or substantial portions of the Software. - // - // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE - // USE OR OTHER DEALINGS IN THE SOFTWARE. - - 'use strict'; - - // If obj.hasOwnProperty has been overridden, then calling - // obj.hasOwnProperty(prop) will break. - // See: https://github.com/joyent/node/issues/1707 - function hasOwnProperty(obj, prop) { - return Object.prototype.hasOwnProperty.call(obj, prop); - } - - module.exports = function(qs, sep, eq, options) { - sep = sep || '&'; - eq = eq || '='; - var obj = {}; - - if (typeof qs !== 'string' || qs.length === 0) { - return obj; - } - - var regexp = /\+/g; - qs = qs.split(sep); - - var maxKeys = 1000; - if (options && typeof options.maxKeys === 'number') { - maxKeys = options.maxKeys; - } - - var len = qs.length; - // maxKeys <= 0 means that we should not limit keys count - if (maxKeys > 0 && len > maxKeys) { - len = maxKeys; - } - - for (var i = 0; i < len; ++i) { - var x = qs[i].replace(regexp, '%20'), - idx = x.indexOf(eq), - kstr, vstr, k, v; - - if (idx >= 0) { - kstr = x.substr(0, idx); - vstr = x.substr(idx + 1); - } else { - kstr = x; - vstr = ''; - } - - k = decodeURIComponent(kstr); - v = decodeURIComponent(vstr); - - if (!hasOwnProperty(obj, k)) { - obj[k] = v; - } else if (Array.isArray(obj[k])) { - obj[k].push(v); - } else { - obj[k] = [obj[k], v]; - } - } - - return obj; - }; - - - /***/ }, - /* 22 */ - /***/ function(module, exports) { - - // Copyright Joyent, Inc. and other Node contributors. - // - // Permission is hereby granted, free of charge, to any person obtaining a - // copy of this software and associated documentation files (the - // "Software"), to deal in the Software without restriction, including - // without limitation the rights to use, copy, modify, merge, publish, - // distribute, sublicense, and/or sell copies of the Software, and to permit - // persons to whom the Software is furnished to do so, subject to the - // following conditions: - // - // The above copyright notice and this permission notice shall be included - // in all copies or substantial portions of the Software. - // - // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE - // USE OR OTHER DEALINGS IN THE SOFTWARE. - - 'use strict'; - - var stringifyPrimitive = function(v) { - switch (typeof v) { - case 'string': - return v; - - case 'boolean': - return v ? 'true' : 'false'; - - case 'number': - return isFinite(v) ? v : ''; - - default: - return ''; - } - }; - - module.exports = function(obj, sep, eq, name) { - sep = sep || '&'; - eq = eq || '='; - if (obj === null) { - obj = undefined; - } - - if (typeof obj === 'object') { - return Object.keys(obj).map(function(k) { - var ks = encodeURIComponent(stringifyPrimitive(k)) + eq; - if (Array.isArray(obj[k])) { - return obj[k].map(function(v) { - return ks + encodeURIComponent(stringifyPrimitive(v)); - }).join(sep); - } else { - return ks + encodeURIComponent(stringifyPrimitive(obj[k])); - } - }).join(sep); - - } - - if (!name) return ''; - return encodeURIComponent(stringifyPrimitive(name)) + eq + - encodeURIComponent(stringifyPrimitive(obj)); - }; - - - /***/ }, - /* 23 */ - /***/ function(module, exports) { - - module.exports = { - "id": "http://json-schema.org/draft-04/schema#", - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "Core schema meta-schema", - "definitions": { - "schemaArray": { - "type": "array", - "minItems": 1, - "items": { - "$ref": "#" - } - }, - "positiveInteger": { - "type": "integer", - "minimum": 0 - }, - "positiveIntegerDefault0": { - "allOf": [ - { - "$ref": "#/definitions/positiveInteger" - }, - { - "default": 0 - } - ] - }, - "simpleTypes": { - "enum": [ - "array", - "boolean", - "integer", - "null", - "number", - "object", - "string" - ] - }, - "stringArray": { - "type": "array", - "items": { - "type": "string" - }, - "minItems": 1, - "uniqueItems": true - } - }, - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uri" - }, - "$schema": { - "type": "string", - "format": "uri" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "default": {}, - "multipleOf": { - "type": "number", - "minimum": 0, - "exclusiveMinimum": true - }, - "maximum": { - "type": "number" - }, - "exclusiveMaximum": { - "type": "boolean", - "default": false - }, - "minimum": { - "type": "number" - }, - "exclusiveMinimum": { - "type": "boolean", - "default": false - }, - "maxLength": { - "$ref": "#/definitions/positiveInteger" - }, - "minLength": { - "$ref": "#/definitions/positiveIntegerDefault0" - }, - "pattern": { - "type": "string", - "format": "regex" - }, - "additionalItems": { - "anyOf": [ - { - "type": "boolean" - }, - { - "$ref": "#" - } - ], - "default": {} - }, - "items": { - "anyOf": [ - { - "$ref": "#" - }, - { - "$ref": "#/definitions/schemaArray" - } - ], - "default": {} - }, - "maxItems": { - "$ref": "#/definitions/positiveInteger" - }, - "minItems": { - "$ref": "#/definitions/positiveIntegerDefault0" - }, - "uniqueItems": { - "type": "boolean", - "default": false - }, - "maxProperties": { - "$ref": "#/definitions/positiveInteger" - }, - "minProperties": { - "$ref": "#/definitions/positiveIntegerDefault0" - }, - "required": { - "$ref": "#/definitions/stringArray" - }, - "additionalProperties": { - "anyOf": [ - { - "type": "boolean" - }, - { - "$ref": "#" - } - ], - "default": {} - }, - "definitions": { - "type": "object", - "additionalProperties": { - "$ref": "#" - }, - "default": {} - }, - "properties": { - "type": "object", - "additionalProperties": { - "$ref": "#" - }, - "default": {} - }, - "patternProperties": { - "type": "object", - "additionalProperties": { - "$ref": "#" - }, - "default": {} - }, - "dependencies": { - "type": "object", - "additionalProperties": { - "anyOf": [ - { - "$ref": "#" - }, - { - "$ref": "#/definitions/stringArray" - } - ] - } - }, - "enum": { - "type": "array", - "minItems": 1, - "uniqueItems": true - }, - "type": { - "anyOf": [ - { - "$ref": "#/definitions/simpleTypes" - }, - { - "type": "array", - "items": { - "$ref": "#/definitions/simpleTypes" - }, - "minItems": 1, - "uniqueItems": true - } - ] - }, - "allOf": { - "$ref": "#/definitions/schemaArray" - }, - "anyOf": { - "$ref": "#/definitions/schemaArray" - }, - "oneOf": { - "$ref": "#/definitions/schemaArray" - }, - "not": { - "$ref": "#" - } - }, - "dependencies": { - "exclusiveMaximum": [ - "maximum" - ], - "exclusiveMinimum": [ - "minimum" - ] - }, - "default": {} - }; - - /***/ }, - /* 24 */ - /***/ function(module, exports) { - - 'use strict'; - - var formats = {}; - - // reference: http://dansnetwork.com/javascript-iso8601rfc3339-date-parser/ - formats['date-time'] = /(\d\d\d\d)(-)?(\d\d)(-)?(\d\d)(T)?(\d\d)(:)?(\d\d)(:)?(\d\d)(\.\d+)?(Z|([+-])(\d\d)(:)?(\d\d))/; - // reference: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js#L7 - formats.uri = /^([a-zA-Z][a-zA-Z0-9+-.]*:){0,1}\/\/[^\s]*$/; - // reference: http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363 - // http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'willful violation') - formats.email = /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/; - // reference: https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html - formats.ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/; - // reference: http://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses - formats.ipv6 = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|[fF][eE]80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::([fF]{4}(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/; - // reference: http://stackoverflow.com/questions/106179/regular-expression-to-match-dns-hostname-or-ip-address#answer-3824105 - formats.hostname = /^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]))*$/; - - module.exports = formats; - - /***/ }, - /* 25 */ - /***/ function(module, exports) { - - 'use strict'; - - // Reference: https://github.com/bestiejs/punycode.js/blob/master/punycode.js#L101` - // Info: https://mathiasbynens.be/notes/javascript-unicode - function ucs2length(string) { - var ucs2len = 0, - counter = 0, - length = string.length, - value, extra; - - while (counter < length) { - ucs2len++; - value = string.charCodeAt(counter++); - - if (value >= 0xD800 && value <= 0xDBFF && counter < length) { - // It's a high surrogate, and there is a next character. - extra = string.charCodeAt(counter++); - - if ((extra & 0xFC00) !== 0xDC00) { /* Low surrogate. */ // jshint ignore: line - counter--; - } - } - } - - return ucs2len; - } - - module.exports = ucs2length; - - /***/ } - /******/ ]) - }); - ; - //# sourceMappingURL=models.js.map - -/***/ }, -/* 6 */ -/***/ function(module, exports) { - - /** - * A Power BI report page - * - * @export - * @class Page - * @implements {IPageNode} - * @implements {IFilterable} - */ - var Page = (function () { - /** - * Creates an instance of a Power BI report page. - * - * @param {IReportNode} report - * @param {string} name - * @param {string} [displayName] - */ - function Page(report, name, displayName) { - this.report = report; - this.name = name; - this.displayName = displayName; - } - /** - * Gets all page level filters within the report. - * - * ```javascript - * page.getFilters() - * .then(pages => { ... }); - * ``` - * - * @returns {(Promise)} - */ - Page.prototype.getFilters = function () { - return this.report.service.hpm.get("/report/pages/" + this.name + "/filters", { uid: this.report.config.uniqueId }, this.report.iframe.contentWindow) - .then(function (response) { return response.body; }, function (response) { - throw response.body; - }); - }; - /** - * Removes all filters from this page of the report. - * - * ```javascript - * page.removeFilters(); - * ``` - * - * @returns {Promise} - */ - Page.prototype.removeFilters = function () { - return this.setFilters([]); - }; - /** - * Makes the current page the active page of the report. - * - * ```javascripot - * page.setActive(); - * ``` - * - * @returns {Promise} - */ - Page.prototype.setActive = function () { - var page = { - name: this.name, - displayName: null - }; - return this.report.service.hpm.put('/report/pages/active', page, { uid: this.report.config.uniqueId }, this.report.iframe.contentWindow) - .catch(function (response) { - throw response.body; - }); - }; - /** - * Sets all filters on the current page. - * - * ```javascript - * page.setFilters(filters); - * .catch(errors => { ... }); - * ``` - * - * @param {(models.IFilter[])} filters - * @returns {Promise} - */ - Page.prototype.setFilters = function (filters) { - return this.report.service.hpm.put("/report/pages/" + this.name + "/filters", filters, { uid: this.report.config.uniqueId }, this.report.iframe.contentWindow) - .catch(function (response) { - throw response.body; - }); - }; - return Page; - }()); - exports.Page = Page; - - -/***/ }, -/* 7 */ -/***/ function(module, exports, __webpack_require__) { - - var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var models = __webpack_require__(5); - var embed = __webpack_require__(2); - var Create = (function (_super) { - __extends(Create, _super); - function Create(service, element, config) { - _super.call(this, service, element, config); - } - /** - * Gets the dataset ID from the first available location: createConfig or embed url. - * - * @returns {string} - */ - Create.prototype.getId = function () { - var datasetId = (this.createConfig && this.createConfig.datasetId) ? this.createConfig.datasetId : Create.findIdFromEmbedUrl(this.config.embedUrl); - if (typeof datasetId !== 'string' || datasetId.length === 0) { - throw new Error('Dataset id is required, but it was not found. You must provide an id either as part of embed configuration.'); - } - return datasetId; - }; - /** - * Validate create report configuration. - */ - Create.prototype.validate = function (config) { - return models.validateCreateReport(config); - }; - /** - * Adds the ability to get datasetId from url. - * (e.g. http://embedded.powerbi.com/appTokenReportEmbed?datasetId=854846ed-2106-4dc2-bc58-eb77533bf2f1). - * - * By extracting the ID we can ensure that the ID is always explicitly provided as part of the create configuration. - * - * @static - * @param {string} url - * @returns {string} - */ - Create.findIdFromEmbedUrl = function (url) { - var datasetIdRegEx = /datasetId="?([^&]+)"?/; - var datasetIdMatch = url.match(datasetIdRegEx); - var datasetId; - if (datasetIdMatch) { - datasetId = datasetIdMatch[1]; - } - return datasetId; - }; - return Create; - }(embed.Embed)); - exports.Create = Create; - - -/***/ }, -/* 8 */ -/***/ function(module, exports, __webpack_require__) { - - var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var embed = __webpack_require__(2); - var models = __webpack_require__(5); - /** - * A Power BI Dashboard embed component - * - * @export - * @class Dashboard - * @extends {embed.Embed} - * @implements {IDashboardNode} - * @implements {IFilterable} - */ - var Dashboard = (function (_super) { - __extends(Dashboard, _super); - /** - * Creates an instance of a Power BI Dashboard. - * - * @param {service.Service} service - * @param {HTMLElement} element - */ - function Dashboard(service, element, config) { - _super.call(this, service, element, config); - this.loadPath = "/dashboard/load"; - Array.prototype.push.apply(this.allowedEvents, Dashboard.allowedEvents); - } - /** - * This adds backwards compatibility for older config which used the dashboardId query param to specify dashboard id. - * E.g. https://powerbi-df.analysis-df.windows.net/dashboardEmbedHost?dashboardId=e9363c62-edb6-4eac-92d3-2199c5ca2a9e - * - * By extracting the id we can ensure id is always explicitly provided as part of the load configuration. - * - * @static - * @param {string} url - * @returns {string} - */ - Dashboard.findIdFromEmbedUrl = function (url) { - var dashboardIdRegEx = /dashboardId="?([^&]+)"?/; - var dashboardIdMatch = url.match(dashboardIdRegEx); - var dashboardId; - if (dashboardIdMatch) { - dashboardId = dashboardIdMatch[1]; - } - return dashboardId; - }; - /** - * Get dashboard id from first available location: options, attribute, embed url. - * - * @returns {string} - */ - Dashboard.prototype.getId = function () { - var dashboardId = this.config.id || this.element.getAttribute(Dashboard.dashboardIdAttribute) || Dashboard.findIdFromEmbedUrl(this.config.embedUrl); - if (typeof dashboardId !== 'string' || dashboardId.length === 0) { - throw new Error("Dashboard id is required, but it was not found. You must provide an id either as part of embed configuration or as attribute '" + Dashboard.dashboardIdAttribute + "'."); - } - return dashboardId; - }; - /** - * Validate load configuration. - */ - Dashboard.prototype.validate = function (config) { - var error = models.validateDashboardLoad(config); - return error ? error : this.ValidatePageView(config.pageView); - }; - /** - * Validate that pageView has a legal value: if page view is defined it must have one of the values defined in models.PageView - */ - Dashboard.prototype.ValidatePageView = function (pageView) { - if (pageView && pageView !== "fitToWidth" && pageView !== "oneColumn" && pageView !== "actualSize") { - return [{ message: "pageView must be one of the followings: fitToWidth, oneColumn, actualSize" }]; - } - }; - Dashboard.allowedEvents = ["tileClicked", "error"]; - Dashboard.dashboardIdAttribute = 'powerbi-dashboard-id'; - Dashboard.typeAttribute = 'powerbi-type'; - Dashboard.type = "Dashboard"; - return Dashboard; - }(embed.Embed)); - exports.Dashboard = Dashboard; - - -/***/ }, -/* 9 */ -/***/ function(module, exports, __webpack_require__) { - - var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var embed_1 = __webpack_require__(2); - /** - * The Power BI tile embed component - * - * @export - * @class Tile - * @extends {Embed} - */ - var Tile = (function (_super) { - __extends(Tile, _super); - function Tile() { - _super.apply(this, arguments); - } - /** - * The ID of the tile - * - * @returns {string} - */ - Tile.prototype.getId = function () { - throw new Error('Not implemented. Embedding tiles is not supported yet.'); - }; - /** - * Validate load configuration. - */ - Tile.prototype.validate = function (config) { - throw new Error('Not implemented. Embedding tiles is not supported yet.'); - }; - Tile.type = "Tile"; - return Tile; - }(embed_1.Embed)); - exports.Tile = Tile; - - -/***/ }, -/* 10 */ -/***/ function(module, exports, __webpack_require__) { - - var config_1 = __webpack_require__(11); - var wpmp = __webpack_require__(12); - var hpm = __webpack_require__(13); - var router = __webpack_require__(14); - exports.hpmFactory = function (wpmp, defaultTargetWindow, sdkVersion, sdkType) { - if (sdkVersion === void 0) { sdkVersion = config_1.default.version; } - if (sdkType === void 0) { sdkType = config_1.default.type; } - return new hpm.HttpPostMessage(wpmp, { - 'x-sdk-type': sdkType, - 'x-sdk-version': sdkVersion - }, defaultTargetWindow); - }; - exports.wpmpFactory = function (name, logMessages, eventSourceOverrideWindow) { - return new wpmp.WindowPostMessageProxy({ - processTrackingProperties: { - addTrackingProperties: hpm.HttpPostMessage.addTrackingProperties, - getTrackingProperties: hpm.HttpPostMessage.getTrackingProperties, - }, - isErrorMessage: hpm.HttpPostMessage.isErrorMessage, - name: name, - logMessages: logMessages, - eventSourceOverrideWindow: eventSourceOverrideWindow - }); - }; - exports.routerFactory = function (wpmp) { - return new router.Router(wpmp); - }; - - -/***/ }, -/* 11 */ -/***/ function(module, exports) { - - var config = { - version: '2.2.7', - type: 'js' - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.default = config; - - -/***/ }, -/* 12 */ -/***/ function(module, exports, __webpack_require__) { - - /*! window-post-message-proxy v0.2.4 | (c) 2016 Microsoft Corporation MIT */ - (function webpackUniversalModuleDefinition(root, factory) { - if(true) - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define([], factory); - else if(typeof exports === 'object') - exports["window-post-message-proxy"] = factory(); - else - root["window-post-message-proxy"] = factory(); - })(this, function() { - return /******/ (function(modules) { // webpackBootstrap - /******/ // The module cache - /******/ var installedModules = {}; - /******/ - /******/ // The require function - /******/ function __webpack_require__(moduleId) { - /******/ - /******/ // Check if module is in cache - /******/ if(installedModules[moduleId]) - /******/ return installedModules[moduleId].exports; - /******/ - /******/ // Create a new module (and put it into the cache) - /******/ var module = installedModules[moduleId] = { - /******/ exports: {}, - /******/ id: moduleId, - /******/ loaded: false - /******/ }; - /******/ - /******/ // Execute the module function - /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); - /******/ - /******/ // Flag the module as loaded - /******/ module.loaded = true; - /******/ - /******/ // Return the exports of the module - /******/ return module.exports; - /******/ } - /******/ - /******/ - /******/ // expose the modules object (__webpack_modules__) - /******/ __webpack_require__.m = modules; - /******/ - /******/ // expose the module cache - /******/ __webpack_require__.c = installedModules; - /******/ - /******/ // __webpack_public_path__ - /******/ __webpack_require__.p = ""; - /******/ - /******/ // Load entry module and return exports - /******/ return __webpack_require__(0); - /******/ }) - /************************************************************************/ - /******/ ([ - /* 0 */ - /***/ function(module, exports) { - - "use strict"; - var WindowPostMessageProxy = (function () { - function WindowPostMessageProxy(options) { - var _this = this; - if (options === void 0) { options = { - processTrackingProperties: { - addTrackingProperties: WindowPostMessageProxy.defaultAddTrackingProperties, - getTrackingProperties: WindowPostMessageProxy.defaultGetTrackingProperties - }, - isErrorMessage: WindowPostMessageProxy.defaultIsErrorMessage, - receiveWindow: window, - name: WindowPostMessageProxy.createRandomString() - }; } - this.pendingRequestPromises = {}; - // save options with defaults - this.addTrackingProperties = (options.processTrackingProperties && options.processTrackingProperties.addTrackingProperties) || WindowPostMessageProxy.defaultAddTrackingProperties; - this.getTrackingProperties = (options.processTrackingProperties && options.processTrackingProperties.getTrackingProperties) || WindowPostMessageProxy.defaultGetTrackingProperties; - this.isErrorMessage = options.isErrorMessage || WindowPostMessageProxy.defaultIsErrorMessage; - this.receiveWindow = options.receiveWindow || window; - this.name = options.name || WindowPostMessageProxy.createRandomString(); - this.logMessages = options.logMessages || false; - this.eventSourceOverrideWindow = options.eventSourceOverrideWindow; - this.suppressWarnings = options.suppressWarnings || false; - if (this.logMessages) { - console.log("new WindowPostMessageProxy created with name: " + this.name + " receiving on window: " + this.receiveWindow.document.title); - } - // Initialize - this.handlers = []; - this.windowMessageHandler = function (event) { return _this.onMessageReceived(event); }; - this.start(); - } - // Static - WindowPostMessageProxy.defaultAddTrackingProperties = function (message, trackingProperties) { - message[WindowPostMessageProxy.messagePropertyName] = trackingProperties; - return message; - }; - WindowPostMessageProxy.defaultGetTrackingProperties = function (message) { - return message[WindowPostMessageProxy.messagePropertyName]; - }; - WindowPostMessageProxy.defaultIsErrorMessage = function (message) { - return !!message.error; - }; - /** - * Utility to create a deferred object. - */ - // TODO: Look to use RSVP library instead of doing this manually. - // From what I searched RSVP would work better because it has .finally and .deferred; however, it doesn't have Typings information. - WindowPostMessageProxy.createDeferred = function () { - var deferred = { - resolve: null, - reject: null, - promise: null - }; - var promise = new Promise(function (resolve, reject) { - deferred.resolve = resolve; - deferred.reject = reject; - }); - deferred.promise = promise; - return deferred; - }; - /** - * Utility to generate random sequence of characters used as tracking id for promises. - */ - WindowPostMessageProxy.createRandomString = function () { - return (Math.random() + 1).toString(36).substring(7); - }; - /** - * Adds handler. - * If the first handler whose test method returns true will handle the message and provide a response. - */ - WindowPostMessageProxy.prototype.addHandler = function (handler) { - this.handlers.push(handler); - }; - /** - * Removes handler. - * The reference must match the original object that was provided when adding the handler. - */ - WindowPostMessageProxy.prototype.removeHandler = function (handler) { - var handlerIndex = this.handlers.indexOf(handler); - if (handlerIndex === -1) { - throw new Error("You attempted to remove a handler but no matching handler was found."); - } - this.handlers.splice(handlerIndex, 1); - }; - /** - * Start listening to message events. - */ - WindowPostMessageProxy.prototype.start = function () { - this.receiveWindow.addEventListener('message', this.windowMessageHandler); - }; - /** - * Stops listening to message events. - */ - WindowPostMessageProxy.prototype.stop = function () { - this.receiveWindow.removeEventListener('message', this.windowMessageHandler); - }; - /** - * Post message to target window with tracking properties added and save deferred object referenced by tracking id. - */ - WindowPostMessageProxy.prototype.postMessage = function (targetWindow, message) { - // Add tracking properties to indicate message came from this proxy - var trackingProperties = { id: WindowPostMessageProxy.createRandomString() }; - this.addTrackingProperties(message, trackingProperties); - if (this.logMessages) { - console.log(this.name + " Posting message:"); - console.log(JSON.stringify(message, null, ' ')); - } - targetWindow.postMessage(message, "*"); - var deferred = WindowPostMessageProxy.createDeferred(); - this.pendingRequestPromises[trackingProperties.id] = deferred; - return deferred.promise; - }; - /** - * Send response message to target window. - * Response messages re-use tracking properties from a previous request message. - */ - WindowPostMessageProxy.prototype.sendResponse = function (targetWindow, message, trackingProperties) { - this.addTrackingProperties(message, trackingProperties); - if (this.logMessages) { - console.log(this.name + " Sending response:"); - console.log(JSON.stringify(message, null, ' ')); - } - targetWindow.postMessage(message, "*"); - }; - /** - * Message handler. - */ - WindowPostMessageProxy.prototype.onMessageReceived = function (event) { - var _this = this; - if (this.logMessages) { - console.log(this.name + " Received message:"); - console.log("type: " + event.type); - console.log(JSON.stringify(event.data, null, ' ')); - } - var sendingWindow = this.eventSourceOverrideWindow || event.source; - var message = event.data; - if (typeof message !== "object") { - if (!this.suppressWarnings) { - console.warn("Proxy(" + this.name + "): Received message that was not an object. Discarding message"); - } - return; - } - var trackingProperties; - try { - trackingProperties = this.getTrackingProperties(message); - } - catch (e) { - if (!this.suppressWarnings) { - console.warn("Proxy(" + this.name + "): Error occurred when attempting to get tracking properties from incoming message:", JSON.stringify(message, null, ' '), "Error: ", e); - } - } - var deferred; - if (trackingProperties) { - deferred = this.pendingRequestPromises[trackingProperties.id]; - } - // If message does not have a known ID, treat it as a request - // Otherwise, treat message as response - if (!deferred) { - var handled = this.handlers.some(function (handler) { - var canMessageBeHandled = false; - try { - canMessageBeHandled = handler.test(message); - } - catch (e) { - if (!_this.suppressWarnings) { - console.warn("Proxy(" + _this.name + "): Error occurred when handler was testing incoming message:", JSON.stringify(message, null, ' '), "Error: ", e); - } - } - if (canMessageBeHandled) { - var responseMessagePromise = void 0; - try { - responseMessagePromise = Promise.resolve(handler.handle(message)); - } - catch (e) { - if (!_this.suppressWarnings) { - console.warn("Proxy(" + _this.name + "): Error occurred when handler was processing incoming message:", JSON.stringify(message, null, ' '), "Error: ", e); - } - responseMessagePromise = Promise.resolve(); - } - responseMessagePromise - .then(function (responseMessage) { - if (!responseMessage) { - var warningMessage = "Handler for message: " + JSON.stringify(message, null, ' ') + " did not return a response message. The default response message will be returned instead."; - if (!_this.suppressWarnings) { - console.warn("Proxy(" + _this.name + "): " + warningMessage); - } - responseMessage = { - warning: warningMessage - }; - } - _this.sendResponse(sendingWindow, responseMessage, trackingProperties); - }); - return true; - } - }); - /** - * TODO: Consider returning an error message if nothing handled the message. - * In the case of the Report receiving messages all of them should be handled, - * however, in the case of the SDK receiving messages it's likely it won't register handlers - * for all events. Perhaps make this an option at construction time. - */ - if (!handled && !this.suppressWarnings) { - console.warn("Proxy(" + this.name + ") did not handle message. Handlers: " + this.handlers.length + " Message: " + JSON.stringify(message, null, '') + "."); - } - } - else { - /** - * If error message reject promise, - * Otherwise, resolve promise - */ - var isErrorMessage = true; - try { - isErrorMessage = this.isErrorMessage(message); - } - catch (e) { - console.warn("Proxy(" + this.name + ") Error occurred when trying to determine if message is consider an error response. Message: ", JSON.stringify(message, null, ''), 'Error: ', e); - } - if (isErrorMessage) { - deferred.reject(message); - } - else { - deferred.resolve(message); - } - // TODO: Move to .finally clause up where promise is created for better maitenance like original proxy code. - delete this.pendingRequestPromises[trackingProperties.id]; - } - }; - WindowPostMessageProxy.messagePropertyName = "windowPostMessageProxy"; - return WindowPostMessageProxy; - }()); - exports.WindowPostMessageProxy = WindowPostMessageProxy; - - - /***/ } - /******/ ]) - }); - ; - //# sourceMappingURL=windowPostMessageProxy.js.map - -/***/ }, -/* 13 */ -/***/ function(module, exports, __webpack_require__) { - - /*! http-post-message v0.2.3 | (c) 2016 Microsoft Corporation MIT */ - (function webpackUniversalModuleDefinition(root, factory) { - if(true) - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define([], factory); - else if(typeof exports === 'object') - exports["http-post-message"] = factory(); - else - root["http-post-message"] = factory(); - })(this, function() { - return /******/ (function(modules) { // webpackBootstrap - /******/ // The module cache - /******/ var installedModules = {}; - /******/ - /******/ // The require function - /******/ function __webpack_require__(moduleId) { - /******/ - /******/ // Check if module is in cache - /******/ if(installedModules[moduleId]) - /******/ return installedModules[moduleId].exports; - /******/ - /******/ // Create a new module (and put it into the cache) - /******/ var module = installedModules[moduleId] = { - /******/ exports: {}, - /******/ id: moduleId, - /******/ loaded: false - /******/ }; - /******/ - /******/ // Execute the module function - /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); - /******/ - /******/ // Flag the module as loaded - /******/ module.loaded = true; - /******/ - /******/ // Return the exports of the module - /******/ return module.exports; - /******/ } - /******/ - /******/ - /******/ // expose the modules object (__webpack_modules__) - /******/ __webpack_require__.m = modules; - /******/ - /******/ // expose the module cache - /******/ __webpack_require__.c = installedModules; - /******/ - /******/ // __webpack_public_path__ - /******/ __webpack_require__.p = ""; - /******/ - /******/ // Load entry module and return exports - /******/ return __webpack_require__(0); - /******/ }) - /************************************************************************/ - /******/ ([ - /* 0 */ - /***/ function(module, exports) { - - "use strict"; - var HttpPostMessage = (function () { - function HttpPostMessage(windowPostMessageProxy, defaultHeaders, defaultTargetWindow) { - if (defaultHeaders === void 0) { defaultHeaders = {}; } - this.defaultHeaders = defaultHeaders; - this.defaultTargetWindow = defaultTargetWindow; - this.windowPostMessageProxy = windowPostMessageProxy; - } - // TODO: See if it's possible to share tracking properties interface? - // The responsibility of knowing how to configure windowPostMessageProxy for http should - // live in this http class, but the configuration would need ITrackingProperties - // interface which lives in WindowPostMessageProxy. Use type as workaround - HttpPostMessage.addTrackingProperties = function (message, trackingProperties) { - message.headers = message.headers || {}; - if (trackingProperties && trackingProperties.id) { - message.headers.id = trackingProperties.id; - } - return message; - }; - HttpPostMessage.getTrackingProperties = function (message) { - return { - id: message.headers && message.headers.id - }; - }; - HttpPostMessage.isErrorMessage = function (message) { - if (typeof (message && message.statusCode) !== 'number') { - return false; - } - return !(200 <= message.statusCode && message.statusCode < 300); - }; - HttpPostMessage.prototype.get = function (url, headers, targetWindow) { - if (headers === void 0) { headers = {}; } - if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; } - return this.send({ - method: "GET", - url: url, - headers: headers - }, targetWindow); - }; - HttpPostMessage.prototype.post = function (url, body, headers, targetWindow) { - if (headers === void 0) { headers = {}; } - if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; } - return this.send({ - method: "POST", - url: url, - headers: headers, - body: body - }, targetWindow); - }; - HttpPostMessage.prototype.put = function (url, body, headers, targetWindow) { - if (headers === void 0) { headers = {}; } - if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; } - return this.send({ - method: "PUT", - url: url, - headers: headers, - body: body - }, targetWindow); - }; - HttpPostMessage.prototype.patch = function (url, body, headers, targetWindow) { - if (headers === void 0) { headers = {}; } - if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; } - return this.send({ - method: "PATCH", - url: url, - headers: headers, - body: body - }, targetWindow); - }; - HttpPostMessage.prototype.delete = function (url, body, headers, targetWindow) { - if (body === void 0) { body = null; } - if (headers === void 0) { headers = {}; } - if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; } - return this.send({ - method: "DELETE", - url: url, - headers: headers, - body: body - }, targetWindow); - }; - HttpPostMessage.prototype.send = function (request, targetWindow) { - if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; } - request.headers = this.assign({}, this.defaultHeaders, request.headers); - if (!targetWindow) { - throw new Error("target window is not provided. You must either provide the target window explicitly as argument to request, or specify default target window when constructing instance of this class."); - } - return this.windowPostMessageProxy.postMessage(targetWindow, request); - }; - /** - * Object.assign() polyfill - * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign - */ - HttpPostMessage.prototype.assign = function (target) { - var sources = []; - for (var _i = 1; _i < arguments.length; _i++) { - sources[_i - 1] = arguments[_i]; - } - if (target === undefined || target === null) { - throw new TypeError('Cannot convert undefined or null to object'); - } - var output = Object(target); - sources.forEach(function (source) { - if (source !== undefined && source !== null) { - for (var nextKey in source) { - if (Object.prototype.hasOwnProperty.call(source, nextKey)) { - output[nextKey] = source[nextKey]; - } - } - } - }); - return output; - }; - return HttpPostMessage; - }()); - exports.HttpPostMessage = HttpPostMessage; - - - /***/ } - /******/ ]) - }); - ; - //# sourceMappingURL=httpPostMessage.js.map - -/***/ }, -/* 14 */ -/***/ function(module, exports, __webpack_require__) { - - /*! powerbi-router v0.1.5 | (c) 2016 Microsoft Corporation MIT */ - (function webpackUniversalModuleDefinition(root, factory) { - if(true) - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define([], factory); - else if(typeof exports === 'object') - exports["powerbi-router"] = factory(); - else - root["powerbi-router"] = factory(); - })(this, function() { - return /******/ (function(modules) { // webpackBootstrap - /******/ // The module cache - /******/ var installedModules = {}; - /******/ - /******/ // The require function - /******/ function __webpack_require__(moduleId) { - /******/ - /******/ // Check if module is in cache - /******/ if(installedModules[moduleId]) - /******/ return installedModules[moduleId].exports; - /******/ - /******/ // Create a new module (and put it into the cache) - /******/ var module = installedModules[moduleId] = { - /******/ exports: {}, - /******/ id: moduleId, - /******/ loaded: false - /******/ }; - /******/ - /******/ // Execute the module function - /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); - /******/ - /******/ // Flag the module as loaded - /******/ module.loaded = true; - /******/ - /******/ // Return the exports of the module - /******/ return module.exports; - /******/ } - /******/ - /******/ - /******/ // expose the modules object (__webpack_modules__) - /******/ __webpack_require__.m = modules; - /******/ - /******/ // expose the module cache - /******/ __webpack_require__.c = installedModules; - /******/ - /******/ // __webpack_public_path__ - /******/ __webpack_require__.p = ""; - /******/ - /******/ // Load entry module and return exports - /******/ return __webpack_require__(0); - /******/ }) - /************************************************************************/ - /******/ ([ - /* 0 */ - /***/ function(module, exports, __webpack_require__) { - - "use strict"; - var RouteRecognizer = __webpack_require__(1); - var Router = (function () { - function Router(handlers) { - this.handlers = handlers; - /** - * TODO: look at generating the router dynamically based on list of supported http methods - * instead of hardcoding the creation of these and the methods. - */ - this.getRouteRecognizer = new RouteRecognizer(); - this.patchRouteRecognizer = new RouteRecognizer(); - this.postRouteRecognizer = new RouteRecognizer(); - this.putRouteRecognizer = new RouteRecognizer(); - this.deleteRouteRecognizer = new RouteRecognizer(); - } - Router.prototype.get = function (url, handler) { - this.registerHandler(this.getRouteRecognizer, "GET", url, handler); - return this; - }; - Router.prototype.patch = function (url, handler) { - this.registerHandler(this.patchRouteRecognizer, "PATCH", url, handler); - return this; - }; - Router.prototype.post = function (url, handler) { - this.registerHandler(this.postRouteRecognizer, "POST", url, handler); - return this; - }; - Router.prototype.put = function (url, handler) { - this.registerHandler(this.putRouteRecognizer, "PUT", url, handler); - return this; - }; - Router.prototype.delete = function (url, handler) { - this.registerHandler(this.deleteRouteRecognizer, "DELETE", url, handler); - return this; - }; - /** - * TODO: This method could use some refactoring. There is conflict of interest between keeping clean separation of test and handle method - * Test method only returns boolean indicating if request can be handled, and handle method has opportunity to modify response and return promise of it. - * In the case of the router with route-recognizer where handlers are associated with routes, this already guarantees that only one handler is selected and makes the test method feel complicated - * Will leave as is an investigate cleaner ways at later time. - */ - Router.prototype.registerHandler = function (routeRecognizer, method, url, handler) { - var routeRecognizerHandler = function (request) { - var response = new Response(); - return Promise.resolve(handler(request, response)) - .then(function (x) { return response; }); - }; - routeRecognizer.add([ - { path: url, handler: routeRecognizerHandler } - ]); - var internalHandler = { - test: function (request) { - if (request.method !== method) { - return false; - } - var matchingRoutes = routeRecognizer.recognize(request.url); - if (matchingRoutes === undefined) { - return false; - } - /** - * Copy parameters from recognized route to the request so they can be used within the handler function - * This isn't ideal because it is side affect which modifies the request instead of strictly testing for true or false - * but I don't see a better place to put this. If we move it between the call to test and the handle it becomes part of the window post message proxy - * even though it's responsibility is related to routing. - */ - var route = matchingRoutes[0]; - request.params = route.params; - request.queryParams = matchingRoutes.queryParams; - request.handler = route.handler; - return true; - }, - handle: function (request) { - return request.handler(request); - } - }; - this.handlers.addHandler(internalHandler); - }; - return Router; - }()); - exports.Router = Router; - var Response = (function () { - function Response() { - this.statusCode = 200; - this.headers = {}; - this.body = null; - } - Response.prototype.send = function (statusCode, body) { - this.statusCode = statusCode; - this.body = body; - }; - return Response; - }()); - exports.Response = Response; - - - /***/ }, - /* 1 */ - /***/ function(module, exports, __webpack_require__) { - - var __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(module) {(function() { - "use strict"; - function $$route$recognizer$dsl$$Target(path, matcher, delegate) { - this.path = path; - this.matcher = matcher; - this.delegate = delegate; - } - - $$route$recognizer$dsl$$Target.prototype = { - to: function(target, callback) { - var delegate = this.delegate; - - if (delegate && delegate.willAddRoute) { - target = delegate.willAddRoute(this.matcher.target, target); - } - - this.matcher.add(this.path, target); - - if (callback) { - if (callback.length === 0) { throw new Error("You must have an argument in the function passed to `to`"); } - this.matcher.addChild(this.path, target, callback, this.delegate); - } - return this; - } - }; - - function $$route$recognizer$dsl$$Matcher(target) { - this.routes = {}; - this.children = {}; - this.target = target; - } - - $$route$recognizer$dsl$$Matcher.prototype = { - add: function(path, handler) { - this.routes[path] = handler; - }, - - addChild: function(path, target, callback, delegate) { - var matcher = new $$route$recognizer$dsl$$Matcher(target); - this.children[path] = matcher; - - var match = $$route$recognizer$dsl$$generateMatch(path, matcher, delegate); - - if (delegate && delegate.contextEntered) { - delegate.contextEntered(target, match); - } - - callback(match); - } - }; - - function $$route$recognizer$dsl$$generateMatch(startingPath, matcher, delegate) { - return function(path, nestedCallback) { - var fullPath = startingPath + path; - - if (nestedCallback) { - nestedCallback($$route$recognizer$dsl$$generateMatch(fullPath, matcher, delegate)); - } else { - return new $$route$recognizer$dsl$$Target(startingPath + path, matcher, delegate); - } - }; - } - - function $$route$recognizer$dsl$$addRoute(routeArray, path, handler) { - var len = 0; - for (var i=0; i z`. For instance, "199" is smaller - // then "200", even though "y" and "z" (which are both 9) are larger than "0" (the value - // of (`b` and `c`). This is because the leading symbol, "2", is larger than the other - // leading symbol, "1". - // The rule is that symbols to the left carry more weight than symbols to the right - // when a number is written out as a string. In the above strings, the leading digit - // represents how many 100's are in the number, and it carries more weight than the middle - // number which represents how many 10's are in the number. - // This system of number magnitude works well for route specificity, too. A route written as - // `a/b/c` will be more specific than `x/y/z` as long as `a` is more specific than - // `x`, irrespective of the other parts. - // Because of this similarity, we assign each type of segment a number value written as a - // string. We can find the specificity of compound routes by concatenating these strings - // together, from left to right. After we have looped through all of the segments, - // we convert the string to a number. - specificity.val = ''; - - for (var i=0; i 2 && key.slice(keyLength -2) === '[]') { - isArray = true; - key = key.slice(0, keyLength - 2); - if(!queryParams[key]) { - queryParams[key] = []; - } - } - value = pair[1] ? $$route$recognizer$$decodeQueryParamPart(pair[1]) : ''; - } - if (isArray) { - queryParams[key].push(value); - } else { - queryParams[key] = value; - } - } - return queryParams; - }, - - recognize: function(path) { - var states = [ this.rootState ], - pathLen, i, l, queryStart, queryParams = {}, - isSlashDropped = false; - - queryStart = path.indexOf('?'); - if (queryStart !== -1) { - var queryString = path.substr(queryStart + 1, path.length); - path = path.substr(0, queryStart); - queryParams = this.parseQueryString(queryString); - } - - path = decodeURI(path); - - if (path.charAt(0) !== "/") { path = "/" + path; } - - pathLen = path.length; - if (pathLen > 1 && path.charAt(pathLen - 1) === "/") { - path = path.substr(0, pathLen - 1); - isSlashDropped = true; - } - - for (i=0; i {\n type: string;\n id: string;\n name: string;\n value: T;\n}\n\nexport interface ICustomEvent extends CustomEvent {\n detail: T;\n}\n\nexport interface IEventHandler {\n (event: ICustomEvent): any;\n}\n\nexport interface IHpmFactory {\n (wpmp: wpmp.WindowPostMessageProxy, targetWindow?: Window, version?: string, type?: string, origin?: string): hpm.HttpPostMessage;\n}\n\nexport interface IWpmpFactory {\n (name?: string, logMessages?: boolean, eventSourceOverrideWindow?: Window): wpmp.WindowPostMessageProxy;\n}\n\nexport interface IRouterFactory {\n (wpmp: wpmp.WindowPostMessageProxy): router.Router;\n}\n\nexport interface IPowerBiElement extends HTMLElement {\n powerBiEmbed: embed.Embed;\n}\n\nexport interface IDebugOptions {\n logMessages?: boolean;\n wpmpName?: string;\n}\n\nexport interface IServiceConfiguration extends IDebugOptions {\n autoEmbedOnContentLoaded?: boolean;\n onError?: (error: any) => any;\n version?: string;\n type?: string;\n}\n\nexport interface IService {\n hpm: hpm.HttpPostMessage;\n}\n\n/**\n * The Power BI Service embed component, which is the entry point to embed all other Power BI components into your application\n * \n * @export\n * @class Service\n * @implements {IService}\n */\nexport class Service implements IService {\n\n /**\n * A list of components that this service can embed\n */\n private static components: (typeof Report | typeof Tile | typeof Dashboard)[] = [\n Tile,\n Report,\n Dashboard\n ];\n\n /**\n * The default configuration for the service\n */\n private static defaultConfig: IServiceConfiguration = {\n autoEmbedOnContentLoaded: false,\n onError: (...args) => console.log(args[0], args.slice(1))\n };\n\n /**\n * Gets or sets the access token as the global fallback token to use when a local token is not provided for a report or tile.\n * \n * @type {string}\n */\n accessToken: string;\n\n /**The Configuration object for the service*/\n private config: IServiceConfiguration;\n\n /** A list of Dashboard, Report and Tile components that have been embedded using this service instance. */\n private embeds: embed.Embed[];\n /** TODO: Look for way to make hpm private without sacraficing ease of maitenance. This should be private but in embed needs to call methods. */\n hpm: hpm.HttpPostMessage;\n /** TODO: Look for way to make wpmp private. This is only public to allow stopping the wpmp in tests */\n wpmp: wpmp.WindowPostMessageProxy;\n private router: router.Router;\n\n /**\n * Creates an instance of a Power BI Service.\n * \n * @param {IHpmFactory} hpmFactory The http post message factory used in the postMessage communication layer\n * @param {IWpmpFactory} wpmpFactory The window post message factory used in the postMessage communication layer\n * @param {IRouterFactory} routerFactory The router factory used in the postMessage communication layer\n * @param {IServiceConfiguration} [config={}]\n */\n constructor(hpmFactory: IHpmFactory, wpmpFactory: IWpmpFactory, routerFactory: IRouterFactory, config: IServiceConfiguration = {}) {\n this.wpmp = wpmpFactory(config.wpmpName, config.logMessages);\n this.hpm = hpmFactory(this.wpmp, null, config.version, config.type);\n this.router = routerFactory(this.wpmp);\n\n /**\n * Adds handler for report events.\n */\n this.router.post(`/reports/:uniqueId/events/:eventName`, (req, res) => {\n const event: IEvent = {\n type: 'report',\n id: req.params.uniqueId,\n name: req.params.eventName,\n value: req.body\n };\n\n this.handleEvent(event);\n });\n this.router.post(`/reports/:uniqueId/pages/:pageName/events/:eventName`, (req, res) => {\n const event: IEvent = {\n type: 'report',\n id: req.params.uniqueId,\n name: req.params.eventName,\n value: req.body\n };\n\n this.handleEvent(event);\n });\n\n this.router.post(`/dashboards/:uniqueId/events/:eventName`, (req, res) => {\n const event: IEvent = {\n type: 'dashboard',\n id: req.params.uniqueId,\n name: req.params.eventName,\n value: req.body\n };\n\n this.handleEvent(event);\n });\n\n this.embeds = [];\n\n // TODO: Change when Object.assign is available.\n this.config = utils.assign({}, Service.defaultConfig, config);\n\n if (this.config.autoEmbedOnContentLoaded) {\n this.enableAutoEmbed();\n }\n }\n\n /**\n * Creates new report\n * @param {HTMLElement} element\n * @param {embed.IEmbedConfiguration} [config={}]\n * @returns {embed.Embed}\n */\n createReport(element: HTMLElement, config: embed.IEmbedConfiguration): embed.Embed {\n config.type = 'create';\n let powerBiElement = element;\n const component = new Create(this, powerBiElement, config);\n powerBiElement.powerBiEmbed = component;\n this.embeds.push(component);\n\n return component;\n }\n\n /**\n * TODO: Add a description here\n * \n * @param {HTMLElement} [container]\n * @param {embed.IEmbedConfiguration} [config=undefined]\n * @returns {embed.Embed[]}\n */\n init(container?: HTMLElement, config: embed.IEmbedConfiguration = undefined): embed.Embed[] {\n container = (container && container instanceof HTMLElement) ? container : document.body;\n\n const elements = Array.prototype.slice.call(container.querySelectorAll(`[${embed.Embed.embedUrlAttribute}]`));\n return elements.map(element => this.embed(element, config));\n }\n\n /**\n * Given a configuration based on an HTML element,\n * if the component has already been created and attached to the element, reuses the component instance and existing iframe,\n * otherwise creates a new component instance.\n * \n * @param {HTMLElement} element\n * @param {embed.IEmbedConfiguration} [config={}]\n * @returns {embed.Embed}\n */\n embed(element: HTMLElement, config: embed.IEmbedConfiguration = {}): embed.Embed {\n let component: embed.Embed;\n let powerBiElement = element;\n\n if (powerBiElement.powerBiEmbed) {\n component = this.embedExisting(powerBiElement, config);\n }\n else {\n component = this.embedNew(powerBiElement, config);\n }\n\n return component;\n }\n\n /**\n * Given a configuration based on a Power BI element, saves the component instance that reference the element for later lookup.\n * \n * @private\n * @param {IPowerBiElement} element\n * @param {embed.IEmbedConfiguration} config\n * @returns {embed.Embed}\n */\n private embedNew(element: IPowerBiElement, config: embed.IEmbedConfiguration): embed.Embed {\n const componentType = config.type || element.getAttribute(embed.Embed.typeAttribute);\n if (!componentType) {\n throw new Error(`Attempted to embed using config ${JSON.stringify(config)} on element ${element.outerHTML}, but could not determine what type of component to embed. You must specify a type in the configuration or as an attribute such as '${embed.Embed.typeAttribute}=\"${Report.type.toLowerCase()}\"'.`);\n }\n\n // Saves the type as part of the configuration so that it can be referenced later at a known location.\n config.type = componentType;\n\n const Component = utils.find(component => componentType === component.type.toLowerCase(), Service.components);\n if (!Component) {\n throw new Error(`Attempted to embed component of type: ${componentType} but did not find any matching component. Please verify the type you specified is intended.`);\n }\n\n const component = new Component(this, element, config);\n element.powerBiEmbed = component;\n this.embeds.push(component);\n\n return component;\n }\n\n /**\n * Given an element that already contains an embed component, load with a new configuration.\n * \n * @private\n * @param {IPowerBiElement} element\n * @param {embed.IEmbedConfiguration} config\n * @returns {embed.Embed}\n */\n private embedExisting(element: IPowerBiElement, config: embed.IEmbedConfiguration): embed.Embed {\n const component = utils.find(x => x.element === element, this.embeds);\n if (!component) {\n throw new Error(`Attempted to embed using config ${JSON.stringify(config)} on element ${element.outerHTML} which already has embedded comopnent associated, but could not find the existing comopnent in the list of active components. This could indicate the embeds list is out of sync with the DOM, or the component is referencing the incorrect HTML element.`);\n }\n\n /**\n * TODO: Dynamic embed type switching could be supported but there is work needed to prepare the service state and DOM cleanup.\n * remove all event handlers from the DOM, then reset the element to initial state which removes iframe, and removes from list of embeds\n * then we can call the embedNew function which would allow setting the proper embedUrl and construction of object based on the new type.\n */\n if (typeof config.type === \"string\" && config.type !== component.config.type) {\n\n /**\n * When loading report after create we want to use existing Iframe to optimize load period\n */\n if(config.type === \"report\" && component.config.type === \"create\") {\n const report = new Report(this, element, config, element.powerBiEmbed.iframe);\n report.load(config);\n element.powerBiEmbed = report;\n this.embeds.push(report);\n\n return report;\n }\n\n throw new Error(`Embedding on an existing element with a different type than the previous embed object is not supported. Attempted to embed using config ${JSON.stringify(config)} on element ${element.outerHTML}, but the existing element contains an embed of type: ${this.config.type} which does not match the new type: ${config.type}`);\n }\n\n component.load(config);\n\n return component;\n }\n\n /**\n * Adds an event handler for DOMContentLoaded, which searches the DOM for elements that have the 'powerbi-embed-url' attribute,\n * and automatically attempts to embed a powerbi component based on information from other powerbi-* attributes.\n *\n * Note: Only runs if `config.autoEmbedOnContentLoaded` is true when the service is created.\n * This handler is typically useful only for applications that are rendered on the server so that all required data is available when the handler is called.\n */\n enableAutoEmbed(): void {\n window.addEventListener('DOMContentLoaded', (event: Event) => this.init(document.body), false);\n }\n\n /**\n * Returns an instance of the component associated with the element.\n * \n * @param {HTMLElement} element\n * @returns {(Report | Tile)}\n */\n get(element: HTMLElement): Report | Tile | Dashboard {\n const powerBiElement = element;\n\n if (!powerBiElement.powerBiEmbed) {\n throw new Error(`You attempted to get an instance of powerbi component associated with element: ${element.outerHTML} but there was no associated instance.`);\n }\n\n return powerBiElement.powerBiEmbed;\n }\n\n /**\n * Finds an embed instance by the name or unique ID that is provided.\n * \n * @param {string} uniqueId\n * @returns {(Report | Tile)}\n */\n find(uniqueId: string): Report | Tile | Dashboard {\n return utils.find(x => x.config.uniqueId === uniqueId, this.embeds);\n }\n\n /**\n * Given an HTML element that has a component embedded within it, removes the component from the list of embedded components, removes the association between the element and the component, and removes the iframe.\n * \n * @param {HTMLElement} element\n * @returns {void}\n */\n reset(element: HTMLElement): void {\n const powerBiElement = element;\n\n if (!powerBiElement.powerBiEmbed) {\n return;\n }\n\n /** Removes the component from an internal list of components. */\n utils.remove(x => x === powerBiElement.powerBiEmbed, this.embeds);\n /** Deletes a property from the HTML element. */\n delete powerBiElement.powerBiEmbed;\n /** Removes the iframe from the element. */\n const iframe = element.querySelector('iframe');\n if (iframe) {\n iframe.remove();\n }\n }\n\n /**\n * Given an event object, finds the embed component with the matching type and ID, and invokes its handleEvent method with the event object.\n * \n * @private\n * @param {IEvent} event\n */\n private handleEvent(event: IEvent): void {\n const embed = utils.find(embed => {\n return (embed.config.uniqueId === event.id);\n }, this.embeds);\n\n if (embed) {\n const value = event.value;\n\n if (event.name === 'pageChanged') {\n const pageKey = 'newPage';\n const page: models.IPage = value[pageKey];\n if (!page) {\n throw new Error(`Page model not found at 'event.value.${pageKey}'.`);\n }\n value[pageKey] = new Page(embed, page.name, page.displayName);\n }\n\n utils.raiseCustomEvent(embed.element, event.name, value);\n }\n }\n}\n\n\n// WEBPACK FOOTER //\n// ./src/service.ts","import * as utils from './util';\r\nimport * as service from './service';\r\nimport * as models from 'powerbi-models';\r\nimport * as hpm from 'http-post-message';\r\n\r\ndeclare global {\r\n interface Document {\r\n // Mozilla Fullscreen\r\n mozCancelFullScreen: Function;\r\n\r\n // Ms Fullscreen\r\n msExitFullscreen: Function;\r\n }\r\n\r\n interface HTMLIFrameElement {\r\n // Mozilla Fullscreen\r\n mozRequestFullScreen: Function;\r\n\r\n // Ms Fullscreen\r\n msRequestFullscreen: Function;\r\n }\r\n}\r\n\r\n// TODO: Re-use ILoadConfiguration interface to prevent duplicating properties.\r\n// Current issue is that they are optional when embedding since they can be specificed as attributes but they are required when loading.\r\n/**\r\n * Configuration settings for Power BI embed components\r\n * \r\n * @export\r\n * @interface IEmbedConfiguration\r\n */\r\nexport interface IEmbedConfiguration {\r\n type?: string;\r\n id?: string;\r\n uniqueId?: string;\r\n embedUrl?: string;\r\n accessToken?: string;\r\n settings?: models.ISettings;\r\n pageName?: string;\r\n filters?: models.IFilter[];\r\n pageView?: models.PageView;\r\n datasetId?: string;\r\n permissions?: models.Permissions;\r\n viewMode?: models.ViewMode;\r\n}\r\n\r\nexport interface IInternalEmbedConfiguration extends models.IReportLoadConfiguration {\r\n uniqueId: string;\r\n type: string;\r\n embedUrl: string;\r\n}\r\n\r\nexport interface IInternalEventHandler {\r\n test(event: service.IEvent): boolean;\r\n handle(event: service.ICustomEvent): void;\r\n}\r\n\r\n/**\r\n * Base class for all Power BI embed components\r\n * \r\n * @export\r\n * @abstract\r\n * @class Embed\r\n */\r\nexport abstract class Embed {\r\n static allowedEvents = [\"loaded\", \"saved\", \"rendered\", \"saveAsTriggered\", \"error\", \"dataSelected\"];\r\n static accessTokenAttribute = 'powerbi-access-token';\r\n static embedUrlAttribute = 'powerbi-embed-url';\r\n static nameAttribute = 'powerbi-name';\r\n static typeAttribute = 'powerbi-type';\r\n static type: string;\r\n\r\n private static defaultSettings: models.ISettings = {\r\n filterPaneEnabled: true\r\n };\r\n\r\n allowedEvents = [];\r\n\r\n /**\r\n * Gets or sets the event handler registered for this embed component.\r\n * \r\n * @type {IInternalEventHandler[]}\r\n */\r\n eventHandlers: IInternalEventHandler[];\r\n\r\n /**\r\n * Gets or sets the Power BI embed service.\r\n * \r\n * @type {service.Service}\r\n */\r\n service: service.Service;\r\n\r\n /**\r\n * Gets or sets the HTML element that contains the Power BI embed component.\r\n * \r\n * @type {HTMLElement}\r\n */\r\n element: HTMLElement;\r\n\r\n /**\r\n * Gets or sets the HTML iframe element that renders the Power BI embed component.\r\n * \r\n * @type {HTMLIFrameElement}\r\n */\r\n iframe: HTMLIFrameElement;\r\n\r\n /**\r\n * Gets or sets the configuration settings for the Power BI embed component.\r\n * \r\n * @type {IInternalEmbedConfiguration}\r\n */\r\n config: IInternalEmbedConfiguration;\r\n\r\n /**\r\n * Gets or sets the configuration settings for creating report.\r\n * \r\n * @type {models.IReportCreateConfiguration}\r\n */\r\n createConfig: models.IReportCreateConfiguration;\r\n\r\n /**\r\n * Url used in the load request.\r\n */\r\n loadPath: string;\r\n\r\n /**\r\n * Type of embed\r\n */\r\n embeType: string;\r\n\r\n /**\r\n * Creates an instance of Embed.\r\n * \r\n * Note: there is circular reference between embeds and the service, because\r\n * the service has a list of all embeds on the host page, and each embed has a reference to the service that created it.\r\n * \r\n * @param {service.Service} service\r\n * @param {HTMLElement} element\r\n * @param {IEmbedConfiguration} config\r\n */\r\n constructor(service: service.Service, element: HTMLElement, config: IEmbedConfiguration, iframe?: HTMLIFrameElement) {\r\n Array.prototype.push.apply(this.allowedEvents, Embed.allowedEvents);\r\n this.eventHandlers = [];\r\n this.service = service;\r\n this.element = element;\r\n this.iframe = iframe;\r\n this.embeType = config.type.toLowerCase();\r\n\r\n this.populateConfig(config);\r\n \r\n if(this.embeType === 'create'){\r\n this.setIframe(false/*set EventListener to call create() on 'load' event*/);\r\n } else {\r\n this.setIframe(true/*set EventListener to call load() on 'load' event*/);\r\n }\r\n }\r\n\r\n /**\r\n * Sends createReport configuration data.\r\n * \r\n * ```javascript\r\n * createReport({\r\n * datasetId: '5dac7a4a-4452-46b3-99f6-a25915e0fe55',\r\n * accessToken: 'eyJ0eXA ... TaE2rTSbmg',\r\n * ```\r\n * \r\n * @param {models.IReportCreateConfiguration} config\r\n * @returns {Promise}\r\n */\r\n createReport(config: models.IReportCreateConfiguration): Promise {\r\n const errors = this.validate(config);\r\n if (errors) {\r\n throw errors;\r\n }\r\n \r\n return this.service.hpm.post(\"/report/create\", config, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n return response.body;\r\n },\r\n response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Saves Report.\r\n * \r\n * @returns {Promise}\r\n */\r\n save(): Promise {\r\n return this.service.hpm.post('/report/save', null, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n return response.body;\r\n })\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * SaveAs Report.\r\n * \r\n * @returns {Promise}\r\n */\r\n saveAs(saveAsParameters: models.ISaveAsParameters): Promise {\r\n return this.service.hpm.post('/report/saveAs', saveAsParameters, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n return response.body;\r\n })\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Sends load configuration data.\r\n * \r\n * ```javascript\r\n * report.load({\r\n * type: 'report',\r\n * id: '5dac7a4a-4452-46b3-99f6-a25915e0fe55',\r\n * accessToken: 'eyJ0eXA ... TaE2rTSbmg',\r\n * settings: {\r\n * navContentPaneEnabled: false\r\n * },\r\n * pageName: \"DefaultPage\",\r\n * filters: [\r\n * {\r\n * ... DefaultReportFilter ...\r\n * }\r\n * ]\r\n * })\r\n * .catch(error => { ... });\r\n * ```\r\n * \r\n * @param {models.ILoadConfiguration} config\r\n * @returns {Promise}\r\n */\r\n load(config: models.IReportLoadConfiguration | models.IDashboardLoadConfiguration): Promise {\r\n const errors = this.validate(config);\r\n if (errors) {\r\n throw errors;\r\n }\r\n\r\n return this.service.hpm.post(this.loadPath, config, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n utils.assign(this.config, config);\r\n return response.body;\r\n },\r\n response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Removes one or more event handlers from the list of handlers.\r\n * If a reference to the existing handle function is specified, remove the specific handler.\r\n * If the handler is not specified, remove all handlers for the event name specified.\r\n * \r\n * ```javascript\r\n * report.off('pageChanged')\r\n * \r\n * or \r\n * \r\n * const logHandler = function (event) {\r\n * console.log(event);\r\n * };\r\n * \r\n * report.off('pageChanged', logHandler);\r\n * ```\r\n * \r\n * @template T\r\n * @param {string} eventName\r\n * @param {service.IEventHandler} [handler]\r\n */\r\n off(eventName: string, handler?: service.IEventHandler): void {\r\n const fakeEvent: service.IEvent = { name: eventName, type: null, id: null, value: null };\r\n if (handler) {\r\n utils.remove(eventHandler => eventHandler.test(fakeEvent) && (eventHandler.handle === handler), this.eventHandlers);\r\n this.element.removeEventListener(eventName, handler);\r\n }\r\n else {\r\n const eventHandlersToRemove = this.eventHandlers\r\n .filter(eventHandler => eventHandler.test(fakeEvent));\r\n\r\n eventHandlersToRemove\r\n .forEach(eventHandlerToRemove => {\r\n utils.remove(eventHandler => eventHandler === eventHandlerToRemove, this.eventHandlers);\r\n this.element.removeEventListener(eventName, eventHandlerToRemove.handle);\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Adds an event handler for a specific event.\r\n * \r\n * ```javascript\r\n * report.on('pageChanged', (event) => {\r\n * console.log('PageChanged: ', event.page.name);\r\n * });\r\n * ```\r\n * \r\n * @template T\r\n * @param {string} eventName\r\n * @param {service.IEventHandler} handler\r\n */\r\n on(eventName: string, handler: service.IEventHandler): void {\r\n if (this.allowedEvents.indexOf(eventName) === -1) {\r\n throw new Error(`eventName is must be one of ${this.allowedEvents}. You passed: ${eventName}`);\r\n }\r\n\r\n this.eventHandlers.push({\r\n test: (event: service.IEvent) => event.name === eventName,\r\n handle: handler\r\n });\r\n\r\n this.element.addEventListener(eventName, handler)\r\n }\r\n\r\n /**\r\n * Reloads embed using existing configuration.\r\n * E.g. For reports this effectively clears all filters and makes the first page active which simulates resetting a report back to loaded state.\r\n * \r\n * ```javascript\r\n * report.reload();\r\n * ```\r\n */\r\n reload(): Promise {\r\n return this.load(this.config);\r\n }\r\n \r\n /**\r\n * Set accessToken.\r\n * \r\n * @returns {Promise}\r\n */\r\n setAccessToken(accessToken: string): Promise {\r\n return this.service.hpm.post('/report/token', accessToken, { uid: this.config.uniqueId }, this.iframe.contentWindow)\r\n .then(response => {\r\n return response.body;\r\n })\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n \r\n /**\r\n * Gets an access token from the first available location: config, attribute, global.\r\n * \r\n * @private\r\n * @param {string} globalAccessToken\r\n * @returns {string}\r\n */\r\n private getAccessToken(globalAccessToken: string): string {\r\n const accessToken = this.config.accessToken || this.element.getAttribute(Embed.accessTokenAttribute) || globalAccessToken;\r\n\r\n if (!accessToken) {\r\n throw new Error(`No access token was found for element. You must specify an access token directly on the element using attribute '${Embed.accessTokenAttribute}' or specify a global token at: powerbi.accessToken.`);\r\n }\r\n\r\n return accessToken;\r\n }\r\n\r\n /**\r\n * Populate config for create and load\r\n * \r\n * @private\r\n * @param {IEmbedConfiguration}\r\n * @returns {void}\r\n */\r\n private populateConfig(config: IEmbedConfiguration): void {\r\n // TODO: Change when Object.assign is available.\r\n const settings = utils.assign({}, Embed.defaultSettings, config.settings);\r\n this.config = utils.assign({ settings }, config);\r\n this.config.uniqueId = this.getUniqueId();\r\n this.config.embedUrl = this.getEmbedUrl();\r\n\r\n if(this.embeType === 'create') {\r\n this.createConfig = {\r\n datasetId: config.datasetId || this.getId(),\r\n accessToken: this.getAccessToken(this.service.accessToken),\r\n settings: settings\r\n }\r\n } else {\r\n this.config.id = this.getId();\r\n this.config.accessToken = this.getAccessToken(this.service.accessToken);\r\n } \r\n }\r\n\r\n\r\n /**\r\n * Gets an embed url from the first available location: options, attribute.\r\n * \r\n * @private\r\n * @returns {string}\r\n */\r\n private getEmbedUrl(): string {\r\n const embedUrl = this.config.embedUrl || this.element.getAttribute(Embed.embedUrlAttribute);\r\n\r\n if (typeof embedUrl !== 'string' || embedUrl.length === 0) {\r\n throw new Error(`Embed Url is required, but it was not found. You must provide an embed url either as part of embed configuration or as attribute '${Embed.embedUrlAttribute}'.`);\r\n }\r\n\r\n return embedUrl;\r\n }\r\n\r\n /**\r\n * Gets a unique ID from the first available location: options, attribute.\r\n * If neither is provided generate a unique string.\r\n * \r\n * @private\r\n * @returns {string}\r\n */\r\n private getUniqueId(): string {\r\n return this.config.uniqueId || this.element.getAttribute(Embed.nameAttribute) || utils.createRandomString();\r\n }\r\n\r\n /**\r\n * Gets the report ID from the first available location: options, attribute.\r\n * \r\n * @abstract\r\n * @returns {string}\r\n */\r\n abstract getId(): string;\r\n\r\n /**\r\n * Requests the browser to render the component's iframe in fullscreen mode.\r\n */\r\n fullscreen(): void {\r\n const requestFullScreen = this.iframe.requestFullscreen || this.iframe.msRequestFullscreen || this.iframe.mozRequestFullScreen || this.iframe.webkitRequestFullscreen;\r\n requestFullScreen.call(this.iframe);\r\n }\r\n\r\n /**\r\n * Requests the browser to exit fullscreen mode.\r\n */\r\n exitFullscreen(): void {\r\n if (!this.isFullscreen(this.iframe)) {\r\n return;\r\n }\r\n\r\n const exitFullscreen = document.exitFullscreen || document.mozCancelFullScreen || document.webkitExitFullscreen || document.msExitFullscreen;\r\n exitFullscreen.call(document);\r\n }\r\n\r\n /**\r\n * Returns true if the iframe is rendered in fullscreen mode,\r\n * otherwise returns false.\r\n * \r\n * @private\r\n * @param {HTMLIFrameElement} iframe\r\n * @returns {boolean}\r\n */\r\n private isFullscreen(iframe: HTMLIFrameElement): boolean {\r\n const options = ['fullscreenElement', 'webkitFullscreenElement', 'mozFullscreenScreenElement', 'msFullscreenElement'];\r\n\r\n return options.some(option => document[option] === iframe);\r\n }\r\n \r\n /**\r\n * Validate load and create configuration.\r\n */\r\n abstract validate(config: models.IReportLoadConfiguration | models.IDashboardLoadConfiguration | models.IReportCreateConfiguration): models.IError[];\r\n\r\n /**\r\n * Sets Iframe for embed\r\n */\r\n private setIframe(isLoad: boolean): void {\r\n if(!this.iframe) {\r\n const iframeHtml = ``;\r\n this.element.innerHTML = iframeHtml;\r\n this.iframe = this.element.childNodes[0];\r\n }\r\n\r\n if(isLoad){\r\n this.iframe.addEventListener('load', () => this.load(this.config), false);\r\n } else {\r\n this.iframe.addEventListener('load', () => this.createReport(this.createConfig), false);\r\n }\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/embed.ts","\r\n/**\r\n * Raises a custom event with event data on the specified HTML element.\r\n * \r\n * @export\r\n * @param {HTMLElement} element\r\n * @param {string} eventName\r\n * @param {*} eventData\r\n */\r\nexport function raiseCustomEvent(element: HTMLElement, eventName: string, eventData: any): void {\r\n let customEvent;\r\n if (typeof CustomEvent === 'function') {\r\n customEvent = new CustomEvent(eventName, {\r\n detail: eventData,\r\n bubbles: true,\r\n cancelable: true\r\n });\r\n } else {\r\n customEvent = document.createEvent('CustomEvent');\r\n customEvent.initCustomEvent(eventName, true, true, eventData);\r\n }\r\n\r\n element.dispatchEvent(customEvent);\r\n}\r\n\r\n/**\r\n * Finds the index of the first value in an array that matches the specified predicate.\r\n * \r\n * @export\r\n * @template T\r\n * @param {(x: T) => boolean} predicate\r\n * @param {T[]} xs\r\n * @returns {number}\r\n */\r\nexport function findIndex(predicate: (x: T) => boolean, xs: T[]): number {\r\n if (!Array.isArray(xs)) {\r\n throw new Error(`You attempted to call find with second parameter that was not an array. You passed: ${xs}`);\r\n }\r\n\r\n let index;\r\n xs.some((x, i) => {\r\n if (predicate(x)) {\r\n index = i;\r\n return true;\r\n }\r\n });\r\n\r\n return index;\r\n}\r\n\r\n/**\r\n * Finds the first value in an array that matches the specified predicate.\r\n * \r\n * @export\r\n * @template T\r\n * @param {(x: T) => boolean} predicate\r\n * @param {T[]} xs\r\n * @returns {T}\r\n */\r\nexport function find(predicate: (x: T) => boolean, xs: T[]): T {\r\n const index = findIndex(predicate, xs);\r\n return xs[index];\r\n}\r\n\r\nexport function remove(predicate: (x: T) => boolean, xs: T[]): void {\r\n const index = findIndex(predicate, xs);\r\n xs.splice(index, 1);\r\n}\r\n\r\n// See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\r\n// TODO: replace in favor of using polyfill\r\n/**\r\n * Copies the values of all enumerable properties from one or more source objects to a target object, and returns the target object.\r\n * \r\n * @export\r\n * @param {any} args\r\n * @returns\r\n */\r\nexport function assign(...args) {\r\n var target = args[0];\r\n\r\n 'use strict';\r\n if (target === undefined || target === null) {\r\n throw new TypeError('Cannot convert undefined or null to object');\r\n }\r\n\r\n var output = Object(target);\r\n for (var index = 1; index < arguments.length; index++) {\r\n var source = arguments[index];\r\n if (source !== undefined && source !== null) {\r\n for (var nextKey in source) {\r\n if (source.hasOwnProperty(nextKey)) {\r\n output[nextKey] = source[nextKey];\r\n }\r\n }\r\n }\r\n }\r\n return output;\r\n}\r\n\r\n/**\r\n * Generates a random 7 character string.\r\n * \r\n * @export\r\n * @returns {string}\r\n */\r\nexport function createRandomString(): string {\r\n return (Math.random() + 1).toString(36).substring(7);\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/util.ts","import * as service from './service';\nimport * as embed from './embed';\nimport * as models from 'powerbi-models';\nimport * as wpmp from 'window-post-message-proxy';\nimport * as hpm from 'http-post-message';\nimport * as utils from './util';\nimport { IFilterable } from './ifilterable';\nimport { IPageNode, Page } from './page';\n\n/**\n * A Report node within a report hierarchy\n * \n * @export\n * @interface IReportNode\n */\nexport interface IReportNode {\n iframe: HTMLIFrameElement;\n service: service.IService;\n config: embed.IInternalEmbedConfiguration\n}\n\n/**\n * The Power BI Report embed component\n * \n * @export\n * @class Report\n * @extends {embed.Embed}\n * @implements {IReportNode}\n * @implements {IFilterable}\n */\nexport class Report extends embed.Embed implements IReportNode, IFilterable {\n static allowedEvents = [\"filtersApplied\", \"pageChanged\"];\n static reportIdAttribute = 'powerbi-report-id';\n static filterPaneEnabledAttribute = 'powerbi-settings-filter-pane-enabled';\n static navContentPaneEnabledAttribute = 'powerbi-settings-nav-content-pane-enabled';\n static typeAttribute = 'powerbi-type';\n static type = \"Report\";\n\n /**\n * Creates an instance of a Power BI Report.\n * \n * @param {service.Service} service\n * @param {HTMLElement} element\n * @param {embed.IEmbedConfiguration} config\n */\n constructor(service: service.Service, element: HTMLElement, config: embed.IEmbedConfiguration, iframe?: HTMLIFrameElement) {\n const filterPaneEnabled = (config.settings && config.settings.filterPaneEnabled) || !(element.getAttribute(Report.filterPaneEnabledAttribute) === \"false\");\n const navContentPaneEnabled = (config.settings && config.settings.navContentPaneEnabled) || !(element.getAttribute(Report.navContentPaneEnabledAttribute) === \"false\");\n const settings = utils.assign({\n filterPaneEnabled,\n navContentPaneEnabled\n }, config.settings);\n const configCopy = utils.assign({ settings }, config);\n\n super(service, element, configCopy, iframe);\n this.loadPath = \"/report/load\";\n Array.prototype.push.apply(this.allowedEvents, Report.allowedEvents);\n }\n\n /**\n * Adds backwards compatibility for the previous load configuration, which used the reportId query parameter to specify the report ID\n * (e.g. http://embedded.powerbi.com/appTokenReportEmbed?reportId=854846ed-2106-4dc2-bc58-eb77533bf2f1).\n * \n * By extracting the ID we can ensure that the ID is always explicitly provided as part of the load configuration.\n * \n * @static\n * @param {string} url\n * @returns {string}\n */\n static findIdFromEmbedUrl(url: string): string {\n const reportIdRegEx = /reportId=\"?([^&]+)\"?/\n const reportIdMatch = url.match(reportIdRegEx);\n\n let reportId;\n if (reportIdMatch) {\n reportId = reportIdMatch[1];\n }\n\n return reportId;\n }\n\n /**\n * Gets filters that are applied at the report level.\n * \n * ```javascript\n * // Get filters applied at report level\n * report.getFilters()\n * .then(filters => {\n * ...\n * });\n * ```\n * \n * @returns {Promise}\n */\n getFilters(): Promise {\n return this.service.hpm.get(`/report/filters`, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .then(response => response.body,\n response => {\n throw response.body;\n });\n }\n\n /**\n * Gets the report ID from the first available location: options, attribute, embed url.\n * \n * @returns {string}\n */\n getId(): string {\n const reportId = this.config.id || this.element.getAttribute(Report.reportIdAttribute) || Report.findIdFromEmbedUrl(this.config.embedUrl);\n\n if (typeof reportId !== 'string' || reportId.length === 0) {\n throw new Error(`Report id is required, but it was not found. You must provide an id either as part of embed configuration or as attribute '${Report.reportIdAttribute}'.`);\n }\n\n return reportId;\n }\n\n /**\n * Gets the list of pages within the report.\n * \n * ```javascript\n * report.getPages()\n * .then(pages => {\n * ...\n * });\n * ```\n * \n * @returns {Promise}\n */\n getPages(): Promise {\n return this.service.hpm.get('/report/pages', { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .then(response => {\n return response.body\n .map(page => {\n return new Page(this, page.name, page.displayName);\n });\n }, response => {\n throw response.body;\n });\n }\n\n /**\n * Creates an instance of a Page.\n * \n * Normally you would get Page objects by calling `report.getPages()`, but in the case\n * that the page name is known and you want to perform an action on a page without having to retrieve it\n * you can create it directly.\n * \n * Note: Because you are creating the page manually there is no guarantee that the page actually exists in the report, and subsequent requests could fail.\n * \n * ```javascript\n * const page = report.page('ReportSection1');\n * page.setActive();\n * ```\n * \n * @param {string} name\n * @param {string} [displayName]\n * @returns {Page}\n */\n page(name: string, displayName?: string): Page {\n return new Page(this, name, displayName);\n }\n\n /**\n * Prints the active page of the report by invoking `window.print()` on the embed iframe component.\n */\n print(): Promise {\n return this.service.hpm.post('/report/print', null, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .then(response => {\n return response.body;\n })\n .catch(response => {\n throw response.body;\n });\n }\n\n /**\n * Removes all filters at the report level.\n * \n * ```javascript\n * report.removeFilters();\n * ```\n * \n * @returns {Promise}\n */\n removeFilters(): Promise {\n return this.setFilters([]);\n }\n\n /**\n * Sets the active page of the report.\n * \n * ```javascript\n * report.setPage(\"page2\")\n * .catch(error => { ... });\n * ```\n * \n * @param {string} pageName\n * @returns {Promise}\n */\n setPage(pageName: string): Promise {\n const page: models.IPage = {\n name: pageName,\n displayName: null\n };\n\n return this.service.hpm.put('/report/pages/active', page, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .catch(response => {\n throw response.body;\n });\n }\n\n /**\n * Sets filters at the report level.\n * \n * ```javascript\n * const filters: [\n * ...\n * ];\n * \n * report.setFilters(filters)\n * .catch(errors => {\n * ...\n * });\n * ```\n * \n * @param {(models.IFilter[])} filters\n * @returns {Promise}\n */\n setFilters(filters: models.IFilter[]): Promise {\n return this.service.hpm.put(`/report/filters`, filters, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .catch(response => {\n throw response.body;\n });\n }\n\n /**\n * Updates visibility settings for the filter pane and the page navigation pane.\n * \n * ```javascript\n * const newSettings = {\n * navContentPaneEnabled: true,\n * filterPaneEnabled: false\n * };\n * \n * report.updateSettings(newSettings)\n * .catch(error => { ... });\n * ```\n * \n * @param {models.ISettings} settings\n * @returns {Promise}\n */\n updateSettings(settings: models.ISettings): Promise {\n return this.service.hpm.patch('/report/settings', settings, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .catch(response => {\n throw response.body;\n });\n }\n\n /**\n * Validate load configuration.\n */\n validate(config: models.IReportLoadConfiguration): models.IError[] {\n return models.validateReportLoad(config);\n }\n\n /**\n * Switch Report view mode.\n * \n * @returns {Promise}\n */\n switchMode(viewMode: models.ViewMode): Promise {\n let url = '/report/switchMode/' + viewMode;\n return this.service.hpm.post(url, null, { uid: this.config.uniqueId }, this.iframe.contentWindow)\n .then(response => {\n return response.body;\n })\n .catch(response => {\n throw response.body;\n });\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/report.ts","/*! powerbi-models v0.11.1 | (c) 2016 Microsoft Corporation MIT */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"powerbi-models\"] = factory();\n\telse\n\t\troot[\"powerbi-models\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __extends = (this && this.__extends) || function (d, b) {\n\t for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n\t function __() { this.constructor = d; }\n\t d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n\t};\n\t/* tslint:disable:no-var-requires */\n\texports.advancedFilterSchema = __webpack_require__(1);\n\texports.filterSchema = __webpack_require__(2);\n\texports.loadSchema = __webpack_require__(3);\n\texports.dashboardLoadSchema = __webpack_require__(4);\n\texports.pageSchema = __webpack_require__(5);\n\texports.settingsSchema = __webpack_require__(6);\n\texports.basicFilterSchema = __webpack_require__(7);\n\texports.createReportSchema = __webpack_require__(8);\n\texports.saveAsParametersSchema = __webpack_require__(9);\n\t/* tslint:enable:no-var-requires */\n\tvar jsen = __webpack_require__(10);\n\tfunction normalizeError(error) {\n\t var message = error.message;\n\t if (!message) {\n\t message = error.path + \" is invalid. Not meeting \" + error.keyword + \" constraint\";\n\t }\n\t return {\n\t message: message\n\t };\n\t}\n\t/**\n\t * Takes in schema and returns function which can be used to validate the schema with better semantics around exposing errors\n\t */\n\tfunction validate(schema, options) {\n\t return function (x) {\n\t var validate = jsen(schema, options);\n\t var isValid = validate(x);\n\t if (isValid) {\n\t return undefined;\n\t }\n\t else {\n\t return validate.errors\n\t .map(normalizeError);\n\t }\n\t };\n\t}\n\texports.validateSettings = validate(exports.settingsSchema, {\n\t schemas: {\n\t basicFilter: exports.basicFilterSchema,\n\t advancedFilter: exports.advancedFilterSchema\n\t }\n\t});\n\texports.validateReportLoad = validate(exports.loadSchema, {\n\t schemas: {\n\t settings: exports.settingsSchema,\n\t basicFilter: exports.basicFilterSchema,\n\t advancedFilter: exports.advancedFilterSchema\n\t }\n\t});\n\texports.validateCreateReport = validate(exports.createReportSchema);\n\texports.validateDashboardLoad = validate(exports.dashboardLoadSchema);\n\texports.validatePage = validate(exports.pageSchema);\n\texports.validateFilter = validate(exports.filterSchema, {\n\t schemas: {\n\t basicFilter: exports.basicFilterSchema,\n\t advancedFilter: exports.advancedFilterSchema\n\t }\n\t});\n\t(function (FilterType) {\n\t FilterType[FilterType[\"Advanced\"] = 0] = \"Advanced\";\n\t FilterType[FilterType[\"Basic\"] = 1] = \"Basic\";\n\t FilterType[FilterType[\"Unknown\"] = 2] = \"Unknown\";\n\t})(exports.FilterType || (exports.FilterType = {}));\n\tvar FilterType = exports.FilterType;\n\tfunction isFilterKeyColumnsTarget(target) {\n\t return isColumn(target) && !!target.keys;\n\t}\n\texports.isFilterKeyColumnsTarget = isFilterKeyColumnsTarget;\n\tfunction isBasicFilterWithKeys(filter) {\n\t return getFilterType(filter) === FilterType.Basic && !!filter.keyValues;\n\t}\n\texports.isBasicFilterWithKeys = isBasicFilterWithKeys;\n\tfunction getFilterType(filter) {\n\t var basicFilter = filter;\n\t var advancedFilter = filter;\n\t if ((typeof basicFilter.operator === \"string\")\n\t && (Array.isArray(basicFilter.values))) {\n\t return FilterType.Basic;\n\t }\n\t else if ((typeof advancedFilter.logicalOperator === \"string\")\n\t && (Array.isArray(advancedFilter.conditions))) {\n\t return FilterType.Advanced;\n\t }\n\t else {\n\t return FilterType.Unknown;\n\t }\n\t}\n\texports.getFilterType = getFilterType;\n\tfunction isMeasure(arg) {\n\t return arg.table !== undefined && arg.measure !== undefined;\n\t}\n\texports.isMeasure = isMeasure;\n\tfunction isColumn(arg) {\n\t return arg.table !== undefined && arg.column !== undefined;\n\t}\n\texports.isColumn = isColumn;\n\tfunction isHierarchy(arg) {\n\t return arg.table !== undefined && arg.hierarchy !== undefined && arg.hierarchyLevel !== undefined;\n\t}\n\texports.isHierarchy = isHierarchy;\n\tvar Filter = (function () {\n\t function Filter(target) {\n\t this.target = target;\n\t }\n\t Filter.prototype.toJSON = function () {\n\t return {\n\t $schema: this.schemaUrl,\n\t target: this.target\n\t };\n\t };\n\t ;\n\t return Filter;\n\t}());\n\texports.Filter = Filter;\n\tvar BasicFilter = (function (_super) {\n\t __extends(BasicFilter, _super);\n\t function BasicFilter(target, operator) {\n\t var values = [];\n\t for (var _i = 2; _i < arguments.length; _i++) {\n\t values[_i - 2] = arguments[_i];\n\t }\n\t _super.call(this, target);\n\t this.operator = operator;\n\t this.schemaUrl = BasicFilter.schemaUrl;\n\t if (values.length === 0 && operator !== \"All\") {\n\t throw new Error(\"values must be a non-empty array unless your operator is \\\"All\\\".\");\n\t }\n\t /**\n\t * Accept values as array instead of as individual arguments\n\t * new BasicFilter('a', 'b', 1, 2);\n\t * new BasicFilter('a', 'b', [1,2]);\n\t */\n\t if (Array.isArray(values[0])) {\n\t this.values = values[0];\n\t }\n\t else {\n\t this.values = values;\n\t }\n\t }\n\t BasicFilter.prototype.toJSON = function () {\n\t var filter = _super.prototype.toJSON.call(this);\n\t filter.operator = this.operator;\n\t filter.values = this.values;\n\t return filter;\n\t };\n\t BasicFilter.schemaUrl = \"http://powerbi.com/product/schema#basic\";\n\t return BasicFilter;\n\t}(Filter));\n\texports.BasicFilter = BasicFilter;\n\tvar BasicFilterWithKeys = (function (_super) {\n\t __extends(BasicFilterWithKeys, _super);\n\t function BasicFilterWithKeys(target, operator, values, keyValues) {\n\t _super.call(this, target, operator, values);\n\t this.keyValues = keyValues;\n\t this.target = target;\n\t var numberOfKeys = target.keys ? target.keys.length : 0;\n\t if (numberOfKeys > 0 && !keyValues) {\n\t throw new Error(\"You shold pass the values to be filtered for each key. You passed: no values and \" + numberOfKeys + \" keys\");\n\t }\n\t if (numberOfKeys === 0 && keyValues && keyValues.length > 0) {\n\t throw new Error(\"You passed key values but your target object doesn't contain the keys to be filtered\");\n\t }\n\t for (var i = 0; i < this.keyValues.length; i++) {\n\t if (this.keyValues[i]) {\n\t var lengthOfArray = this.keyValues[i].length;\n\t if (lengthOfArray !== numberOfKeys) {\n\t throw new Error(\"Each tuple of key values should contain a value for each of the keys. You passed: \" + lengthOfArray + \" values and \" + numberOfKeys + \" keys\");\n\t }\n\t }\n\t }\n\t }\n\t BasicFilterWithKeys.prototype.toJSON = function () {\n\t var filter = _super.prototype.toJSON.call(this);\n\t filter.keyValues = this.keyValues;\n\t return filter;\n\t };\n\t return BasicFilterWithKeys;\n\t}(BasicFilter));\n\texports.BasicFilterWithKeys = BasicFilterWithKeys;\n\tvar AdvancedFilter = (function (_super) {\n\t __extends(AdvancedFilter, _super);\n\t function AdvancedFilter(target, logicalOperator) {\n\t var conditions = [];\n\t for (var _i = 2; _i < arguments.length; _i++) {\n\t conditions[_i - 2] = arguments[_i];\n\t }\n\t _super.call(this, target);\n\t this.schemaUrl = AdvancedFilter.schemaUrl;\n\t // Guard statements\n\t if (typeof logicalOperator !== \"string\" || logicalOperator.length === 0) {\n\t // TODO: It would be nicer to list out the possible logical operators.\n\t throw new Error(\"logicalOperator must be a valid operator, You passed: \" + logicalOperator);\n\t }\n\t this.logicalOperator = logicalOperator;\n\t var extractedConditions;\n\t /**\n\t * Accept conditions as array instead of as individual arguments\n\t * new AdvancedFilter('a', 'b', \"And\", { value: 1, operator: \"Equals\" }, { value: 2, operator: \"IsGreaterThan\" });\n\t * new AdvancedFilter('a', 'b', \"And\", [{ value: 1, operator: \"Equals\" }, { value: 2, operator: \"IsGreaterThan\" }]);\n\t */\n\t if (Array.isArray(conditions[0])) {\n\t extractedConditions = conditions[0];\n\t }\n\t else {\n\t extractedConditions = conditions;\n\t }\n\t if (extractedConditions.length === 0) {\n\t throw new Error(\"conditions must be a non-empty array. You passed: \" + conditions);\n\t }\n\t if (extractedConditions.length > 2) {\n\t throw new Error(\"AdvancedFilters may not have more than two conditions. You passed: \" + conditions.length);\n\t }\n\t if (extractedConditions.length === 1 && logicalOperator !== \"And\") {\n\t throw new Error(\"Logical Operator must be \\\"And\\\" when there is only one condition provided\");\n\t }\n\t this.conditions = extractedConditions;\n\t }\n\t AdvancedFilter.prototype.toJSON = function () {\n\t var filter = _super.prototype.toJSON.call(this);\n\t filter.logicalOperator = this.logicalOperator;\n\t filter.conditions = this.conditions;\n\t return filter;\n\t };\n\t AdvancedFilter.schemaUrl = \"http://powerbi.com/product/schema#advanced\";\n\t return AdvancedFilter;\n\t}(Filter));\n\texports.AdvancedFilter = AdvancedFilter;\n\t(function (Permissions) {\n\t Permissions[Permissions[\"Read\"] = 0] = \"Read\";\n\t Permissions[Permissions[\"ReadWrite\"] = 1] = \"ReadWrite\";\n\t Permissions[Permissions[\"Copy\"] = 2] = \"Copy\";\n\t Permissions[Permissions[\"Create\"] = 4] = \"Create\";\n\t Permissions[Permissions[\"All\"] = 7] = \"All\";\n\t})(exports.Permissions || (exports.Permissions = {}));\n\tvar Permissions = exports.Permissions;\n\t(function (ViewMode) {\n\t ViewMode[ViewMode[\"View\"] = 0] = \"View\";\n\t ViewMode[ViewMode[\"Edit\"] = 1] = \"Edit\";\n\t})(exports.ViewMode || (exports.ViewMode = {}));\n\tvar ViewMode = exports.ViewMode;\n\texports.validateSaveAsParameters = validate(exports.saveAsParametersSchema);\n\n\n/***/ },\n/* 1 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"target\": {\n\t\t\t\t\"oneOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\t\"table\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"column\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"required\": [\n\t\t\t\t\t\t\t\"table\",\n\t\t\t\t\t\t\t\"column\"\n\t\t\t\t\t\t]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\t\"table\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"hierarchy\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"hierarchyLevel\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"required\": [\n\t\t\t\t\t\t\t\"table\",\n\t\t\t\t\t\t\t\"hierarchy\",\n\t\t\t\t\t\t\t\"hierarchyLevel\"\n\t\t\t\t\t\t]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\t\"table\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"measure\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"required\": [\n\t\t\t\t\t\t\t\"table\",\n\t\t\t\t\t\t\t\"measure\"\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"logicalOperator\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"conditions\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\"value\": {\n\t\t\t\t\t\t\t\"type\": [\n\t\t\t\t\t\t\t\t\"string\",\n\t\t\t\t\t\t\t\t\"boolean\",\n\t\t\t\t\t\t\t\t\"number\"\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"operator\": {\n\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\"required\": [\n\t\t\t\t\t\t\"value\",\n\t\t\t\t\t\t\"operator\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"target\",\n\t\t\t\"logicalOperator\",\n\t\t\t\"conditions\"\n\t\t]\n\t};\n\n/***/ },\n/* 2 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"oneOf\": [\n\t\t\t{\n\t\t\t\t\"$ref\": \"#basicFilter\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"$ref\": \"#advancedFilter\"\n\t\t\t}\n\t\t],\n\t\t\"invalidMessage\": \"filter is invalid\"\n\t};\n\n/***/ },\n/* 3 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"accessToken\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"accessToken must be a string\",\n\t\t\t\t\t\"required\": \"accessToken is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"id\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"id must be a string\",\n\t\t\t\t\t\"required\": \"id is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"settings\": {\n\t\t\t\t\"$ref\": \"#settings\"\n\t\t\t},\n\t\t\t\"pageName\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"pageName must be a string\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"filters\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\"oneOf\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"$ref\": \"#basicFilter\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"$ref\": \"#advancedFilter\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t\"invalidMessage\": \"filters property is invalid\"\n\t\t\t},\n\t\t\t\"permissions\": {\n\t\t\t\t\"type\": \"number\",\n\t\t\t\t\"enum\": [\n\t\t\t\t\t0,\n\t\t\t\t\t1,\n\t\t\t\t\t2,\n\t\t\t\t\t4,\n\t\t\t\t\t7\n\t\t\t\t],\n\t\t\t\t\"default\": 0,\n\t\t\t\t\"invalidMessage\": \"permissions property is invalid\"\n\t\t\t},\n\t\t\t\"viewMode\": {\n\t\t\t\t\"type\": \"number\",\n\t\t\t\t\"enum\": [\n\t\t\t\t\t0,\n\t\t\t\t\t1\n\t\t\t\t],\n\t\t\t\t\"default\": 0,\n\t\t\t\t\"invalidMessage\": \"viewMode property is invalid\"\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"accessToken\",\n\t\t\t\"id\"\n\t\t]\n\t};\n\n/***/ },\n/* 4 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"accessToken\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"accessToken must be a string\",\n\t\t\t\t\t\"required\": \"accessToken is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"id\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"id must be a string\",\n\t\t\t\t\t\"required\": \"id is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"pageView\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"pageView must be a string with one of the following values: \\\"actualSize\\\", \\\"fitToWidth\\\", \\\"oneColumn\\\"\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"accessToken\",\n\t\t\t\"id\"\n\t\t]\n\t};\n\n/***/ },\n/* 5 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"name\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"name must be a string\",\n\t\t\t\t\t\"required\": \"name is required\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"name\"\n\t\t]\n\t};\n\n/***/ },\n/* 6 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"filterPaneEnabled\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"filterPaneEnabled must be a boolean\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"navContentPaneEnabled\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"navContentPaneEnabled must be a boolean\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"useCustomSaveAsDialog\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"useCustomSaveAsDialog must be a boolean\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n/***/ },\n/* 7 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"target\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"properties\": {\n\t\t\t\t\t\"table\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"column\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"hierarchy\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"hierarchyLevel\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"measure\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"required\": [\n\t\t\t\t\t\"table\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"operator\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"values\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"type\": [\n\t\t\t\t\t\t\"string\",\n\t\t\t\t\t\t\"boolean\",\n\t\t\t\t\t\t\"number\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"target\",\n\t\t\t\"operator\",\n\t\t\t\"values\"\n\t\t]\n\t};\n\n/***/ },\n/* 8 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"accessToken\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"accessToken must be a string\",\n\t\t\t\t\t\"required\": \"accessToken is required\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"datasetId\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"datasetId must be a string\",\n\t\t\t\t\t\"required\": \"datasetId is required\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"accessToken\",\n\t\t\t\"datasetId\"\n\t\t]\n\t};\n\n/***/ },\n/* 9 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"name\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"messages\": {\n\t\t\t\t\t\"type\": \"name must be a string\",\n\t\t\t\t\t\"required\": \"name is required\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"required\": [\n\t\t\t\"name\"\n\t\t]\n\t};\n\n/***/ },\n/* 10 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = __webpack_require__(11);\n\n/***/ },\n/* 11 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar REGEX_ESCAPE_EXPR = /[\\/]/g,\n\t STR_ESCAPE_EXPR = /(\")/gim,\n\t VALID_IDENTIFIER_EXPR = /^[a-z_$][0-9a-z]*$/gi,\n\t INVALID_SCHEMA = 'jsen: invalid schema object',\n\t browser = typeof window === 'object' && !!window.navigator, // jshint ignore: line\n\t regescape = new RegExp('/').source !== '/', // node v0.x does not properly escape '/'s in inline regex\n\t func = __webpack_require__(12),\n\t equal = __webpack_require__(13),\n\t unique = __webpack_require__(14),\n\t SchemaResolver = __webpack_require__(15),\n\t formats = __webpack_require__(24),\n\t ucs2length = __webpack_require__(25),\n\t types = {},\n\t keywords = {};\n\t\n\tfunction inlineRegex(regex) {\n\t regex = regex instanceof RegExp ? regex : new RegExp(regex);\n\t\n\t return regescape ?\n\t regex.toString() :\n\t '/' + regex.source.replace(REGEX_ESCAPE_EXPR, '\\\\$&') + '/';\n\t}\n\t\n\tfunction encodeStr(str) {\n\t return '\"' + str.replace(STR_ESCAPE_EXPR, '\\\\$1') + '\"';\n\t}\n\t\n\tfunction appendToPath(path, key) {\n\t VALID_IDENTIFIER_EXPR.lastIndex = 0;\n\t\n\t return VALID_IDENTIFIER_EXPR.test(key) ?\n\t path + '.' + key :\n\t path + '[' + encodeStr(key) + ']';\n\t}\n\t\n\tfunction type(obj) {\n\t if (obj === undefined) {\n\t return 'undefined';\n\t }\n\t\n\t var str = Object.prototype.toString.call(obj);\n\t return str.substr(8, str.length - 9).toLowerCase();\n\t}\n\t\n\tfunction isInteger(obj) {\n\t return (obj | 0) === obj; // jshint ignore: line\n\t}\n\t\n\ttypes['null'] = function (path) {\n\t return path + ' === null';\n\t};\n\t\n\ttypes.boolean = function (path) {\n\t return 'typeof ' + path + ' === \"boolean\"';\n\t};\n\t\n\ttypes.string = function (path) {\n\t return 'typeof ' + path + ' === \"string\"';\n\t};\n\t\n\ttypes.number = function (path) {\n\t return 'typeof ' + path + ' === \"number\"';\n\t};\n\t\n\ttypes.integer = function (path) {\n\t return 'typeof ' + path + ' === \"number\" && !(' + path + ' % 1)';\n\t};\n\t\n\ttypes.array = function (path) {\n\t return 'Array.isArray(' + path + ')';\n\t};\n\t\n\ttypes.object = function (path) {\n\t return 'typeof ' + path + ' === \"object\" && ' + path + ' !== null && !Array.isArray(' + path + ')';\n\t};\n\t\n\ttypes.date = function (path) {\n\t return path + ' instanceof Date';\n\t};\n\t\n\tkeywords.enum = function (context) {\n\t var arr = context.schema['enum'];\n\t\n\t context.code('if (!equalAny(' + context.path + ', ' + JSON.stringify(arr) + ')) {');\n\t context.error('enum');\n\t context.code('}');\n\t};\n\t\n\tkeywords.minimum = function (context) {\n\t if (typeof context.schema.minimum === 'number') {\n\t context.code('if (' + context.path + ' < ' + context.schema.minimum + ') {');\n\t context.error('minimum');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.exclusiveMinimum = function (context) {\n\t if (context.schema.exclusiveMinimum === true && typeof context.schema.minimum === 'number') {\n\t context.code('if (' + context.path + ' === ' + context.schema.minimum + ') {');\n\t context.error('exclusiveMinimum');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.maximum = function (context) {\n\t if (typeof context.schema.maximum === 'number') {\n\t context.code('if (' + context.path + ' > ' + context.schema.maximum + ') {');\n\t context.error('maximum');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.exclusiveMaximum = function (context) {\n\t if (context.schema.exclusiveMaximum === true && typeof context.schema.maximum === 'number') {\n\t context.code('if (' + context.path + ' === ' + context.schema.maximum + ') {');\n\t context.error('exclusiveMaximum');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.multipleOf = function (context) {\n\t if (typeof context.schema.multipleOf === 'number') {\n\t var mul = context.schema.multipleOf,\n\t decimals = mul.toString().length - mul.toFixed(0).length - 1,\n\t pow = decimals > 0 ? Math.pow(10, decimals) : 1,\n\t path = context.path;\n\t\n\t if (decimals > 0) {\n\t context.code('if (+(Math.round((' + path + ' * ' + pow + ') + \"e+\" + ' + decimals + ') + \"e-\" + ' + decimals + ') % ' + (mul * pow) + ' !== 0) {');\n\t } else {\n\t context.code('if (((' + path + ' * ' + pow + ') % ' + (mul * pow) + ') !== 0) {');\n\t }\n\t\n\t context.error('multipleOf');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.minLength = function (context) {\n\t if (isInteger(context.schema.minLength)) {\n\t context.code('if (ucs2length(' + context.path + ') < ' + context.schema.minLength + ') {');\n\t context.error('minLength');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.maxLength = function (context) {\n\t if (isInteger(context.schema.maxLength)) {\n\t context.code('if (ucs2length(' + context.path + ') > ' + context.schema.maxLength + ') {');\n\t context.error('maxLength');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.pattern = function (context) {\n\t var pattern = context.schema.pattern;\n\t\n\t if (typeof pattern === 'string' || pattern instanceof RegExp) {\n\t context.code('if (!(' + inlineRegex(pattern) + ').test(' + context.path + ')) {');\n\t context.error('pattern');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.format = function (context) {\n\t if (typeof context.schema.format !== 'string' || !formats[context.schema.format]) {\n\t return;\n\t }\n\t\n\t context.code('if (!(' + formats[context.schema.format] + ').test(' + context.path + ')) {');\n\t context.error('format');\n\t context.code('}');\n\t};\n\t\n\tkeywords.minItems = function (context) {\n\t if (isInteger(context.schema.minItems)) {\n\t context.code('if (' + context.path + '.length < ' + context.schema.minItems + ') {');\n\t context.error('minItems');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.maxItems = function (context) {\n\t if (isInteger(context.schema.maxItems)) {\n\t context.code('if (' + context.path + '.length > ' + context.schema.maxItems + ') {');\n\t context.error('maxItems');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.additionalItems = function (context) {\n\t if (context.schema.additionalItems === false && Array.isArray(context.schema.items)) {\n\t context.code('if (' + context.path + '.length > ' + context.schema.items.length + ') {');\n\t context.error('additionalItems');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.uniqueItems = function (context) {\n\t if (context.schema.uniqueItems) {\n\t context.code('if (unique(' + context.path + ').length !== ' + context.path + '.length) {');\n\t context.error('uniqueItems');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.items = function (context) {\n\t var index = context.declare(0),\n\t i = 0;\n\t\n\t if (type(context.schema.items) === 'object') {\n\t context.code('for (' + index + ' = 0; ' + index + ' < ' + context.path + '.length; ' + index + '++) {');\n\t\n\t context.descend(context.path + '[' + index + ']', context.schema.items);\n\t\n\t context.code('}');\n\t }\n\t else if (Array.isArray(context.schema.items)) {\n\t for (; i < context.schema.items.length; i++) {\n\t context.code('if (' + context.path + '.length - 1 >= ' + i + ') {');\n\t\n\t context.descend(context.path + '[' + i + ']', context.schema.items[i]);\n\t\n\t context.code('}');\n\t }\n\t\n\t if (type(context.schema.additionalItems) === 'object') {\n\t context.code('for (' + index + ' = ' + i + '; ' + index + ' < ' + context.path + '.length; ' + index + '++) {');\n\t\n\t context.descend(context.path + '[' + index + ']', context.schema.additionalItems);\n\t\n\t context.code('}');\n\t }\n\t }\n\t};\n\t\n\tkeywords.maxProperties = function (context) {\n\t if (isInteger(context.schema.maxProperties)) {\n\t context.code('if (Object.keys(' + context.path + ').length > ' + context.schema.maxProperties + ') {');\n\t context.error('maxProperties');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.minProperties = function (context) {\n\t if (isInteger(context.schema.minProperties)) {\n\t context.code('if (Object.keys(' + context.path + ').length < ' + context.schema.minProperties + ') {');\n\t context.error('minProperties');\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.required = function (context) {\n\t if (!Array.isArray(context.schema.required)) {\n\t return;\n\t }\n\t\n\t for (var i = 0; i < context.schema.required.length; i++) {\n\t context.code('if (' + appendToPath(context.path, context.schema.required[i]) + ' === undefined) {');\n\t context.error('required', context.schema.required[i]);\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.properties = function (context) {\n\t var props = context.schema.properties,\n\t propKeys = type(props) === 'object' ? Object.keys(props) : [],\n\t required = Array.isArray(context.schema.required) ? context.schema.required : [],\n\t prop, i, nestedPath;\n\t\n\t if (!propKeys.length) {\n\t return;\n\t }\n\t\n\t for (i = 0; i < propKeys.length; i++) {\n\t prop = propKeys[i];\n\t nestedPath = appendToPath(context.path, prop);\n\t\n\t context.code('if (' + nestedPath + ' !== undefined) {');\n\t\n\t context.descend(nestedPath, props[prop]);\n\t\n\t context.code('}');\n\t\n\t if (required.indexOf(prop) > -1) {\n\t context.code('else {');\n\t context.error('required', prop);\n\t context.code('}');\n\t }\n\t }\n\t};\n\t\n\tkeywords.patternProperties = keywords.additionalProperties = function (context) {\n\t var propKeys = type(context.schema.properties) === 'object' ?\n\t Object.keys(context.schema.properties) : [],\n\t patProps = context.schema.patternProperties,\n\t patterns = type(patProps) === 'object' ? Object.keys(patProps) : [],\n\t addProps = context.schema.additionalProperties,\n\t addPropsCheck = addProps === false || type(addProps) === 'object',\n\t props, keys, key, n, found, pattern, i;\n\t\n\t if (!patterns.length && !addPropsCheck) {\n\t return;\n\t }\n\t\n\t keys = context.declare('[]');\n\t key = context.declare('\"\"');\n\t n = context.declare(0);\n\t\n\t if (addPropsCheck) {\n\t found = context.declare(false);\n\t }\n\t\n\t context.code(keys + ' = Object.keys(' + context.path + ')');\n\t\n\t context.code('for (' + n + ' = 0; ' + n + ' < ' + keys + '.length; ' + n + '++) {')\n\t (key + ' = ' + keys + '[' + n + ']')\n\t\n\t ('if (' + context.path + '[' + key + '] === undefined) {')\n\t ('continue')\n\t ('}');\n\t\n\t if (addPropsCheck) {\n\t context.code(found + ' = false');\n\t }\n\t\n\t // validate pattern properties\n\t for (i = 0; i < patterns.length; i++) {\n\t pattern = patterns[i];\n\t\n\t context.code('if ((' + inlineRegex(pattern) + ').test(' + key + ')) {');\n\t\n\t context.descend(context.path + '[' + key + ']', patProps[pattern]);\n\t\n\t if (addPropsCheck) {\n\t context.code(found + ' = true');\n\t }\n\t\n\t context.code('}');\n\t }\n\t\n\t // validate additional properties\n\t if (addPropsCheck) {\n\t if (propKeys.length) {\n\t props = context.declare(JSON.stringify(propKeys));\n\t\n\t // do not validate regular properties\n\t context.code('if (' + props + '.indexOf(' + key + ') > -1) {')\n\t ('continue')\n\t ('}');\n\t }\n\t\n\t context.code('if (!' + found + ') {');\n\t\n\t if (addProps === false) {\n\t // do not allow additional properties\n\t context.error('additionalProperties', undefined, key);\n\t }\n\t else {\n\t // validate additional properties\n\t context.descend(context.path + '[' + key + ']', addProps);\n\t }\n\t\n\t context.code('}');\n\t }\n\t\n\t context.code('}');\n\t};\n\t\n\tkeywords.dependencies = function (context) {\n\t if (type(context.schema.dependencies) !== 'object') {\n\t return;\n\t }\n\t\n\t var depKeys = Object.keys(context.schema.dependencies),\n\t len = depKeys.length,\n\t key, dep, i = 0, k = 0;\n\t\n\t for (; k < len; k++) {\n\t key = depKeys[k];\n\t dep = context.schema.dependencies[key];\n\t\n\t context.code('if (' + appendToPath(context.path, key) + ' !== undefined) {');\n\t\n\t if (type(dep) === 'object') {\n\t //schema dependency\n\t context.descend(context.path, dep);\n\t }\n\t else {\n\t // property dependency\n\t for (i; i < dep.length; i++) {\n\t context.code('if (' + appendToPath(context.path, dep[i]) + ' === undefined) {');\n\t context.error('dependencies', dep[i]);\n\t context.code('}');\n\t }\n\t }\n\t\n\t context.code('}');\n\t }\n\t};\n\t\n\tkeywords.allOf = function (context) {\n\t if (!Array.isArray(context.schema.allOf)) {\n\t return;\n\t }\n\t\n\t for (var i = 0; i < context.schema.allOf.length; i++) {\n\t context.descend(context.path, context.schema.allOf[i]);\n\t }\n\t};\n\t\n\tkeywords.anyOf = function (context) {\n\t if (!Array.isArray(context.schema.anyOf)) {\n\t return;\n\t }\n\t\n\t var greedy = context.greedy,\n\t errCount = context.declare(0),\n\t initialCount = context.declare(0),\n\t found = context.declare(false),\n\t i = 0;\n\t\n\t context.code(initialCount + ' = errors.length');\n\t\n\t for (; i < context.schema.anyOf.length; i++) {\n\t context.code('if (!' + found + ') {');\n\t\n\t context.code(errCount + ' = errors.length');\n\t\n\t context.greedy = true;\n\t\n\t context.descend(context.path, context.schema.anyOf[i]);\n\t\n\t context.code(found + ' = errors.length === ' + errCount)\n\t ('}');\n\t }\n\t\n\t context.greedy = greedy;\n\t\n\t context.code('if (!' + found + ') {');\n\t\n\t context.error('anyOf');\n\t\n\t context.code('} else {')\n\t ('errors.length = ' + initialCount)\n\t ('}');\n\t};\n\t\n\tkeywords.oneOf = function (context) {\n\t if (!Array.isArray(context.schema.oneOf)) {\n\t return;\n\t }\n\t\n\t var greedy = context.greedy,\n\t matching = context.declare(0),\n\t initialCount = context.declare(0),\n\t errCount = context.declare(0),\n\t i = 0;\n\t\n\t context.code(initialCount + ' = errors.length');\n\t context.code(matching + ' = 0');\n\t\n\t for (; i < context.schema.oneOf.length; i++) {\n\t context.code(errCount + ' = errors.length');\n\t\n\t context.greedy = true;\n\t\n\t context.descend(context.path, context.schema.oneOf[i]);\n\t\n\t context.code('if (errors.length === ' + errCount + ') {')\n\t (matching + '++')\n\t ('}');\n\t }\n\t\n\t context.greedy = greedy;\n\t\n\t context.code('if (' + matching + ' !== 1) {');\n\t\n\t context.error('oneOf');\n\t\n\t context.code('} else {')\n\t ('errors.length = ' + initialCount)\n\t ('}');\n\t};\n\t\n\tkeywords.not = function (context) {\n\t if (type(context.schema.not) !== 'object') {\n\t return;\n\t }\n\t\n\t var greedy = context.greedy,\n\t errCount = context.declare(0);\n\t\n\t context.code(errCount + ' = errors.length');\n\t\n\t context.greedy = true;\n\t\n\t context.descend(context.path, context.schema.not);\n\t\n\t context.greedy = greedy;\n\t\n\t context.code('if (errors.length === ' + errCount + ') {');\n\t\n\t context.error('not');\n\t\n\t context.code('} else {')\n\t ('errors.length = ' + errCount)\n\t ('}');\n\t};\n\t\n\tfunction decorateGenerator(type, keyword) {\n\t keywords[keyword].type = type;\n\t keywords[keyword].keyword = keyword;\n\t}\n\t\n\t['minimum', 'exclusiveMinimum', 'maximum', 'exclusiveMaximum', 'multipleOf']\n\t .forEach(decorateGenerator.bind(null, 'number'));\n\t\n\t['minLength', 'maxLength', 'pattern', 'format']\n\t .forEach(decorateGenerator.bind(null, 'string'));\n\t\n\t['minItems', 'maxItems', 'additionalItems', 'uniqueItems', 'items']\n\t .forEach(decorateGenerator.bind(null, 'array'));\n\t\n\t['maxProperties', 'minProperties', 'required', 'properties', 'patternProperties', 'additionalProperties', 'dependencies']\n\t .forEach(decorateGenerator.bind(null, 'object'));\n\t\n\t['enum', 'allOf', 'anyOf', 'oneOf', 'not']\n\t .forEach(decorateGenerator.bind(null, null));\n\t\n\tfunction groupKeywords(schema) {\n\t var keys = Object.keys(schema),\n\t propIndex = keys.indexOf('properties'),\n\t patIndex = keys.indexOf('patternProperties'),\n\t ret = {\n\t enum: Array.isArray(schema.enum) && schema.enum.length > 0,\n\t type: null,\n\t allType: [],\n\t perType: {}\n\t },\n\t key, gen, i;\n\t\n\t if (schema.type) {\n\t if (typeof schema.type === 'string') {\n\t ret.type = [schema.type];\n\t }\n\t else if (Array.isArray(schema.type) && schema.type.length) {\n\t ret.type = schema.type.slice(0);\n\t }\n\t }\n\t\n\t for (i = 0; i < keys.length; i++) {\n\t key = keys[i];\n\t\n\t if (key === 'enum' || key === 'type') {\n\t continue;\n\t }\n\t\n\t gen = keywords[key];\n\t\n\t if (!gen) {\n\t continue;\n\t }\n\t\n\t if (gen.type) {\n\t if (!ret.perType[gen.type]) {\n\t ret.perType[gen.type] = [];\n\t }\n\t\n\t if (!(propIndex > -1 && key === 'required') &&\n\t !(patIndex > -1 && key === 'additionalProperties')) {\n\t ret.perType[gen.type].push(key);\n\t }\n\t }\n\t else {\n\t ret.allType.push(key);\n\t }\n\t }\n\t\n\t return ret;\n\t}\n\t\n\tfunction getPathExpression(path, key) {\n\t var path_ = path.substr(4),\n\t len = path_.length,\n\t tokens = [],\n\t token = '',\n\t isvar = false,\n\t char, i;\n\t\n\t for (i = 0; i < len; i++) {\n\t char = path_[i];\n\t\n\t switch (char) {\n\t case '.':\n\t if (token) {\n\t token += char;\n\t }\n\t break;\n\t case '[':\n\t if (isNaN(+path_[i + 1])) {\n\t isvar = true;\n\t\n\t if (token) {\n\t tokens.push('\"' + token + '\"');\n\t token = '';\n\t }\n\t }\n\t else {\n\t isvar = false;\n\t\n\t if (token) {\n\t token += '.';\n\t }\n\t }\n\t break;\n\t case ']':\n\t tokens.push(isvar ? token : '\"' + token + '\"');\n\t token = '';\n\t break;\n\t default:\n\t token += char;\n\t }\n\t }\n\t\n\t if (token) {\n\t tokens.push('\"' + token + '\"');\n\t }\n\t\n\t if (key) {\n\t tokens.push('\"' + key + '\"');\n\t }\n\t\n\t if (tokens.length === 1 && isvar) {\n\t return '\"\" + ' + tokens[0] + ' + \"\"';\n\t }\n\t\n\t return tokens.join(' + \".\" + ') || '\"\"';\n\t}\n\t\n\tfunction clone(obj) {\n\t var cloned = obj,\n\t objType = type(obj),\n\t keys, len, key, i;\n\t\n\t if (objType === 'object') {\n\t cloned = {};\n\t keys = Object.keys(obj);\n\t\n\t for (i = 0, len = keys.length; i < len; i++) {\n\t key = keys[i];\n\t cloned[key] = clone(obj[key]);\n\t }\n\t }\n\t else if (objType === 'array') {\n\t cloned = [];\n\t\n\t for (i = 0, len = obj.length; i < len; i++) {\n\t cloned[i] = clone(obj[i]);\n\t }\n\t }\n\t else if (objType === 'regexp') {\n\t return new RegExp(obj);\n\t }\n\t else if (objType === 'date') {\n\t return new Date(obj.toJSON());\n\t }\n\t\n\t return cloned;\n\t}\n\t\n\tfunction equalAny(obj, options) {\n\t for (var i = 0, len = options.length; i < len; i++) {\n\t if (equal(obj, options[i])) {\n\t return true;\n\t }\n\t }\n\t\n\t return false;\n\t}\n\t\n\tfunction PropertyMarker() {\n\t this.objects = [];\n\t this.properties = [];\n\t}\n\t\n\tPropertyMarker.prototype.mark = function (obj, key) {\n\t var index = this.objects.indexOf(obj),\n\t prop;\n\t\n\t if (index < 0) {\n\t this.objects.push(obj);\n\t\n\t prop = {};\n\t prop[key] = 1;\n\t\n\t this.properties.push(prop);\n\t\n\t return;\n\t }\n\t\n\t prop = this.properties[index];\n\t\n\t prop[key] = prop[key] ? prop[key] + 1 : 1;\n\t};\n\t\n\tPropertyMarker.prototype.deleteDuplicates = function () {\n\t var props, keys, key, i, j;\n\t\n\t for (i = 0; i < this.properties.length; i++) {\n\t props = this.properties[i];\n\t keys = Object.keys(props);\n\t\n\t for (j = 0; j < keys.length; j++) {\n\t key = keys[j];\n\t\n\t if (props[key] > 1) {\n\t delete this.objects[i][key];\n\t }\n\t }\n\t }\n\t};\n\t\n\tPropertyMarker.prototype.dispose = function () {\n\t this.objects.length = 0;\n\t this.properties.length = 0;\n\t};\n\t\n\tfunction build(schema, def, additional, resolver, parentMarker) {\n\t var defType, defValue, key, i, propertyMarker, props, defProps;\n\t\n\t if (type(schema) !== 'object') {\n\t return def;\n\t }\n\t\n\t schema = resolver.resolve(schema);\n\t\n\t if (def === undefined && schema.hasOwnProperty('default')) {\n\t def = clone(schema['default']);\n\t }\n\t\n\t defType = type(def);\n\t\n\t if (defType === 'object' && type(schema.properties) === 'object') {\n\t props = Object.keys(schema.properties);\n\t\n\t for (i = 0; i < props.length; i++) {\n\t key = props[i];\n\t defValue = build(schema.properties[key], def[key], additional, resolver);\n\t\n\t if (defValue !== undefined) {\n\t def[key] = defValue;\n\t }\n\t }\n\t\n\t if (additional !== 'always') {\n\t defProps = Object.keys(def);\n\t\n\t for (i = 0; i < defProps.length; i++) {\n\t key = defProps[i];\n\t\n\t if (props.indexOf(key) < 0 &&\n\t (schema.additionalProperties === false ||\n\t (additional === false && !schema.additionalProperties))) {\n\t\n\t if (parentMarker) {\n\t parentMarker.mark(def, key);\n\t }\n\t else {\n\t delete def[key];\n\t }\n\t }\n\t }\n\t }\n\t }\n\t else if (defType === 'array' && schema.items) {\n\t if (type(schema.items) === 'array') {\n\t for (i = 0; i < schema.items.length; i++) {\n\t defValue = build(schema.items[i], def[i], additional, resolver);\n\t\n\t if (defValue !== undefined || i < def.length) {\n\t def[i] = defValue;\n\t }\n\t }\n\t }\n\t else if (def.length) {\n\t for (i = 0; i < def.length; i++) {\n\t def[i] = build(schema.items, def[i], additional, resolver);\n\t }\n\t }\n\t }\n\t else if (type(schema.allOf) === 'array' && schema.allOf.length) {\n\t propertyMarker = new PropertyMarker();\n\t\n\t for (i = 0; i < schema.allOf.length; i++) {\n\t def = build(schema.allOf[i], def, additional, resolver, propertyMarker);\n\t }\n\t\n\t propertyMarker.deleteDuplicates();\n\t propertyMarker.dispose();\n\t }\n\t\n\t return def;\n\t}\n\t\n\tfunction ValidationContext(options) {\n\t this.path = 'data';\n\t this.schema = options.schema;\n\t this.formats = options.formats;\n\t this.greedy = options.greedy;\n\t this.resolver = options.resolver;\n\t this.id = options.id;\n\t this.funcache = options.funcache || {};\n\t this.scope = options.scope || {\n\t equalAny: equalAny,\n\t unique: unique,\n\t ucs2length: ucs2length,\n\t refs: {}\n\t };\n\t}\n\t\n\tValidationContext.prototype.clone = function (schema) {\n\t var ctx = new ValidationContext({\n\t schema: schema,\n\t formats: this.formats,\n\t greedy: this.greedy,\n\t resolver: this.resolver,\n\t id: this.id,\n\t funcache: this.funcache,\n\t scope: this.scope\n\t });\n\t\n\t return ctx;\n\t};\n\t\n\tValidationContext.prototype.declare = function (def) {\n\t var variname = this.id();\n\t this.code.def(variname, def);\n\t return variname;\n\t};\n\t\n\tValidationContext.prototype.cache = function (cacheKey, schema) {\n\t var cached = this.funcache[cacheKey],\n\t context;\n\t\n\t if (!cached) {\n\t cached = this.funcache[cacheKey] = {\n\t key: this.id()\n\t };\n\t\n\t context = this.clone(schema);\n\t\n\t cached.func = context.compile(cached.key);\n\t\n\t this.scope.refs[cached.key] = cached.func;\n\t\n\t context.dispose();\n\t }\n\t\n\t return 'refs.' + cached.key;\n\t};\n\t\n\tValidationContext.prototype.error = function (keyword, key, additional) {\n\t var schema = this.schema,\n\t path = this.path,\n\t errorPath = path !== 'data' || key ?\n\t '(path ? path + \".\" : \"\") + ' + getPathExpression(path, key) + ',' :\n\t 'path,',\n\t res = key && schema.properties && schema.properties[key] ?\n\t this.resolver.resolve(schema.properties[key]) : null,\n\t message = res ? res.requiredMessage : schema.invalidMessage;\n\t\n\t if (!message) {\n\t message = (res && res.messages && res.messages[keyword]) ||\n\t (schema.messages && schema.messages[keyword]);\n\t }\n\t\n\t this.code('errors.push({');\n\t\n\t if (message) {\n\t this.code('message: ' + encodeStr(message) + ',');\n\t }\n\t\n\t if (additional) {\n\t this.code('additionalProperties: ' + additional + ',');\n\t }\n\t\n\t this.code('path: ' + errorPath)\n\t ('keyword: ' + encodeStr(keyword))\n\t ('})');\n\t\n\t if (!this.greedy) {\n\t this.code('return');\n\t }\n\t};\n\t\n\tValidationContext.prototype.refactor = function (path, schema, cacheKey) {\n\t var parentPathExp = path !== 'data' ?\n\t '(path ? path + \".\" : \"\") + ' + getPathExpression(path) :\n\t 'path',\n\t cachedRef = this.cache(cacheKey, schema),\n\t refErrors = this.declare();\n\t\n\t this.code(refErrors + ' = ' + cachedRef + '(' + path + ', ' + parentPathExp + ', errors)');\n\t\n\t if (!this.greedy) {\n\t this.code('if (errors.length) { return }');\n\t }\n\t};\n\t\n\tValidationContext.prototype.descend = function (path, schema) {\n\t var origPath = this.path,\n\t origSchema = this.schema;\n\t\n\t this.path = path;\n\t this.schema = schema;\n\t\n\t this.generate();\n\t\n\t this.path = origPath;\n\t this.schema = origSchema;\n\t};\n\t\n\tValidationContext.prototype.generate = function () {\n\t var path = this.path,\n\t schema = this.schema,\n\t context = this,\n\t scope = this.scope,\n\t encodedFormat,\n\t format,\n\t schemaKeys,\n\t typeKeys,\n\t typeIndex,\n\t validatedType,\n\t i;\n\t\n\t if (type(schema) !== 'object') {\n\t return;\n\t }\n\t\n\t if (schema.$ref !== undefined) {\n\t schema = this.resolver.resolve(schema);\n\t\n\t if (this.resolver.hasRef(schema)) {\n\t this.refactor(path, schema,\n\t this.resolver.getNormalizedRef(this.schema) || this.schema.$ref);\n\t\n\t return;\n\t }\n\t else {\n\t // substitute $ref schema with the resolved instance\n\t this.schema = schema;\n\t }\n\t }\n\t\n\t schemaKeys = groupKeywords(schema);\n\t\n\t if (schemaKeys.enum) {\n\t keywords.enum(context);\n\t\n\t return; // do not process the schema further\n\t }\n\t\n\t typeKeys = Object.keys(schemaKeys.perType);\n\t\n\t function generateForKeyword(keyword) {\n\t keywords[keyword](context); // jshint ignore: line\n\t }\n\t\n\t for (i = 0; i < typeKeys.length; i++) {\n\t validatedType = typeKeys[i];\n\t\n\t this.code((i ? 'else ' : '') + 'if (' + types[validatedType](path) + ') {');\n\t\n\t schemaKeys.perType[validatedType].forEach(generateForKeyword);\n\t\n\t this.code('}');\n\t\n\t if (schemaKeys.type) {\n\t typeIndex = schemaKeys.type.indexOf(validatedType);\n\t\n\t if (typeIndex > -1) {\n\t schemaKeys.type.splice(typeIndex, 1);\n\t }\n\t }\n\t }\n\t\n\t if (schemaKeys.type) { // we have types in the schema\n\t if (schemaKeys.type.length) { // case 1: we still have some left to check\n\t this.code((typeKeys.length ? 'else ' : '') + 'if (!(' + schemaKeys.type.map(function (type) {\n\t return types[type] ? types[type](path) : 'true';\n\t }).join(' || ') + ')) {');\n\t this.error('type');\n\t this.code('}');\n\t }\n\t else {\n\t this.code('else {'); // case 2: we don't have any left to check\n\t this.error('type');\n\t this.code('}');\n\t }\n\t }\n\t\n\t schemaKeys.allType.forEach(function (keyword) {\n\t keywords[keyword](context);\n\t });\n\t\n\t if (schema.format && this.formats) {\n\t format = this.formats[schema.format];\n\t\n\t if (format) {\n\t if (typeof format === 'string' || format instanceof RegExp) {\n\t this.code('if (!(' + inlineRegex(format) + ').test(' + path + ')) {');\n\t this.error('format');\n\t this.code('}');\n\t }\n\t else if (typeof format === 'function') {\n\t (scope.formats || (scope.formats = {}))[schema.format] = format;\n\t (scope.schemas || (scope.schemas = {}))[schema.format] = schema;\n\t\n\t encodedFormat = encodeStr(schema.format);\n\t\n\t this.code('if (!formats[' + encodedFormat + '](' + path + ', schemas[' + encodedFormat + '])) {');\n\t this.error('format');\n\t this.code('}');\n\t }\n\t }\n\t }\n\t};\n\t\n\tValidationContext.prototype.compile = function (id) {\n\t this.code = func('jsen_compiled' + (id ? '_' + id : ''), 'data', 'path', 'errors');\n\t this.generate();\n\t\n\t return this.code.compile(this.scope);\n\t};\n\t\n\tValidationContext.prototype.dispose = function () {\n\t for (var key in this) {\n\t this[key] = undefined;\n\t }\n\t};\n\t\n\tfunction jsen(schema, options) {\n\t if (type(schema) !== 'object') {\n\t throw new Error(INVALID_SCHEMA);\n\t }\n\t\n\t options = options || {};\n\t\n\t var counter = 0,\n\t id = function () { return 'i' + (counter++); },\n\t resolver = new SchemaResolver(schema, options.schemas, options.missing$Ref || false),\n\t context = new ValidationContext({\n\t schema: schema,\n\t resolver: resolver,\n\t id: id,\n\t schemas: options.schemas,\n\t formats: options.formats,\n\t greedy: options.greedy || false\n\t }),\n\t compiled = func('validate', 'data')\n\t ('validate.errors = []')\n\t ('gen(data, \"\", validate.errors)')\n\t ('return validate.errors.length === 0')\n\t .compile({ gen: context.compile() });\n\t\n\t context.dispose();\n\t context = null;\n\t\n\t compiled.errors = [];\n\t\n\t compiled.build = function (initial, options) {\n\t return build(\n\t schema,\n\t (options && options.copy === false ? initial : clone(initial)),\n\t options && options.additionalProperties,\n\t resolver);\n\t };\n\t\n\t return compiled;\n\t}\n\t\n\tjsen.browser = browser;\n\tjsen.clone = clone;\n\tjsen.equal = equal;\n\tjsen.unique = unique;\n\tjsen.ucs2length = ucs2length;\n\tjsen.SchemaResolver = SchemaResolver;\n\tjsen.resolve = SchemaResolver.resolvePointer;\n\t\n\tmodule.exports = jsen;\n\n\n/***/ },\n/* 12 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = function func() {\n\t var args = Array.apply(null, arguments),\n\t name = args.shift(),\n\t tab = ' ',\n\t lines = '',\n\t vars = '',\n\t ind = 1, // indentation\n\t bs = '{[', // block start\n\t be = '}]', // block end\n\t space = function () {\n\t var sp = tab, i = 0;\n\t while (i++ < ind - 1) { sp += tab; }\n\t return sp;\n\t },\n\t add = function (line) {\n\t lines += space() + line + '\\n';\n\t },\n\t builder = function (line) {\n\t var first = line[0],\n\t last = line[line.length - 1];\n\t\n\t if (be.indexOf(first) > -1 && bs.indexOf(last) > -1) {\n\t ind--;\n\t add(line);\n\t ind++;\n\t }\n\t else if (bs.indexOf(last) > -1) {\n\t add(line);\n\t ind++;\n\t }\n\t else if (be.indexOf(first) > -1) {\n\t ind--;\n\t add(line);\n\t }\n\t else {\n\t add(line);\n\t }\n\t\n\t return builder;\n\t };\n\t\n\t builder.def = function (id, def) {\n\t vars += (vars ? ',\\n' + tab + ' ' : '') + id + (def !== undefined ? ' = ' + def : '');\n\t return builder;\n\t };\n\t\n\t builder.toSource = function () {\n\t return 'function ' + name + '(' + args.join(', ') + ') {\\n' +\n\t tab + '\"use strict\"' + '\\n' +\n\t (vars ? tab + 'var ' + vars + ';\\n' : '') +\n\t lines + '}';\n\t };\n\t\n\t builder.compile = function (scope) {\n\t var src = 'return (' + builder.toSource() + ')',\n\t scp = scope || {},\n\t keys = Object.keys(scp),\n\t vals = keys.map(function (key) { return scp[key]; });\n\t\n\t return Function.apply(null, keys.concat(src)).apply(null, vals);\n\t };\n\t\n\t return builder;\n\t};\n\n/***/ },\n/* 13 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tfunction type(obj) {\n\t var str = Object.prototype.toString.call(obj);\n\t return str.substr(8, str.length - 9).toLowerCase();\n\t}\n\t\n\tfunction deepEqual(a, b) {\n\t var keysA = Object.keys(a).sort(),\n\t keysB = Object.keys(b).sort(),\n\t i, key;\n\t\n\t if (!equal(keysA, keysB)) {\n\t return false;\n\t }\n\t\n\t for (i = 0; i < keysA.length; i++) {\n\t key = keysA[i];\n\t\n\t if (!equal(a[key], b[key])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t}\n\t\n\tfunction equal(a, b) { // jshint ignore: line\n\t var typeA = typeof a,\n\t typeB = typeof b,\n\t i;\n\t\n\t // get detailed object type\n\t if (typeA === 'object') {\n\t typeA = type(a);\n\t }\n\t\n\t // get detailed object type\n\t if (typeB === 'object') {\n\t typeB = type(b);\n\t }\n\t\n\t if (typeA !== typeB) {\n\t return false;\n\t }\n\t\n\t if (typeA === 'object') {\n\t return deepEqual(a, b);\n\t }\n\t\n\t if (typeA === 'regexp') {\n\t return a.toString() === b.toString();\n\t }\n\t\n\t if (typeA === 'array') {\n\t if (a.length !== b.length) {\n\t return false;\n\t }\n\t\n\t for (i = 0; i < a.length; i++) {\n\t if (!equal(a[i], b[i])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t }\n\t\n\t return a === b;\n\t}\n\t\n\tmodule.exports = equal;\n\n/***/ },\n/* 14 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar equal = __webpack_require__(13);\n\t\n\tfunction findIndex(arr, value, comparator) {\n\t for (var i = 0, len = arr.length; i < len; i++) {\n\t if (comparator(arr[i], value)) {\n\t return i;\n\t }\n\t }\n\t\n\t return -1;\n\t}\n\t\n\tmodule.exports = function unique(arr) {\n\t return arr.filter(function uniqueOnly(value, index, self) {\n\t return findIndex(self, value, equal) === index;\n\t });\n\t};\n\t\n\tmodule.exports.findIndex = findIndex;\n\n/***/ },\n/* 15 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar url = __webpack_require__(16),\n\t metaschema = __webpack_require__(23),\n\t INVALID_SCHEMA_REFERENCE = 'jsen: invalid schema reference',\n\t DUPLICATE_SCHEMA_ID = 'jsen: duplicate schema id',\n\t CIRCULAR_SCHEMA_REFERENCE = 'jsen: circular schema reference';\n\t\n\tfunction get(obj, path) {\n\t if (!path.length) {\n\t return obj;\n\t }\n\t\n\t var key = path.shift(),\n\t val;\n\t\n\t if (obj && typeof obj === 'object' && obj.hasOwnProperty(key)) {\n\t val = obj[key];\n\t }\n\t\n\t if (path.length) {\n\t if (val && typeof val === 'object') {\n\t return get(val, path);\n\t }\n\t\n\t return undefined;\n\t }\n\t\n\t return val;\n\t}\n\t\n\tfunction refToObj(ref) {\n\t var index = ref.indexOf('#'),\n\t ret = {\n\t base: ref.substr(0, index),\n\t path: []\n\t };\n\t\n\t if (index < 0) {\n\t ret.base = ref;\n\t return ret;\n\t }\n\t\n\t ref = ref.substr(index + 1);\n\t\n\t if (!ref) {\n\t return ret;\n\t }\n\t\n\t ret.path = ref.split('/').map(function (segment) {\n\t // Reference: http://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-08#section-3\n\t return decodeURIComponent(segment)\n\t .replace(/~1/g, '/')\n\t .replace(/~0/g, '~');\n\t });\n\t\n\t if (ref[0] === '/') {\n\t ret.path.shift();\n\t }\n\t\n\t return ret;\n\t}\n\t\n\t// TODO: Can we prevent nested resolvers and combine schemas instead?\n\tfunction SchemaResolver(rootSchema, external, missing$Ref, baseId) { // jshint ignore: line\n\t this.rootSchema = rootSchema;\n\t this.resolvers = null;\n\t this.resolvedRootSchema = null;\n\t this.cache = {};\n\t this.idCache = {};\n\t this.refCache = { refs: [], schemas: [] };\n\t this.missing$Ref = missing$Ref;\n\t this.refStack = [];\n\t\n\t baseId = baseId || '';\n\t\n\t this._buildIdCache(rootSchema, baseId);\n\t\n\t // get updated base id after normalizing root schema id\n\t baseId = this.refCache.refs[this.refCache.schemas.indexOf(this.rootSchema)] || baseId;\n\t\n\t this._buildResolvers(external, baseId);\n\t}\n\t\n\tSchemaResolver.prototype._cacheId = function (id, schema, resolver) {\n\t if (this.idCache[id]) {\n\t throw new Error(DUPLICATE_SCHEMA_ID + ' ' + id);\n\t }\n\t\n\t this.idCache[id] = { resolver: resolver, schema: schema };\n\t};\n\t\n\tSchemaResolver.prototype._buildIdCache = function (schema, baseId) {\n\t var id = baseId,\n\t ref, keys, i;\n\t\n\t if (!schema || typeof schema !== 'object') {\n\t return;\n\t }\n\t\n\t if (typeof schema.id === 'string' && schema.id) {\n\t id = url.resolve(baseId, schema.id);\n\t\n\t this._cacheId(id, schema, this);\n\t }\n\t else if (schema === this.rootSchema && baseId) {\n\t this._cacheId(baseId, schema, this);\n\t }\n\t\n\t if (schema.$ref && typeof schema.$ref === 'string') {\n\t ref = url.resolve(id, schema.$ref);\n\t\n\t this.refCache.schemas.push(schema);\n\t this.refCache.refs.push(ref);\n\t }\n\t\n\t keys = Object.keys(schema);\n\t\n\t for (i = 0; i < keys.length; i++) {\n\t this._buildIdCache(schema[keys[i]], id);\n\t }\n\t};\n\t\n\tSchemaResolver.prototype._buildResolvers = function (schemas, baseId) {\n\t if (!schemas || typeof schemas !== 'object') {\n\t return;\n\t }\n\t\n\t var that = this,\n\t resolvers = {};\n\t\n\t Object.keys(schemas).forEach(function (key) {\n\t var id = url.resolve(baseId, key),\n\t resolver = new SchemaResolver(schemas[key], null, that.missing$Ref, id);\n\t\n\t that._cacheId(id, resolver.rootSchema, resolver);\n\t\n\t Object.keys(resolver.idCache).forEach(function (idKey) {\n\t that.idCache[idKey] = resolver.idCache[idKey];\n\t });\n\t\n\t resolvers[key] = resolver;\n\t });\n\t\n\t this.resolvers = resolvers;\n\t};\n\t\n\tSchemaResolver.prototype.getNormalizedRef = function (schema) {\n\t var index = this.refCache.schemas.indexOf(schema);\n\t return this.refCache.refs[index];\n\t};\n\t\n\tSchemaResolver.prototype._resolveRef = function (ref) {\n\t var err = new Error(INVALID_SCHEMA_REFERENCE + ' ' + ref),\n\t idCache = this.idCache,\n\t externalResolver, cached, descriptor, path, dest;\n\t\n\t if (!ref || typeof ref !== 'string') {\n\t throw err;\n\t }\n\t\n\t if (ref === metaschema.id) {\n\t dest = metaschema;\n\t }\n\t\n\t cached = idCache[ref];\n\t\n\t if (cached) {\n\t dest = cached.resolver.resolve(cached.schema);\n\t }\n\t\n\t if (dest === undefined) {\n\t descriptor = refToObj(ref);\n\t path = descriptor.path;\n\t\n\t if (descriptor.base) {\n\t cached = idCache[descriptor.base] || idCache[descriptor.base + '#'];\n\t\n\t if (cached) {\n\t dest = cached.resolver.resolve(get(cached.schema, path.slice(0)));\n\t }\n\t else {\n\t path.unshift(descriptor.base);\n\t }\n\t }\n\t }\n\t\n\t if (dest === undefined && this.resolvedRootSchema) {\n\t dest = get(this.resolvedRootSchema, path.slice(0));\n\t }\n\t\n\t if (dest === undefined) {\n\t dest = get(this.rootSchema, path.slice(0));\n\t }\n\t\n\t if (dest === undefined && path.length && this.resolvers) {\n\t externalResolver = get(this.resolvers, path);\n\t\n\t if (externalResolver) {\n\t dest = externalResolver.resolve(externalResolver.rootSchema);\n\t }\n\t }\n\t\n\t if (dest === undefined || typeof dest !== 'object') {\n\t if (this.missing$Ref) {\n\t dest = {};\n\t } else {\n\t throw err;\n\t }\n\t }\n\t\n\t if (this.cache[ref] === dest) {\n\t return dest;\n\t }\n\t\n\t this.cache[ref] = dest;\n\t\n\t if (dest.$ref !== undefined) {\n\t dest = this.resolve(dest);\n\t }\n\t\n\t return dest;\n\t};\n\t\n\tSchemaResolver.prototype.resolve = function (schema) {\n\t if (!schema || typeof schema !== 'object' || schema.$ref === undefined) {\n\t return schema;\n\t }\n\t\n\t var ref = this.getNormalizedRef(schema) || schema.$ref,\n\t resolved = this.cache[ref];\n\t\n\t if (resolved !== undefined) {\n\t return resolved;\n\t }\n\t\n\t if (this.refStack.indexOf(ref) > -1) {\n\t throw new Error(CIRCULAR_SCHEMA_REFERENCE + ' ' + ref);\n\t }\n\t\n\t this.refStack.push(ref);\n\t\n\t resolved = this._resolveRef(ref);\n\t\n\t this.refStack.pop();\n\t\n\t if (schema === this.rootSchema) {\n\t // cache the resolved root schema\n\t this.resolvedRootSchema = resolved;\n\t }\n\t\n\t return resolved;\n\t};\n\t\n\tSchemaResolver.prototype.hasRef = function (schema) {\n\t var keys = Object.keys(schema),\n\t len, key, i, hasChildRef;\n\t\n\t if (keys.indexOf('$ref') > -1) {\n\t return true;\n\t }\n\t\n\t for (i = 0, len = keys.length; i < len; i++) {\n\t key = keys[i];\n\t\n\t if (schema[key] && typeof schema[key] === 'object' && !Array.isArray(schema[key])) {\n\t hasChildRef = this.hasRef(schema[key]);\n\t\n\t if (hasChildRef) {\n\t return true;\n\t }\n\t }\n\t }\n\t\n\t return false;\n\t};\n\t\n\tSchemaResolver.resolvePointer = function (obj, pointer) {\n\t var descriptor = refToObj(pointer),\n\t path = descriptor.path;\n\t\n\t if (descriptor.base) {\n\t path = [descriptor.base].concat(path);\n\t }\n\t\n\t return get(obj, path);\n\t};\n\t\n\tmodule.exports = SchemaResolver;\n\n/***/ },\n/* 16 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t// Copyright Joyent, Inc. and other Node contributors.\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a\n\t// copy of this software and associated documentation files (the\n\t// \"Software\"), to deal in the Software without restriction, including\n\t// without limitation the rights to use, copy, modify, merge, publish,\n\t// distribute, sublicense, and/or sell copies of the Software, and to permit\n\t// persons to whom the Software is furnished to do so, subject to the\n\t// following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included\n\t// in all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n\t// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\t// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n\t// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n\t// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n\t// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n\t// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\t\n\t'use strict';\n\t\n\tvar punycode = __webpack_require__(17);\n\tvar util = __webpack_require__(19);\n\t\n\texports.parse = urlParse;\n\texports.resolve = urlResolve;\n\texports.resolveObject = urlResolveObject;\n\texports.format = urlFormat;\n\t\n\texports.Url = Url;\n\t\n\tfunction Url() {\n\t this.protocol = null;\n\t this.slashes = null;\n\t this.auth = null;\n\t this.host = null;\n\t this.port = null;\n\t this.hostname = null;\n\t this.hash = null;\n\t this.search = null;\n\t this.query = null;\n\t this.pathname = null;\n\t this.path = null;\n\t this.href = null;\n\t}\n\t\n\t// Reference: RFC 3986, RFC 1808, RFC 2396\n\t\n\t// define these here so at least they only have to be\n\t// compiled once on the first module load.\n\tvar protocolPattern = /^([a-z0-9.+-]+:)/i,\n\t portPattern = /:[0-9]*$/,\n\t\n\t // Special case for a simple path URL\n\t simplePathPattern = /^(\\/\\/?(?!\\/)[^\\?\\s]*)(\\?[^\\s]*)?$/,\n\t\n\t // RFC 2396: characters reserved for delimiting URLs.\n\t // We actually just auto-escape these.\n\t delims = ['<', '>', '\"', '`', ' ', '\\r', '\\n', '\\t'],\n\t\n\t // RFC 2396: characters not allowed for various reasons.\n\t unwise = ['{', '}', '|', '\\\\', '^', '`'].concat(delims),\n\t\n\t // Allowed by RFCs, but cause of XSS attacks. Always escape these.\n\t autoEscape = ['\\''].concat(unwise),\n\t // Characters that are never ever allowed in a hostname.\n\t // Note that any invalid chars are also handled, but these\n\t // are the ones that are *expected* to be seen, so we fast-path\n\t // them.\n\t nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape),\n\t hostEndingChars = ['/', '?', '#'],\n\t hostnameMaxLen = 255,\n\t hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,\n\t hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,\n\t // protocols that can allow \"unsafe\" and \"unwise\" chars.\n\t unsafeProtocol = {\n\t 'javascript': true,\n\t 'javascript:': true\n\t },\n\t // protocols that never have a hostname.\n\t hostlessProtocol = {\n\t 'javascript': true,\n\t 'javascript:': true\n\t },\n\t // protocols that always contain a // bit.\n\t slashedProtocol = {\n\t 'http': true,\n\t 'https': true,\n\t 'ftp': true,\n\t 'gopher': true,\n\t 'file': true,\n\t 'http:': true,\n\t 'https:': true,\n\t 'ftp:': true,\n\t 'gopher:': true,\n\t 'file:': true\n\t },\n\t querystring = __webpack_require__(20);\n\t\n\tfunction urlParse(url, parseQueryString, slashesDenoteHost) {\n\t if (url && util.isObject(url) && url instanceof Url) return url;\n\t\n\t var u = new Url;\n\t u.parse(url, parseQueryString, slashesDenoteHost);\n\t return u;\n\t}\n\t\n\tUrl.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {\n\t if (!util.isString(url)) {\n\t throw new TypeError(\"Parameter 'url' must be a string, not \" + typeof url);\n\t }\n\t\n\t // Copy chrome, IE, opera backslash-handling behavior.\n\t // Back slashes before the query string get converted to forward slashes\n\t // See: https://code.google.com/p/chromium/issues/detail?id=25916\n\t var queryIndex = url.indexOf('?'),\n\t splitter =\n\t (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#',\n\t uSplit = url.split(splitter),\n\t slashRegex = /\\\\/g;\n\t uSplit[0] = uSplit[0].replace(slashRegex, '/');\n\t url = uSplit.join(splitter);\n\t\n\t var rest = url;\n\t\n\t // trim before proceeding.\n\t // This is to support parse stuff like \" http://foo.com \\n\"\n\t rest = rest.trim();\n\t\n\t if (!slashesDenoteHost && url.split('#').length === 1) {\n\t // Try fast path regexp\n\t var simplePath = simplePathPattern.exec(rest);\n\t if (simplePath) {\n\t this.path = rest;\n\t this.href = rest;\n\t this.pathname = simplePath[1];\n\t if (simplePath[2]) {\n\t this.search = simplePath[2];\n\t if (parseQueryString) {\n\t this.query = querystring.parse(this.search.substr(1));\n\t } else {\n\t this.query = this.search.substr(1);\n\t }\n\t } else if (parseQueryString) {\n\t this.search = '';\n\t this.query = {};\n\t }\n\t return this;\n\t }\n\t }\n\t\n\t var proto = protocolPattern.exec(rest);\n\t if (proto) {\n\t proto = proto[0];\n\t var lowerProto = proto.toLowerCase();\n\t this.protocol = lowerProto;\n\t rest = rest.substr(proto.length);\n\t }\n\t\n\t // figure out if it's got a host\n\t // user@server is *always* interpreted as a hostname, and url\n\t // resolution will treat //foo/bar as host=foo,path=bar because that's\n\t // how the browser resolves relative URLs.\n\t if (slashesDenoteHost || proto || rest.match(/^\\/\\/[^@\\/]+@[^@\\/]+/)) {\n\t var slashes = rest.substr(0, 2) === '//';\n\t if (slashes && !(proto && hostlessProtocol[proto])) {\n\t rest = rest.substr(2);\n\t this.slashes = true;\n\t }\n\t }\n\t\n\t if (!hostlessProtocol[proto] &&\n\t (slashes || (proto && !slashedProtocol[proto]))) {\n\t\n\t // there's a hostname.\n\t // the first instance of /, ?, ;, or # ends the host.\n\t //\n\t // If there is an @ in the hostname, then non-host chars *are* allowed\n\t // to the left of the last @ sign, unless some host-ending character\n\t // comes *before* the @-sign.\n\t // URLs are obnoxious.\n\t //\n\t // ex:\n\t // http://a@b@c/ => user:a@b host:c\n\t // http://a@b?@c => user:a host:c path:/?@c\n\t\n\t // v0.12 TODO(isaacs): This is not quite how Chrome does things.\n\t // Review our test case against browsers more comprehensively.\n\t\n\t // find the first instance of any hostEndingChars\n\t var hostEnd = -1;\n\t for (var i = 0; i < hostEndingChars.length; i++) {\n\t var hec = rest.indexOf(hostEndingChars[i]);\n\t if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n\t hostEnd = hec;\n\t }\n\t\n\t // at this point, either we have an explicit point where the\n\t // auth portion cannot go past, or the last @ char is the decider.\n\t var auth, atSign;\n\t if (hostEnd === -1) {\n\t // atSign can be anywhere.\n\t atSign = rest.lastIndexOf('@');\n\t } else {\n\t // atSign must be in auth portion.\n\t // http://a@b/c@d => host:b auth:a path:/c@d\n\t atSign = rest.lastIndexOf('@', hostEnd);\n\t }\n\t\n\t // Now we have a portion which is definitely the auth.\n\t // Pull that off.\n\t if (atSign !== -1) {\n\t auth = rest.slice(0, atSign);\n\t rest = rest.slice(atSign + 1);\n\t this.auth = decodeURIComponent(auth);\n\t }\n\t\n\t // the host is the remaining to the left of the first non-host char\n\t hostEnd = -1;\n\t for (var i = 0; i < nonHostChars.length; i++) {\n\t var hec = rest.indexOf(nonHostChars[i]);\n\t if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n\t hostEnd = hec;\n\t }\n\t // if we still have not hit it, then the entire thing is a host.\n\t if (hostEnd === -1)\n\t hostEnd = rest.length;\n\t\n\t this.host = rest.slice(0, hostEnd);\n\t rest = rest.slice(hostEnd);\n\t\n\t // pull out port.\n\t this.parseHost();\n\t\n\t // we've indicated that there is a hostname,\n\t // so even if it's empty, it has to be present.\n\t this.hostname = this.hostname || '';\n\t\n\t // if hostname begins with [ and ends with ]\n\t // assume that it's an IPv6 address.\n\t var ipv6Hostname = this.hostname[0] === '[' &&\n\t this.hostname[this.hostname.length - 1] === ']';\n\t\n\t // validate a little.\n\t if (!ipv6Hostname) {\n\t var hostparts = this.hostname.split(/\\./);\n\t for (var i = 0, l = hostparts.length; i < l; i++) {\n\t var part = hostparts[i];\n\t if (!part) continue;\n\t if (!part.match(hostnamePartPattern)) {\n\t var newpart = '';\n\t for (var j = 0, k = part.length; j < k; j++) {\n\t if (part.charCodeAt(j) > 127) {\n\t // we replace non-ASCII char with a temporary placeholder\n\t // we need this to make sure size of hostname is not\n\t // broken by replacing non-ASCII by nothing\n\t newpart += 'x';\n\t } else {\n\t newpart += part[j];\n\t }\n\t }\n\t // we test again with ASCII char only\n\t if (!newpart.match(hostnamePartPattern)) {\n\t var validParts = hostparts.slice(0, i);\n\t var notHost = hostparts.slice(i + 1);\n\t var bit = part.match(hostnamePartStart);\n\t if (bit) {\n\t validParts.push(bit[1]);\n\t notHost.unshift(bit[2]);\n\t }\n\t if (notHost.length) {\n\t rest = '/' + notHost.join('.') + rest;\n\t }\n\t this.hostname = validParts.join('.');\n\t break;\n\t }\n\t }\n\t }\n\t }\n\t\n\t if (this.hostname.length > hostnameMaxLen) {\n\t this.hostname = '';\n\t } else {\n\t // hostnames are always lower case.\n\t this.hostname = this.hostname.toLowerCase();\n\t }\n\t\n\t if (!ipv6Hostname) {\n\t // IDNA Support: Returns a punycoded representation of \"domain\".\n\t // It only converts parts of the domain name that\n\t // have non-ASCII characters, i.e. it doesn't matter if\n\t // you call it with a domain that already is ASCII-only.\n\t this.hostname = punycode.toASCII(this.hostname);\n\t }\n\t\n\t var p = this.port ? ':' + this.port : '';\n\t var h = this.hostname || '';\n\t this.host = h + p;\n\t this.href += this.host;\n\t\n\t // strip [ and ] from the hostname\n\t // the host field still retains them, though\n\t if (ipv6Hostname) {\n\t this.hostname = this.hostname.substr(1, this.hostname.length - 2);\n\t if (rest[0] !== '/') {\n\t rest = '/' + rest;\n\t }\n\t }\n\t }\n\t\n\t // now rest is set to the post-host stuff.\n\t // chop off any delim chars.\n\t if (!unsafeProtocol[lowerProto]) {\n\t\n\t // First, make 100% sure that any \"autoEscape\" chars get\n\t // escaped, even if encodeURIComponent doesn't think they\n\t // need to be.\n\t for (var i = 0, l = autoEscape.length; i < l; i++) {\n\t var ae = autoEscape[i];\n\t if (rest.indexOf(ae) === -1)\n\t continue;\n\t var esc = encodeURIComponent(ae);\n\t if (esc === ae) {\n\t esc = escape(ae);\n\t }\n\t rest = rest.split(ae).join(esc);\n\t }\n\t }\n\t\n\t\n\t // chop off from the tail first.\n\t var hash = rest.indexOf('#');\n\t if (hash !== -1) {\n\t // got a fragment string.\n\t this.hash = rest.substr(hash);\n\t rest = rest.slice(0, hash);\n\t }\n\t var qm = rest.indexOf('?');\n\t if (qm !== -1) {\n\t this.search = rest.substr(qm);\n\t this.query = rest.substr(qm + 1);\n\t if (parseQueryString) {\n\t this.query = querystring.parse(this.query);\n\t }\n\t rest = rest.slice(0, qm);\n\t } else if (parseQueryString) {\n\t // no query string, but parseQueryString still requested\n\t this.search = '';\n\t this.query = {};\n\t }\n\t if (rest) this.pathname = rest;\n\t if (slashedProtocol[lowerProto] &&\n\t this.hostname && !this.pathname) {\n\t this.pathname = '/';\n\t }\n\t\n\t //to support http.request\n\t if (this.pathname || this.search) {\n\t var p = this.pathname || '';\n\t var s = this.search || '';\n\t this.path = p + s;\n\t }\n\t\n\t // finally, reconstruct the href based on what has been validated.\n\t this.href = this.format();\n\t return this;\n\t};\n\t\n\t// format a parsed object into a url string\n\tfunction urlFormat(obj) {\n\t // ensure it's an object, and not a string url.\n\t // If it's an obj, this is a no-op.\n\t // this way, you can call url_format() on strings\n\t // to clean up potentially wonky urls.\n\t if (util.isString(obj)) obj = urlParse(obj);\n\t if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n\t return obj.format();\n\t}\n\t\n\tUrl.prototype.format = function() {\n\t var auth = this.auth || '';\n\t if (auth) {\n\t auth = encodeURIComponent(auth);\n\t auth = auth.replace(/%3A/i, ':');\n\t auth += '@';\n\t }\n\t\n\t var protocol = this.protocol || '',\n\t pathname = this.pathname || '',\n\t hash = this.hash || '',\n\t host = false,\n\t query = '';\n\t\n\t if (this.host) {\n\t host = auth + this.host;\n\t } else if (this.hostname) {\n\t host = auth + (this.hostname.indexOf(':') === -1 ?\n\t this.hostname :\n\t '[' + this.hostname + ']');\n\t if (this.port) {\n\t host += ':' + this.port;\n\t }\n\t }\n\t\n\t if (this.query &&\n\t util.isObject(this.query) &&\n\t Object.keys(this.query).length) {\n\t query = querystring.stringify(this.query);\n\t }\n\t\n\t var search = this.search || (query && ('?' + query)) || '';\n\t\n\t if (protocol && protocol.substr(-1) !== ':') protocol += ':';\n\t\n\t // only the slashedProtocols get the //. Not mailto:, xmpp:, etc.\n\t // unless they had them to begin with.\n\t if (this.slashes ||\n\t (!protocol || slashedProtocol[protocol]) && host !== false) {\n\t host = '//' + (host || '');\n\t if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname;\n\t } else if (!host) {\n\t host = '';\n\t }\n\t\n\t if (hash && hash.charAt(0) !== '#') hash = '#' + hash;\n\t if (search && search.charAt(0) !== '?') search = '?' + search;\n\t\n\t pathname = pathname.replace(/[?#]/g, function(match) {\n\t return encodeURIComponent(match);\n\t });\n\t search = search.replace('#', '%23');\n\t\n\t return protocol + host + pathname + search + hash;\n\t};\n\t\n\tfunction urlResolve(source, relative) {\n\t return urlParse(source, false, true).resolve(relative);\n\t}\n\t\n\tUrl.prototype.resolve = function(relative) {\n\t return this.resolveObject(urlParse(relative, false, true)).format();\n\t};\n\t\n\tfunction urlResolveObject(source, relative) {\n\t if (!source) return relative;\n\t return urlParse(source, false, true).resolveObject(relative);\n\t}\n\t\n\tUrl.prototype.resolveObject = function(relative) {\n\t if (util.isString(relative)) {\n\t var rel = new Url();\n\t rel.parse(relative, false, true);\n\t relative = rel;\n\t }\n\t\n\t var result = new Url();\n\t var tkeys = Object.keys(this);\n\t for (var tk = 0; tk < tkeys.length; tk++) {\n\t var tkey = tkeys[tk];\n\t result[tkey] = this[tkey];\n\t }\n\t\n\t // hash is always overridden, no matter what.\n\t // even href=\"\" will remove it.\n\t result.hash = relative.hash;\n\t\n\t // if the relative url is empty, then there's nothing left to do here.\n\t if (relative.href === '') {\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t // hrefs like //foo/bar always cut to the protocol.\n\t if (relative.slashes && !relative.protocol) {\n\t // take everything except the protocol from relative\n\t var rkeys = Object.keys(relative);\n\t for (var rk = 0; rk < rkeys.length; rk++) {\n\t var rkey = rkeys[rk];\n\t if (rkey !== 'protocol')\n\t result[rkey] = relative[rkey];\n\t }\n\t\n\t //urlParse appends trailing / to urls like http://www.example.com\n\t if (slashedProtocol[result.protocol] &&\n\t result.hostname && !result.pathname) {\n\t result.path = result.pathname = '/';\n\t }\n\t\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t if (relative.protocol && relative.protocol !== result.protocol) {\n\t // if it's a known url protocol, then changing\n\t // the protocol does weird things\n\t // first, if it's not file:, then we MUST have a host,\n\t // and if there was a path\n\t // to begin with, then we MUST have a path.\n\t // if it is file:, then the host is dropped,\n\t // because that's known to be hostless.\n\t // anything else is assumed to be absolute.\n\t if (!slashedProtocol[relative.protocol]) {\n\t var keys = Object.keys(relative);\n\t for (var v = 0; v < keys.length; v++) {\n\t var k = keys[v];\n\t result[k] = relative[k];\n\t }\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t result.protocol = relative.protocol;\n\t if (!relative.host && !hostlessProtocol[relative.protocol]) {\n\t var relPath = (relative.pathname || '').split('/');\n\t while (relPath.length && !(relative.host = relPath.shift()));\n\t if (!relative.host) relative.host = '';\n\t if (!relative.hostname) relative.hostname = '';\n\t if (relPath[0] !== '') relPath.unshift('');\n\t if (relPath.length < 2) relPath.unshift('');\n\t result.pathname = relPath.join('/');\n\t } else {\n\t result.pathname = relative.pathname;\n\t }\n\t result.search = relative.search;\n\t result.query = relative.query;\n\t result.host = relative.host || '';\n\t result.auth = relative.auth;\n\t result.hostname = relative.hostname || relative.host;\n\t result.port = relative.port;\n\t // to support http.request\n\t if (result.pathname || result.search) {\n\t var p = result.pathname || '';\n\t var s = result.search || '';\n\t result.path = p + s;\n\t }\n\t result.slashes = result.slashes || relative.slashes;\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'),\n\t isRelAbs = (\n\t relative.host ||\n\t relative.pathname && relative.pathname.charAt(0) === '/'\n\t ),\n\t mustEndAbs = (isRelAbs || isSourceAbs ||\n\t (result.host && relative.pathname)),\n\t removeAllDots = mustEndAbs,\n\t srcPath = result.pathname && result.pathname.split('/') || [],\n\t relPath = relative.pathname && relative.pathname.split('/') || [],\n\t psychotic = result.protocol && !slashedProtocol[result.protocol];\n\t\n\t // if the url is a non-slashed url, then relative\n\t // links like ../.. should be able\n\t // to crawl up to the hostname, as well. This is strange.\n\t // result.protocol has already been set by now.\n\t // Later on, put the first path part into the host field.\n\t if (psychotic) {\n\t result.hostname = '';\n\t result.port = null;\n\t if (result.host) {\n\t if (srcPath[0] === '') srcPath[0] = result.host;\n\t else srcPath.unshift(result.host);\n\t }\n\t result.host = '';\n\t if (relative.protocol) {\n\t relative.hostname = null;\n\t relative.port = null;\n\t if (relative.host) {\n\t if (relPath[0] === '') relPath[0] = relative.host;\n\t else relPath.unshift(relative.host);\n\t }\n\t relative.host = null;\n\t }\n\t mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === '');\n\t }\n\t\n\t if (isRelAbs) {\n\t // it's absolute.\n\t result.host = (relative.host || relative.host === '') ?\n\t relative.host : result.host;\n\t result.hostname = (relative.hostname || relative.hostname === '') ?\n\t relative.hostname : result.hostname;\n\t result.search = relative.search;\n\t result.query = relative.query;\n\t srcPath = relPath;\n\t // fall through to the dot-handling below.\n\t } else if (relPath.length) {\n\t // it's relative\n\t // throw away the existing file, and take the new path instead.\n\t if (!srcPath) srcPath = [];\n\t srcPath.pop();\n\t srcPath = srcPath.concat(relPath);\n\t result.search = relative.search;\n\t result.query = relative.query;\n\t } else if (!util.isNullOrUndefined(relative.search)) {\n\t // just pull out the search.\n\t // like href='https://github.com/?foo'.\n\t // Put this after the other two cases because it simplifies the booleans\n\t if (psychotic) {\n\t result.hostname = result.host = srcPath.shift();\n\t //occationaly the auth can get stuck only in host\n\t //this especially happens in cases like\n\t //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n\t var authInHost = result.host && result.host.indexOf('@') > 0 ?\n\t result.host.split('@') : false;\n\t if (authInHost) {\n\t result.auth = authInHost.shift();\n\t result.host = result.hostname = authInHost.shift();\n\t }\n\t }\n\t result.search = relative.search;\n\t result.query = relative.query;\n\t //to support http.request\n\t if (!util.isNull(result.pathname) || !util.isNull(result.search)) {\n\t result.path = (result.pathname ? result.pathname : '') +\n\t (result.search ? result.search : '');\n\t }\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t if (!srcPath.length) {\n\t // no path at all. easy.\n\t // we've already handled the other stuff above.\n\t result.pathname = null;\n\t //to support http.request\n\t if (result.search) {\n\t result.path = '/' + result.search;\n\t } else {\n\t result.path = null;\n\t }\n\t result.href = result.format();\n\t return result;\n\t }\n\t\n\t // if a url ENDs in . or .., then it must get a trailing slash.\n\t // however, if it ends in anything else non-slashy,\n\t // then it must NOT get a trailing slash.\n\t var last = srcPath.slice(-1)[0];\n\t var hasTrailingSlash = (\n\t (result.host || relative.host || srcPath.length > 1) &&\n\t (last === '.' || last === '..') || last === '');\n\t\n\t // strip single dots, resolve double dots to parent dir\n\t // if the path tries to go above the root, `up` ends up > 0\n\t var up = 0;\n\t for (var i = srcPath.length; i >= 0; i--) {\n\t last = srcPath[i];\n\t if (last === '.') {\n\t srcPath.splice(i, 1);\n\t } else if (last === '..') {\n\t srcPath.splice(i, 1);\n\t up++;\n\t } else if (up) {\n\t srcPath.splice(i, 1);\n\t up--;\n\t }\n\t }\n\t\n\t // if the path is allowed to go above the root, restore leading ..s\n\t if (!mustEndAbs && !removeAllDots) {\n\t for (; up--; up) {\n\t srcPath.unshift('..');\n\t }\n\t }\n\t\n\t if (mustEndAbs && srcPath[0] !== '' &&\n\t (!srcPath[0] || srcPath[0].charAt(0) !== '/')) {\n\t srcPath.unshift('');\n\t }\n\t\n\t if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) {\n\t srcPath.push('');\n\t }\n\t\n\t var isAbsolute = srcPath[0] === '' ||\n\t (srcPath[0] && srcPath[0].charAt(0) === '/');\n\t\n\t // put the host back\n\t if (psychotic) {\n\t result.hostname = result.host = isAbsolute ? '' :\n\t srcPath.length ? srcPath.shift() : '';\n\t //occationaly the auth can get stuck only in host\n\t //this especially happens in cases like\n\t //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n\t var authInHost = result.host && result.host.indexOf('@') > 0 ?\n\t result.host.split('@') : false;\n\t if (authInHost) {\n\t result.auth = authInHost.shift();\n\t result.host = result.hostname = authInHost.shift();\n\t }\n\t }\n\t\n\t mustEndAbs = mustEndAbs || (result.host && srcPath.length);\n\t\n\t if (mustEndAbs && !isAbsolute) {\n\t srcPath.unshift('');\n\t }\n\t\n\t if (!srcPath.length) {\n\t result.pathname = null;\n\t result.path = null;\n\t } else {\n\t result.pathname = srcPath.join('/');\n\t }\n\t\n\t //to support request.http\n\t if (!util.isNull(result.pathname) || !util.isNull(result.search)) {\n\t result.path = (result.pathname ? result.pathname : '') +\n\t (result.search ? result.search : '');\n\t }\n\t result.auth = relative.auth || result.auth;\n\t result.slashes = result.slashes || relative.slashes;\n\t result.href = result.format();\n\t return result;\n\t};\n\t\n\tUrl.prototype.parseHost = function() {\n\t var host = this.host;\n\t var port = portPattern.exec(host);\n\t if (port) {\n\t port = port[0];\n\t if (port !== ':') {\n\t this.port = port.substr(1);\n\t }\n\t host = host.substr(0, host.length - port.length);\n\t }\n\t if (host) this.hostname = host;\n\t};\n\n\n/***/ },\n/* 17 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(module, global) {/*! https://mths.be/punycode v1.3.2 by @mathias */\n\t;(function(root) {\n\t\n\t\t/** Detect free variables */\n\t\tvar freeExports = typeof exports == 'object' && exports &&\n\t\t\t!exports.nodeType && exports;\n\t\tvar freeModule = typeof module == 'object' && module &&\n\t\t\t!module.nodeType && module;\n\t\tvar freeGlobal = typeof global == 'object' && global;\n\t\tif (\n\t\t\tfreeGlobal.global === freeGlobal ||\n\t\t\tfreeGlobal.window === freeGlobal ||\n\t\t\tfreeGlobal.self === freeGlobal\n\t\t) {\n\t\t\troot = freeGlobal;\n\t\t}\n\t\n\t\t/**\n\t\t * The `punycode` object.\n\t\t * @name punycode\n\t\t * @type Object\n\t\t */\n\t\tvar punycode,\n\t\n\t\t/** Highest positive signed 32-bit float value */\n\t\tmaxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1\n\t\n\t\t/** Bootstring parameters */\n\t\tbase = 36,\n\t\ttMin = 1,\n\t\ttMax = 26,\n\t\tskew = 38,\n\t\tdamp = 700,\n\t\tinitialBias = 72,\n\t\tinitialN = 128, // 0x80\n\t\tdelimiter = '-', // '\\x2D'\n\t\n\t\t/** Regular expressions */\n\t\tregexPunycode = /^xn--/,\n\t\tregexNonASCII = /[^\\x20-\\x7E]/, // unprintable ASCII chars + non-ASCII chars\n\t\tregexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g, // RFC 3490 separators\n\t\n\t\t/** Error messages */\n\t\terrors = {\n\t\t\t'overflow': 'Overflow: input needs wider integers to process',\n\t\t\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t\t\t'invalid-input': 'Invalid input'\n\t\t},\n\t\n\t\t/** Convenience shortcuts */\n\t\tbaseMinusTMin = base - tMin,\n\t\tfloor = Math.floor,\n\t\tstringFromCharCode = String.fromCharCode,\n\t\n\t\t/** Temporary variable */\n\t\tkey;\n\t\n\t\t/*--------------------------------------------------------------------------*/\n\t\n\t\t/**\n\t\t * A generic error utility function.\n\t\t * @private\n\t\t * @param {String} type The error type.\n\t\t * @returns {Error} Throws a `RangeError` with the applicable error message.\n\t\t */\n\t\tfunction error(type) {\n\t\t\tthrow RangeError(errors[type]);\n\t\t}\n\t\n\t\t/**\n\t\t * A generic `Array#map` utility function.\n\t\t * @private\n\t\t * @param {Array} array The array to iterate over.\n\t\t * @param {Function} callback The function that gets called for every array\n\t\t * item.\n\t\t * @returns {Array} A new array of values returned by the callback function.\n\t\t */\n\t\tfunction map(array, fn) {\n\t\t\tvar length = array.length;\n\t\t\tvar result = [];\n\t\t\twhile (length--) {\n\t\t\t\tresult[length] = fn(array[length]);\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\n\t\t/**\n\t\t * A simple `Array#map`-like wrapper to work with domain name strings or email\n\t\t * addresses.\n\t\t * @private\n\t\t * @param {String} domain The domain name or email address.\n\t\t * @param {Function} callback The function that gets called for every\n\t\t * character.\n\t\t * @returns {Array} A new string of characters returned by the callback\n\t\t * function.\n\t\t */\n\t\tfunction mapDomain(string, fn) {\n\t\t\tvar parts = string.split('@');\n\t\t\tvar result = '';\n\t\t\tif (parts.length > 1) {\n\t\t\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t\t\t// the local part (i.e. everything up to `@`) intact.\n\t\t\t\tresult = parts[0] + '@';\n\t\t\t\tstring = parts[1];\n\t\t\t}\n\t\t\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\t\t\tstring = string.replace(regexSeparators, '\\x2E');\n\t\t\tvar labels = string.split('.');\n\t\t\tvar encoded = map(labels, fn).join('.');\n\t\t\treturn result + encoded;\n\t\t}\n\t\n\t\t/**\n\t\t * Creates an array containing the numeric code points of each Unicode\n\t\t * character in the string. While JavaScript uses UCS-2 internally,\n\t\t * this function will convert a pair of surrogate halves (each of which\n\t\t * UCS-2 exposes as separate characters) into a single code point,\n\t\t * matching UTF-16.\n\t\t * @see `punycode.ucs2.encode`\n\t\t * @see \n\t\t * @memberOf punycode.ucs2\n\t\t * @name decode\n\t\t * @param {String} string The Unicode input string (UCS-2).\n\t\t * @returns {Array} The new array of code points.\n\t\t */\n\t\tfunction ucs2decode(string) {\n\t\t\tvar output = [],\n\t\t\t counter = 0,\n\t\t\t length = string.length,\n\t\t\t value,\n\t\t\t extra;\n\t\t\twhile (counter < length) {\n\t\t\t\tvalue = string.charCodeAt(counter++);\n\t\t\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t\t\t// high surrogate, and there is a next character\n\t\t\t\t\textra = string.charCodeAt(counter++);\n\t\t\t\t\tif ((extra & 0xFC00) == 0xDC00) { // low surrogate\n\t\t\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// unmatched surrogate; only append this code unit, in case the next\n\t\t\t\t\t\t// code unit is the high surrogate of a surrogate pair\n\t\t\t\t\t\toutput.push(value);\n\t\t\t\t\t\tcounter--;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\toutput.push(value);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn output;\n\t\t}\n\t\n\t\t/**\n\t\t * Creates a string based on an array of numeric code points.\n\t\t * @see `punycode.ucs2.decode`\n\t\t * @memberOf punycode.ucs2\n\t\t * @name encode\n\t\t * @param {Array} codePoints The array of numeric code points.\n\t\t * @returns {String} The new Unicode string (UCS-2).\n\t\t */\n\t\tfunction ucs2encode(array) {\n\t\t\treturn map(array, function(value) {\n\t\t\t\tvar output = '';\n\t\t\t\tif (value > 0xFFFF) {\n\t\t\t\t\tvalue -= 0x10000;\n\t\t\t\t\toutput += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);\n\t\t\t\t\tvalue = 0xDC00 | value & 0x3FF;\n\t\t\t\t}\n\t\t\t\toutput += stringFromCharCode(value);\n\t\t\t\treturn output;\n\t\t\t}).join('');\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a basic code point into a digit/integer.\n\t\t * @see `digitToBasic()`\n\t\t * @private\n\t\t * @param {Number} codePoint The basic numeric code point value.\n\t\t * @returns {Number} The numeric value of a basic code point (for use in\n\t\t * representing integers) in the range `0` to `base - 1`, or `base` if\n\t\t * the code point does not represent a value.\n\t\t */\n\t\tfunction basicToDigit(codePoint) {\n\t\t\tif (codePoint - 48 < 10) {\n\t\t\t\treturn codePoint - 22;\n\t\t\t}\n\t\t\tif (codePoint - 65 < 26) {\n\t\t\t\treturn codePoint - 65;\n\t\t\t}\n\t\t\tif (codePoint - 97 < 26) {\n\t\t\t\treturn codePoint - 97;\n\t\t\t}\n\t\t\treturn base;\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a digit/integer into a basic code point.\n\t\t * @see `basicToDigit()`\n\t\t * @private\n\t\t * @param {Number} digit The numeric value of a basic code point.\n\t\t * @returns {Number} The basic code point whose value (when used for\n\t\t * representing integers) is `digit`, which needs to be in the range\n\t\t * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n\t\t * used; else, the lowercase form is used. The behavior is undefined\n\t\t * if `flag` is non-zero and `digit` has no uppercase form.\n\t\t */\n\t\tfunction digitToBasic(digit, flag) {\n\t\t\t// 0..25 map to ASCII a..z or A..Z\n\t\t\t// 26..35 map to ASCII 0..9\n\t\t\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n\t\t}\n\t\n\t\t/**\n\t\t * Bias adaptation function as per section 3.4 of RFC 3492.\n\t\t * http://tools.ietf.org/html/rfc3492#section-3.4\n\t\t * @private\n\t\t */\n\t\tfunction adapt(delta, numPoints, firstTime) {\n\t\t\tvar k = 0;\n\t\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\t\tdelta += floor(delta / numPoints);\n\t\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t\t}\n\t\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n\t\t * symbols.\n\t\t * @memberOf punycode\n\t\t * @param {String} input The Punycode string of ASCII-only symbols.\n\t\t * @returns {String} The resulting string of Unicode symbols.\n\t\t */\n\t\tfunction decode(input) {\n\t\t\t// Don't use UCS-2\n\t\t\tvar output = [],\n\t\t\t inputLength = input.length,\n\t\t\t out,\n\t\t\t i = 0,\n\t\t\t n = initialN,\n\t\t\t bias = initialBias,\n\t\t\t basic,\n\t\t\t j,\n\t\t\t index,\n\t\t\t oldi,\n\t\t\t w,\n\t\t\t k,\n\t\t\t digit,\n\t\t\t t,\n\t\t\t /** Cached calculation results */\n\t\t\t baseMinusT;\n\t\n\t\t\t// Handle the basic code points: let `basic` be the number of input code\n\t\t\t// points before the last delimiter, or `0` if there is none, then copy\n\t\t\t// the first basic code points to the output.\n\t\n\t\t\tbasic = input.lastIndexOf(delimiter);\n\t\t\tif (basic < 0) {\n\t\t\t\tbasic = 0;\n\t\t\t}\n\t\n\t\t\tfor (j = 0; j < basic; ++j) {\n\t\t\t\t// if it's not a basic code point\n\t\t\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\t\t\terror('not-basic');\n\t\t\t\t}\n\t\t\t\toutput.push(input.charCodeAt(j));\n\t\t\t}\n\t\n\t\t\t// Main decoding loop: start just after the last delimiter if any basic code\n\t\t\t// points were copied; start at the beginning otherwise.\n\t\n\t\t\tfor (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\t\n\t\t\t\t// `index` is the index of the next character to be consumed.\n\t\t\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t\t\t// which gets added to `i`. The overflow checking is easier\n\t\t\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t\t\t// value at the end to obtain `delta`.\n\t\t\t\tfor (oldi = i, w = 1, k = base; /* no condition */; k += base) {\n\t\n\t\t\t\t\tif (index >= inputLength) {\n\t\t\t\t\t\terror('invalid-input');\n\t\t\t\t\t}\n\t\n\t\t\t\t\tdigit = basicToDigit(input.charCodeAt(index++));\n\t\n\t\t\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\t\t\terror('overflow');\n\t\t\t\t\t}\n\t\n\t\t\t\t\ti += digit * w;\n\t\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\n\t\t\t\t\tif (digit < t) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tbaseMinusT = base - t;\n\t\t\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\t\t\terror('overflow');\n\t\t\t\t\t}\n\t\n\t\t\t\t\tw *= baseMinusT;\n\t\n\t\t\t\t}\n\t\n\t\t\t\tout = output.length + 1;\n\t\t\t\tbias = adapt(i - oldi, out, oldi == 0);\n\t\n\t\t\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t\t\t// incrementing `n` each time, so we'll fix that now:\n\t\t\t\tif (floor(i / out) > maxInt - n) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\t\n\t\t\t\tn += floor(i / out);\n\t\t\t\ti %= out;\n\t\n\t\t\t\t// Insert `n` at position `i` of the output\n\t\t\t\toutput.splice(i++, 0, n);\n\t\n\t\t\t}\n\t\n\t\t\treturn ucs2encode(output);\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a string of Unicode symbols (e.g. a domain name label) to a\n\t\t * Punycode string of ASCII-only symbols.\n\t\t * @memberOf punycode\n\t\t * @param {String} input The string of Unicode symbols.\n\t\t * @returns {String} The resulting Punycode string of ASCII-only symbols.\n\t\t */\n\t\tfunction encode(input) {\n\t\t\tvar n,\n\t\t\t delta,\n\t\t\t handledCPCount,\n\t\t\t basicLength,\n\t\t\t bias,\n\t\t\t j,\n\t\t\t m,\n\t\t\t q,\n\t\t\t k,\n\t\t\t t,\n\t\t\t currentValue,\n\t\t\t output = [],\n\t\t\t /** `inputLength` will hold the number of code points in `input`. */\n\t\t\t inputLength,\n\t\t\t /** Cached calculation results */\n\t\t\t handledCPCountPlusOne,\n\t\t\t baseMinusT,\n\t\t\t qMinusT;\n\t\n\t\t\t// Convert the input in UCS-2 to Unicode\n\t\t\tinput = ucs2decode(input);\n\t\n\t\t\t// Cache the length\n\t\t\tinputLength = input.length;\n\t\n\t\t\t// Initialize the state\n\t\t\tn = initialN;\n\t\t\tdelta = 0;\n\t\t\tbias = initialBias;\n\t\n\t\t\t// Handle the basic code points\n\t\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\t\tcurrentValue = input[j];\n\t\t\t\tif (currentValue < 0x80) {\n\t\t\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\thandledCPCount = basicLength = output.length;\n\t\n\t\t\t// `handledCPCount` is the number of code points that have been handled;\n\t\t\t// `basicLength` is the number of basic code points.\n\t\n\t\t\t// Finish the basic string - if it is not empty - with a delimiter\n\t\t\tif (basicLength) {\n\t\t\t\toutput.push(delimiter);\n\t\t\t}\n\t\n\t\t\t// Main encoding loop:\n\t\t\twhile (handledCPCount < inputLength) {\n\t\n\t\t\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t\t\t// larger one:\n\t\t\t\tfor (m = maxInt, j = 0; j < inputLength; ++j) {\n\t\t\t\t\tcurrentValue = input[j];\n\t\t\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\t\t\tm = currentValue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\t// Increase `delta` enough to advance the decoder's state to ,\n\t\t\t\t// but guard against overflow\n\t\t\t\thandledCPCountPlusOne = handledCPCount + 1;\n\t\t\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\t\n\t\t\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\t\t\tn = m;\n\t\n\t\t\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\t\t\tcurrentValue = input[j];\n\t\n\t\t\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\t\t\terror('overflow');\n\t\t\t\t\t}\n\t\n\t\t\t\t\tif (currentValue == n) {\n\t\t\t\t\t\t// Represent delta as a generalized variable-length integer\n\t\t\t\t\t\tfor (q = delta, k = base; /* no condition */; k += base) {\n\t\t\t\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tqMinusT = q - t;\n\t\t\t\t\t\t\tbaseMinusT = base - t;\n\t\t\t\t\t\t\toutput.push(\n\t\t\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\t\t\tdelta = 0;\n\t\t\t\t\t\t++handledCPCount;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\t++delta;\n\t\t\t\t++n;\n\t\n\t\t\t}\n\t\t\treturn output.join('');\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a Punycode string representing a domain name or an email address\n\t\t * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n\t\t * it doesn't matter if you call it on a string that has already been\n\t\t * converted to Unicode.\n\t\t * @memberOf punycode\n\t\t * @param {String} input The Punycoded domain name or email address to\n\t\t * convert to Unicode.\n\t\t * @returns {String} The Unicode representation of the given Punycode\n\t\t * string.\n\t\t */\n\t\tfunction toUnicode(input) {\n\t\t\treturn mapDomain(input, function(string) {\n\t\t\t\treturn regexPunycode.test(string)\n\t\t\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t\t\t: string;\n\t\t\t});\n\t\t}\n\t\n\t\t/**\n\t\t * Converts a Unicode string representing a domain name or an email address to\n\t\t * Punycode. Only the non-ASCII parts of the domain name will be converted,\n\t\t * i.e. it doesn't matter if you call it with a domain that's already in\n\t\t * ASCII.\n\t\t * @memberOf punycode\n\t\t * @param {String} input The domain name or email address to convert, as a\n\t\t * Unicode string.\n\t\t * @returns {String} The Punycode representation of the given domain name or\n\t\t * email address.\n\t\t */\n\t\tfunction toASCII(input) {\n\t\t\treturn mapDomain(input, function(string) {\n\t\t\t\treturn regexNonASCII.test(string)\n\t\t\t\t\t? 'xn--' + encode(string)\n\t\t\t\t\t: string;\n\t\t\t});\n\t\t}\n\t\n\t\t/*--------------------------------------------------------------------------*/\n\t\n\t\t/** Define the public API */\n\t\tpunycode = {\n\t\t\t/**\n\t\t\t * A string representing the current Punycode.js version number.\n\t\t\t * @memberOf punycode\n\t\t\t * @type String\n\t\t\t */\n\t\t\t'version': '1.3.2',\n\t\t\t/**\n\t\t\t * An object of methods to convert from JavaScript's internal character\n\t\t\t * representation (UCS-2) to Unicode code points, and back.\n\t\t\t * @see \n\t\t\t * @memberOf punycode\n\t\t\t * @type Object\n\t\t\t */\n\t\t\t'ucs2': {\n\t\t\t\t'decode': ucs2decode,\n\t\t\t\t'encode': ucs2encode\n\t\t\t},\n\t\t\t'decode': decode,\n\t\t\t'encode': encode,\n\t\t\t'toASCII': toASCII,\n\t\t\t'toUnicode': toUnicode\n\t\t};\n\t\n\t\t/** Expose `punycode` */\n\t\t// Some AMD build optimizers, like r.js, check for specific condition patterns\n\t\t// like the following:\n\t\tif (\n\t\t\ttrue\n\t\t) {\n\t\t\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function() {\n\t\t\t\treturn punycode;\n\t\t\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t\t} else if (freeExports && freeModule) {\n\t\t\tif (module.exports == freeExports) { // in Node.js or RingoJS v0.8.0+\n\t\t\t\tfreeModule.exports = punycode;\n\t\t\t} else { // in Narwhal or RingoJS v0.7.0-\n\t\t\t\tfor (key in punycode) {\n\t\t\t\t\tpunycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]);\n\t\t\t\t}\n\t\t\t}\n\t\t} else { // in Rhino or a web browser\n\t\t\troot.punycode = punycode;\n\t\t}\n\t\n\t}(this));\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(18)(module), (function() { return this; }())))\n\n/***/ },\n/* 18 */\n/***/ function(module, exports) {\n\n\tmodule.exports = function(module) {\r\n\t\tif(!module.webpackPolyfill) {\r\n\t\t\tmodule.deprecate = function() {};\r\n\t\t\tmodule.paths = [];\r\n\t\t\t// module.parent = undefined by default\r\n\t\t\tmodule.children = [];\r\n\t\t\tmodule.webpackPolyfill = 1;\r\n\t\t}\r\n\t\treturn module;\r\n\t}\r\n\n\n/***/ },\n/* 19 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = {\n\t isString: function(arg) {\n\t return typeof(arg) === 'string';\n\t },\n\t isObject: function(arg) {\n\t return typeof(arg) === 'object' && arg !== null;\n\t },\n\t isNull: function(arg) {\n\t return arg === null;\n\t },\n\t isNullOrUndefined: function(arg) {\n\t return arg == null;\n\t }\n\t};\n\n\n/***/ },\n/* 20 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\texports.decode = exports.parse = __webpack_require__(21);\n\texports.encode = exports.stringify = __webpack_require__(22);\n\n\n/***/ },\n/* 21 */\n/***/ function(module, exports) {\n\n\t// Copyright Joyent, Inc. and other Node contributors.\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a\n\t// copy of this software and associated documentation files (the\n\t// \"Software\"), to deal in the Software without restriction, including\n\t// without limitation the rights to use, copy, modify, merge, publish,\n\t// distribute, sublicense, and/or sell copies of the Software, and to permit\n\t// persons to whom the Software is furnished to do so, subject to the\n\t// following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included\n\t// in all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n\t// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\t// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n\t// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n\t// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n\t// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n\t// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\t\n\t'use strict';\n\t\n\t// If obj.hasOwnProperty has been overridden, then calling\n\t// obj.hasOwnProperty(prop) will break.\n\t// See: https://github.com/joyent/node/issues/1707\n\tfunction hasOwnProperty(obj, prop) {\n\t return Object.prototype.hasOwnProperty.call(obj, prop);\n\t}\n\t\n\tmodule.exports = function(qs, sep, eq, options) {\n\t sep = sep || '&';\n\t eq = eq || '=';\n\t var obj = {};\n\t\n\t if (typeof qs !== 'string' || qs.length === 0) {\n\t return obj;\n\t }\n\t\n\t var regexp = /\\+/g;\n\t qs = qs.split(sep);\n\t\n\t var maxKeys = 1000;\n\t if (options && typeof options.maxKeys === 'number') {\n\t maxKeys = options.maxKeys;\n\t }\n\t\n\t var len = qs.length;\n\t // maxKeys <= 0 means that we should not limit keys count\n\t if (maxKeys > 0 && len > maxKeys) {\n\t len = maxKeys;\n\t }\n\t\n\t for (var i = 0; i < len; ++i) {\n\t var x = qs[i].replace(regexp, '%20'),\n\t idx = x.indexOf(eq),\n\t kstr, vstr, k, v;\n\t\n\t if (idx >= 0) {\n\t kstr = x.substr(0, idx);\n\t vstr = x.substr(idx + 1);\n\t } else {\n\t kstr = x;\n\t vstr = '';\n\t }\n\t\n\t k = decodeURIComponent(kstr);\n\t v = decodeURIComponent(vstr);\n\t\n\t if (!hasOwnProperty(obj, k)) {\n\t obj[k] = v;\n\t } else if (Array.isArray(obj[k])) {\n\t obj[k].push(v);\n\t } else {\n\t obj[k] = [obj[k], v];\n\t }\n\t }\n\t\n\t return obj;\n\t};\n\n\n/***/ },\n/* 22 */\n/***/ function(module, exports) {\n\n\t// Copyright Joyent, Inc. and other Node contributors.\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a\n\t// copy of this software and associated documentation files (the\n\t// \"Software\"), to deal in the Software without restriction, including\n\t// without limitation the rights to use, copy, modify, merge, publish,\n\t// distribute, sublicense, and/or sell copies of the Software, and to permit\n\t// persons to whom the Software is furnished to do so, subject to the\n\t// following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included\n\t// in all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n\t// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\t// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n\t// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n\t// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n\t// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n\t// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\t\n\t'use strict';\n\t\n\tvar stringifyPrimitive = function(v) {\n\t switch (typeof v) {\n\t case 'string':\n\t return v;\n\t\n\t case 'boolean':\n\t return v ? 'true' : 'false';\n\t\n\t case 'number':\n\t return isFinite(v) ? v : '';\n\t\n\t default:\n\t return '';\n\t }\n\t};\n\t\n\tmodule.exports = function(obj, sep, eq, name) {\n\t sep = sep || '&';\n\t eq = eq || '=';\n\t if (obj === null) {\n\t obj = undefined;\n\t }\n\t\n\t if (typeof obj === 'object') {\n\t return Object.keys(obj).map(function(k) {\n\t var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;\n\t if (Array.isArray(obj[k])) {\n\t return obj[k].map(function(v) {\n\t return ks + encodeURIComponent(stringifyPrimitive(v));\n\t }).join(sep);\n\t } else {\n\t return ks + encodeURIComponent(stringifyPrimitive(obj[k]));\n\t }\n\t }).join(sep);\n\t\n\t }\n\t\n\t if (!name) return '';\n\t return encodeURIComponent(stringifyPrimitive(name)) + eq +\n\t encodeURIComponent(stringifyPrimitive(obj));\n\t};\n\n\n/***/ },\n/* 23 */\n/***/ function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"id\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"$schema\": \"http://json-schema.org/draft-04/schema#\",\n\t\t\"description\": \"Core schema meta-schema\",\n\t\t\"definitions\": {\n\t\t\t\"schemaArray\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"minItems\": 1,\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"positiveInteger\": {\n\t\t\t\t\"type\": \"integer\",\n\t\t\t\t\"minimum\": 0\n\t\t\t},\n\t\t\t\"positiveIntegerDefault0\": {\n\t\t\t\t\"allOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#/definitions/positiveInteger\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"default\": 0\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"simpleTypes\": {\n\t\t\t\t\"enum\": [\n\t\t\t\t\t\"array\",\n\t\t\t\t\t\"boolean\",\n\t\t\t\t\t\"integer\",\n\t\t\t\t\t\"null\",\n\t\t\t\t\t\"number\",\n\t\t\t\t\t\"object\",\n\t\t\t\t\t\"string\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"stringArray\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": {\n\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t},\n\t\t\t\t\"minItems\": 1,\n\t\t\t\t\"uniqueItems\": true\n\t\t\t}\n\t\t},\n\t\t\"type\": \"object\",\n\t\t\"properties\": {\n\t\t\t\"id\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"uri\"\n\t\t\t},\n\t\t\t\"$schema\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"uri\"\n\t\t\t},\n\t\t\t\"title\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"description\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"default\": {},\n\t\t\t\"multipleOf\": {\n\t\t\t\t\"type\": \"number\",\n\t\t\t\t\"minimum\": 0,\n\t\t\t\t\"exclusiveMinimum\": true\n\t\t\t},\n\t\t\t\"maximum\": {\n\t\t\t\t\"type\": \"number\"\n\t\t\t},\n\t\t\t\"exclusiveMaximum\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"minimum\": {\n\t\t\t\t\"type\": \"number\"\n\t\t\t},\n\t\t\t\"exclusiveMinimum\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"maxLength\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveInteger\"\n\t\t\t},\n\t\t\t\"minLength\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveIntegerDefault0\"\n\t\t\t},\n\t\t\t\"pattern\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"regex\"\n\t\t\t},\n\t\t\t\"additionalItems\": {\n\t\t\t\t\"anyOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"boolean\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"items\": {\n\t\t\t\t\"anyOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#/definitions/schemaArray\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"maxItems\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveInteger\"\n\t\t\t},\n\t\t\t\"minItems\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveIntegerDefault0\"\n\t\t\t},\n\t\t\t\"uniqueItems\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"maxProperties\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveInteger\"\n\t\t\t},\n\t\t\t\"minProperties\": {\n\t\t\t\t\"$ref\": \"#/definitions/positiveIntegerDefault0\"\n\t\t\t},\n\t\t\t\"required\": {\n\t\t\t\t\"$ref\": \"#/definitions/stringArray\"\n\t\t\t},\n\t\t\t\"additionalProperties\": {\n\t\t\t\t\"anyOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"boolean\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"definitions\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": {\n\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t},\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"properties\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": {\n\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t},\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"patternProperties\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": {\n\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t},\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"dependencies\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": {\n\t\t\t\t\t\"anyOf\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"$ref\": \"#\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"$ref\": \"#/definitions/stringArray\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"enum\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"minItems\": 1,\n\t\t\t\t\"uniqueItems\": true\n\t\t\t},\n\t\t\t\"type\": {\n\t\t\t\t\"anyOf\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"$ref\": \"#/definitions/simpleTypes\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"array\",\n\t\t\t\t\t\t\"items\": {\n\t\t\t\t\t\t\t\"$ref\": \"#/definitions/simpleTypes\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"minItems\": 1,\n\t\t\t\t\t\t\"uniqueItems\": true\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"allOf\": {\n\t\t\t\t\"$ref\": \"#/definitions/schemaArray\"\n\t\t\t},\n\t\t\t\"anyOf\": {\n\t\t\t\t\"$ref\": \"#/definitions/schemaArray\"\n\t\t\t},\n\t\t\t\"oneOf\": {\n\t\t\t\t\"$ref\": \"#/definitions/schemaArray\"\n\t\t\t},\n\t\t\t\"not\": {\n\t\t\t\t\"$ref\": \"#\"\n\t\t\t}\n\t\t},\n\t\t\"dependencies\": {\n\t\t\t\"exclusiveMaximum\": [\n\t\t\t\t\"maximum\"\n\t\t\t],\n\t\t\t\"exclusiveMinimum\": [\n\t\t\t\t\"minimum\"\n\t\t\t]\n\t\t},\n\t\t\"default\": {}\n\t};\n\n/***/ },\n/* 24 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tvar formats = {};\n\t\n\t// reference: http://dansnetwork.com/javascript-iso8601rfc3339-date-parser/\n\tformats['date-time'] = /(\\d\\d\\d\\d)(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))/;\n\t// reference: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js#L7\n\tformats.uri = /^([a-zA-Z][a-zA-Z0-9+-.]*:){0,1}\\/\\/[^\\s]*$/;\n\t// reference: http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363\n\t// http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'willful violation')\n\tformats.email = /^[a-zA-Z0-9.!#$%&'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n\t// reference: https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html\n\tformats.ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;\n\t// reference: http://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses\n\tformats.ipv6 = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|[fF][eE]80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::([fF]{4}(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;\n\t// reference: http://stackoverflow.com/questions/106179/regular-expression-to-match-dns-hostname-or-ip-address#answer-3824105\n\tformats.hostname = /^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])(\\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]))*$/;\n\t\n\tmodule.exports = formats;\n\n/***/ },\n/* 25 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\t// Reference: https://github.com/bestiejs/punycode.js/blob/master/punycode.js#L101`\n\t// Info: https://mathiasbynens.be/notes/javascript-unicode\n\tfunction ucs2length(string) {\n\t var ucs2len = 0,\n\t counter = 0,\n\t length = string.length,\n\t value, extra;\n\t\n\t while (counter < length) {\n\t ucs2len++;\n\t value = string.charCodeAt(counter++);\n\t\n\t if (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t // It's a high surrogate, and there is a next character.\n\t extra = string.charCodeAt(counter++);\n\t\n\t if ((extra & 0xFC00) !== 0xDC00) { /* Low surrogate. */ // jshint ignore: line\n\t counter--;\n\t }\n\t }\n\t }\n\t\n\t return ucs2len;\n\t}\n\t\n\tmodule.exports = ucs2length;\n\n/***/ }\n/******/ ])\n});\n;\n//# sourceMappingURL=models.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/powerbi-models/dist/models.js\n// module id = 5\n// module chunks = 0","import { IFilterable } from './ifilterable';\r\nimport { IReportNode } from './report';\r\nimport * as models from 'powerbi-models';\r\n\r\n/**\r\n * A Page node within a report hierarchy\r\n * \r\n * @export\r\n * @interface IPageNode\r\n */\r\nexport interface IPageNode {\r\n report: IReportNode;\r\n name: string;\r\n}\r\n\r\n/**\r\n * A Power BI report page\r\n * \r\n * @export\r\n * @class Page\r\n * @implements {IPageNode}\r\n * @implements {IFilterable}\r\n */\r\nexport class Page implements IPageNode, IFilterable {\r\n /**\r\n * The parent Power BI report that this page is a member of\r\n * \r\n * @type {IReportNode}\r\n */\r\n report: IReportNode;\r\n /**\r\n * The report page name\r\n * \r\n * @type {string}\r\n */\r\n name: string;\r\n\r\n /**\r\n * The user defined display name of the report page, which is undefined if the page is created manually\r\n * \r\n * @type {string}\r\n */\r\n displayName: string;\r\n\r\n /**\r\n * Creates an instance of a Power BI report page.\r\n * \r\n * @param {IReportNode} report\r\n * @param {string} name\r\n * @param {string} [displayName]\r\n */\r\n constructor(report: IReportNode, name: string, displayName?: string) {\r\n this.report = report;\r\n this.name = name;\r\n this.displayName = displayName;\r\n }\r\n\r\n /**\r\n * Gets all page level filters within the report.\r\n * \r\n * ```javascript\r\n * page.getFilters()\r\n * .then(pages => { ... });\r\n * ```\r\n * \r\n * @returns {(Promise)}\r\n */\r\n getFilters(): Promise {\r\n return this.report.service.hpm.get(`/report/pages/${this.name}/filters`, { uid: this.report.config.uniqueId }, this.report.iframe.contentWindow)\r\n .then(response => response.body,\r\n response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Removes all filters from this page of the report.\r\n * \r\n * ```javascript\r\n * page.removeFilters();\r\n * ```\r\n * \r\n * @returns {Promise}\r\n */\r\n removeFilters(): Promise {\r\n return this.setFilters([]);\r\n }\r\n\r\n /**\r\n * Makes the current page the active page of the report.\r\n * \r\n * ```javascripot\r\n * page.setActive();\r\n * ```\r\n * \r\n * @returns {Promise}\r\n */\r\n setActive(): Promise {\r\n const page: models.IPage = {\r\n name: this.name,\r\n displayName: null\r\n };\r\n\r\n return this.report.service.hpm.put('/report/pages/active', page, { uid: this.report.config.uniqueId }, this.report.iframe.contentWindow)\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n\r\n /**\r\n * Sets all filters on the current page.\r\n * \r\n * ```javascript\r\n * page.setFilters(filters);\r\n * .catch(errors => { ... });\r\n * ```\r\n * \r\n * @param {(models.IFilter[])} filters\r\n * @returns {Promise}\r\n */\r\n setFilters(filters: models.IFilter[]): Promise {\r\n return this.report.service.hpm.put(`/report/pages/${this.name}/filters`, filters, { uid: this.report.config.uniqueId }, this.report.iframe.contentWindow)\r\n .catch(response => {\r\n throw response.body;\r\n });\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/page.ts","import * as service from './service';\r\nimport * as models from 'powerbi-models';\r\nimport * as embed from './embed';\r\n\r\nexport class Create extends embed.Embed {\r\n\r\n constructor(service: service.Service, element: HTMLElement, config: embed.IEmbedConfiguration) {\r\n super(service, element, config);\r\n }\r\n\r\n /**\r\n * Gets the dataset ID from the first available location: createConfig or embed url.\r\n * \r\n * @returns {string}\r\n */\r\n getId(): string {\r\n const datasetId = (this.createConfig && this.createConfig.datasetId) ? this.createConfig.datasetId : Create.findIdFromEmbedUrl(this.config.embedUrl);\r\n\r\n if (typeof datasetId !== 'string' || datasetId.length === 0) {\r\n throw new Error('Dataset id is required, but it was not found. You must provide an id either as part of embed configuration.');\r\n }\r\n\r\n return datasetId;\r\n }\r\n\r\n /**\r\n * Validate create report configuration.\r\n */\r\n validate(config: models.IReportCreateConfiguration): models.IError[] {\r\n return models.validateCreateReport(config);\r\n }\r\n\r\n /**\r\n * Adds the ability to get datasetId from url. \r\n * (e.g. http://embedded.powerbi.com/appTokenReportEmbed?datasetId=854846ed-2106-4dc2-bc58-eb77533bf2f1).\r\n * \r\n * By extracting the ID we can ensure that the ID is always explicitly provided as part of the create configuration.\r\n * \r\n * @static\r\n * @param {string} url\r\n * @returns {string}\r\n */\r\n static findIdFromEmbedUrl(url: string): string {\r\n const datasetIdRegEx = /datasetId=\"?([^&]+)\"?/\r\n const datasetIdMatch = url.match(datasetIdRegEx);\r\n\r\n let datasetId;\r\n if (datasetIdMatch) {\r\n datasetId = datasetIdMatch[1];\r\n }\r\n\r\n return datasetId;\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/create.ts","import * as service from './service';\r\nimport * as embed from './embed';\r\nimport * as models from 'powerbi-models';\r\nimport * as wpmp from 'window-post-message-proxy';\r\nimport * as hpm from 'http-post-message';\r\nimport * as utils from './util';\r\n\r\n/**\r\n * A Dashboard node within a dashboard hierarchy\r\n * \r\n * @export\r\n * @interface IDashboardNode\r\n */\r\nexport interface IDashboardNode {\r\n iframe: HTMLIFrameElement;\r\n service: service.IService;\r\n config: embed.IInternalEmbedConfiguration\r\n}\r\n\r\n/**\r\n * A Power BI Dashboard embed component\r\n * \r\n * @export\r\n * @class Dashboard\r\n * @extends {embed.Embed}\r\n * @implements {IDashboardNode}\r\n * @implements {IFilterable}\r\n */\r\nexport class Dashboard extends embed.Embed implements IDashboardNode {\r\n static allowedEvents = [\"tileClicked\", \"error\"];\r\n static dashboardIdAttribute = 'powerbi-dashboard-id';\r\n static typeAttribute = 'powerbi-type';\r\n static type = \"Dashboard\";\r\n\r\n /**\r\n * Creates an instance of a Power BI Dashboard.\r\n * \r\n * @param {service.Service} service\r\n * @param {HTMLElement} element\r\n */\r\n constructor(service: service.Service, element: HTMLElement, config: embed.IEmbedConfiguration) {\r\n super(service, element, config);\r\n this.loadPath = \"/dashboard/load\";\r\n Array.prototype.push.apply(this.allowedEvents, Dashboard.allowedEvents);\r\n }\r\n\r\n /**\r\n * This adds backwards compatibility for older config which used the dashboardId query param to specify dashboard id.\r\n * E.g. https://powerbi-df.analysis-df.windows.net/dashboardEmbedHost?dashboardId=e9363c62-edb6-4eac-92d3-2199c5ca2a9e\r\n * \r\n * By extracting the id we can ensure id is always explicitly provided as part of the load configuration.\r\n * \r\n * @static\r\n * @param {string} url\r\n * @returns {string}\r\n */\r\n static findIdFromEmbedUrl(url: string): string {\r\n const dashboardIdRegEx = /dashboardId=\"?([^&]+)\"?/\r\n const dashboardIdMatch = url.match(dashboardIdRegEx);\r\n\r\n let dashboardId;\r\n if (dashboardIdMatch) {\r\n dashboardId = dashboardIdMatch[1];\r\n }\r\n\r\n return dashboardId;\r\n }\r\n\r\n /**\r\n * Get dashboard id from first available location: options, attribute, embed url.\r\n * \r\n * @returns {string}\r\n */\r\n getId(): string {\r\n const dashboardId = this.config.id || this.element.getAttribute(Dashboard.dashboardIdAttribute) || Dashboard.findIdFromEmbedUrl(this.config.embedUrl);\r\n\r\n if (typeof dashboardId !== 'string' || dashboardId.length === 0) {\r\n throw new Error(`Dashboard id is required, but it was not found. You must provide an id either as part of embed configuration or as attribute '${Dashboard.dashboardIdAttribute}'.`);\r\n }\r\n\r\n return dashboardId;\r\n }\r\n\r\n /**\r\n * Validate load configuration.\r\n */\r\n validate(config: models.IDashboardLoadConfiguration): models.IError[] {\r\n let error = models.validateDashboardLoad(config);\r\n return error ? error : this.ValidatePageView(config.pageView);\r\n }\r\n \r\n /**\r\n * Validate that pageView has a legal value: if page view is defined it must have one of the values defined in models.PageView\r\n */\r\n private ValidatePageView(pageView: models.PageView): models.IError[] {\r\n if (pageView && pageView !== \"fitToWidth\" && pageView !== \"oneColumn\" && pageView !== \"actualSize\") {\r\n return [{message: \"pageView must be one of the followings: fitToWidth, oneColumn, actualSize\"}];\r\n }\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/dashboard.ts","import * as models from 'powerbi-models';\r\nimport { Embed } from './embed';\r\n\r\n/**\r\n * The Power BI tile embed component\r\n * \r\n * @export\r\n * @class Tile\r\n * @extends {Embed}\r\n */\r\nexport class Tile extends Embed {\r\n static type = \"Tile\";\r\n\r\n /**\r\n * The ID of the tile\r\n * \r\n * @returns {string}\r\n */\r\n getId(): string {\r\n throw new Error('Not implemented. Embedding tiles is not supported yet.');\r\n }\r\n\r\n /**\r\n * Validate load configuration.\r\n */\r\n validate(config: any): models.IError[] {\r\n throw new Error('Not implemented. Embedding tiles is not supported yet.');\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/tile.ts","/**\r\n * TODO: Need to find better place for these factory functions or refactor how we handle dependency injection\r\n */\r\nimport { IHpmFactory, IWpmpFactory, IRouterFactory } from './service';\r\nimport config from './config';\r\nimport * as wpmp from 'window-post-message-proxy';\r\nimport * as hpm from 'http-post-message';\r\nimport * as router from 'powerbi-router';\r\n\r\nexport {\r\n IHpmFactory,\r\n IWpmpFactory,\r\n IRouterFactory\r\n};\r\n\r\nexport const hpmFactory: IHpmFactory = (wpmp, defaultTargetWindow, sdkVersion = config.version, sdkType = config.type) => {\r\n return new hpm.HttpPostMessage(wpmp, {\r\n 'x-sdk-type': sdkType,\r\n 'x-sdk-version': sdkVersion\r\n }, defaultTargetWindow);\r\n};\r\n\r\nexport const wpmpFactory: IWpmpFactory = (name?: string, logMessages?: boolean, eventSourceOverrideWindow?: Window) => {\r\n return new wpmp.WindowPostMessageProxy({\r\n processTrackingProperties: {\r\n addTrackingProperties: hpm.HttpPostMessage.addTrackingProperties,\r\n getTrackingProperties: hpm.HttpPostMessage.getTrackingProperties,\r\n },\r\n isErrorMessage: hpm.HttpPostMessage.isErrorMessage,\r\n name,\r\n logMessages,\r\n eventSourceOverrideWindow\r\n });\r\n};\r\n\r\nexport const routerFactory: IRouterFactory = (wpmp) => {\r\n return new router.Router(wpmp);\r\n};\n\n\n// WEBPACK FOOTER //\n// ./src/factories.ts","const config = {\r\n version: '2.2.7',\r\n type: 'js'\r\n};\r\n\r\nexport default config;\n\n\n// WEBPACK FOOTER //\n// ./src/config.ts","/*! window-post-message-proxy v0.2.4 | (c) 2016 Microsoft Corporation MIT */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"window-post-message-proxy\"] = factory();\n\telse\n\t\troot[\"window-post-message-proxy\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\tvar WindowPostMessageProxy = (function () {\n\t function WindowPostMessageProxy(options) {\n\t var _this = this;\n\t if (options === void 0) { options = {\n\t processTrackingProperties: {\n\t addTrackingProperties: WindowPostMessageProxy.defaultAddTrackingProperties,\n\t getTrackingProperties: WindowPostMessageProxy.defaultGetTrackingProperties\n\t },\n\t isErrorMessage: WindowPostMessageProxy.defaultIsErrorMessage,\n\t receiveWindow: window,\n\t name: WindowPostMessageProxy.createRandomString()\n\t }; }\n\t this.pendingRequestPromises = {};\n\t // save options with defaults\n\t this.addTrackingProperties = (options.processTrackingProperties && options.processTrackingProperties.addTrackingProperties) || WindowPostMessageProxy.defaultAddTrackingProperties;\n\t this.getTrackingProperties = (options.processTrackingProperties && options.processTrackingProperties.getTrackingProperties) || WindowPostMessageProxy.defaultGetTrackingProperties;\n\t this.isErrorMessage = options.isErrorMessage || WindowPostMessageProxy.defaultIsErrorMessage;\n\t this.receiveWindow = options.receiveWindow || window;\n\t this.name = options.name || WindowPostMessageProxy.createRandomString();\n\t this.logMessages = options.logMessages || false;\n\t this.eventSourceOverrideWindow = options.eventSourceOverrideWindow;\n\t this.suppressWarnings = options.suppressWarnings || false;\n\t if (this.logMessages) {\n\t console.log(\"new WindowPostMessageProxy created with name: \" + this.name + \" receiving on window: \" + this.receiveWindow.document.title);\n\t }\n\t // Initialize\n\t this.handlers = [];\n\t this.windowMessageHandler = function (event) { return _this.onMessageReceived(event); };\n\t this.start();\n\t }\n\t // Static\n\t WindowPostMessageProxy.defaultAddTrackingProperties = function (message, trackingProperties) {\n\t message[WindowPostMessageProxy.messagePropertyName] = trackingProperties;\n\t return message;\n\t };\n\t WindowPostMessageProxy.defaultGetTrackingProperties = function (message) {\n\t return message[WindowPostMessageProxy.messagePropertyName];\n\t };\n\t WindowPostMessageProxy.defaultIsErrorMessage = function (message) {\n\t return !!message.error;\n\t };\n\t /**\n\t * Utility to create a deferred object.\n\t */\n\t // TODO: Look to use RSVP library instead of doing this manually.\n\t // From what I searched RSVP would work better because it has .finally and .deferred; however, it doesn't have Typings information. \n\t WindowPostMessageProxy.createDeferred = function () {\n\t var deferred = {\n\t resolve: null,\n\t reject: null,\n\t promise: null\n\t };\n\t var promise = new Promise(function (resolve, reject) {\n\t deferred.resolve = resolve;\n\t deferred.reject = reject;\n\t });\n\t deferred.promise = promise;\n\t return deferred;\n\t };\n\t /**\n\t * Utility to generate random sequence of characters used as tracking id for promises.\n\t */\n\t WindowPostMessageProxy.createRandomString = function () {\n\t return (Math.random() + 1).toString(36).substring(7);\n\t };\n\t /**\n\t * Adds handler.\n\t * If the first handler whose test method returns true will handle the message and provide a response.\n\t */\n\t WindowPostMessageProxy.prototype.addHandler = function (handler) {\n\t this.handlers.push(handler);\n\t };\n\t /**\n\t * Removes handler.\n\t * The reference must match the original object that was provided when adding the handler.\n\t */\n\t WindowPostMessageProxy.prototype.removeHandler = function (handler) {\n\t var handlerIndex = this.handlers.indexOf(handler);\n\t if (handlerIndex === -1) {\n\t throw new Error(\"You attempted to remove a handler but no matching handler was found.\");\n\t }\n\t this.handlers.splice(handlerIndex, 1);\n\t };\n\t /**\n\t * Start listening to message events.\n\t */\n\t WindowPostMessageProxy.prototype.start = function () {\n\t this.receiveWindow.addEventListener('message', this.windowMessageHandler);\n\t };\n\t /**\n\t * Stops listening to message events.\n\t */\n\t WindowPostMessageProxy.prototype.stop = function () {\n\t this.receiveWindow.removeEventListener('message', this.windowMessageHandler);\n\t };\n\t /**\n\t * Post message to target window with tracking properties added and save deferred object referenced by tracking id.\n\t */\n\t WindowPostMessageProxy.prototype.postMessage = function (targetWindow, message) {\n\t // Add tracking properties to indicate message came from this proxy\n\t var trackingProperties = { id: WindowPostMessageProxy.createRandomString() };\n\t this.addTrackingProperties(message, trackingProperties);\n\t if (this.logMessages) {\n\t console.log(this.name + \" Posting message:\");\n\t console.log(JSON.stringify(message, null, ' '));\n\t }\n\t targetWindow.postMessage(message, \"*\");\n\t var deferred = WindowPostMessageProxy.createDeferred();\n\t this.pendingRequestPromises[trackingProperties.id] = deferred;\n\t return deferred.promise;\n\t };\n\t /**\n\t * Send response message to target window.\n\t * Response messages re-use tracking properties from a previous request message.\n\t */\n\t WindowPostMessageProxy.prototype.sendResponse = function (targetWindow, message, trackingProperties) {\n\t this.addTrackingProperties(message, trackingProperties);\n\t if (this.logMessages) {\n\t console.log(this.name + \" Sending response:\");\n\t console.log(JSON.stringify(message, null, ' '));\n\t }\n\t targetWindow.postMessage(message, \"*\");\n\t };\n\t /**\n\t * Message handler.\n\t */\n\t WindowPostMessageProxy.prototype.onMessageReceived = function (event) {\n\t var _this = this;\n\t if (this.logMessages) {\n\t console.log(this.name + \" Received message:\");\n\t console.log(\"type: \" + event.type);\n\t console.log(JSON.stringify(event.data, null, ' '));\n\t }\n\t var sendingWindow = this.eventSourceOverrideWindow || event.source;\n\t var message = event.data;\n\t if (typeof message !== \"object\") {\n\t if (!this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + this.name + \"): Received message that was not an object. Discarding message\");\n\t }\n\t return;\n\t }\n\t var trackingProperties;\n\t try {\n\t trackingProperties = this.getTrackingProperties(message);\n\t }\n\t catch (e) {\n\t if (!this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + this.name + \"): Error occurred when attempting to get tracking properties from incoming message:\", JSON.stringify(message, null, ' '), \"Error: \", e);\n\t }\n\t }\n\t var deferred;\n\t if (trackingProperties) {\n\t deferred = this.pendingRequestPromises[trackingProperties.id];\n\t }\n\t // If message does not have a known ID, treat it as a request\n\t // Otherwise, treat message as response\n\t if (!deferred) {\n\t var handled = this.handlers.some(function (handler) {\n\t var canMessageBeHandled = false;\n\t try {\n\t canMessageBeHandled = handler.test(message);\n\t }\n\t catch (e) {\n\t if (!_this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + _this.name + \"): Error occurred when handler was testing incoming message:\", JSON.stringify(message, null, ' '), \"Error: \", e);\n\t }\n\t }\n\t if (canMessageBeHandled) {\n\t var responseMessagePromise = void 0;\n\t try {\n\t responseMessagePromise = Promise.resolve(handler.handle(message));\n\t }\n\t catch (e) {\n\t if (!_this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + _this.name + \"): Error occurred when handler was processing incoming message:\", JSON.stringify(message, null, ' '), \"Error: \", e);\n\t }\n\t responseMessagePromise = Promise.resolve();\n\t }\n\t responseMessagePromise\n\t .then(function (responseMessage) {\n\t if (!responseMessage) {\n\t var warningMessage = \"Handler for message: \" + JSON.stringify(message, null, ' ') + \" did not return a response message. The default response message will be returned instead.\";\n\t if (!_this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + _this.name + \"): \" + warningMessage);\n\t }\n\t responseMessage = {\n\t warning: warningMessage\n\t };\n\t }\n\t _this.sendResponse(sendingWindow, responseMessage, trackingProperties);\n\t });\n\t return true;\n\t }\n\t });\n\t /**\n\t * TODO: Consider returning an error message if nothing handled the message.\n\t * In the case of the Report receiving messages all of them should be handled,\n\t * however, in the case of the SDK receiving messages it's likely it won't register handlers\n\t * for all events. Perhaps make this an option at construction time.\n\t */\n\t if (!handled && !this.suppressWarnings) {\n\t console.warn(\"Proxy(\" + this.name + \") did not handle message. Handlers: \" + this.handlers.length + \" Message: \" + JSON.stringify(message, null, '') + \".\");\n\t }\n\t }\n\t else {\n\t /**\n\t * If error message reject promise,\n\t * Otherwise, resolve promise\n\t */\n\t var isErrorMessage = true;\n\t try {\n\t isErrorMessage = this.isErrorMessage(message);\n\t }\n\t catch (e) {\n\t console.warn(\"Proxy(\" + this.name + \") Error occurred when trying to determine if message is consider an error response. Message: \", JSON.stringify(message, null, ''), 'Error: ', e);\n\t }\n\t if (isErrorMessage) {\n\t deferred.reject(message);\n\t }\n\t else {\n\t deferred.resolve(message);\n\t }\n\t // TODO: Move to .finally clause up where promise is created for better maitenance like original proxy code.\n\t delete this.pendingRequestPromises[trackingProperties.id];\n\t }\n\t };\n\t WindowPostMessageProxy.messagePropertyName = \"windowPostMessageProxy\";\n\t return WindowPostMessageProxy;\n\t}());\n\texports.WindowPostMessageProxy = WindowPostMessageProxy;\n\n\n/***/ }\n/******/ ])\n});\n;\n//# sourceMappingURL=windowPostMessageProxy.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/window-post-message-proxy/dist/windowPostMessageProxy.js\n// module id = 12\n// module chunks = 0","/*! http-post-message v0.2.3 | (c) 2016 Microsoft Corporation MIT */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"http-post-message\"] = factory();\n\telse\n\t\troot[\"http-post-message\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\tvar HttpPostMessage = (function () {\n\t function HttpPostMessage(windowPostMessageProxy, defaultHeaders, defaultTargetWindow) {\n\t if (defaultHeaders === void 0) { defaultHeaders = {}; }\n\t this.defaultHeaders = defaultHeaders;\n\t this.defaultTargetWindow = defaultTargetWindow;\n\t this.windowPostMessageProxy = windowPostMessageProxy;\n\t }\n\t // TODO: See if it's possible to share tracking properties interface?\n\t // The responsibility of knowing how to configure windowPostMessageProxy for http should\n\t // live in this http class, but the configuration would need ITrackingProperties\n\t // interface which lives in WindowPostMessageProxy. Use type as workaround\n\t HttpPostMessage.addTrackingProperties = function (message, trackingProperties) {\n\t message.headers = message.headers || {};\n\t if (trackingProperties && trackingProperties.id) {\n\t message.headers.id = trackingProperties.id;\n\t }\n\t return message;\n\t };\n\t HttpPostMessage.getTrackingProperties = function (message) {\n\t return {\n\t id: message.headers && message.headers.id\n\t };\n\t };\n\t HttpPostMessage.isErrorMessage = function (message) {\n\t if (typeof (message && message.statusCode) !== 'number') {\n\t return false;\n\t }\n\t return !(200 <= message.statusCode && message.statusCode < 300);\n\t };\n\t HttpPostMessage.prototype.get = function (url, headers, targetWindow) {\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"GET\",\n\t url: url,\n\t headers: headers\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.post = function (url, body, headers, targetWindow) {\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"POST\",\n\t url: url,\n\t headers: headers,\n\t body: body\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.put = function (url, body, headers, targetWindow) {\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"PUT\",\n\t url: url,\n\t headers: headers,\n\t body: body\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.patch = function (url, body, headers, targetWindow) {\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"PATCH\",\n\t url: url,\n\t headers: headers,\n\t body: body\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.delete = function (url, body, headers, targetWindow) {\n\t if (body === void 0) { body = null; }\n\t if (headers === void 0) { headers = {}; }\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t return this.send({\n\t method: \"DELETE\",\n\t url: url,\n\t headers: headers,\n\t body: body\n\t }, targetWindow);\n\t };\n\t HttpPostMessage.prototype.send = function (request, targetWindow) {\n\t if (targetWindow === void 0) { targetWindow = this.defaultTargetWindow; }\n\t request.headers = this.assign({}, this.defaultHeaders, request.headers);\n\t if (!targetWindow) {\n\t throw new Error(\"target window is not provided. You must either provide the target window explicitly as argument to request, or specify default target window when constructing instance of this class.\");\n\t }\n\t return this.windowPostMessageProxy.postMessage(targetWindow, request);\n\t };\n\t /**\n\t * Object.assign() polyfill\n\t * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\n\t */\n\t HttpPostMessage.prototype.assign = function (target) {\n\t var sources = [];\n\t for (var _i = 1; _i < arguments.length; _i++) {\n\t sources[_i - 1] = arguments[_i];\n\t }\n\t if (target === undefined || target === null) {\n\t throw new TypeError('Cannot convert undefined or null to object');\n\t }\n\t var output = Object(target);\n\t sources.forEach(function (source) {\n\t if (source !== undefined && source !== null) {\n\t for (var nextKey in source) {\n\t if (Object.prototype.hasOwnProperty.call(source, nextKey)) {\n\t output[nextKey] = source[nextKey];\n\t }\n\t }\n\t }\n\t });\n\t return output;\n\t };\n\t return HttpPostMessage;\n\t}());\n\texports.HttpPostMessage = HttpPostMessage;\n\n\n/***/ }\n/******/ ])\n});\n;\n//# sourceMappingURL=httpPostMessage.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/http-post-message/dist/httpPostMessage.js\n// module id = 13\n// module chunks = 0","/*! powerbi-router v0.1.5 | (c) 2016 Microsoft Corporation MIT */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"powerbi-router\"] = factory();\n\telse\n\t\troot[\"powerbi-router\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar RouteRecognizer = __webpack_require__(1);\n\tvar Router = (function () {\n\t function Router(handlers) {\n\t this.handlers = handlers;\n\t /**\n\t * TODO: look at generating the router dynamically based on list of supported http methods\n\t * instead of hardcoding the creation of these and the methods.\n\t */\n\t this.getRouteRecognizer = new RouteRecognizer();\n\t this.patchRouteRecognizer = new RouteRecognizer();\n\t this.postRouteRecognizer = new RouteRecognizer();\n\t this.putRouteRecognizer = new RouteRecognizer();\n\t this.deleteRouteRecognizer = new RouteRecognizer();\n\t }\n\t Router.prototype.get = function (url, handler) {\n\t this.registerHandler(this.getRouteRecognizer, \"GET\", url, handler);\n\t return this;\n\t };\n\t Router.prototype.patch = function (url, handler) {\n\t this.registerHandler(this.patchRouteRecognizer, \"PATCH\", url, handler);\n\t return this;\n\t };\n\t Router.prototype.post = function (url, handler) {\n\t this.registerHandler(this.postRouteRecognizer, \"POST\", url, handler);\n\t return this;\n\t };\n\t Router.prototype.put = function (url, handler) {\n\t this.registerHandler(this.putRouteRecognizer, \"PUT\", url, handler);\n\t return this;\n\t };\n\t Router.prototype.delete = function (url, handler) {\n\t this.registerHandler(this.deleteRouteRecognizer, \"DELETE\", url, handler);\n\t return this;\n\t };\n\t /**\n\t * TODO: This method could use some refactoring. There is conflict of interest between keeping clean separation of test and handle method\n\t * Test method only returns boolean indicating if request can be handled, and handle method has opportunity to modify response and return promise of it.\n\t * In the case of the router with route-recognizer where handlers are associated with routes, this already guarantees that only one handler is selected and makes the test method feel complicated\n\t * Will leave as is an investigate cleaner ways at later time.\n\t */\n\t Router.prototype.registerHandler = function (routeRecognizer, method, url, handler) {\n\t var routeRecognizerHandler = function (request) {\n\t var response = new Response();\n\t return Promise.resolve(handler(request, response))\n\t .then(function (x) { return response; });\n\t };\n\t routeRecognizer.add([\n\t { path: url, handler: routeRecognizerHandler }\n\t ]);\n\t var internalHandler = {\n\t test: function (request) {\n\t if (request.method !== method) {\n\t return false;\n\t }\n\t var matchingRoutes = routeRecognizer.recognize(request.url);\n\t if (matchingRoutes === undefined) {\n\t return false;\n\t }\n\t /**\n\t * Copy parameters from recognized route to the request so they can be used within the handler function\n\t * This isn't ideal because it is side affect which modifies the request instead of strictly testing for true or false\n\t * but I don't see a better place to put this. If we move it between the call to test and the handle it becomes part of the window post message proxy\n\t * even though it's responsibility is related to routing.\n\t */\n\t var route = matchingRoutes[0];\n\t request.params = route.params;\n\t request.queryParams = matchingRoutes.queryParams;\n\t request.handler = route.handler;\n\t return true;\n\t },\n\t handle: function (request) {\n\t return request.handler(request);\n\t }\n\t };\n\t this.handlers.addHandler(internalHandler);\n\t };\n\t return Router;\n\t}());\n\texports.Router = Router;\n\tvar Response = (function () {\n\t function Response() {\n\t this.statusCode = 200;\n\t this.headers = {};\n\t this.body = null;\n\t }\n\t Response.prototype.send = function (statusCode, body) {\n\t this.statusCode = statusCode;\n\t this.body = body;\n\t };\n\t return Response;\n\t}());\n\texports.Response = Response;\n\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(module) {(function() {\n\t \"use strict\";\n\t function $$route$recognizer$dsl$$Target(path, matcher, delegate) {\n\t this.path = path;\n\t this.matcher = matcher;\n\t this.delegate = delegate;\n\t }\n\t\n\t $$route$recognizer$dsl$$Target.prototype = {\n\t to: function(target, callback) {\n\t var delegate = this.delegate;\n\t\n\t if (delegate && delegate.willAddRoute) {\n\t target = delegate.willAddRoute(this.matcher.target, target);\n\t }\n\t\n\t this.matcher.add(this.path, target);\n\t\n\t if (callback) {\n\t if (callback.length === 0) { throw new Error(\"You must have an argument in the function passed to `to`\"); }\n\t this.matcher.addChild(this.path, target, callback, this.delegate);\n\t }\n\t return this;\n\t }\n\t };\n\t\n\t function $$route$recognizer$dsl$$Matcher(target) {\n\t this.routes = {};\n\t this.children = {};\n\t this.target = target;\n\t }\n\t\n\t $$route$recognizer$dsl$$Matcher.prototype = {\n\t add: function(path, handler) {\n\t this.routes[path] = handler;\n\t },\n\t\n\t addChild: function(path, target, callback, delegate) {\n\t var matcher = new $$route$recognizer$dsl$$Matcher(target);\n\t this.children[path] = matcher;\n\t\n\t var match = $$route$recognizer$dsl$$generateMatch(path, matcher, delegate);\n\t\n\t if (delegate && delegate.contextEntered) {\n\t delegate.contextEntered(target, match);\n\t }\n\t\n\t callback(match);\n\t }\n\t };\n\t\n\t function $$route$recognizer$dsl$$generateMatch(startingPath, matcher, delegate) {\n\t return function(path, nestedCallback) {\n\t var fullPath = startingPath + path;\n\t\n\t if (nestedCallback) {\n\t nestedCallback($$route$recognizer$dsl$$generateMatch(fullPath, matcher, delegate));\n\t } else {\n\t return new $$route$recognizer$dsl$$Target(startingPath + path, matcher, delegate);\n\t }\n\t };\n\t }\n\t\n\t function $$route$recognizer$dsl$$addRoute(routeArray, path, handler) {\n\t var len = 0;\n\t for (var i=0; i z`. For instance, \"199\" is smaller\n\t // then \"200\", even though \"y\" and \"z\" (which are both 9) are larger than \"0\" (the value\n\t // of (`b` and `c`). This is because the leading symbol, \"2\", is larger than the other\n\t // leading symbol, \"1\".\n\t // The rule is that symbols to the left carry more weight than symbols to the right\n\t // when a number is written out as a string. In the above strings, the leading digit\n\t // represents how many 100's are in the number, and it carries more weight than the middle\n\t // number which represents how many 10's are in the number.\n\t // This system of number magnitude works well for route specificity, too. A route written as\n\t // `a/b/c` will be more specific than `x/y/z` as long as `a` is more specific than\n\t // `x`, irrespective of the other parts.\n\t // Because of this similarity, we assign each type of segment a number value written as a\n\t // string. We can find the specificity of compound routes by concatenating these strings\n\t // together, from left to right. After we have looped through all of the segments,\n\t // we convert the string to a number.\n\t specificity.val = '';\n\t\n\t for (var i=0; i 2 && key.slice(keyLength -2) === '[]') {\n\t isArray = true;\n\t key = key.slice(0, keyLength - 2);\n\t if(!queryParams[key]) {\n\t queryParams[key] = [];\n\t }\n\t }\n\t value = pair[1] ? $$route$recognizer$$decodeQueryParamPart(pair[1]) : '';\n\t }\n\t if (isArray) {\n\t queryParams[key].push(value);\n\t } else {\n\t queryParams[key] = value;\n\t }\n\t }\n\t return queryParams;\n\t },\n\t\n\t recognize: function(path) {\n\t var states = [ this.rootState ],\n\t pathLen, i, l, queryStart, queryParams = {},\n\t isSlashDropped = false;\n\t\n\t queryStart = path.indexOf('?');\n\t if (queryStart !== -1) {\n\t var queryString = path.substr(queryStart + 1, path.length);\n\t path = path.substr(0, queryStart);\n\t queryParams = this.parseQueryString(queryString);\n\t }\n\t\n\t path = decodeURI(path);\n\t\n\t if (path.charAt(0) !== \"/\") { path = \"/\" + path; }\n\t\n\t pathLen = path.length;\n\t if (pathLen > 1 && path.charAt(pathLen - 1) === \"/\") {\n\t path = path.substr(0, pathLen - 1);\n\t isSlashDropped = true;\n\t }\n\t\n\t for (i=0; i';this.element.innerHTML=r,this.iframe=this.element.childNodes[0]}e?this.iframe.addEventListener("load",function(){return t.load(t.config)},!1):this.iframe.addEventListener("load",function(){return t.createReport(t.createConfig)},!1)},e.allowedEvents=["loaded","saved","rendered","saveAsTriggered","error","dataSelected"],e.accessTokenAttribute="powerbi-access-token",e.embedUrlAttribute="powerbi-embed-url",e.nameAttribute="powerbi-name",e.typeAttribute="powerbi-type",e.defaultSettings={filterPaneEnabled:!0},e}();t.Embed=i},function(e,t){function r(e,t,r){var n;"function"==typeof CustomEvent?n=new CustomEvent(t,{detail:r,bubbles:!0,cancelable:!0}):(n=document.createEvent("CustomEvent"),n.initCustomEvent(t,!0,!0,r)),e.dispatchEvent(n)}function n(e,t){if(!Array.isArray(t))throw new Error("You attempted to call find with second parameter that was not an array. You passed: "+t);var r;return t.some(function(t,n){if(e(t))return r=n,!0}),r}function i(e,t){var r=n(e,t);return t[r]}function o(e,t){var r=n(e,t);t.splice(r,1)}function s(){for(var e=[],t=0;t0&&!i)throw new Error("You shold pass the values to be filtered for each key. You passed: no values and "+o+" keys");if(0===o&&i&&i.length>0)throw new Error("You passed key values but your target object doesn't contain the keys to be filtered");for(var s=0;s2)throw new Error("AdvancedFilters may not have more than two conditions. You passed: "+i.length);if(1===s.length&&"And"!==n)throw new Error('Logical Operator must be "And" when there is only one condition provided');this.conditions=s}return d(t,e),t.prototype.toJSON=function(){var t=e.prototype.toJSON.call(this);return t.logicalOperator=this.logicalOperator,t.conditions=this.conditions,t},t.schemaUrl="http://powerbi.com/product/schema#advanced",t}(l);t.AdvancedFilter=y,function(e){e[e.Read=0]="Read",e[e.ReadWrite=1]="ReadWrite",e[e.Copy=2]="Copy",e[e.Create=4]="Create",e[e.All=7]="All"}(t.Permissions||(t.Permissions={}));t.Permissions;!function(e){e[e.View=0]="View",e[e.Edit=1]="Edit"}(t.ViewMode||(t.ViewMode={}));t.ViewMode;t.validateSaveAsParameters=i(t.saveAsParametersSchema)},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{target:{oneOf:[{type:"object",properties:{table:{type:"string"},column:{type:"string"}},required:["table","column"]},{type:"object",properties:{table:{type:"string"},hierarchy:{type:"string"},hierarchyLevel:{type:"string"}},required:["table","hierarchy","hierarchyLevel"]},{type:"object",properties:{table:{type:"string"},measure:{type:"string"}},required:["table","measure"]}]},logicalOperator:{type:"string"},conditions:{type:"array",items:{type:"object",properties:{value:{type:["string","boolean","number"]},operator:{type:"string"}},required:["value","operator"]}}},required:["target","logicalOperator","conditions"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",oneOf:[{$ref:"#basicFilter"},{$ref:"#advancedFilter"}],invalidMessage:"filter is invalid"}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{accessToken:{type:"string",messages:{type:"accessToken must be a string",required:"accessToken is required"}},id:{type:"string",messages:{type:"id must be a string",required:"id is required"}},settings:{$ref:"#settings"},pageName:{type:"string",messages:{type:"pageName must be a string"}},filters:{type:"array",items:{type:"object",oneOf:[{$ref:"#basicFilter"},{$ref:"#advancedFilter"}]},invalidMessage:"filters property is invalid"},permissions:{type:"number","enum":[0,1,2,4,7],"default":0,invalidMessage:"permissions property is invalid"},viewMode:{type:"number","enum":[0,1],"default":0,invalidMessage:"viewMode property is invalid"}},required:["accessToken","id"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{accessToken:{type:"string",messages:{type:"accessToken must be a string",required:"accessToken is required"}},id:{type:"string",messages:{type:"id must be a string",required:"id is required"}},pageView:{type:"string",messages:{type:'pageView must be a string with one of the following values: "actualSize", "fitToWidth", "oneColumn"'}}},required:["accessToken","id"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{name:{type:"string",messages:{type:"name must be a string",required:"name is required"}}},required:["name"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{filterPaneEnabled:{type:"boolean",messages:{type:"filterPaneEnabled must be a boolean"}},navContentPaneEnabled:{type:"boolean",messages:{type:"navContentPaneEnabled must be a boolean"}},useCustomSaveAsDialog:{type:"boolean",messages:{type:"useCustomSaveAsDialog must be a boolean"}}}}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{target:{type:"object",properties:{table:{type:"string"},column:{type:"string"},hierarchy:{type:"string"},hierarchyLevel:{type:"string"},measure:{type:"string"}},required:["table"]},operator:{type:"string"},values:{type:"array",items:{type:["string","boolean","number"]}}},required:["target","operator","values"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{accessToken:{type:"string",messages:{type:"accessToken must be a string",required:"accessToken is required"}},datasetId:{type:"string",messages:{type:"datasetId must be a string",required:"datasetId is required"}}},required:["accessToken","datasetId"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{name:{type:"string",messages:{type:"name must be a string",required:"name is required"}}},required:["name"]}},function(e,t,r){e.exports=r(11)},function(e,t,r){"use strict";function n(e){return e=e instanceof RegExp?e:new RegExp(e),A?e.toString():"/"+e.source.replace(y,"\\$&")+"/"}function i(e){return'"'+e.replace(v,"\\$1")+'"'}function o(e,t){return b.lastIndex=0,b.test(t)?e+"."+t:e+"["+i(t)+"]"}function s(e){if(void 0===e)return"undefined";var t=Object.prototype.toString.call(e);return t.substr(8,t.length-9).toLowerCase()}function a(e){return(0|e)===e}function c(e,t){k[t].type=e,k[t].keyword=t}function h(e){var t,r,n,i=Object.keys(e),o=i.indexOf("properties"),s=i.indexOf("patternProperties"),a={"enum":Array.isArray(e["enum"])&&e["enum"].length>0,type:null,allType:[],perType:{}};for(e.type&&("string"==typeof e.type?a.type=[e.type]:Array.isArray(e.type)&&e.type.length&&(a.type=e.type.slice(0))),n=0;n-1&&"required"===t||s>-1&&"additionalProperties"===t||a.perType[r.type].push(t)):a.allType.push(t)));return a}function u(e,t){var r,n,i=e.substr(4),o=i.length,s=[],a="",c=!1;for(n=0;n "+e.schema.maximum+") {"),e.error("maximum"),e.code("}"))},k.exclusiveMaximum=function(e){e.schema.exclusiveMaximum===!0&&"number"==typeof e.schema.maximum&&(e.code("if ("+e.path+" === "+e.schema.maximum+") {"),e.error("exclusiveMaximum"),e.code("}"))},k.multipleOf=function(e){if("number"==typeof e.schema.multipleOf){var t=e.schema.multipleOf,r=t.toString().length-t.toFixed(0).length-1,n=r>0?Math.pow(10,r):1,i=e.path;r>0?e.code("if (+(Math.round(("+i+" * "+n+') + "e+" + '+r+') + "e-" + '+r+") % "+t*n+" !== 0) {"):e.code("if ((("+i+" * "+n+") % "+t*n+") !== 0) {"),e.error("multipleOf"),e.code("}")}},k.minLength=function(e){a(e.schema.minLength)&&(e.code("if (ucs2length("+e.path+") < "+e.schema.minLength+") {"),e.error("minLength"),e.code("}"))},k.maxLength=function(e){a(e.schema.maxLength)&&(e.code("if (ucs2length("+e.path+") > "+e.schema.maxLength+") {"),e.error("maxLength"),e.code("}"))},k.pattern=function(e){var t=e.schema.pattern;("string"==typeof t||t instanceof RegExp)&&(e.code("if (!("+n(t)+").test("+e.path+")) {"),e.error("pattern"),e.code("}"))},k.format=function(e){"string"==typeof e.schema.format&&I[e.schema.format]&&(e.code("if (!("+I[e.schema.format]+").test("+e.path+")) {"),e.error("format"),e.code("}"))},k.minItems=function(e){a(e.schema.minItems)&&(e.code("if ("+e.path+".length < "+e.schema.minItems+") {"),e.error("minItems"),e.code("}"))},k.maxItems=function(e){a(e.schema.maxItems)&&(e.code("if ("+e.path+".length > "+e.schema.maxItems+") {"),e.error("maxItems"),e.code("}"))},k.additionalItems=function(e){e.schema.additionalItems===!1&&Array.isArray(e.schema.items)&&(e.code("if ("+e.path+".length > "+e.schema.items.length+") {"),e.error("additionalItems"),e.code("}"))},k.uniqueItems=function(e){e.schema.uniqueItems&&(e.code("if (unique("+e.path+").length !== "+e.path+".length) {"),e.error("uniqueItems"),e.code("}"))},k.items=function(e){var t=e.declare(0),r=0;if("object"===s(e.schema.items))e.code("for ("+t+" = 0; "+t+" < "+e.path+".length; "+t+"++) {"),e.descend(e.path+"["+t+"]",e.schema.items),e.code("}");else if(Array.isArray(e.schema.items)){for(;r= "+r+") {"),e.descend(e.path+"["+r+"]",e.schema.items[r]),e.code("}");"object"===s(e.schema.additionalItems)&&(e.code("for ("+t+" = "+r+"; "+t+" < "+e.path+".length; "+t+"++) {"),e.descend(e.path+"["+t+"]",e.schema.additionalItems),e.code("}"))}},k.maxProperties=function(e){a(e.schema.maxProperties)&&(e.code("if (Object.keys("+e.path+").length > "+e.schema.maxProperties+") {"),e.error("maxProperties"),e.code("}"))},k.minProperties=function(e){a(e.schema.minProperties)&&(e.code("if (Object.keys("+e.path+").length < "+e.schema.minProperties+") {"),e.error("minProperties"),e.code("}"))},k.required=function(e){if(Array.isArray(e.schema.required))for(var t=0;t-1&&(e.code("else {"),e.error("required",t),e.code("}"))},k.patternProperties=k.additionalProperties=function(e){var t,r,i,o,a,c,h,u="object"===s(e.schema.properties)?Object.keys(e.schema.properties):[],d=e.schema.patternProperties,p="object"===s(d)?Object.keys(d):[],f=e.schema.additionalProperties,l=f===!1||"object"===s(f);if(p.length||l){for(r=e.declare("[]"),i=e.declare('""'),o=e.declare(0),l&&(a=e.declare(!1)),e.code(r+" = Object.keys("+e.path+")"),e.code("for ("+o+" = 0; "+o+" < "+r+".length; "+o+"++) {")(i+" = "+r+"["+o+"]")("if ("+e.path+"["+i+"] === undefined) {")("continue")("}"),l&&e.code(a+" = false"),h=0;h -1) {")("continue")("}")),e.code("if (!"+a+") {"),f===!1?e.error("additionalProperties",void 0,i):e.descend(e.path+"["+i+"]",f),e.code("}")),e.code("}")}},k.dependencies=function(e){if("object"===s(e.schema.dependencies))for(var t,r,n=Object.keys(e.schema.dependencies),i=n.length,a=0,c=0;c1&&delete this.objects[n][r]},f.prototype.dispose=function(){this.objects.length=0,this.properties.length=0},m.prototype.clone=function(e){var t=new m({schema:e,formats:this.formats,greedy:this.greedy,resolver:this.resolver,id:this.id,funcache:this.funcache,scope:this.scope});return t},m.prototype.declare=function(e){var t=this.id();return this.code.def(t,e),t},m.prototype.cache=function(e,t){var r,n=this.funcache[e];return n||(n=this.funcache[e]={key:this.id()},r=this.clone(t),n.func=r.compile(n.key),this.scope.refs[n.key]=n.func,r.dispose()),"refs."+n.key},m.prototype.error=function(e,t,r){var n=this.schema,o=this.path,s="data"!==o||t?'(path ? path + "." : "") + '+u(o,t)+",":"path,",a=t&&n.properties&&n.properties[t]?this.resolver.resolve(n.properties[t]):null,c=a?a.requiredMessage:n.invalidMessage;c||(c=a&&a.messages&&a.messages[e]||n.messages&&n.messages[e]),this.code("errors.push({"),c&&this.code("message: "+i(c)+","),r&&this.code("additionalProperties: "+r+","),this.code("path: "+s)("keyword: "+i(e))("})"),this.greedy||this.code("return")},m.prototype.refactor=function(e,t,r){var n="data"!==e?'(path ? path + "." : "") + '+u(e):"path",i=this.cache(r,t),o=this.declare();this.code(o+" = "+i+"("+e+", "+n+", errors)"),this.greedy||this.code("if (errors.length) { return }")},m.prototype.descend=function(e,t){var r=this.path,n=this.schema;this.path=e,this.schema=t,this.generate(),this.path=r,this.schema=n},m.prototype.generate=function(){function e(e){k[e](l)}var t,r,o,a,c,u,d,p=this.path,f=this.schema,l=this,m=this.scope;if("object"===s(f)){if(void 0!==f.$ref){if(f=this.resolver.resolve(f),this.resolver.hasRef(f))return void this.refactor(p,f,this.resolver.getNormalizedRef(this.schema)||this.schema.$ref);this.schema=f}if(o=h(f),o["enum"])return void k["enum"](l);for(a=Object.keys(o.perType),d=0;d-1&&o.type.splice(c,1));o.type&&(o.type.length?(this.code((a.length?"else ":"")+"if (!("+o.type.map(function(e){return S[e]?S[e](p):"true"}).join(" || ")+")) {"),this.error("type"),this.code("}")):(this.code("else {"),this.error("type"),this.code("}"))),o.allType.forEach(function(e){k[e](l)}),f.format&&this.formats&&(r=this.formats[f.format],r&&("string"==typeof r||r instanceof RegExp?(this.code("if (!("+n(r)+").test("+p+")) {"),this.error("format"),this.code("}")):"function"==typeof r&&((m.formats||(m.formats={}))[f.format]=r,(m.schemas||(m.schemas={}))[f.format]=f,t=i(f.format),this.code("if (!formats["+t+"]("+p+", schemas["+t+"])) {"),this.error("format"),this.code("}"))))}},m.prototype.compile=function(e){return this.code=E("jsen_compiled"+(e?"_"+e:""),"data","path","errors"),this.generate(),this.code.compile(this.scope)},m.prototype.dispose=function(){for(var e in this)this[e]=void 0},g.browser=x,g.clone=d,g.equal=O,g.unique=P,g.ucs2length=C,g.SchemaResolver=j,g.resolve=j.resolvePointer,e.exports=g},function(e,t){"use strict";e.exports=function(){var e=Array.apply(null,arguments),t=e.shift(),r=" ",n="",i="",o=1,s="{[",a="}]",c=function(){for(var e=r,t=0;t++-1&&s.indexOf(r)>-1?(o--,h(e),o++):s.indexOf(r)>-1?(h(e),o++):a.indexOf(t)>-1?(o--,h(e)):h(e),u};return u.def=function(e,t){return i+=(i?",\n"+r+" ":"")+e+(void 0!==t?" = "+t:""),u},u.toSource=function(){return"function "+t+"("+e.join(", ")+") {\n"+r+'"use strict"\n'+(i?r+"var "+i+";\n":"")+n+"}"},u.compile=function(e){var t="return ("+u.toSource()+")",r=e||{},n=Object.keys(r),i=n.map(function(e){return r[e]});return Function.apply(null,n.concat(t)).apply(null,i)},u}},function(e,t){"use strict";function r(e){var t=Object.prototype.toString.call(e);return t.substr(8,t.length-9).toLowerCase()}function n(e,t){var r,n,o=Object.keys(e).sort(),s=Object.keys(t).sort();if(!i(o,s))return!1;for(r=0;r-1)throw new Error(u+" "+t);return this.refStack.push(t),r=this._resolveRef(t),this.refStack.pop(),e===this.rootSchema&&(this.resolvedRootSchema=r),r},o.prototype.hasRef=function(e){var t,r,n,i,o=Object.keys(e);if(o.indexOf("$ref")>-1)return!0;for(n=0,t=o.length;n",'"',"`"," ","\r","\n","\t"],l=["{","}","|","\\","^","`"].concat(f),m=["'"].concat(l),g=["%","/","?",";","#"].concat(m),y=["/","?","#"],v=255,b=/^[+a-z0-9A-Z_-]{0,63}$/,w=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,x={javascript:!0,"javascript:":!0},A={javascript:!0,"javascript:":!0},E={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},O=r(20);n.prototype.parse=function(e,t,r){if(!h.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var n=e.indexOf("?"),i=n!==-1&&n127?"x":F[$];if(!M.match(b)){var U=T.slice(0,I),L=T.slice(I+1),W=F.match(w);W&&(U.push(W[1]),L.unshift(W[2])),L.length&&(a="/"+L.join(".")+a),this.hostname=U.join(".");break}}}this.hostname.length>v?this.hostname="":this.hostname=this.hostname.toLowerCase(),q||(this.hostname=c.toASCII(this.hostname));var z=this.port?":"+this.port:"",H=this.hostname||"";this.host=H+z,this.href+=this.host,q&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==a[0]&&(a="/"+a))}if(!x[l])for(var I=0,R=m.length;I0)&&r.host.split("@");P&&(r.auth=P.shift(),r.host=r.hostname=P.shift())}return r.search=e.search,r.query=e.query,h.isNull(r.pathname)&&h.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!x.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var j=x.slice(-1)[0],I=(r.host||e.host||x.length>1)&&("."===j||".."===j)||""===j,C=0,S=x.length;S>=0;S--)j=x[S],"."===j?x.splice(S,1):".."===j?(x.splice(S,1),C++):C&&(x.splice(S,1),C--);if(!b&&!w)for(;C--;C)x.unshift("..");!b||""===x[0]||x[0]&&"/"===x[0].charAt(0)||x.unshift(""),I&&"/"!==x.join("/").substr(-1)&&x.push("");var k=""===x[0]||x[0]&&"/"===x[0].charAt(0);if(O){r.hostname=r.host=k?"":x.length?x.shift():"";var P=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@");P&&(r.auth=P.shift(),r.host=r.hostname=P.shift())}return b=b||r.host&&x.length,b&&!k&&x.unshift(""),x.length?r.pathname=x.join("/"):(r.pathname=null,r.path=null),h.isNull(r.pathname)&&h.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},n.prototype.parseHost=function(){var e=this.host,t=d.exec(e);t&&(t=t[0],":"!==t&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,r){var n;(function(e,i){!function(o){function s(e){throw RangeError(T[e])}function a(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function c(e,t){var r=e.split("@"),n="";r.length>1&&(n=r[0]+"@",e=r[1]),e=e.replace(q,".");var i=e.split("."),o=a(i,t).join(".");return n+o}function h(e){for(var t,r,n=[],i=0,o=e.length;i=55296&&t<=56319&&i65535&&(e-=65536,t+=M(e>>>10&1023|55296),e=56320|1023&e),t+=M(e)}).join("")}function d(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:x}function p(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function f(e,t,r){var n=0;for(e=r?F(e/P):e>>1,e+=F(e/t);e>R*E>>1;n+=x)e=F(e/R);return F(n+(R+1)*e/(e+O))}function l(e){var t,r,n,i,o,a,c,h,p,l,m=[],g=e.length,y=0,v=I,b=j;for(r=e.lastIndexOf(C),r<0&&(r=0),n=0;n=128&&s("not-basic"),m.push(e.charCodeAt(n));for(i=r>0?r+1:0;i=g&&s("invalid-input"),h=d(e.charCodeAt(i++)),(h>=x||h>F((w-y)/a))&&s("overflow"),y+=h*a,p=c<=b?A:c>=b+E?E:c-b,!(hF(w/l)&&s("overflow"),a*=l;t=m.length+1,b=f(y-o,t,0==o),F(y/t)>w-v&&s("overflow"),v+=F(y/t),y%=t,m.splice(y++,0,v)}return u(m)}function m(e){var t,r,n,i,o,a,c,u,d,l,m,g,y,v,b,O=[];for(e=h(e),g=e.length,t=I,r=0,o=j,a=0;a=t&&mF((w-r)/y)&&s("overflow"),r+=(c-t)*y,t=c,a=0;aw&&s("overflow"),m==t){for(u=r,d=x;l=d<=o?A:d>=o+E?E:d-o,!(u= 0x80 (not a basic code point)","invalid-input":"Invalid input"},R=x-A,F=Math.floor,M=String.fromCharCode;b={version:"1.3.2",ucs2:{decode:h,encode:u},decode:l,encode:m,toASCII:y,toUnicode:g},n=function(){return b}.call(t,r,t,e),!(void 0!==n&&(e.exports=n))}(this)}).call(t,r(18)(e),function(){return this}())},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],e.webpackPolyfill=1),e}},function(e,t){"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,t,r){"use strict";t.decode=t.parse=r(21),t.encode=t.stringify=r(22)},function(e,t){ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. -"use strict";function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,n,i){t=t||"&",n=n||"=";var o={};if("string"!=typeof e||0===e.length)return o;var s=/\+/g;e=e.split(t);var a=1e3;i&&"number"==typeof i.maxKeys&&(a=i.maxKeys);var c=e.length;a>0&&c>a&&(c=a);for(var h=0;h=0?(u=l.substr(0,m),d=l.substr(m+1)):(u=l,d=""),p=decodeURIComponent(u),f=decodeURIComponent(d),r(o,p)?Array.isArray(o[p])?o[p].push(f):o[p]=[o[p],f]:o[p]=f}return o}},function(e,t){ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. -"use strict";var r=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,n,i){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map(function(i){var o=encodeURIComponent(r(i))+n;return Array.isArray(e[i])?e[i].map(function(e){return o+encodeURIComponent(r(e))}).join(t):o+encodeURIComponent(r(e[i]))}).join(t):i?encodeURIComponent(r(i))+n+encodeURIComponent(r(e)):""}},function(e,t){e.exports={id:"http://json-schema.org/draft-04/schema#",$schema:"http://json-schema.org/draft-04/schema#",description:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},positiveInteger:{type:"integer",minimum:0},positiveIntegerDefault0:{allOf:[{$ref:"#/definitions/positiveInteger"},{"default":0}]},simpleTypes:{"enum":["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0}},type:"object",properties:{id:{type:"string",format:"uri"},$schema:{type:"string",format:"uri"},title:{type:"string"},description:{type:"string"},"default":{},multipleOf:{type:"number",minimum:0,exclusiveMinimum:!0},maximum:{type:"number"},exclusiveMaximum:{type:"boolean","default":!1},minimum:{type:"number"},exclusiveMinimum:{type:"boolean","default":!1},maxLength:{$ref:"#/definitions/positiveInteger"},minLength:{$ref:"#/definitions/positiveIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{anyOf:[{type:"boolean"},{$ref:"#"}],"default":{}},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],"default":{}},maxItems:{$ref:"#/definitions/positiveInteger"},minItems:{$ref:"#/definitions/positiveIntegerDefault0"},uniqueItems:{type:"boolean","default":!1},maxProperties:{$ref:"#/definitions/positiveInteger"},minProperties:{$ref:"#/definitions/positiveIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{anyOf:[{type:"boolean"},{$ref:"#"}],"default":{}},definitions:{type:"object",additionalProperties:{$ref:"#"},"default":{}},properties:{type:"object",additionalProperties:{$ref:"#"},"default":{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},"default":{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},"enum":{type:"array",minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},dependencies:{exclusiveMaximum:["maximum"],exclusiveMinimum:["minimum"]},"default":{}}},function(e,t){"use strict";var r={};r["date-time"]=/(\d\d\d\d)(-)?(\d\d)(-)?(\d\d)(T)?(\d\d)(:)?(\d\d)(:)?(\d\d)(\.\d+)?(Z|([+-])(\d\d)(:)?(\d\d))/,r.uri=/^([a-zA-Z][a-zA-Z0-9+-.]*:){0,1}\/\/[^\s]*$/,r.email=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,r.ipv4=/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,r.ipv6=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|[fF][eE]80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::([fF]{4}(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,r.hostname=/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]))*$/,e.exports=r},function(e,t){"use strict";function r(e){for(var t,r,n=0,i=0,o=e.length;i=55296&&t<=56319&&i2&&"[]"===s.slice(a-2)&&(c=!0,s=s.slice(0,a-2),r[s]||(r[s]=[])),i=o[1]?w(o[1]):""),c?r[s].push(i):r[s]=i}return r},recognize:function(e){var t,r,n,i=[this.rootState],o={},s=!1;if(n=e.indexOf("?"),n!==-1){var a=e.substr(n+1,e.length);e=e.substr(0,n),o=this.parseQueryString(a)}for(e=decodeURI(e),"/"!==e.charAt(0)&&(e="/"+e),t=e.length,t>1&&"/"===e.charAt(t-1)&&(e=e.substr(0,t-1),s=!0),r=0;r { - * ... - * }); - * ``` - * - * @returns {Promise} - */ - getFilters(): Promise; - /** - * Gets the report ID from the first available location: options, attribute, embed url. - * - * @returns {string} - */ - getId(): string; - /** - * Gets the list of pages within the report. - * - * ```javascript - * report.getPages() - * .then(pages => { - * ... - * }); - * ``` - * - * @returns {Promise} - */ - getPages(): Promise; - /** - * Creates an instance of a Page. - * - * Normally you would get Page objects by calling `report.getPages()`, but in the case - * that the page name is known and you want to perform an action on a page without having to retrieve it - * you can create it directly. - * - * Note: Because you are creating the page manually there is no guarantee that the page actually exists in the report, and subsequent requests could fail. - * - * ```javascript - * const page = report.page('ReportSection1'); - * page.setActive(); - * ``` - * - * @param {string} name - * @param {string} [displayName] - * @returns {Page} - */ - page(name: string, displayName?: string): Page; - /** - * Prints the active page of the report by invoking `window.print()` on the embed iframe component. - */ - print(): Promise; - /** - * Removes all filters at the report level. - * - * ```javascript - * report.removeFilters(); - * ``` - * - * @returns {Promise} - */ - removeFilters(): Promise; - /** - * Sets the active page of the report. - * - * ```javascript - * report.setPage("page2") - * .catch(error => { ... }); - * ``` - * - * @param {string} pageName - * @returns {Promise} - */ - setPage(pageName: string): Promise; - /** - * Sets filters at the report level. - * - * ```javascript - * const filters: [ - * ... - * ]; - * - * report.setFilters(filters) - * .catch(errors => { - * ... - * }); - * ``` - * - * @param {(models.IFilter[])} filters - * @returns {Promise} - */ - setFilters(filters: models.IFilter[]): Promise; - /** - * Updates visibility settings for the filter pane and the page navigation pane. - * - * ```javascript - * const newSettings = { - * navContentPaneEnabled: true, - * filterPaneEnabled: false - * }; - * - * report.updateSettings(newSettings) - * .catch(error => { ... }); - * ``` - * - * @param {models.ISettings} settings - * @returns {Promise} - */ - updateSettings(settings: models.ISettings): Promise; - /** - * Validate load configuration. - */ - validate(config: models.IReportLoadConfiguration): models.IError[]; - /** - * Switch Report view mode. - * - * @returns {Promise} - */ - switchMode(viewMode: models.ViewMode): Promise; -} diff --git a/dist/service.d.ts b/dist/service.d.ts deleted file mode 100644 index b2475cac..00000000 --- a/dist/service.d.ts +++ /dev/null @@ -1,165 +0,0 @@ -/*! powerbi-client v2.2.7 | (c) 2016 Microsoft Corporation MIT */ -import * as embed from './embed'; -import { Report } from './report'; -import { Dashboard } from './dashboard'; -import { Tile } from './tile'; -import * as wpmp from 'window-post-message-proxy'; -import * as hpm from 'http-post-message'; -import * as router from 'powerbi-router'; -export interface IEvent { - type: string; - id: string; - name: string; - value: T; -} -export interface ICustomEvent extends CustomEvent { - detail: T; -} -export interface IEventHandler { - (event: ICustomEvent): any; -} -export interface IHpmFactory { - (wpmp: wpmp.WindowPostMessageProxy, targetWindow?: Window, version?: string, type?: string, origin?: string): hpm.HttpPostMessage; -} -export interface IWpmpFactory { - (name?: string, logMessages?: boolean, eventSourceOverrideWindow?: Window): wpmp.WindowPostMessageProxy; -} -export interface IRouterFactory { - (wpmp: wpmp.WindowPostMessageProxy): router.Router; -} -export interface IPowerBiElement extends HTMLElement { - powerBiEmbed: embed.Embed; -} -export interface IDebugOptions { - logMessages?: boolean; - wpmpName?: string; -} -export interface IServiceConfiguration extends IDebugOptions { - autoEmbedOnContentLoaded?: boolean; - onError?: (error: any) => any; - version?: string; - type?: string; -} -export interface IService { - hpm: hpm.HttpPostMessage; -} -/** - * The Power BI Service embed component, which is the entry point to embed all other Power BI components into your application - * - * @export - * @class Service - * @implements {IService} - */ -export declare class Service implements IService { - /** - * A list of components that this service can embed - */ - private static components; - /** - * The default configuration for the service - */ - private static defaultConfig; - /** - * Gets or sets the access token as the global fallback token to use when a local token is not provided for a report or tile. - * - * @type {string} - */ - accessToken: string; - /**The Configuration object for the service*/ - private config; - /** A list of Dashboard, Report and Tile components that have been embedded using this service instance. */ - private embeds; - /** TODO: Look for way to make hpm private without sacraficing ease of maitenance. This should be private but in embed needs to call methods. */ - hpm: hpm.HttpPostMessage; - /** TODO: Look for way to make wpmp private. This is only public to allow stopping the wpmp in tests */ - wpmp: wpmp.WindowPostMessageProxy; - private router; - /** - * Creates an instance of a Power BI Service. - * - * @param {IHpmFactory} hpmFactory The http post message factory used in the postMessage communication layer - * @param {IWpmpFactory} wpmpFactory The window post message factory used in the postMessage communication layer - * @param {IRouterFactory} routerFactory The router factory used in the postMessage communication layer - * @param {IServiceConfiguration} [config={}] - */ - constructor(hpmFactory: IHpmFactory, wpmpFactory: IWpmpFactory, routerFactory: IRouterFactory, config?: IServiceConfiguration); - /** - * Creates new report - * @param {HTMLElement} element - * @param {embed.IEmbedConfiguration} [config={}] - * @returns {embed.Embed} - */ - createReport(element: HTMLElement, config: embed.IEmbedConfiguration): embed.Embed; - /** - * TODO: Add a description here - * - * @param {HTMLElement} [container] - * @param {embed.IEmbedConfiguration} [config=undefined] - * @returns {embed.Embed[]} - */ - init(container?: HTMLElement, config?: embed.IEmbedConfiguration): embed.Embed[]; - /** - * Given a configuration based on an HTML element, - * if the component has already been created and attached to the element, reuses the component instance and existing iframe, - * otherwise creates a new component instance. - * - * @param {HTMLElement} element - * @param {embed.IEmbedConfiguration} [config={}] - * @returns {embed.Embed} - */ - embed(element: HTMLElement, config?: embed.IEmbedConfiguration): embed.Embed; - /** - * Given a configuration based on a Power BI element, saves the component instance that reference the element for later lookup. - * - * @private - * @param {IPowerBiElement} element - * @param {embed.IEmbedConfiguration} config - * @returns {embed.Embed} - */ - private embedNew(element, config); - /** - * Given an element that already contains an embed component, load with a new configuration. - * - * @private - * @param {IPowerBiElement} element - * @param {embed.IEmbedConfiguration} config - * @returns {embed.Embed} - */ - private embedExisting(element, config); - /** - * Adds an event handler for DOMContentLoaded, which searches the DOM for elements that have the 'powerbi-embed-url' attribute, - * and automatically attempts to embed a powerbi component based on information from other powerbi-* attributes. - * - * Note: Only runs if `config.autoEmbedOnContentLoaded` is true when the service is created. - * This handler is typically useful only for applications that are rendered on the server so that all required data is available when the handler is called. - */ - enableAutoEmbed(): void; - /** - * Returns an instance of the component associated with the element. - * - * @param {HTMLElement} element - * @returns {(Report | Tile)} - */ - get(element: HTMLElement): Report | Tile | Dashboard; - /** - * Finds an embed instance by the name or unique ID that is provided. - * - * @param {string} uniqueId - * @returns {(Report | Tile)} - */ - find(uniqueId: string): Report | Tile | Dashboard; - /** - * Given an HTML element that has a component embedded within it, removes the component from the list of embedded components, removes the association between the element and the component, and removes the iframe. - * - * @param {HTMLElement} element - * @returns {void} - */ - reset(element: HTMLElement): void; - /** - * Given an event object, finds the embed component with the matching type and ID, and invokes its handleEvent method with the event object. - * - * @private - * @param {IEvent} event - */ - private handleEvent(event); -} diff --git a/dist/tile.d.ts b/dist/tile.d.ts deleted file mode 100644 index 901e3f07..00000000 --- a/dist/tile.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -/*! powerbi-client v2.2.7 | (c) 2016 Microsoft Corporation MIT */ -import * as models from 'powerbi-models'; -import { Embed } from './embed'; -/** - * The Power BI tile embed component - * - * @export - * @class Tile - * @extends {Embed} - */ -export declare class Tile extends Embed { - static type: string; - /** - * The ID of the tile - * - * @returns {string} - */ - getId(): string; - /** - * Validate load configuration. - */ - validate(config: any): models.IError[]; -} diff --git a/dist/util.d.ts b/dist/util.d.ts deleted file mode 100644 index 6d0a2ddb..00000000 --- a/dist/util.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -/*! powerbi-client v2.2.7 | (c) 2016 Microsoft Corporation MIT */ -/** - * Raises a custom event with event data on the specified HTML element. - * - * @export - * @param {HTMLElement} element - * @param {string} eventName - * @param {*} eventData - */ -export declare function raiseCustomEvent(element: HTMLElement, eventName: string, eventData: any): void; -/** - * Finds the index of the first value in an array that matches the specified predicate. - * - * @export - * @template T - * @param {(x: T) => boolean} predicate - * @param {T[]} xs - * @returns {number} - */ -export declare function findIndex(predicate: (x: T) => boolean, xs: T[]): number; -/** - * Finds the first value in an array that matches the specified predicate. - * - * @export - * @template T - * @param {(x: T) => boolean} predicate - * @param {T[]} xs - * @returns {T} - */ -export declare function find(predicate: (x: T) => boolean, xs: T[]): T; -export declare function remove(predicate: (x: T) => boolean, xs: T[]): void; -/** - * Copies the values of all enumerable properties from one or more source objects to a target object, and returns the target object. - * - * @export - * @param {any} args - * @returns - */ -export declare function assign(...args: any[]): any; -/** - * Generates a random 7 character string. - * - * @export - * @returns {string} - */ -export declare function createRandomString(): string;