@looker/embed-sdk
Advanced tools
Comparing version 1.0.0-beta.3 to 1.0.0-beta.4
@@ -1,2 +0,2 @@ | ||
!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){r._receivers[e]=t,setTimeout(function(){delete r._receivers[e],n(new Error("Timeout"))},r._defaultTimeout)})]})})}});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,f=c.payload,h=c.sequence,d=[];e._handlers[l]&&(d=e._handlers[l].map(function(t){return t.apply(e,f)})),e.sendMsg(s.ChattyClientMessages.Response,{eventName:l,payload:d},h);break;case a.ChattyHostMessages.Response:var p=e._receivers[r.data.data.sequence];p&&(delete e._receivers[r.data.data.sequence],p(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"}(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"}(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,f=-1;function h(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&d())}function d(){if(!l){var t=a(h);l=!0;for(var e=c.length;e;){for(u=c,c=[];++f<e;)u&&u[f].run();f=-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){this._url=t,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,"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(),this.iframe.src=t.url,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){r._receivers[e]=t,setTimeout(function(){delete r._receivers[e],n(new Error("Timeout"))},r._defaultTimeout)})]})})}});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,f=c.payload,h=c.sequence,d=[];e._handlers[l]&&(d=e._handlers[l].map(function(t){return t.apply(e,f)})),e.sendMsg(a.ChattyHostMessages.Response,{eventName:l,payload:d},h);break;case s.ChattyClientMessages.Response:var p=e._receivers[r.data.data.sequence];p&&(delete e._receivers[r.data.data.sequence],p(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}(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",o.LookerEmbedDashboard).withUrl(t)},t.createDashboardWithId=function(t){return new r.EmbedBuilder(this,"dashboard",o.LookerEmbedDashboard).withId(t)},t.createExploreWithUrl=function(t){return new r.EmbedBuilder(this,"explore",i.LookerEmbedExplore).withUrl(t)},t.createExploreWithId=function(t){return new r.EmbedBuilder(this,"explore",i.LookerEmbedExplore).withId(t)},t.createLookWithUrl=function(t){return new r.EmbedBuilder(this,"look",s.LookerEmbedLook).withUrl(t)},t.createLookWithId=function(t){return new r.EmbedBuilder(this,"look",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){this._hostSettings=t,this._type=e,this._clientConstructor=n,this._handlers={},this._appendTo=null,this._sandboxAttrs=[],this._classNames=[],this._frameBorder="0";var r=window.location.origin;this._params={embed_domain:r,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.withTheme=function(t){return this._params.theme=t,this},t.prototype.withUrl=function(t){return this._url=t,this},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,"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"/embed/"+this.type+"s/"+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,"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=function(){function t(t){this._builder=t,this._hostBuilder=null,this._host=null,this._connection=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}),t.prototype.createIframe=function(t){return r(this,void 0,void 0,function(){var e,n,r,s,a,u,c,l,f=this;return o(this,function(o){for(n in this._hostBuilder=i.Chatty.createHost(t),this._builder.handlers)for(r=0,s=this._builder.handlers[n];r<s.length;r++)a=s[r],this._hostBuilder.on(n,a);for(u=0,c=this._builder.sandboxAttrs;u<c.length;u++)l=c[u],this._hostBuilder.withSandboxAttribute(l);return this._host=this._hostBuilder.frameBorder(this._builder.frameBorder).withTargetOrigin("https://"+this._builder.apiHost).appendTo(this._builder.el).build(),(e=this._host.iframe.classList).add.apply(e,this._builder.classNames),[2,this._host.connect().then(function(t){return new f._builder.clientConstructor(t)})]})})},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,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=s},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.createClient=function(){return new r.ChattyClientBuilder},t}();e.Chatty=c},function(t,e,n){(function(e,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,f=c.payload,h=c.sequence,d=[];e._handlers[l]&&(d=e._handlers[l].map(function(t){return t.apply(e,f)})),Promise.all(d).then(function(t){e.sendMsg(s.ChattyClientMessages.Response,{eventName:l,payload:t},h)}).catch(function(t){e.sendMsg(s.ChattyClientMessages.ResponseError,{eventName:l,payload:t},h)});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,f=-1;function h(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&d())}function d(){if(!l){var t=a(h);l=!0;for(var e=c.length;e;){for(u=c,c=[];++f<e;)u&&u[f].run();f=-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,f=c.payload,h=c.sequence,d=[];e._handlers[l]&&(d=e._handlers[l].map(function(t){return t.apply(e,f)})),Promise.all(d).then(function(t){e.sendMsg(a.ChattyHostMessages.Response,{eventName:l,payload:t},h)}).catch(function(t){e.sendMsg(a.ChattyHostMessages.ResponseError,{eventName:l,payload:t},h)});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",o.LookerEmbedDashboard).withUrl(t)},t.createDashboardWithId=function(t){return new r.EmbedBuilder(this,"dashboard",o.LookerEmbedDashboard).withId(t)},t.createExploreWithUrl=function(t){return new r.EmbedBuilder(this,"explore",i.LookerEmbedExplore).withUrl(t)},t.createExploreWithId=function(t){return new r.EmbedBuilder(this,"explore",i.LookerEmbedExplore).withId(t)},t.createLookWithUrl=function(t){return new r.EmbedBuilder(this,"look",s.LookerEmbedLook).withUrl(t)},t.createLookWithId=function(t){return new r.EmbedBuilder(this,"look",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){this._hostSettings=t,this._type=e,this._clientConstructor=n,this._handlers={},this._appendTo=null,this._sandboxAttrs=[],this._classNames=[],this._frameBorder="0",this._suffix="";var r=window.location.origin;this._params={embed_domain:r,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},t.prototype.withTheme=function(t){return this._params.theme=t,this},t.prototype.withUrl=function(t){return this._url=t,this},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,"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"/embed/"+this.type+"s"+this.suffix+"/"+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(){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,f,h,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,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&&(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,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 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):m())},u="undefined"!=typeof window?window:void 0,c=u||{},l=c.MutationObserver||c.WebKitMutationObserver,f="undefined"==typeof self&&void 0!==e&&"[object process]"==={}.toString.call(e),h="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,v,m=void 0;function w(t,e){var n=this,r=new this.constructor(M);void 0===r[O]&&N(r);var o=n._state;if(o){var i=arguments[o-1];a(function(){return H(o,r,i,n._result)})}else L(n,r,t,e);return r}function C(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=new this(M);return P(e,t),e}f?m=function(){return e.nextTick(y)}:l?(b=0,g=new l(y),v=document.createTextNode(""),g.observe(v,{characterData:!0}),m=function(){v.data=b=++b%2}):h?((_=new MessageChannel).port1.onmessage=y,m=function(){return _.port2.postMessage(0)}):m=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 M(){}var k=void 0,x=1,j=2;function E(e,n,r){n.constructor===e.constructor&&r===w&&n.constructor.resolve===C?function(t,e){e._state===x?A(t,e._result):e._state===j?S(t,e._result):L(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),B(t)}function A(t,e){t._state===k&&(t._result=e,t._state=x,0!==t._subscribers.length&&a(B,t))}function S(t,e){t._state===k&&(t._state=j,t._result=e,a(T,t))}function L(t,e,n,r){var o=t._subscribers,i=o.length;t._onerror=null,o[i]=e,o[i+x]=n,o[i+j]=r,0===i&&t._state&&a(B,t)}function B(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?H(n,r,o,i):o(i);t._subscribers.length=0}}function H(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!==k||(i&&u?P(n,s):!1===u?S(n,a):e===x?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 W=function(){function t(t,e){this._instanceConstructor=t,this.promise=new t(M),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===k&&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!==k)this._settledAt(t._state,e,t._result);else if("function"!=typeof o)this._remaining--,this._result[e]=t;else if(n===U){var a=new n(M);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===k&&(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;L(t,void 0,function(t){return n._settledAt(x,e,t)},function(t){return n._settledAt(j,e,t)})},t}(),U=function(){function e(t){this[O]=R++,this._result=this._state=void 0,this._subscribers=[],M!==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 U.prototype.then=w,U.all=function(t){return new W(this,t).promise},U.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."))})},U.resolve=C,U.reject=function(t){var e=new this(M);return S(e,t),e},U._setScheduler=function(t){s=t},U._setAsap=function(t){a=t},U._asap=a,U.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=U},U.Promise=U,U},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))}}])}); | ||
*/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):m())},u="undefined"!=typeof window?window:void 0,c=u||{},l=c.MutationObserver||c.WebKitMutationObserver,f="undefined"==typeof self&&void 0!==e&&"[object process]"==={}.toString.call(e),h="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,v,m=void 0;function w(t,e){var n=this,r=new this.constructor(M);void 0===r[O]&&N(r);var o=n._state;if(o){var i=arguments[o-1];a(function(){return R(o,r,i,n._result)})}else L(n,r,t,e);return r}function C(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=new this(M);return P(e,t),e}f?m=function(){return e.nextTick(y)}:l?(b=0,g=new l(y),v=document.createTextNode(""),g.observe(v,{characterData:!0}),m=function(){v.data=b=++b%2}):h?((_=new MessageChannel).port1.onmessage=y,m=function(){return _.port2.postMessage(0)}):m=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 M(){}var k=void 0,x=1,j=2;function E(e,n,r){n.constructor===e.constructor&&r===w&&n.constructor.resolve===C?function(t,e){e._state===x?A(t,e._result):e._state===j?S(t,e._result):L(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),B(t)}function A(t,e){t._state===k&&(t._result=e,t._state=x,0!==t._subscribers.length&&a(B,t))}function S(t,e){t._state===k&&(t._state=j,t._result=e,a(T,t))}function L(t,e,n,r){var o=t._subscribers,i=o.length;t._onerror=null,o[i]=e,o[i+x]=n,o[i+j]=r,0===i&&t._state&&a(B,t)}function B(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?R(n,r,o,i):o(i);t._subscribers.length=0}}function R(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!==k||(i&&u?P(n,s):!1===u?S(n,a):e===x?A(n,s):e===j&&S(n,s))}var H=0;function N(t){t[O]=H++,t._state=void 0,t._result=void 0,t._subscribers=[]}var I=function(){function t(t,e){this._instanceConstructor=t,this.promise=new t(M),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===k&&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!==k)this._settledAt(t._state,e,t._result);else if("function"!=typeof o)this._remaining--,this._result[e]=t;else if(n===W){var a=new n(M);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===k&&(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;L(t,void 0,function(t){return n._settledAt(x,e,t)},function(t){return n._settledAt(j,e,t)})},t}(),W=function(){function e(t){this[O]=H++,this._result=this._state=void 0,this._subscribers=[],M!==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 W.prototype.then=w,W.all=function(t){return new I(this,t).promise},W.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."))})},W.resolve=C,W.reject=function(t){var e=new this(M);return S(e,t),e},W._setScheduler=function(t){s=t},W._setAsap=function(t){a=t},W._asap=a,W.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=W},W.Promise=W,W},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))}}])}); |
{ | ||
"name": "@looker/embed-sdk", | ||
"version": "1.0.0-beta.3", | ||
"version": "1.0.0-beta.4", | ||
"description": "A toolkit for embedding Looker", | ||
"main": "dist/main.js", | ||
"main": "lib/index.js", | ||
"typings": "lib/index.d.ts", | ||
@@ -14,4 +14,9 @@ "directories": { | ||
}, | ||
"files": [ | ||
"dist/**/*", | ||
"lib/**/*", | ||
"src/**/*" | ||
], | ||
"scripts": { | ||
"build": "npm run clean && npm run build_utils && webpack", | ||
"build": "npm run clean && npm run build_utils && tsc && webpack", | ||
"build_utils": "tsc --build tsconfig-server.json", | ||
@@ -23,3 +28,3 @@ "clean": "rm -rf lib dist", | ||
"start": "npm run build_utils && webpack-dev-server --config webpack-devserver.config.js --hot --inline --open --color --progress", | ||
"prepublish": "npm run build", | ||
"prepare": "npm run build", | ||
"prepublishOnly": "npm run test-once", | ||
@@ -69,3 +74,3 @@ "python": "webpack --config webpack-devserver.config.js && python demo/demo.py", | ||
"dependencies": { | ||
"@looker/chatty": "^2.0.0" | ||
"@looker/chatty": "^2.2.0" | ||
}, | ||
@@ -72,0 +77,0 @@ "pre-commit": [ |
@@ -25,3 +25,3 @@ /* | ||
import { LookerEmbedFilterParams } from './types' | ||
import { LookerDashboardOptions, LookerEmbedFilterParams } from './types' | ||
import { LookerEmbedBase } from './embed_base' | ||
@@ -52,2 +52,12 @@ | ||
} | ||
/** | ||
* Convenience method for setting options on the embedded dashboard. | ||
* | ||
* @param options An options object to be applied | ||
*/ | ||
setOptions (options: LookerDashboardOptions) { | ||
this.send('dashboard:options:set', options) | ||
} | ||
} |
@@ -65,2 +65,3 @@ /* | ||
private _params: UrlParams | ||
private _suffix: string = '' | ||
private _url?: string | null | ||
@@ -159,4 +160,15 @@ | ||
/** | ||
* Allows specifying next generation content | ||
* | ||
* @param suffix Next generation suffix. Defaults to '-next'. | ||
*/ | ||
withNext (suffix: string = '-next') { | ||
this._suffix = suffix | ||
return this | ||
} | ||
/** | ||
* Allows specifying a theme for the content. | ||
* * | ||
* | ||
* @param theme Theme name | ||
@@ -235,3 +247,3 @@ */ | ||
const params = stringify(this._params) | ||
return `/embed/${this.type}s/${this.id}?${params}` | ||
return `/embed/${this.type}s${this.suffix}/${this.id}?${params}` | ||
} | ||
@@ -264,2 +276,10 @@ | ||
/** | ||
* The the suffix to append to the content type portion of the url | ||
*/ | ||
get suffix () { | ||
return this._suffix | ||
} | ||
/** | ||
* The ID of this embedded content, if provided | ||
@@ -266,0 +286,0 @@ */ |
@@ -28,2 +28,4 @@ /* | ||
const IS_URL = /^https?:\/\// | ||
/** | ||
@@ -38,2 +40,3 @@ * Wrapper for Looker embedded content. Provides a mechanism for creating the embedded content element, | ||
_connection: Promise<T> | null = null | ||
_client: T | null = null | ||
@@ -63,2 +66,7 @@ /** | ||
get targetOrigin () { | ||
const apiHost = this._builder.apiHost | ||
return IS_URL.test(apiHost) ? apiHost : `https://${apiHost}` | ||
} | ||
private async createIframe (url: string) { | ||
@@ -68,3 +76,3 @@ this._hostBuilder = Chatty.createHost(url) | ||
for (const handler of this._builder.handlers[eventType]) { | ||
this._hostBuilder.on(eventType, handler) | ||
this._hostBuilder.on(eventType, (...args) => handler.apply(this._client, args)) | ||
} | ||
@@ -78,11 +86,15 @@ } | ||
.frameBorder(this._builder.frameBorder) | ||
.withTargetOrigin(`https://${this._builder.apiHost}`) | ||
.withTargetOrigin(this.targetOrigin) | ||
.appendTo(this._builder.el) | ||
.build() | ||
this._host.iframe.classList.add(...this._builder.classNames) | ||
// IE doesn't like calling classList.add() with no arguments, so check | ||
if (this._builder.classNames.length) { | ||
this._host.iframe.classList.add(...this._builder.classNames) | ||
} | ||
return this._host.connect() | ||
.then((host) => { | ||
return new this._builder.clientConstructor(host) | ||
this._client = new this._builder.clientConstructor(host) | ||
return this._client | ||
}) | ||
@@ -89,0 +101,0 @@ } |
@@ -36,2 +36,9 @@ /* | ||
/** | ||
* Initialize the Embed SDK. | ||
* | ||
* @param apiHost The address or base URL of the Looker host (example.looker.com:9999, https://example.looker.com:9999) | ||
* @param authUrl A server endpoint that will sign SSO embed URLs | ||
*/ | ||
static init (apiHost: string, authUrl?: string) { | ||
@@ -38,0 +45,0 @@ this.apiHost = apiHost |
106
src/types.ts
@@ -25,2 +25,6 @@ /* | ||
import { LookerEmbedBase } from './embed_base' | ||
import { LookerEmbedDashboard } from './dashboard_client' | ||
import { LookerEmbedLook } from './look_client' | ||
/** | ||
@@ -35,2 +39,71 @@ * Data structure for filters. | ||
/** | ||
* Dashboard Layout | ||
* | ||
* Contains details of dashboard layout. | ||
*/ | ||
interface DashboardLayout { | ||
id: string | ||
dashboard_id: string | ||
type: 'newspaper' | ||
active: boolean | ||
column_width: number | ||
width: number | null | ||
deleted: boolean | ||
dashboard_layout_components: DashboardLayoutComponent[] | ||
} | ||
/** | ||
* Dashboard Layout Component | ||
* | ||
* Contains details of individual dashboard element layout. | ||
*/ | ||
interface DashboardLayoutComponent { | ||
id: string | ||
dashboard_layout_id: string | ||
dashboard_element_id: string | ||
row: number | ||
column: number | ||
width: number | ||
height: number | ||
deleted: boolean | ||
} | ||
/** | ||
* Visualization Config interface | ||
*/ | ||
export interface VisConfig { | ||
type: string | ||
[key: string]: any | ||
} | ||
/** | ||
* Element Options interface | ||
*/ | ||
export interface ElementOptionItems { | ||
title?: string | null | ||
title_hidden?: boolean | ||
vis_config?: VisConfig | null | ||
} | ||
/** | ||
* Element to element options mapping interface | ||
*/ | ||
export interface ElementOptions { | ||
[id: string]: ElementOptionItems | ||
} | ||
/** | ||
* Options interface | ||
*/ | ||
export interface LookerDashboardOptions { | ||
elements?: ElementOptions | ||
layouts?: DashboardLayout[] | ||
} | ||
/** | ||
* A generic Looker embed event | ||
@@ -63,2 +136,3 @@ */ | ||
url: string | ||
options: LookerDashboardOptions | ||
} | ||
@@ -228,24 +302,24 @@ | ||
export interface LookerEmbedEventMap { | ||
'dashboard:run:start': (event: DashboardEvent) => void | ||
'dashboard:run:complete': (event: DashboardEvent) => void | ||
'dashboard:filters:changed': (event: DashboardEvent) => void | ||
'dashboard:tile:start': (event: DashboardTileEvent) => void | ||
'dashboard:tile:complete': (event: DashboardTileEvent) => void | ||
'dashboard:tile:download': (event: DashboardTileDownloadEvent) => void | ||
'dashboard:tile:explore': (event: DashboardTileExploreEvent) => CancellableEventResponse | undefined | ||
'dashboard:tile:view': (event: DashboardTileViewEvent) => CancellableEventResponse | undefined | ||
'dashboard:run:start': (this: LookerEmbedDashboard, event: DashboardEvent) => void | ||
'dashboard:run:complete': (this: LookerEmbedDashboard, event: DashboardEvent) => void | ||
'dashboard:filters:changed': (this: LookerEmbedDashboard, event: DashboardEvent) => void | ||
'dashboard:tile:start': (this: LookerEmbedDashboard, event: DashboardTileEvent) => void | ||
'dashboard:tile:complete': (this: LookerEmbedDashboard, event: DashboardTileEvent) => void | ||
'dashboard:tile:download': (this: LookerEmbedDashboard, event: DashboardTileDownloadEvent) => void | ||
'dashboard:tile:explore': (this: LookerEmbedDashboard, event: DashboardTileExploreEvent) => CancellableEventResponse | undefined | ||
'dashboard:tile:view': (this: LookerEmbedDashboard, event: DashboardTileViewEvent) => CancellableEventResponse | undefined | ||
'drillmenu:click': (event: DrillMenuEvent) => CancellableEventResponse | undefined | ||
'drillmodal:explore': (event: DrillModalExploreEvent) => CancellableEventResponse | undefined | ||
'drillmenu:click': (this: LookerEmbedBase, event: DrillMenuEvent) => CancellableEventResponse | undefined | ||
'drillmodal:explore': (this: LookerEmbedBase, event: DrillModalExploreEvent) => CancellableEventResponse | undefined | ||
'explore:run:start': (event: ExploreEvent) => void | ||
'explore:run:complete': (event: ExploreEvent) => void | ||
'explore:run:start': (this: LookerEmbedLook, event: ExploreEvent) => void | ||
'explore:run:complete': (this: LookerEmbedLook, event: ExploreEvent) => void | ||
'look:run:start': (event: LookEvent) => void | ||
'look:run:complete': (event: LookEvent) => void | ||
'look:run:start': (this: LookerEmbedLook, event: LookEvent) => void | ||
'look:run:complete': (this: LookerEmbedLook, event: LookEvent) => void | ||
'page:changed': (event: PageChangedEvent) => void | ||
'page:properties:changed': (event: PagePropertiesChangedEvent) => void | ||
'page:changed': (this: LookerEmbedBase, event: PageChangedEvent) => void | ||
'page:properties:changed': (this: LookerEmbedBase, event: PagePropertiesChangedEvent) => void | ||
[key: string]: any | ||
} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
141663
2606
0
28
1
Updated@looker/chatty@^2.2.0