@looker/embed-sdk
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.LookerEmbedSDK=t():e.LookerEmbedSDK=t()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=13)}([function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{u(r.next(e))}catch(e){i(e)}}function a(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){e.done?o(e.value):new n((function(t){t(e.value)})).then(s,a)}u((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e){this._host=e}return e.prototype.send=function(e,t){this._host.send(e,t)},e.prototype.sendAndReceive=function(e,t){return r(this,void 0,void 0,(function(){return o(this,(function(n){return[2,this._host.sendAndReceive(e,t)]}))}))},e}();t.LookerEmbedBase=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),o=function(){function e(){this._targetOrigin="*",this._handlers={},this._defaultTimeout=3e4}return Object.defineProperty(e.prototype,"targetOrigin",{get:function(){return this._targetOrigin},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"handlers",{get:function(){return this._handlers},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"defaultTimeout",{get:function(){return this._defaultTimeout},enumerable:!0,configurable:!0}),e.prototype.off=function(e,t){this._handlers[e]&&(this._handlers[e]=this._handlers[e].filter((function(e){return e!==t})))},e.prototype.on=function(e,t){return this._handlers[e]=this._handlers[e]||[],this._handlers[e].push(t),this},e.prototype.withDefaultTimeout=function(e){return this._defaultTimeout=e,this},e.prototype.withTargetOrigin=function(e){return this._targetOrigin=e,this},e.prototype.build=function(){return new r.ChattyClient(this)},e}();t.ChattyClientBuilder=o},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{u(r.next(e))}catch(e){i(e)}}function a(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){e.done?o(e.value):new n((function(t){t(e.value)})).then(s,a)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(3),a=n(4);n(5);var u,c=n(7);!function(e){e[e.Connecting=0]="Connecting",e[e.Syn=1]="Syn",e[e.Connected=2]="Connected"}(u=t.ChattyClientStates||(t.ChattyClientStates={}));var l=function(){function e(e){this._clientWindow=window,this._connection=null,this._hostWindow=this._clientWindow.parent,this._state=u.Connecting,this._sequence=0,this._receivers={},this._handlers=e.handlers,this._targetOrigin=e.targetOrigin,this._defaultTimeout=e.defaultTimeout,this._channel=new MessageChannel}return Object.defineProperty(e.prototype,"connection",{get:function(){return this._connection},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isConnected",{get:function(){return this._state===u.Connected},enumerable:!0,configurable:!0}),e.prototype.connect=function(){return o(this,void 0,void 0,(function(){var t=this;return i(this,(function(n){return this._connection?[2,this._connection]:(this._connection=new Promise((function(n,r){t._channel.port1.onmessage=function(r){switch(e._debug("received",r.data.action,r.data.data),r.data.action){case a.ChattyHostMessages.SynAck:t._state=u.Connected,t.sendMsg(s.ChattyClientMessages.Ack),n({send:function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];t.sendMsg(s.ChattyClientMessages.Message,{eventName:e,payload:n})},sendAndReceive:function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return o(t,void 0,void 0,(function(){var t,r=this;return i(this,(function(o){return t=++this._sequence,this.sendMsg(s.ChattyClientMessages.MessageWithResponse,{eventName:e,payload:n},t),[2,new Promise((function(e,n){var o;r._defaultTimeout>-1&&(o=setTimeout((function(){delete r._receivers[t],n(new Error("Timeout"))}),r._defaultTimeout)),r._receivers[t]={resolve:e,reject:n,timeoutId:o}}))]}))}))}});break;case a.ChattyHostMessages.Message:t._handlers[r.data.data.eventName]&&t._handlers[r.data.data.eventName].forEach((function(e){return e.apply(t,r.data.data.payload)}));break;case a.ChattyHostMessages.MessageWithResponse:var c=r.data.data,l=c.eventName,f=c.payload,h=c.sequence,d=[];t._handlers[l]&&(d=t._handlers[l].map((function(e){return e.apply(t,f)}))),Promise.all(d).then((function(e){t.sendMsg(s.ChattyClientMessages.Response,{eventName:l,payload:e},h)})).catch((function(e){t.sendMsg(s.ChattyClientMessages.ResponseError,{eventName:l,payload:e},h)}));break;case a.ChattyHostMessages.Response:var p=t._receivers[r.data.data.sequence];p&&(delete t._receivers[r.data.data.sequence],p.timeoutId&&clearTimeout(p.timeoutId),p.resolve(r.data.data.payload));break;case a.ChattyHostMessages.ResponseError:var y=t._receivers[r.data.data.sequence];y&&(delete t._receivers[r.data.data.sequence],y.timeoutId&&clearTimeout(y.timeoutId),y.reject(r.data.data.payload))}},t.initiateHandshake()})),[2,this._connection])}))}))},e.prototype.initiateHandshake=function(){e._debug("connecting to",this._targetOrigin),this._hostWindow.postMessage({action:s.ChattyClientMessages.Syn},this._targetOrigin,[this._channel.port2]),this._state=u.Syn},e.prototype.sendMsg=function(t,n,o){void 0===n&&(n={});var i=r({},n,o?{sequence:o}:{});e._debug("sending",t,i),this._channel.port1.postMessage({action:t,data:i})},e._debug=c("looker:chatty:client"),e}();t.ChattyClient=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.Syn=0]="Syn",e[e.Ack=1]="Ack",e[e.Message=2]="Message",e[e.MessageWithResponse=3]="MessageWithResponse",e[e.Response=4]="Response",e[e.ResponseError=5]="ResponseError"}(t.ChattyClientMessages||(t.ChattyClientMessages={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.SynAck=0]="SynAck",e[e.Message=1]="Message",e[e.MessageWithResponse=2]="MessageWithResponse",e[e.Response=3]="Response",e[e.ResponseError=4]="ResponseError"}(t.ChattyHostMessages||(t.ChattyHostMessages={}))},function(e,t,n){"use strict";e.exports=n(17).polyfill()},function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(e){r=s}}();var u,c=[],l=!1,f=-1;function h(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&d())}function d(){if(!l){var e=a(h);l=!0;for(var t=c.length;t;){for(u=c,c=[];++f<t;)u&&u[f].run();f=-1,t=c.length}u=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function y(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new p(e,t)),1!==c.length||l||a(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=y,o.addListener=y,o.once=y,o.off=y,o.removeListener=y,o.removeAllListeners=y,o.emit=y,o.prependListener=y,o.prependOnceListener=y,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){(function(r){function o(){var e;try{e=t.storage.debug}catch(e){}return!e&&void 0!==r&&"env"in r&&(e=r.env.DEBUG),e}(t=e.exports=n(19)).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(e){var n=this.useColors;if(e[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+e[0]+(n?"%c ":" ")+"+"+t.humanize(this.diff),!n)return;var r="color: "+this.color;e.splice(1,0,r,"color: inherit");var o=0,i=0;e[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(o++,"%c"===e&&(i=o))})),e.splice(i,0,r)},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}},t.load=o,t.useColors=function(){if("undefined"!=typeof window&&window.process&&"renderer"===window.process.type)return!0;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(o())}).call(this,n(6))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9),o=function(){function e(e,t){this._url=e,this._source=t,this._appendTo=null,this._handlers={},this._sandboxAttrs=[],this._frameBorder="0",this._targetOrigin=null,this._defaultTimeout=3e4}return Object.defineProperty(e.prototype,"el",{get:function(){return this._appendTo||document.body},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"handlers",{get:function(){return this._handlers},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"sandboxAttrs",{get:function(){return this._sandboxAttrs},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"targetOrigin",{get:function(){return this._targetOrigin},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"url",{get:function(){return this._url},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"source",{get:function(){return this._source},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"defaultTimeout",{get:function(){return this._defaultTimeout},enumerable:!0,configurable:!0}),e.prototype.appendTo=function(e){return this._appendTo=e,this},e.prototype.off=function(e,t){this._handlers[e]&&(this._handlers[e]=this._handlers[e].filter((function(e){return e!==t})))},e.prototype.on=function(e,t){return this._handlers[e]=this._handlers[e]||[],this._handlers[e].push(t),this},e.prototype.withDefaultTimeout=function(e){return this._defaultTimeout=e,this},e.prototype.getFrameBorder=function(){return this._frameBorder},e.prototype.frameBorder=function(e){return this._frameBorder=e,this},e.prototype.sandbox=function(e){return this.withSandboxAttribute(e),this},e.prototype.withSandboxAttribute=function(e){return this._sandboxAttrs.push(e),this},e.prototype.withTargetOrigin=function(e){return this._targetOrigin=e,this},e.prototype.build=function(){return new r.ChattyHost(this)},e}();t.ChattyHostBuilder=o},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{u(r.next(e))}catch(e){i(e)}}function a(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){e.done?o(e.value):new n((function(t){t(e.value)})).then(s,a)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(3),a=n(4);n(5);var u,c=n(7);!function(e){e[e.Connecting=0]="Connecting",e[e.SynAck=1]="SynAck",e[e.Connected=2]="Connected"}(u=t.ChattyHostStates||(t.ChattyHostStates={}));var l=function(){function e(e){var t=this;this._hostWindow=window,this._connection=null,this._state=u.Connecting,this._sequence=0,this._receivers={},this.iframe=document.createElement("iframe"),e.sandboxAttrs.forEach((function(e){return t.iframe.sandbox.add(e)})),this.iframe.frameBorder=e.getFrameBorder(),e.url?this.iframe.src=e.url:e.source?this.iframe.srcdoc=e.source:console.warn("url or source required to initialize Chatty host correctly"),this._appendTo=e.el,this._handlers=e.handlers,this._port=null,this._targetOrigin=e.targetOrigin,this._defaultTimeout=e.defaultTimeout}return Object.defineProperty(e.prototype,"connection",{get:function(){return this._connection},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isConnected",{get:function(){return this._state===u.Connected},enumerable:!0,configurable:!0}),e.prototype.connect=function(){return o(this,void 0,void 0,(function(){var t,n=this;return i(this,(function(r){return this._connection?[2,this._connection]:(t=function(){return o(n,void 0,void 0,(function(){var t=this;return i(this,(function(n){return[2,new Promise((function(n,r){var c=function(r){switch(e._debug("port received",r.data.action,r.data.data),r.data.action){case s.ChattyClientMessages.Ack:t._state=u.Connected,n({send:function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];t.sendMsg(a.ChattyHostMessages.Message,{eventName:e,payload:n})},sendAndReceive:function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return o(t,void 0,void 0,(function(){var t,r=this;return i(this,(function(o){return t=++this._sequence,this.sendMsg(a.ChattyHostMessages.MessageWithResponse,{eventName:e,payload:n},t),[2,new Promise((function(e,n){var o;r._defaultTimeout>-1&&(o=setTimeout((function(){delete r._receivers[t],n(new Error("Timeout"))}),r._defaultTimeout)),r._receivers[t]={resolve:e,reject:n,timeoutId:o}}))]}))}))}});break;case s.ChattyClientMessages.Message:t._handlers[r.data.data.eventName]&&t._handlers[r.data.data.eventName].forEach((function(e){return e.apply(t,r.data.data.payload)}));break;case s.ChattyClientMessages.MessageWithResponse:var c=r.data.data,l=c.eventName,f=c.payload,h=c.sequence,d=[];t._handlers[l]&&(d=t._handlers[l].map((function(e){return e.apply(t,f)}))),Promise.all(d).then((function(e){t.sendMsg(a.ChattyHostMessages.Response,{eventName:l,payload:e},h)})).catch((function(e){t.sendMsg(a.ChattyHostMessages.ResponseError,{eventName:l,payload:e},h)}));break;case s.ChattyClientMessages.Response:(p=t._receivers[r.data.data.sequence])&&(delete t._receivers[r.data.data.sequence],p.timeoutId&&clearTimeout(p.timeoutId),p.resolve(r.data.data.payload));break;case s.ChattyClientMessages.ResponseError:var p;(p=t._receivers[r.data.data.sequence])&&(delete t._receivers[r.data.data.sequence],p.timeoutId&&clearTimeout(p.timeoutId),p.reject(r.data.data.payload))}};t._hostWindow.addEventListener("message",(function(n){if(t.isValidMsg(n))switch(e._debug("window received",n.data.action,n.data.data),n.data.action){case s.ChattyClientMessages.Syn:if(t._port){if(!(t._targetOrigin&&"*"===t._targetOrigin||t._targetOrigin===n.origin))return void e._debug("rejected new connection from",n.origin);e._debug("reconnecting to",n.origin),t._port.close()}t._port=n.ports[0],t._port.onmessage=c,t.sendMsg(a.ChattyHostMessages.SynAck),t._state=u.SynAck}else e._debug("window received invalid",n)}))}))]}))}))},this._appendTo.appendChild(this.iframe),[2,this._connection=t()])}))}))},e.prototype.sendMsg=function(t,n,o){void 0===n&&(n={});var i=r({},n,o?{sequence:o}:{});e._debug("sending",t,i),this._port.postMessage({action:t,data:i})},e.prototype.isValidMsg=function(e){return e.source===this.iframe.contentWindow&&(!this._targetOrigin||"*"===this._targetOrigin||this._targetOrigin===e.origin)},e._debug=c("looker:chatty:host"),e}();t.ChattyHost=l},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.run=function(){this.send("dashboard:run")},t.prototype.updateFilters=function(e){this.send("dashboard:filters:update",{filters:e})},t.prototype.setOptions=function(e){this.send("dashboard:options:set",e)},t}(n(0).LookerEmbedBase);t.LookerEmbedDashboard=i},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.run=function(){this.send("look:run")},t.prototype.updateFilters=function(e){this.send("look:filters:update",{filters:e})},t}(n(0).LookerEmbedBase);t.LookerEmbedExplore=i},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.run=function(){this.send("look:run")},t.prototype.updateFilters=function(e){this.send("look:filters:update",{filters:e})},t}(n(0).LookerEmbedBase);t.LookerEmbedLook=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(14),o=n(10),i=n(11),s=n(12),a=n(10);t.LookerEmbedDashboard=a.LookerEmbedDashboard;var u=n(11);t.LookerEmbedExplore=u.LookerEmbedExplore;var c=n(12);t.LookerEmbedLook=c.LookerEmbedLook;var l=function(){function e(){}return e.init=function(e,t){this.apiHost=e,this.authUrl=t},e.createDashboardWithUrl=function(e){return new r.EmbedBuilder(this,"dashboard","/embed/dashboards",o.LookerEmbedDashboard).withUrl(e)},e.createDashboardWithId=function(e){return new r.EmbedBuilder(this,"dashboard","/embed/dashboards",o.LookerEmbedDashboard).withId(e)},e.createExploreWithUrl=function(e){return new r.EmbedBuilder(this,"explore","/embed/explore",i.LookerEmbedExplore).withUrl(e)},e.createExploreWithId=function(e){return e=e.replace("::","/"),new r.EmbedBuilder(this,"explore","/embed/explore",i.LookerEmbedExplore).withId(e)},e.createLookWithUrl=function(e){return new r.EmbedBuilder(this,"look","/embed/looks",s.LookerEmbedLook).withUrl(e)},e.createLookWithId=function(e){return new r.EmbedBuilder(this,"look","/embed/looks",s.LookerEmbedLook).withId(e)},e}();t.LookerEmbedSDK=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(15);function o(e){return e.replace(/,/g,"^,")}var i=function(){function e(e,t,n,r){if(this._hostSettings=e,this._type=t,this._endpoint=n,this._clientConstructor=r,this._handlers={},this._appendTo=null,this._sandboxAttrs=[],this._classNames=[],this._frameBorder="0",this._suffix="",this.sandboxedHost)this._params={embed_domain:this._hostSettings.apiHost,sdk:"2",sandboxed_host:"true"};else{var o=window.location.origin;this._params={embed_domain:o,sdk:"2"}}}return e.prototype.withFrameBorder=function(e){return this._frameBorder=e,this},e.prototype.withId=function(e){return this._id=e,this},e.prototype.withParams=function(e){for(var t in e)this._params[t]=e[t];return this},e.prototype.withFilters=function(e,t){if(void 0===t&&(t=!1),"dashboard"===this.type)for(var n in e)this._params[n]=t?o(e[n]):e[n];else for(var n in e)this._params["f["+n+"]"]=t?o(e[n]):e[n];return this},e.prototype.withSandboxAttr=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this._sandboxAttrs=this._sandboxAttrs.concat(e),this},e.prototype.withClassName=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this._classNames=this._classNames.concat(e),this},e.prototype.withNext=function(e){return void 0===e&&(e="-next"),this._suffix=e,this._endpoint+=this._suffix,this},e.prototype.withTheme=function(e){return this._params.theme=e,this},e.prototype.withUrl=function(e){return this._url=e,this},Object.defineProperty(e.prototype,"sandboxedHost",{get:function(){if(void 0===this._sandboxedHost){var e=window.location.origin;this._sandboxedHost="null"===e||!e}return this._sandboxedHost},set:function(e){this._sandboxedHost=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"el",{get:function(){return this._appendTo||document.body},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"frameBorder",{get:function(){return this._frameBorder},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"endpoint",{get:function(){return this._endpoint},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"apiHost",{get:function(){return this._hostSettings.apiHost},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"url",{get:function(){return this._url},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"authUrl",{get:function(){return this._hostSettings.authUrl},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"embedUrl",{get:function(){var e=function(e){var t=[];for(var n in e)t.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t.join("&")}(this._params);return this.endpoint+"/"+this.id+"?"+e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"handlers",{get:function(){return this._handlers},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"sandboxAttrs",{get:function(){return this._sandboxAttrs},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"classNames",{get:function(){return this._classNames},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"suffix",{get:function(){return this._suffix},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"clientConstructor",{get:function(){return this._clientConstructor},enumerable:!0,configurable:!0}),e.prototype.appendTo=function(e){return this._appendTo="string"==typeof e?document.querySelector(e):e,this},e.prototype.on=function(e,t){return this._handlers[e]=this._handlers[e]?this._handlers[e]:[],this._handlers[e].push(t),this},e.prototype.build=function(){return new r.EmbedClient(this)},e}();t.EmbedBuilder=i},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{u(r.next(e))}catch(e){i(e)}}function a(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){e.done?o(e.value):new n((function(t){t(e.value)})).then(s,a)}u((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(16),s=/^https?:\/\//,a=function(){function e(e){this._builder=e,this._hostBuilder=null,this._host=null,this._connection=null,this._client=null}return Object.defineProperty(e.prototype,"connection",{get:function(){return this._connection},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isConnected",{get:function(){return!!this._connection},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"targetOrigin",{get:function(){if(this._builder.sandboxedHost)return"*";var e=this._builder.apiHost;return s.test(e)?e:"https://"+e},enumerable:!0,configurable:!0}),e.prototype.createIframe=function(e){return r(this,void 0,void 0,(function(){var t,n,r,s,a,u,c,l,f,h,d=this;return o(this,(function(o){for(n in this._hostBuilder=i.Chatty.createHost(e),this._builder.handlers)for(r=function(e){s._hostBuilder.on(n,(function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.apply(d._client,t)}))},s=this,a=0,u=this._builder.handlers[n];a<u.length;a++)c=u[a],r(c);for(l=0,f=this._builder.sandboxAttrs;l<f.length;l++)h=f[l],this._hostBuilder.withSandboxAttribute(h);return this._host=this._hostBuilder.frameBorder(this._builder.frameBorder).withTargetOrigin(this.targetOrigin).appendTo(this._builder.el).build(),this._builder.classNames.length&&(t=this._host.iframe.classList).add.apply(t,this._builder.classNames),[2,this._host.connect().then((function(e){return d._client=new d._builder.clientConstructor(e),d._client}))]}))}))},e.prototype.createUrl=function(){return r(this,void 0,void 0,(function(){var e,t,n=this;return o(this,(function(i){return e=this._builder.embedUrl,this._builder.authUrl?(t=this._builder.authUrl+"?src="+encodeURIComponent(e),[2,new Promise((function(e,i){return r(n,void 0,void 0,(function(){var n;return o(this,(function(r){return(n=new XMLHttpRequest).open("GET",t),n.setRequestHeader("Cache-Control","no-cache"),n.onload=function(){200===n.status?e(JSON.parse(n.responseText).url):i(n.statusText)},n.onerror=function(){return i(n.statusText)},n.send(),[2]}))}))}))]):[2,""+this._builder.apiHost+e]}))}))},e.prototype.connect=function(){return r(this,void 0,void 0,(function(){var e=this;return o(this,(function(t){return this._connection?[2,this._connection]:(this._builder.url?this._connection=this.createIframe(this._builder.url):this._connection=this.createUrl().then((function(t){return r(e,void 0,void 0,(function(){return o(this,(function(e){return[2,this.createIframe(t)]}))}))})),[2,this._connection])}))}))},e}();t.EmbedClient=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),o=n(8),i=n(1);t.ChattyClientBuilder=i.ChattyClientBuilder;var s=n(8);t.ChattyHostBuilder=s.ChattyHostBuilder;var a=n(2);t.ChattyClient=a.ChattyClient;var u=n(9);t.ChattyHost=u.ChattyHost;var c=function(){function e(){}return e.createHost=function(e){return new o.ChattyHostBuilder(e)},e.createHostFromSource=function(e){return new o.ChattyHostBuilder(void 0,e)},e.createClient=function(){return new r.ChattyClientBuilder},e}();t.Chatty=c},function(e,t,n){(function(t,n){ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.LookerEmbedSDK=e():t.LookerEmbedSDK=e()}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=13)}([function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{u(r.next(t))}catch(t){i(t)}}function a(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){t.done?o(t.value):new n((function(e){e(t.value)})).then(s,a)}u((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t){this._host=t}return t.prototype.send=function(t,e){this._host.send(t,e)},t.prototype.sendAndReceive=function(t,e){return r(this,void 0,void 0,(function(){return o(this,(function(n){return[2,this._host.sendAndReceive(t,e)]}))}))},t}();e.LookerEmbedBase=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(2),o=function(){function t(){this._targetOrigin="*",this._handlers={},this._defaultTimeout=3e4}return Object.defineProperty(t.prototype,"targetOrigin",{get:function(){return this._targetOrigin},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"handlers",{get:function(){return this._handlers},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"defaultTimeout",{get:function(){return this._defaultTimeout},enumerable:!0,configurable:!0}),t.prototype.off=function(t,e){this._handlers[t]&&(this._handlers[t]=this._handlers[t].filter((function(t){return t!==e})))},t.prototype.on=function(t,e){return this._handlers[t]=this._handlers[t]||[],this._handlers[t].push(e),this},t.prototype.withDefaultTimeout=function(t){return this._defaultTimeout=t,this},t.prototype.withTargetOrigin=function(t){return this._targetOrigin=t,this},t.prototype.build=function(){return new r.ChattyClient(this)},t}();e.ChattyClientBuilder=o},function(t,e,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{u(r.next(t))}catch(t){i(t)}}function a(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){t.done?o(t.value):new n((function(e){e(t.value)})).then(s,a)}u((r=r.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(e,"__esModule",{value:!0});var s=n(3),a=n(4);n(5);var u,c=n(7);!function(t){t[t.Connecting=0]="Connecting",t[t.Syn=1]="Syn",t[t.Connected=2]="Connected"}(u=e.ChattyClientStates||(e.ChattyClientStates={}));var l=function(){function t(t){this._clientWindow=window,this._connection=null,this._hostWindow=this._clientWindow.parent,this._state=u.Connecting,this._sequence=0,this._receivers={},this._handlers=t.handlers,this._targetOrigin=t.targetOrigin,this._defaultTimeout=t.defaultTimeout,this._channel=new MessageChannel}return Object.defineProperty(t.prototype,"connection",{get:function(){return this._connection},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isConnected",{get:function(){return this._state===u.Connected},enumerable:!0,configurable:!0}),t.prototype.connect=function(){return o(this,void 0,void 0,(function(){var e=this;return i(this,(function(n){return this._connection?[2,this._connection]:(this._connection=new Promise((function(n,r){e._channel.port1.onmessage=function(r){switch(t._debug("received",r.data.action,r.data.data),r.data.action){case a.ChattyHostMessages.SynAck:e._state=u.Connected,e.sendMsg(s.ChattyClientMessages.Ack),n({send:function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];e.sendMsg(s.ChattyClientMessages.Message,{eventName:t,payload:n})},sendAndReceive:function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return o(e,void 0,void 0,(function(){var e,r=this;return i(this,(function(o){return e=++this._sequence,this.sendMsg(s.ChattyClientMessages.MessageWithResponse,{eventName:t,payload:n},e),[2,new Promise((function(t,n){var o;r._defaultTimeout>-1&&(o=setTimeout((function(){delete r._receivers[e],n(new Error("Timeout"))}),r._defaultTimeout)),r._receivers[e]={resolve:t,reject:n,timeoutId:o}}))]}))}))}});break;case a.ChattyHostMessages.Message:e._handlers[r.data.data.eventName]&&e._handlers[r.data.data.eventName].forEach((function(t){return t.apply(e,r.data.data.payload)}));break;case a.ChattyHostMessages.MessageWithResponse:var c=r.data.data,l=c.eventName,h=c.payload,f=c.sequence,d=[];e._handlers[l]&&(d=e._handlers[l].map((function(t){return t.apply(e,h)}))),Promise.all(d).then((function(t){e.sendMsg(s.ChattyClientMessages.Response,{eventName:l,payload:t},f)})).catch((function(t){e.sendMsg(s.ChattyClientMessages.ResponseError,{eventName:l,payload:t},f)}));break;case a.ChattyHostMessages.Response:var p=e._receivers[r.data.data.sequence];p&&(delete e._receivers[r.data.data.sequence],p.timeoutId&&clearTimeout(p.timeoutId),p.resolve(r.data.data.payload));break;case a.ChattyHostMessages.ResponseError:var y=e._receivers[r.data.data.sequence];y&&(delete e._receivers[r.data.data.sequence],y.timeoutId&&clearTimeout(y.timeoutId),y.reject(r.data.data.payload))}},e.initiateHandshake()})),[2,this._connection])}))}))},t.prototype.initiateHandshake=function(){t._debug("connecting to",this._targetOrigin),this._hostWindow.postMessage({action:s.ChattyClientMessages.Syn},this._targetOrigin,[this._channel.port2]),this._state=u.Syn},t.prototype.sendMsg=function(e,n,o){void 0===n&&(n={});var i=r({},n,o?{sequence:o}:{});t._debug("sending",e,i),this._channel.port1.postMessage({action:e,data:i})},t._debug=c("looker:chatty:client"),t}();e.ChattyClient=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.Syn=0]="Syn",t[t.Ack=1]="Ack",t[t.Message=2]="Message",t[t.MessageWithResponse=3]="MessageWithResponse",t[t.Response=4]="Response",t[t.ResponseError=5]="ResponseError"}(e.ChattyClientMessages||(e.ChattyClientMessages={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.SynAck=0]="SynAck",t[t.Message=1]="Message",t[t.MessageWithResponse=2]="MessageWithResponse",t[t.Response=3]="Response",t[t.ResponseError=4]="ResponseError"}(e.ChattyHostMessages||(e.ChattyHostMessages={}))},function(t,e,n){"use strict";t.exports=n(17).polyfill()},function(t,e){var n,r,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(t){n=i}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(t){r=s}}();var u,c=[],l=!1,h=-1;function f(){l&&u&&(l=!1,u.length?c=u.concat(c):h=-1,c.length&&d())}function d(){if(!l){var t=a(f);l=!0;for(var e=c.length;e;){for(u=c,c=[];++h<e;)u&&u[h].run();h=-1,e=c.length}u=null,l=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function y(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];c.push(new p(t,e)),1!==c.length||l||a(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=y,o.addListener=y,o.once=y,o.off=y,o.removeListener=y,o.removeAllListeners=y,o.emit=y,o.prependListener=y,o.prependOnceListener=y,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(t,e,n){(function(r){function o(){var t;try{t=e.storage.debug}catch(t){}return!t&&void 0!==r&&"env"in r&&(t=r.env.DEBUG),t}(e=t.exports=n(19)).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},e.formatArgs=function(t){var n=this.useColors;if(t[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+t[0]+(n?"%c ":" ")+"+"+e.humanize(this.diff),!n)return;var r="color: "+this.color;t.splice(1,0,r,"color: inherit");var o=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(function(t){"%%"!==t&&(o++,"%c"===t&&(i=o))})),t.splice(i,0,r)},e.save=function(t){try{null==t?e.storage.removeItem("debug"):e.storage.debug=t}catch(t){}},e.load=o,e.useColors=function(){if("undefined"!=typeof window&&window.process&&"renderer"===window.process.type)return!0;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},e.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(t){}}(),e.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],e.formatters.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},e.enable(o())}).call(this,n(6))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(9),o=function(){function t(t,e){this._url=t,this._source=e,this._appendTo=null,this._handlers={},this._sandboxAttrs=[],this._frameBorder="0",this._targetOrigin=null,this._defaultTimeout=3e4}return Object.defineProperty(t.prototype,"el",{get:function(){return this._appendTo||document.body},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"handlers",{get:function(){return this._handlers},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"sandboxAttrs",{get:function(){return this._sandboxAttrs},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"targetOrigin",{get:function(){return this._targetOrigin},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"url",{get:function(){return this._url},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"source",{get:function(){return this._source},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"defaultTimeout",{get:function(){return this._defaultTimeout},enumerable:!0,configurable:!0}),t.prototype.appendTo=function(t){return this._appendTo=t,this},t.prototype.off=function(t,e){this._handlers[t]&&(this._handlers[t]=this._handlers[t].filter((function(t){return t!==e})))},t.prototype.on=function(t,e){return this._handlers[t]=this._handlers[t]||[],this._handlers[t].push(e),this},t.prototype.withDefaultTimeout=function(t){return this._defaultTimeout=t,this},t.prototype.getFrameBorder=function(){return this._frameBorder},t.prototype.frameBorder=function(t){return this._frameBorder=t,this},t.prototype.sandbox=function(t){return this.withSandboxAttribute(t),this},t.prototype.withSandboxAttribute=function(t){return this._sandboxAttrs.push(t),this},t.prototype.withTargetOrigin=function(t){return this._targetOrigin=t,this},t.prototype.build=function(){return new r.ChattyHost(this)},t}();e.ChattyHostBuilder=o},function(t,e,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{u(r.next(t))}catch(t){i(t)}}function a(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){t.done?o(t.value):new n((function(e){e(t.value)})).then(s,a)}u((r=r.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(e,"__esModule",{value:!0});var s=n(3),a=n(4);n(5);var u,c=n(7);!function(t){t[t.Connecting=0]="Connecting",t[t.SynAck=1]="SynAck",t[t.Connected=2]="Connected"}(u=e.ChattyHostStates||(e.ChattyHostStates={}));var l=function(){function t(t){var e=this;this._hostWindow=window,this._connection=null,this._state=u.Connecting,this._sequence=0,this._receivers={},this.iframe=document.createElement("iframe"),t.sandboxAttrs.forEach((function(t){return e.iframe.sandbox.add(t)})),this.iframe.frameBorder=t.getFrameBorder(),t.url?this.iframe.src=t.url:t.source?this.iframe.srcdoc=t.source:console.warn("url or source required to initialize Chatty host correctly"),this._appendTo=t.el,this._handlers=t.handlers,this._port=null,this._targetOrigin=t.targetOrigin,this._defaultTimeout=t.defaultTimeout}return Object.defineProperty(t.prototype,"connection",{get:function(){return this._connection},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isConnected",{get:function(){return this._state===u.Connected},enumerable:!0,configurable:!0}),t.prototype.connect=function(){return o(this,void 0,void 0,(function(){var e,n=this;return i(this,(function(r){return this._connection?[2,this._connection]:(e=function(){return o(n,void 0,void 0,(function(){var e=this;return i(this,(function(n){return[2,new Promise((function(n,r){var c=function(r){switch(t._debug("port received",r.data.action,r.data.data),r.data.action){case s.ChattyClientMessages.Ack:e._state=u.Connected,n({send:function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];e.sendMsg(a.ChattyHostMessages.Message,{eventName:t,payload:n})},sendAndReceive:function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return o(e,void 0,void 0,(function(){var e,r=this;return i(this,(function(o){return e=++this._sequence,this.sendMsg(a.ChattyHostMessages.MessageWithResponse,{eventName:t,payload:n},e),[2,new Promise((function(t,n){var o;r._defaultTimeout>-1&&(o=setTimeout((function(){delete r._receivers[e],n(new Error("Timeout"))}),r._defaultTimeout)),r._receivers[e]={resolve:t,reject:n,timeoutId:o}}))]}))}))}});break;case s.ChattyClientMessages.Message:e._handlers[r.data.data.eventName]&&e._handlers[r.data.data.eventName].forEach((function(t){return t.apply(e,r.data.data.payload)}));break;case s.ChattyClientMessages.MessageWithResponse:var c=r.data.data,l=c.eventName,h=c.payload,f=c.sequence,d=[];e._handlers[l]&&(d=e._handlers[l].map((function(t){return t.apply(e,h)}))),Promise.all(d).then((function(t){e.sendMsg(a.ChattyHostMessages.Response,{eventName:l,payload:t},f)})).catch((function(t){e.sendMsg(a.ChattyHostMessages.ResponseError,{eventName:l,payload:t},f)}));break;case s.ChattyClientMessages.Response:(p=e._receivers[r.data.data.sequence])&&(delete e._receivers[r.data.data.sequence],p.timeoutId&&clearTimeout(p.timeoutId),p.resolve(r.data.data.payload));break;case s.ChattyClientMessages.ResponseError:var p;(p=e._receivers[r.data.data.sequence])&&(delete e._receivers[r.data.data.sequence],p.timeoutId&&clearTimeout(p.timeoutId),p.reject(r.data.data.payload))}};e._hostWindow.addEventListener("message",(function(n){if(e.isValidMsg(n))switch(t._debug("window received",n.data.action,n.data.data),n.data.action){case s.ChattyClientMessages.Syn:if(e._port){if(!(e._targetOrigin&&"*"===e._targetOrigin||e._targetOrigin===n.origin))return void t._debug("rejected new connection from",n.origin);t._debug("reconnecting to",n.origin),e._port.close()}e._port=n.ports[0],e._port.onmessage=c,e.sendMsg(a.ChattyHostMessages.SynAck),e._state=u.SynAck}else t._debug("window received invalid",n)}))}))]}))}))},this._appendTo.appendChild(this.iframe),[2,this._connection=e()])}))}))},t.prototype.sendMsg=function(e,n,o){void 0===n&&(n={});var i=r({},n,o?{sequence:o}:{});t._debug("sending",e,i),this._port.postMessage({action:e,data:i})},t.prototype.isValidMsg=function(t){return t.source===this.iframe.contentWindow&&(!this._targetOrigin||"*"===this._targetOrigin||this._targetOrigin===t.origin)},t._debug=c("looker:chatty:host"),t}();e.ChattyHost=l},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.run=function(){this.send("dashboard:run")},e.prototype.updateFilters=function(t){this.send("dashboard:filters:update",{filters:t})},e.prototype.setOptions=function(t){this.send("dashboard:options:set",t)},e}(n(0).LookerEmbedBase);e.LookerEmbedDashboard=i},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.run=function(){this.send("look:run")},e.prototype.updateFilters=function(t){this.send("look:filters:update",{filters:t})},e}(n(0).LookerEmbedBase);e.LookerEmbedExplore=i},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.run=function(){this.send("look:run")},e.prototype.updateFilters=function(t){this.send("look:filters:update",{filters:t})},e}(n(0).LookerEmbedBase);e.LookerEmbedLook=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(14),o=n(10),i=n(11),s=n(12),a=n(10);e.LookerEmbedDashboard=a.LookerEmbedDashboard;var u=n(11);e.LookerEmbedExplore=u.LookerEmbedExplore;var c=n(12);e.LookerEmbedLook=c.LookerEmbedLook;var l=function(){function t(){}return t.init=function(t,e){this.apiHost=t,this.authUrl=e},t.createDashboardWithUrl=function(t){return new r.EmbedBuilder(this,"dashboard","/embed/dashboards",o.LookerEmbedDashboard).withUrl(t)},t.createDashboardWithId=function(t){return new r.EmbedBuilder(this,"dashboard","/embed/dashboards",o.LookerEmbedDashboard).withId(t)},t.createExploreWithUrl=function(t){return new r.EmbedBuilder(this,"explore","/embed/explore",i.LookerEmbedExplore).withUrl(t)},t.createExploreWithId=function(t){return t=t.replace("::","/"),new r.EmbedBuilder(this,"explore","/embed/explore",i.LookerEmbedExplore).withId(t)},t.createLookWithUrl=function(t){return new r.EmbedBuilder(this,"look","/embed/looks",s.LookerEmbedLook).withUrl(t)},t.createLookWithId=function(t){return new r.EmbedBuilder(this,"look","/embed/looks",s.LookerEmbedLook).withId(t)},t}();e.LookerEmbedSDK=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(15);function o(t){return t.replace(/,/g,"^,")}var i=function(){function t(t,e,n,r){if(this._hostSettings=t,this._type=e,this._endpoint=n,this._clientConstructor=r,this._handlers={},this._appendTo=null,this._sandboxAttrs=[],this._classNames=[],this._frameBorder="0",this._suffix="",this.sandboxedHost)this._params={embed_domain:this._hostSettings.apiHost,sdk:"2",sandboxed_host:"true"};else{var o=window.location.origin;this._params={embed_domain:o,sdk:"2"}}}return t.prototype.withFrameBorder=function(t){return this._frameBorder=t,this},t.prototype.withId=function(t){return this._id=t,this},t.prototype.withParams=function(t){for(var e in t)this._params[e]=t[e];return this},t.prototype.withFilters=function(t,e){if(void 0===e&&(e=!1),"dashboard"===this.type)for(var n in t)this._params[n]=e?o(t[n]):t[n];else for(var n in t)this._params["f["+n+"]"]=e?o(t[n]):t[n];return this},t.prototype.withSandboxAttr=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._sandboxAttrs=this._sandboxAttrs.concat(t),this},t.prototype.withClassName=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._classNames=this._classNames.concat(t),this},t.prototype.withNext=function(t){return void 0===t&&(t="-next"),this._suffix=t,this._endpoint+=this._suffix,this},t.prototype.withTheme=function(t){return this._params.theme=t,this},t.prototype.withApiHost=function(t){if(this._hostSettings.apiHost){if(this._hostSettings.apiHost!==t)throw new Error("not allowed to change api host")}else this._hostSettings.apiHost=t,this.sandboxedHost&&(this._params.embed_domain=t,this._params.sandboxed_host="true");return this},t.prototype.withAuthUrl=function(t){if(this._hostSettings.authUrl){if(this._hostSettings.authUrl!==t)throw new Error("not allowed to change auth url")}else this._hostSettings.authUrl=t;return this},t.prototype.withUrl=function(t){return this._url=t,this},Object.defineProperty(t.prototype,"sandboxedHost",{get:function(){if(void 0===this._sandboxedHost){var t=window.location.origin;this._sandboxedHost="null"===t||!t}return this._sandboxedHost},set:function(t){this._sandboxedHost=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"el",{get:function(){return this._appendTo||document.body},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"frameBorder",{get:function(){return this._frameBorder},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"endpoint",{get:function(){return this._endpoint},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){return this._type},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"apiHost",{get:function(){return this._hostSettings.apiHost},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"url",{get:function(){return this._url},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"authUrl",{get:function(){return this._hostSettings.authUrl},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"embedUrl",{get:function(){var t=function(t){var e=[];for(var n in t)e.push(encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e.join("&")}(this._params);return this.endpoint+"/"+this.id+"?"+t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"handlers",{get:function(){return this._handlers},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"sandboxAttrs",{get:function(){return this._sandboxAttrs},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"classNames",{get:function(){return this._classNames},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"suffix",{get:function(){return this._suffix},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"clientConstructor",{get:function(){return this._clientConstructor},enumerable:!0,configurable:!0}),t.prototype.appendTo=function(t){return this._appendTo="string"==typeof t?document.querySelector(t):t,this},t.prototype.on=function(t,e){return this._handlers[t]=this._handlers[t]?this._handlers[t]:[],this._handlers[t].push(e),this},t.prototype.build=function(){return new r.EmbedClient(this)},t}();e.EmbedBuilder=i},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{u(r.next(t))}catch(t){i(t)}}function a(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){t.done?o(t.value):new n((function(e){e(t.value)})).then(s,a)}u((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(16),s=/^https?:\/\//,a=function(){function t(t){this._builder=t,this._hostBuilder=null,this._host=null,this._connection=null,this._client=null}return Object.defineProperty(t.prototype,"connection",{get:function(){return this._connection},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isConnected",{get:function(){return!!this._connection},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"targetOrigin",{get:function(){if(this._builder.sandboxedHost)return"*";var t=this._builder.apiHost;return s.test(t)?t:"https://"+t},enumerable:!0,configurable:!0}),t.prototype.createIframe=function(t){return r(this,void 0,void 0,(function(){var e,n,r,s,a,u,c,l,h,f,d=this;return o(this,(function(o){for(n in this._hostBuilder=i.Chatty.createHost(t),this._builder.handlers)for(r=function(t){s._hostBuilder.on(n,(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.apply(d._client,e)}))},s=this,a=0,u=this._builder.handlers[n];a<u.length;a++)c=u[a],r(c);for(l=0,h=this._builder.sandboxAttrs;l<h.length;l++)f=h[l],this._hostBuilder.withSandboxAttribute(f);return this._host=this._hostBuilder.frameBorder(this._builder.frameBorder).withTargetOrigin(this.targetOrigin).appendTo(this._builder.el).build(),this._builder.classNames.length&&(e=this._host.iframe.classList).add.apply(e,this._builder.classNames),[2,this._host.connect().then((function(t){return d._client=new d._builder.clientConstructor(t),d._client}))]}))}))},t.prototype.createUrl=function(){return r(this,void 0,void 0,(function(){var t,e,n=this;return o(this,(function(i){return t=this._builder.embedUrl,this._builder.authUrl?(e=this._builder.authUrl+"?src="+encodeURIComponent(t),[2,new Promise((function(t,i){return r(n,void 0,void 0,(function(){var n;return o(this,(function(r){return(n=new XMLHttpRequest).open("GET",e),n.setRequestHeader("Cache-Control","no-cache"),n.onload=function(){200===n.status?t(JSON.parse(n.responseText).url):i(n.statusText)},n.onerror=function(){return i(n.statusText)},n.send(),[2]}))}))}))]):[2,""+this._builder.apiHost+t]}))}))},t.prototype.connect=function(){return r(this,void 0,void 0,(function(){var t=this;return o(this,(function(e){return this._connection?[2,this._connection]:(this._builder.url?this._connection=this.createIframe(this._builder.url):this._connection=this.createUrl().then((function(e){return r(t,void 0,void 0,(function(){return o(this,(function(t){return[2,this.createIframe(e)]}))}))})),[2,this._connection])}))}))},t}();e.EmbedClient=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(1),o=n(8),i=n(1);e.ChattyClientBuilder=i.ChattyClientBuilder;var s=n(8);e.ChattyHostBuilder=s.ChattyHostBuilder;var a=n(2);e.ChattyClient=a.ChattyClient;var u=n(9);e.ChattyHost=u.ChattyHost;var c=function(){function t(){}return t.createHost=function(t){return new o.ChattyHostBuilder(t)},t.createHostFromSource=function(t){return new o.ChattyHostBuilder(void 0,t)},t.createClient=function(){return new r.ChattyClientBuilder},t}();e.Chatty=c},function(t,e,n){(function(e,n){ | ||
/*! | ||
@@ -8,2 +8,2 @@ * @overview es6-promise - a tiny implementation of Promises/A+. | ||
* @version v4.2.8+1e68dce6 | ||
*/var r;r=function(){"use strict";function e(e){return"function"==typeof e}var r=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},o=0,i=void 0,s=void 0,a=function(e,t){p[o]=e,p[o+1]=t,2===(o+=2)&&(s?s(y):v())},u="undefined"!=typeof window?window:void 0,c=u||{},l=c.MutationObserver||c.WebKitMutationObserver,f="undefined"==typeof self&&void 0!==t&&"[object process]"==={}.toString.call(t),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function d(){var e=setTimeout;return function(){return e(y,1)}}var p=new Array(1e3);function y(){for(var e=0;e<o;e+=2)(0,p[e])(p[e+1]),p[e]=void 0,p[e+1]=void 0;o=0}var b,_,g,m,v=void 0;function w(e,t){var n=this,r=new this.constructor(x);void 0===r[O]&&N(r);var o=n._state;if(o){var i=arguments[o-1];a((function(){return B(o,r,i,n._result)}))}else H(n,r,e,t);return r}function C(e){if(e&&"object"==typeof e&&e.constructor===this)return e;var t=new this(x);return P(t,e),t}f?v=function(){return t.nextTick(y)}:l?(_=0,g=new l(y),m=document.createTextNode(""),g.observe(m,{characterData:!0}),v=function(){m.data=_=++_%2}):h?((b=new MessageChannel).port1.onmessage=y,v=function(){return b.port2.postMessage(0)}):v=void 0===u?function(){try{var e=Function("return this")().require("vertx");return void 0!==(i=e.runOnLoop||e.runOnContext)?function(){i(y)}:d()}catch(e){return d()}}():d();var O=Math.random().toString(36).substring(2);function x(){}var M=void 0,k=1,j=2;function E(t,n,r){n.constructor===t.constructor&&r===w&&n.constructor.resolve===C?function(e,t){t._state===k?A(e,t._result):t._state===j?S(e,t._result):H(t,void 0,(function(t){return P(e,t)}),(function(t){return S(e,t)}))}(t,n):void 0===r?A(t,n):e(r)?function(e,t,n){a((function(e){var r=!1,o=function(e,t,n,r){try{e.call(t,n,r)}catch(e){return e}}(n,t,(function(n){r||(r=!0,t!==n?P(e,n):A(e,n))}),(function(t){r||(r=!0,S(e,t))}),e._label);!r&&o&&(r=!0,S(e,o))}),e)}(t,n,r):A(t,n)}function P(e,t){if(e===t)S(e,new TypeError("You cannot resolve a promise with itself"));else if(o=typeof(r=t),null===r||"object"!==o&&"function"!==o)A(e,t);else{var n=void 0;try{n=t.then}catch(t){return void S(e,t)}E(e,t,n)}var r,o}function T(e){e._onerror&&e._onerror(e._result),L(e)}function A(e,t){e._state===M&&(e._result=t,e._state=k,0!==e._subscribers.length&&a(L,e))}function S(e,t){e._state===M&&(e._state=j,e._result=t,a(T,e))}function H(e,t,n,r){var o=e._subscribers,i=o.length;e._onerror=null,o[i]=t,o[i+k]=n,o[i+j]=r,0===i&&e._state&&a(L,e)}function L(e){var t=e._subscribers,n=e._state;if(0!==t.length){for(var r=void 0,o=void 0,i=e._result,s=0;s<t.length;s+=3)r=t[s],o=t[s+n],r?B(n,r,o,i):o(i);e._subscribers.length=0}}function B(t,n,r,o){var i=e(r),s=void 0,a=void 0,u=!0;if(i){try{s=r(o)}catch(e){u=!1,a=e}if(n===s)return void S(n,new TypeError("A promises callback cannot return that same promise."))}else s=o;n._state!==M||(i&&u?P(n,s):!1===u?S(n,a):t===k?A(n,s):t===j&&S(n,s))}var R=0;function N(e){e[O]=R++,e._state=void 0,e._result=void 0,e._subscribers=[]}var I=function(){function e(e,t){this._instanceConstructor=e,this.promise=new e(x),this.promise[O]||N(this.promise),r(t)?(this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?A(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&A(this.promise,this._result))):S(this.promise,new Error("Array Methods must be provided an Array"))}return e.prototype._enumerate=function(e){for(var t=0;this._state===M&&t<e.length;t++)this._eachEntry(e[t],t)},e.prototype._eachEntry=function(e,t){var n=this._instanceConstructor,r=n.resolve;if(r===C){var o=void 0,i=void 0,s=!1;try{o=e.then}catch(e){s=!0,i=e}if(o===w&&e._state!==M)this._settledAt(e._state,t,e._result);else if("function"!=typeof o)this._remaining--,this._result[t]=e;else if(n===W){var a=new n(x);s?S(a,i):E(a,e,o),this._willSettleAt(a,t)}else this._willSettleAt(new n((function(t){return t(e)})),t)}else this._willSettleAt(r(e),t)},e.prototype._settledAt=function(e,t,n){var r=this.promise;r._state===M&&(this._remaining--,e===j?S(r,n):this._result[t]=n),0===this._remaining&&A(r,this._result)},e.prototype._willSettleAt=function(e,t){var n=this;H(e,void 0,(function(e){return n._settledAt(k,t,e)}),(function(e){return n._settledAt(j,t,e)}))},e}(),W=function(){function t(e){this[O]=R++,this._result=this._state=void 0,this._subscribers=[],x!==e&&("function"!=typeof e&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof t?function(e,t){try{t((function(t){P(e,t)}),(function(t){S(e,t)}))}catch(t){S(e,t)}}(this,e):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return t.prototype.catch=function(e){return this.then(null,e)},t.prototype.finally=function(t){var n=this.constructor;return e(t)?this.then((function(e){return n.resolve(t()).then((function(){return e}))}),(function(e){return n.resolve(t()).then((function(){throw e}))})):this.then(t,t)},t}();return W.prototype.then=w,W.all=function(e){return new I(this,e).promise},W.race=function(e){var t=this;return r(e)?new t((function(n,r){for(var o=e.length,i=0;i<o;i++)t.resolve(e[i]).then(n,r)})):new t((function(e,t){return t(new TypeError("You must pass an array to race."))}))},W.resolve=C,W.reject=function(e){var t=new this(x);return S(t,e),t},W._setScheduler=function(e){s=e},W._setAsap=function(e){a=e},W._asap=a,W.polyfill=function(){var e=void 0;if(void 0!==n)e=n;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;if(t){var r=null;try{r=Object.prototype.toString.call(t.resolve())}catch(e){}if("[object Promise]"===r&&!t.cast)return}e.Promise=W},W.Promise=W,W},e.exports=r()}).call(this,n(6),n(18))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){var r;function o(e){function n(){if(n.enabled){var e=n,o=+new Date,i=o-(r||o);e.diff=i,e.prev=r,e.curr=o,r=o;for(var s=new Array(arguments.length),a=0;a<s.length;a++)s[a]=arguments[a];s[0]=t.coerce(s[0]),"string"!=typeof s[0]&&s.unshift("%O");var u=0;s[0]=s[0].replace(/%([a-zA-Z%])/g,(function(n,r){if("%%"===n)return n;u++;var o=t.formatters[r];if("function"==typeof o){var i=s[u];n=o.call(e,i),s.splice(u,1),u--}return n})),t.formatArgs.call(e,s),(n.log||t.log||console.log.bind(console)).apply(e,s)}}return n.namespace=e,n.enabled=t.enabled(e),n.useColors=t.useColors(),n.color=function(e){var n,r=0;for(n in e)r=(r<<5)-r+e.charCodeAt(n),r|=0;return t.colors[Math.abs(r)%t.colors.length]}(e),"function"==typeof t.init&&t.init(n),n}(t=e.exports=o.debug=o.default=o).coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){t.save(e),t.names=[],t.skips=[];for(var n=("string"==typeof e?e:"").split(/[\s,]+/),r=n.length,o=0;o<r;o++)n[o]&&("-"===(e=n[o].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){var n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=n(20),t.names=[],t.skips=[],t.formatters={}},function(e,t){var n=1e3,r=60*n,o=60*r,i=24*o,s=365.25*i;function a(e,t,n){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}e.exports=function(e,t){t=t||{};var u,c=typeof e;if("string"===c&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var a=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return a*s;case"days":case"day":case"d":return a*i;case"hours":case"hour":case"hrs":case"hr":case"h":return a*o;case"minutes":case"minute":case"mins":case"min":case"m":return a*r;case"seconds":case"second":case"secs":case"sec":case"s":return a*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}(e);if("number"===c&&!1===isNaN(e))return t.long?a(u=e,i,"day")||a(u,o,"hour")||a(u,r,"minute")||a(u,n,"second")||u+" ms":function(e){if(e>=i)return Math.round(e/i)+"d";if(e>=o)return Math.round(e/o)+"h";if(e>=r)return Math.round(e/r)+"m";if(e>=n)return Math.round(e/n)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}}])})); | ||
*/var r;r=function(){"use strict";function t(t){return"function"==typeof t}var r=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},o=0,i=void 0,s=void 0,a=function(t,e){p[o]=t,p[o+1]=e,2===(o+=2)&&(s?s(y):v())},u="undefined"!=typeof window?window:void 0,c=u||{},l=c.MutationObserver||c.WebKitMutationObserver,h="undefined"==typeof self&&void 0!==e&&"[object process]"==={}.toString.call(e),f="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function d(){var t=setTimeout;return function(){return t(y,1)}}var p=new Array(1e3);function y(){for(var t=0;t<o;t+=2)(0,p[t])(p[t+1]),p[t]=void 0,p[t+1]=void 0;o=0}var _,b,g,m,v=void 0;function w(t,e){var n=this,r=new this.constructor(x);void 0===r[O]&&N(r);var o=n._state;if(o){var i=arguments[o-1];a((function(){return B(o,r,i,n._result)}))}else H(n,r,t,e);return r}function C(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=new this(x);return P(e,t),e}h?v=function(){return e.nextTick(y)}:l?(b=0,g=new l(y),m=document.createTextNode(""),g.observe(m,{characterData:!0}),v=function(){m.data=b=++b%2}):f?((_=new MessageChannel).port1.onmessage=y,v=function(){return _.port2.postMessage(0)}):v=void 0===u?function(){try{var t=Function("return this")().require("vertx");return void 0!==(i=t.runOnLoop||t.runOnContext)?function(){i(y)}:d()}catch(t){return d()}}():d();var O=Math.random().toString(36).substring(2);function x(){}var M=void 0,k=1,j=2;function E(e,n,r){n.constructor===e.constructor&&r===w&&n.constructor.resolve===C?function(t,e){e._state===k?A(t,e._result):e._state===j?S(t,e._result):H(e,void 0,(function(e){return P(t,e)}),(function(e){return S(t,e)}))}(e,n):void 0===r?A(e,n):t(r)?function(t,e,n){a((function(t){var r=!1,o=function(t,e,n,r){try{t.call(e,n,r)}catch(t){return t}}(n,e,(function(n){r||(r=!0,e!==n?P(t,n):A(t,n))}),(function(e){r||(r=!0,S(t,e))}),t._label);!r&&o&&(r=!0,S(t,o))}),t)}(e,n,r):A(e,n)}function P(t,e){if(t===e)S(t,new TypeError("You cannot resolve a promise with itself"));else if(o=typeof(r=e),null===r||"object"!==o&&"function"!==o)A(t,e);else{var n=void 0;try{n=e.then}catch(e){return void S(t,e)}E(t,e,n)}var r,o}function T(t){t._onerror&&t._onerror(t._result),L(t)}function A(t,e){t._state===M&&(t._result=e,t._state=k,0!==t._subscribers.length&&a(L,t))}function S(t,e){t._state===M&&(t._state=j,t._result=e,a(T,t))}function H(t,e,n,r){var o=t._subscribers,i=o.length;t._onerror=null,o[i]=e,o[i+k]=n,o[i+j]=r,0===i&&t._state&&a(L,t)}function L(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var r=void 0,o=void 0,i=t._result,s=0;s<e.length;s+=3)r=e[s],o=e[s+n],r?B(n,r,o,i):o(i);t._subscribers.length=0}}function B(e,n,r,o){var i=t(r),s=void 0,a=void 0,u=!0;if(i){try{s=r(o)}catch(t){u=!1,a=t}if(n===s)return void S(n,new TypeError("A promises callback cannot return that same promise."))}else s=o;n._state!==M||(i&&u?P(n,s):!1===u?S(n,a):e===k?A(n,s):e===j&&S(n,s))}var R=0;function N(t){t[O]=R++,t._state=void 0,t._result=void 0,t._subscribers=[]}var U=function(){function t(t,e){this._instanceConstructor=t,this.promise=new t(x),this.promise[O]||N(this.promise),r(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?A(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&A(this.promise,this._result))):S(this.promise,new Error("Array Methods must be provided an Array"))}return t.prototype._enumerate=function(t){for(var e=0;this._state===M&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,r=n.resolve;if(r===C){var o=void 0,i=void 0,s=!1;try{o=t.then}catch(t){s=!0,i=t}if(o===w&&t._state!==M)this._settledAt(t._state,e,t._result);else if("function"!=typeof o)this._remaining--,this._result[e]=t;else if(n===I){var a=new n(x);s?S(a,i):E(a,t,o),this._willSettleAt(a,e)}else this._willSettleAt(new n((function(e){return e(t)})),e)}else this._willSettleAt(r(t),e)},t.prototype._settledAt=function(t,e,n){var r=this.promise;r._state===M&&(this._remaining--,t===j?S(r,n):this._result[e]=n),0===this._remaining&&A(r,this._result)},t.prototype._willSettleAt=function(t,e){var n=this;H(t,void 0,(function(t){return n._settledAt(k,e,t)}),(function(t){return n._settledAt(j,e,t)}))},t}(),I=function(){function e(t){this[O]=R++,this._result=this._state=void 0,this._subscribers=[],x!==t&&("function"!=typeof t&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof e?function(t,e){try{e((function(e){P(t,e)}),(function(e){S(t,e)}))}catch(e){S(t,e)}}(this,t):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return e.prototype.catch=function(t){return this.then(null,t)},e.prototype.finally=function(e){var n=this.constructor;return t(e)?this.then((function(t){return n.resolve(e()).then((function(){return t}))}),(function(t){return n.resolve(e()).then((function(){throw t}))})):this.then(e,e)},e}();return I.prototype.then=w,I.all=function(t){return new U(this,t).promise},I.race=function(t){var e=this;return r(t)?new e((function(n,r){for(var o=t.length,i=0;i<o;i++)e.resolve(t[i]).then(n,r)})):new e((function(t,e){return e(new TypeError("You must pass an array to race."))}))},I.resolve=C,I.reject=function(t){var e=new this(x);return S(e,t),e},I._setScheduler=function(t){s=t},I._setAsap=function(t){a=t},I._asap=a,I.polyfill=function(){var t=void 0;if(void 0!==n)t=n;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var r=null;try{r=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===r&&!e.cast)return}t.Promise=I},I.Promise=I,I},t.exports=r()}).call(this,n(6),n(18))},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){var r;function o(t){function n(){if(n.enabled){var t=n,o=+new Date,i=o-(r||o);t.diff=i,t.prev=r,t.curr=o,r=o;for(var s=new Array(arguments.length),a=0;a<s.length;a++)s[a]=arguments[a];s[0]=e.coerce(s[0]),"string"!=typeof s[0]&&s.unshift("%O");var u=0;s[0]=s[0].replace(/%([a-zA-Z%])/g,(function(n,r){if("%%"===n)return n;u++;var o=e.formatters[r];if("function"==typeof o){var i=s[u];n=o.call(t,i),s.splice(u,1),u--}return n})),e.formatArgs.call(t,s),(n.log||e.log||console.log.bind(console)).apply(t,s)}}return n.namespace=t,n.enabled=e.enabled(t),n.useColors=e.useColors(),n.color=function(t){var n,r=0;for(n in t)r=(r<<5)-r+t.charCodeAt(n),r|=0;return e.colors[Math.abs(r)%e.colors.length]}(t),"function"==typeof e.init&&e.init(n),n}(e=t.exports=o.debug=o.default=o).coerce=function(t){return t instanceof Error?t.stack||t.message:t},e.disable=function(){e.enable("")},e.enable=function(t){e.save(t),e.names=[],e.skips=[];for(var n=("string"==typeof t?t:"").split(/[\s,]+/),r=n.length,o=0;o<r;o++)n[o]&&("-"===(t=n[o].replace(/\*/g,".*?"))[0]?e.skips.push(new RegExp("^"+t.substr(1)+"$")):e.names.push(new RegExp("^"+t+"$")))},e.enabled=function(t){var n,r;for(n=0,r=e.skips.length;n<r;n++)if(e.skips[n].test(t))return!1;for(n=0,r=e.names.length;n<r;n++)if(e.names[n].test(t))return!0;return!1},e.humanize=n(20),e.names=[],e.skips=[],e.formatters={}},function(t,e){var n=1e3,r=60*n,o=60*r,i=24*o,s=365.25*i;function a(t,e,n){if(!(t<e))return t<1.5*e?Math.floor(t/e)+" "+n:Math.ceil(t/e)+" "+n+"s"}t.exports=function(t,e){e=e||{};var u,c=typeof t;if("string"===c&&t.length>0)return function(t){if((t=String(t)).length>100)return;var e=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(t);if(!e)return;var a=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return a*s;case"days":case"day":case"d":return a*i;case"hours":case"hour":case"hrs":case"hr":case"h":return a*o;case"minutes":case"minute":case"mins":case"min":case"m":return a*r;case"seconds":case"second":case"secs":case"sec":case"s":return a*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}(t);if("number"===c&&!1===isNaN(t))return e.long?a(u=t,i,"day")||a(u,o,"hour")||a(u,r,"minute")||a(u,n,"second")||u+" ms":function(t){if(t>=i)return Math.round(t/i)+"d";if(t>=o)return Math.round(t/o)+"h";if(t>=r)return Math.round(t/r)+"m";if(t>=n)return Math.round(t/n)+"s";return t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}}])})); |
@@ -84,2 +84,14 @@ import { ChattyHostConnection, CallbackStore } from '@looker/chatty'; | ||
/** | ||
* Allows api host to be specified | ||
* | ||
* @param apiHost | ||
*/ | ||
withApiHost(apiHost: string): this; | ||
/** | ||
* Allows auth url to be specified | ||
* | ||
* @param authUrl | ||
*/ | ||
withAuthUrl(authUrl: string): this; | ||
/** | ||
* @hidden | ||
@@ -86,0 +98,0 @@ * |
@@ -164,2 +164,34 @@ "use strict"; | ||
/** | ||
* Allows api host to be specified | ||
* | ||
* @param apiHost | ||
*/ | ||
EmbedBuilder.prototype.withApiHost = function (apiHost) { | ||
if (!this._hostSettings.apiHost) { | ||
this._hostSettings.apiHost = apiHost; | ||
if (this.sandboxedHost) { | ||
this._params.embed_domain = apiHost; | ||
this._params.sandboxed_host = 'true'; | ||
} | ||
} | ||
else if (this._hostSettings.apiHost !== apiHost) { | ||
throw new Error('not allowed to change api host'); | ||
} | ||
return this; | ||
}; | ||
/** | ||
* Allows auth url to be specified | ||
* | ||
* @param authUrl | ||
*/ | ||
EmbedBuilder.prototype.withAuthUrl = function (authUrl) { | ||
if (!this._hostSettings.authUrl) { | ||
this._hostSettings.authUrl = authUrl; | ||
} | ||
else if (this._hostSettings.authUrl !== authUrl) { | ||
throw new Error('not allowed to change auth url'); | ||
} | ||
return this; | ||
}; | ||
/** | ||
* @hidden | ||
@@ -166,0 +198,0 @@ * |
{ | ||
"name": "@looker/embed-sdk", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "A toolkit for embedding Looker", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -192,2 +192,36 @@ /* | ||
/** | ||
* Allows api host to be specified | ||
* | ||
* @param apiHost | ||
*/ | ||
withApiHost (apiHost: string) { | ||
if (!this._hostSettings.apiHost) { | ||
this._hostSettings.apiHost = apiHost | ||
if (this.sandboxedHost) { | ||
this._params.embed_domain = apiHost | ||
this._params.sandboxed_host = 'true' | ||
} | ||
} else if (this._hostSettings.apiHost !== apiHost) { | ||
throw new Error('not allowed to change api host') | ||
} | ||
return this | ||
} | ||
/** | ||
* Allows auth url to be specified | ||
* | ||
* @param authUrl | ||
*/ | ||
withAuthUrl (authUrl: string) { | ||
if (!this._hostSettings.authUrl) { | ||
this._hostSettings.authUrl = authUrl | ||
} else if (this._hostSettings.authUrl !== authUrl) { | ||
throw new Error('not allowed to change auth url') | ||
} | ||
return this | ||
} | ||
/** | ||
* @hidden | ||
@@ -194,0 +228,0 @@ * |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
147767
2780