diff --git a/demo/code-demo/scripts/codesamples.js b/demo/code-demo/scripts/codesamples.js index 8fc31de1..b9b061e4 100644 --- a/demo/code-demo/scripts/codesamples.js +++ b/demo/code-demo/scripts/codesamples.js @@ -503,6 +503,23 @@ function _Report_Reload() { }); } +function _Report_Refresh() { + // Get a reference to the embedded report HTML element + var reportContainer = $('#reportContainer')[0]; + + // Get a reference to the embedded report. + report = powerbi.get(reportContainer); + + // Refresh the displayed report + report.refresh() + .then(function (result) { + Log.log(result); + }) + .catch(function (errors) { + Log.log(errors); + }); +} + function _Report_FullScreen() { // Get a reference to the embedded report HTML element var reportContainer = $('#reportContainer')[0]; diff --git a/demo/code-demo/scripts/session_utils.js b/demo/code-demo/scripts/session_utils.js index 72782c4a..b99c66d0 100644 --- a/demo/code-demo/scripts/session_utils.js +++ b/demo/code-demo/scripts/session_utils.js @@ -4,6 +4,7 @@ const SessionKeys = { AccessToken : "accessToken", EmbedUrl : "embedUrl", EmbedId : "embedId", + GroupId : "groupId", IsSampleReport: "isSampleReport" }; @@ -48,6 +49,17 @@ function SetTextBoxesFromSessionOrUrlParam(accessTokenSelector, embedUrlSelector if (!embedUrl) { embedUrl = GetSession(SessionKeys.EmbedUrl); + } else { + var groupId = GetParameterByName(SessionKeys.GroupId); + if(groupId) + { + if (embedUrl.indexOf("?") != -1) + { + embedUrl += "&groupId=" + groupId; + } else { + embedUrl += "?groupId=" + groupId; + } + } } var embedId = GetParameterByName(SessionKeys.EmbedId); diff --git a/demo/code-demo/scripts/step_embed.js b/demo/code-demo/scripts/step_embed.js index 823c6249..af4cacef 100644 --- a/demo/code-demo/scripts/step_embed.js +++ b/demo/code-demo/scripts/step_embed.js @@ -35,6 +35,10 @@ function Report_Reload() { SetCode(_Report_Reload); } +function Report_Refresh() { + SetCode(_Report_Refresh); +} + function Report_FullScreen() { SetCode(_Report_FullScreen); } diff --git a/demo/code-demo/settings_interact.html b/demo/code-demo/settings_interact.html index a54dcc21..74f14216 100644 --- a/demo/code-demo/settings_interact.html +++ b/demo/code-demo/settings_interact.html @@ -31,6 +31,7 @@
  • Print
  • Update settings
  • Reload
  • +
  • Refresh
  • Full screen
  • Exit full screen
  • diff --git a/dist/powerbi.js b/dist/powerbi.js index 2fd9d092..a0f8ae3c 100644 --- a/dist/powerbi.js +++ b/dist/powerbi.js @@ -313,7 +313,13 @@ return /******/ (function(modules) { // webpackBootstrap /** Removes the iframe from the element. */ var iframe = element.querySelector('iframe'); if (iframe) { - iframe.remove(); + if (iframe.remove !== undefined) { + iframe.remove(); + } + else { + /** Workaround for IE: unhandled rejection TypeError: object doesn't support propert or method 'remove' */ + iframe.parentElement.removeChild(iframe); + } } }; /** diff --git a/dist/powerbi.js.map b/dist/powerbi.js.map index 3d368357..0283b4c3 100644 --- a/dist/powerbi.js.map +++ b/dist/powerbi.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 067f1f71b7920d286d54","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":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;ACtCA,KAAY,OAAO,uBAAM,CAAW,CAAC;AAOnC,gBAAO;AANT,KAAY,SAAS,uBAAM,EA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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;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,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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,K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W;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 067f1f71b7920d286d54","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 { Create } from './create';\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 * Creates new report\r\n * @param {HTMLElement} element\r\n * @param {embed.IEmbedConfiguration} [config={}]\r\n * @returns {embed.Embed}\r\n */\r\n createReport(element: HTMLElement, config: embed.IEmbedConfiguration): embed.Embed {\r\n config.type = 'create';\r\n let powerBiElement = element;\r\n const component = new Create(this, powerBiElement, config);\r\n powerBiElement.powerBiEmbed = component;\r\n \r\n this.addOrOverwriteEmbed(component, element);\r\n\r\n return component;\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\r\n this.addOrOverwriteEmbed(component, element);\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\r\n /**\r\n * When loading report after create we want to use existing Iframe to optimize load period\r\n */\r\n if(config.type === \"report\" && component.config.type === \"create\") {\r\n const report = new Report(this, element, config, element.powerBiEmbed.iframe);\r\n report.load(config);\r\n element.powerBiEmbed = report;\r\n \r\n this.addOrOverwriteEmbed(component, element);\r\n\r\n return report;\r\n }\r\n\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 addOrOverwriteEmbed(component: embed.Embed, element: HTMLElement): void {\r\n // remove embeds over the same div element.\r\n this.embeds = this.embeds.filter(function(embed) {\r\n return embed.element.id !== element.id;\r\n });\r\n\r\n this.embeds.push(component);\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.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 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 var iframeContent = document.createElement(\"iframe\");\r\n var embedUrl = this.config.embedUrl;\r\n iframeContent.setAttribute(\"style\", \"width:100%;height:100%;\");\r\n iframeContent.setAttribute(\"src\", embedUrl);\r\n iframeContent.setAttribute(\"scrolling\", \"no\");\r\n iframeContent.setAttribute(\"allowfullscreen\", \"true\");\r\n var node = this.element;\r\n while(node.firstChild) {\r\n node.removeChild(node.firstChild);\r\n }\r\n node.appendChild(iframeContent);\r\n this.iframe = node.firstChild;\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';\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 = [\"filtersApplied\", \"pageChanged\"];\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, iframe?: HTMLIFrameElement) {\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, iframe);\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\r\n /**\r\n * Switch Report view mode.\r\n * \r\n * @returns {Promise}\r\n */\r\n switchMode(viewMode: models.ViewMode): Promise {\r\n let url = '/report/switchMode/' + viewMode;\r\n return this.service.hpm.post(url, 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 * Refreshes data sources for the report.\r\n * \r\n * ```javascript\r\n * report.refresh();\r\n * ```\r\n */\r\n refresh(): Promise {\r\n return this.service.hpm.post('/report/refresh', 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\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='?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.3.0',\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 {\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 * Creates new report\r\n * @param {HTMLElement} element\r\n * @param {embed.IEmbedConfiguration} [config={}]\r\n * @returns {embed.Embed}\r\n */\r\n createReport(element: HTMLElement, config: embed.IEmbedConfiguration): embed.Embed {\r\n config.type = 'create';\r\n let powerBiElement = element;\r\n const component = new Create(this, powerBiElement, config);\r\n powerBiElement.powerBiEmbed = component;\r\n this.addOrOverwriteEmbed(component, element);\r\n\r\n return component;\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\r\n this.addOrOverwriteEmbed(component, element);\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\r\n /**\r\n * When loading report after create we want to use existing Iframe to optimize load period\r\n */\r\n if(config.type === \"report\" && component.config.type === \"create\") {\r\n const report = new Report(this, element, config, element.powerBiEmbed.iframe);\r\n report.load(config);\r\n element.powerBiEmbed = report;\r\n\r\n this.addOrOverwriteEmbed(component, element);\r\n\r\n return report;\r\n }\r\n\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 addOrOverwriteEmbed(component: embed.Embed, element: HTMLElement): void {\r\n // remove embeds over the same div element.\r\n this.embeds = this.embeds.filter(function(embed) {\r\n return embed.element.id !== element.id;\r\n });\r\n\r\n this.embeds.push(component);\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 if(iframe.remove !== undefined) {\r\n iframe.remove();\r\n\t }\r\n else {\r\n /** Workaround for IE: unhandled rejection TypeError: object doesn't support propert or method 'remove' */\r\n iframe.parentElement.removeChild(iframe);\r\n }\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.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 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 var iframeContent = document.createElement(\"iframe\");\r\n var embedUrl = this.config.embedUrl;\r\n iframeContent.setAttribute(\"style\", \"width:100%;height:100%;\");\r\n iframeContent.setAttribute(\"src\", embedUrl);\r\n iframeContent.setAttribute(\"scrolling\", \"no\");\r\n iframeContent.setAttribute(\"allowfullscreen\", \"true\");\r\n var node = this.element;\r\n while(node.firstChild) {\r\n node.removeChild(node.firstChild);\r\n }\r\n node.appendChild(iframeContent);\r\n this.iframe = node.firstChild;\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';\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 = [\"filtersApplied\", \"pageChanged\"];\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, iframe?: HTMLIFrameElement) {\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, iframe);\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\r\n /**\r\n * Switch Report view mode.\r\n * \r\n * @returns {Promise}\r\n */\r\n switchMode(viewMode: models.ViewMode): Promise {\r\n let url = '/report/switchMode/' + viewMode;\r\n return this.service.hpm.post(url, 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 * Refreshes data sources for the report.\r\n * \r\n * ```javascript\r\n * report.refresh();\r\n * ```\r\n */\r\n refresh(): Promise {\r\n return this.service.hpm.post('/report/refresh', 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\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='?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.3.0',\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; i0&&!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;nelement; const component = new Create(this, powerBiElement, config); powerBiElement.powerBiEmbed = component; - this.addOrOverwriteEmbed(component, element); return component; @@ -270,7 +269,7 @@ export class Service implements IService { const report = new Report(this, element, config, element.powerBiEmbed.iframe); report.load(config); element.powerBiEmbed = report; - + this.addOrOverwriteEmbed(component, element); return report; @@ -350,7 +349,13 @@ export class Service implements IService { /** Removes the iframe from the element. */ const iframe = element.querySelector('iframe'); if (iframe) { - iframe.remove(); + if(iframe.remove !== undefined) { + iframe.remove(); + } + else { + /** Workaround for IE: unhandled rejection TypeError: object doesn't support propert or method 'remove' */ + iframe.parentElement.removeChild(iframe); + } } } diff --git a/tslint.json b/tslint.json index 5235b53e..e0ef791d 100644 --- a/tslint.json +++ b/tslint.json @@ -18,7 +18,7 @@ "check-decl", "check-operator", "check-module", - "check-seperator", + "check-separator", "check-type" ], "object-literal-sort-keys": false