From e021d1a963b6ea2308f183149bf30e9144b8eb40 Mon Sep 17 00:00:00 2001 From: Egor Date: Sat, 31 Dec 2016 13:39:09 -0800 Subject: [PATCH] update --- ...06ae3.js => huegasm-3ab53c2ae6849442072dae1507dc0776.js} | 6 +++--- index.html | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) rename assets/{huegasm-9d96168b7ebe44f2733560339c606ae3.js => huegasm-3ab53c2ae6849442072dae1507dc0776.js} (69%) diff --git a/assets/huegasm-9d96168b7ebe44f2733560339c606ae3.js b/assets/huegasm-3ab53c2ae6849442072dae1507dc0776.js similarity index 69% rename from assets/huegasm-9d96168b7ebe44f2733560339c606ae3.js rename to assets/huegasm-3ab53c2ae6849442072dae1507dc0776.js index f2643d0..f504f51 100644 --- a/assets/huegasm-9d96168b7ebe44f2733560339c606ae3.js +++ b/assets/huegasm-3ab53c2ae6849442072dae1507dc0776.js @@ -1,6 +1,6 @@ "use strict";define("huegasm/app",["exports","ember","huegasm/resolver","ember-load-initializers","huegasm/config/environment"],function(e,t,n,l,a){var o=void 0;t.default.MODEL_FACTORY_INJECTIONS=!0,o=t.default.Application.extend({modulePrefix:a.default.modulePrefix,podModulePrefix:a.default.podModulePrefix,Resolver:n.default}),(0,l.default)(o,a.default.modulePrefix),e.default=o}),define("huegasm/components/basic-dropdown",["exports","ember-basic-dropdown/components/basic-dropdown"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("huegasm/components/basic-dropdown/content",["exports","ember-basic-dropdown/components/basic-dropdown/content"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("huegasm/components/basic-dropdown/trigger",["exports","ember-basic-dropdown/components/basic-dropdown/trigger"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("huegasm/components/ember-modal-dialog-positioned-container",["exports","ember-modal-dialog/components/positioned-container"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("huegasm/components/ember-notify",["exports","ember-notify/components/ember-notify"],function(e,t){e.default=t.default}),define("huegasm/components/ember-notify/message",["exports","ember-notify/components/ember-notify/message"],function(e,t){e.default=t.default}),define("huegasm/components/ember-wormhole",["exports","ember-wormhole/components/ember-wormhole"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("huegasm/components/modal-dialog-overlay",["exports","ember-modal-dialog/components/modal-dialog-overlay"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("huegasm/components/modal-dialog",["exports","ember-modal-dialog/components/modal-dialog"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("huegasm/components/paper-autocomplete-content",["exports","ember-paper/components/paper-autocomplete-content"],function(e,t){e.default=t.default}),define("huegasm/components/paper-autocomplete-dropdown",["exports","ember-paper/components/paper-autocomplete-dropdown"],function(e,t){e.default=t.default}),define("huegasm/components/paper-autocomplete-highlight",["exports","ember-paper/components/paper-autocomplete-highlight"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("huegasm/components/paper-autocomplete-options",["exports","ember-paper/components/paper-autocomplete-options"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("huegasm/components/paper-autocomplete-trigger-container",["exports","ember-paper/components/paper-autocomplete-trigger-container"],function(e,t){e.default=t.default}),define("huegasm/components/paper-autocomplete-trigger",["exports","ember-paper/components/paper-autocomplete-trigger"],function(e,t){e.default=t.default}),define("huegasm/components/paper-autocomplete",["exports","ember-paper/components/paper-autocomplete"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("huegasm/components/paper-backdrop",["exports","ember-paper/components/paper-backdrop"],function(e,t){e.default=t.default}),define("huegasm/components/paper-button",["exports","ember-paper/components/paper-button"],function(e,t){e.default=t.default}),define("huegasm/components/paper-card-actions",["exports","ember-paper/components/paper-card-actions"],function(e,t){e.default=t.default}),define("huegasm/components/paper-card-avatar",["exports","ember-paper/components/paper-card-avatar"],function(e,t){e.default=t.default}),define("huegasm/components/paper-card-content",["exports","ember-paper/components/paper-card-content"],function(e,t){e.default=t.default}),define("huegasm/components/paper-card-header-headline",["exports","ember-paper/components/paper-card-header-headline"],function(e,t){e.default=t.default}),define("huegasm/components/paper-card-header-subhead",["exports","ember-paper/components/paper-card-header-subhead"],function(e,t){e.default=t.default}),define("huegasm/components/paper-card-header-text",["exports","ember-paper/components/paper-card-header-text"],function(e,t){e.default=t.default}),define("huegasm/components/paper-card-header-title",["exports","ember-paper/components/paper-card-header-title"],function(e,t){e.default=t.default}),define("huegasm/components/paper-card-header",["exports","ember-paper/components/paper-card-header"],function(e,t){e.default=t.default}),define("huegasm/components/paper-card-icon-actions",["exports","ember-paper/components/paper-card-icon-actions"],function(e,t){e.default=t.default}),define("huegasm/components/paper-card-image",["exports","ember-paper/components/paper-card-image"],function(e,t){e.default=t.default}),define("huegasm/components/paper-card-media",["exports","ember-paper/components/paper-card-media"],function(e,t){e.default=t.default}),define("huegasm/components/paper-card-title-media",["exports","ember-paper/components/paper-card-title-media"],function(e,t){e.default=t.default}),define("huegasm/components/paper-card-title-text",["exports","ember-paper/components/paper-card-title-text"],function(e,t){e.default=t.default}),define("huegasm/components/paper-card-title",["exports","ember-paper/components/paper-card-title"],function(e,t){e.default=t.default}),define("huegasm/components/paper-card",["exports","ember-paper/components/paper-card"],function(e,t){e.default=t.default}),define("huegasm/components/paper-checkbox",["exports","ember-paper/components/paper-checkbox"],function(e,t){e.default=t.default}),define("huegasm/components/paper-chips",["exports","ember-paper/components/paper-chips"],function(e,t){e.default=t.default}),define("huegasm/components/paper-contact-chips",["exports","ember-paper/components/paper-contact-chips"],function(e,t){e.default=t.default}),define("huegasm/components/paper-content",["exports","ember-paper/components/paper-content"],function(e,t){e.default=t.default}),define("huegasm/components/paper-dialog-actions",["exports","ember-paper/components/paper-dialog-actions"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("huegasm/components/paper-dialog-container",["exports","ember-paper/components/paper-dialog-container"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("huegasm/components/paper-dialog-content",["exports","ember-paper/components/paper-dialog-content"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("huegasm/components/paper-dialog-inner",["exports","ember-paper/components/paper-dialog-inner"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("huegasm/components/paper-dialog",["exports","ember-paper/components/paper-dialog"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("huegasm/components/paper-divider",["exports","ember-paper/components/paper-divider"],function(e,t){e.default=t.default}),define("huegasm/components/paper-form",["exports","ember-paper/components/paper-form"],function(e,t){e.default=t.default}),define("huegasm/components/paper-grid-list",["exports","ember-paper/components/paper-grid-list"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("huegasm/components/paper-grid-tile-footer",["exports","ember-paper/components/paper-grid-tile-footer"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("huegasm/components/paper-grid-tile",["exports","ember-paper/components/paper-grid-tile"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("huegasm/components/paper-icon",["exports","ember-paper/components/paper-icon"],function(e,t){e.default=t.default}),define("huegasm/components/paper-input",["exports","ember-paper/components/paper-input"],function(e,t){e.default=t.default}),define("huegasm/components/paper-item",["exports","ember-paper/components/paper-item"],function(e,t){e.default=t.default}),define("huegasm/components/paper-list",["exports","ember-paper/components/paper-list"],function(e,t){e.default=t.default}),define("huegasm/components/paper-menu-content-inner",["exports","ember-paper/components/paper-menu-content-inner"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("huegasm/components/paper-menu-content",["exports","ember-paper/components/paper-menu-content"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("huegasm/components/paper-menu-item",["exports","ember-paper/components/paper-menu-item"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("huegasm/components/paper-menu",["exports","ember-paper/components/paper-menu"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("huegasm/components/paper-optgroup",["exports","ember-paper/components/paper-optgroup"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("huegasm/components/paper-option",["exports","ember-paper/components/paper-option"],function(e,t){e.default=t.default}),define("huegasm/components/paper-progress-circular",["exports","ember-paper/components/paper-progress-circular"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("huegasm/components/paper-progress-linear",["exports","ember-paper/components/paper-progress-linear"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("huegasm/components/paper-radio-group",["exports","ember-paper/components/paper-radio-group"],function(e,t){e.default=t.default}),define("huegasm/components/paper-radio",["exports","ember-paper/components/paper-radio"],function(e,t){e.default=t.default}),define("huegasm/components/paper-reset-button",["exports","ember-paper/components/paper-reset-button"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("huegasm/components/paper-select-content",["exports","ember-paper/components/paper-select-content"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("huegasm/components/paper-select-header",["exports","ember-paper/components/paper-select-header"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("huegasm/components/paper-select-menu-inner",["exports","ember-paper/components/paper-select-menu-inner"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("huegasm/components/paper-select-menu-trigger",["exports","ember-paper/components/paper-select-menu-trigger"],function(e,t){e.default=t.default}),define("huegasm/components/paper-select-menu",["exports","ember-paper/components/paper-select-menu"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("huegasm/components/paper-select-options",["exports","ember-paper/components/paper-select-options"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("huegasm/components/paper-select-search",["exports","ember-paper/components/paper-select-search"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("huegasm/components/paper-select-trigger",["exports","ember-paper/components/paper-select-trigger"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("huegasm/components/paper-select",["exports","ember-paper/components/paper-select"],function(e,t){e.default=t.default}),define("huegasm/components/paper-sidenav-container",["exports","ember-paper/components/paper-sidenav-container"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("huegasm/components/paper-sidenav-inner",["exports","ember-paper/components/paper-sidenav-inner"],function(e,t){e.default=t.default}),define("huegasm/components/paper-sidenav-toggle",["exports","ember-paper/components/paper-sidenav-toggle"],function(e,t){e.default=t.default}),define("huegasm/components/paper-sidenav",["exports","ember-paper/components/paper-sidenav"],function(e,t){e.default=t.default}),define("huegasm/components/paper-slider",["exports","ember-paper/components/paper-slider"],function(e,t){e.default=t.default}),define("huegasm/components/paper-subheader",["exports","ember-paper/components/paper-subheader"],function(e,t){e.default=t.default}),define("huegasm/components/paper-switch",["exports","ember-paper/components/paper-switch"],function(e,t){e.default=t.default}),define("huegasm/components/paper-toolbar-tools",["exports","ember-paper/components/paper-toolbar-tools"],function(e,t){e.default=t.default}),define("huegasm/components/paper-toolbar",["exports","ember-paper/components/paper-toolbar"],function(e,t){e.default=t.default}),define("huegasm/components/paper-virtual-repeat-scroller",["exports","ember-paper/components/paper-virtual-repeat-scroller"],function(e,t){e.default=t.default}),define("huegasm/components/paper-virtual-repeat",["exports","ember-paper/components/paper-virtual-repeat"],function(e,t){e.default=t.default}),define("huegasm/components/power-select-multiple",["exports","ember-power-select/components/power-select-multiple"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("huegasm/components/power-select-multiple/trigger",["exports","ember-power-select/components/power-select-multiple/trigger"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("huegasm/components/power-select",["exports","ember-power-select/components/power-select"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("huegasm/components/power-select/before-options",["exports","ember-power-select/components/power-select/before-options"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("huegasm/components/power-select/options",["exports","ember-power-select/components/power-select/options"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("huegasm/components/power-select/search-message",["exports","ember-power-select/components/power-select/search-message"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("huegasm/components/power-select/trigger",["exports","ember-power-select/components/power-select/trigger"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("huegasm/components/range-slider",["exports","ember-cli-nouislider/components/range-slider"],function(e,t){e.default=t.default}),define("huegasm/components/tether-dialog",["exports","ember-modal-dialog/components/tether-dialog"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("huegasm/components/transition-group",["exports","ember-css-transitions/components/transition-group"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("huegasm/components/virtual-each",["exports","virtual-each/components/virtual-each/component"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("huegasm/helpers/-paper-underscore",["exports","ember-paper/helpers/underscore"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"underscore",{enumerable:!0,get:function(){return t.underscore}})}),define("huegasm/helpers/and",["exports","ember","ember-truth-helpers/helpers/and"],function(e,t,n){var l=null;t.default.Helper?l=t.default.Helper.helper(n.andHelper):t.default.HTMLBars.makeBoundHelper&&(l=t.default.HTMLBars.makeBoundHelper(n.andHelper)),e.default=l}),define("huegasm/helpers/app-version",["exports","ember","huegasm/config/environment"],function(e,t,n){function l(){return a}e.appVersion=l;var a=n.default.APP.version;e.default=t.default.Helper.helper(l)}),define("huegasm/helpers/cancel-all",["exports","ember","ember-concurrency/-helpers"],function(e,t,n){function l(e){var l=e[0];return l&&"function"==typeof l.cancelAll||t.default.assert("The first argument passed to the `cancel-all` helper should be a Task or TaskGroup (without quotes); you passed "+l,!1),(0,n.taskHelperClosure)("cancelAll",e)}e.cancelHelper=l,e.default=t.default.Helper.helper(l)}),define("huegasm/helpers/ember-power-select-is-group",["exports","ember-power-select/helpers/ember-power-select-is-group"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"emberPowerSelectIsGroup",{enumerable:!0,get:function(){return t.emberPowerSelectIsGroup}})}),define("huegasm/helpers/ember-power-select-is-selected",["exports","ember-power-select/helpers/ember-power-select-is-selected"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"emberPowerSelectIsSelected",{enumerable:!0,get:function(){return t.emberPowerSelectIsSelected}})}),define("huegasm/helpers/ember-power-select-true-string-if-present",["exports","ember-power-select/helpers/ember-power-select-true-string-if-present"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"emberPowerSelectTrueStringIfPresent",{enumerable:!0,get:function(){return t.emberPowerSelectTrueStringIfPresent}})}),define("huegasm/helpers/eq",["exports","ember","ember-truth-helpers/helpers/equal"],function(e,t,n){var l=null;t.default.Helper?l=t.default.Helper.helper(n.equalHelper):t.default.HTMLBars.makeBoundHelper&&(l=t.default.HTMLBars.makeBoundHelper(n.equalHelper)),e.default=l}),define("huegasm/helpers/gt",["exports","ember","ember-truth-helpers/helpers/gt"],function(e,t,n){var l=null;t.default.Helper?l=t.default.Helper.helper(n.gtHelper):t.default.HTMLBars.makeBoundHelper&&(l=t.default.HTMLBars.makeBoundHelper(n.gtHelper)),e.default=l}),define("huegasm/helpers/gte",["exports","ember","ember-truth-helpers/helpers/gte"],function(e,t,n){var l=null;t.default.Helper?l=t.default.Helper.helper(n.gteHelper):t.default.HTMLBars.makeBoundHelper&&(l=t.default.HTMLBars.makeBoundHelper(n.gteHelper)),e.default=l}),define("huegasm/helpers/is-array",["exports","ember","ember-truth-helpers/helpers/is-array"],function(e,t,n){var l=null;t.default.Helper?l=t.default.Helper.helper(n.isArrayHelper):t.default.HTMLBars.makeBoundHelper&&(l=t.default.HTMLBars.makeBoundHelper(n.isArrayHelper)),e.default=l}),define("huegasm/helpers/lt",["exports","ember","ember-truth-helpers/helpers/lt"],function(e,t,n){var l=null;t.default.Helper?l=t.default.Helper.helper(n.ltHelper):t.default.HTMLBars.makeBoundHelper&&(l=t.default.HTMLBars.makeBoundHelper(n.ltHelper)),e.default=l}),define("huegasm/helpers/lte",["exports","ember","ember-truth-helpers/helpers/lte"],function(e,t,n){var l=null;t.default.Helper?l=t.default.Helper.helper(n.lteHelper):t.default.HTMLBars.makeBoundHelper&&(l=t.default.HTMLBars.makeBoundHelper(n.lteHelper)),e.default=l}),define("huegasm/helpers/not-eq",["exports","ember","ember-truth-helpers/helpers/not-equal"],function(e,t,n){var l=null;t.default.Helper?l=t.default.Helper.helper(n.notEqualHelper):t.default.HTMLBars.makeBoundHelper&&(l=t.default.HTMLBars.makeBoundHelper(n.notEqualHelper)),e.default=l}),define("huegasm/helpers/not",["exports","ember","ember-truth-helpers/helpers/not"],function(e,t,n){var l=null;t.default.Helper?l=t.default.Helper.helper(n.notHelper):t.default.HTMLBars.makeBoundHelper&&(l=t.default.HTMLBars.makeBoundHelper(n.notHelper)),e.default=l}),define("huegasm/helpers/or",["exports","ember","ember-truth-helpers/helpers/or"],function(e,t,n){var l=null;t.default.Helper?l=t.default.Helper.helper(n.orHelper):t.default.HTMLBars.makeBoundHelper&&(l=t.default.HTMLBars.makeBoundHelper(n.orHelper)),e.default=l}),define("huegasm/helpers/perform",["exports","ember","ember-concurrency/-helpers"],function(e,t,n){function l(e,t){return(0,n.taskHelperClosure)("perform",e,t)}e.performHelper=l,e.default=t.default.Helper.helper(l)}),define("huegasm/helpers/task",["exports","ember"],function(e,t){function n(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t1?!function(){var n=e.get("multipleBridgeIps");t.forEach(function(e){n.pushObject(e.internalipaddress)}),l="multiple"}():l="fail",e.set("bridgeFindStatus",l)}).fail(function(){e.set("bridgeFindStatus","fail")})},pingBridgeUser:function(){var e=this,t=this.get("bridgeIp"),n=this.get("bridgeUserNamePingIntervalProgress"),l=this.get("bridgeUsernamePingMaxTime");null!==t&&n<100?(i.ajax("http://"+t+"/api",{data:JSON.stringify({devicetype:"huegasm"}),contentType:"application/json",type:"POST"}).done(function(t,n){e.isDestroyed||(e.set("bridgeAuthenticateReachedStatus",n),"success"!==n||t[0].error||(e.clearBridgePingIntervalHandle(),e.get("storage").set("huegasm.bridgeUsername",t[0].success.username),e.set("bridgeUsername",t[0].success.username)))}).fail(function(){e.clearBridgePingIntervalHandle(),e.set("error",!0)}),this.incrementProperty("bridgeUserNamePingIntervalProgress",this.get("bridgeUsernamePingIntervalTime")/l*100)):this.clearBridgePingIntervalHandle()},clearBridgePingIntervalHandle:function(){clearInterval(this.get("bridgePingIntervalHandle")),this.set("bridgePingIntervalHandle",null)},actions:{retry:function(){this.onBridgeIpChange()},chooseBridge:function(e){this.set("bridgeIp",e)},findBridgeByIp:function(){var e=this,t=this.get("manualBridgeIp");"trial"===t.toLowerCase()||"offline"===t.toLowerCase()?this.setProperties({trial:!0,bridgeIp:"trial",bridgeUsername:"trial"}):i.ajax("http://"+t+"/api",{data:JSON.stringify({devicetype:"huegasm"}),contentType:"application/json",type:"POST"}).fail(function(){e.set("manualBridgeIpNotFound",!0),r(e,function(){this.set("manualBridgeIpNotFound",!1)},5e3)}).then(function(){e.set("bridgeIp",t)})}}})}),define("huegasm/pods/components/bridge-finder/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"pe7ISywg",block:'{"statements":[["open-element","div",[]],["static-attr","class","title"],["flush-element"],["open-element","img",[]],["static-attr","src","assets/images/logo-2d51b899f18553cfc8ffd147c158cd3f.png"],["static-attr","alt","Huegasm"],["flush-element"],["close-element"],["close-element"],["text","\\n"],["block",["unless"],[["get",["bridgeUsername"]]],null,12]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","p",[]],["static-attr","class","bg-danger"],["flush-element"],["text","\\n Could not find a bridge with that IP address.\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","p",[]],["flush-element"],["text","A hue bridge could not be automatically found on your network. "],["open-element","br",[]],["flush-element"],["close-element"],["text","\\n Enter one manually? "],["open-element","br",[]],["flush-element"],["close-element"],["open-element","br",[]],["flush-element"],["close-element"],["text","\\n ( or type "],["open-element","b",[]],["flush-element"],["text","offline"],["close-element"],["text"," to look around )\\n "],["close-element"],["text","\\n\\n "],["open-element","span",[]],["static-attr","id","bridge-input"],["flush-element"],["text","\\n "],["append",["helper",["paper-input"],null,[["label","value","onChange"],["Hue bridge IP address",["get",["manualBridgeIp"]],["helper",["action"],[["get",[null]],["helper",["mut"],[["get",["manualBridgeIp"]]],null]],null]]]],false],["text","\\n\\n "],["open-element","div",[]],["flush-element"],["text","\\n "],["append",["helper",["paper-button"],null,[["onClick","raised","primary","label"],[["helper",["action"],[["get",[null]],"findBridgeByIp"],null],true,true,"Find"]]],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n\\n"],["block",["if"],[["get",["manualBridgeIpNotFound"]]],null,0]],"locals":[]},{"statements":[["block",["if"],[["get",["bridgeFindFail"]]],null,1]],"locals":[]},{"statements":[["text"," "],["append",["helper",["paper-radio"],null,[["value","label","onChange"],[["get",["bridge"]],["get",["bridge"]],["helper",["action"],[["get",[null]],"chooseBridge"],null]]]],false],["text","\\n"]],"locals":["bridge"]},{"statements":[["text"," "],["open-element","p",[]],["flush-element"],["text","Found multiple hue bridges. "],["open-element","br",[]],["flush-element"],["close-element"],["text","\\n Please select the one you want to use for this application."],["close-element"],["text","\\n\\n "],["open-element","div",[]],["static-attr","id","bridge-button-group"],["flush-element"],["text","\\n"],["block",["each"],[["get",["multipleBridgeIps"]]],null,3],["text"," "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["paper-progress-circular"],null,[["diameter"],[100]]],false],["text","\\n "],["open-element","p",[]],["flush-element"],["text","Trying to find your bridge\'s IP."],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["unless"],[["get",["bridgeFindStatus"]]],null,5],["text","\\n"],["block",["if"],[["get",["bridgeFindMultiple"]]],null,4,2]],"locals":[]},{"statements":[["text"," "],["open-element","p",[]],["flush-element"],["text","You failed to press the button in time. "],["open-element","a",[]],["static-attr","class","no-text-decoration"],["static-attr","href","#"],["modifier",["action"],[["get",[null]],"retry"]],["flush-element"],["text","RETRY"],["close-element"],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","p",[]],["flush-element"],["text","\\n Your bridge IP is "],["open-element","b",[]],["flush-element"],["append",["unknown",["bridgeIp"]],false],["close-element"],["text","\\n "],["open-element","br",[]],["flush-element"],["close-element"],["text","\\n Press the button on your bridge to authenticate this application.\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","img",[]],["static-attr","src","assets/images/pressButtonBridge-b15485b257b549c269d7f36fdc0d917b.png"],["static-attr","id","press-bridge-button-img"],["flush-element"],["close-element"],["text","\\n "],["append",["helper",["paper-progress-linear"],null,[["warn","value"],[true,["get",["bridgeUserNamePingIntervalProgress"]]]]],false],["text","\\n\\n"],["block",["if"],[["get",["isAuthenticating"]]],null,8,7]],"locals":[]},{"statements":[["text"," "],["open-element","p",[]],["flush-element"],["text","Huegasm encountered a critical error while trying to connect to your bridge."],["open-element","br",[]],["flush-element"],["close-element"],["open-element","br",[]],["flush-element"],["close-element"],["text","\\n This likely happened because you\'re using an outdated browser and/or because your browser does not support "],["open-element","a",[]],["static-attr","href","https://en.wikipedia.org/wiki/Cross-origin_resource_sharing"],["static-attr","target","_blank"],["static-attr","rel","noopener noreferrer"],["flush-element"],["text","CORS"],["close-element"],["text",". Feel free to contact me through the link at the bottom of the page if you feel like this is not the case."],["open-element","br",[]],["flush-element"],["close-element"],["text","\\n For the best browsing experience on this site ( and every other one known to man ) please switch to "],["open-element","a",[]],["static-attr","href","https://www.google.com/chrome/"],["static-attr","target","_blank"],["static-attr","rel","noopener noreferrer"],["flush-element"],["text","Google Chrome"],["close-element"],["text"," or "],["open-element","a",[]],["static-attr","href","https://www.mozilla.org/en-US/firefox/new/"],["static-attr","target","_blank"],["static-attr","rel","noopener noreferrer"],["flush-element"],["text","Firefox."],["close-element"],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["error"]]],null,10,9]],"locals":[]},{"statements":[["block",["if"],[["get",["bridgeIp"]]],null,11,6]],"locals":[]}],"hasPartials":false}', -meta:{moduleName:"huegasm/pods/components/bridge-finder/template.hbs"}})}),define("huegasm/pods/components/hue-controls/component",["exports","ember"],function(e,t){var n=t.default.A,l=t.default.Component,a=t.default.computed,o=t.default.isEmpty,s=t.default.isNone,r=t.default.run,i=r.later,c=r.scheduleOnce,p=t.default.inject,u=t.default.$;e.default=l.extend({classNames:["container-fluid"],elementId:"hue-controls",lightsData:null,activeLights:n(),tabList:["Lights","Music"],selectedTab:1,pauseLightUpdates:!1,displayFailure:!0,notify:p.service(),dimmerOnClass:a("dimmerOn",function(){return this.get("dimmerOn")?"dimmerOn md-menu-origin":"md-menu-origin"}),ready:a("lightsData","trial",function(){return this.get("trial")||!s(this.get("lightsData"))}),apiURL:a("bridgeIp","bridgeUsername",function(){return"http://"+this.get("bridgeIp")+"/api/"+this.get("bridgeUsername")}),tabData:a("tabList","selectedTab",function(){var e=[],t=this.get("selectedTab");return this.get("tabList").forEach(function(n,l){var a=!1;l===t&&(a=!0),e.push({name:n,selected:a})}),e}),didInsertElement:function(){if(!window.matchMedia||window.matchMedia("(min-width: 768px)").matches){var e=new MutationObserver(function(e){var t=!e.every(function(e){return o(e.addedNodes)||s(e.addedNodes[0].classList)||e.addedNodes[0].classList.contains("tooltip")});t&&c("afterRender",function(){u(".bootstrap-tooltip").tooltip()})});e.observe(u("#hue-controls")[0],{childList:!0,subtree:!0})}},init:function(){this._super.apply(this,arguments),this.get("trial")||(this.updateLightData(),setInterval(this.updateLightData.bind(this),2e3)),s(this.get("storage").get("huegasm.selectedTab"))||this.set("selectedTab",this.get("storage").get("huegasm.selectedTab"))},updateLightData:function(){var e=this,t=function(){s(e.get("lightsData"))?e.send("clearBridge"):e.get("displayFailure")&&(e.get("notify").warning({html:''}),e.set("displayFailure",!1),i(e,function(){this.set("displayFailure",!0)},3e4))};this.get("pauseLightUpdates")||u.get(this.get("apiURL")+"/lights",function(n,l){s(n[0])||s(n[0].error)?"success"===l&&JSON.stringify(e.get("lightsData"))!==JSON.stringify(n)&&e.set("lightsData",n):t()}).fail(t)},actions:{changeTab:function(e){var t=this.get("tabList").indexOf(e);this.set("selectedTab",t),this.get("storage").set("huegasm.selectedTab",t)},clearBridge:function(){var e=this.get("storage");e.remove("huegasm.bridgeUsername"),e.remove("huegasm.bridgeIp"),location.reload()},toggleDimmer:function(){this.sendAction()},clearAllSettings:function(){this.get("storage").clear(),location.reload()},startIntro:function(){var e=this,t=introJs(),n=u("#player-bottom");this.get("dimmerOn")&&this.send("toggleDimmer"),t.setOptions({steps:[{intro:"Welcome! This short tutorial will introduce you to Huegasm."},{element:"#music-tab",intro:"This is the music player. You'll use this to play music and synchronize it with your active lights.

TIP: Control which lights are active through the Lights tab."},{element:"#playlist",intro:"You can add and select music to play from your playlist here. You may listen to local audio files, stream music from soundcloud or stream directly from a connected microphone.

TIP: Songs added through Soundcloud will be saved for when you visit this page again."},{element:u("#playlist md-menu")[0],intro:'You can add songs from SoundCloud by copy and pasting the URL shown here'},{element:"#player-area",intro:"The audio playback may be controlled with the controls here. Basic music visualization effects may be shown here by selecting them from the menu ( eyeball icon in the bottom right )."},{element:"#beat-option-row",intro:"These are the settings for the music tab:
Sensitivity - The sensitivity of the beat detector ( more sensitivity results in more registered beats )
Hue Range - The hue range that the lights may change to on beat.
Flashing Transitions - Quickly flash the lights on beat
Colorloop - Slowly cycle the lights through all the colors while the music is playing
TIP: Your sensitivity settings are saved per song as indicated by the red star icon in the top left corner. These settings they will be restored if you ever listen to the same song again.",position:"top"},{element:"#beat-container",intro:"An interactive speaker that will bump when a beat is registered.

TIP: Click on the center of the speaker to simulate a beat.",position:"top"},{element:"#lights-tab",intro:"This is the lights tab. Here you'll be able to change various light properties:
Power - Turn the selected lights on/off
Brightness - The brightness level of the selected lights
Color - The color of the selected lights
Strobe - Selected lights will flash in sequential order
Colorloop - Selected lights will slowly cycle through all the colors
"},{element:"#active-lights",intro:"These icons represent the hue lights in your system. Active lights will be controlled by the application while the inactive lights will have a red X over them and will not be controlled.
You may toggle a light's state by clicking on it."},{element:u("#navigation .ember-basic-dropdown-trigger")[0],intro:"A few miscellaneous settings can be found here.

WARNING: clearing application settings will restore the application to its original state. This will even delete your playlist and any saved song beat preferences."},{intro:"And that's it...Hope you enjoy the application. ;)"}]}),t.onexit(function(){u("body").velocity("scroll",{duration:200})}),t.onchange(function(e){""===e.id||"music-tab"===e.id||"playlist"===e.id||"player-area"===e.id||"beat-option-row"===e.id||"beat-option-button-group"===e.id||"beat-container"===e.id||"using-mic-audio-tooltip"===e.id||"MD-MENU"===e.nodeName?u(".navigation-item").eq(1).click():u(".navigation-item").eq(0).click(),"music-tab"===e.id||"playlist"===e.id||"player-area"===e.id?n.hide():"beat-option-row"===e.id||"beat-option-button-group"===e.id||"beat-container"===e.id?n.show():"dimmer"===e.id&&u(document).click()}),t.onafterchange(function(t){var n=u(t);""===n.html()&&u(".introjs-nextbutton").click(),""===t.id?i(e,function(){u("body").velocity("scroll")},500):i(e,function(){u(".introjs-tooltip").velocity("scroll",{offset:-100})},500)}).start()}}})}),define("huegasm/pods/components/hue-controls/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"0kJgw7UI",block:'{"statements":[["block",["if"],[["get",["ready"]]],null,10,0],["text","\\n"],["append",["helper",["ember-notify"],null,[["messageStyle","closeAfter"],["bootstrap",5000]]],false]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["append",["helper",["paper-progress-circular"],null,[["diameter"],[100]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["paper-icon"],["settings backup restore"],[["class"],[["get",["dimmerOnClass"]]]]],false],["text"," Reset settings\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["paper-icon"],["cached"],[["class"],[["get",["dimmerOnClass"]]]]],false],["text"," Restart tutorial\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["paper-icon"],["compare arrows"],[["class"],[["get",["dimmerOnClass"]]]]],false],["text"," Switch bridge\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["paper-icon"],["lightbulb outline"],[["class"],[["get",["dimmerOnClass"]]]]],false],["text"," Dark Mode: "],["append",["helper",["if"],[["get",["dimmerOn"]],"On","Off"],null],false],["text","\\n"]],"locals":[]},{"statements":[["block",["content","menu-item"],null,[["onClick"],["toggleDimmer"]],4],["text","\\n"],["block",["content","menu-item"],null,[["onClick"],["clearBridge"]],3],["text","\\n"],["block",["content","menu-item"],null,[["onClick"],["startIntro"]],2],["text","\\n"],["block",["content","menu-item"],null,[["onClick"],["clearAllSettings"]],1]],"locals":["content"]},{"statements":[["text"," "],["append",["helper",["paper-icon"],["settings-icon"],[["class","size"],[["get",["dimmerOnClass"]],28]]],false],["text","\\n"]],"locals":[]},{"statements":[["block",["paper-button"],null,[["iconButton"],[true]],6]],"locals":[]},{"statements":[["block",["menu","trigger"],null,null,7],["block",["menu","content"],null,[["width"],[3]],5]],"locals":["menu"]},{"statements":[["text"," "],["open-element","span",[]],["dynamic-attr","class",["concat",["navigation-item pointer text-uppercase ",["helper",["if"],[["get",["tab","selected"]],"active"],null]]]],["modifier",["action"],[["get",[null]],"changeTab",["get",["tab","name"]]]],["flush-element"],["append",["unknown",["tab","name"]],false],["close-element"],["text","\\n"]],"locals":["tab"]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","id","navigation"],["static-attr","class","row"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","col-sm-10 col-sm-offset-1 col-xs-12"],["flush-element"],["text","\\n"],["block",["each"],[["get",["tabData"]]],null,9],["block",["paper-menu"],null,null,8],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n\\n "],["append",["helper",["light-group"],null,[["lightsData","activeLights","syncLight","apiURL","dimmerOn","storage"],[["get",["lightsData"]],["get",["activeLights"]],["get",["syncLight"]],["get",["apiURL"]],["get",["dimmerOn"]],["get",["storage"]]]]],false],["text","\\n\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["lights-tab"],null,[["active","apiURL","lightsData","activeLights","syncLight","trial","colorLoopOn","dimmerOn","playing","pauseLightUpdates"],[["helper",["eq"],[["get",["selectedTab"]],0],null],["get",["apiURL"]],["get",["lightsData"]],["get",["activeLights"]],["get",["syncLight"]],["get",["trial"]],["get",["colorLoopOn"]],["get",["dimmerOn"]],["get",["playing"]],["get",["pauseLightUpdates"]]]]],false],["text","\\n\\n "],["append",["helper",["music-tab"],null,[["active","apiURL","lightsData","activeLights","pauseLightUpdates","dimmerOn","storage","colorLoopOn","playing","action"],[["helper",["eq"],[["get",["selectedTab"]],1],null],["get",["apiURL"]],["get",["lightsData"]],["get",["activeLights"]],["get",["pauseLightUpdates"]],["get",["dimmerOn"]],["get",["storage"]],["get",["colorLoopOn"]],["get",["playing"]],"startIntro"]]],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"huegasm/pods/components/hue-controls/template.hbs"}})}),define("huegasm/pods/components/huegasm-app/component",["exports","ember"],function(e,t){var n=t.default.Component,l=t.default.isEmpty,a=t.default.$;e.default=n.extend({bridgeIp:null,bridgeUsername:null,trial:!1,ready:!1,elementId:"huegasm",init:function(){this._super.apply(this,arguments);var e=this.get("storage");l(e.get("huegasm.bridgeIp"))||l(e.get("huegasm.bridgeUsername"))||this.setProperties({bridgeIp:e.get("huegasm.bridgeIp"),bridgeUsername:e.get("huegasm.bridgeUsername")})},actions:{toggleDimmer:function(){this.sendAction()},isReady:function(){this.set("ready",!0),a("html, body").velocity("scroll")}}})}),define("huegasm/pods/components/huegasm-app/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"ZHk8la/u",block:'{"statements":[["block",["if"],[["get",["bridgeUsername"]]],null,3,2]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","ready-block"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","title"],["flush-element"],["text","\\n "],["open-element","img",[]],["static-attr","src","assets/images/logo-2d51b899f18553cfc8ffd147c158cd3f.png"],["static-attr","alt","Huegasm"],["flush-element"],["close-element"],["text","\\n "],["close-element"],["text","\\n\\n "],["open-element","p",[]],["static-attr","id","intro"],["flush-element"],["text","\\n Your lights meet your music.\\n "],["close-element"],["text","\\n "],["open-element","p",[]],["static-attr","id","intro-paragraph"],["flush-element"],["text","\\n Huegasm is a free web application for managing and synchronizing your "],["open-element","a",[]],["static-attr","target","_blank"],["static-attr","href","http://www2.meethue.com"],["flush-element"],["text","Philips Hue lights"],["close-element"],["text"," with the beat of your music.\\n "],["close-element"],["text","\\n\\n "],["open-element","div",[]],["static-attr","class","embed-container-wrapper"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","embed-container"],["flush-element"],["text","\\n "],["open-element","iframe",[]],["static-attr","width","560"],["static-attr","height","315"],["static-attr","src","https://www.youtube.com/embed/zi9J6Qg-MPw"],["static-attr","frameborder","0"],["static-attr","allowfullscreen",""],["flush-element"],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["append",["helper",["paper-button"],null,[["raised","primary","onClick","class","label"],[true,true,["helper",["action"],[["get",[null]],"isReady"],null],"go-button center-block","Go!"]]],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["bridge-finder"],null,[["bridgeIp","bridgeUsername","trial","storage"],[["get",["bridgeIp"]],["get",["bridgeUsername"]],["get",["trial"]],["get",["storage"]]]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","a",[]],["static-attr","href","https://github.com/hoboman313/huegasm"],["static-attr","target","_blank "],["static-attr","rel","noopener noreferrer"],["static-attr","id","github-ribbon"],["flush-element"],["text","\\n "],["open-element","img",[]],["static-attr","src","https://camo.githubusercontent.com/365986a132ccd6a44c23a9169022c0b5c890c387/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f7265645f6161303030302e706e67"],["static-attr","alt","Fork me on GitHub"],["static-attr","data-canonical-src","https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png"],["flush-element"],["close-element"],["text","\\n "],["close-element"],["text","\\n\\n"],["block",["if"],[["get",["ready"]]],null,1,0]],"locals":[]},{"statements":[["text"," "],["append",["helper",["hue-controls"],null,[["bridgeIp","bridgeUsername","trial","dimmerOn","storage","action"],[["get",["bridgeIp"]],["get",["bridgeUsername"]],["get",["trial"]],["get",["dimmerOn"]],["get",["storage"]],"toggleDimmer"]]],false],["text","\\n"]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"huegasm/pods/components/huegasm-app/template.hbs"}})}),define("huegasm/pods/components/huegasm-footer/component",["exports","ember"],function(e,t){var n=t.default.Component,l=t.default.computed;e.default=n.extend({tagName:"footer",classNames:["footer"],year:l(function(){return(new Date).getFullYear()}),actions:{toggleDimmer:function(){this.sendAction()}}})}),define("huegasm/pods/components/huegasm-footer/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"f1VFdSVa",block:'{"statements":[["open-element","div",[]],["static-attr","class","logo"],["modifier",["action"],[["get",[null]],"toggleDimmer"]],["flush-element"],["close-element"],["text","\\n\\n"],["open-element","div",[]],["static-attr","class","footer-text"],["flush-element"],["text","\\n © "],["append",["unknown",["year"]],false],["text","\\n\\n "],["open-element","a",[]],["static-attr","href","http://www.egorphilippov.me"],["static-attr","target","_blank"],["static-attr","rel","noopener noreferrer"],["flush-element"],["text","\\n Egor Philippov\\n "],["close-element"],["text","\\n"],["close-element"],["text","\\n\\n"],["open-element","a",[]],["static-attr","href","https://play.google.com/store/apps/details?id=com.hoboman313.huegasm"],["static-attr","target","_blank"],["static-attr","rel","noopener noreferrer"],["flush-element"],["text","\\n "],["open-element","img",[]],["static-attr","src","assets/images/google-play-badge-4be08e3cf4d01124257db037380272ea.png"],["static-attr","alt","Get it on the Google Play Store"],["flush-element"],["close-element"],["text","\\n"],["close-element"]],"locals":[],"named":[],"yields":[],"blocks":[],"hasPartials":false}',meta:{moduleName:"huegasm/pods/components/huegasm-footer/template.hbs"}})}),define("huegasm/pods/components/light-group/component",["exports","ember"],function(e,t){var n=t.default.A,l=t.default.Component,a=t.default.computed,o=t.default.isEmpty,s=t.default.isNone,r=t.default.observer,i=t.default.$;e.default=l.extend({elementId:"active-lights",classNames:["light-group","horizontal-light-group"],isHovering:!1,activeLights:n(),lightsList:a("lightsData","activeLights.[]","dimmerOn",function(){var e=this.get("lightsData"),t=this.get("activeLights"),l=this.get("dimmerOn"),a=n(),o=void 0,s=void 0;for(var r in e)if(s="light-active",e.hasOwnProperty(r)&&e[r].state.reachable){switch(e[r].modelid){case"LCT001":o="a19";break;case"LCT002":o="br30";break;case"LCT003":o="gu10";break;case"LST001":o="lightstrip";break;case"LLC010":o="lc_iris";break;case"LLC011":o="lc_bloom";break;case"LLC012":o="lc_bloom";break;case"LLC006":o="lc_iris";break;case"LLC007":o="lc_aura";break;case"LLC013":o="storylight";break;case"LWB004":o="a19";break;case"LLC020":o="huego";break;default:o="a19"}l&&(o+="w"),t.includes(r)||(s="light-inactive"),a.push({type:o,name:e[r].name,id:r,data:e[r],activeClass:s})}return a}),onActiveLightsChange:r("activeLights.[]",function(){this.get("storage").set("huegasm.activeLights",this.get("activeLights"))}),init:function(){this._super.apply(this,arguments);var e=this.get("lightsData"),t=this.get("activeLights"),n=this.get("storage").get("huegasm.activeLights");if(s(n))for(var l in e)e.hasOwnProperty(l)&&e[l].state.reachable&&t.pushObject(l);else n.forEach(function(n){e.hasOwnProperty(n)&&e[n].state.reachable&&t.pushObject(n)})},actions:{clickLight:function(e){var t=this.get("activeLights"),n=t.indexOf(e);n!==-1?t.removeObject(e):(t.pushObject(e),this.set("syncLight",e))},lightStartHover:function(e){if(!window.matchMedia||window.matchMedia("(min-width: 768px)").matches){var t=this.get("lightsList").filter(function(t){return"unreachable"!==t.activeClass&&t.id===e[0]});o(t)||this.get("noHover")===!0||i.ajax(this.get("apiURL")+"/lights/"+e+"/state",{data:JSON.stringify({alert:"lselect"}),contentType:"application/json",type:"PUT"}),this.set("isHovering",!0)}},lightStopHover:function(e){if(!window.matchMedia||window.matchMedia("(min-width: 768px)").matches){var t=this.get("lightsList").filter(function(t){return"unreachable"!==t.activeClass&&t.id===e[0]});o(t)||this.get("noHover")===!0||i.ajax(this.get("apiURL")+"/lights/"+e+"/state",{data:JSON.stringify({alert:"none"}),contentType:"application/json",type:"PUT"}),this.set("isHovering",!1)}}}})}),define("huegasm/pods/components/light-group/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"NgytHQNN",block:'{"statements":[["block",["each"],[["get",["lightsList"]]],null,0]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","div",[]],["dynamic-attr","class",["concat",[["unknown",["light","activeClass"]]," bootstrap-tooltip light",["unknown",["light","id"]]]]],["static-attr","data-toggle","tooltip"],["static-attr","data-placement","top auto"],["dynamic-attr","data-title",["unknown",["light","name"]],null],["modifier",["action"],[["get",[null]],"clickLight",["get",["light","id"]]]],["modifier",["action"],[["get",[null]],"lightStartHover",["get",["light","id"]]],[["on"],["mouseEnter"]]],["modifier",["action"],[["get",[null]],"lightStopHover",["get",["light","id"]]],[["on"],["mouseLeave"]]],["flush-element"],["text","\\n "],["open-element","img",[]],["static-attr","class","hueLight"],["static-attr","width","40"],["dynamic-attr","src",["concat",["assets/images/lights/",["unknown",["light","type"]],".svg"]]],["flush-element"],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":["light"]}],"hasPartials":false}',meta:{moduleName:"huegasm/pods/components/light-group/template.hbs"}})}),define("huegasm/pods/components/lights-tab/color-picker/component",["exports","ember"],function(e,t){var n=t.default.Component,l=t.default.$;e.default=n.extend({elementId:"color-picker",rgb:null,canvas:null,canvasContext:null,pressingDown:!1,mouseUp:function(){this.set("pressingDown",!1)},mouseMove:function(e){this.get("pressingDown")&&this.mouseDown(e)},mouseDown:function(e){var t=l(this.get("canvas")).offset(),n=Math.floor(e.pageX-t.left),a=Math.floor(e.pageY-t.top),o=this.get("canvasContext").getImageData(n,a,1,1),s=o.data;this.set("pressingDown",!0),0===s[0]&&0===s[1]&&0===s[2]||this.set("rgb",[s[0],s[1],s[2]])},didInsertElement:function(){var e=l("#picker")[0],t=e.getContext("2d"),n=new Image;n.src="assets/images/colormap-83aafd17086eaab68b229a681c04139b.png",n.onload=function(){t.drawImage(n,0,0,n.width,n.height)},this.setProperties({canvas:e,canvasContext:t})}})}),define("huegasm/pods/components/lights-tab/color-picker/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"wNrN9ioa",block:'{"statements":[["open-element","canvas",[]],["static-attr","id","picker"],["static-attr","width","256"],["static-attr","height","256"],["flush-element"],["close-element"]],"locals":[],"named":[],"yields":[],"blocks":[],"hasPartials":false}',meta:{moduleName:"huegasm/pods/components/lights-tab/color-picker/template.hbs"}})}),define("huegasm/pods/components/lights-tab/component",["exports","ember"],function(e,t){var n=t.default.Component,l=t.default.observer,a=t.default.computed,o=t.default.on,s=t.default.run.later,r=t.default.$;e.default=n.extend({classNames:["col-sm-10","col-sm-offset-1","col-xs-12"],classNameBindings:["active::hidden"],elementId:"lights-tab",rgb:[255,255,255],lightsOn:!1,colorLoopOn:!1,lightsOnTxt:a("lightsOn",function(){return this.get("lightsOn")?"On":"Off"}),colorloopOnTxt:a("colorLoopOn",function(){return this.get("colorLoopOn")?"On":"Off"}),lightsBrightness:a("lightsData",function(){var e=this.get("lightsData"),t=this.get("activeLights"),n=0;return t.forEach(function(t){n+=e[t].state.bri}),n/t.length}),brightnessControlDisabled:a.not("lightsOn"),onColorLoopOnChange:l("colorLoopOn",function(){var e=this,t=this.get("lightsData"),n=this.get("activeLights"),l=this.get("colorLoopOn"),a=l?"colorloop":"none",o=n.some(function(e){return"colorloop"===t[e].state.effect});l!==o&&n.forEach(function(t){e.get("lightsData")[t].state.effect!==a&&r.ajax(e.get("apiURL")+"/lights/"+t+"/state",{data:JSON.stringify({effect:a}),contentType:"application/json",type:"PUT"})})}),rgbPreview:l("rgb",function(){var e=this,t=this.get("rgb"),n=this.rgbToXy(t[0],t[1],t[2]);this.set("colorLoopOn",!1),this.get("activeLights").forEach(function(t){r.ajax(e.get("apiURL")+"/lights/"+t+"/state",{data:JSON.stringify({xy:n}),contentType:"application/json",type:"PUT"})}),this.set("colorLoopOn",!1),r(".color").css("background","rgb("+t[0]+","+t[1]+","+t[2]+")")}),lightsOnChange:o("init",l("lightsData.@each.state.on","activeLights.[]",function(){var e=this;this.get("strobeOn")||!function(){var t=e.get("lightsData"),n=e.get("activeLights").some(function(e){return t[e].state.on===!0});e.set("lightsOn",n)}()})),onLightsOnChange:l("lightsOn",function(){var e=this,t=this.get("lightsData"),n=this.get("activeLights"),l=this.get("lightsOn"),a=n.some(function(e){return t[e].state.on===!0});l!==a&&n.forEach(function(t){r.ajax(e.get("apiURL")+"/lights/"+t+"/state",{data:JSON.stringify({on:l}),contentType:"application/json",type:"PUT"})})}),onBrightnessChanged:l("lightsBrightness",function(){var e=this,t=this.get("lightsData"),n=!1,l=this.get("lightsBrightness"),a=this.get("activeLights");a.forEach(function(e){n+=t[e].state.bri}),n/=a.length,l!==n&&a.forEach(function(t){r.ajax(e.get("apiURL")+"/lights/"+t+"/state",{data:JSON.stringify({bri:l}),contentType:"application/json",type:"PUT"})})}),onaActiveLightsChange:l("syncLight",function(){var e={on:this.get("lightsOn"),bri:this.get("lightsBrightness"),effect:this.get("colorLoopOn")?"colorloop":"none"},t=this.get("rgb"),n=this.get("syncLight");255!==t[0]&&255!==t[1]&&255!==t[2]&&(e.xy=this.rgbToXy(t[0],t[1],t[2])),e.transitiontime=0,r.ajax(this.get("apiURL")+"/lights/"+n+"/state",{data:JSON.stringify(e),contentType:"application/json",type:"PUT"})}),strobeOn:!1,strobeOnInervalHandle:null,strobeSat:0,preStrobeOnLightsDataCache:null,lastStrobeLight:0,onStrobeOnChange:l("strobeOn",function(){var e=this,t=this.get("lightsData"),n=this.get("strobeOn");if(n){this.set("preStrobeOnLightsDataCache",t);var l={sat:this.get("strobeSat"),transitiontime:0};for(var a in t)t.hasOwnProperty(a)&&(t[a].state.on&&(l.on=!1),r.ajax(this.get("apiURL")+"/lights/"+a+"/state",{data:JSON.stringify(l),contentType:"application/json",type:"PUT"}));this.set("strobeOnInervalHandle",setInterval(this.strobeStep.bind(this),500))}else!function(){var n=e.get("preStrobeOnLightsDataCache"),l=function(t){r.ajax(e.get("apiURL")+"/lights/"+t+"/state",{data:JSON.stringify({on:n[t].state.on,sat:n[t].state.sat}),contentType:"application/json",type:"PUT"})};for(var a in t)t.hasOwnProperty(a)&&s(e,l,a,2e3);s(e,e.onColorLoopOnChange,2e3),clearInterval(e.get("strobeOnInervalHandle"))}();this.set("pauseLightUpdates",n)}),strobeStep:function(){var e=(this.get("lastStrobeLight")+1)%(this.get("activeLights").length+1),t={on:!0,transitiontime:0,alert:"select"};this.get("colorLoopOn")&&(t.hue=Math.floor(65535*Math.random())),r.ajax(this.get("apiURL")+"/lights/"+e+"/state",{data:JSON.stringify(t),contentType:"application/json",type:"PUT"}),r.ajax(this.get("apiURL")+"/lights/"+e+"/state",{data:JSON.stringify({on:!1,transitiontime:0}),contentType:"application/json",type:"PUT"}),this.set("lastStrobeLight",e)},strobeOnTxt:a("strobeOn",function(){return this.get("strobeOn")?"On":"Off"}),dimmerOnClass:a("dimmerOn",function(){return this.get("dimmerOn")?"dimmerOn":null}),actions:{toggleDimmer:function(){this.sendAction("toggleDimmer")}},rgbToXy:function(e,t,n){var l=void 0,a=void 0,o=void 0,s=void 0,r=void 0;return e=Number(e/255),t=Number(t/255),n=Number(n/255),e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92,n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,l=.664511*e+.154324*t+.162028*n,a=.283881*e+.668433*t+.047685*n,o=88e-6*e+.07231*t+.986039*n,s=l/(l+a+o),r=a/(l+a+o),[s,r]},xyToRgb:function(e,t){var n=void 0,l=void 0,a=void 0,o=void 0,s=1,r=void 0;return o=s/t*e,r=s/t*(1-e-t),n=1.656492*o-.354851*s-.255038*r,l=o*-.707196+1.655397*s+.036152*r,a=.051713*o-.121364*s+1.01153*r,n>a&&n>l&&n>1?(l/=n,a/=n,n=1):l>a&&l>n&&l>1?(n/=l,a/=l,l=1):a>n&&a>l&&a>1&&(n/=a,l/=a,a=1),n=n<=.0031308?12.92*n:1.055*Math.pow(n,1/2.4)-.055,l=l<=.0031308?12.92*l:1.055*Math.pow(l,1/2.4)-.055,a=a<=.0031308?12.92*a:1.055*Math.pow(a,1/2.4)-.055,n>a&&n>l?n>1&&(l/=n,a/=n,n=1):l>a&&l>n?l>1&&(n/=l,a/=l,l=1):a>n&&a>l&&a>1&&(n/=a,l/=a,a=1),n*=255,l*=255,a*=255,[n,l,a]}})}),define("huegasm/pods/components/lights-tab/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"m2hlx07r",block:'{"statements":[["block",["paper-list"],null,null,10]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["append",["helper",["paper-icon"],["color-lens"],[["class"],[["get",["dimmerOnClass"]]]]],false],["text"," "],["append",["helper",["paper-icon"],["loop"],[["id","class"],["loop-addition",["get",["dimmerOnClass"]]]]],false],["text","\\n "],["open-element","p",[]],["static-attr","data-toggle","tooltip"],["static-attr","data-placement","top auto"],["static-attr","class","bootstrap-tooltip lights-control-tooltip"],["static-attr","data-title","Selected lights will slowly cycle through all the colors"],["flush-element"],["text","Colorloop"],["close-element"],["text","\\n "],["append",["helper",["paper-switch"],null,[["value","onChange","disabled","skipProxy","label"],[["get",["colorLoopOn"]],["helper",["action"],[["get",[null]],["helper",["mut"],[["get",["colorLoopOn"]]],null]],null],["helper",["or"],[["get",["trial"]],["get",["playing"]]],null],["get",["trial"]],["get",["colorloopOnTxt"]]]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["paper-icon"],["flare"],[["class"],[["get",["dimmerOnClass"]]]]],false],["text","\\n "],["open-element","p",[]],["static-attr","data-toggle","tooltip"],["static-attr","data-placement","top auto"],["static-attr","class","bootstrap-tooltip lights-control-tooltip"],["static-attr","data-title","Selected lights will flash in sequential order"],["flush-element"],["text","Strobe"],["close-element"],["text","\\n "],["append",["helper",["paper-switch"],null,[["value","onChange","disabled","skipProxy","label"],[["get",["strobeOn"]],["helper",["action"],[["get",[null]],["helper",["mut"],[["get",["strobeOn"]]],null]],null],["helper",["or"],[["get",["trial"]],["get",["playing"]]],null],["get",["trial"]],["get",["strobeOnTxt"]]]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["lights-tab/color-picker"],null,[["lightsData","activeLights","rgb"],[["get",["lightsData"]],["get",["activeLights"]],["get",["rgb"]]]]],false],["text","\\n"]],"locals":[]},{"statements":[["block",["content","menu-item"],null,null,2]],"locals":["content"]},{"statements":[["text"," "],["append",["helper",["paper-button"],null,[["raised","class","disabled"],[true,"color",["helper",["or"],[["get",["trial"]],["get",["playing"]]],null]]]],false],["text","\\n"]],"locals":[]},{"statements":[["block",["paper-button"],null,[["iconButton"],[false]],4]],"locals":[]},{"statements":[["block",["menu","trigger"],null,null,5],["block",["menu","content"],null,[["class","width"],["color-content",0]],3]],"locals":["menu"]},{"statements":[["text"," "],["append",["helper",["paper-icon"],["color-lens"],[["class"],[["get",["dimmerOnClass"]]]]],false],["text","\\n "],["open-element","p",[]],["static-attr","data-toggle","tooltip"],["static-attr","data-placement","top auto"],["static-attr","class","bootstrap-tooltip lights-control-tooltip"],["static-attr","data-title","The color of the selected lights"],["flush-element"],["text","Color"],["close-element"],["text","\\n\\n"],["block",["paper-menu"],null,[["offset"],["0 -50"]],6]],"locals":[]},{"statements":[["text"," "],["append",["helper",["paper-icon"],["brightness-4"],[["class"],[["get",["dimmerOnClass"]]]]],false],["text","\\n "],["open-element","p",[]],["static-attr","data-toggle","tooltip"],["static-attr","data-placement","top auto"],["static-attr","class","bootstrap-tooltip lights-control-tooltip"],["static-attr","data-title","The brightness level of the selected lights"],["flush-element"],["text","Brightness"],["close-element"],["text","\\n "],["append",["helper",["paper-slider"],null,[["flex","min","max","value","disabled"],[true,1,254,["get",["lightsBrightness"]],["get",["brightnessControlDisabled"]]]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["paper-icon"],["power-settings-new"],[["class"],[["get",["dimmerOnClass"]]]]],false],["text","\\n "],["open-element","p",[]],["static-attr","data-toggle","tooltip"],["static-attr","data-placement","top auto"],["static-attr","class","bootstrap-tooltip lights-control-tooltip"],["static-attr","data-title","Turn the selected lights on/off"],["flush-element"],["text","Power"],["close-element"],["text","\\n "],["append",["helper",["paper-switch"],null,[["value","onChange","disabled","skipProxy","label"],[["get",["lightsOn"]],["helper",["action"],[["get",[null]],["helper",["mut"],[["get",["lightsOn"]]],null]],null],["helper",["or"],[["get",["trial"]],["get",["playing"]]],null],["get",["trial"]],["get",["lightsOnTxt"]]]]],false],["text","\\n"]],"locals":[]},{"statements":[["block",["paper-item"],null,null,9],["text","\\n"],["block",["paper-item"],null,null,8],["text","\\n"],["block",["paper-item"],null,[["elementId"],["color-row"]],7],["text","\\n"],["block",["paper-item"],null,null,1],["text","\\n"],["block",["paper-item"],null,null,0]],"locals":[]}],"hasPartials":false}', -meta:{moduleName:"huegasm/pods/components/lights-tab/template.hbs"}})}),define("huegasm/pods/components/music-tab/add-soundcloud-sound-modal/component",["exports","ember"],function(e,t){var n=t.default.Component,l=t.default.observer,a=t.default.computed,o=t.default.isEmpty,s=t.default.isNone,r=t.default.run.later,i=t.default.$;e.default=n.extend({url:null,onIsShowingModalChange:l("isShowingModal",function(){this.get("isShowingModal")&&(this.set("url",null),r(function(){i("md-input-container input").focus()},500))}),saveDisabled:a("url",function(){return s(this.get("url"))||o(this.get("url").trim())}),didInsertElement:function(){var e=this;i(document).keypress(function(t){e.get("saveDisabled")||13!==t.which||e.send("add")})},actions:{close:function(){this.sendAction()},add:function(){this.sendAction("action",this.get("url"))}}})}),define("huegasm/pods/components/music-tab/add-soundcloud-sound-modal/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"bOxSs2v4",block:'{"statements":[["block",["if"],[["get",["isShowingModal"]]],null,1]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text","\\n "],["open-element","p",[]],["flush-element"],["text","Enter a "],["open-element","a",[]],["static-attr","href","https://soundcloud.com"],["static-attr","target","_blank"],["static-attr","rel","noopener noreferrer"],["flush-element"],["text","SoundCloud"],["close-element"],["text"," track or playlist/set URL"],["close-element"],["text","\\n "],["open-element","p",[]],["flush-element"],["text","( ex. https://soundcloud.com/mrsuicidesheep/tracks )"],["close-element"],["text","\\n\\n "],["append",["helper",["paper-input"],null,[["label","icon","value","onChange"],["SoundCloud URL","search",["get",["url"]],["helper",["action"],[["get",[null]],["helper",["mut"],[["get",["url"]]],null]],null]]]],false],["text","\\n\\n "],["open-element","div",[]],["flush-element"],["text","\\n "],["append",["helper",["paper-button"],null,[["onClick","label"],[["helper",["action"],[["get",[null]],"close"],null],"Close"]]],false],["text","\\n "],["append",["helper",["paper-button"],null,[["class","onClick","disabled","primary","label"],["pull-right",["helper",["action"],[["get",[null]],"add"],null],["get",["saveDisabled"]],true,"Add Music"]]],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["modal-dialog"],null,[["close","alignment","translucentOverlay","attachment","targetAttachment"],["close","center",true,"center","center"]],0]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"huegasm/pods/components/music-tab/add-soundcloud-sound-modal/template.hbs"}})}),define("huegasm/pods/components/music-tab/component",["exports","ember","huegasm/pods/components/music-tab/mixins/helpers","huegasm/pods/components/music-tab/mixins/visualizer"],function(e,t,n,l){var a=t.default.Component,o=t.default.observer,s=t.default.isEmpty,r=t.default.isNone,i=t.default.$,c=t.default.run,p=c.later,u=c.next;e.default=a.extend(n.default,l.default,{updatePageTitle:o("playQueuePointer",function(){var e="Huegasm",t=this.get("playQueuePointer"),n=this.get("playQueue");if(t!==-1){var l=n[t];l.title?(e=l.title,l.artist&&(e+=" - "+l.artist)):e=l.fileName,e+="- Huegasm"}document.title=e}),changePlayerControl:function(e,t,n){this.set(e,t),"threshold"===e&&this.get("kick").set({threshold:t}),n&&this.get("playQueuePointer")!==-1&&this.saveSongBeatPreferences(),this.get("storage").set("huegasm."+e,t)},saveSongBeatPreferences:function(){var e=this.get("playQueue")[this.get("playQueuePointer")];if(e){var t=s(e.artist)?e.fileName:e.artist+"-"+e.title,n=this.get("songBeatPreferences");n[t]={threshold:this.get("threshold")},this.set("usingBeatPreferences",!0),this.get("storage").set("huegasm.songBeatPreferences",n)}},loadSongBeatPreferences:function(){var e=this.get("playQueue")[this.get("playQueuePointer")],t=s(e.artist)?e.fileName:e.artist+"-"+e.title,n=this.get("songBeatPreferences"),l=n[t],a=this.get("oldBeatPrefCache"),o=null;r(l)?r(a)||(this.changePlayerControl("threshold",a.threshold),this.set("usingBeatPreferences",!1)):(o={threshold:this.get("threshold")},this.changePlayerControl("threshold",l.threshold),this.set("usingBeatPreferences",!0)),this.set("oldBeatPrefCache",o)},clearCurrentAudio:function(e){var t=this.get("dancer");t.audio.pause&&t.pause(),e&&this.set("playQueuePointer",-1),this.setProperties({timeElapsed:0,timeTotal:0,playing:!1})},dragOver:function(){var e=this.get("dragLeaveTimeoutHandle");this.set("dragging",!0),e&&clearTimeout(e)},dragLeave:function(){var e=this;this.set("dragLeaveTimeoutHandle",setTimeout(function(){e.set("dragging",!1)},500))},simulateKick:function(){var e=this,t=this.get("activeLights"),n=this.get("lightsData"),l=null,a=this.get("flashingTransitions"),o=function(t,l,o){var s={bri:l};a?s.transitiontime=0:s.transitiontime=1,r(o)||(s.hue=o),n[t].state.on===!1&&(s.on=!0),i.ajax(e.get("apiURL")+"/lights/"+t+"/state",{data:JSON.stringify(s),contentType:"application/json",type:"PUT"})},s=100;if(t.length>0&&!this.get("ambienceMode")){var c=this.get("lastLightBopIndex"),u=void 0,d=254,m=void 0;if(u=Math.floor(Math.random()*t.length),t.length>1)for(;u===c;)u=Math.floor(Math.random()*t.length);if(m=t[u],this.set("lastLightBopIndex",u),!this.get("colorloopMode")){var h=this.get("hueRange");l=Math.floor(Math.random()*(h[1]-h[0]+1)+h[0])}a&&(s=80),o(m,d,l),p(this,o,m,1,s)}this.set("paused",!0),p(this,function(){this.set("paused",!1)},150),i("#beat-speaker-center-outer").velocity({blur:3},100).velocity({blur:0},100),i("#beat-speaker-center-inner").velocity({scale:1.05},100).velocity({scale:1},100)},init:function(){var e=this;this._super.apply(this,arguments),window.requestAnimationFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame,window.cancelAnimationFrame=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia;var t=new Dancer,n=this.get("storage"),l=t.createKick({threshold:this.get("threshold"),onKick:function(t,n){e.get("paused")===!1&&e.simulateKick(t,n)}});l.on(),this.setProperties({dancer:t,kick:l}),["volume","shuffle","repeat","volumeMuted","threshold","playerBottomDisplayed","songBeatPreferences","firstVisit","currentVisName","playQueue","playQueuePointer","flashingTransitions","colorloopMode","ambienceMode","hueRange"].forEach(function(t){if(!r(n.get("huegasm."+t))){var l=n.get("huegasm."+t);r(e.actions[t+"Changed"])?e.set(t,l):e.send(t+"Changed",l)}}),this.set("oldPlayQueueLength",this.get("playQueue.length")),SC.initialize({client_id:this.get("SC_CLIENT_ID")})},didInsertElement:function(){var e=this;this._super();var t=this;i("#file-input").on("change",function(){var e=this.files;t.send("handleNewFiles",e),this.value=null}),i(document).on("click",".alert",function(e){i(e.target).addClass("removed")}),i("#beat-container").on("mousedown","#beat-speaker-center-inner",function(e){e.preventDefault()}),i(document).keypress(function(t){32===t.which&&"text"!==t.target.type&&e.send("play")}),this.$().on("drop","#play-list-area",function(t){e.send("dropFiles",t.dataTransfer.files)}),i("#player-area").on("mousewheel",function(t){if(e.get("playQueueNotEmpty")){var n=5;t.deltaY<0&&(n*=-1);var l=e.get("volume")+n;e.send("volumeChanged",l<0?0:l),t.preventDefault()}}),this.get("firstVisit")&&(this.send("handleNewSoundCloudURL","https://soundcloud.com/mrsuicidesheep/candyland-speechless-feat-rkcb"),this.send("handleNewSoundCloudURL","https://soundcloud.com/dillistone/dillistone-lili-n-rude"),this.send("handleNewSoundCloudURL","https://soundcloud.com/mrsuicidesheep/vallis-alps-young-feki-remix"),this.send("handleNewSoundCloudURL","https://soundcloud.com/mrsuicidesheep/andrew-luce-when-to-love-you-feat-chelsea-cutler"),this.send("handleNewSoundCloudURL","https://soundcloud.com/mrsuicidesheep/ahh-ooh-carefree-with-me"),this.send("handleNewSoundCloudURL","https://soundcloud.com/mrsuicidesheep/crywolf-slow-burn"),this.send("handleNewSoundCloudURL","https://soundcloud.com/mrsuicidesheep/clozee-red-forest"),this.send("handleNewSoundCloudURL","https://soundcloud.com/mrsuicidesheep/elo-method-subranger-solace"),this.send("handleNewSoundCloudURL","https://soundcloud.com/mrsuicidesheep/90-pounds-of-pete-waited-too-long-feat-devon-baldwin"),this.send("handleNewSoundCloudURL","https://soundcloud.com/mrsuicidesheep/draper-eyes-open"),this.get("storage").set("huegasm.firstVisit",!1),this.sendAction()),this.get("playerBottomDisplayed")||i("#player-bottom").hide()},actions:{clearPlaylist:function(){this.get("playQueue").clear()},setVisName:function(e){this.set("currentVisName",e)},hideTooltip:function(){i(".bootstrap-tooltip").tooltip("hide")},gotoSCURL:function(e){this.get("playing")&&this.send("play"),this.send("gotoURL",e)},gotoURL:function(e){i(".tooltip").remove(),window.open(e,"_blank")},handleNewSoundCloudURL:function(e){var t=this;e&&SC.resolve(e).then(function(e){var n=function e(n){"user"===n.kind?t.get("notify").alert({html:t.get("scUserNotSupportedHtml")}):"track"===n.kind?n.streamable===!0?!function(){var e=null;n.artwork_url?e=n.artwork_url.replace("large","t67x67"):n.user.avatar_url&&(e=n.user.avatar_url),i.get(e).done(function(){t.get("playQueue").pushObject({url:n.stream_url+"?client_id="+t.get("SC_CLIENT_ID"),fileName:n.title+" - "+n.user.username,artist:n.user.username,scUrl:n.permalink_url,title:n.title,picture:e})}).fail(function(){t.get("playQueue").pushObject({url:n.stream_url+"?client_id="+t.get("SC_CLIENT_ID"),fileName:n.title+" - "+n.user.username,artist:n.user.username,scUrl:n.permalink_url,title:n.title})})}():l.push(n.title):"playlist"===n.kind&&(n.streamable===!0?n.tracks.forEach(e):l.push(n.title))},l=[];e instanceof Array?e.forEach(n):n(e),l.length>0&&t.get("notify").alert({html:t.get("notStreamableHtml")(l)}),t.get("playQueuePointer")===-1&&(t.get("firstVisit")?t.send("goToSong",0):t.send("next"))},function(){t.get("notify").alert({html:t.get("urlNotFoundHtml")(e)})}),this.set("isShowingAddSoundCloudModal",!1)},toggleIsShowingAddSoundCloudModal:function(){this.toggleProperty("isShowingAddSoundCloudModal")},slideTogglePlayerBottom:function(){var e=this.$("#player-bottom");e.velocity(e.is(":visible")?"slideUp":"slideDown",{duration:300}),this.changePlayerControl("playerBottomDisplayed",!this.get("playerBottomDisplayed"))},goToSong:function(e,t,n){var l=this,a=this.get("dancer"),o=this.get("playQueue");a.audio&&this.clearCurrentAudio(!0),r(o[e])||!function(){var o=new Audio;o.src=l.get("playQueue")[e].url,o.crossOrigin="anonymous",o.oncanplay=function(){l.set("timeTotal",Math.floor(o.duration)),l.set("soundCloudFuckUps",0)},o.onerror=function(e){var t=l.get("playQueuePointer"),n=l.get("playQueue")[t];l.get("soundCloudFuckUps")>=l.get("maxSoundCloudFuckUps")?(l.get("notify").alert({html:l.get("tooManySoundCloudFuckUps")}),l.send("play"),l.set("soundCloudFuckUps",0)):(n.local?l.send("removeAudio",t):l.send("next",!0),2===e.target.error.code?l.get("notify").alert({html:l.get("failedToDecodeFileHtml")(n.fileName)}):l.get("notify").alert({html:l.get("failedToPlayFileHtml")(n.fileName)}),l.set("usingBeatPreferences",!1),l.incrementProperty("soundCloudFuckUps"))},o.ontimeupdate=function(){l.set("timeElapsed",Math.floor(o.currentTime))},o.onended=function(){l.send("next")},a.load(o,1),l.set("playQueuePointer",e),l.loadSongBeatPreferences(),t&&l.send("play"),n&&u(l,function(){i(".track"+e).velocity("scroll",{container:i("#play-list-area"),duration:200})})}()},removeAudio:function(e){this.get("playQueue").removeAt(e),i("body .tooltip").remove(),e===this.get("playQueuePointer")&&this.send("goToSong",e,!0,!0)},playerAreaPlay:function(){s(i("#player-controls:hover"))&&this.get("playQueuePointer")!==-1&&(this.send("play"),i("#play-notification").velocity({opacity:.8,scale:1},0).velocity({opacity:0,scale:3},500))},play:function(e){var t=this.get("dancer"),n=this.get("playQueuePointer"),l=this.get("playing");if(n!==-1){if(l)t.pause(),e||this.set("timeElapsed",Math.floor(t.getTime()));else{var a=this.get("timeTotal");if(this.get("volumeMuted")?t.setVolume(0):t.setVolume(this.get("volume")/100),this.get("timeElapsed")===a&&0!==a)return void this.send("next",!0);i(window).trigger("resize"),t.play()}this.set("pauseLightUpdates",!l),this.onColorloopModeChange(),this.toggleProperty("playing")}},volumeChanged:function(e){this.changePlayerControl("volume",e),this.get("playing")&&this.get("dancer").setVolume(e/100),this.get("volume")>0&&this.get("volumeMuted")&&this.changePlayerControl("volumeMuted",!1)},next:function(e){var t=this.get("playQueuePointer"),n=this.get("playQueue"),l=t+1,a=this.get("repeat"),o=this.get("shuffle");if(2===a)l=t===-1&&n.length>0?0:t;else if(o){var s=this.get("shufflePlayed");if(s.length===n.length)return s.clear(),void this.send("play",!0);do l=Math.floor(Math.random()*n.length);while(s.includes(n[l].url));s.pushObject(n[l].url)}else if(l>n.length-1){if(1!==a&&!e)return void this.send("play",!0);l%=n.length}this.send("goToSong",l,!0,!0)},previous:function(){var e=this;this.get("timeElapsed")>5?this.send("seekChanged",0):!function(){var t=e.get("playQueuePointer"),n=e.get("playQueue");e.get("shuffle")&&!r(n[t])?!function(){var l=e.get("shufflePlayed"),a=e.get("shufflePlayed").indexOf(n[t].url),o=0;l.length>0&&a!==-1&&(t=a-1,t<0&&(t=l.length-1),n.some(function(e){return e.url===l[t]?(t=o,!0):(o++,!1)}))}():(t--,t<0&&(t=n.length-1)),e.send("goToSong",t,!0,!0)}()},seekChanged:function(e){var t=this.get("dancer");t.audio&&(t.audio.currentTime=Math.floor(this.get("timeTotal")*e/100))},volumeMutedChanged:function(e){var t=this.get("dancer"),n=r(e)?!this.get("volumeMuted"):e;this.changePlayerControl("volumeMuted",n),this.get("playing")&&(n?t.setVolume(0):t.setVolume(this.get("volume")/100))},addLocalAudio:function(){i("#file-input").click()},shuffleChanged:function(e){this.changePlayerControl("shuffle",r(e)?!this.get("shuffle"):e)},repeatChanged:function(e){this.changePlayerControl("repeat",r(e)?(this.get("repeat")+1)%3:e)},playerBottomDisplayedChanged:function(e){this.changePlayerControl("playerBottomDisplayed",e)},thresholdChanged:function(e){this.changePlayerControl("threshold",e,!0)},hueRangeChanged:function(e){this.changePlayerControl("hueRange",e)},playQueuePointerChanged:function(e){this.send("goToSong",e,!1,!0)},clickSpeaker:function(){this.simulateKick(1)},dropFiles:function(e){this.setProperties({dragging:!1,draggingOverPlayListArea:!1}),this.send("handleNewFiles",e)},playerListAreaDragOver:function(){this.set("draggingOverPlayListArea",!0)},playerListAreaDragLeave:function(){this.set("draggingOverPlayListArea",!1)},handleNewFiles:function(e){var t=this,n=this.get("playQueue"),l=function(){var e=ID3.getAllTags("local"),l=null;if(e.picture){for(var a="",o=0;oSoundCloud user URLs are not supported.',tooManySoundCloudFuckUps:'',notStreamableHtml:function(e){var t='";return t},urlNotFoundHtml:function(e){return'"},failedToPlayFileHtml:function(e){return'"},failedToDecodeFileHtml:function(e){return'"},scUrl:a("playQueuePointer","playQueue.[]",function(){var e=null,t=this.get("playQueue")[this.get("playQueuePointer")];return t&&t.scUrl&&(e=t.scUrl),e}),playQueueEmpty:a.empty("playQueue"),playQueueNotEmpty:a.notEmpty("playQueue"),playQueueMultiple:a("playQueue.[]",function(){return this.get("playQueue").length>1}),seekPosition:a("timeElapsed","timeTotal",function(){var e=this.get("timeTotal"),t=this.get("timeElapsed");return 0===e?0:t/e*100}),largeArtworkPic:a("playQueuePointer","currentVisName",function(){var e="",t=this.get("currentVisName"),n=this.get("playQueuePointer"),l=this.get("playQueue");if(n!==-1&&"None"===t){var a=l[n];o(a.picture)||(e=a.picture,a.scUrl&&(e=e.replace("67x67","500x500")))}return e}),repeatIcon:a("repeat",function(){return 2===this.get("repeat")?"repeat-one":"repeat"}),playingIcon:a("playing",function(){return this.get("playing")?"pause":this.get("timeElapsed")===this.get("timeTotal")&&0!==this.get("timeTotal")?"replay":"play-arrow"}),playerAreaClickIcon:a("playing",function(){return this.get("playing")?"play-arrow":"pause"}),playListAreaClass:a("dragging","draggingOverPlayListArea","dimmerOn",function(){var e="pointer";return this.get("dragging")&&(e+=" drag-here-highlight"),this.get("draggingOverPlayListArea")&&(e+=" dragging-over"),this.get("dimmerOn")&&(e+=" dimmerOn"),e}),dimmerOnClass:a("dimmerOn",function(){return this.get("dimmerOn")?"dimmerOn":null}),volumeMutedClass:a("volumeMuted",function(){var e="player-control-icon volumeButton";return this.get("volumeMuted")&&(e+=" active"),e}),repeatClass:a("repeat",function(){return 0!==this.get("repeat")?"player-control-icon active":"player-control-icon"}),shuffleClass:a("shuffle",function(){return this.get("shuffle")?"player-control-icon active":"player-control-icon"}),volumeIcon:a("volumeMuted","volume",function(){var e=this.get("volume");return this.get("volumeMuted")?"volume-off":e>=70?"volume-up":e>10?"volume-down":"volume-mute"}),beatDetectionAreaArrowIcon:a("playerBottomDisplayed",function(){return this.get("playerBottomDisplayed")?"keyboard-arrow-up":"keyboard-arrow-down"}),timeElapsedTxt:a("timeElapsed",function(){return this.formatTime(this.get("timeElapsed"))}),timeTotalTxt:a("timeTotal",function(){return this.formatTime(this.get("timeTotal"))}),onPlayQueueChange:l("playQueue.length",function(){var e=this,t=this.get("playQueue.length");t>this.get("oldPlayQueueLength")&&s.once(this,function(){s.next(e,function(){r(".track"+(t-1)).velocity("scroll",{container:r("#play-list-area"),duration:200})})}),this.set("oldPlayQueueLength",t)}),onColorloopModeChange:l("colorloopMode","playing",function(){this.set("colorLoopOn",this.get("playing")&&this.get("colorloopMode"))}),onOptionChange:l("flashingTransitions","playQueue.[]","playQueuePointer","colorloopMode","ambienceMode",function(e,t){t=t.replace(".[]","");var n=this.get(t);"playQueue"===t&&(n=n.filter(function(e){return!e.url.startsWith("blob:")})),this.get("storage").set("huegasm."+t,n)}),onRepeatChange:c("init",l("repeat",function(){var e="Repeat all",t="repeat";1===this.get(t)?e="Repeat one":2===this.get(t)&&(e="Repeat off"),this.changeTooltipText(t,e)})),onShuffleChange:c("init",l("shuffle",function(){var e="Shuffle",t="shuffle";this.get(t)&&(this.get("shufflePlayed").clear(),e="Unshuffle"),this.changeTooltipText(t,e)})),onVolumeMutedChange:c("init",l("volumeMuted",function(){var e="Mute",t="volumeMuted",n=this.get(t),l=this.get("dancer"),a=0;n?(e="Unmute",a=0):a=this.get("volume")/100,this.get("playing")&&l.setVolume(a),this.changeTooltipText(t,e)})),onPrevChange:c("init",l("timeElapsed","playQueueNotEmpty","playQueue.[]",function(){if(this.get("playQueueNotEmpty")){var e="Previous",t="prev";(this.get("timeElapsed")>5||1===this.get("playQueue").length)&&(e="Replay"),this.changeTooltipText(t,e)}})),onPlayingChange:c("init",l("playing",function(){var e="Play",t="playing";this.get(t)?e="Pause":this.get("timeElapsed")===this.get("timeTotal")&&0!==this.get("timeTotal")&&(e="Replay"),this.changeTooltipText(t,e)})),changeTooltipText:function(e,t){r("#"+e+"Tooltip + .tooltip .tooltip-inner").html(t),r("#"+e+"Tooltip").attr("data-original-title",t),o(this.get(e+"TooltipTxt"))&&this.set(e+"TooltipTxt",t)},formatTime:function(e){return this.pad(Math.floor(e/60),2)+":"+this.pad(e%60,2)},pad:function(e,t){return("000000000"+e).substr(-t)}})}),define("huegasm/pods/components/music-tab/mixins/visualizer",["exports","ember"],function(e,t){var n=t.default.Mixin,l=t.default.observer,a=t.default.$;e.default=n.create({currentVisName:"None",visNames:["None","Bars","Wave"],onCurrentVisNameChange:l("currentVisName",function(){var e=this.get("currentVisName");if("None"===e){var t=a("#visualization")[0],n=t.getContext("2d");n.clearRect(0,0,t.width,t.height)}this.get("storage").set("huegasm.currentVisName",e)}),didInsertElement:function(){var e=this,t=this.get("dancer"),n=a("#visualization")[0],l=a("#player-area"),o=n.getContext("2d"),s=2,r=l.height(),i=void 0;n.height=r;var c=function(){i=l.width(),n.width=i};c(),a(window).on("resize",c),t.bind("update",function(){var n=e.get("currentVisName"),l=o.createLinearGradient(0,0,0,r),a=document.hidden||document.msHidden||document.webkitHidden||document.mozHidden;if("None"!==n&&!a&&e.get("active"))if(o.clearRect(0,0,i,r),"Wave"===n){var c=3,p=1024;l.addColorStop(.6,"white"),l.addColorStop(0,"#0036FA"),o.lineWidth=1,o.strokeStyle=l;var u=t.getWaveform();o.beginPath(),o.moveTo(0,r/2);for(var d=0,m=u.length;dError retrieving data from your lights. Yikes.'}),e.set("displayFailure",!1),i(e,function(){this.set("displayFailure",!0)},3e4))};this.get("pauseLightUpdates")||u.get(this.get("apiURL")+"/lights",function(n,l){s(n[0])||s(n[0].error)?"success"===l&&JSON.stringify(e.get("lightsData"))!==JSON.stringify(n)&&e.set("lightsData",n):t()}).fail(t)},actions:{changeTab:function(e){var t=this.get("tabList").indexOf(e);this.set("selectedTab",t),this.get("storage").set("huegasm.selectedTab",t)},clearBridge:function(){var e=this.get("storage");e.remove("huegasm.bridgeUsername"),e.remove("huegasm.bridgeIp"),location.reload()},toggleDimmer:function(){this.sendAction()},clearAllSettings:function(){this.get("storage").clear(),location.reload()},startIntro:function(){var e=this,t=introJs(),n=u("#player-bottom");this.get("dimmerOn")&&this.send("toggleDimmer"),t.setOptions({steps:[{intro:"Welcome! This short tutorial will introduce you to Huegasm."},{element:"#music-tab",intro:"This is the music player. You'll use this to play music and synchronize it with your active lights.

TIP: Control which lights are active through the Lights tab."},{element:"#playlist",intro:"You can add and select music to play from your playlist here. You may listen to local audio files, stream music from soundcloud or stream directly from a connected microphone.

TIP: Songs added through Soundcloud will be saved for when you visit this page again."},{element:u("#playlist md-menu")[0],intro:'You can add songs from SoundCloud by copy and pasting the URL shown here'},{element:"#player-area",intro:"The audio playback may be controlled with the controls here. Basic music visualization effects may be shown here by selecting them from the menu ( eyeball icon in the bottom right )."},{element:"#beat-option-row",intro:"These are the settings for the music tab:
Sensitivity - The sensitivity of the beat detector ( more sensitivity results in more registered beats )
Hue Range - The hue range that the lights may change to on beat.
Flashing Transitions - Quickly flash the lights on beat
Colorloop - Slowly cycle the lights through all the colors while the music is playing
TIP: Your sensitivity settings are saved per song as indicated by the red star icon in the top left corner. These settings they will be restored if you ever listen to the same song again.",position:"top"},{element:"#beat-container",intro:"An interactive speaker that will bump when a beat is registered.

TIP: Click on the center of the speaker to simulate a beat.",position:"top"},{element:"#lights-tab",intro:"This is the lights tab. Here you'll be able to change various light properties:
Power - Turn the selected lights on/off
Brightness - The brightness level of the selected lights
Color - The color of the selected lights
Strobe - Selected lights will flash in sequential order
Colorloop - Selected lights will slowly cycle through all the colors
"},{element:"#active-lights",intro:"These icons represent the hue lights in your system. Active lights will be controlled by the application while the inactive lights will have a red X over them and will not be controlled.
You may toggle a light's state by clicking on it."},{element:u("#navigation .ember-basic-dropdown-trigger")[0],intro:"A few miscellaneous settings can be found here.

WARNING: clearing application settings will restore the application to its original state. This will even delete your playlist and any saved song beat preferences."},{intro:"And that's it...Hope you enjoy the application. ;)"}]}),t.onexit(function(){u("body").velocity("scroll",{duration:200})}),t.onchange(function(e){""===e.id||"music-tab"===e.id||"playlist"===e.id||"player-area"===e.id||"beat-option-row"===e.id||"beat-option-button-group"===e.id||"beat-container"===e.id||"using-mic-audio-tooltip"===e.id||"MD-MENU"===e.nodeName?u(".navigation-item").eq(1).click():u(".navigation-item").eq(0).click(),"music-tab"===e.id||"playlist"===e.id||"player-area"===e.id?n.hide():"beat-option-row"===e.id||"beat-option-button-group"===e.id||"beat-container"===e.id?n.show():"dimmer"===e.id&&u(document).click()}),t.onafterchange(function(t){var n=u(t);""===n.html()&&u(".introjs-nextbutton").click(),""===t.id?i(e,function(){u("body").velocity("scroll")},500):i(e,function(){u(".introjs-tooltip").velocity("scroll",{offset:-100})},500)}).start()}}})}),define("huegasm/pods/components/hue-controls/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"0kJgw7UI",block:'{"statements":[["block",["if"],[["get",["ready"]]],null,10,0],["text","\\n"],["append",["helper",["ember-notify"],null,[["messageStyle","closeAfter"],["bootstrap",5000]]],false]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["append",["helper",["paper-progress-circular"],null,[["diameter"],[100]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["paper-icon"],["settings backup restore"],[["class"],[["get",["dimmerOnClass"]]]]],false],["text"," Reset settings\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["paper-icon"],["cached"],[["class"],[["get",["dimmerOnClass"]]]]],false],["text"," Restart tutorial\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["paper-icon"],["compare arrows"],[["class"],[["get",["dimmerOnClass"]]]]],false],["text"," Switch bridge\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["paper-icon"],["lightbulb outline"],[["class"],[["get",["dimmerOnClass"]]]]],false],["text"," Dark Mode: "],["append",["helper",["if"],[["get",["dimmerOn"]],"On","Off"],null],false],["text","\\n"]],"locals":[]},{"statements":[["block",["content","menu-item"],null,[["onClick"],["toggleDimmer"]],4],["text","\\n"],["block",["content","menu-item"],null,[["onClick"],["clearBridge"]],3],["text","\\n"],["block",["content","menu-item"],null,[["onClick"],["startIntro"]],2],["text","\\n"],["block",["content","menu-item"],null,[["onClick"],["clearAllSettings"]],1]],"locals":["content"]},{"statements":[["text"," "],["append",["helper",["paper-icon"],["settings-icon"],[["class","size"],[["get",["dimmerOnClass"]],28]]],false],["text","\\n"]],"locals":[]},{"statements":[["block",["paper-button"],null,[["iconButton"],[true]],6]],"locals":[]},{"statements":[["block",["menu","trigger"],null,null,7],["block",["menu","content"],null,[["width"],[3]],5]],"locals":["menu"]},{"statements":[["text"," "],["open-element","span",[]],["dynamic-attr","class",["concat",["navigation-item pointer text-uppercase ",["helper",["if"],[["get",["tab","selected"]],"active"],null]]]],["modifier",["action"],[["get",[null]],"changeTab",["get",["tab","name"]]]],["flush-element"],["append",["unknown",["tab","name"]],false],["close-element"],["text","\\n"]],"locals":["tab"]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","id","navigation"],["static-attr","class","row"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","col-sm-10 col-sm-offset-1 col-xs-12"],["flush-element"],["text","\\n"],["block",["each"],[["get",["tabData"]]],null,9],["block",["paper-menu"],null,null,8],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n\\n "],["append",["helper",["light-group"],null,[["lightsData","activeLights","syncLight","apiURL","dimmerOn","storage"],[["get",["lightsData"]],["get",["activeLights"]],["get",["syncLight"]],["get",["apiURL"]],["get",["dimmerOn"]],["get",["storage"]]]]],false],["text","\\n\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["lights-tab"],null,[["active","apiURL","lightsData","activeLights","syncLight","trial","colorLoopOn","dimmerOn","playing","pauseLightUpdates"],[["helper",["eq"],[["get",["selectedTab"]],0],null],["get",["apiURL"]],["get",["lightsData"]],["get",["activeLights"]],["get",["syncLight"]],["get",["trial"]],["get",["colorLoopOn"]],["get",["dimmerOn"]],["get",["playing"]],["get",["pauseLightUpdates"]]]]],false],["text","\\n\\n "],["append",["helper",["music-tab"],null,[["active","apiURL","lightsData","activeLights","pauseLightUpdates","dimmerOn","storage","colorLoopOn","playing","action"],[["helper",["eq"],[["get",["selectedTab"]],1],null],["get",["apiURL"]],["get",["lightsData"]],["get",["activeLights"]],["get",["pauseLightUpdates"]],["get",["dimmerOn"]],["get",["storage"]],["get",["colorLoopOn"]],["get",["playing"]],"startIntro"]]],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"huegasm/pods/components/hue-controls/template.hbs"}})}),define("huegasm/pods/components/huegasm-app/component",["exports","ember"],function(e,t){var n=t.default.Component,l=t.default.isEmpty,a=t.default.$;e.default=n.extend({bridgeIp:null,bridgeUsername:null,trial:!1,ready:!1,elementId:"huegasm",init:function(){this._super.apply(this,arguments);var e=this.get("storage");l(e.get("huegasm.bridgeIp"))||l(e.get("huegasm.bridgeUsername"))||this.setProperties({bridgeIp:e.get("huegasm.bridgeIp"),bridgeUsername:e.get("huegasm.bridgeUsername")})},actions:{toggleDimmer:function(){this.sendAction()},isReady:function(){this.set("ready",!0),a("html, body").velocity("scroll")}}})}),define("huegasm/pods/components/huegasm-app/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"GscS0kxX",block:'{"statements":[["block",["if"],[["get",["bridgeUsername"]]],null,3,2]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","ready-block"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","title"],["flush-element"],["text","\\n "],["open-element","img",[]],["static-attr","src","assets/images/logo-2d51b899f18553cfc8ffd147c158cd3f.png"],["static-attr","alt","Huegasm"],["flush-element"],["close-element"],["text","\\n "],["close-element"],["text","\\n\\n "],["open-element","p",[]],["static-attr","id","intro"],["flush-element"],["text","\\n Your lights meet your music.\\n "],["close-element"],["text","\\n "],["open-element","p",[]],["static-attr","id","intro-paragraph"],["flush-element"],["text","\\n Huegasm is a free web application for managing and synchronizing your "],["open-element","a",[]],["static-attr","target","_blank"],["static-attr","href","http://www2.meethue.com"],["flush-element"],["text","Philips Hue lights"],["close-element"],["text"," with the beat of your music.\\n "],["close-element"],["text","\\n\\n "],["open-element","div",[]],["static-attr","class","embed-container-wrapper"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","embed-container"],["flush-element"],["text","\\n "],["open-element","iframe",[]],["static-attr","width","560"],["static-attr","height","315"],["static-attr","src","https://www.youtube.com/embed/zi9J6Qg-MPw"],["static-attr","frameborder","0"],["static-attr","allowfullscreen",""],["flush-element"],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["append",["helper",["paper-button"],null,[["raised","primary","onClick","class","label"],[true,true,["helper",["action"],[["get",[null]],"isReady"],null],"go-button center-block","Go!"]]],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["bridge-finder"],null,[["bridgeIp","bridgeUsername","trial","storage"],[["get",["bridgeIp"]],["get",["bridgeUsername"]],["get",["trial"]],["get",["storage"]]]]],false],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["ready"]]],null,1,0]],"locals":[]},{"statements":[["text"," "],["append",["helper",["hue-controls"],null,[["bridgeIp","bridgeUsername","trial","dimmerOn","storage","action"],[["get",["bridgeIp"]],["get",["bridgeUsername"]],["get",["trial"]],["get",["dimmerOn"]],["get",["storage"]],"toggleDimmer"]]],false],["text","\\n"]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"huegasm/pods/components/huegasm-app/template.hbs"}})}),define("huegasm/pods/components/huegasm-footer/component",["exports","ember"],function(e,t){var n=t.default.Component,l=t.default.computed;e.default=n.extend({tagName:"footer",classNames:["footer"],year:l(function(){return(new Date).getFullYear()}),actions:{toggleDimmer:function(){this.sendAction()}}})}),define("huegasm/pods/components/huegasm-footer/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"f1VFdSVa",block:'{"statements":[["open-element","div",[]],["static-attr","class","logo"],["modifier",["action"],[["get",[null]],"toggleDimmer"]],["flush-element"],["close-element"],["text","\\n\\n"],["open-element","div",[]],["static-attr","class","footer-text"],["flush-element"],["text","\\n © "],["append",["unknown",["year"]],false],["text","\\n\\n "],["open-element","a",[]],["static-attr","href","http://www.egorphilippov.me"],["static-attr","target","_blank"],["static-attr","rel","noopener noreferrer"],["flush-element"],["text","\\n Egor Philippov\\n "],["close-element"],["text","\\n"],["close-element"],["text","\\n\\n"],["open-element","a",[]],["static-attr","href","https://play.google.com/store/apps/details?id=com.hoboman313.huegasm"],["static-attr","target","_blank"],["static-attr","rel","noopener noreferrer"],["flush-element"],["text","\\n "],["open-element","img",[]],["static-attr","src","assets/images/google-play-badge-4be08e3cf4d01124257db037380272ea.png"],["static-attr","alt","Get it on the Google Play Store"],["flush-element"],["close-element"],["text","\\n"],["close-element"]],"locals":[],"named":[],"yields":[],"blocks":[],"hasPartials":false}',meta:{moduleName:"huegasm/pods/components/huegasm-footer/template.hbs"}})}),define("huegasm/pods/components/light-group/component",["exports","ember"],function(e,t){var n=t.default.A,l=t.default.Component,a=t.default.computed,o=t.default.isEmpty,s=t.default.isNone,r=t.default.observer,i=t.default.$;e.default=l.extend({elementId:"active-lights",classNames:["light-group","horizontal-light-group"],isHovering:!1,activeLights:n(),lightsList:a("lightsData","activeLights.[]","dimmerOn",function(){var e=this.get("lightsData"),t=this.get("activeLights"),l=this.get("dimmerOn"),a=n(),o=void 0,s=void 0;for(var r in e)if(s="light-active",e.hasOwnProperty(r)&&e[r].state.reachable){switch(e[r].modelid){case"LCT001":o="a19";break;case"LCT002":o="br30";break;case"LCT003":o="gu10";break;case"LST001":o="lightstrip";break;case"LLC010":o="lc_iris";break;case"LLC011":o="lc_bloom";break;case"LLC012":o="lc_bloom";break;case"LLC006":o="lc_iris";break;case"LLC007":o="lc_aura";break;case"LLC013":o="storylight";break;case"LWB004":o="a19";break;case"LLC020":o="huego";break;default:o="a19"}l&&(o+="w"),t.includes(r)||(s="light-inactive"),a.push({type:o,name:e[r].name,id:r,data:e[r],activeClass:s})}return a}),onActiveLightsChange:r("activeLights.[]",function(){this.get("storage").set("huegasm.activeLights",this.get("activeLights"))}),init:function(){this._super.apply(this,arguments);var e=this.get("lightsData"),t=this.get("activeLights"),n=this.get("storage").get("huegasm.activeLights");if(s(n))for(var l in e)e.hasOwnProperty(l)&&e[l].state.reachable&&t.pushObject(l);else n.forEach(function(n){e.hasOwnProperty(n)&&e[n].state.reachable&&t.pushObject(n)})},actions:{clickLight:function(e){var t=this.get("activeLights"),n=t.indexOf(e);n!==-1?t.removeObject(e):(t.pushObject(e),this.set("syncLight",e))},lightStartHover:function(e){if(!window.matchMedia||window.matchMedia("(min-width: 768px)").matches){var t=this.get("lightsList").filter(function(t){return"unreachable"!==t.activeClass&&t.id===e[0]});o(t)||this.get("noHover")===!0||i.ajax(this.get("apiURL")+"/lights/"+e+"/state",{data:JSON.stringify({alert:"lselect"}),contentType:"application/json",type:"PUT"}),this.set("isHovering",!0)}},lightStopHover:function(e){if(!window.matchMedia||window.matchMedia("(min-width: 768px)").matches){var t=this.get("lightsList").filter(function(t){return"unreachable"!==t.activeClass&&t.id===e[0]});o(t)||this.get("noHover")===!0||i.ajax(this.get("apiURL")+"/lights/"+e+"/state",{data:JSON.stringify({alert:"none"}),contentType:"application/json",type:"PUT"}),this.set("isHovering",!1)}}}})}),define("huegasm/pods/components/light-group/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"NgytHQNN",block:'{"statements":[["block",["each"],[["get",["lightsList"]]],null,0]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","div",[]],["dynamic-attr","class",["concat",[["unknown",["light","activeClass"]]," bootstrap-tooltip light",["unknown",["light","id"]]]]],["static-attr","data-toggle","tooltip"],["static-attr","data-placement","top auto"],["dynamic-attr","data-title",["unknown",["light","name"]],null],["modifier",["action"],[["get",[null]],"clickLight",["get",["light","id"]]]],["modifier",["action"],[["get",[null]],"lightStartHover",["get",["light","id"]]],[["on"],["mouseEnter"]]],["modifier",["action"],[["get",[null]],"lightStopHover",["get",["light","id"]]],[["on"],["mouseLeave"]]],["flush-element"],["text","\\n "],["open-element","img",[]],["static-attr","class","hueLight"],["static-attr","width","40"],["dynamic-attr","src",["concat",["assets/images/lights/",["unknown",["light","type"]],".svg"]]],["flush-element"],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":["light"]}],"hasPartials":false}',meta:{moduleName:"huegasm/pods/components/light-group/template.hbs"}})}),define("huegasm/pods/components/lights-tab/color-picker/component",["exports","ember"],function(e,t){var n=t.default.Component,l=t.default.$;e.default=n.extend({elementId:"color-picker",rgb:null,canvas:null,canvasContext:null,pressingDown:!1,mouseUp:function(){this.set("pressingDown",!1)},mouseMove:function(e){this.get("pressingDown")&&this.mouseDown(e)},mouseDown:function(e){var t=l(this.get("canvas")).offset(),n=Math.floor(e.pageX-t.left),a=Math.floor(e.pageY-t.top),o=this.get("canvasContext").getImageData(n,a,1,1),s=o.data;this.set("pressingDown",!0),0===s[0]&&0===s[1]&&0===s[2]||this.set("rgb",[s[0],s[1],s[2]])},didInsertElement:function(){var e=l("#picker")[0],t=e.getContext("2d"),n=new Image;n.src="assets/images/colormap-83aafd17086eaab68b229a681c04139b.png",n.onload=function(){t.drawImage(n,0,0,n.width,n.height)},this.setProperties({canvas:e,canvasContext:t})}})}),define("huegasm/pods/components/lights-tab/color-picker/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"wNrN9ioa",block:'{"statements":[["open-element","canvas",[]],["static-attr","id","picker"],["static-attr","width","256"],["static-attr","height","256"],["flush-element"],["close-element"]],"locals":[],"named":[],"yields":[],"blocks":[],"hasPartials":false}',meta:{moduleName:"huegasm/pods/components/lights-tab/color-picker/template.hbs"}})}),define("huegasm/pods/components/lights-tab/component",["exports","ember"],function(e,t){var n=t.default.Component,l=t.default.observer,a=t.default.computed,o=t.default.on,s=t.default.run.later,r=t.default.$;e.default=n.extend({classNames:["col-sm-10","col-sm-offset-1","col-xs-12"],classNameBindings:["active::hidden"],elementId:"lights-tab",rgb:[255,255,255],lightsOn:!1,colorLoopOn:!1,lightsOnTxt:a("lightsOn",function(){return this.get("lightsOn")?"On":"Off"}),colorloopOnTxt:a("colorLoopOn",function(){return this.get("colorLoopOn")?"On":"Off"}),lightsBrightness:a("lightsData",function(){var e=this.get("lightsData"),t=this.get("activeLights"),n=0;return t.forEach(function(t){n+=e[t].state.bri}),n/t.length}),brightnessControlDisabled:a.not("lightsOn"),onColorLoopOnChange:l("colorLoopOn",function(){var e=this,t=this.get("lightsData"),n=this.get("activeLights"),l=this.get("colorLoopOn"),a=l?"colorloop":"none",o=n.some(function(e){return"colorloop"===t[e].state.effect});l!==o&&n.forEach(function(t){e.get("lightsData")[t].state.effect!==a&&r.ajax(e.get("apiURL")+"/lights/"+t+"/state",{data:JSON.stringify({effect:a}),contentType:"application/json",type:"PUT"})})}),rgbPreview:l("rgb",function(){var e=this,t=this.get("rgb"),n=this.rgbToXy(t[0],t[1],t[2]);this.set("colorLoopOn",!1),this.get("activeLights").forEach(function(t){r.ajax(e.get("apiURL")+"/lights/"+t+"/state",{data:JSON.stringify({xy:n}),contentType:"application/json",type:"PUT"})}),this.set("colorLoopOn",!1),r(".color").css("background","rgb("+t[0]+","+t[1]+","+t[2]+")")}),lightsOnChange:o("init",l("lightsData.@each.state.on","activeLights.[]",function(){var e=this;this.get("strobeOn")||!function(){var t=e.get("lightsData"),n=e.get("activeLights").some(function(e){return t[e].state.on===!0});e.set("lightsOn",n)}()})),onLightsOnChange:l("lightsOn",function(){var e=this,t=this.get("lightsData"),n=this.get("activeLights"),l=this.get("lightsOn"),a=n.some(function(e){return t[e].state.on===!0});l!==a&&n.forEach(function(t){r.ajax(e.get("apiURL")+"/lights/"+t+"/state",{data:JSON.stringify({on:l}),contentType:"application/json",type:"PUT"})})}),onBrightnessChanged:l("lightsBrightness",function(){var e=this,t=this.get("lightsData"),n=!1,l=this.get("lightsBrightness"),a=this.get("activeLights");a.forEach(function(e){n+=t[e].state.bri}),n/=a.length,l!==n&&a.forEach(function(t){r.ajax(e.get("apiURL")+"/lights/"+t+"/state",{data:JSON.stringify({bri:l}),contentType:"application/json",type:"PUT"})})}),onaActiveLightsChange:l("syncLight",function(){var e={on:this.get("lightsOn"),bri:this.get("lightsBrightness"),effect:this.get("colorLoopOn")?"colorloop":"none"},t=this.get("rgb"),n=this.get("syncLight");255!==t[0]&&255!==t[1]&&255!==t[2]&&(e.xy=this.rgbToXy(t[0],t[1],t[2])),e.transitiontime=0,r.ajax(this.get("apiURL")+"/lights/"+n+"/state",{data:JSON.stringify(e),contentType:"application/json",type:"PUT"})}),strobeOn:!1,strobeOnInervalHandle:null,strobeSat:0,preStrobeOnLightsDataCache:null,lastStrobeLight:0,onStrobeOnChange:l("strobeOn",function(){var e=this,t=this.get("lightsData"),n=this.get("strobeOn");if(n){this.set("preStrobeOnLightsDataCache",t);var l={sat:this.get("strobeSat"),transitiontime:0};for(var a in t)t.hasOwnProperty(a)&&(t[a].state.on&&(l.on=!1),r.ajax(this.get("apiURL")+"/lights/"+a+"/state",{data:JSON.stringify(l),contentType:"application/json",type:"PUT"}));this.set("strobeOnInervalHandle",setInterval(this.strobeStep.bind(this),500))}else!function(){var n=e.get("preStrobeOnLightsDataCache"),l=function(t){r.ajax(e.get("apiURL")+"/lights/"+t+"/state",{data:JSON.stringify({on:n[t].state.on,sat:n[t].state.sat}),contentType:"application/json",type:"PUT"})};for(var a in t)t.hasOwnProperty(a)&&s(e,l,a,2e3);s(e,e.onColorLoopOnChange,2e3),clearInterval(e.get("strobeOnInervalHandle"))}();this.set("pauseLightUpdates",n)}),strobeStep:function(){var e=(this.get("lastStrobeLight")+1)%(this.get("activeLights").length+1),t={on:!0,transitiontime:0,alert:"select"};this.get("colorLoopOn")&&(t.hue=Math.floor(65535*Math.random())),r.ajax(this.get("apiURL")+"/lights/"+e+"/state",{data:JSON.stringify(t),contentType:"application/json",type:"PUT"}),r.ajax(this.get("apiURL")+"/lights/"+e+"/state",{data:JSON.stringify({on:!1,transitiontime:0}),contentType:"application/json",type:"PUT"}),this.set("lastStrobeLight",e)},strobeOnTxt:a("strobeOn",function(){return this.get("strobeOn")?"On":"Off"}),dimmerOnClass:a("dimmerOn",function(){return this.get("dimmerOn")?"dimmerOn":null}),actions:{toggleDimmer:function(){this.sendAction("toggleDimmer")}},rgbToXy:function(e,t,n){var l=void 0,a=void 0,o=void 0,s=void 0,r=void 0;return e=Number(e/255),t=Number(t/255),n=Number(n/255),e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92,n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,l=.664511*e+.154324*t+.162028*n,a=.283881*e+.668433*t+.047685*n,o=88e-6*e+.07231*t+.986039*n,s=l/(l+a+o),r=a/(l+a+o),[s,r]},xyToRgb:function(e,t){var n=void 0,l=void 0,a=void 0,o=void 0,s=1,r=void 0;return o=s/t*e,r=s/t*(1-e-t),n=1.656492*o-.354851*s-.255038*r,l=o*-.707196+1.655397*s+.036152*r,a=.051713*o-.121364*s+1.01153*r,n>a&&n>l&&n>1?(l/=n,a/=n,n=1):l>a&&l>n&&l>1?(n/=l,a/=l,l=1):a>n&&a>l&&a>1&&(n/=a,l/=a,a=1),n=n<=.0031308?12.92*n:1.055*Math.pow(n,1/2.4)-.055,l=l<=.0031308?12.92*l:1.055*Math.pow(l,1/2.4)-.055,a=a<=.0031308?12.92*a:1.055*Math.pow(a,1/2.4)-.055,n>a&&n>l?n>1&&(l/=n,a/=n,n=1):l>a&&l>n?l>1&&(n/=l,a/=l,l=1):a>n&&a>l&&a>1&&(n/=a,l/=a,a=1),n*=255,l*=255,a*=255,[n,l,a]}})}),define("huegasm/pods/components/lights-tab/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"m2hlx07r",block:'{"statements":[["block",["paper-list"],null,null,10]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["append",["helper",["paper-icon"],["color-lens"],[["class"],[["get",["dimmerOnClass"]]]]],false],["text"," "],["append",["helper",["paper-icon"],["loop"],[["id","class"],["loop-addition",["get",["dimmerOnClass"]]]]],false],["text","\\n "],["open-element","p",[]],["static-attr","data-toggle","tooltip"],["static-attr","data-placement","top auto"],["static-attr","class","bootstrap-tooltip lights-control-tooltip"],["static-attr","data-title","Selected lights will slowly cycle through all the colors"],["flush-element"],["text","Colorloop"],["close-element"],["text","\\n "],["append",["helper",["paper-switch"],null,[["value","onChange","disabled","skipProxy","label"],[["get",["colorLoopOn"]],["helper",["action"],[["get",[null]],["helper",["mut"],[["get",["colorLoopOn"]]],null]],null],["helper",["or"],[["get",["trial"]],["get",["playing"]]],null],["get",["trial"]],["get",["colorloopOnTxt"]]]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["paper-icon"],["flare"],[["class"],[["get",["dimmerOnClass"]]]]],false],["text","\\n "],["open-element","p",[]],["static-attr","data-toggle","tooltip"],["static-attr","data-placement","top auto"],["static-attr","class","bootstrap-tooltip lights-control-tooltip"],["static-attr","data-title","Selected lights will flash in sequential order"],["flush-element"],["text","Strobe"],["close-element"],["text","\\n "],["append",["helper",["paper-switch"],null,[["value","onChange","disabled","skipProxy","label"],[["get",["strobeOn"]],["helper",["action"],[["get",[null]],["helper",["mut"],[["get",["strobeOn"]]],null]],null],["helper",["or"],[["get",["trial"]],["get",["playing"]]],null],["get",["trial"]],["get",["strobeOnTxt"]]]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["lights-tab/color-picker"],null,[["lightsData","activeLights","rgb"],[["get",["lightsData"]],["get",["activeLights"]],["get",["rgb"]]]]],false],["text","\\n"]],"locals":[]},{"statements":[["block",["content","menu-item"],null,null,2]],"locals":["content"]},{"statements":[["text"," "],["append",["helper",["paper-button"],null,[["raised","class","disabled"],[true,"color",["helper",["or"],[["get",["trial"]],["get",["playing"]]],null]]]],false],["text","\\n"]],"locals":[]},{"statements":[["block",["paper-button"],null,[["iconButton"],[false]],4]],"locals":[]},{"statements":[["block",["menu","trigger"],null,null,5],["block",["menu","content"],null,[["class","width"],["color-content",0]],3]],"locals":["menu"]},{"statements":[["text"," "],["append",["helper",["paper-icon"],["color-lens"],[["class"],[["get",["dimmerOnClass"]]]]],false],["text","\\n "],["open-element","p",[]],["static-attr","data-toggle","tooltip"],["static-attr","data-placement","top auto"],["static-attr","class","bootstrap-tooltip lights-control-tooltip"],["static-attr","data-title","The color of the selected lights"],["flush-element"],["text","Color"],["close-element"],["text","\\n\\n"],["block",["paper-menu"],null,[["offset"],["0 -50"]],6]],"locals":[]},{"statements":[["text"," "],["append",["helper",["paper-icon"],["brightness-4"],[["class"],[["get",["dimmerOnClass"]]]]],false],["text","\\n "],["open-element","p",[]],["static-attr","data-toggle","tooltip"],["static-attr","data-placement","top auto"],["static-attr","class","bootstrap-tooltip lights-control-tooltip"],["static-attr","data-title","The brightness level of the selected lights"],["flush-element"],["text","Brightness"],["close-element"],["text","\\n "],["append",["helper",["paper-slider"],null,[["flex","min","max","value","disabled"],[true,1,254,["get",["lightsBrightness"]],["get",["brightnessControlDisabled"]]]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["paper-icon"],["power-settings-new"],[["class"],[["get",["dimmerOnClass"]]]]],false],["text","\\n "],["open-element","p",[]],["static-attr","data-toggle","tooltip"],["static-attr","data-placement","top auto"],["static-attr","class","bootstrap-tooltip lights-control-tooltip"],["static-attr","data-title","Turn the selected lights on/off"],["flush-element"],["text","Power"],["close-element"],["text","\\n "],["append",["helper",["paper-switch"],null,[["value","onChange","disabled","skipProxy","label"],[["get",["lightsOn"]],["helper",["action"],[["get",[null]],["helper",["mut"],[["get",["lightsOn"]]],null]],null],["helper",["or"],[["get",["trial"]],["get",["playing"]]],null],["get",["trial"]],["get",["lightsOnTxt"]]]]],false],["text","\\n"]],"locals":[]},{"statements":[["block",["paper-item"],null,null,9],["text","\\n"],["block",["paper-item"],null,null,8],["text","\\n"],["block",["paper-item"],null,[["elementId"],["color-row"]],7],["text","\\n"],["block",["paper-item"],null,null,1],["text","\\n"],["block",["paper-item"],null,null,0]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"huegasm/pods/components/lights-tab/template.hbs"}})}),define("huegasm/pods/components/music-tab/add-soundcloud-sound-modal/component",["exports","ember"],function(e,t){ +var n=t.default.Component,l=t.default.observer,a=t.default.computed,o=t.default.isEmpty,s=t.default.isNone,r=t.default.run.later,i=t.default.$;e.default=n.extend({url:null,onIsShowingModalChange:l("isShowingModal",function(){this.get("isShowingModal")&&(this.set("url",null),r(function(){i("md-input-container input").focus()},500))}),saveDisabled:a("url",function(){return s(this.get("url"))||o(this.get("url").trim())}),didInsertElement:function(){var e=this;i(document).keypress(function(t){e.get("saveDisabled")||13!==t.which||e.send("add")})},actions:{close:function(){this.sendAction()},add:function(){this.sendAction("action",this.get("url"))}}})}),define("huegasm/pods/components/music-tab/add-soundcloud-sound-modal/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"bOxSs2v4",block:'{"statements":[["block",["if"],[["get",["isShowingModal"]]],null,1]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text","\\n "],["open-element","p",[]],["flush-element"],["text","Enter a "],["open-element","a",[]],["static-attr","href","https://soundcloud.com"],["static-attr","target","_blank"],["static-attr","rel","noopener noreferrer"],["flush-element"],["text","SoundCloud"],["close-element"],["text"," track or playlist/set URL"],["close-element"],["text","\\n "],["open-element","p",[]],["flush-element"],["text","( ex. https://soundcloud.com/mrsuicidesheep/tracks )"],["close-element"],["text","\\n\\n "],["append",["helper",["paper-input"],null,[["label","icon","value","onChange"],["SoundCloud URL","search",["get",["url"]],["helper",["action"],[["get",[null]],["helper",["mut"],[["get",["url"]]],null]],null]]]],false],["text","\\n\\n "],["open-element","div",[]],["flush-element"],["text","\\n "],["append",["helper",["paper-button"],null,[["onClick","label"],[["helper",["action"],[["get",[null]],"close"],null],"Close"]]],false],["text","\\n "],["append",["helper",["paper-button"],null,[["class","onClick","disabled","primary","label"],["pull-right",["helper",["action"],[["get",[null]],"add"],null],["get",["saveDisabled"]],true,"Add Music"]]],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["modal-dialog"],null,[["close","alignment","translucentOverlay","attachment","targetAttachment"],["close","center",true,"center","center"]],0]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"huegasm/pods/components/music-tab/add-soundcloud-sound-modal/template.hbs"}})}),define("huegasm/pods/components/music-tab/component",["exports","ember","huegasm/pods/components/music-tab/mixins/helpers","huegasm/pods/components/music-tab/mixins/visualizer"],function(e,t,n,l){var a=t.default.Component,o=t.default.observer,s=t.default.isEmpty,r=t.default.isNone,i=t.default.$,c=t.default.run,p=c.later,u=c.next;e.default=a.extend(n.default,l.default,{updatePageTitle:o("playQueuePointer",function(){var e="Huegasm",t=this.get("playQueuePointer"),n=this.get("playQueue");if(t!==-1){var l=n[t];l.title?(e=l.title,l.artist&&(e+=" - "+l.artist)):e=l.fileName,e+="- Huegasm"}document.title=e}),changePlayerControl:function(e,t,n){this.set(e,t),"threshold"===e&&this.get("kick").set({threshold:t}),n&&this.get("playQueuePointer")!==-1&&this.saveSongBeatPreferences(),this.get("storage").set("huegasm."+e,t)},saveSongBeatPreferences:function(){var e=this.get("playQueue")[this.get("playQueuePointer")];if(e){var t=s(e.artist)?e.fileName:e.artist+"-"+e.title,n=this.get("songBeatPreferences");n[t]={threshold:this.get("threshold")},this.set("usingBeatPreferences",!0),this.get("storage").set("huegasm.songBeatPreferences",n)}},loadSongBeatPreferences:function(){var e=this.get("playQueue")[this.get("playQueuePointer")],t=s(e.artist)?e.fileName:e.artist+"-"+e.title,n=this.get("songBeatPreferences"),l=n[t],a=this.get("oldBeatPrefCache"),o=null;r(l)?r(a)||(this.changePlayerControl("threshold",a.threshold),this.set("usingBeatPreferences",!1)):(o={threshold:this.get("threshold")},this.changePlayerControl("threshold",l.threshold),this.set("usingBeatPreferences",!0)),this.set("oldBeatPrefCache",o)},clearCurrentAudio:function(e){var t=this.get("dancer");t.audio.pause&&t.pause(),e&&this.set("playQueuePointer",-1),this.setProperties({timeElapsed:0,timeTotal:0,playing:!1})},dragOver:function(){var e=this.get("dragLeaveTimeoutHandle");this.set("dragging",!0),e&&clearTimeout(e)},dragLeave:function(){var e=this;this.set("dragLeaveTimeoutHandle",setTimeout(function(){e.set("dragging",!1)},500))},simulateKick:function(){var e=this,t=this.get("activeLights"),n=this.get("lightsData"),l=null,a=this.get("flashingTransitions"),o=function(t,l,o){var s={bri:l};a?s.transitiontime=0:s.transitiontime=1,r(o)||(s.hue=o),n[t].state.on===!1&&(s.on=!0),i.ajax(e.get("apiURL")+"/lights/"+t+"/state",{data:JSON.stringify(s),contentType:"application/json",type:"PUT"})},s=100;if(t.length>0&&!this.get("ambienceMode")){var c=this.get("lastLightBopIndex"),u=void 0,d=254,m=void 0;if(u=Math.floor(Math.random()*t.length),t.length>1)for(;u===c;)u=Math.floor(Math.random()*t.length);if(m=t[u],this.set("lastLightBopIndex",u),!this.get("colorloopMode")){var h=this.get("hueRange");l=Math.floor(Math.random()*(h[1]-h[0]+1)+h[0])}a&&(s=80),o(m,d,l),p(this,o,m,1,s)}this.set("paused",!0),p(this,function(){this.set("paused",!1)},150),i("#beat-speaker-center-outer").velocity({blur:3},100).velocity({blur:0},100),i("#beat-speaker-center-inner").velocity({scale:1.05},100).velocity({scale:1},100)},init:function(){var e=this;this._super.apply(this,arguments),window.requestAnimationFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame,window.cancelAnimationFrame=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia;var t=new Dancer,n=this.get("storage"),l=t.createKick({threshold:this.get("threshold"),onKick:function(t,n){e.get("paused")===!1&&e.simulateKick(t,n)}});l.on(),this.setProperties({dancer:t,kick:l}),["volume","shuffle","repeat","volumeMuted","threshold","playerBottomDisplayed","songBeatPreferences","firstVisit","currentVisName","playQueue","playQueuePointer","flashingTransitions","colorloopMode","ambienceMode","hueRange"].forEach(function(t){if(!r(n.get("huegasm."+t))){var l=n.get("huegasm."+t);r(e.actions[t+"Changed"])?e.set(t,l):e.send(t+"Changed",l)}}),this.set("oldPlayQueueLength",this.get("playQueue.length")),SC.initialize({client_id:this.get("SC_CLIENT_ID")})},didInsertElement:function(){var e=this;this._super();var t=this;i("#file-input").on("change",function(){var e=this.files;t.send("handleNewFiles",e),this.value=null}),i(document).on("click",".alert",function(e){i(e.target).addClass("removed")}),i("#beat-container").on("mousedown","#beat-speaker-center-inner",function(e){e.preventDefault()}),i(document).keypress(function(t){32===t.which&&"text"!==t.target.type&&e.send("play")}),this.$().on("drop","#play-list-area",function(t){e.send("dropFiles",t.dataTransfer.files)}),i("#player-area").on("mousewheel",function(t){if(e.get("playQueueNotEmpty")){var n=5;t.deltaY<0&&(n*=-1);var l=e.get("volume")+n;e.send("volumeChanged",l<0?0:l),t.preventDefault()}}),this.get("firstVisit")&&(this.send("handleNewSoundCloudURL","https://soundcloud.com/mrsuicidesheep/candyland-speechless-feat-rkcb"),this.send("handleNewSoundCloudURL","https://soundcloud.com/dillistone/dillistone-lili-n-rude"),this.send("handleNewSoundCloudURL","https://soundcloud.com/mrsuicidesheep/vallis-alps-young-feki-remix"),this.send("handleNewSoundCloudURL","https://soundcloud.com/mrsuicidesheep/andrew-luce-when-to-love-you-feat-chelsea-cutler"),this.send("handleNewSoundCloudURL","https://soundcloud.com/mrsuicidesheep/ahh-ooh-carefree-with-me"),this.send("handleNewSoundCloudURL","https://soundcloud.com/mrsuicidesheep/crywolf-slow-burn"),this.send("handleNewSoundCloudURL","https://soundcloud.com/mrsuicidesheep/clozee-red-forest"),this.send("handleNewSoundCloudURL","https://soundcloud.com/mrsuicidesheep/elo-method-subranger-solace"),this.send("handleNewSoundCloudURL","https://soundcloud.com/mrsuicidesheep/90-pounds-of-pete-waited-too-long-feat-devon-baldwin"),this.send("handleNewSoundCloudURL","https://soundcloud.com/mrsuicidesheep/draper-eyes-open"),this.get("storage").set("huegasm.firstVisit",!1),this.sendAction()),this.get("playerBottomDisplayed")||i("#player-bottom").hide()},actions:{clearPlaylist:function(){this.get("playQueue").clear()},setVisName:function(e){this.set("currentVisName",e)},hideTooltip:function(){i(".bootstrap-tooltip").tooltip("hide")},gotoSCURL:function(e){this.get("playing")&&this.send("play"),this.send("gotoURL",e)},gotoURL:function(e){i(".tooltip").remove(),window.open(e,"_blank")},handleNewSoundCloudURL:function(e){var t=this;e&&SC.resolve(e).then(function(e){var n=function e(n){"user"===n.kind?t.get("notify").alert({html:t.get("scUserNotSupportedHtml")}):"track"===n.kind?n.streamable===!0?!function(){var e=null;n.artwork_url?e=n.artwork_url.replace("large","t67x67"):n.user.avatar_url&&(e=n.user.avatar_url),i.get(e).done(function(){t.get("playQueue").pushObject({url:n.stream_url+"?client_id="+t.get("SC_CLIENT_ID"),fileName:n.title+" - "+n.user.username,artist:n.user.username,scUrl:n.permalink_url,title:n.title,picture:e})}).fail(function(){t.get("playQueue").pushObject({url:n.stream_url+"?client_id="+t.get("SC_CLIENT_ID"),fileName:n.title+" - "+n.user.username,artist:n.user.username,scUrl:n.permalink_url,title:n.title})})}():l.push(n.title):"playlist"===n.kind&&(n.streamable===!0?n.tracks.forEach(e):l.push(n.title))},l=[];e instanceof Array?e.forEach(n):n(e),l.length>0&&t.get("notify").alert({html:t.get("notStreamableHtml")(l)}),t.get("playQueuePointer")===-1&&(t.get("firstVisit")?t.send("goToSong",0):t.send("next"))},function(){t.get("notify").alert({html:t.get("urlNotFoundHtml")(e)})}),this.set("isShowingAddSoundCloudModal",!1)},toggleIsShowingAddSoundCloudModal:function(){this.toggleProperty("isShowingAddSoundCloudModal")},slideTogglePlayerBottom:function(){var e=this.$("#player-bottom");e.velocity(e.is(":visible")?"slideUp":"slideDown",{duration:300}),this.changePlayerControl("playerBottomDisplayed",!this.get("playerBottomDisplayed"))},goToSong:function(e,t,n){var l=this,a=this.get("dancer"),o=this.get("playQueue");a.audio&&this.clearCurrentAudio(!0),r(o[e])||!function(){var o=new Audio;o.src=l.get("playQueue")[e].url,o.crossOrigin="anonymous",o.oncanplay=function(){l.set("timeTotal",Math.floor(o.duration)),l.set("soundCloudFuckUps",0)},o.onerror=function(e){var t=l.get("playQueuePointer"),n=l.get("playQueue")[t];l.get("soundCloudFuckUps")>=l.get("maxSoundCloudFuckUps")?(l.get("notify").alert({html:l.get("tooManySoundCloudFuckUps")}),l.send("play"),l.set("soundCloudFuckUps",0)):(n.local?l.send("removeAudio",t):l.send("next",!0),2===e.target.error.code?l.get("notify").alert({html:l.get("failedToDecodeFileHtml")(n.fileName)}):l.get("notify").alert({html:l.get("failedToPlayFileHtml")(n.fileName)}),l.set("usingBeatPreferences",!1),l.incrementProperty("soundCloudFuckUps"))},o.ontimeupdate=function(){l.set("timeElapsed",Math.floor(o.currentTime))},o.onended=function(){l.send("next")},a.load(o,1),l.set("playQueuePointer",e),l.loadSongBeatPreferences(),t&&l.send("play"),n&&u(l,function(){i(".track"+e).velocity("scroll",{container:i("#play-list-area"),duration:200})})}()},removeAudio:function(e){this.get("playQueue").removeAt(e),i("body .tooltip").remove(),e===this.get("playQueuePointer")&&this.send("goToSong",e,!0,!0)},playerAreaPlay:function(){s(i("#player-controls:hover"))&&this.get("playQueuePointer")!==-1&&(this.send("play"),i("#play-notification").velocity({opacity:.8,scale:1},0).velocity({opacity:0,scale:3},500))},play:function(e){var t=this.get("dancer"),n=this.get("playQueuePointer"),l=this.get("playing");if(n!==-1){if(l)t.pause(),e||this.set("timeElapsed",Math.floor(t.getTime()));else{var a=this.get("timeTotal");if(this.get("volumeMuted")?t.setVolume(0):t.setVolume(this.get("volume")/100),this.get("timeElapsed")===a&&0!==a)return void this.send("next",!0);i(window).trigger("resize"),t.play()}this.set("pauseLightUpdates",!l),this.onColorloopModeChange(),this.toggleProperty("playing")}},volumeChanged:function(e){this.changePlayerControl("volume",e),this.get("playing")&&this.get("dancer").setVolume(e/100),this.get("volume")>0&&this.get("volumeMuted")&&this.changePlayerControl("volumeMuted",!1)},next:function(e){var t=this.get("playQueuePointer"),n=this.get("playQueue"),l=t+1,a=this.get("repeat"),o=this.get("shuffle");if(2===a)l=t===-1&&n.length>0?0:t;else if(o){var s=this.get("shufflePlayed");if(s.length===n.length)return s.clear(),void this.send("play",!0);do l=Math.floor(Math.random()*n.length);while(s.includes(n[l].url));s.pushObject(n[l].url)}else if(l>n.length-1){if(1!==a&&!e)return void this.send("play",!0);l%=n.length}this.send("goToSong",l,!0,!0)},previous:function(){var e=this;this.get("timeElapsed")>5?this.send("seekChanged",0):!function(){var t=e.get("playQueuePointer"),n=e.get("playQueue");e.get("shuffle")&&!r(n[t])?!function(){var l=e.get("shufflePlayed"),a=e.get("shufflePlayed").indexOf(n[t].url),o=0;l.length>0&&a!==-1&&(t=a-1,t<0&&(t=l.length-1),n.some(function(e){return e.url===l[t]?(t=o,!0):(o++,!1)}))}():(t--,t<0&&(t=n.length-1)),e.send("goToSong",t,!0,!0)}()},seekChanged:function(e){var t=this.get("dancer");t.audio&&(t.audio.currentTime=Math.floor(this.get("timeTotal")*e/100))},volumeMutedChanged:function(e){var t=this.get("dancer"),n=r(e)?!this.get("volumeMuted"):e;this.changePlayerControl("volumeMuted",n),this.get("playing")&&(n?t.setVolume(0):t.setVolume(this.get("volume")/100))},addLocalAudio:function(){i("#file-input").click()},shuffleChanged:function(e){this.changePlayerControl("shuffle",r(e)?!this.get("shuffle"):e)},repeatChanged:function(e){this.changePlayerControl("repeat",r(e)?(this.get("repeat")+1)%3:e)},playerBottomDisplayedChanged:function(e){this.changePlayerControl("playerBottomDisplayed",e)},thresholdChanged:function(e){this.changePlayerControl("threshold",e,!0)},hueRangeChanged:function(e){this.changePlayerControl("hueRange",e)},playQueuePointerChanged:function(e){this.send("goToSong",e,!1,!0)},clickSpeaker:function(){this.simulateKick(1)},dropFiles:function(e){this.setProperties({dragging:!1,draggingOverPlayListArea:!1}),this.send("handleNewFiles",e)},playerListAreaDragOver:function(){this.set("draggingOverPlayListArea",!0)},playerListAreaDragLeave:function(){this.set("draggingOverPlayListArea",!1)},handleNewFiles:function(e){var t=this,n=this.get("playQueue"),l=function(){var e=ID3.getAllTags("local"),l=null;if(e.picture){for(var a="",o=0;oSoundCloud user URLs are not supported.',tooManySoundCloudFuckUps:'',notStreamableHtml:function(e){var t='";return t},urlNotFoundHtml:function(e){return'"},failedToPlayFileHtml:function(e){return'"},failedToDecodeFileHtml:function(e){return'"},scUrl:a("playQueuePointer","playQueue.[]",function(){var e=null,t=this.get("playQueue")[this.get("playQueuePointer")];return t&&t.scUrl&&(e=t.scUrl),e}),playQueueEmpty:a.empty("playQueue"),playQueueNotEmpty:a.notEmpty("playQueue"),playQueueMultiple:a("playQueue.[]",function(){return this.get("playQueue").length>1}),seekPosition:a("timeElapsed","timeTotal",function(){var e=this.get("timeTotal"),t=this.get("timeElapsed");return 0===e?0:t/e*100}),largeArtworkPic:a("playQueuePointer","currentVisName",function(){var e="",t=this.get("currentVisName"),n=this.get("playQueuePointer"),l=this.get("playQueue");if(n!==-1&&"None"===t){var a=l[n];o(a.picture)||(e=a.picture,a.scUrl&&(e=e.replace("67x67","500x500")))}return e}),repeatIcon:a("repeat",function(){return 2===this.get("repeat")?"repeat-one":"repeat"}),playingIcon:a("playing",function(){return this.get("playing")?"pause":this.get("timeElapsed")===this.get("timeTotal")&&0!==this.get("timeTotal")?"replay":"play-arrow"}),playerAreaClickIcon:a("playing",function(){return this.get("playing")?"play-arrow":"pause"}),playListAreaClass:a("dragging","draggingOverPlayListArea","dimmerOn",function(){var e="pointer";return this.get("dragging")&&(e+=" drag-here-highlight"),this.get("draggingOverPlayListArea")&&(e+=" dragging-over"),this.get("dimmerOn")&&(e+=" dimmerOn"),e}),dimmerOnClass:a("dimmerOn",function(){return this.get("dimmerOn")?"dimmerOn":null}),volumeMutedClass:a("volumeMuted",function(){var e="player-control-icon volumeButton";return this.get("volumeMuted")&&(e+=" active"),e}),repeatClass:a("repeat",function(){return 0!==this.get("repeat")?"player-control-icon active":"player-control-icon"}),shuffleClass:a("shuffle",function(){return this.get("shuffle")?"player-control-icon active":"player-control-icon"}),volumeIcon:a("volumeMuted","volume",function(){var e=this.get("volume");return this.get("volumeMuted")?"volume-off":e>=70?"volume-up":e>10?"volume-down":"volume-mute"}),beatDetectionAreaArrowIcon:a("playerBottomDisplayed",function(){return this.get("playerBottomDisplayed")?"keyboard-arrow-up":"keyboard-arrow-down"}),timeElapsedTxt:a("timeElapsed",function(){return this.formatTime(this.get("timeElapsed"))}),timeTotalTxt:a("timeTotal",function(){return this.formatTime(this.get("timeTotal"))}),onPlayQueueChange:l("playQueue.length",function(){var e=this,t=this.get("playQueue.length");t>this.get("oldPlayQueueLength")&&s.once(this,function(){s.next(e,function(){r(".track"+(t-1)).velocity("scroll",{container:r("#play-list-area"),duration:200})})}),this.set("oldPlayQueueLength",t)}),onColorloopModeChange:l("colorloopMode","playing",function(){this.set("colorLoopOn",this.get("playing")&&this.get("colorloopMode"))}),onOptionChange:l("flashingTransitions","playQueue.[]","playQueuePointer","colorloopMode","ambienceMode",function(e,t){t=t.replace(".[]","");var n=this.get(t);"playQueue"===t&&(n=n.filter(function(e){return!e.url.startsWith("blob:")})),this.get("storage").set("huegasm."+t,n)}),onRepeatChange:c("init",l("repeat",function(){var e="Repeat all",t="repeat";1===this.get(t)?e="Repeat one":2===this.get(t)&&(e="Repeat off"),this.changeTooltipText(t,e)})),onShuffleChange:c("init",l("shuffle",function(){var e="Shuffle",t="shuffle";this.get(t)&&(this.get("shufflePlayed").clear(),e="Unshuffle"),this.changeTooltipText(t,e)})),onVolumeMutedChange:c("init",l("volumeMuted",function(){var e="Mute",t="volumeMuted",n=this.get(t),l=this.get("dancer"),a=0;n?(e="Unmute",a=0):a=this.get("volume")/100,this.get("playing")&&l.setVolume(a),this.changeTooltipText(t,e)})),onPrevChange:c("init",l("timeElapsed","playQueueNotEmpty","playQueue.[]",function(){if(this.get("playQueueNotEmpty")){var e="Previous",t="prev";(this.get("timeElapsed")>5||1===this.get("playQueue").length)&&(e="Replay"),this.changeTooltipText(t,e)}})),onPlayingChange:c("init",l("playing",function(){var e="Play",t="playing";this.get(t)?e="Pause":this.get("timeElapsed")===this.get("timeTotal")&&0!==this.get("timeTotal")&&(e="Replay"),this.changeTooltipText(t,e)})),changeTooltipText:function(e,t){r("#"+e+"Tooltip + .tooltip .tooltip-inner").html(t),r("#"+e+"Tooltip").attr("data-original-title",t),o(this.get(e+"TooltipTxt"))&&this.set(e+"TooltipTxt",t)},formatTime:function(e){return this.pad(Math.floor(e/60),2)+":"+this.pad(e%60,2)},pad:function(e,t){return("000000000"+e).substr(-t)}})}),define("huegasm/pods/components/music-tab/mixins/visualizer",["exports","ember"],function(e,t){var n=t.default.Mixin,l=t.default.observer,a=t.default.$;e.default=n.create({currentVisName:"None",visNames:["None","Bars","Wave"],onCurrentVisNameChange:l("currentVisName",function(){var e=this.get("currentVisName");if("None"===e){var t=a("#visualization")[0],n=t.getContext("2d");n.clearRect(0,0,t.width,t.height)}this.get("storage").set("huegasm.currentVisName",e)}),didInsertElement:function(){var e=this,t=this.get("dancer"),n=a("#visualization")[0],l=a("#player-area"),o=n.getContext("2d"),s=2,r=l.height(),i=void 0;n.height=r;var c=function(){i=l.width(),n.width=i};c(),a(window).on("resize",c),t.bind("update",function(){var n=e.get("currentVisName"),l=o.createLinearGradient(0,0,0,r),a=document.hidden||document.msHidden||document.webkitHidden||document.mozHidden;if("None"!==n&&!a&&e.get("active"))if(o.clearRect(0,0,i,r),"Wave"===n){var c=3,p=1024;l.addColorStop(.6,"white"),l.addColorStop(0,"#0036FA"),o.lineWidth=1,o.strokeStyle=l;var u=t.getWaveform();o.beginPath(),o.moveTo(0,r/2);for(var d=0,m=u.length;d\n
\n ');return i.appendChild(a[0]),a.on("wheel",t),a.on("touchmove",t),s.on("keydown",e),function(){a.off("wheel"),a.off("touchmove"),a[0].parentNode.removeChild(a[0]),s.off("keydown",e),delete o.disableScrollAround._enableScrolling}}function n(){var e=i.parentNode,t=e.getAttribute("style")||"",n=i.getAttribute("style")||"",l=i.scrollTop+i.parentElement.scrollTop,o=i.clientWidth;return i.scrollHeight>i.clientHeight&&(a(i,{position:"fixed",width:"100%",top:-l+"px"}),a(e,{overflowY:"scroll"})),i.clientWidth