@widgetic/editor 3.11.2 → 3.11.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/core.js +1 -1
- package/lib/dev/core.js +10 -10
- package/lib/dev/editor.js +369 -364
- package/lib/editor.js +3 -3
- package/package.json +1 -1
- package/src/core/services/uploads.js +6 -3
- package/src/editor/content/browser/dropzone.html +4 -2
- package/src/editor/content/browser/upload.html +0 -3
package/lib/editor.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=129)}([function(t,e,r){"use strict";var n=Object.prototype.hasOwnProperty;function i(t,e){return Array.isArray(t)?function(t,e){for(var r,n="",o="",s=Array.isArray(e),a=0;a<t.length;a++)(r=i(t[a]))&&(s&&e[a]&&(r=u(r)),n=n+o+r,o=" ");return n}(t,e):t&&"object"==typeof t?function(t){var e="",r="";for(var i in t)i&&t[i]&&n.call(t,i)&&(e=e+r+i,r=" ");return e}(t):t||""}function o(t){if(!t)return"";if("object"==typeof t){var e="";for(var r in t)n.call(t,r)&&(e=e+r+":"+t[r]+";");return e}return";"!==(t+="")[t.length-1]?t+";":t}function s(t,e,r,n){return!1!==e&&null!=e&&(e||"class"!==t&&"style"!==t)?!0===e?" "+(n?t:t+'="'+t+'"'):("function"==typeof e.toJSON&&(e=e.toJSON()),"string"==typeof e||(e=JSON.stringify(e),r||-1===e.indexOf('"'))?(r&&(e=u(e))," "+t+'="'+e+'"'):" "+t+"='"+e.replace(/'/g,"'")+"'"):""}e.merge=function t(e,r){if(1===arguments.length){for(var n=e[0],i=1;i<e.length;i++)n=t(n,e[i]);return n}for(var s in r)if("class"===s){var a=e[s]||[];e[s]=(Array.isArray(a)?a:[a]).concat(r[s]||[])}else if("style"===s){var a=o(e[s]),u=o(r[s]);e[s]=a+u}else e[s]=r[s];return e},e.classes=i,e.style=o,e.attr=s,e.attrs=function(t,e){var r="";for(var a in t)if(n.call(t,a)){var u=t[a];if("class"===a){u=i(u),r=s(a,u,!1,e)+r;continue}"style"===a&&(u=o(u)),r+=s(a,u,!1,e)}return r};var a=/["&<>]/;function u(t){var e=""+t,r=a.exec(e);if(!r)return t;var n,i,o,s="";for(n=r.index,i=0;n<e.length;n++){switch(e.charCodeAt(n)){case 34:o=""";break;case 38:o="&";break;case 60:o="<";break;case 62:o=">";break;default:continue}i!==n&&(s+=e.substring(i,n)),i=n+1,s+=o}return i!==n?s+e.substring(i,n):s}e.escape=u,e.rethrow=function t(e,n,i,o){if(!(e instanceof Error))throw e;if(!("undefined"==typeof window&&n||o))throw e.message+=" on line "+i,e;try{o=o||r(49).readFileSync(n,"utf8")}catch(r){t(e,null,i)}var s=3,a=o.split("\n"),u=Math.max(i-s,0),l=Math.min(a.length,i+s);var s=a.slice(u,l).map(function(t,e){var r=e+u+1;return(r==i?" > ":" ")+r+"| "+t}).join("\n");e.path=n;e.message=(n||"Pug")+":"+i+"\n"+s+"\n\n"+e.message;throw e}},,function(t,e,r){var n,i,o,s,a=function(t,e){return function(){return t.apply(e,arguments)}},u={}.hasOwnProperty;i=window.require("spine/controller"),s=document.createElement("textarea"),o=r(39),n=function(t){function e(t){var r;this.onEditStateChanged=a(this.onEditStateChanged,this),this.toggleEditState=a(this.toggleEditState,this),this.initEditableState=a(this.initEditableState,this),this.release=a(this.release,this),this._onChange=a(this._onChange,this),this.setItem=a(this.setItem,this),null==t.isAccesible&&(t.isAccesible=!0),e.__super__.constructor.apply(this,arguments),this.options.label&&this.el.attr("data-label",this.options.label),this.el.toggleClass("control--restricted",!this.isAccesible),this.render(),null!=(r=this.item)&&r.constructor.bind("change",this._onChange),null!=this.item&&this._onChange(this.item),this.options.editable&&this.initEditableState()}return function(t,e){for(var r in e)u.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.prototype.className="control",e.prototype.elements={".control-help":"helpText",".control-edit-btn input":"editBtnInput"},e.prototype.events={"input .custom-checkbox-input":"onEditStateChanged","click .control-upgrade":"onUpgradeClick"},e.prototype.setItem=function(t){return this.item=t,this._onChange(this.item)},e.prototype.update=function(){},e.prototype.change=function(t,e){var r;if(null==e&&(e={}),!e.silent)return null!=(r=this.item)&&r.updateAttribute(this.attribute,t,$.extend({attribute:this.attribute,from:this},e)),this.trigger("change:"+(this.type||"control"),{attribute:this.attribute,val:t,value:t})},e.prototype._onChange=function(t,e,r){if(null==r&&(r={}),t&&t.eql(this.item)){if(r.changedID&&(this.item=t),"destroy"===e)return this.release();if(this.el.toggleClass("control--hidden",!this.shouldShow()),null==r.attribute||r.attribute===this.attribute)return this.update(t,e,r)}},e.prototype.shouldShow=function(){return o(this.conditions,this.item)},e.prototype.release=function(){var t;return clearTimeout(this.interval),null!=(t=this.unbind().item)&&t.constructor.unbind("change",this._onChange),e.__super__.release.apply(this,arguments),this},e.prototype.initEditableState=function(){return this.editBtnInput.prop("checked",!!this.item.editedMeta(this.attribute)),this.editBtnInput.bind("change",this.onEditStateChanged),this.bind("change:"+(this.type||"control"),this.toggleEditState)},e.prototype.toggleEditState=function(t){return this.editBtnInput.prop("checked",!0),this.onEditStateChanged()},e.prototype.onEditStateChanged=function(){return this.item.editedMeta(this.attribute,this.editBtnInput.is(":checked"))},e.prototype.onUpgradeClick=function(t){return t.preventDefault(),this.$trigger("Control:upgrade",this.options)},e.prototype.render=function(){return e.__super__.render.apply(this,arguments),this.el.get(0)&&this.setWindow(),this.helpText.attr({"data-tooltip-position":"8% 3%","data-tooltip-text":this.options.help_text})},e.prototype.setWindow=function(t){var e;return this.$window=$(this.window=t||(null!=(e=this.el.get(0))?e.ownerDocument.defaultView:void 0))},e.prototype.htmlEntities=function(t){return s.innerHTML=t,s.innerHTML},e.prototype.unescapeHtmlEntities=function(t){return s.innerHTML=t,s.innerText||s.textContent},e}(),t.exports=n},function(t,e,r){var n,i,o,s,a,u,l=function(t,e){return function(){return t.apply(e,arguments)}},c={}.hasOwnProperty,p=[].slice;n=r(2),a=Math.min,s=Math.max,u=Math.round,o=function(t,e,r){return s(e,a(r,+t))},$("body"),i=function(t){function e(){var t,r,n,i,o,s;this.stopoinc=l(this.stopoinc,this),this.mousedown=l(this.mousedown,this),this.blur=l(this.blur,this),this.focus=l(this.focus,this),this.update=l(this.update,this),this.mouseEnterBody=l(this.mouseEnterBody,this),e.__super__.constructor.apply(this,arguments),(t=this.options).step||(t.step=1),(r=this.options).max||(r.max=10),(n=this.options).min||(n.min=0),(i=this.options).default||(i.default=0),(o=this.options).unit||(o.unit=""),this.change((null!=(s=this.item)?s[this.attribute]:void 0)||this.options.default||0,{silent:!0})}return function(t,e){for(var r in e)c.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,n),e.prototype.className="control control-stepper",e.prototype.template="core/views/stepper",e.prototype.type="stepper",e.prototype.elements={".control-input":"input"},e.prototype.events={"mousedown .spinner-button":"mousedown","keydown input":"keydown"},e.prototype.isMouseDown=!1,e.prototype.mouseEnterBody=function(t){if(this.isMouseDown)return 1!==(t.buttons||t.which)?this.stopoinc(t):void 0},e.prototype.limit=function(t){return o(parseInt(t),this.options.min,this.options.max)},e.prototype.update=function(t,e,r){var n;if(null==r&&(r={}),!r.from||r.from!==this)return n=parseInt(null!=t[this.attribute]?t[this.attribute]:this.options.default)||0,this.change(n,{silent:!0})},e.prototype.value=function(t){var e;return null!=t?this.input.val(t):isNaN(e=parseInt(this.input.val()))?+this.lastValue:e},e.prototype.change=function(){var t,r;return r=arguments[0],t=2<=arguments.length?p.call(arguments,1):[],this.lastValue=this.limit(r),e.__super__.change.apply(this,[this.lastValue].concat(p.call(t))),this.value(u(this.lastValue)+this.options.unit)},e.prototype.render=function(){var t;return this.input.unbind("blur").unbind("focus"),e.__super__.render.apply(this,arguments),this.input.bind({blur:this.blur,focus:this.focus}),this.change((null!=(t=this.item)?t[this.attribute]:void 0)||this.options.default||0,{silent:!0}),this},e.prototype.focus=function(){return this.value(parseInt(this.value()))},e.prototype.blur=function(){var t;return this.change(t=this.limit(parseFloat(this.value())),{silent:this.lastValue===t})},e.prototype.keydown=function(t){if(13===t.keyCode)return this.blur()},e.prototype.incdec=function(t){return this.change(this.limit(parseInt(this.value())+t))},e.prototype.mousedown=function(t){var e,r;return t.preventDefault(),this.isMouseDown=!0,clearInterval(this.interval),$(this.el[0].ownerDocument.body).one("mouseup",this.stopoinc).unbind("mouseenter",this.mouseEnterBody).bind("mouseenter",this.mouseEnterBody),e=$(t.target).hasClass("spinner-up")?1:-1,e*=this.options.step,this.incdec(e),r=function(t){return function(){return t.incdec(e),clearTimeout(t.timeout),t.interval=setInterval(function(){return t.incdec(e)},100)}}(this),this.timeout=setTimeout(r,300)},e.prototype.stopoinc=function(t){return this.isMouseDown=!1,clearInterval(this.interval),clearTimeout(this.timeout)},e}(),t.exports=i},function(t,e,r){var n,i,o,s,a,u=function(t,e){return function(){return t.apply(e,arguments)}},l={}.hasOwnProperty;n=r(11),o="validate invalid valid",a=/^((https?|ftp):\/\/)?((\w+|\*)\.)?[0-9a-z\-]+(\.([a-z]+|\*))?\.([a-z]+|\*)/i,s=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,i=function(t){function e(){this.testURLisValid=u(this.testURLisValid,this),this.onValidURL=u(this.onValidURL,this),this.onInvalidURL=u(this.onInvalidURL,this),this.onBlur=u(this.onBlur,this),this.updateState=u(this.updateState,this),this._onValidationComplete=u(this._onValidationComplete,this),this._checkURL=u(this._checkURL,this),this.checkURL=u(this.checkURL,this),this.onInput=u(this.onInput,this),e.__super__.constructor.apply(this,arguments),this.options.regex&&(a=this.options.regex),this.input.bind("blur",this.onBlur),this.lastURL&&this.checkURL(this.lastURL,{silent:!0})}return function(t,e){for(var r in e)l.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,n),e.prototype.className="control control-url",e.prototype.type=null,e.prototype.lastURL=null,e.prototype.events={"input input":"onInput","keyup input":"onInput","focus input":"onFocus",invalid:"onInvalidURL",valid:"onValidURL"},e.prototype.elements={input:"input"},e.prototype.onInput=function(t){if(13===t.which)return this.onBlur(t)},e.prototype.checkURL=function(t,e){return this.opts=null!=e?e:{},!(null!=t?t.length:void 0)&&this.options.allowEmpty?(this.lastURL=t,this._onValidationComplete(!0),this):(this.el.removeClass(o),this.lastURL=t,this.type?this.testURLisValid(t)?(this.$addClass("validate"),this._checkURL(t).then(function(t){return function(){return t._onValidationComplete(!0)}}(this)).fail(function(t){return function(){return t._onValidationComplete(!1)}}(this)),this):this._onValidationComplete(!1):this._onValidationComplete(!t.length||this.testURLisValid(t)))},e.prototype._checkURL=function(t){var e;return(e=Widgetic.Aye.defer()).resolve(),e.promise},e.prototype._onValidationComplete=function(t){if(this.$trigger(this.updateState(t)),!(this.silent||this.item&&this.item[this.attribute]===this.lastURL))return this.onURL(t)},e.prototype.updateState=function(t){return this.state=t?"valid":"invalid"},e.prototype.onURL=function(t,e){return null==e&&(e={}),!this.silent&&t&&this.onValidURL(),t&&this.change(this.lastURL,$.extend(this.opts,e)),this},e.prototype.onBlur=function(t){var r;return this.lastURL===(r=$(t.target).val())&&this.state?this.$trigger(this.state):(this.options.allow_email&&/@/.test(r)||!r||/^(https?|ftp):\/\//i.test(r)||(r="http://"+r),this.isNew()&&!r||this.checkURL(r),e.__super__.onBlur.apply(this,arguments))},e.prototype.onFocus=function(){return this.$removeClass("invalid")},e.prototype._change=function(){},e.prototype.onInvalidURL=function(){if(this.$removeClass(o).$addClass("invalid"),!this.silent)return this.onURL(!1)},e.prototype.onValidURL=function(){return this.$removeClass(o).$addClass("valid")},e.prototype.testURLisValid=function(t){return this.options.allow_email?a.test(t)||s.test(t):a.test(t)},e}(),t.exports=i},function(t,e){var r,n,i,o=function(t,e){return function(){return t.apply(e,arguments)}};i=function(t){return t.preventDefault()},r=function(){function t(t,e){this.el=t,null==e&&(e={}),this.bindEvents=o(this.bindEvents,this),this.render(),this.callbacks=e.callbacks,delete e.callbacks,this.$box.nanoScroller(this.options=$.extend(!0,{},this.defaults,e)),this.bindEvents(this.callbacks)}return t.prototype.defaults={preventPageScrolling:!0,disableResize:!0,contentClass:"scroll-content",alwaysVisible:!1,paneClass:"scroll-pane"},t.prototype.render=function(){var t;return t=$('<div class="scroll-content"></div>'),this.$box=$('<div class="nano scrolling-container">'),this.el.append(this.$box.append(t.append(this.el.children()))).addClass("scroll-box"),this.container=t},t.prototype.update=function(){return this.$box.nanoScroller(),this},t.prototype.scrollTo=function(t,e){return null==e&&(e={}),t="number"==typeof t?{scrollTop:t}:{scrollTo:t},this.$box.nanoScroller(t),this},t.prototype.detach=function(){return this},t.prototype.disable=function(){return this.$box.nanoScroller({stop:!0}),this.container.bind("mousewheel",i),this},t.prototype.enable=function(){return this.container.unbind("mousewheel",i),this.update()},t.prototype.offset=function(){return{top:this.container.scrollTop(),left:this.container.scrollLeft()}},t.prototype.bindEvents=function(t){return this.$box.bind("update",t.whileScrolling),this.$box.bind("update",t.onScroll)},t}(),n={onScroll:function(){},whileScrolling:function(){},scroll:function(){var t;return t={callbacks:{onScroll:this.onScroll,whileScrolling:this.whileScrolling}},this._scroll||(this._scroll=new r(this.scrollContainer||this.el,$.extend(!0,{},t,this.scrollOptions)),this.bind("release",function(t){return function(){return t.delay(function(){return t._scroll.detach()})}}(this)),this.container=this._scroll.container),this._scroll}},t.exports=n},function(t,e){var r,n,i=function(t,e){return function(){return t.apply(e,arguments)}},o={}.hasOwnProperty,s=[].indexOf||function(t){for(var e=0,r=this.length;e<r;e++)if(e in this&&this[e]===t)return e;return-1};r=window.require("spine/controller"),n=function(t){function e(){this.getProperties=i(this.getProperties,this),this.updateMarker=i(this.updateMarker,this),this.change=i(this.change,this),this.update=i(this.update,this),this.updatePanelSize=i(this.updatePanelSize,this),e.__super__.constructor.apply(this,arguments),this.refresh()}return function(t,e){for(var r in e)o.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,r),e.prototype.document=$(document),e.prototype.isTouch=s.call(window,"ontouchstart")>=0,e.prototype.elements={".positionPanelWrapper":"positionPanel",".dragPanel":"dragPanel","span.markDown":"marker",".reference-input":"referenceInput"},e.prototype.maxX=100,e.prototype.maxY=100,e.prototype.initW=275,e.prototype.initH=138,e.prototype.markerTop=0,e.prototype.markerLeft=0,e.prototype.reference={x:"center",y:"center"},e.prototype.updatePanelSize=function(t,e){var r,n,i,o;return i=parseFloat(this.initW/(e/this.initH)),n=parseFloat(this.initH/(t/this.initW)),o=this.initW*i/n,r=this.initH,o>this.initW&&(r=this.initH*n/i,o=this.initW),this.positionPanel.css({width:o,height:r})},e.prototype.prevent=function(t){if(null!=t.stopPropagation()&&t.stopPropagation(),null!=t.preventDefault())return t.preventDefault()},e.prototype.update=function(t,e,r){var n,i;if(null==r&&(r={}),t&&r.from!==this){for(n in t)i=t[n],this[n]=i;return this.updateMarker(),this.referenceInput.text(this.reference.y+" - "+this.reference.x)}},e.prototype.change=function(){return this.el.trigger("change",{attributes:{x:this.x,y:this.y,reference:this.reference},from:this})},e.prototype.updateMarker=function(){return this.marker.css({left:this.x+"%",top:this.y+"%"}).attr("reference",this.reference.x+" "+this.reference.y)},e.prototype.refresh=function(){return this.refreshElements(),this.getProperties()},e.prototype.setDocument=function(t){return this.document=t,this},e.prototype.getProperties=function(){return this.maxHeight=this.dragPanel.height(),this.maxWidth=this.dragPanel.width(),this.markerWidth=this.marker.outerWidth()/2,this.markerHeight=this.marker.outerHeight()/2,this.offset=this.dragPanel.offset()},e}(),t.exports=n},function(t,e,r){var n,i,o,s=function(t,e){return function(){return t.apply(e,arguments)}},a={}.hasOwnProperty;n=r(2),o=function(){return!1},i=function(t){function e(){this.updateOptions=s(this.updateOptions,this),this.focus=s(this.focus,this),this.blur=s(this.blur,this),this.deactivate=s(this.deactivate,this),this.enable=s(this.enable,this),this.disable=s(this.disable,this),this.click=s(this.click,this),this.update=s(this.update,this),this.reposition=s(this.reposition,this),this.calculateDimensions=s(this.calculateDimensions,this),this._onFocus=s(this._onFocus,this),this._onBlur=s(this._onBlur,this),this._onClick=s(this._onClick,this),e.__super__.constructor.apply(this,arguments),this.$window.bind("resize",this.reposition).bind("mousewheel scroll",this.blur),this.updateOptions(this.options)}return function(t,e){for(var r in e)a.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,n),e.prototype.className="control control-dropdown",e.prototype.template="core/views/dropdown",e.prototype.type="dropdown",e.prototype.elements={".input-dropdown":"input",".input-dropdown-default span":"default",".input-dropdown-list":"list",".input-dropdown-list li":"items"},e.prototype.events={"mousedown .input-dropdown":o,"mousedown .input-dropdown-list":o,"click .input-dropdown":"_onClick"},e.prototype._onClick=function(){return this[this.list.is(":visible")?"_onBlur":"_onFocus"]()},e.prototype._onBlur=function(){return this.list.hide()},e.prototype._onFocus=function(){return this.reposition().show(),this.delay(function(t){return function(){return $(t.window.document).on("click",t.blur)}}(this))},e.prototype.render=function(){var t;return e.__super__.render.apply(this,arguments),this.items.bind("mousedown",this.click),this.change((null!=(t=this.item)?t[this.attribute]:void 0)||this.options.default,{silent:!0}),this.reposition(),(this.body=$(this.window.document.body)).append(this.list),this},e.prototype.calculateDimensions=function(){return this.elHeight=this.el.height(),this.listHeight=this.list.height(),this.inputWidth=this.input.width(),this.offset=this.el.offset(),this.offset.bottom=this.offset.top+this.elHeight+this.listHeight-this.$window.scrollTop()},e.prototype.reposition=function(){var t,e,r;return this.calculateDimensions(),e=this.offset.bottom>this.$window.height()?this.input.offset().top-this.listHeight:this.offset.top+this.elHeight-1,t=this.offset.left,r=this.inputWidth-2,this.list.css({top:e,left:t,width:r})},e.prototype.update=function(t,e,r){var n;return null==r&&(r={}),r.from&&r.from===this?this:this.change(null!=(n=this.item)?n[this.attribute]:void 0,{silent:!0})},e.prototype.change=function(t){var r,n;if(e.__super__.change.apply(this,arguments),null!=t&&(n=RegExp("^"+t+"$","ig"),r=this.options.options.filter(function(t){return n.test(t.value+"")})[0]))return this.default.text(r.label),this.list.find("[data-value='"+r.value+"']").addClass("active").siblings().removeClass("active")},e.prototype.click=function(t){var e;return(e=$(t.target)).addClass("active").siblings().removeClass("active"),this.change(e.attr("data-value")),this.blur(),!1},e.prototype.disable=function(){return this.$addClass("disabled").default.text(this.options.disabledText)},e.prototype.enable=function(){var t,e;return this.$removeClass("disabled").change((null!=(t=this.item)?t[this.attribute]:void 0)||this.options.default||(null!=(e=this.options.options[0])?e.value:void 0))},e.prototype.deactivate=function(){return this.blur()},e.prototype.blur=function(){return $(this.window.document).unbind("click",this.blur),this._onBlur()},e.prototype.focus=function(){return this._onFocus()},e.prototype.updateOptions=function(t){return this.options=$.extend({},this.options,t),this.list.remove(),this.render(this._onBlur()),this.el.toggleClass("disabled",this.options.options.length<=1)},e}(),t.exports=i},function(t,e,r){var n,i,o,s,a={}.hasOwnProperty;o=window.require("spine/core/module"),i=window.require("spine/core/events"),n=r(9),s=function(t){function e(t,r){e.__super__.constructor.apply(this,arguments),this.title=t,this.root=new n({type:"folder",path:"/",root:!0}),this.options=r,this.listenTo(this,"auth",function(t){return function(){return clearTimeout(t.authFailInterval)}}(this))}return function(t,e){for(var r in e)a.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,o),e.browser="browser/controller",e.authenticating=!1,e.include(i),e.prototype.auth=function(){if(!this.authenticating)return this.authenticating=!0,setTimeout(function(t){return function(){return t.authenticating=!1}}(this),300),clearTimeout(this.authFailInterval),this.authFailInterval=setTimeout(function(t){return function(){return t.trigger("auth",t.authenticated=!1)}}(this),3e3),this._auth.apply(this,arguments)},e}(),t.exports=s},function(t,e){var r,n,i,o={}.hasOwnProperty;i=window.require("spine/core/module"),n=window.require("spine/core/events"),r=function(t){function e(t){var r,n;for(r in null==t&&(t={}),e.__super__.constructor.apply(this,arguments),t)n=t[r],t.hasOwnProperty(r)&&"function"==typeof this[r]?this[r](n):this[r]=n}return function(t,e){for(var r in e)o.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.include(n),e.prototype.stat=0,e}(),t.exports=r},function(t,e){var r,n,i,o,s=function(t,e){return function(){return t.apply(e,arguments)}},a=[].slice;i=new $.Deferred,o=i.promise(),r=function(){function t(){this._getFontList=s(this._getFontList,this),this.loadFontList=s(this.loadFontList,this),this.loadGoogleFont=s(this.loadGoogleFont,this),this.loadFontLoader()}return t.prototype.fontList={},t.prototype.loadFontLoader=function(){var t,e;return(e=document.createElement("script")).src="https://ajax.googleapis.com/ajax/libs/webfont/1.6.16/webfont.js",e.type="text/javascript",e.async="true",e.onload=function(){return i.resolve()},(t=document.getElementsByTagName("script")[0]).parentNode.insertBefore(e,t)},t.prototype.load=function(t,e,r){return null==t&&(t={}),null==e&&(e=window),o.then(function(){var i;return i=t.families[0],r||(r=t.source||"google"),null!=e.fontDefs&&null!=e.fontDefs[i]?e.fontDefs[i]:(e.fontDefs||(e.fontDefs={}),e.fontDefs[i]="local"===r?(new $.Deferred).resolve().promise():n.loadGoogleFont(t,e))})},t.prototype.loadGoogleFont=function(t,e){var r;return r=new $.Deferred,WebFont.load({google:t,context:e,fontactive:function(t){return function(){return t.resolve(arguments)}}(r),fontinactive:function(t){return function(){return t.resolve(arguments)}}(r),timeout:600}),r.promise()},t.prototype.loadFontList=function(){var t;return null!=this.fontListRdy?this.fontListRdy:(t=Blogvio.Aye.defer(),this._getFontList().then(function(e){return function(){var r,n;return t.resolve($.extend.apply($,[{}].concat(a.call(function(){var t,e;for(r in e=[],t=this.fontList)n=t[r],e.push(n);return e}.call(e)))))}}(this)),this.fontListRdy=t.promise)},t.prototype._getFontList=function(){var t,e;return t=new $.Deferred,e=function(e,r){var n;if(e){for(n in r)r[n],r[n].source=e;this.fontList[e]=r}else this.fontList=$.extend({},this.fontList,r);if(null!=this.fontList.google&&null!=this.fontList.local)return t.resolve()},$.getJSON("/fonts-list").then(e.bind(this,null)),$.getJSON("/fonts.json").then(e.bind(this,"local")),t.promise()},t}(),t.exports=n=new r},function(t,e,r){var n,i,o,s=function(t,e){return function(){return t.apply(e,arguments)}},a={}.hasOwnProperty;i=r(2),n=window.require("core/models/content"),o=function(t){function e(){this.isContentItem=s(this.isContentItem,this),this.destroy=s(this.destroy,this),this.isEmpty=s(this.isEmpty,this),this.isNew=s(this.isNew,this),this.onBlur=s(this.onBlur,this),this._change=s(this._change,this),this.update=s(this.update,this),this.render=s(this.render,this),e.__super__.constructor.apply(this,arguments),this.lengthLimit=this.options.lengthLimit||1e3,this.options.readonly?this.input.attr("readonly",!0):(this.input.bind("input",this._change),this.input.bind("blur",this.onBlur))}return function(t,e){for(var r in e)a.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.prototype.template="core/views/text",e.prototype.className="control-text",e.prototype.elements={"input[type=text]":"input"},e.prototype.render=function(){return e.__super__.render.apply(this,arguments),this.item&&this.update(this.item),this},e.prototype.update=function(t,e,r){var n;if(null==r&&(r={}),n=null!=t[this.attribute]?t[this.attribute]:this.options.default,this.unescapeHtmlEntities(n||"")!==this.input.val())return this.input.val(this.unescapeHtmlEntities(n||""))},e.prototype._change=function(){return this.change(this.htmlEntities(this.input.val().slice(0,this.lengthLimit)))},e.prototype.onBlur=function(){if(!this.isDetailInput)return this.isContentItem()&&!this.isNew()&&this.isEmpty()?this.destroy():void 0},e.prototype.isNew=function(){return!!this.item&&null==this.item[this.attribute]},e.prototype.isEmpty=function(){return!!this.item&&!this.item[this.attribute]},e.prototype.destroy=function(){return this.item.destroy()},e.prototype.isContentItem=function(){return this.item instanceof n},e}(),t.exports=o},function(t,e){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e){var r,n,i,o=function(t,e){return function(){return t.apply(e,arguments)}};n=function(t){var e;for(e=[];t;){if(e.push(t),"HTML"===t.tagName)return e.push(document),e.push(window),e;t=t.parentElement}},i=function(t){return new Promise(function(e,n){return e(new r(t))})},r=function(){function t(t){var e,r,n;e=t.anchor,n=t.topOffset,r=t.leftOffset,this.hideOnClickOutside=o(this.hideOnClickOutside,this),this.window=window,this.visible=!1,this.anchor=e[0],this.topOffset=n||0,this.leftOffset=r||0,this.el=document.createElement("div"),this.el.style="position:absolute;top: 0; left: 0; display: none;",document.body.appendChild(this.el)}return t.prototype.append=function(t){return this.el.appendChild(t[0])},t.prototype.hide=function(){return this.visible=!1,this.el.style.display="none",document.removeEventListener("click",this.hideOnClickOutside)},t.prototype.show=function(){return this.visible=!0,this.el.style.display="block",this.position(),setTimeout(function(t){return function(){return document.addEventListener("click",t.hideOnClickOutside)}}(this))},t.prototype.resize=function(){},t.prototype.position=function(){var t,e,r,n,i,o,s,a;return i=(r=this.anchor.getBoundingClientRect()).top,e=r.left,a=(n=this.el.getBoundingClientRect()).width,t=n.height,s=window.innerWidth,o=window.innerHeight,e+=this.leftOffset,i+=this.topOffset,e=Math.max(0,Math.min(s-a,e-a)),i=Math.max(0,Math.min(o-t,i)),this.el.style.left=e+"px",this.el.style.top=i+"px"},t.prototype.hideOnClickOutside=function(t){if(this.visible&&!(t.path||t.composedPath&&t.composedPath()||n(t.target)).includes(this.el))return this.hide()},t.prototype.release=function(){return this.el.parentNode.removeChild(this.el),document.removeEventListener("click",this.hideOnClickOutside)},t}(),t.exports={createPopup:i,Popup:r}},function(t,e,r){var n,i,o=function(t,e){return function(){return t.apply(e,arguments)}},s={}.hasOwnProperty;n=window.require("spine/controller"),i=function(t){function e(){this._close=o(this._close,this),this._remove=o(this._remove,this),this.pop=o(this.pop,this),this.onCancel=o(this.onCancel,this),this.onConfirm=o(this.onConfirm,this),this.close=o(this.close,this),this.cancel=o(this.cancel,this),this.confirm=o(this.confirm,this),e.__super__.constructor.apply(this,arguments),this.render(this)}return function(t,e){for(var r in e)s.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,n),e.prototype.className="popup",e.prototype.template=r(41),e.prototype._confirmBtnClass="confirm-button",e.prototype._cancelBtnClass="cancel-button",e.prototype.events={"click .close":"close","click .confirm-button":"confirm","click .cancel-button":"cancel",keyup:"keyup"},e.prototype.render=function(t){return this.el.html(this.template({confirmBtnClass:[this._confirmBtnClass,t.confirmBtnClass].join(" "),cancelBtnClass:[this._cancelBtnClass,t.cancelBtnClass].join(" "),title:t.title,content:t.content,note:t.note,confirm:t.confirmBtn,cancel:t.cancelBtn,separator:t.separator||!1})),this.item=t,this},e.prototype.keyup=function(t){if(13===t.keyCode)return this.confirm()},e.prototype.confirm=function(){return this._remove()&&this.onConfirm()},e.prototype.cancel=function(){return this._remove()&&this.onCancel()},e.prototype.close=function(){return this._remove()&&this.trigger("canceled")},e.prototype.onConfirm=function(){return this.trigger("confirmed")},e.prototype.onCancel=function(){return this.trigger("canceled")},e.prototype.pop=function(t,e,r){if(this.onConfirm=null!=e?e:this.onConfirm,this.onCancel=null!=r?r:this.onCancel,!this.el.is(":visible"))return t.append(this.el.stop(!0,!0).css({opacity:0}).show().animate({opacity:1},250)),this.el.unbind("click",this._close).bind("click",this._close)},e.prototype._remove=function(){return this.el.stop(!0,!0).animate({opacity:0},250,function(t){return function(){return t.el.hide().detach()}}(this))},e.prototype._close=function(t){if(this.el.is(t.target))return this.close()},e}(),t.exports=i},function(t,e,r){var n,i,o,s=function(t,e){return function(){return t.apply(e,arguments)}},a={}.hasOwnProperty;i=r(43),n=window.require("spine/controller/activateable"),o=function(t){function e(){this.refresh=s(this.refresh,this),this.getPreviewURL=s(this.getPreviewURL,this),e.__super__.constructor.apply(this,arguments),this.update({selected:this.selected}),this.selected&&this.activate(),this.listenTo(this.item,"refresh",this.refresh),this.refresh()}return function(t,e){for(var r in e)a.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.prototype.className="browser-entry",e.include(n),e.prototype.events={"click .browser-entry-prew":"toggle"},e.prototype.update=function(t){return null==t&&(t={}),this.el.toggleClass("active",t.selected)},e.prototype.toggle=function(){var t;if(this.isActive()||null==this.item.onActivate||("function"==typeof(t=this.item).onActivate?t.onActivate():void 0))return this.isActive()?this.deactivate():this.active()},e.prototype.getPreviewURL=function(){if(this.item)return this.getPreview(this.item)},e.prototype.refresh=function(){return this.item.isPrivate?(this.el.addClass("private-entry"),this.el.attr("data-tooltip-text","To use this item, make it public.")):this.el.removeClass("private-entry",this.el.removeAttr("data-tooltip-text"))},e}(),t.exports=o},function(t,e,r){"use strict";function n(){}function i(t){for(var e,r,n=1,i=arguments.length;n<i;n++)for(e in r=arguments[n])t[e]=r[e];return t}function o(t,e){e.appendChild(t)}function s(t,e,r){e.insertBefore(t,r)}function a(t){t.parentNode.removeChild(t)}function u(t,e,r){for(var n=r;n<t.length;n+=1)t[n]&&t[n].destroy(e)}function l(t){return document.createElement(t)}function c(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function p(t){return document.createTextNode(t)}function h(){return document.createComment("")}function d(t,e,r){t.addEventListener(e,r,!1)}function f(t,e,r){t.removeEventListener(e,r,!1)}function g(t,e,r){t.setAttribute(e,r)}function y(t,e,r){t.setAttributeNS("http://www.w3.org/1999/xlink",e,r)}r.d(e,"j",function(){return _}),r.d(e,"k",function(){return v}),r.d(e,"n",function(){return x}),r.d(e,"b",function(){return o}),r.d(e,"l",function(){return s}),r.d(e,"i",function(){return a}),r.d(e,"h",function(){return u}),r.d(e,"e",function(){return l}),r.d(e,"f",function(){return c}),r.d(e,"g",function(){return p}),r.d(e,"d",function(){return h}),r.d(e,"a",function(){return d}),r.d(e,"o",function(){return f}),r.d(e,"p",function(){return g}),r.d(e,"q",function(){return y}),r.d(e,"m",function(){return n}),r.d(e,"c",function(){return i});function _(t,e){return t!==e||t&&"object"==typeof t||"function"==typeof t}function v(t,e,r,n){for(var i in e)if(i in r){var o=r[i],s=n[i];if(_(o,s)){var a=e[i];if(!a)continue;for(var u=0;u<a.length;u+=1){var l=a[u];l.__calling||(l.__calling=!0,l.call(t,o,s),l.__calling=!1)}}}}function m(t){return t?this._state[t]:this._state}function b(t,e){var r=t in this._handlers&&this._handlers[t].slice();if(r)for(var n=0;n<r.length;n+=1)r[n].call(this,e)}function w(t,e,r){var n=r&&r.defer?this._observers.post:this._observers.pre;return(n[t]||(n[t]=[])).push(e),r&&!1===r.init||(e.__calling=!0,e.call(this,this._state[t]),e.__calling=!1),{cancel:function(){var r=n[t].indexOf(e);~r&&n[t].splice(r,1)}}}function E(t,e){if("teardown"===t)return this.on("destroy",e);var r=this._handlers[t]||(this._handlers[t]=[]);return r.push(e),{cancel:function(){var t=r.indexOf(e);~t&&r.splice(t,1)}}}function P(t){this._set(i({},t)),this._root._flush()}function S(){if(this._renderHooks)for(;this._renderHooks.length;)this._renderHooks.pop()()}var x={get:m,fire:b,observe:w,on:E,set:P,_flush:S}},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",i=t||{};return function(t,i){r=r+'<label class="font-item"'+n.attr("data-tag",t.toLowerCase()+" "+i.category,!0,!0)+'><input class="font-family-select" type="radio" name="font-select"'+n.attr("value",t,!0,!0)+'><span class="font-family-text"'+n.attr("style",n.style("font-family: "+t),!0,!0)+">"+n.escape(null==(e=t)?"":e)+"</span></label>"}.call(this,"font"in i?i.font:"undefined"!=typeof font?font:void 0,"fontData"in i?i.fontData:"undefined"!=typeof fontData?fontData:void 0),r}},function(t,e,r){r(0);t.exports=function(t){var e="";return e+='<div class="pixel-based"><div class="currentPositionWrapper"><div class="currentPositioningType"><div class="reference-icon"></div><div class="reference-input"></div></div></div><div class="positionPanel-center"><div class="positionPanelWrapper-visual"><div class="positionPanelWrapper"><div class="dragPanel"><span class="markDown"><div class="mark"></div></span></div></div></div></div><div class="positionFooter"><div class="switch-positioning-type">Switch to Grid Positioning</div></div></div><div class="grid-based"><div class="currentPositionWrapper"><div class="currentPositioningType"><div class="reference-icon"></div><div class="reference-input"></div></div></div><div class="positionPanel-center"><div class="positionPanelWrapper-visual"><div class="position-grid_modifiers"><span class="position-grid_modifier add colP"></span><span class="position-grid_modifier remove colM"></span><span class="position-grid_modifier add rowP"></span><span class="position-grid_modifier remove rowM"></span></div><div class="positionPanelWrapper"><div class="dragPanel"><span class="markDown"><div class="mark"></div></span></div><table class="position-grid"><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr></table></div></div></div><div class="positionFooter"><div class="switch-positioning-type">Switch to Pixel Positioning</div></div></div><div class="reference-panel"><div class="currentPositionWrapper"><div class="currentPositioningType"><div class="reference-input"></div><div class="reference-input_close-btn"></div></div></div><div class="positions input-reference-panel"><div class="centrate-all options"><span class="top left"></span><span class="top center"></span><span class="top right"></span><span class="center left"></span><span class="center center"></span><span class="center right"></span><span class="bottom left"></span><span class="bottom center"></span><span class="bottom right"></span><table class="background"><tr><td></td><td></td></tr><tr><td></td><td></td></tr></table></div></div></div>'}},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",i=t||{};return function(t,i){i.label&&(r=r+'<div class="control-label">'+n.escape(null==(e=i.label)?"":e)+"</div>"),t||(r+='<a class="control-upgrade" href="#">Upgrade to enable</a>'),i.help_text&&(r+='<div class="control-help"></div>'),i.editable&&(r+='<div class="control-edit-btn" data-tooltip-text="Edit this field"><input class="custom-checkbox-input" type="checkbox"><div class="custom-checkbox"></div></div>'),r+='<div class="input-position" tabIndex="0"><div class="input-position-x"><div class="property-label">x</div><div class="control"></div></div><div class="input-position-y"><div class="property-label">y</div><div class="control"></div></div><div class="input-position-panel"></div></div>'}.call(this,"isAccesible"in i?i.isAccesible:"undefined"!=typeof isAccesible?isAccesible:void 0,"options"in i?i.options:"undefined"!=typeof options?options:void 0),r}},function(t,e,r){var n,i,o=function(t,e){return function(){return t.apply(e,arguments)}},s={}.hasOwnProperty;i=r(4),n=function(t){function e(){this.onURL=o(this.onURL,this),this.status=o(this.status,this),this.update=o(this.update,this),e.__super__.constructor.apply(this,arguments),this.deflt={volume:100,onpause:this.status,onresume:this.status,onfinish:this.status,onplay:this.status}}return function(t,e){for(var r in e)s.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.prototype.className="control-audio",e.prototype.template="core/views/audio",e.prototype.elements={input:"input"},e.prototype.type="audio",e.prototype.elements={".url-thumb":"toggleBtn"},e.prototype.events={"click .play-btn,.pause-btn":"toggle"},e.prototype.render=function(){return e.__super__.render.apply(this,arguments),this.toggleBtn.toggle("undefined"!=typeof soundManager&&null!==soundManager),this.delay(function(t){return function(){return t.update(t.item)}}(this)),this},e.prototype.update=function(t,e,r){return null==r&&(r={}),this.input.val(this.lastURL=t[this.attribute]||""),this.onURL(!0,{silent:!0})},e.prototype.onInput=function(t){var r;return e.__super__.onInput.apply(this,arguments),null!=(r=this.sound)&&r.destruct(),this.status()},e.prototype.toggle=function(){var t;return null!=(t=this.sound)?t.togglePause():void 0},e.prototype.status=function(){var t,e;return this.el.toggleClass("playing",!(null!=(t=this.sound)?t.paused:void 0)&&1===(null!=(e=this.sound)?e.playState:void 0))},e.prototype.onURL=function(t){var r,n;return e.__super__.onURL.apply(this,arguments),"undefined"!=typeof soundManager&&null!==soundManager&&t&&(null!=(n=this.lastURL)?n.length:void 0)&&(r=function(t){return function(){return t.sound=soundManager.createSound($.extend({url:t.lastURL},t.deflt))||null}}(this),soundManager.enabled?r():soundManager.onready(r)),t&&!this.item[this.attribute]&&this.$removeClass("valid"),this},e.prototype.release=function(){var t,r;return null!=(t=e.__super__.release.apply(this,arguments))&&null!=(r=t.sound)?r.destruct():void 0},e}(),t.exports=n},function(t,e,r){var n,i,o,s,a,u=function(t,e){return function(){return t.apply(e,arguments)}},l={}.hasOwnProperty;o=window.require("spine/controller"),n=window.require("spine/controller/activateable"),s=r(22),a=r(23),i=function(t){function e(){this.triggerResize=u(this.triggerResize,this),this.years=u(this.years,this),this.months=u(this.months,this),this.calendar=u(this.calendar,this),this.view=u(this.view,this),this.nextView=u(this.nextView,this),this._yearChanged=u(this._yearChanged,this),this._monthChanged=u(this._monthChanged,this),this._change=u(this._change,this),e.__super__.constructor.apply(this,arguments),this.render(),this.input.bind("change",this._change),this.c=-1,this.l=this.views.length,this.nextView()}return function(t,e){for(var r in e)l.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,o),e.prototype.className="calendar",e.include(n),e.prototype.template="core/views/date-time/calendar",e.prototype.elements={".date-input":"input",".datepickr-wrapper":"calendarEl",".date_time-content":"content",".date_time-footer":"footer"},e.prototype.events={"click .datepickr-current-month":"nextView","click .date_time-current":"nextView","change:year":"_yearChanged","change:month":"_monthChanged","click .datepickr-next-month":"triggerResize","click .datepickr-prev-month":"triggerResize"},e.prototype.views=["calendar","months","years"],e.prototype.minYear=1889,e.prototype.maxYear=2189,e.prototype.update=function(t){var e,r,n,i,o,s,a,u;return this.date=t.date,e=(o=this.date.split("-"))[0],i=o[1],e=+e,i--,u=+(u=o[2]),this.datePickr.selectedDate={day:e,month:i,year:u},s=[e,i,u],this.datePickr.currentDayView=s[0],this.datePickr.currentMonthView=s[1],this.datePickr.currentYearView=s[2],this.datePickr.refresh(),this.yearsController.update({year:u}),this.monthsController.update({year:u,month:i}),r=(a=t.time.split(":"))[0],n=a[1],this.footer.html('<span class="hh">'+r+'</span>:<span class="mm">'+n+"</span>")},e.prototype.render=function(){return e.__super__.render.apply(this,arguments),this.datePickr=this.input.datepickr({dateFormat:"j-n-Y",firstDayOfWeek:1})[0],this.content.append((this.monthsController=new s({minYear:this.minYear,maxYear:this.maxYear})).el),this.content.append((this.yearsController=new a({min:this.minYear,max:this.maxYear})).el),this.refreshElements()},e.prototype._change=function(){var t;if((t=this.input.val())!==this.date)return this.el.trigger("change",{date:t})},e.prototype._monthChanged=function(t,e){var r;return r=this.date.replace(/-\d+-\d+$/,"-"+(e.month+1)+"-"+e.year),this.el.trigger("change",{date:r}),this.view("calendar")},e.prototype._yearChanged=function(t,e){var r;return r=this.date.replace(/\d+$/,e.year),this.el.trigger("change",{date:r}),this.view("months")},e.prototype.nextView=function(){return this.view(this.views[(this.c+1)%this.l])},e.prototype.view=function(t){return this.content.children().hide(),this.c=this.views.indexOf(t),this[t](),this.triggerResize()},e.prototype.calendar=function(){return this.calendarEl.show()},e.prototype.months=function(){return this.monthsController.render().show()},e.prototype.years=function(){return this.yearsController.render().show()},e.prototype.triggerResize=function(){return this.el.trigger("resize:popup")},e}(),t.exports=i},function(t,e){var r,n,i=function(t,e){return function(){return t.apply(e,arguments)}},o={}.hasOwnProperty;r=window.require("spine/controller"),n=function(t){function e(){this.prevYear=i(this.prevYear,this),this.nextYear=i(this.nextYear,this),this._change=i(this._change,this),e.__super__.constructor.apply(this,arguments),this.months=$.datepickr.prototype.l10n.months}return function(t,e){for(var r in e)o.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,r),e.prototype.className="months-view",e.prototype.template=window.require("core/views/date-time/grid"),e.prototype.table=window.require("core/views/date-time/table"),e.prototype.elements={".date_time-wrapper table":"tableEl",".date_time-current":"title",".selected":"selected"},e.prototype.events={"click .date_time-next":"nextYear","click .date_time-prev":"prevYear","click .date_time-cell":"_change"},e.prototype.render=function(){return e.__super__.render.apply(this,arguments),this.renderTable(),this.el},e.prototype.renderTable=function(){var t;return t=this.year===this.date.year?this.months.shorthand[this.month]:"",this.tableEl.html(this.table({cols:4,selected:t,data:this.months.shorthand})),this.refreshElements(),this.title.html(""+this.year)},e.prototype.update=function(t){var e;return this.date=t,e=this.date,this.month=e.month,this.year=e.year,this.renderTable()},e.prototype._change=function(t){var e,r;return this.selected.removeClass("selected"),(r=$(t.target)).parent().addClass("selected"),e=this.months.shorthand.indexOf(r.text()),this.el.trigger("change:month",{month:e,year:this.year})},e.prototype.nextYear=function(){return this.renderTable(++this.year)},e.prototype.prevYear=function(){return this.renderTable(--this.year)},e}(),t.exports=n},function(t,e){var r,n,i,o,s=function(t,e){return function(){return t.apply(e,arguments)}},a={}.hasOwnProperty,u=[].indexOf||function(t){for(var e=0,r=this.length;e<r;e++)if(e in this&&this[e]===t)return e;return-1};r=window.require("spine/controller"),o=function(t,e){return t+e},i=function(t,e){return Array.apply(null,{length:e-t}).map(o.call,o.bind(null,t))},n=function(t){function e(){this._change=s(this._change,this),this.update=s(this.update,this),this.prevPage=s(this.prevPage,this),this.nextPage=s(this.nextPage,this),e.__super__.constructor.apply(this,arguments),this.index=this.min}return function(t,e){for(var r in e)a.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,r),e.prototype.className="years-view",e.prototype.template=window.require("core/views/date-time/grid"),e.prototype.table=window.require("core/views/date-time/table"),e.prototype.elements={".date_time-wrapper table":"tableEl",".selected":"selected",".date_time-current":"title"},e.prototype.events={"click .date_time-next":"nextPage","click .date_time-prev":"prevPage","click .date_time-cell":"_change"},e.prototype.years=[],e.prototype.render=function(){return e.__super__.render.apply(this,arguments),this.renderTable(),this.el},e.prototype.renderTable=function(){return this.tableEl.html(this.table({cols:4,selected:this.year,data:this.years=i(this.index,this.index+16)})),this.refreshElements(),this.title.html(this.index+" - "+(this.index+16-1))},e.prototype.nextPage=function(){return this.renderTable(this.index=Math.min(this.max-16,this.index+16))},e.prototype.prevPage=function(){return this.renderTable(this.index=Math.max(this.min,this.index-16))},e.prototype.update=function(t){var e;return this.year=t.year,e=this.year,u.call(this.years,e)<0&&(this.index=this.year),this.renderTable()},e.prototype._change=function(t){var e,r;if(this.selected.removeClass("selected"),(e=$(t.target)).parent().addClass("selected"),(r=e.text())!==this.year)return this.el.trigger("change:year",{year:r})},e}(),t.exports=n},function(t,e){var r,n,i,o=function(t,e){return function(){return t.apply(e,arguments)}},s={}.hasOwnProperty;i=window.require("spine/controller"),r=window.require("spine/controller/activateable"),n=function(t){function e(){this.update=o(this.update,this),this.toggleView=o(this.toggleView,this),this.activate=o(this.activate,this),this.render=o(this.render,this),e.__super__.constructor.apply(this,arguments),this.months=$.datepickr.prototype.l10n.months,this.render()}return function(t,e){for(var r in e)s.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.prototype.className="clock",e.include(r),e.prototype.template=window.require("core/views/date-time/clock"),e.prototype.events={"click .date_time-current":"toggleView","change .clockpicker":"stopPropagation"},e.prototype.elements={".clockpicker":"picker",".clockpicker input":"pickrInput",".date_time-footer":"footer",".hh":"hoursEl",".mm":"minutesEl",".time-elements":"tElem"},e.prototype.hours="00",e.prototype.minutes="00",e.prototype.render=function(){return e.__super__.render.apply(this,arguments)},e.prototype.activate=function(){return r.activate.apply(this,arguments),this.picker.clockpicker({clockUpdate:function(t){return function(e,r){return t[e]=r,t.time=t.hours+":"+t.minutes,t.hoursEl.text(t.hours),t.minutesEl.text(t.minutes)}}(this),afterDone:function(t){return function(){return t.el.trigger("change",{time:t.time})}}(this),afterViewToggle:function(t){return function(e){return t.tElem.removeClass("active"),t[e+"El"].addClass("active")}}(this)})},e.prototype.toggleView=function(){return this.picker.clockpicker("toggleView")},e.prototype.update=function(t){var e,r,n,i;return this.date=t.date,this.time=t.time,r=this.time.split(":"),this.hours=r[0],this.minutes=r[1],this.pickrInput.val(this.time),(n=this.date.split("-"))[0],e=n[1],i=n[2],this.footer.html(this.months.longhand[e-1]+" "+i)},e.prototype.stopPropagation=function(t){return t.stopPropagation(),t.stopImmediatePropagation()},e}(),t.exports=n},function(t,e){var r;t.exports=r={setFormat:function(t){return null==t&&(t="d/m/Y H:i"),r.format.bind(r,t)},parseFrom:function(t,e){var r,n,i,o,s,a,u,l,c,p,h,d;for(c={},a=e.match(RegExp(""+t.replace(/\w+/g,"(\\w+|\\d+)"))).slice(1),i=o=0,s=(p=t.match(/\w+/g)).length;o<s;i=++o)c[p[i]]=a[i];return d=c.Y||c.y||0,l=(c.F||c.m||c.M||c.n||0)-1,r=c.d||c.D||c.j||0,n=c.g||c.G||c.h||c.H||0,u=c.i||0,h=c.s||0,new Date(d,l,r,n,u,h).getTime()},changeFormat:function(t,e,n){var i;return i=r.parseFrom(t,n),r.format(e,i)},format:function(t,e){var r;return null==t&&(t="d/m/Y H:i"),"string"==typeof e&&"Invalid Date"!==new Date(r=Date.parse(e))&&(e=r),"object"==typeof e&&null!=e.date&&null!=e.time&&(e=Date.parse(e.date.split("-").reverse().join("/")+" "+e.time)),$.datepickr.prototype.formatDate(t,e)}}},function(t,e,r){var n,i,o=function(t,e){return function(){return t.apply(e,arguments)}},s={}.hasOwnProperty;i=r(27),n=function(t){function e(){this.toggleViews=o(this.toggleViews,this),this.resize=o(this.resize,this),this.toggle=o(this.toggle,this),this.controllers=[],e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var r in e)s.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.prototype.className="control-popup date-time-popup",e.prototype.template=window.require("core/views/date-time/popup"),e.prototype.popupOptions={topOffset:3},e.prototype.events={change:"_change","resize:popup":"resize","click .date_time-footer":"toggleViews"},e.prototype.elements={".date_time-footer":"footer"},e.prototype.render=function(){var t,n,i,o;for(e.__super__.render.apply(this,arguments),"date"!==this.options.disable&&this.controllers.push(new(r(21))),"time"!==this.options.disable&&this.controllers.push(new(r(24))),n=0,i=(o=this.controllers).length;n<i;n++)t=o[n],this.el.append(t.el);return this.refreshElements(),this.footer.toggle(this.controllers.length>1),this.el.toggleClass("clock","date"===this.options.disable)},e.prototype.toggle=function(){return e.__super__.toggle.apply(this,arguments).then(function(t){return function(){if(setTimeout(t.resize,50),null==t.active)return t.controllers[t.active=0].activate()}}(this))},e.prototype.update=function(t){var e,r,n,i,o;for(this.date=t.date,this.time=t.time,o=[],r=0,n=(i=this.controllers).length;r<n;r++)e=i[r],o.push(e.update(t));return o},e.prototype._change=function(t,e){var r,n;for(r in e)n=e[r],this[r]=n;return this.trigger("change",{date:this.date,time:this.time})},e.prototype.resize=function(){return this.popup.resize()},e.prototype.toggleViews=function(){return this.controllers[this.active].deactivate(),this.controllers[this.active=(this.active+1)%this.controllers.length].activate()},e}(),t.exports=n},function(t,e){var r,n,i=function(t,e){return function(){return t.apply(e,arguments)}},o={}.hasOwnProperty;r=window.require("spine/controller"),n=function(t){function e(){return this.setPopupTargetWindow=i(this.setPopupTargetWindow,this),this.setPopupCSS=i(this.setPopupCSS,this),this.getPopupCSS=i(this.getPopupCSS,this),this.toggle=i(this.toggle,this),this.hide=i(this.hide,this),this.show=i(this.show,this),e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var r in e)o.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,r),e.prototype.document=$(document),e.prototype.window=$(window),e.prototype.show=function(){var t;return null!=(t=this.popup)&&t.show(),setTimeout(function(t){return function(){return t.document.bind("click",t.hide)}}(this))},e.prototype.hide=function(){var t;return null!=(t=this.popup)&&t.hide(),this.document.unbind("click",this.hide)},e.prototype.toggle=function(){return this._createPopup().then(function(t){return function(){return t.popup.visible?t.hide():t.show()}}(this))},e.prototype.release=function(){var t;return e.__super__.release.apply(this,arguments),null!=(t=this.popup)?t.release():void 0},e.prototype._createPopup=function(){return this.popupPromise?this.popupPromise:this.popupPromise=Blogvio.UI.popup.new($.extend({},{anchor:this.anchor,css:this.getPopupCSS(),targetWindow:this.targetWindow},this.popupOptions||{})).then(function(t){return function(e){return t.popup=e,t.popup.append(t.el)}}(this)).fail(function(t){return console.error(t.stack)})},e.prototype.getPopupCSS=function(){return this.css||(this.css=["https://widgetic.com/bundles/blogvioapp/css/editor/editor.css"])},e.prototype.setPopupCSS=function(t){return this.css=t,this},e.prototype.setPopupTargetWindow=function(t){return this.targetWindow=t,this},e}(),t.exports=n},function(t,e,r){var n,i,o=function(t,e){return function(){return t.apply(e,arguments)}},s={}.hasOwnProperty;i=r(4),$("body"),n=function(t){function e(){return this.onInvalidURL=o(this.onInvalidURL,this),this.onValidURL=o(this.onValidURL,this),this.update=o(this.update,this),e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var r in e)s.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.prototype.className="control control-image",e.prototype.template="core/views/image",e.prototype.type="photo",e.prototype.elements={input:"input",".url-thumb":"thumb"},e.prototype.update=function(t,e,r){return null==t&&(t=""),null==r&&(r={}),this.lastURL="string"==typeof t||t instanceof String?t:t[this.attribute]||"",this.input.val(this.lastURL),this.onURL(!0,{silent:!0})},e.prototype.onInput=function(t){return this.thumb.css({backgroundImage:"none"}),e.__super__.onInput.apply(this,arguments)},e.prototype.onValidURL=function(){return e.__super__.onValidURL.apply(this,arguments),this.thumb.attr({"data-tooltip-image":this.lastURL,"data-tooltip-position":"center top"}),this.thumb.toggle(this.lastURL.length>0).css({backgroundImage:"url("+(this.attachedBackground=this.lastURL)+")"})},e.prototype.onInvalidURL=function(){return e.__super__.onInvalidURL.apply(this,arguments),this.attachedBackground=null},e}(),t.exports=n},function(t,e,r){var n,i,o={}.hasOwnProperty;n=r(4),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var r in e)o.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,n),e.prototype.className="control-video",e.prototype.template="core/views/video",e.prototype.elements={input:"input"},e.prototype.type="video",e}(),t.exports=i},function(t,e,r){var n,i,o=function(t,e){return function(){return t.apply(e,arguments)}};i=r(10),n=function(){function t(t,e){this.font=t,this.fontData=e,this.show=o(this.show,this),this.loadFont=o(this.loadFont,this),this.render=o(this.render,this),this.render(),this.source=this.fontData.source,this.el.on("change",'input[type="radio"]',this.loadFont)}return t.prototype.template=r(17),t.prototype.render=function(){return this.el=$(this.template(this))},t.prototype.loadFont=function(){return i.load({families:[this.font],text:this.font,source:this.source},this.el.get(0).ownerDocument.defaultView).then(function(t){return function(){return t.el.addClass("loaded")}}(this))},t.prototype.show=function(){return this.loadFont()},t}(),t.exports=n},function(t,e,r){var n,i,o,s,a,u,l=function(t,e){return function(){return t.apply(e,arguments)}},c={}.hasOwnProperty;n=window.require("spine/controller"),u=r(5),a=r(42),i=r(30),s=r(10),o=function(t){function e(){this.getFontData=l(this.getFontData,this),this.lazyItems=l(this.lazyItems,this),this.whileScrolling=l(this.whileScrolling,this),this.scrollOnOpen=l(this.scrollOnOpen,this),this.ready=l(this.ready,this),this.refresh=l(this.refresh,this),this.render=l(this.render,this),this.clearSearch=l(this.clearSearch,this),this.filter=l(this.filter,this),this.onSearchInput=l(this.onSearchInput,this),this.update=l(this.update,this),this.onInput=l(this.onInput,this),this.fontCtrls={},e.__super__.constructor.apply(this,arguments),this.ready().then(function(t){return function(e){return t.fonts=e,t.refresh(t.render())}}(this))}return function(t,e){for(var r in e)c.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,n),e.include(u),e.include(a),e.prototype.template="core/views/font/fonts-list",e.prototype.className="font-list-wrapper",e.prototype.scrollOptions={},e.prototype.offsetToPreLoad=250,e.prototype.fonts={},e.prototype.fontCtrls={},e.prototype.elements={".search-input":"searchInput",".font-item":"fontItems",".font-list":"scrollContainer",".no-result":"noResult",".clear":"clearBtn"},e.prototype.events={'change input[type="radio"]':"onInput","keyup .search-input":"onSearchInput","click .clear":"clearSearch"},e.prototype.onInput=function(t){var e,r;return(e={})[this.attribute]=r=$(t.target).val(),e.style=this.fonts[r].styles[0],e.source=this.fonts[r].source,e.category=this.fonts[r].category,this.trigger("change",{attributes:e})},e.prototype.update=function(t,e,r){return null==r&&(r={}),this.ready().then(function(e){return function(){return e.el.find('[value="'+t[e.attribute]+'"]').prop("checked",!0),e.selected=e.fonts[t[e.attribute]]}}(this))},e.prototype.onSearchInput=function(){return clearTimeout(this.int),this.int=this.delay(function(t){return function(){return t.filter(t.searchInput.val())}}(this),150)},e.prototype.filter=function(t){var e;return(t=t.toLowerCase().replace(/\ /g,""))?(this.clearBtn.show(),e=this.fontItems.filter(":not([data-tag*="+t+"])").hide().end().filter("[data-tag*="+t+"]").show().length,this.noResult.toggle(!e),this.refresh()):(this.clearBtn.hide(),this.fontItems.show().first().hide(),this.refresh())},e.prototype.clearSearch=function(){return this.searchInput.val(""),this.onSearchInput()},e.prototype.render=function(){var t,r,n,o;for(r in e.__super__.render.apply(this,arguments),this.scrollOptions.documentContext=this.el.get(0).ownerDocument,o=this.fonts)n=o[r],this.scrollContainer.append(((t=this.fontCtrls)[r]||(t[r]=new i(r,n))).el);return this.refreshElements()},e.prototype.refresh=function(){return this.ready().then(function(t){return function(){return t.scroll().update(),t.lazyContainer=t.scrollContainer.find(".scroll-content"),t.lazyLoad()}}(this))},e.prototype.ready=function(){return s.loadFontList()},e.prototype.scrollOnOpen=function(t){return this.refresh(),this.first||this.scroll().scrollTo(t.parent()),this.first=!0},e.prototype.whileScrolling=function(){return this.lazyLoad()},e.prototype.lazyItems=function(){var t,e,r;for(t in r=[],e=this.fonts)e[t],this.fontCtrls[t].el.is(":visible")&&r.push(this.fontCtrls[t]);return r},e.prototype.getFontData=function(t){return this.fonts[t]},e}(),t.exports=o},function(t,e,r){var n,i,o,s,a,u,l=function(t,e){return function(){return t.apply(e,arguments)}},c={}.hasOwnProperty;n=window.require("spine/controller"),o=r(31),i=r(7),a=r(3),u=r(13).createPopup,s=function(t){function e(){this.setPopupTargetWindow=l(this.setPopupTargetWindow,this),this.deactivate=l(this.deactivate,this),this.activate=l(this.activate,this),this.toggle=l(this.toggle,this),this.update=l(this.update,this),this._change=l(this._change,this),e.__super__.constructor.apply(this,arguments),this.el.hide()}return function(t,e){for(var r in e)c.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,n),e.prototype.template="core/views/font/fonts-popup",e.prototype.elements={".font-list-wrapper":"fontListEl",".font-size":"fontSizeEl",".font-weight":"fontWeightEl"},e.prototype.render=function(){var t,r;return e.__super__.render.apply(this,arguments),this.el.toggleClass("no-size-input",this.disableSize),this.fontList=new o({el:this.fontListEl,attribute:"family",options:this.options}),this.fontSizeControl=new a({body:$(this.popup.window.document.body),el:this.fontSizeEl,attribute:"size",options:$.extend({label:"Size"},this.options.size)}),t=(null!=(r=this.options.default)?r.style:void 0)||this.options.style,this.fontWeightControl=new i({el:this.fontWeightEl,attribute:"style",options:{label:"Style",default:t,options:[{label:t,value:t}]}}),this.listenTo(this.fontList,"change",this._change),this.listenTo(this.fontSizeControl,"change:stepper",this._change),this.listenTo(this.fontWeightControl,"change:dropdown",this._change)},e.prototype._change=function(t){return this.trigger("change",t)},e.prototype.update=function(t,e,r){var n;if(null==r&&(r={}),t&&(this.item=t),this.popupPromise&&(this.fontList.update({family:this.item.family},e,r),this.fontSizeControl.update({size:this.item.size},e,r),this.fontList.selected&&this.family!==this.item.family))return n=this.fontList.getFontData(this.family=this.item.family)||{styles:[this.item.style]},this.fontWeightControl.updateOptions({default:n.styles[0],options:n.styles.slice(0,6).map(function(t){return{label:t,value:t}})})},e.prototype._createPopup=function(){return this.popupPromise?this.popupPromise:this.popupPromise=u({anchor:this.popupReference}).then(function(t){return function(e){return t.popup=e,t.el.show(),t.popup.append(t.el),t.render(),t.update(t.item,null,{silent:!0})}}(this)).catch(function(t){return console.error(t)})},e.prototype.toggle=function(){return this._createPopup().then(function(t){return function(){var e;return(null!=(e=t.popup)?e.visible:void 0)?t.deactivate():t.activate()}}(this))},e.prototype.activate=function(){var t;return null!=(t=this.popup)&&t.show(),this.fontList.refresh()},e.prototype.deactivate=function(){var t;return null!=(t=this.popup)?t.hide():void 0},e.prototype.release=function(){var t;return null!=(t=this.popup)&&t.release(),e.__super__.release.apply(this,arguments)},e.prototype.setPopupTargetWindow=function(t){return this.targetWindow=t,this},e}(),t.exports=s},function(t,e,r){var n,i,o,s,a,u=function(t,e){return function(){return t.apply(e,arguments)}},l={}.hasOwnProperty;o=r(6),n=window.require("spine/controller/activateable"),a=$("<tr>"),s=$("<td>"),i=function(t){function e(){this.subRows=u(this.subRows,this),this.addRows=u(this.addRows,this),this.subCols=u(this.subCols,this),this.addCols=u(this.addCols,this),this.updateSelf=u(this.updateSelf,this),this.deactivateCurentCell=u(this.deactivateCurentCell,this),this.activateCell=u(this.activateCell,this),e.__super__.constructor.apply(this,arguments),this.cols=this.rows=3,this.drawTable(this.cols,this.rows)}return function(t,e){for(var r in e)l.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,o),e.include(n),e.prototype.events={"click .position-grid td":"onCellClick","click .colP":"addCols","click .colM":"subCols","click .rowP":"addRows","click .rowM":"subRows"},e.prototype.elements={"table.position-grid":"grid",".position-grid td":"cells",".position-grid tr":"gridRows"},e.prototype.activeCell={},e.prototype.onCellClick=function(t){var e;return this.activeCell={col:(e=$(t.target)).index(),row:e.parent().index()},this.activateCell(e)},e.prototype.activateCell=function(t){var e,r;return this.cells.removeClass("active"),t.addClass("active"),e=t.offset().left-this.offset.left+t.width()/2+1,r=t.offset().top-this.offset.top+t.height()/2+1,e=Math.ceil(this.maxX*e/this.maxWidth),r=Math.ceil(this.maxY*r/this.maxHeight),this.update({x:e,y:r,reference:this.reference}),this.change()},e.prototype.deactivateCurentCell=function(){return this.cells.removeClass("active")},e.prototype.updateSelf=function(t,r){if(null==r&&(r={}),r.from!==this)return e.__super__.updateSelf.apply(this,arguments)&&this.deactivateCurentCell()},e.prototype.drawTable=function(t,e){var r,n,i,o,u,l;for(this.grid.html(""),this.rows=Math.max(1,Math.min(this.rows,10)),this.cols=Math.max(1,Math.min(this.cols,10)),u=a.clone(),r=1,i=this.cols;1<=i?r<=i:r>=i;1<=i?++r:--r)u.append(s.clone());for(n=1,o=this.rows;1<=o?n<=o:n>=o;1<=o?++n:--n)this.grid.append(u.clone());if(this.refreshElements(),(l=this.grid.find("tr:nth("+this.activeCell.row+") td:nth("+this.activeCell.col+")")).length)return this.activateCell(l)},e.prototype.addCols=function(){return this.drawTable(++this.cols,this.rows)},e.prototype.subCols=function(){return this.drawTable(--this.cols,this.rows)},e.prototype.addRows=function(){return this.drawTable(this.cols,++this.rows)},e.prototype.subRows=function(){return this.drawTable(this.cols,--this.rows)},e}(),t.exports=i},function(t,e,r){var n,i,o,s,a,u=function(t,e){return function(){return t.apply(e,arguments)}},l={}.hasOwnProperty;o=r(27),i=r(35),n=r(33),a=r(36),s=function(t){function e(){return this.change=u(this.change,this),this.update=u(this.update,this),this.toggleReference=u(this.toggleReference,this),this.toggleMode=u(this.toggleMode,this),this.refreshGrids=u(this.refreshGrids,this),e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var r in e)l.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,o),e.prototype.template=r(18),e.prototype.className="pixelPositionWrapper",e.prototype.elements={".pixel-based":"pixelPanel",".grid-based":"gridPanel",".reference-panel":"referencePanelEl"},e.prototype.events={"click .switch-positioning-type":"toggleMode",change:"change","click .currentPositionWrapper":"toggleReference"},e.prototype.mods=["pixel","grid"],e.prototype.refreshGrids=function(){return this.pixel.refresh(),this.grid.refresh()},e.prototype.toggleMode=function(){var t;return t=this.pixel.isActive(),this[this.mods[Number(!t)]].deactivate(),this[this.mods[Number(t)]].activate().refresh()},e.prototype.toggleReference=function(){var t;return t=this.referencePanel.isActive(),this.referencePanel[["activate","deactivate"][Number(t)]]()},e.prototype.release=function(){return this.pixel.release(),this.grid.release(),this.referencePanel.release(),e.__super__.release.apply(this,arguments)},e.prototype._createPopup=function(){return e.__super__._createPopup.apply(this,arguments).then(function(t){return function(){return t.pixel.setDocument($(t.popup.document)),t.refreshGrids(),$(t.popup.document.body).bind("mouseenter",t.pixel.mouseEnterBody)}}(this))},e.prototype.render=function(){return e.__super__.render.apply(this,arguments),this.referencePanel=new a({el:this.referencePanelEl}),this.grid=new n({el:this.gridPanel}),(this.pixel=new i({el:this.pixelPanel,x:this.x,y:this.y})).activate()},e.prototype.update=function(){var t,e,r;return(t=this.pixel).update.apply(t,arguments),(e=this.grid).update.apply(e,arguments),(r=this.referencePanel).update.apply(r,arguments)},e.prototype.change=function(t,e){return this.trigger("change",e)},e}(),t.exports=s},function(t,e,r){var n,i,o,s,a=[].slice,u=function(t,e){return function(){return t.apply(e,arguments)}},l={}.hasOwnProperty;i=r(6),n=window.require("spine/controller/activateable"),s=function(t,e){var r;return 0,r=!1,function(){var n;if(n=1<=arguments.length?a.call(arguments,0):[],!r)return r=!0,t.apply(null,n),setTimeout(function(){return r=!1},e)}},o=function(t){function e(){this.mouseEnterBody=u(this.mouseEnterBody,this),this.refresh=u(this.refresh,this),this.dragMove=u(this.dragMove,this),this.startDrag=u(this.startDrag,this),this.stopDrag=u(this.stopDrag,this),e.__super__.constructor.apply(this,arguments),this.dragMove=s(this.dragMove,15),this.dragEvents=this.isTouch?{touchmove:this.dragMove,touchend:this.stopDrag}:{mousemove:this.dragMove,mouseup:this.stopDrag}}return function(t,e){for(var r in e)l.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.include(n),e.prototype.isMouseDown=!1,e.prototype.stopDrag=function(t){return this.isMouseDown=!1,this.document.unbind(this.dragEvents),this.update()},e.prototype.startDrag=function(t){return this.isMouseDown=!0,this.prevent(t),this.dragMove(t),this.document.bind(this.dragEvents)},e.prototype.dragMove=function(t){var e,r;return e=Math.max(0,Math.min(t.pageX-this.offset.left,this.maxWidth)),r=Math.max(0,Math.min(t.pageY-this.offset.top,this.maxHeight)),e=Math.ceil(this.maxX*e/this.maxWidth),r=Math.ceil(this.maxY*r/this.maxHeight),this.update({x:e,y:r,reference:this.reference}),this.change()},e.prototype.refresh=function(){return e.__super__.refresh.apply(this,arguments),this.dragPanel.unbind("mousedown",this.startDrag),this.dragPanel.bind("mousedown",this.startDrag)},e.prototype.mouseEnterBody=function(t){if(this.isMouseDown)return 1!==(t.buttons||t.which)?this.stopDrag(t):void 0},e}(),t.exports=o},function(t,e,r){var n,i,o,s=function(t,e){return function(){return t.apply(e,arguments)}},a={}.hasOwnProperty;i=r(6),n=window.require("spine/controller/activateable"),o=function(t){function e(){return this.update=s(this.update,this),this.selectCurrent=s(this.selectCurrent,this),this._onClick=s(this._onClick,this),e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var r in e)a.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.include(n),e.prototype.events={"click .options span":"_onClick"},e.prototype.elements={".options":"options"},e.prototype._onClick=function(t){var e,r;return r=$(t.target),this.reference={y:(e=r.attr("class").split(" "))[0],x:e[1]},this.change()},e.prototype.selectCurrent=function(){return this.options.find("span[class='"+this.reference.y+" "+this.reference.x+"']").addClass("active").siblings().removeClass("active")},e.prototype.update=function(t,r,n){if(null==n&&(n={}),e.__super__.update.apply(this,arguments),null!=t.reference&&n.from!==this)return this.selectCurrent()},e}(),t.exports=o},,,function(t,e,r){var n,i;n=r(47),i=r(48),t.exports=function(t,e){var r,o;if(!t)return!0;try{return i.apply(t,e)}catch(t){}for(r in t)if(o=t[r],n(e,r.replace(/:/g,"."))!==o)return!1;return!0}},function(t,e,r){r(0);t.exports=function(t){var e="";return e+='<div class="skin-header"><div class="default"><span class="title">select a theme</span></div><div class="toggle-skin-edit-wrapper"><div class="toggle-skin-edit"><div class="content"><div class="back">Back</div><div class="edit">Edit Theme</div></div></div></div></div>'}},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",i=t||{};return function(t,i,o,s,a,u,l,c,p){r=r+'<div class="popup-wrapper"><div class="popup-inner"><div class="popup-header"><div class="popup-title">'+n.escape(null==(e=p)?"":e)+'</div><div class="close" data-icon="x"></div></div><div class="popup-content">'+(null==(e=u)?"":e),s&&(t=a||"green-button button--uc",r=r+"<div"+n.attr("class",n.classes(["confirm-button",t],[!1,!0]),!1,!0)+">"+n.escape(null==(e=s)?"":e)+"</div>"),c&&(r+='<div class="popup-content-separator"></div>'),i&&(t=o||"dim-button button--uc",r=r+"<div"+n.attr("class",n.classes(["cancel-button",t],[!1,!0]),!1,!0)+">"+n.escape(null==(e=i)?"":e)+"</div>"),l&&(r=r+"<label>"+n.escape(null==(e=l)?"":e)+"</label>"),r+="</div></div></div>"}.call(this,"c"in i?i.c:"undefined"!=typeof c?c:void 0,"cancel"in i?i.cancel:"undefined"!=typeof cancel?cancel:void 0,"cancelBtnClass"in i?i.cancelBtnClass:"undefined"!=typeof cancelBtnClass?cancelBtnClass:void 0,"confirm"in i?i.confirm:"undefined"!=typeof confirm?confirm:void 0,"confirmBtnClass"in i?i.confirmBtnClass:"undefined"!=typeof confirmBtnClass?confirmBtnClass:void 0,"content"in i?i.content:"undefined"!=typeof content?content:void 0,"note"in i?i.note:"undefined"!=typeof note?note:void 0,"separator"in i?i.separator:"undefined"!=typeof separator?separator:void 0,"title"in i?i.title:"undefined"!=typeof title?title:void 0),r}},function(t,e){var r;r={lazyLoad:function(){return clearTimeout(this.loadTimeout),this.loadTimeout=setTimeout(function(t){return function(){var e,r,n,i,o,s,a,u,l,c;for(c=(i=t.el.offset().top)-(t.offsetToPreLoad||150),e=i+t.el.height()+(t.offsetToPreLoad||150),l=[],o=s=0,u=(a=("function"==typeof t.lazyItems?t.lazyItems():void 0)||("function"==typeof t.children?t.children():void 0)||[]).length;s<u;o=++s)(n=(r=a[o]).el.offset().top)>c&&n<e?l.push("function"==typeof r.show?r.show():void 0):l.push(void 0);return l}}(this),50)}},t.exports=r},function(t,e){var r,n,i=function(t,e){return function(){return t.apply(e,arguments)}},o={}.hasOwnProperty;r=window.require("spine/controller"),n=function(t){function e(){var t,r;this.show=i(this.show,this),e.__super__.constructor.apply(this,arguments),t=(null!=(r=this.item.name)?r.replace(/\.[a-zA-Z]{3,4}$/,""):void 0)||"No Title",this.preview=$('<div class="browser-entry-prew"><span class="browser-entry-icon"></span></div>'),this.info=$('<div class="browser-entry-info">'+t+"</div>"),this.el.append(this.preview,this.info)}return function(t,e){for(var r in e)o.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,r),e.prototype.tag="span",e.prototype.className="browser-entry",e.prototype.show=function(){var t;return"function"==typeof(t=this.item).onShow?t.onShow():void 0},e}(),t.exports=n},,,function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,r){(function(e){var r="Expected a function",n="__lodash_hash_undefined__",i=1/0,o="[object Function]",s="[object GeneratorFunction]",a="[object Symbol]",u=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,l=/^\w*$/,c=/^\./,p=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,h=/\\(\\)?/g,d=/^\[object .+?Constructor\]$/,f="object"==typeof e&&e&&e.Object===Object&&e,g="object"==typeof self&&self&&self.Object===Object&&self,y=f||g||Function("return this")();var _=Array.prototype,v=Function.prototype,m=Object.prototype,b=y["__core-js_shared__"],w=function(){var t=/[^.]+$/.exec(b&&b.keys&&b.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),E=v.toString,P=m.hasOwnProperty,S=m.toString,x=RegExp("^"+E.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),k=y.Symbol,A=_.splice,O=j(y,"Map"),T=j(Object,"create"),R=k?k.prototype:void 0,C=R?R.toString:void 0;function I(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function M(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function D(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function L(t,e){for(var r=t.length;r--;)if(H(t[r][0],e))return r;return-1}function U(t,e){for(var r=0,n=(e=function(t,e){if(V(t))return!1;var r=typeof t;if("number"==r||"symbol"==r||"boolean"==r||null==t||G(t))return!0;return l.test(t)||!u.test(t)||null!=e&&t in Object(e)}(e,t)?[e]:function(t){return V(t)?t:B(t)}(e)).length;null!=t&&r<n;)t=t[z(e[r++])];return r&&r==n?t:void 0}function F(t){return!(!W(t)||function(t){return!!w&&w in t}(t))&&(function(t){var e=W(t)?S.call(t):"";return e==o||e==s}(t)||function(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}(t)?x:d).test(function(t){if(null!=t){try{return E.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function N(t,e){var r=t.__data__;return function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}(e)?r["string"==typeof e?"string":"hash"]:r.map}function j(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return F(r)?r:void 0}I.prototype.clear=function(){this.__data__=T?T(null):{}},I.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},I.prototype.get=function(t){var e=this.__data__;if(T){var r=e[t];return r===n?void 0:r}return P.call(e,t)?e[t]:void 0},I.prototype.has=function(t){var e=this.__data__;return T?void 0!==e[t]:P.call(e,t)},I.prototype.set=function(t,e){return this.__data__[t]=T&&void 0===e?n:e,this},M.prototype.clear=function(){this.__data__=[]},M.prototype.delete=function(t){var e=this.__data__,r=L(e,t);return!(r<0||(r==e.length-1?e.pop():A.call(e,r,1),0))},M.prototype.get=function(t){var e=this.__data__,r=L(e,t);return r<0?void 0:e[r][1]},M.prototype.has=function(t){return L(this.__data__,t)>-1},M.prototype.set=function(t,e){var r=this.__data__,n=L(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},D.prototype.clear=function(){this.__data__={hash:new I,map:new(O||M),string:new I}},D.prototype.delete=function(t){return N(this,t).delete(t)},D.prototype.get=function(t){return N(this,t).get(t)},D.prototype.has=function(t){return N(this,t).has(t)},D.prototype.set=function(t,e){return N(this,t).set(t,e),this};var B=q(function(t){t=function(t){return null==t?"":function(t){if("string"==typeof t)return t;if(G(t))return C?C.call(t):"";var e=t+"";return"0"==e&&1/t==-i?"-0":e}(t)}(t);var e=[];return c.test(t)&&e.push(""),t.replace(p,function(t,r,n,i){e.push(n?i.replace(h,"$1"):r||t)}),e});function z(t){if("string"==typeof t||G(t))return t;var e=t+"";return"0"==e&&1/t==-i?"-0":e}function q(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new TypeError(r);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=t.apply(this,r);return n.cache=o.set(i,s),s};return n.cache=new(q.Cache||D),n}function H(t,e){return t===e||t!=t&&e!=e}q.Cache=D;var V=Array.isArray;function W(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function G(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&S.call(t)==a}t.exports=function(t,e,r){var n=null==t?void 0:U(t,e);return void 0===n?r:n}}).call(e,r(12))},function(t,e,r){var n,i;!function(o,s){void 0===(i="function"==typeof(n=s)?n.call(e,r,e,t):n)||(t.exports=i)}(0,function(){"use strict";Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)});var t={},e={"==":function(t,e){return t==e},"===":function(t,e){return t===e},"!=":function(t,e){return t!=e},"!==":function(t,e){return t!==e},">":function(t,e){return t>e},">=":function(t,e){return t>=e},"<":function(t,e,r){return void 0===r?t<e:t<e&&e<r},"<=":function(t,e,r){return void 0===r?t<=e:t<=e&&e<=r},"!!":function(e){return t.truthy(e)},"!":function(e){return!t.truthy(e)},"%":function(t,e){return t%e},log:function(t){return console.log(t),t},in:function(t,e){return!(!e||void 0===e.indexOf)&&-1!==e.indexOf(t)},cat:function(){return Array.prototype.join.call(arguments,"")},substr:function(t,e,r){if(r<0){var n=String(t).substr(e);return n.substr(0,n.length+r)}return String(t).substr(e,r)},"+":function(){return Array.prototype.reduce.call(arguments,function(t,e){return parseFloat(t,10)+parseFloat(e,10)},0)},"*":function(){return Array.prototype.reduce.call(arguments,function(t,e){return parseFloat(t,10)*parseFloat(e,10)})},"-":function(t,e){return void 0===e?-t:t-e},"/":function(t,e){return t/e},min:function(){return Math.min.apply(this,arguments)},max:function(){return Math.max.apply(this,arguments)},merge:function(){return Array.prototype.reduce.call(arguments,function(t,e){return t.concat(e)},[])},var:function(t,e){var r=void 0===e?null:e,n=this;if(void 0===t||""===t||null===t)return n;for(var i=String(t).split("."),o=0;o<i.length;o++){if(null===n)return r;if(void 0===(n=n[i[o]]))return r}return n},missing:function(){for(var e=[],r=Array.isArray(arguments[0])?arguments[0]:arguments,n=0;n<r.length;n++){var i=r[n],o=t.apply({var:i},this);null!==o&&""!==o||e.push(i)}return e},missing_some:function(e,r){var n=t.apply({missing:r},this);return r.length-n.length>=e?[]:n},method:function(t,e,r){return t[e].apply(t,r)}};return t.is_logic=function(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)&&1===Object.keys(t).length},t.truthy=function(t){return(!Array.isArray(t)||0!==t.length)&&!!t},t.get_operator=function(t){return Object.keys(t)[0]},t.get_values=function(e){return e[t.get_operator(e)]},t.apply=function(r,n){if(Array.isArray(r))return r.map(function(e){return t.apply(e,n)});if(!t.is_logic(r))return r;n=n||{};var i,o,s,a,u,l=t.get_operator(r),c=r[l];if(Array.isArray(c)||(c=[c]),"if"===l||"?:"==l){for(i=0;i<c.length-1;i+=2)if(t.truthy(t.apply(c[i],n)))return t.apply(c[i+1],n);return c.length===i+1?t.apply(c[i],n):null}if("and"===l){for(i=0;i<c.length;i+=1)if(o=t.apply(c[i],n),!t.truthy(o))return o;return o}if("or"===l){for(i=0;i<c.length;i+=1)if(o=t.apply(c[i],n),t.truthy(o))return o;return o}if("filter"===l)return a=t.apply(c[0],n),s=c[1],Array.isArray(a)?a.filter(function(e){return t.truthy(t.apply(s,e))}):[];if("map"===l)return a=t.apply(c[0],n),s=c[1],Array.isArray(a)?a.map(function(e){return t.apply(s,e)}):[];if("reduce"===l)return a=t.apply(c[0],n),s=c[1],u=void 0!==c[2]?c[2]:null,Array.isArray(a)?a.reduce(function(e,r){return t.apply(s,{current:r,accumulator:e})},u):u;if("all"===l){if(a=t.apply(c[0],n),s=c[1],!a.length)return!1;for(i=0;i<a.length;i+=1)if(!t.truthy(t.apply(s,a[i])))return!1;return!0}if("none"===l)return 0===t.apply({filter:c},n).length;if("some"===l)return t.apply({filter:c},n).length>0;if(c=c.map(function(e){return t.apply(e,n)}),"function"==typeof e[l])return e[l].apply(n,c);if(l.indexOf(".")>0){var p=String(l).split("."),h=e;for(i=0;i<p.length;i++)if(void 0===(h=h[p[i]]))throw new Error("Unrecognized operation "+l+" (failed at "+p.slice(0,i+1).join(".")+")");return h.apply(n,c)}throw new Error("Unrecognized operation "+l)},t.uses_data=function(e){var r=[];if(t.is_logic(e)){var n=t.get_operator(e),i=e[n];Array.isArray(i)||(i=[i]),"var"===n?r.push(i[0]):i.map(function(e){r.push.apply(r,t.uses_data(e))})}return function(t){for(var e=[],r=0,n=t.length;r<n;r++)-1===e.indexOf(t[r])&&e.push(t[r]);return e}(r)},t.add_operation=function(t,r){e[t]=r},t.rm_operation=function(t){delete e[t]},t.rule_like=function(e,r){if(r===e)return!0;if("@"===r)return!0;if("number"===r)return"number"==typeof e;if("string"===r)return"string"==typeof e;if("array"===r)return Array.isArray(e)&&!t.is_logic(e);if(t.is_logic(r)){if(t.is_logic(e)){var n=t.get_operator(r),i=t.get_operator(e);if("@"===n||n===i)return t.rule_like(t.get_values(e,!1),t.get_values(r,!1))}return!1}if(Array.isArray(r)){if(Array.isArray(e)){if(r.length!==e.length)return!1;for(var o=0;o<r.length;o+=1)if(!t.rule_like(e[o],r[o]))return!1;return!0}return!1}return!1},t})},function(t,e){},function(t,e,r){var n,i,o,s,a,u,l,c,p,h=function(t,e){return function(){return t.apply(e,arguments)}},d={}.hasOwnProperty;s=window.require("spine/controller"),n=window.require("spine/controller/activateable"),o=window.require("spine/controller/container"),p=r(5),l=r(42),r(43),c=r(51),u=function(t){var e;return e="",(t.colors||t.icon||t.connectButton)&&(e='<div class="before" style="background: '+t.colors.dark+" url('"+t.icon+'\')"></div>\x3c!--\n\t\t --\x3e<div class="after" style="background: '+t.colors.light+'">'+t.connectButton.label+"</div>"),'<div class="browser-login">\n\t<div class="browser-login-cont">\n\t\t<div class="browser-login-message">add content from your account</div>\n\t\t<div class="browser-login-button" data-content="'+!!e+'">'+e+'</div>\n\t</div>\n</div>"'},a={folder:r(52),button:r(107),image:r(108),audio:r(109),video:r(110),rss:r(111)},i=function(t){function e(){this._requestAuth=h(this._requestAuth,this),this.getContentItemsInFolder=h(this.getContentItemsInFolder,this),this.whileScrolling=h(this.whileScrolling,this),this.getOptions=h(this.getOptions,this),this._deactivate=h(this._deactivate,this),this._activate=h(this._activate,this),this._release=h(this._release,this),this._active=h(this._active,this),this.onFolderRefresh=h(this.onFolderRefresh,this),this.updateCurrentCount=h(this.updateCurrentCount,this),this.refreshChildren=h(this.refreshChildren,this),this.setFolder=h(this.setFolder,this),this.onLogout=h(this.onLogout,this),this.onAuth=h(this.onAuth,this),this.deactivate=h(this.deactivate,this),e.__super__.constructor.apply(this,arguments),this.service=new this.Service(this.title,this.options),this.serviceTitle||(this.serviceTitle=this.service.title),this.currentContent=[],this.addNavBar(),this.intent=$(u(this.service.options)),this.el.addClass(this.title),this.el.attr("data-filetype",this.options.types[0]),this.on("activate",this.auth).listenTo(this.service,"auth",this.onAuth),this.listenTo(this.nav,"select",this.setFolder),this.listenTo(this.nav,"logout",this.onLogout),this.listenTo(this.service,"refresh",this.onFolderRefresh),this.listenTo(this.service,"auth-req",this._requestAuth),this.$bind("getURL",function(t){return function(e,r){return t.service.getURL($(e.target).controller().item,r)}}(this))}return function(t,e){for(var r in e)d.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,s),e.prototype.className="browser",e.include(o),e.include(n),e.include(p),e.include(l),e.prototype.scrollOptions={},e.prototype.events={"click .browser-login-button":"auth"},e.prototype.addNavBar=function(){return this.nav=new c({disconnectBtn:!this.service.hideDisconnectBtn})},e.prototype.active=function(){return n.active.apply(this,arguments),this.scrollOptions.documentContext=this.el.get(0).ownerDocument,this.scroll(),this.el.append(this.nav.el,this.intent),null!=this.service.faqLink&&this.el.append(this.service.faqLink),this.refreshChildren(),this.delay(function(t){return function(){return t.$trigger("editor:browser:active",{service:t.Service.name,authenticated:!0===t.authenticated&&t.nav.el.is(":visible")})}}(this))},e.prototype.deactivate=function(){return n.deactivate.apply(this,arguments),this.refreshChildren()},e.prototype.auth=function(t){if("true"!==String(this.el.attr("authenticated")))return this.service.auth("click"===(null!=t?t.type:void 0))},e.prototype.onAuth=function(t){return this.authenticated=t,this.currentContent=[],this.authenticated?this.updateCurrentCount():this.tab.count(0),this.el.attr({authenticated:this.authenticated}),this.authenticated&&this.setFolder(this.service.root),this.$trigger("editor:browser:auth",{service:this.Service.name,authenticated:!0===this.authenticated})},e.prototype.onLogout=function(){return this.service.deauth(),this.refreshChildren(),this.currentFolder=null},e.prototype.setFolder=function(t){var e;return(null!=(e=this.currentFolder)?e.path:void 0)===t.path||this.nav.addItem(t),t.children=[],this.currentFolder=t,this.empty().$addClass("loading"),this.service.refresh(t),this},e.prototype.refreshChildren=function(){return this.children(function(t){return"function"==typeof t.refresh?t.refresh():void 0})},e.prototype.refresh=function(){if(!this.refreshing)return this.refreshing=!0,this.currentFolder?this.setFolder(this.currentFolder):void 0},e.prototype.updateCurrentCount=function(){return this.tab.count(this.content.filter(function(t){return function(e){return t.currentContent.some(function(t){return e.id===t.id})}}(this)).length)},e.prototype.onFolderRefresh=function(t,e){var r,n,i,o,s,u,l;for(null==e&&(e={}),e.root&&(u=[],l=[],t.map(function(t){return function(e){return"folder"===e.type?l=l.concat(e.children.map(function(r){return t.service.newEntry("audio",r,e.id)})):u.push(e)}}(this)),l.length&&!this.currentContent.length&&(this.currentContent=this.currentContent.concat(l)),u.length&&(t=u=u.filter(function(t){return function(e){return!t.currentContent.some(function(t){return t.id===e.id})}}(this)),this.currentContent=this.currentContent.concat(u)),this.updateCurrentCount()),e.hard&&this.empty().$addClass("loading"),this.refreshing=!1,this.$removeClass("loading"),this.currentFolder.children=this.currentFolder.children.concat(t),this.el.toggleClass("no-items",!t.length&&!this.children().length),o=0,s=t.length;o<s;o++)i=t[o],/^\.[^\.]/.test(i.name)||(e={item:i,getPreview:function(t){return function(e){return t.service.preview(e)}}(this),getURL:function(t){return function(e,r){return t.service.getURL(e,r)}}(this),count:(n="folder"===i.type)?this.getContentItemsInFolder(i):void 0,selected:n?void 0:!!this.content.filter(function(t){return t.path===i.path}).length},r=new a[i.type](e),this.append(r),"folder"===i.type&&this.listenTo(r,"select",this.setFolder));return this.scroll().update(),this.lazyLoad()},e.prototype.afterAdd=function(t){return o.afterAdd.call(this,t),this.listenTo(t,"active",this._active),this.listenTo(t,"activate",this._activate),this.listenTo(t,"deactivate",this._deactivate),t},e.prototype._active=function(t,e){return null==e&&(e={}),this.trigger("canAdd",function(){return t.activate(e)})},e.prototype._release=function(){var t;return t=o._release.apply(this,arguments),this.stopListening(t),t},e.prototype._activate=function(t,e){var r;return this.addEntry(r=t.item),r.service=this.title,r.active=!0,r.getURLPromise=this.service.getURL(r,function(t){return function(e){return function(n){if(r.active&&r.stat===e)return r.url=n,t.trigger("add",r)}}}(this)(++r.stat))},e.prototype._deactivate=function(t,e){return t.item.active=!1,this.removeEntry(t.item),this.trigger("remove",t.item)},e.prototype.empty=function(){var t,e,r;for(t=0,e=(r=this.children()).length;t<e;t++)r[t].release();return this.scroll().update(),this},e.prototype.addEntry=function(t){var e,r,n,i,o;for(n=0,i=(o=this.content).length;n<i;n++)(e=o[n]).path===t.path&&(r=e);if(-1===this.content.indexOf(r))return this.content.push(t),this.updateCurrentCount()},e.prototype.removeEntry=function(t){var e,r,n,i,o,s,a,u,l,c,p;for(i=0,s=(u=this.content).length;i<s;i++)(r=u[i]).path===t.path&&(n=r);for(this.content.splice(this.content.indexOf(n),1),this.updateCurrentCount(),p=[],o=0,a=(l=this.children()).length;o<a;o++)("folder"===(c=(e=l[o]).item.type)||"button"===c||("function"==typeof e.isActive?e.isActive():void 0))&&p.push(e.update(this.getOptions(e.item)));return p},e.prototype.recount=function(){var t,e,r,n,i;for(i=[],e=0,r=(n=this.children()).length;e<r;e++)t=n[e],i.push(t.update(this.getOptions(t.item)));return i},e.prototype.getOptions=function(t){var e;return{count:(e="folder"===t.type)?this.content.filter(function(e){return!e.path.indexOf(t.path)}).length:void 0,selected:e?void 0:!!this.content.filter(function(e){return e.path===t.path}).length}},e.prototype.whileScrolling=function(){return this.lazyLoad()},e.prototype.getContentItemsInFolder=function(t){var e;return e=t.path.toLowerCase()+"/",this.content.filter(function(t){return 0===t.path.toLowerCase().indexOf(e)}).length},e.prototype._requestAuth=function(t){return this.$trigger("content:auth-req",t)},e}(),t.exports=i},function(t,e,r){var n,i,o,s,a,u,l=function(t,e){for(var r in e)c.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},c={}.hasOwnProperty;o=window.require("spine/controller"),i=window.require("spine/controller/activator"),n=window.require("spine/controller/activateable"),u=r(14),$("body"),a=function(t){function e(t){e.__super__.constructor.apply(this,arguments),this.item.root?this.el.attr("title",this.item.navTitle).addClass("root"):this.el.html(this.item.name),this.$bind("click",function(t){return function(){if(!t.isActive())return t.parent().trigger("select",t.item),t.active().el.nextAll().each(function(t,e){return $(e).controller().release()})}}(this))}return l(e,o),e.prototype.className="browser-nav-item",e.include(n),e}(),s=function(t){function e(){e.__super__.constructor.apply(this,arguments),this.disconnectBtn&&(this.popup=new u({title:"Sure about disconnecting?",confirmBtn:"Yes, Disconnect",cancelBtn:"Cancel",confirmBtnClass:"green-button button--uc no-icons",cancelBtnClass:"dim-button button--uc no-icons"}),this.append(this.logout=$("<div class='browser-logout' title='Disconnect from server' data-icon='↯'></div>")),this.logout.bind("click",function(t){return function(e){return e.stopPropagation(),t.popup.pop(t.el.closest("body"),function(){return t.$trigger("logout").trigger("logout"),t.children(function(t){return t.release()})})}}(this)))}return l(e,i),e.prototype.className="browser-nav",e.prototype.addItem=function(t){var e;return this.children(function(e){if(!e.item.root&&!RegExp("^"+e.item.path.replace(/\//gi,"/")+"(\\/|$)").test(t.path))return e.release()}),this.append(e=new a({item:t})),e.active()},e}(),t.exports=s},function(t,e,r){var n,i,o={}.hasOwnProperty;n=r(43),i=function(t){function e(){e.__super__.constructor.apply(this,arguments),this.update({count:this.count})}return function(t,e){for(var r in e)o.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,n),e.prototype.className="browser-folder",e.prototype.events={click:"click"},e.prototype.update=function(t){return null==t&&(t={}),this.el.attr("data-count",t.count||0)},e.prototype.click=function(){return this.trigger("select",this.item)},e}(),t.exports=i},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(113);e.default=n.default.instance},function(t,e,r){"use strict";e.a=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}},function(t,e,r){"use strict";var n=r(56),i=r.n(n),o=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}();e.a=function(t){return function(e){function r(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(r,t),o(r,[{key:"events",get:function(){return this._events},set:function(t){this._broadcast={},this._events={};var e=!0,r=!1,n=void 0;try{for(var o,s=t[Symbol.iterator]();!(e=(o=s.next()).done);e=!0){var a=o.value,u=new i.a;this._events[a]=u.listen,this._broadcast[a]=u.broadcast}}catch(t){r=!0,n=t}finally{try{!e&&s.return&&s.return()}finally{if(r)throw n}}}}]),r}()}},function(t,e){t.exports=function(){var t=[];return{broadcast:function(e){for(var r=t.slice(),n=0;n<r.length;n++)r[n].deleted||r[n].fn(e)},listen:function(e){return t.push(new function(t){this.fn=t,this.deleted=!1}(e)),function(){for(var r=0;r<t.length;r++)if(t[r].fn===e){t[r].deleted=!0,t.splice(r,1);break}}}}}},function(t,e,r){"use strict";var n=r(53),i=r(16);function o(t,e,r,n){(n||"service"in e&&i.j(t.service,r.service))&&(t.instance=e.instance=s.computed.instance(t.service))}var s={data:function(){return{service:null}},computed:{instance:function(t){return n.default[t]}},oncreate:function(){this._unsubscribes=[],this._proxiedProperties=[],this.observer=this.observe("instance",this._subscribe.bind(this))},ondestroy:function(){this._unsubscribe(),this.observer.cancel()},methods:{instance:function(){return this.get("instance")},_subscribe:function(t){var e=this;this._unsubscribe();var r=function(r){e._unsubscribes.push(t.events[r](function(t){e.fire(r,t)}))};for(var n in t.events)r(n)},_unsubscribe:function(){this._unsubscribes.forEach(function(t){return t()}),this._unsubscribes=[]}}};function a(t){t=t||{},this._state=i.c(s.data(),t.data),o(this._state,this._state,{},!0),this._observers={pre:Object.create(null),post:Object.create(null)},this._handlers=Object.create(null),this._root=t._root||this,this._yield=t._yield,this._torndown=!1,this._fragment=(this._state,{create:i.m,mount:i.m,unmount:i.m,destroy:i.m}),t.target&&(this._fragment.create(),this._fragment.mount(t.target,null)),t._root?t._root._renderHooks.push(s.oncreate.bind(this)):s.oncreate.call(this)}i.c(a.prototype,s.methods,i.n),a.prototype._set=function(t){var e=this._state;this._state=i.c({},e,t),o(this._state,t,e,!1),i.k(this,this._observers.pre,t,e),i.k(this,this._observers.post,t,e)},a.prototype.teardown=a.prototype.destroy=function(t){this.fire("destroy"),s.ondestroy.call(this),!1!==t&&this._fragment.unmount(),this._fragment.destroy(),this._fragment=null,this._state={},this._torndown=!0},e.a=a},function(t,e,r){var n={"./core/views/audio-details.pug":59,"./core/views/audio.pug":60,"./core/views/browser.pug":61,"./core/views/color.pug":62,"./core/views/date-time/calendar.pug":63,"./core/views/date-time/clock.pug":64,"./core/views/date-time/grid.pug":65,"./core/views/date-time/input.pug":66,"./core/views/date-time/popup.pug":67,"./core/views/date-time/table.pug":68,"./core/views/dropdown.pug":69,"./core/views/font/font-item.pug":17,"./core/views/font/fonts-list.pug":70,"./core/views/font/fonts-popup.pug":71,"./core/views/font/index.pug":72,"./core/views/image-details.pug":73,"./core/views/image.pug":74,"./core/views/input-layout.pug":75,"./core/views/order-items.pug":76,"./core/views/order-picker.pug":77,"./core/views/pixelpanel.pug":18,"./core/views/position.pug":19,"./core/views/range.pug":78,"./core/views/scale.pug":79,"./core/views/slider.pug":80,"./core/views/stepper.pug":81,"./core/views/text.pug":82,"./core/views/textarea.pug":83,"./core/views/toggle.pug":84,"./core/views/video-details.pug":85,"./core/views/video.pug":86,"./editor/views/embed.pug":87,"./editor/views/loginbutton.pug":88,"./editor/views/popup.pug":41,"./editor/views/presets.pug":89,"./editor/views/presetslist-header.pug":40,"./editor/views/skinitem.pug":90};function i(t){return r(o(t))}function o(t){var e=n[t];if(!(e+1))throw new Error("Cannot find module '"+t+"'.");return e}i.keys=function(){return Object.keys(n)},i.resolve=o,t.exports=i,i.id=58},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",i=t||{};return function(t,i){i.label&&(r=r+'<div class="control-label">'+n.escape(null==(e=i.label)?"":e)+"</div>"),t||(r+='<a class="control-upgrade" href="#">Upgrade to enable</a>'),i.help_text&&(r+='<div class="control-help"></div>'),i.editable&&(r+='<div class="control-edit-btn" data-tooltip-text="Edit this field"><input class="custom-checkbox-input" type="checkbox"><div class="custom-checkbox"></div></div>'),r=r+'<div class="input-audio"><span class="icon"></span><div class="audio-title"></div><input class="control-input input-text" type="text"'+n.attr("placeholder",i.placeholder,!0,!0)+n.attr("readonly",i.readonly,!0,!0)+' autocorrect="off" autocapitalize="off"><div class="url-thumb"><div class="play-btn" data-icon="►"></div><div class="pause-btn" data-icon="▮"></div></div></div>'}.call(this,"isAccesible"in i?i.isAccesible:"undefined"!=typeof isAccesible?isAccesible:void 0,"options"in i?i.options:"undefined"!=typeof options?options:void 0),r}},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",i=t||{};return function(t,i){i.label&&(r=r+'<div class="control-label">'+n.escape(null==(e=i.label)?"":e)+"</div>"),t||(r+='<a class="control-upgrade" href="#">Upgrade to enable</a>'),i.help_text&&(r+='<div class="control-help"></div>'),i.editable&&(r+='<div class="control-edit-btn" data-tooltip-text="Edit this field"><input class="custom-checkbox-input" type="checkbox"><div class="custom-checkbox"></div></div>'),r=r+'<div class="input-audio"><input class="control-input input-text" type="text"'+n.attr("placeholder",i.placeholder,!0,!0)+n.attr("readonly",i.readonly,!0,!0)+' autocorrect="off" autocapitalize="off"><div class="url-thumb"><div class="play-btn" data-icon="►"></div><div class="pause-btn" data-icon="▮"></div></div></div>'}.call(this,"isAccesible"in i?i.isAccesible:"undefined"!=typeof isAccesible?isAccesible:void 0,"options"in i?i.options:"undefined"!=typeof options?options:void 0),r}},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",i=t||{};return function(t,i){i.label&&(r=r+'<div class="control-label">'+n.escape(null==(e=i.label)?"":e)+"</div>"),t||(r+='<a class="control-upgrade" href="#">Upgrade to enable</a>'),i.help_text&&(r+='<div class="control-help"></div>'),i.editable&&(r+='<div class="control-edit-btn" data-tooltip-text="Edit this field"><input class="custom-checkbox-input" type="checkbox"><div class="custom-checkbox"></div></div>'),r+='<div class="input-browser"><div class="input-browser-browse"></div></div>'}.call(this,"isAccesible"in i?i.isAccesible:"undefined"!=typeof isAccesible?isAccesible:void 0,"options"in i?i.options:"undefined"!=typeof options?options:void 0),r}},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",i=t||{};return function(t,i){i.label&&(r=r+'<div class="control-label">'+n.escape(null==(e=i.label)?"":e)+"</div>"),t||(r+='<a class="control-upgrade" href="#">Upgrade to enable</a>'),i.help_text&&(r+='<div class="control-help"></div>'),i.editable&&(r+='<div class="control-edit-btn" data-tooltip-text="Edit this field"><input class="custom-checkbox-input" type="checkbox"><div class="custom-checkbox"></div></div>'),r+='<div class="input-color"><input class="control-input input-text" type="text"><input class="color-preview" type="text"><div class="sp-replacer color-preview-i"><div class="sp-preview"><div class="sp-preview-inner"></div></div></div></div>'}.call(this,"isAccesible"in i?i.isAccesible:"undefined"!=typeof isAccesible?isAccesible:void 0,"options"in i?i.options:"undefined"!=typeof options?options:void 0),r}},function(t,e,r){r(0);t.exports=function(t){var e="";return e+='<div class="date_time-content"><input class="date-input hidden"></div><div class="date_time-footer"></div>'}},function(t,e,r){r(0);t.exports=function(t){var e="";return e+='<div class="date_time-content"><div class="date_time-wrapper"><div class="date_time-header"><div class="date_time-current"><span class="time-elements hh hours"></span>:<span class="time-elements mm minutes"></span></div></div><div class="input-group clockpicker"><input class="form-control" type="text"><span class="input-group-addon"><span class="glyphicon glyphicon-time"></span></span></div></div></div><div class="date_time-footer"></div>'}},function(t,e,r){r(0);t.exports=function(t){var e="";return e+='<div class="date_time-wrapper"><div class="date_time-header"><div class="date_time-prev"></div><div class="date_time-next"></div><div class="date_time-current"></div></div><table></table></div>'}},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",i=t||{};return function(t,i){i.label&&(r=r+'<div class="control-label">'+n.escape(null==(e=i.label)?"":e)+"</div>"),t||(r+='<a class="control-upgrade" href="#">Upgrade to enable</a>'),i.help_text&&(r+='<div class="control-help"></div>'),i.editable&&(r+='<div class="control-edit-btn" data-tooltip-text="Edit this field"><input class="custom-checkbox-input" type="checkbox"><div class="custom-checkbox"></div></div>'),r=r+'<input class="control-input input-text input-with-icon" type="text"'+n.attr("placeholder",i.placeholder,!0,!0)+'><div class="input-icon"></div>'}.call(this,"isAccesible"in i?i.isAccesible:"undefined"!=typeof isAccesible?isAccesible:void 0,"options"in i?i.options:"undefined"!=typeof options?options:void 0),r}},function(t,e,r){r(0);t.exports=function(t){return""}},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",o=t||{};return function(t,i,o,s,a){for(r+="<tbody>",o=0;o<i.length/t;o++){for(r+="<tr>",s=o*t;s<(o+1)*t;s++)r=r+"<td"+n.attr("class",n.classes([i[s]==a?"selected":""],[!0]),!1,!0)+'><span class="date_time-cell">'+n.escape(null==(e=i[s])?"":e)+"</span></td>";r+="</tr>"}r+="</tbody>"}.call(this,"cols"in o?o.cols:"undefined"!=typeof cols?cols:void 0,"data"in o?o.data:"undefined"!=typeof data?data:void 0,"i"in o?o.i:"undefined"!=typeof i?i:void 0,"j"in o?o.j:"undefined"!=typeof j?j:void 0,"selected"in o?o.selected:"undefined"!=typeof selected?selected:void 0),r}},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",i=t||{};return function(t,i){i.label&&(r=r+'<div class="control-label">'+n.escape(null==(e=i.label)?"":e)+"</div>"),t||(r+='<a class="control-upgrade" href="#">Upgrade to enable</a>'),i.help_text&&(r+='<div class="control-help"></div>'),i.editable&&(r+='<div class="control-edit-btn" data-tooltip-text="Edit this field"><input class="custom-checkbox-input" type="checkbox"><div class="custom-checkbox"></div></div>'),r+='<div class="input-dropdown" tabIndex="0"><div class="input-dropdown-default"><span></span><div class="dropdown-arrow"></div></div><ul class="input-dropdown-list">',function(){var t=i.options;if("number"==typeof t.length)for(var o=0,s=t.length;o<s;o++){var a=t[o];r=r+"<li"+n.attr("data-value",a.value,!0,!0)+">"+n.escape(null==(e=a.label)?"":e)+"</li>"}else for(var o in s=0,t)s++,a=t[o],r=r+"<li"+n.attr("data-value",a.value,!0,!0)+">"+n.escape(null==(e=a.label)?"":e)+"</li>"}.call(this),r+="</ul></div>"}.call(this,"isAccesible"in i?i.isAccesible:"undefined"!=typeof isAccesible?isAccesible:void 0,"options"in i?i.options:"undefined"!=typeof options?options:void 0),r}},function(t,e,r){r(0);t.exports=function(t){var e="";return e+='<div class="search-input-control"><input class="search-input" placeholder="SEARCH"><div class="search-icon"></div><div class="clear clear-search-input" data-icon="x"></div></div><div class="font-list"><label class="font-item no-result loaded"><span class="font-family-text">No results</span></label></div>'}},function(t,e,r){r(0);t.exports=function(t){var e="";return e+='<div class="font-popup-wrapper"><div class="font-list-wrapper"></div><div class="font-footer"><div class="font-size"></div><div class="font-weight"></div></div></div>'}},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",i=t||{};return function(t,i){i.label&&(r=r+'<div class="control-label">'+n.escape(null==(e=i.label)?"":e)+"</div>"),t||(r+='<a class="control-upgrade" href="#">Upgrade to enable</a>'),i.help_text&&(r+='<div class="control-help"></div>'),i.editable&&(r+='<div class="control-edit-btn" data-tooltip-text="Edit this field"><input class="custom-checkbox-input" type="checkbox"><div class="custom-checkbox"></div></div>'),r=r+'<div class="font-size"></div><div class="control-input font-family"><div class="input-text">'+n.escape(null==(e=i.family)?"":e)+'</div><div class="font-family-icon"></div></div><div class="font-popup"></div>'}.call(this,"isAccesible"in i?i.isAccesible:"undefined"!=typeof isAccesible?isAccesible:void 0,"options"in i?i.options:"undefined"!=typeof options?options:void 0),r}},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",i=t||{};return function(t,i){i.label&&(r=r+'<div class="control-label">'+n.escape(null==(e=i.label)?"":e)+"</div>"),t||(r+='<a class="control-upgrade" href="#">Upgrade to enable</a>'),i.help_text&&(r+='<div class="control-help"></div>'),i.editable&&(r+='<div class="control-edit-btn" data-tooltip-text="Edit this field"><input class="custom-checkbox-input" type="checkbox"><div class="custom-checkbox"></div></div>'),r=r+'<div class="input-image"><div class="image-title"></div><input class="control-input input-text" type="text"'+n.attr("placeholder",i.placeholder,!0,!0)+n.attr("readonly",i.readonly,!0,!0)+' autocorrect="off" autocapitalize="off"><div class="url-thumb"></div></div>'}.call(this,"isAccesible"in i?i.isAccesible:"undefined"!=typeof isAccesible?isAccesible:void 0,"options"in i?i.options:"undefined"!=typeof options?options:void 0),r}},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",i=t||{};return function(t,i){i.label&&(r=r+'<div class="control-label">'+n.escape(null==(e=i.label)?"":e)+"</div>"),t||(r+='<a class="control-upgrade" href="#">Upgrade to enable</a>'),i.help_text&&(r+='<div class="control-help"></div>'),i.editable&&(r+='<div class="control-edit-btn" data-tooltip-text="Edit this field"><input class="custom-checkbox-input" type="checkbox"><div class="custom-checkbox"></div></div>'),r=r+'<div class="input-image"><input class="control-input input-text" type="text"'+n.attr("placeholder",i.placeholder,!0,!0)+n.attr("readonly",i.readonly,!0,!0)+' autocorrect="off" autocapitalize="off"><div class="url-thumb"></div></div>'}.call(this,"isAccesible"in i?i.isAccesible:"undefined"!=typeof isAccesible?isAccesible:void 0,"options"in i?i.options:"undefined"!=typeof options?options:void 0),r}},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",i=t||{};return function(t,i){i.label&&(r=r+'<div class="control-label">'+n.escape(null==(e=i.label)?"":e)+"</div>"),t||(r+='<a class="control-upgrade" href="#">Upgrade to enable</a>'),i.help_text&&(r+='<div class="control-help"></div>'),i.editable&&(r+='<div class="control-edit-btn" data-tooltip-text="Edit this field"><input class="custom-checkbox-input" type="checkbox"><div class="custom-checkbox"></div></div>')}.call(this,"isAccesible"in i?i.isAccesible:"undefined"!=typeof isAccesible?isAccesible:void 0,"options"in i?i.options:"undefined"!=typeof options?options:void 0),r}},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",i=t||{};return function(t){(function(){var i=t;if("number"==typeof i.length)for(var o=0,s=i.length;o<s;o++){var a=i[o];r=r+'<li class="list-item"'+n.attr("data-value",a.value,!0,!0)+'><span class="item-details-order">'+n.escape(null==(e=a.order)?"":e)+'</span><span class="input-text-label">'+n.escape(null==(e=a.label)?"":e)+'</span><span class="option-is-enabled"><input class="is-enabled custom-checkbox-input" type="checkbox"'+n.attr("checked",a.enabled,!0,!0)+'><div class="custom-checkbox"></div></span></li>'}else for(var o in s=0,i)s++,a=i[o],r=r+'<li class="list-item"'+n.attr("data-value",a.value,!0,!0)+'><span class="item-details-order">'+n.escape(null==(e=a.order)?"":e)+'</span><span class="input-text-label">'+n.escape(null==(e=a.label)?"":e)+'</span><span class="option-is-enabled"><input class="is-enabled custom-checkbox-input" type="checkbox"'+n.attr("checked",a.enabled,!0,!0)+'><div class="custom-checkbox"></div></span></li>'}).call(this)}.call(this,"options"in i?i.options:"undefined"!=typeof options?options:void 0),r}},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",i=t||{};return function(t,i){i.label&&(r=r+'<div class="control-label">'+n.escape(null==(e=i.label)?"":e)+"</div>"),t||(r+='<a class="control-upgrade" href="#">Upgrade to enable</a>'),i.help_text&&(r+='<div class="control-help"></div>'),i.editable&&(r+='<div class="control-edit-btn" data-tooltip-text="Edit this field"><input class="custom-checkbox-input" type="checkbox"><div class="custom-checkbox"></div></div>'),r=r+'<div class="input-dropdown" tabIndex="0"><div class="input-dropdown-default"><span>'+n.escape(null==(e=i.title)?"":e)+'</span><div class="dropdown-arrow"></div></div><ul class="input-dropdown-list order-picker-list"></ul></div>'}.call(this,"isAccesible"in i?i.isAccesible:"undefined"!=typeof isAccesible?isAccesible:void 0,"options"in i?i.options:"undefined"!=typeof options?options:void 0),r}},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",i=t||{};return function(t,i){i.label&&(r=r+'<div class="control-label">'+n.escape(null==(e=i.label)?"":e)+"</div>"),t||(r+='<a class="control-upgrade" href="#">Upgrade to enable</a>'),i.help_text&&(r+='<div class="control-help"></div>'),i.editable&&(r+='<div class="control-edit-btn" data-tooltip-text="Edit this field"><input class="custom-checkbox-input" type="checkbox"><div class="custom-checkbox"></div></div>'),r+='<div class="input-range" tabIndex="0"><input class="input-range-value min-value" type="text" value=""><div class="input-range-track"><div class="input-range-thumbs"><div class="input-range-thumb min-thumb" data-thumb="min"></div><div class="input-range-thumb max-thumb" data-thumb="max"></div></div></div><input class="input-range-value max-value" type="text" value=""></div>'}.call(this,"isAccesible"in i?i.isAccesible:"undefined"!=typeof isAccesible?isAccesible:void 0,"options"in i?i.options:"undefined"!=typeof options?options:void 0),r}},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",i=t||{};return function(t,i){i.label&&(r=r+'<div class="control-label">'+n.escape(null==(e=i.label)?"":e)+"</div>"),t||(r+='<a class="control-upgrade" href="#">Upgrade to enable</a>'),i.help_text&&(r+='<div class="control-help"></div>'),i.editable&&(r+='<div class="control-edit-btn" data-tooltip-text="Edit this field"><input class="custom-checkbox-input" type="checkbox"><div class="custom-checkbox"></div></div>'),r+='<div class="input-scale" tabIndex="0"><div class="input-scale-width"></div><div class="input-scale-height"></div><div class="input-scale-scaler"><span class="input-label">Scale </span></div></div>'}.call(this,"isAccesible"in i?i.isAccesible:"undefined"!=typeof isAccesible?isAccesible:void 0,"options"in i?i.options:"undefined"!=typeof options?options:void 0),r}},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",i=t||{};return function(t,i){i.label&&(r=r+'<div class="control-label">'+n.escape(null==(e=i.label)?"":e)+"</div>"),t||(r+='<a class="control-upgrade" href="#">Upgrade to enable</a>'),i.help_text&&(r+='<div class="control-help"></div>'),i.editable&&(r+='<div class="control-edit-btn" data-tooltip-text="Edit this field"><input class="custom-checkbox-input" type="checkbox"><div class="custom-checkbox"></div></div>'),r+='<input class="input-slider-value" type="text" value=""><div class="input-slider" tabIndex="0"><div class="input-slider-container"><div class="input-slider-thumb"></div></div></div>'}.call(this,"isAccesible"in i?i.isAccesible:"undefined"!=typeof isAccesible?isAccesible:void 0,"options"in i?i.options:"undefined"!=typeof options?options:void 0),r}},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",i=t||{};return function(t,i){i.label&&(r=r+'<div class="control-label">'+n.escape(null==(e=i.label)?"":e)+"</div>"),t||(r+='<a class="control-upgrade" href="#">Upgrade to enable</a>'),i.help_text&&(r+='<div class="control-help"></div>'),i.editable&&(r+='<div class="control-edit-btn" data-tooltip-text="Edit this field"><input class="custom-checkbox-input" type="checkbox"><div class="custom-checkbox"></div></div>'),r+='<div class="input-spinner"><div class="spinner-down spinner-button"></div><input class="control-input" type="text" autocorrect="off" autocapitalize="off"><div class="spinner-up spinner-button"></div></div>'}.call(this,"isAccesible"in i?i.isAccesible:"undefined"!=typeof isAccesible?isAccesible:void 0,"options"in i?i.options:"undefined"!=typeof options?options:void 0),r}},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",i=t||{};return function(t,i){i.label&&(r=r+'<div class="control-label">'+n.escape(null==(e=i.label)?"":e)+"</div>"),t||(r+='<a class="control-upgrade" href="#">Upgrade to enable</a>'),i.help_text&&(r+='<div class="control-help"></div>'),i.editable&&(r+='<div class="control-edit-btn" data-tooltip-text="Edit this field"><input class="custom-checkbox-input" type="checkbox"><div class="custom-checkbox"></div></div>'),r=r+'<input class="control-input input-text" type="text"'+n.attr("placeholder",i.placeholder,!0,!0)+'><div class="color-preview"></div>'}.call(this,"isAccesible"in i?i.isAccesible:"undefined"!=typeof isAccesible?isAccesible:void 0,"options"in i?i.options:"undefined"!=typeof options?options:void 0),r}},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",i=t||{};return function(t,i){i.label&&(r=r+'<div class="control-label">'+n.escape(null==(e=i.label)?"":e)+"</div>"),t||(r+='<a class="control-upgrade" href="#">Upgrade to enable</a>'),i.help_text&&(r+='<div class="control-help"></div>'),i.editable&&(r+='<div class="control-edit-btn" data-tooltip-text="Edit this field"><input class="custom-checkbox-input" type="checkbox"><div class="custom-checkbox"></div></div>'),r=r+'<div class="general-input input-textarea"><textarea'+n.attr("placeholder",i.placeholder,!0,!0)+'></textarea><div class="toolbar" style="display:none;"><a data-wysihtml5-command="bold" tabIndex="-1"></a><a data-wysihtml5-command="italic" tabIndex="-1"></a><a data-wysihtml5-command="underline" tabIndex="-1"></a></div></div>'}.call(this,"isAccesible"in i?i.isAccesible:"undefined"!=typeof isAccesible?isAccesible:void 0,"options"in i?i.options:"undefined"!=typeof options?options:void 0),r}},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",i=t||{};return function(t,i,o){o.label&&(r=r+'<div class="control-label">'+n.escape(null==(e=o.label)?"":e)+"</div>"),t||(r+='<a class="control-upgrade" href="#">Upgrade to enable</a>'),o.help_text&&(r+='<div class="control-help"></div>'),o.editable&&(r+='<div class="control-edit-btn" data-tooltip-text="Edit this field"><input class="custom-checkbox-input" type="checkbox"><div class="custom-checkbox"></div></div>'),r=r+'<div class="input-toggle" tabIndex="0"><div class="input-toggle-true">'+n.escape(null==(e=i.true||"On")?"":e)+'</div><div class="input-toggle-false">'+n.escape(null==(e=i.false||"Off")?"":e)+"</div></div>"}.call(this,"isAccesible"in i?i.isAccesible:"undefined"!=typeof isAccesible?isAccesible:void 0,"labels"in i?i.labels:"undefined"!=typeof labels?labels:void 0,"options"in i?i.options:"undefined"!=typeof options?options:void 0),r}},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",i=t||{};return function(t,i){i.label&&(r=r+'<div class="control-label">'+n.escape(null==(e=i.label)?"":e)+"</div>"),t||(r+='<a class="control-upgrade" href="#">Upgrade to enable</a>'),i.help_text&&(r+='<div class="control-help"></div>'),i.editable&&(r+='<div class="control-edit-btn" data-tooltip-text="Edit this field"><input class="custom-checkbox-input" type="checkbox"><div class="custom-checkbox"></div></div>'),r=r+'<div class="input-video"><span class="icon"></span><span class="video-prew"></span><div class="video-title"></div><input class="control-input input-text" type="text"'+n.attr("placeholder",i.placeholder,!0,!0)+n.attr("readonly",i.readonly,!0,!0)+' autocorrect="off" autocapitalize="off"></div>'}.call(this,"isAccesible"in i?i.isAccesible:"undefined"!=typeof isAccesible?isAccesible:void 0,"options"in i?i.options:"undefined"!=typeof options?options:void 0),r}},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",i=t||{};return function(t,i){i.label&&(r=r+'<div class="control-label">'+n.escape(null==(e=i.label)?"":e)+"</div>"),t||(r+='<a class="control-upgrade" href="#">Upgrade to enable</a>'),i.help_text&&(r+='<div class="control-help"></div>'),i.editable&&(r+='<div class="control-edit-btn" data-tooltip-text="Edit this field"><input class="custom-checkbox-input" type="checkbox"><div class="custom-checkbox"></div></div>'),r=r+'<div class="input-video"><input class="control-input input-text" type="text"'+n.attr("placeholder",i.placeholder,!0,!0)+n.attr("readonly",i.readonly,!0,!0)+' autocorrect="off" autocapitalize="off"></div>'}.call(this,"isAccesible"in i?i.isAccesible:"undefined"!=typeof isAccesible?isAccesible:void 0,"options"in i?i.options:"undefined"!=typeof options?options:void 0),r}},function(t,e,r){r(0);t.exports=function(t){var e="";return e+='<div class="save-editor_overlay"><div class="embedder-content"><div class="ready-icon-wrap"><div class="ready-icon"><div class="icon success-icon animate"><div class="line tip animateSuccessTip"></div><div class="line long animateSuccessLong"></div><div class="placeholder"></div><div class="fix"></div></div></div></div><div class="embedder-title">Published</div></div></div>'}},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",i=t||{};return function(t){r=r+'<div class="login-service #{serviceName}-login"><div class="login-service-title">upload photos from your account</div><div class="social-button social-button-#{serviceName} #{serviceName}-login-button"><div class="icon-area icon-area-#{serviceName}"></div><div class="label-area">Connect with '+n.escape(null==(e=t)?"":e)+"</div></div></div>"}.call(this,"title"in i?i.title:"undefined"!=typeof title?title:void 0),r}},function(t,e,r){r(0);t.exports=function(t){var e="";return e+='<div class="input-dropdown" tabIndex="0"><div class="input-dropdown-default"><span>All</span><div class="dropdown-arrow"></div></div><ul class="input-dropdown-list"><li class="active" data-value="skins">All</li><li data-value="presets">Presets</li><li data-value="yours">Skins</li></ul></div>'}},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",i=t||{};return function(t,i,o){r=r+'<div class="presets-list-colors"'+n.attr("data-tooltip-text",i.name,!0,!0)+' data-tooltip-position="right center"><span class="before"></span><div class="presets-list-delete" data-icon="⏍"></div>',function(){var e=t;if("number"==typeof e.length)for(var s=0,a=e.length;s<a;s++){var u=e[s];o="background-color:"+i[u]+";width:"+60/t.length+"px",r=r+'<div class="presets-list-color"'+n.attr("data-name",u,!0,!0)+n.attr("style",n.style(o),!0,!0)+"></div>"}else for(var s in a=0,e)a++,u=e[s],o="background-color:"+i[u]+";width:"+60/t.length+"px",r=r+'<div class="presets-list-color"'+n.attr("data-name",u,!0,!0)+n.attr("style",n.style(o),!0,!0)+"></div>"}.call(this),r=r+'</div><div class="presets-list-name"><span>'+n.escape(null==(e=i.name)?"":e)+'</span></div><div class="presets-list-changes"><div class="total">0</div><div class="text">changes</div><div class="save">Save</div><div class="cancel">Reset</div></div>'}.call(this,"colors"in i?i.colors:"undefined"!=typeof colors?colors:void 0,"item"in i?i.item:"undefined"!=typeof item?item:void 0,"style"in i?i.style:"undefined"!=typeof style?style:void 0),r}},function(t,e,r){var n,i,o,s,a=function(t,e){return function(){return t.apply(e,arguments)}},u={}.hasOwnProperty,l=[].slice;i=r(2),o=r(3),s=r(13).createPopup,n=function(t){function e(){return this.setPopupTargetWindow=a(this.setPopupTargetWindow,this),this.deactivate=a(this.deactivate,this),this.colorChange=a(this.colorChange,this),this._change=a(this._change,this),this._updateOpacity=a(this._updateOpacity,this),this.update=a(this.update,this),this.toggle=a(this.toggle,this),this.render=a(this.render,this),e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var r in e)u.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.prototype.template="core/views/color",e.prototype.className="control-color",e.prototype.events={"input .control-input":"_change","click .color-preview-i":"toggle"},e.prototype.elements={".control-input":"input",".color-preview":"color",".color-preview-i":"colorPreview"},e.prototype.render=function(){return e.__super__.render.apply(this,arguments),this._updatePreviewColor(),this},e.prototype.toggle=function(){return this._createPopup().then(function(t){return function(){return t.popup.visible?t.popup.hide():t.popup.show()}}(this))},e.prototype.update=function(t,e,r){var n,i,o;return null==r&&(r={}),o=null!=t[this.attribute]?t[this.attribute]:this.options.default,r.from!==this&&this.input.val(this.tinycolor(o).toString("hex6")),r.from!==this.color&&this.spectrum(this.color,"set",o),n=this.tinycolor(o).toRgb(),null!=(i=this.spinner)&&i.change(100*n.a,{silent:!0}),this._updatePreviewColor(t)},e.prototype._createPopup=function(){return this.popupPromise?this.popupPromise:this.popupPromise=s({anchor:this.colorPreview}).then(function(t){return function(e){var r,n,i;return t.popup=e,t.spectrum(t.color,{preview:t.colorPreview.find(".sp-preview-inner"),flat:!0,showAlpha:!0,showInitial:!0,showInput:!0,preferredFormat:"hex6",showButtons:!1,clickoutFiresChange:!0,change:t.colorChange,move:t.colorChange,color:t.item[t.attribute],input:function(e){var r;return(r=e.toRgb()).a=t.spinner.input.val()/100,t.spectrum(t.color,"setTemp",r),t.colorChange(t.tinycolor(r))}}),i=t.spectrum(t.color,"container"),n=null==(r=t.options.alpha)||!0===String(r),i.toggleClass("sp-alpha-enabled",n),t.spinner=new o({className:"control control-stepper sp-alpha-step",attribute:"opacity",options:{min:0,max:100,default:100*t.tinycolor(t.item[t.attribute]).toRgb().a}}),t.spinner.bind("change:stepper",t._updateOpacity),i.find(".sp-input-container").append(t.spinner.render().el),i.find(".sp-input-container .sp-input").attr("maxLength","7"),t.popup.append(i)}}(this)).catch(function(t){return console.error(t.stack)})},e.prototype._updatePreviewColor=function(t){return this.colorPreview.find(".sp-preview-inner").css({backgroundColor:(t||this.item)[this.attribute]})},e.prototype._updateOpacity=function(t){var e;if(null==t&&(t={}),this.popup.visible)return(e=this.spectrum(this.color,"get").toRgb()).a=t.val/100,this.spectrum(this.color,"setTemp",e),this.colorChange(this.tinycolor(e))},e.prototype._change=function(){return this.colorChange(this.tinycolor(this.input.val()),{from:this})},e.prototype.colorChange=function(t,e){return null==e&&(e={}),this.change(t.toRgbString(),$.extend({attribute:this.attribute,from:this.color},e))},e.prototype.deactivate=function(){var t;return null!=(t=this.popup)?t.hide():void 0},e.prototype.release=function(){var t;return this.spectrum(this.color,"destroy"),null!=(t=this.popup)&&t.release(),e.__super__.release.apply(this,arguments)},e.prototype.tinycolor=function(){return window.tinycolor.apply(window,arguments)},e.prototype.spectrum=function(){var t,e,r;return e=arguments[0],t=2<=arguments.length?l.call(arguments,1):[],(r=$(e)).spectrum.apply(r,t)},e.prototype.setPopupTargetWindow=function(t){return this.targetWindow=t,this},e}(),t.exports=n},function(t,e,r){var n,i,o,s,a,u=function(t,e){return function(){return t.apply(e,arguments)}},l={}.hasOwnProperty;i=r(11),n=window.require("spine/controller/container"),a=r(26),o=r(25),s=function(t){function e(){return this.setPopupTargetWindow=u(this.setPopupTargetWindow,this),this.setPopupCSS=u(this.setPopupCSS,this),this.deactivate=u(this.deactivate,this),this.blur=u(this.blur,this),this.toggle=u(this.toggle,this),this.change=u(this.change,this),this.update=u(this.update,this),this.render=u(this.render,this),e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var r in e)l.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.prototype.className="control control-date-time",e.prototype.template=window.require("core/views/date-time/input"),e.include(n),e.prototype.elements={".input-icon":"popupAnchor"},e.prototype.events={"click .input-icon":"toggle","click .control-input":"toggle","focus .control-input":"blur"},e.prototype._format="d-m-Y H:i",e.prototype.render=function(){return e.__super__.render.apply(this,arguments),(this.popup=new a({anchor:this.popupAnchor,options:this.options})).render(),this.listenTo(this.popup,"change",this.change)},e.prototype.update=function(t,e,r){var n,i,s,a;return null==r&&(r={}),this.value=null!=t[this.attribute]?t[this.attribute]:this.options.default,this.value&&this.input.val(o.format(this.options.format,new Date(this.value))),this.value||(this.value=1e3*+o.format("U",(new Date).getTime())),n=(i=o.format(this._format,new Date(this.value)).split(" "))[0],a=i[1],null!=(s=this.popup)?s.update({date:n,time:a}):void 0},e.prototype.change=function(t){return t=1e3*+o.format("U",t),e.__super__.change.call(this,t)},e.prototype.toggle=function(){var t;if(null==(t=this._parent||(this._parent=this.parent()))||!t.disabled)return this.blur(),this.popup.toggle()},e.prototype.blur=function(){return this.input.blur()},e.prototype.deactivate=function(){return this.popup.hide()},e.prototype.setPopupCSS=function(t){return this.popup.setPopupCSS(t)},e.prototype.setPopupTargetWindow=function(t){return this.popup.setPopupTargetWindow(t)},e}(),t.exports=s},function(t,e,r){var n,i,o,s=function(t,e){return function(){return t.apply(e,arguments)}},a={}.hasOwnProperty;i=r(20),n=$("body"),o=function(t){function e(){return this._forcePause=s(this._forcePause,this),this.toggle=s(this.toggle,this),this.onInvalidURL=s(this.onInvalidURL,this),e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var r in e)a.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.prototype.className="control control-url control-audio-details",e.prototype.template="core/views/audio-details",e.prototype.silent=!0,e.prototype.elements={".audio-title":"title",".audio-title, .icon":"toggleTarget"},e.prototype.events={"click .audio-title, .icon":"toggle"},e.prototype.onInvalidURL=function(){return this.$removeClass("invalid"),this.title.text("File missing.")},e.prototype.update=function(){var t;return e.__super__.update.apply(this,arguments),(t=this.item.path.split("/").pop().split(".")).pop(),this.title.text(unescape(t.join(".")).trim()||"No Title")},e.prototype.toggle=function(){return e.__super__.toggle.apply(this,arguments),this.delay(function(t){return function(){return n.one("click",t._forcePause)}}(this))},e.prototype._forcePause=function(t){if(!this.toggleTarget.is(t.target))return this.sound.pause()},e}(),t.exports=o},function(t,e,r){var n,i,o=function(t,e){return function(){return t.apply(e,arguments)}},s={}.hasOwnProperty;i=r(28),n=function(t){function e(){return this.onInvalidURL=o(this.onInvalidURL,this),e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var r in e)s.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.prototype.className="control control-url control-image-details",e.prototype.template="core/views/image-details",e.prototype.elements={".image-title":"title"},e.prototype.silent=!0,e.prototype.onInvalidURL=function(){return this.$removeClass("invalid"),this.title.text("File missing.")},e.prototype.update=function(){var t,r;return e.__super__.update.apply(this,arguments),(r=this.item.image.split("/").pop().split(".")).pop(),this.title.text(unescape(r.join(".")).trim()||(null!=(t=this.item.metadata)?t.name:void 0)||"No Title")},e}(),t.exports=n},function(t,e,r){var n,i,o={}.hasOwnProperty;i=r(29),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var r in e)o.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.prototype.className="control control-url control-video-details",e.prototype.template="core/views/video-details",e.prototype.elements={".video-title":"title"},e.prototype.update=function(){var t;return e.__super__.update.apply(this,arguments),(t=this.item.path.split("/").pop().split(".")).pop(),this.title.text(unescape(t.join(".")).trim()||"No Title")},e}(),t.exports=n},function(t,e,r){var n,i,o,s,a,u=function(t,e){return function(){return t.apply(e,arguments)}},l={}.hasOwnProperty;i=r(2),n=window.require("spine/controller/container"),a=r(3),s=r(32),o=function(t){function e(){return this.setPopupTargetWindow=u(this.setPopupTargetWindow,this),this.deactivate=u(this.deactivate,this),this.toggle=u(this.toggle,this),this._change=u(this._change,this),this.update=u(this.update,this),this.render=u(this.render,this),e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var r in e)l.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.include(n),e.prototype.template="core/views/font",e.prototype.className="control-font",e.prototype.elements={".font-size":"fontSizeEl",".input-text":"fontFamily",".font-family-icon":"icon",".font-popup":"popupEl"},e.prototype.events={"click .font-family":"toggle"},e.prototype.render=function(){return e.__super__.render.apply(this,arguments),this.lastVal||(this.lastVal={family:this.options.family,size:this.options.size.default||0,style:this.options.style}),this.fontSizeControl=new a({el:this.fontSizeEl,attribute:"size",options:this.options.size}),this.fontsPopup=new s({el:this.popupEl,options:this.options,popupReference:this.icon,default:this.lastVal,disableSize:!this.options.size}),this.listenTo(this.fontSizeControl,"change:stepper",this._change),this.listenTo(this.fontsPopup,"change",this._change),this.el.toggleClass("no-size-input",!this.options.size),this.delay(function(t){return function(){return t.update(t.item)}}(this))},e.prototype.update=function(t,e,r){if(null==r&&(r={}),t[this.attribute])return this.lastVal=$.extend({},t[this.attribute]),r=$.extend({},r,{silent:!0}),this.fontsPopup.update(this.lastVal,e,r),this.fontSizeControl.update({size:this.lastVal.size},e,r),this.fontFamily.text(this.lastVal.family)},e.prototype._change=function(t){var e,r,n;if(t.attributes)for(e in r=t.attributes)n=r[e],this.lastVal[e]=n;return t.attribute&&(this.lastVal[t.attribute]=t.value),this.change(this.lastVal)},e.prototype.toggle=function(){return this.fontsPopup.toggle()},e.prototype.deactivate=function(){return this.fontsPopup.deactivate()},e.prototype.setPopupTargetWindow=function(t){return this.fontsPopup.setPopupTargetWindow(t)},e}(),t.exports=o},function(t,e,r){var n,i,o=function(t,e){return function(){return t.apply(e,arguments)}},s={}.hasOwnProperty,a=[].slice;n=r(7),i=function(t){function e(){this.blur=o(this.blur,this),this.update=o(this.update,this),this._change=o(this._change,this),this.onDrop=o(this.onDrop,this),this.onDrag=o(this.onDrag,this),this.onDragStart=o(this.onDragStart,this),this.render=o(this.render,this),this.init=o(this.init,this),e.__super__.constructor.apply(this,arguments),this.sortable(this.list,{itemSelector:".list-item",handle:".item-details-order",onDragStart:this.onDragStart,onDrop:this.onDrop,onDrag:this.onDrag}),this.list.bind("change",this._change)}return function(t,e){for(var r in e)s.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,n),e.prototype.template="core/views/order-picker",e.prototype.itemsTmpl=window.require("core/views/order-items"),e.prototype.className="order-picker",e.prototype.init=function(){var t,e,r,n,i;for(i=[],t=0,e=(n=this.options.options).length;t<e;t++)r=n[t],i.push((this.labels||(this.labels={}))[r.value]=r.label);return i},e.prototype.render=function(){return e.__super__.render.apply(this,arguments),this.item&&this.update(this.item),this.default.text("Arrange Items"),this},e.prototype.onDragStart=function(t,e,r){return this.isDragging=!0,r(t,e)},e.prototype.onDrag=function(t,e,r){return r(t,e)},e.prototype.onDrop=function(t,e,r){return this.isDragging=!1,r(t,e),this._change()},e.prototype._change=function(){var t;return t={},this.list.find(".list-item").each(function(e,r){var n,i,o,s;return o=(n=$(r)).data("value"),s=1+n.index(),i=n.find(".is-enabled").is(":checked"),t[o]={order:s,enabled:i}}),this.change(t)},e.prototype.update=function(t,e,r){var n,i,o,s,a,u,l,c,p;if(null==r&&(r={}),!this.isDragging){for(p=null!=t[this.attribute]?t[this.attribute]:this.options.default,r=[],n=0,o=(l=this.options.options).length;n<o;n++)p[(a=l[n]).value]&&(r[(u=p[a.value].order)-1]=$.extend({order:u},a,{enabled:p[a.value].enabled}));for(i=0,s=(c=this.options.options).length;i<s;i++)p[(a=c[i]).value]||r.push($.extend({order:r.length},a,{enabled:!1}));return this.list.html(this.itemsTmpl({options:r}))}},e.prototype.sortable=function(){var t,e,r;return t=arguments[0],e=2<=arguments.length?a.call(arguments,1):[],(r=$(t)).sortable.apply(r,e)},e.prototype.blur=function(t){if(t&&("click"!==t.type||!$(t.target).closest(this.list).length))return e.__super__.blur.apply(this,arguments)},e}(),t.exports=i},function(t,e,r){var n,i,o,s,a,u,l,c=function(t,e){return function(){return t.apply(e,arguments)}},p={}.hasOwnProperty;o=r(2),i=window.require("spine/controller/container"),u=r(3),n=window.require("core/models/composition"),s=r(34),l=$.extend.bind(null,{}),a=function(t){function e(t){var r;this.setPopupTargetWindow=c(this.setPopupTargetWindow,this),this.setPopupCSS=c(this.setPopupCSS,this),this.deactivate=c(this.deactivate,this),this.update=c(this.update,this),this._change=c(this._change,this),this.showPixelPanel=c(this.showPixelPanel,this),this.render=c(this.render,this),this.compositionSizeUpdate=c(this.compositionSizeUpdate,this),r=t.options.default,this.x=r.x,this.y=r.y,this.reference=r.reference,e.__super__.constructor.apply(this,arguments),n.bind("update",this.compositionSizeUpdate),this.compositionSizeUpdate(null,{attribute:!0})}return function(t,e){for(var r in e)p.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,o),e.include(i),e.prototype.template=r(19),e.prototype.className="control-position",e.prototype.elements={".input-position-x .control":"xPos",".input-position-y .control":"yPos",".input-position-panel":"positionPanel"},e.prototype.events={"click .input-position-panel":"showPixelPanel",positionUpdate:"_change"},e.prototype.getComposition=function(){var t;if(this.composition)return this.composition;try{return this.item.composition()}catch(e){t=e,console.error(t)}},e.prototype.compositionSizeUpdate=function(t,e){var r,n,i;if((r=this.getComposition())&&null!=e.attribute)return n=r.width,i=r.height,this.panelsPopup.pixel.updatePanelSize(n,i),this.panelsPopup.grid.updatePanelSize(n,i)},e.prototype.render=function(){var t;return e.__super__.render.apply(this,arguments),t=l(this.options,{label:"",help_text:""}),this._x=new u({el:this.xPos,attribute:"x",options:l(t,{default:this.options.default.x})}),this._y=new u({el:this.yPos,attribute:"y",options:l(t,{default:this.options.default.y})}),this.listenTo(this._x,"change:stepper",this._change),this.listenTo(this._y,"change:stepper",this._change),(this.panelsPopup=new s({x:this.x,y:this.y,anchor:this.positionPanel,options:this.options})).render(),this.listenTo(this.panelsPopup,"change",this._change),this},e.prototype.showPixelPanel=function(){return this.panelsPopup.refreshGrids(this.panelsPopup.toggle())},e.prototype._change=function(t){var e,r,n;if(t.attributes)for(e in r=t.attributes)n=r[e],this[e]=n;return t.attribute&&(this[t.attribute]=t.value),this.change({x:this.x,y:this.y,reference:this.reference})},e.prototype.update=function(t,e,r){var n;return null==r&&(r={}),n=t[this.attribute],this.x=n.x,this.y=n.y,this.reference=n.reference,this._x.update(n,e,r),this._y.update(n,e,r),this.panelsPopup.update(n,e,r)},e.prototype.deactivate=function(){return this.panelsPopup.hide()},e.prototype.release=function(){return e.__super__.release.apply(this,arguments),this.panelsPopup.release()},e.prototype.setPopupCSS=function(t){return this.panelsPopup.setPopupCSS(t)},e.prototype.setPopupTargetWindow=function(t){return this.panelsPopup.setPopupTargetWindow(t)},e}(),t.exports=a},function(t,e,r){var n,i,o,s,a,u,l=function(t,e){return function(){return t.apply(e,arguments)}},c={}.hasOwnProperty;s=r(2),o=window.require("spine/controller/container"),u=function(t,e,r){return Math.max(Math.min(r,parseInt(t)),e)},i=$(document),n=$("body"),a=function(t){function e(){var t,r,i;this.eventX=l(this.eventX,this),this.maxInpVal=l(this.maxInpVal,this),this.minInpVal=l(this.minInpVal,this),this.blurMax=l(this.blurMax,this),this.blurMin=l(this.blurMin,this),this.minMaxFocus=l(this.minMaxFocus,this),this.liveUpdate=l(this.liveUpdate,this),this.updateInputs=l(this.updateInputs,this),this.focus=l(this.focus,this),this.update=l(this.update,this),this.dragStop=l(this.dragStop,this),this.drag=l(this.drag,this),this._onMouseDown=l(this._onMouseDown,this),this.trackWidth=l(this.trackWidth,this),this.added=l(this.added,this),this.mouseEnterBody=l(this.mouseEnterBody,this),e.__super__.constructor.apply(this,arguments),(t=this.options).min||(t.min=0),(r=this.options).max||(r.max=1),(i=this.options).unit||(i.unit=""),this.options.min>>=0,this.options.max>>=0,n.bind("mouseenter",this.mouseEnterBody),this.minInput.bind("blur",this.blurMin),this.maxInput.bind("blur",this.blurMax),this.el.find("input").bind("focus",this.focus),this.el.find(".min-value, .max-value").bind("focus",this.minMaxFocus)}return function(t,e){for(var r in e)c.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,s),e.include(o),e.prototype.template="core/views/range",e.prototype.className="control-range",e.prototype.elements={".min-thumb":"minThumb",".max-thumb":"maxThumb",".min-value":"minInput",".max-value":"maxInput",".input-range-track":"track",".input-range-thumbs":"thumbs",".input-range":"input"},e.prototype.events={"mousedown .input-range-thumb":"dragStart","keydown .min-value,.max-value":"onKeyDown","mousedown .input-range-track":"click"},e.prototype.offsetX=0,e.prototype.isMouseDown=!1,e.prototype.position={left:function(t){return u(t-this.offsetX+40,0,this.trackWidth()-this.thumbsCss("right"))},right:function(t){return u(this.width-(t-this.offsetX),0,this.trackWidth()-this.thumbsCss("left"))}},e.prototype.mouseEnterBody=function(t){if(this.isMouseDown)return 1!==(t.buttons||t.which)?this.dragStop(t):void 0},e.prototype.thumbsCss=function(t,e,r){return this._||(this._={left:0,right:0}),null==e?null!=r&&this.thumbs.css(t)||this._[t]:this.thumbs.css(t,this._[t]=e)},e.prototype.thumbsEase=function(t,e,r){var n;return null==r&&(r=function(){}),(n={})[t]=this._[t]=e,this.thumbs.animate(n,300,r)},e.prototype.added=function(){return e.__super__.added.apply(this,arguments),this.trackWidth(),this},e.prototype.trackWidth=function(){return this.width>0?this._trackWidth:(this.width=this.track.width(),this._trackWidth=this.width-2)},e.prototype.dragStart=function(t){var e;return e=$(t.target),this.current="max"===e.data("thumb")?"right":"left",this.offsetX=this.track.offset().left+(this.eventX(t)-e.offset().left),this._onMouseDown(t)},e.prototype.click=function(t){return this.current=this.eventX(t)-(this.thumbs.offset().left+this.thumbs.width()/2)<=0?"left":"right","left"===this.current&&this.minThumb||this.maxThumb,this.offsetX=this.track.offset().left+20,this._onMouseDown(t),this.thumbsEase(this.current,this.position[this.current].call(this,this.eventX(t)),this.liveUpdate)},e.prototype._onMouseDown=function(t){return this.isMouseDown=!0,t.preventDefault(),t.stopPropagation(),this.input.focus(),n.addClass("thumb-dragging"),i.bind("mousemove",this.drag).one("mouseup",this.dragStop),this.liveUpdate()},e.prototype.drag=function(t){return this.thumbs.stop(!0,!0),this.thumbsCss(this.current,this.position[this.current].call(this,this.eventX(t))),this.updateInputs(),this.timeout=setTimeout(this.liveUpdate,100)},e.prototype.dragStop=function(){return i.unbind("mousemove",this.drag),clearTimeout(this.timeout),n.removeClass("thumb-dragging"),this.liveUpdate(),this.isMouseDown=!1},e.prototype.update=function(t,e,r){var n;if(null==r&&(r={}),!r.from||r.from!==this)return(n=t[this.attribute]||{min:0,max:0}).min=parseInt(n.min||0)>>0,n.max=parseInt(n.max||0)>>0,this.minInpVal(n.min),this.maxInpVal(n.max),this.thumbsCss("left",(n.min-this.options.min)/(this.options.max-this.options.min)*this.trackWidth()),this.thumbsCss("right",this.trackWidth()-(n.max-this.options.min)/(this.options.max-this.options.min)*this.trackWidth())},e.prototype.focus=function(){return this.input.addClass("active")},e.prototype.updateInputs=function(){var t,e;return e=this.thumbsCss("left")/this.trackWidth()*(this.options.max-this.options.min)+this.options.min,t=(this.trackWidth()-this.thumbsCss("right"))/this.trackWidth()*(this.options.max-this.options.min)+this.options.min,this.minInpVal(Math.round(e)),this.maxInpVal(Math.round(Math.min(t,this.options.max))),{min:e,max:t}},e.prototype.liveUpdate=function(){return this.item.updateAttribute(this.attribute,this.updateInputs(),{attribute:this.attribute,from:this})},e.prototype.minMaxFocus=function(t){var e;return(e=$(t.target)).val(parseInt(e.val()))},e.prototype.blurMin=function(){var t;return this.min===(t=parseInt(this.minInpVal(null,!0)))?this.minInpVal(this.min):(t=Math.min(this.options.max,t),t=Math.max(this.options.min,t),t=Math.min(t,parseInt(this.maxInpVal())),this.thumbsCss("left",(t-this.options.min)/(this.options.max-this.options.min)*this.trackWidth()),this.minInpVal(parseInt(t)),this.input.removeClass("active"),this.liveUpdate())},e.prototype.blurMax=function(){var t;return this.max===(t=parseInt(this.maxInpVal(null,!0)))?this.maxInpVal(this.max):(t=Math.min(this.options.max,t),t=Math.max(this.options.min,t),t=Math.max(t,parseInt(this.minInpVal())),this.thumbsCss("right",this.trackWidth()-(t-this.options.min)/(this.options.max-this.options.min)*this.trackWidth()),this.maxInpVal(parseInt(t)),this.input.removeClass("active"),this.liveUpdate())},e.prototype.minInpVal=function(t,e){var r;return null!=t?this.minInput.val((this.min=t)+this.options.unit):null==e||isNaN(r=parseInt(this.minInput.val()))?this.min:r},e.prototype.maxInpVal=function(t,e){var r;return null!=t?this.maxInput.val((this.max=t)+this.options.unit):null==e||isNaN(r=parseInt(this.maxInput.val()))?this.max:r},e.prototype.onKeyDown=function(t){if(13===t.keyCode)return $(t.target).blur()},e.prototype.eventX=function(t){return t.pageX||t.clientX},e.prototype.setWindow=function(){return e.__super__.setWindow.apply(this,arguments),i=$(this.window.document),n=i.find("body")},e}(),t.exports=a},function(t,e,r){var n,i,o,s=function(t,e){return function(){return t.apply(e,arguments)}},a={}.hasOwnProperty;i=r(4),o=function(t){return $.ajax("//widgetic.com/feeds/?v=1.0&q="+encodeURIComponent(t),{dataType:"jsonp"})},n=function(t){function e(){return this._checkURL=s(this._checkURL,this),e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var r in e)a.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.prototype.type="rss",e.prototype.className="control-rss",e.prototype._checkURL=function(){return this.req=o(this.lastURL).done(function(t){return function(e){return 200===e.responseStatus&&t.def.resolve()||t.def.reject()}}(this)),(this.def=new $.Deferred).promise()},e}(),t.exports=n},function(t,e,r){var n,i,o,s,a=function(t,e){return function(){return t.apply(e,arguments)}},u={}.hasOwnProperty;i=r(2),n=window.require("spine/controller/container"),s=r(3),window.require("core/models/composition"),o=function(t){function e(){this.update=a(this.update,this),this.change=a(this.change,this),this.updateSteppers=a(this.updateSteppers,this),this.scaleUpdated=a(this.scaleUpdated,this),this.heightUpdated=a(this.heightUpdated,this),this.widthUpdated=a(this.widthUpdated,this),this.updateValues=a(this.updateValues,this),this.render=a(this.render,this),this.getProp=a(this.getProp,this),this.spinnerOptions=a(this.spinnerOptions,this),e.__super__.constructor.apply(this,arguments),this.getProp(),this.widthStepper=new s(this.spinnerOptions("width")),this.heightStepper=new s(this.spinnerOptions("height")),this.scalerStepper=new s({attribute:"scale",options:{label:"",unit:" %",min:parseInt(this.options.min),max:parseInt(this.options.max),default:100}}),this.steppers=[this.widthStepper,this.heightStepper,this.scalerStepper]}return function(t,e){for(var r in e)u.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.include(n),e.prototype.template="core/views/scale",e.prototype.className="control-scale",e.prototype.elements={".input-scale-width":"widthEl",".input-scale-height":"heightEl",".input-scale-scaler":"scaleEl"},e.prototype.events={"change:stepper":"updateValues"},e.prototype.spinnerOptions=function(t){return{attribute:t,options:{label:"",unit:" px",min:parseInt(this.options[t])*(parseInt(this.options.min)/100),max:parseInt(this.options[t])*(parseInt(this.options.max)/100),default:this.options[t]}}},e.prototype.getProp=function(){return this.dw=parseInt(this.options.width),this.dh=parseInt(this.options.height),this.ratio=this.dw/this.dh},e.prototype.render=function(){var t,r,n,i;for(e.__super__.render.apply(this,arguments),r=0,n=(i=this.steppers).length;r<n;r++)this[(t=i[r]).attribute+"El"].append(t.render().el);return this},e.prototype.updateValues=function(t,e){return null==e&&(e={}),null!=t&&t.stopPropagation(),this[e.attribute+"Updated"](e.val)},e.prototype.widthUpdated=function(t){return this.updateSteppers(t/this.dw)},e.prototype.heightUpdated=function(t){return this.updateSteppers(t/this.dh)},e.prototype.scaleUpdated=function(t){return this.updateSteppers(t/100)},e.prototype.updateSteppers=function(t,e){return this.height=this.dh*t,this.width=this.dw*t,this.scale=100*t,this.change(e)},e.prototype.change=function(t){var r,n,i,o;for(n=0,i=(o=this.steppers).length;n<i;n++)(r=o[n]).change(this[r.attribute],{silent:!0});return e.__super__.change.call(this,{width:this.width,height:this.height},t)},e.prototype.update=function(t,e,r){var n;if(null==r&&(r={}),!r.from||r.from!==this)return this.updateSteppers((null!=(n=this.item)?n[this.attribute].width:void 0)/this.dw,{silent:!0})},e}(),t.exports=o},function(t,e,r){var n,i,o,s,a,u=function(t,e){return function(){return t.apply(e,arguments)}},l={}.hasOwnProperty;o=r(2),i=window.require("spine/controller/container"),a=function(t,e,r){return Math.max(Math.min(r,Number(t)),e)},n=$("body"),s=function(t){function e(){var t,r,n;this.blur=u(this.blur,this),this._valToPos=u(this._valToPos,this),this._posToVal=u(this._posToVal,this),this.trackClick=u(this.trackClick,this),this.liveUpdate=u(this.liveUpdate,this),this.mouseToLocal=u(this.mouseToLocal,this),this.drag=u(this.drag,this),this.stopDrag=u(this.stopDrag,this),this.startDrag=u(this.startDrag,this),this.update=u(this.update,this),this.mouseEnterBody=u(this.mouseEnterBody,this),e.__super__.constructor.apply(this,arguments),(t=this.options).min||(t.min=0),(r=this.options).max||(r.max=1),(n=this.options).unit||(n.unit=""),this.text.bind("blur",this.blur)}return function(t,e){for(var r in e)l.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,o),e.include(i),e.prototype.template="core/views/slider",e.prototype.className="control-slider",e.prototype.elements={".input-slider-thumb":"thumb",".input-slider":"input",".input-slider-value":"text",".input-slider-container":"container"},e.prototype.events={"mousedown .input-slider-thumb":"startDrag","mousedown .input-slider":"trackClick","focus input":"focus","keydown input":"keydown"},e.prototype.pageX=0,e.prototype.isMouseDown=!1,e.prototype.mouseEnterBody=function(t){if(this.isMouseDown)return 1!==(t.buttons||t.which)?this.stopDrag(t):void 0},e.prototype.update=function(t,e,r){var n;if(null==r&&(r={}),!r.from||r.from!==this)return n=null!=t[this.attribute]?t[this.attribute]:this.options.default,this.thumb.css({left:this._valToPos(n)}),this.value(parseInt(a(n,this.options.min,this.options.max)))},e.prototype.startDrag=function(t){return this.isMouseDown=!0,t.stopPropagation(),t.preventDefault(),this.input.focus(),this.tw=this.thumb.width(),(n=$(this.el[0].ownerDocument.body)).bind("mousemove",this.drag).bind("mouseup",this.stopDrag).addClass("thumb-dragging").unbind("mouseenter",this.mouseEnterBody).bind("mouseenter",this.mouseEnterBody),clearInterval(this.interval),this.interval=setInterval(this.liveUpdate,100)},e.prototype.stopDrag=function(t){return n.unbind("mousemove",this.drag).unbind("mouseup",this.stopDrag).removeClass("thumb-dragging"),clearInterval(this.interval),this.liveUpdate(),this.isMouseDown=!1},e.prototype.drag=function(t){return t.preventDefault(),this.pageX=t.pageX,this.thumb.css({left:this.mouseToLocal()})},e.prototype.mouseToLocal=function(){return a(this.pageX-this.container.offset().left-this.tw/2,0,this.container.width()-this.tw)},e.prototype.liveUpdate=function(){var t;return t=this._posToVal(),this.value(parseInt(t)),this.item.updateAttribute(this.attribute,t,{attribute:this.attribute,from:this}),this},e.prototype.trackClick=function(t){return t.preventDefault(),this.tw=this.thumb.width(),this.pageX=t.pageX,this.thumb.animate({left:this.mouseToLocal()},300,this.liveUpdate)},e.prototype._posToVal=function(){return(this.options.max-this.options.min)*this.thumb.position().left/(this.container.width()-this.tw)+Number(this.options.min)},e.prototype._valToPos=function(t){var e,r;return e=this.container.width()-this.thumb.width(),r=100*(t-this.options.min)/(this.options.max-this.options.min)/100,e?a(e*r,0,e):a(100*r,0,100)+"%"},e.prototype.focus=function(){return this.text.val(this.lastValue)},e.prototype.value=function(t){var e;return null!=t?this.text.val((this.lastValue=t)+this.options.unit):isNaN(e=parseInt(this.text.val()))?+this.lastValue:e},e.prototype.blur=function(){var t;return t=a(this.value(),this.options.min,this.options.max),this.thumb.css({left:this._valToPos(t)}),this.value(parseInt(t)),this.item.updateAttribute(this.attribute,t,{attribute:this.attribute,from:this})},e.prototype.keydown=function(t){if(13===t.keyCode)return this.blur()},e.prototype.release=function(){return clearInterval(this.interval),e.__super__.release.apply(this,arguments)},e}(),t.exports=s},function(t,e,r){var n,i,o=function(t,e){return function(){return t.apply(e,arguments)}},s={}.hasOwnProperty;n=r(2),i=function(t){function e(){return this._editor=o(this._editor,this),this.release=o(this.release,this),this._change=o(this._change,this),this._load=o(this._load,this),this.render=o(this.render,this),this.update=o(this.update,this),e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var r in e)s.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,n),e.prototype.className="control-textarea loading",e.prototype.template="core/views/textarea",e.prototype.parserRules={tags:{b:{},i:{},u:{},br:{},a:{set_attributes:{target:"_blank",rel:"nofollow"},check_attributes:{href:"url"}}}},e.prototype.elements={textarea:"textarea",".toolbar":"toolbar"},e.prototype.update=function(t,e,r){var n;if(null==r&&(r={}),(n=null!=t[this.attribute]?t[this.attribute]:this.options.default)&&(!this.loaded||n!==this.editor.getValue()))return this.editor?this.editor.setValue(n):void 0},e.prototype.render=function(){var t;if(this.el.addClass("loading"),e.__super__.render.apply(this,arguments),null!=(t=this._editor()))return this.editor=new t(this.textarea[0],{parserRules:this.parserRules,placeholderText:this.options.placeholder,toolbar:this.toolbar[0],style:!0}).on("load",this._load).on("change",this._change),this.editor.on("focus",function(t){return function(e){if(!t.el.is(".focused"))return t.el.addClass("focused"),t.editor.currentView.element.style.overflow="auto"}}(this)),this.editor.on("blur",function(t){return function(e){if(t.el.is(".focused"))return t.el.removeClass("focused"),t.editor.currentView.element.scrollTop=0,t.editor.currentView.element.style.overflow="hidden"}}(this)),this},e.prototype.onDrop=function(){var t;return null!=(t=this.editor)&&t.stopObserving(),this.render()},e.prototype._load=function(){return this.loaded=!0,this.el.removeClass("loading")},e.prototype._change=function(){return this.change(this.editor.getValue())},e.prototype.release=function(){var t;return null!=(t=this.editor)&&t.stopObserving(),e.__super__.release.apply(this,arguments)},e.prototype._editor=function(){var t;return null!=(t=window.wysihtml5)?t.Editor:void 0},e}(),t.exports=i},function(t,e,r){var n,i,o,s=function(t,e){return function(){return t.apply(e,arguments)}},a={}.hasOwnProperty;i=r(2),n=window.require("spine/controller/container"),o=function(t){function e(){return this.render=s(this.render,this),this.toggle=s(this.toggle,this),this.update=s(this.update,this),e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var r in e)a.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.include(n),e.prototype.template="core/views/toggle",e.prototype.className="control-toggle",e.prototype.elements={".input-toggle-true":"true",".input-toggle-false":"false",".input-toggle":"input"},e.prototype.events={"click .input-toggle":"toggle"},e.prototype.update=function(t){var e;return e=null!=t[this.attribute]?t[this.attribute]:this.options.default,this.input.attr("data-value",String(e))},e.prototype.toggle=function(t){return null!=t&&t.stopPropagation(),this.item.updateAttribute(this.attribute,!("true"===this.input.attr("data-value")),{attribute:this.attribute,from:this})},e.prototype.render=function(){return this.labels=this.options.values_labels||[],e.__super__.render.apply(this,arguments)},e}(),t.exports=o},,function(t,e){var r,n,i,o={}.hasOwnProperty;r=window.require("spine/controller/activateable"),n=window.require("spine/controller/index"),i=function(t){function e(){var t,r;e.__super__.constructor.apply(this,arguments),r=(r=null!=this.panel.serviceTitle?this.panel.serviceTitle:this.panel.title)[0].toUpperCase()+r.slice(1),this.el.append(this.len=$('<div data-count="0"></div>')).addClass(this.panel.title).attr({"data-tooltip-text":r,"data-tooltip-position":"right center"}),(t=this.panel.options.icon)&&this.el.append('<div class="browser-tab--icon" style="background-image: url(\''+t+"')\"></div>")}return function(t,e){for(var r in e)o.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,n),e.prototype.className="browser-tab",e.prototype.events={click:"active"},e.include(r),e.prototype.count=function(t){return this.len.attr("data-count",t)},e}(),t.exports=i},function(t,e,r){var n,i,o={}.hasOwnProperty;i=r(52),n=function(t){function e(){var t;e.__super__.constructor.apply(this,arguments),null!=(t=this.item.className)&&this.el.addClass(t)}return function(t,e){for(var r in e)o.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.prototype.className="browser-entry browser-folder",e.prototype.events={click:"click"},e.prototype.update=function(){return this.el.attr("data-count",0)},e.prototype.click=function(){return this.item.trigger("select")},e}(),t.exports=n},function(t,e,r){var n,i,o=function(t,e){return function(){return t.apply(e,arguments)}},s={}.hasOwnProperty;n=r(15),i=function(t){function e(){return this.previewUrl=o(this.previewUrl,this),this.url=o(this.url,this),this.saveURL=o(this.saveURL,this),this.appendPreview=o(this.appendPreview,this),this.show=o(this.show,this),e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var r in e)s.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,n),e.prototype.className="browser-image",e.prototype.img=function(){return $('<span class="browser-image-prew_img"></span>').css({background:"url("+this.previewUrl()+") center center no-repeat",opacity:1})},e.prototype.show=function(){return e.__super__.show.apply(this,arguments),this.appendPreview()},e.prototype.appendPreview=function(){return!this._previewUrl&&this.preview.append(this.img())},e.prototype.saveURL=function(t){return this._previewUrl=t,this.appendPreview()},e.prototype.url=function(){return"function"==typeof this.getURL?this.getURL(this.item,this.saveURL):void 0},e.prototype.previewUrl=function(){return this._previewUrl||(this._previewUrl="function"==typeof this.getPreviewURL?this.getPreviewURL(this.item):void 0)||this.url()},e}(),t.exports=i},function(t,e,r){var n,i,o=function(t,e){return function(){return t.apply(e,arguments)}},s={}.hasOwnProperty;i=r(15),n=function(t){function e(){this.refresh=o(this.refresh,this),this.status=o(this.status,this),e.__super__.constructor.apply(this,arguments),this.deflt={volume:100,onpause:this.status,onstop:this.status,onresume:this.status,onfinish:this.status,onplay:this.status,fromController:"browser-audio"}}return function(t,e){for(var r in e)s.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.prototype.className="browser-audio",e.prototype.events={"click .browser-entry-info":"togglePlay"},e.prototype.status=function(){if(this.sound)return this.el.toggleClass("playing",!this.sound.paused&&1===this.sound.playState)},e.prototype.togglePlay=function(){var t,e,r,n;if(this.el.toggleClass("loading",!this.sound),n=function(t){return function(e){return t.item.url=e,t.sound=soundManager.createSound($.extend({url:e},t.deflt))||null,t.togglePlay()}}(this),this.sound){if(!this.el.is(".playing"))for(t in e=soundManager.sounds)"browser-audio"===(r=e[t]).instanceOptions.fromController&&r.id!==this.sound.id&&r.stop().setPosition(0);return this.sound.togglePause()}return this.$trigger("getURL",n)},e.prototype.release=function(){try{this.sound.destruct()}catch(t){}return this.sound=null,e.__super__.release.apply(this,arguments)},e.prototype.refresh=function(){var t;return null!=(t=this.sound)?t.pause():void 0},e}(),t.exports=n},function(t,e,r){var n,i,o={}.hasOwnProperty;n=r(15),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var r in e)o.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,n),e.prototype.className="browser-video",e}(),t.exports=i},function(t,e,r){var n,i,o={}.hasOwnProperty;n=r(15),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var r in e)o.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,n),e.prototype.className="browser-rss",e}(),t.exports=i},function(t,e,r){var n,i,o,s={}.hasOwnProperty,a=[].slice;i=window.require("spine/controller"),n=window.require("spine/controller/activateable"),r(53).default,o=r(150).default,t.exports=function(t){function e(t){var r,n;e.__super__.constructor.apply(this,arguments),this._initilized=new Promise(function(t){return function(e){return t._resolve=e}}(this)),r=(r=null!=(n=t.filetypes)?n:[]).join(","),this.options=Object.assign(t,{filetypes:r}),this.on("activate",function(t){return function(){return t.component||t._init(),t.component.activate()}}(this))}return function(t,e){for(var r in e)s.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.include(n),e.isCompatible=function(t){return!!t&&t.some(function(t){return"audio"===t||"image"===t||"video"===t})},e.prototype.className="browser activateable upload-browser",e.prototype.attributes={authenticated:!0},e.prototype.title="uploads",e.prototype._init=function(){return this.component=new o({target:this.el[0],data:this.options}),this.component.on("error",function(t){return function(e){return t.$trigger("error","Error: "+e.message)}}(this)),this.component.on("toggle",function(t){return function(e){return t.trigger("toggle",e)}}(this)),this.component.on("clearContent",function(t){return function(e){return t.trigger("clearContent",e)}}(this)),this.component.observe("loading",function(t){return function(e){return t.el.toggleClass("loading",e)}}(this)),this._resolve()},e.prototype.set=function(t){return this._initilized.then(function(e){return function(){return e.component.set(t)}}(this))},e.prototype.observe=function(){var t;return t=1<=arguments.length?a.call(arguments,0):[],this._initilized.then(function(e){return function(){var r;return(r=e.component).observe.apply(r,t)}}(this))},e}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(146),i=r.n(n),o=r(147),s=r(148),a=r(149),u=new i.a;e.default={init:function(t){u.constant("user",t.user),u.constant("uploadToken",t.uploadToken),u.service("Content",o.a,"user"),u.service("Uploads",s.a,"user","uploadToken"),u.service("Sounds",a.a)},instance:u.container}},function(t,e,r){"use strict";const n=["B","kB","MB","GB","TB","PB","EB","ZB","YB"];t.exports=function(t){if(!Number.isFinite(t))throw new TypeError("Expected a finite number, got "+typeof t+": "+t);const e=t<0;if(e&&(t=-t),t<1)return(e?"-":"")+t+" B";const r=Math.min(Math.floor(Math.log(t)/Math.log(1e3)),n.length-1),i=Number((t/Math.pow(1e3,r)).toPrecision(3));return(e?"-":"")+i+" "+n[r]}},function(t,e,r){"use strict";r.d(e,"a",function(){return m});var n=r(153),i=r(163),o=(r(117),r(116),r(164)),s=r(165),a=r(166),u=r(172);function l(t){"@babel/helpers - typeof";return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function c(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,_(n.key),n)}}function p(t,e,r){return e=h(e),function(t,e){if(e&&("object"===l(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,r||[],h(t).constructor):e.apply(t,r))}function h(t){return(h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function d(t,e){return(d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function f(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function g(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?f(Object(r),!0).forEach(function(e){y(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function y(t,e,r){return(e=_(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _(t){var e=function(t,e){if("object"!=l(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==l(e)?e:String(e)}var v=g(g({},n.a.defaultOptions),{},{httpStack:new s.a,fileReader:new a.a,urlStorage:o.b?new o.a:new i.a,fingerprint:u.a}),m=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),p(this,e,[t,r=g(g({},v),r)])}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&d(t,e)}(e,n["a"]),function(t,e,r){e&&c(t.prototype,e),r&&c(t,r),Object.defineProperty(t,"prototype",{writable:!1})}(e,null,[{key:"terminate",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e=g(g({},v),e),n.a.terminate(t,e)}}]),e}();"function"==typeof XMLHttpRequest&&"function"==typeof Blob&&Blob.prototype.slice},function(t,e,r){"use strict";function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,o(n.key),n)}}function o(t){var e=function(t,e){if("object"!=n(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==n(e)?e:String(e)}function s(t,e,r){return e=c(e),function(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,u()?Reflect.construct(e,r||[],c(t).constructor):e.apply(t,r))}function a(t){var e="function"==typeof Map?new Map:void 0;return(a=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return function(t,e,r){if(u())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var i=new(t.bind.apply(t,n));return r&&l(i,r.prototype),i}(t,arguments,c(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),l(r,t)})(t)}function u(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(u=function(){return!!t})()}function l(t,e){return(l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function c(t){return(c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var p=function(t){function e(t){var r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=s(this,e,[t])).originalRequest=i,r.originalResponse=o,r.causingError=n,null!=n&&(t+=", caused by ".concat(n.toString())),null!=i){var a=i.getHeader("X-Request-ID")||"n/a",u=i.getMethod(),l=i.getURL(),c=o?o.getStatus():"n/a",p=o?o.getBody()||"":"n/a";t+=", originated from request (method: ".concat(u,", url: ").concat(l,", response code: ").concat(c,", response text: ").concat(p,", request id: ").concat(a,")")}return r.message=t,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&l(t,e)}(e,a(Error)),function(t,e,r){return e&&i(t.prototype,e),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}(e)}();e.a=p},function(t,e,r){"use strict";e.a=function(t){if(!n)return;console.log(t)};var n=!1},function(t,e,r){"use strict";e.a=function(){return"undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase()}},function(t,e){var r,n,i,o=function(t,e){return function(){return t.apply(e,arguments)}},s={}.hasOwnProperty;i=window.require("spine/controller"),n=window.require("spine/controller/container"),r=function(t){function e(){var t,r,n,i,s,a;for(r in this.deactivate=o(this.deactivate,this),this.update=o(this.update,this),e.__super__.constructor.apply(this,arguments),this.length=0,a=this.options)s=a[r],this.isEditable(s)&&(t=window.require(s.control),void 0!==i&&null!==i||(i=t=window.require(this.det(s.control))),n=new t({options:$.extend(!0,{},s.options||{}),attribute:r,item:this.item,isDetailInput:!0,conditions:s.if}),this.append(n),this.el.toggleClass("no-attributes",++this.length<2))}return function(t,e){for(var r in e)s.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.prototype.className="item-details-attributes",e.include(n),e.prototype.update=function(){return this.delay(function(t){return function(){var e,r,n,i,o;for(o=[],r=0,n=(i=t.children()).length;r<n;r++)e=i[r],o.push(e.setItem(t.item));return o}}(this))},e.prototype.det=function(t){return/audio|video|image/.test(t)?t.replace("core/controls/","core/controls/details/"):t},e.prototype.deactivate=function(){return this.children(function(t){return"function"==typeof t.deactivate?t.deactivate():void 0})},e.prototype.isEditable=function(t){return!1!==t.options.editable},e.prototype.onDrop=function(){return this.children(function(t){return"function"==typeof t.onDrop?t.onDrop():void 0})},e}(),t.exports=r},function(t,e){var r,n,i=function(t,e){return function(){return t.apply(e,arguments)}},o={}.hasOwnProperty,s=[].indexOf||function(t){for(var e=0,r=this.length;e<r;e++)if(e in this&&this[e]===t)return e;return-1};r=window.require("spine/controller/activator"),window.require("core/models/content"),window.require("core/models/composition"),n=function(t){function e(){return this.setOptions=i(this.setOptions,this),this._active=i(this._active,this),this.init=i(this.init,this),e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var r in e)o.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,r),e.prototype.className="editor-footer",e.prototype.containerClass="editor-breadcrumbs",e.prototype.events={"click .editor-next-btn":"getStep","click .editor-prev-btn":"getStep"},e.prototype.init=function(){return this.prevBtn=$("<div class='editor-prev-btn' data-dir='prev'>prev</div>"),this.nextBtn=$("<div class='editor-next-btn' data-dir='next'></div>"),this.append(this.prevBtn,this.nextBtn),e.__super__.init.apply(this,arguments)},e.prototype.getStep=function(t){var e,r;if(e=this.children(function(t){return t.isActive()})[0])return r=e.el[$(t.target).data("dir")]().controller().panel.title.toLowerCase(),this.$trigger("Footer:step",r)},e.prototype._active=function(t){return this.ctrl=t,e.__super__._active.apply(this,arguments),this.prevBtn.toggleClass("disabled",null==this.ctrl.el.prev().controller())},e.prototype.setOptions=function(t){if(null!=t.enabled&&this.el.toggle(t.enabled),t.steps)return this.children(function(e){var r;if(r=e.panel.title.toLowerCase(),s.call(t.steps,r)<0)return e.el.remove()}),this._active(this.ctrl)},e}(),t.exports=n},function(t,e){t.exports=function(){var t,e;return"e_gd_c",e=1e4,t={},{init:function(t,r){return t,e=r},clear:function(e,r){var n;return r?null!=(n=t[e])?n[r]=null:void 0:t[e]={}},set:function(r,n,i){return(t[r]||(t[r]={}))[n]=i,t[r][n].__exp__=+new Date+e},check:function(e,r){var n,i;return(null!=(n=t[e])&&null!=(i=n[r])?i.__exp__:void 0)>+new Date},get:function(e,r){var n;return null!=(n=t[e])?n[r]:void 0}}}()},function(t,e){t.exports=new Promise(function(t){var e,r,n;return e=function(){return gapi.load("client:auth2",function(){return gapi.client.init({apiKey:"AIzaSyDNHyaQxinEYqwuGTTy1pJeEC09ewAxNNM",clientId:"30789742875.apps.googleusercontent.com",discoveryDocs:["https://www.googleapis.com/discovery/v1/apis/drive/v3/rest"],scope:"https://www.googleapis.com/auth/drive"}).then(t)})},(r=document.createElement("script")).type="text/javascript",r.async=!0,r.src="https://apis.google.com/js/api.js",r.onload=e,(n=document.getElementsByTagName("script")[0]).parentNode.insertBefore(r,n)})},function(t,e,r){var n,i,o={}.hasOwnProperty;n=r(14),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var r in e)o.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,n),e.prototype.className="popup login-popup share-file-popup",e.prototype.confirmBtnClass="green-button button--uc",e.prototype.cancelBtnClass="dim-button button--uc",e.prototype.title="Only public files can be embedded.",e.prototype.content="Do you want to share this file publicly?",e.prototype.note="",e.prototype.separator=!1,e.prototype.confirmBtn="Make public",e.prototype.cancelBtn="Cancel",e}(),t.exports=new i},,,,,,function(t,e,r){function n(t,e,r){this.name="AjaxError",this.message=e,this.jqXHR=t,this.errorThrown=r}n.prototype=new Error,n.prototype.constructor=n,function(t){var e=t.ajax;t.ajax=function(){var t=Array.prototype.slice.call(arguments),r=e.apply(this,t);return function t(e){return e.done=function(r){return t(e.then(r))},e.fail=function(r){return t(e.then(null,r))},e.complete=function(r){return t(e.then(r,r))},e}(new Promise(function(t,e){r.then(function(e,r,n){t(e)},function(t,r,i){e(new n(t,r,i))})}))}}(jQuery);var i=function(t,e){return e?function(r,n,i){i.exports=t(e)}:function(e,r,n){n.exports=t}};function o(t,e){var r=/^\.\/(.+)\.(pug|coffee)$/;t.keys().forEach(function(n){var o=r.exec(n)[1];e&&(o=e+o),window.require.define(o,i(t,n))})}window.soundManager=r(130).soundManager,window.require.define({"editor/listeners/embed-listener":i(r(131))}),o(r(58)),o(r(183),"core/controls/"),o(r(185),"editor/content/service/"),o(r(196),"browser/controller/")},function(t,e,r){(function(t){var n;
|
|
1
|
+
!function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=128)}([function(t,e,r){"use strict";var n=Object.prototype.hasOwnProperty;function i(t,e){return Array.isArray(t)?function(t,e){for(var r,n="",o="",s=Array.isArray(e),a=0;a<t.length;a++)(r=i(t[a]))&&(s&&e[a]&&(r=u(r)),n=n+o+r,o=" ");return n}(t,e):t&&"object"==typeof t?function(t){var e="",r="";for(var i in t)i&&t[i]&&n.call(t,i)&&(e=e+r+i,r=" ");return e}(t):t||""}function o(t){if(!t)return"";if("object"==typeof t){var e="";for(var r in t)n.call(t,r)&&(e=e+r+":"+t[r]+";");return e}return";"!==(t+="")[t.length-1]?t+";":t}function s(t,e,r,n){return!1!==e&&null!=e&&(e||"class"!==t&&"style"!==t)?!0===e?" "+(n?t:t+'="'+t+'"'):("function"==typeof e.toJSON&&(e=e.toJSON()),"string"==typeof e||(e=JSON.stringify(e),r||-1===e.indexOf('"'))?(r&&(e=u(e))," "+t+'="'+e+'"'):" "+t+"='"+e.replace(/'/g,"'")+"'"):""}e.merge=function t(e,r){if(1===arguments.length){for(var n=e[0],i=1;i<e.length;i++)n=t(n,e[i]);return n}for(var s in r)if("class"===s){var a=e[s]||[];e[s]=(Array.isArray(a)?a:[a]).concat(r[s]||[])}else if("style"===s){var a=o(e[s]),u=o(r[s]);e[s]=a+u}else e[s]=r[s];return e},e.classes=i,e.style=o,e.attr=s,e.attrs=function(t,e){var r="";for(var a in t)if(n.call(t,a)){var u=t[a];if("class"===a){u=i(u),r=s(a,u,!1,e)+r;continue}"style"===a&&(u=o(u)),r+=s(a,u,!1,e)}return r};var a=/["&<>]/;function u(t){var e=""+t,r=a.exec(e);if(!r)return t;var n,i,o,s="";for(n=r.index,i=0;n<e.length;n++){switch(e.charCodeAt(n)){case 34:o=""";break;case 38:o="&";break;case 60:o="<";break;case 62:o=">";break;default:continue}i!==n&&(s+=e.substring(i,n)),i=n+1,s+=o}return i!==n?s+e.substring(i,n):s}e.escape=u,e.rethrow=function t(e,n,i,o){if(!(e instanceof Error))throw e;if(!("undefined"==typeof window&&n||o))throw e.message+=" on line "+i,e;try{o=o||r(49).readFileSync(n,"utf8")}catch(r){t(e,null,i)}var s=3,a=o.split("\n"),u=Math.max(i-s,0),l=Math.min(a.length,i+s);var s=a.slice(u,l).map(function(t,e){var r=e+u+1;return(r==i?" > ":" ")+r+"| "+t}).join("\n");e.path=n;e.message=(n||"Pug")+":"+i+"\n"+s+"\n\n"+e.message;throw e}},,function(t,e,r){var n,i,o,s,a=function(t,e){return function(){return t.apply(e,arguments)}},u={}.hasOwnProperty;i=window.require("spine/controller"),s=document.createElement("textarea"),o=r(39),n=function(t){function e(t){var r;this.onEditStateChanged=a(this.onEditStateChanged,this),this.toggleEditState=a(this.toggleEditState,this),this.initEditableState=a(this.initEditableState,this),this.release=a(this.release,this),this._onChange=a(this._onChange,this),this.setItem=a(this.setItem,this),null==t.isAccesible&&(t.isAccesible=!0),e.__super__.constructor.apply(this,arguments),this.options.label&&this.el.attr("data-label",this.options.label),this.el.toggleClass("control--restricted",!this.isAccesible),this.render(),null!=(r=this.item)&&r.constructor.bind("change",this._onChange),null!=this.item&&this._onChange(this.item),this.options.editable&&this.initEditableState()}return function(t,e){for(var r in e)u.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.prototype.className="control",e.prototype.elements={".control-help":"helpText",".control-edit-btn input":"editBtnInput"},e.prototype.events={"input .custom-checkbox-input":"onEditStateChanged","click .control-upgrade":"onUpgradeClick"},e.prototype.setItem=function(t){return this.item=t,this._onChange(this.item)},e.prototype.update=function(){},e.prototype.change=function(t,e){var r;if(null==e&&(e={}),!e.silent)return null!=(r=this.item)&&r.updateAttribute(this.attribute,t,$.extend({attribute:this.attribute,from:this},e)),this.trigger("change:"+(this.type||"control"),{attribute:this.attribute,val:t,value:t})},e.prototype._onChange=function(t,e,r){if(null==r&&(r={}),t&&t.eql(this.item)){if(r.changedID&&(this.item=t),"destroy"===e)return this.release();if(this.el.toggleClass("control--hidden",!this.shouldShow()),null==r.attribute||r.attribute===this.attribute)return this.update(t,e,r)}},e.prototype.shouldShow=function(){return o(this.conditions,this.item)},e.prototype.release=function(){var t;return clearTimeout(this.interval),null!=(t=this.unbind().item)&&t.constructor.unbind("change",this._onChange),e.__super__.release.apply(this,arguments),this},e.prototype.initEditableState=function(){return this.editBtnInput.prop("checked",!!this.item.editedMeta(this.attribute)),this.editBtnInput.bind("change",this.onEditStateChanged),this.bind("change:"+(this.type||"control"),this.toggleEditState)},e.prototype.toggleEditState=function(t){return this.editBtnInput.prop("checked",!0),this.onEditStateChanged()},e.prototype.onEditStateChanged=function(){return this.item.editedMeta(this.attribute,this.editBtnInput.is(":checked"))},e.prototype.onUpgradeClick=function(t){return t.preventDefault(),this.$trigger("Control:upgrade",this.options)},e.prototype.render=function(){return e.__super__.render.apply(this,arguments),this.el.get(0)&&this.setWindow(),this.helpText.attr({"data-tooltip-position":"8% 3%","data-tooltip-text":this.options.help_text})},e.prototype.setWindow=function(t){var e;return this.$window=$(this.window=t||(null!=(e=this.el.get(0))?e.ownerDocument.defaultView:void 0))},e.prototype.htmlEntities=function(t){return s.innerHTML=t,s.innerHTML},e.prototype.unescapeHtmlEntities=function(t){return s.innerHTML=t,s.innerText||s.textContent},e}(),t.exports=n},function(t,e,r){var n,i,o,s,a,u,l=function(t,e){return function(){return t.apply(e,arguments)}},c={}.hasOwnProperty,p=[].slice;n=r(2),a=Math.min,s=Math.max,u=Math.round,o=function(t,e,r){return s(e,a(r,+t))},$("body"),i=function(t){function e(){var t,r,n,i,o,s;this.stopoinc=l(this.stopoinc,this),this.mousedown=l(this.mousedown,this),this.blur=l(this.blur,this),this.focus=l(this.focus,this),this.update=l(this.update,this),this.mouseEnterBody=l(this.mouseEnterBody,this),e.__super__.constructor.apply(this,arguments),(t=this.options).step||(t.step=1),(r=this.options).max||(r.max=10),(n=this.options).min||(n.min=0),(i=this.options).default||(i.default=0),(o=this.options).unit||(o.unit=""),this.change((null!=(s=this.item)?s[this.attribute]:void 0)||this.options.default||0,{silent:!0})}return function(t,e){for(var r in e)c.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,n),e.prototype.className="control control-stepper",e.prototype.template="core/views/stepper",e.prototype.type="stepper",e.prototype.elements={".control-input":"input"},e.prototype.events={"mousedown .spinner-button":"mousedown","keydown input":"keydown"},e.prototype.isMouseDown=!1,e.prototype.mouseEnterBody=function(t){if(this.isMouseDown)return 1!==(t.buttons||t.which)?this.stopoinc(t):void 0},e.prototype.limit=function(t){return o(parseInt(t),this.options.min,this.options.max)},e.prototype.update=function(t,e,r){var n;if(null==r&&(r={}),!r.from||r.from!==this)return n=parseInt(null!=t[this.attribute]?t[this.attribute]:this.options.default)||0,this.change(n,{silent:!0})},e.prototype.value=function(t){var e;return null!=t?this.input.val(t):isNaN(e=parseInt(this.input.val()))?+this.lastValue:e},e.prototype.change=function(){var t,r;return r=arguments[0],t=2<=arguments.length?p.call(arguments,1):[],this.lastValue=this.limit(r),e.__super__.change.apply(this,[this.lastValue].concat(p.call(t))),this.value(u(this.lastValue)+this.options.unit)},e.prototype.render=function(){var t;return this.input.unbind("blur").unbind("focus"),e.__super__.render.apply(this,arguments),this.input.bind({blur:this.blur,focus:this.focus}),this.change((null!=(t=this.item)?t[this.attribute]:void 0)||this.options.default||0,{silent:!0}),this},e.prototype.focus=function(){return this.value(parseInt(this.value()))},e.prototype.blur=function(){var t;return this.change(t=this.limit(parseFloat(this.value())),{silent:this.lastValue===t})},e.prototype.keydown=function(t){if(13===t.keyCode)return this.blur()},e.prototype.incdec=function(t){return this.change(this.limit(parseInt(this.value())+t))},e.prototype.mousedown=function(t){var e,r;return t.preventDefault(),this.isMouseDown=!0,clearInterval(this.interval),$(this.el[0].ownerDocument.body).one("mouseup",this.stopoinc).unbind("mouseenter",this.mouseEnterBody).bind("mouseenter",this.mouseEnterBody),e=$(t.target).hasClass("spinner-up")?1:-1,e*=this.options.step,this.incdec(e),r=function(t){return function(){return t.incdec(e),clearTimeout(t.timeout),t.interval=setInterval(function(){return t.incdec(e)},100)}}(this),this.timeout=setTimeout(r,300)},e.prototype.stopoinc=function(t){return this.isMouseDown=!1,clearInterval(this.interval),clearTimeout(this.timeout)},e}(),t.exports=i},function(t,e,r){var n,i,o,s,a,u=function(t,e){return function(){return t.apply(e,arguments)}},l={}.hasOwnProperty;n=r(11),o="validate invalid valid",a=/^((https?|ftp):\/\/)?((\w+|\*)\.)?[0-9a-z\-]+(\.([a-z]+|\*))?\.([a-z]+|\*)/i,s=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,i=function(t){function e(){this.testURLisValid=u(this.testURLisValid,this),this.onValidURL=u(this.onValidURL,this),this.onInvalidURL=u(this.onInvalidURL,this),this.onBlur=u(this.onBlur,this),this.updateState=u(this.updateState,this),this._onValidationComplete=u(this._onValidationComplete,this),this._checkURL=u(this._checkURL,this),this.checkURL=u(this.checkURL,this),this.onInput=u(this.onInput,this),e.__super__.constructor.apply(this,arguments),this.options.regex&&(a=this.options.regex),this.input.bind("blur",this.onBlur),this.lastURL&&this.checkURL(this.lastURL,{silent:!0})}return function(t,e){for(var r in e)l.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,n),e.prototype.className="control control-url",e.prototype.type=null,e.prototype.lastURL=null,e.prototype.events={"input input":"onInput","keyup input":"onInput","focus input":"onFocus",invalid:"onInvalidURL",valid:"onValidURL"},e.prototype.elements={input:"input"},e.prototype.onInput=function(t){if(13===t.which)return this.onBlur(t)},e.prototype.checkURL=function(t,e){return this.opts=null!=e?e:{},!(null!=t?t.length:void 0)&&this.options.allowEmpty?(this.lastURL=t,this._onValidationComplete(!0),this):(this.el.removeClass(o),this.lastURL=t,this.type?this.testURLisValid(t)?(this.$addClass("validate"),this._checkURL(t).then(function(t){return function(){return t._onValidationComplete(!0)}}(this)).fail(function(t){return function(){return t._onValidationComplete(!1)}}(this)),this):this._onValidationComplete(!1):this._onValidationComplete(!t.length||this.testURLisValid(t)))},e.prototype._checkURL=function(t){var e;return(e=Widgetic.Aye.defer()).resolve(),e.promise},e.prototype._onValidationComplete=function(t){if(this.$trigger(this.updateState(t)),!(this.silent||this.item&&this.item[this.attribute]===this.lastURL))return this.onURL(t)},e.prototype.updateState=function(t){return this.state=t?"valid":"invalid"},e.prototype.onURL=function(t,e){return null==e&&(e={}),!this.silent&&t&&this.onValidURL(),t&&this.change(this.lastURL,$.extend(this.opts,e)),this},e.prototype.onBlur=function(t){var r;return this.lastURL===(r=$(t.target).val())&&this.state?this.$trigger(this.state):(this.options.allow_email&&/@/.test(r)||!r||/^(https?|ftp):\/\//i.test(r)||(r="http://"+r),this.isNew()&&!r||this.checkURL(r),e.__super__.onBlur.apply(this,arguments))},e.prototype.onFocus=function(){return this.$removeClass("invalid")},e.prototype._change=function(){},e.prototype.onInvalidURL=function(){if(this.$removeClass(o).$addClass("invalid"),!this.silent)return this.onURL(!1)},e.prototype.onValidURL=function(){return this.$removeClass(o).$addClass("valid")},e.prototype.testURLisValid=function(t){return this.options.allow_email?a.test(t)||s.test(t):a.test(t)},e}(),t.exports=i},function(t,e){var r,n,i,o=function(t,e){return function(){return t.apply(e,arguments)}};i=function(t){return t.preventDefault()},r=function(){function t(t,e){this.el=t,null==e&&(e={}),this.bindEvents=o(this.bindEvents,this),this.render(),this.callbacks=e.callbacks,delete e.callbacks,this.$box.nanoScroller(this.options=$.extend(!0,{},this.defaults,e)),this.bindEvents(this.callbacks)}return t.prototype.defaults={preventPageScrolling:!0,disableResize:!0,contentClass:"scroll-content",alwaysVisible:!1,paneClass:"scroll-pane"},t.prototype.render=function(){var t;return t=$('<div class="scroll-content"></div>'),this.$box=$('<div class="nano scrolling-container">'),this.el.append(this.$box.append(t.append(this.el.children()))).addClass("scroll-box"),this.container=t},t.prototype.update=function(){return this.$box.nanoScroller(),this},t.prototype.scrollTo=function(t,e){return null==e&&(e={}),t="number"==typeof t?{scrollTop:t}:{scrollTo:t},this.$box.nanoScroller(t),this},t.prototype.detach=function(){return this},t.prototype.disable=function(){return this.$box.nanoScroller({stop:!0}),this.container.bind("mousewheel",i),this},t.prototype.enable=function(){return this.container.unbind("mousewheel",i),this.update()},t.prototype.offset=function(){return{top:this.container.scrollTop(),left:this.container.scrollLeft()}},t.prototype.bindEvents=function(t){return this.$box.bind("update",t.whileScrolling),this.$box.bind("update",t.onScroll)},t}(),n={onScroll:function(){},whileScrolling:function(){},scroll:function(){var t;return t={callbacks:{onScroll:this.onScroll,whileScrolling:this.whileScrolling}},this._scroll||(this._scroll=new r(this.scrollContainer||this.el,$.extend(!0,{},t,this.scrollOptions)),this.bind("release",function(t){return function(){return t.delay(function(){return t._scroll.detach()})}}(this)),this.container=this._scroll.container),this._scroll}},t.exports=n},function(t,e){var r,n,i=function(t,e){return function(){return t.apply(e,arguments)}},o={}.hasOwnProperty,s=[].indexOf||function(t){for(var e=0,r=this.length;e<r;e++)if(e in this&&this[e]===t)return e;return-1};r=window.require("spine/controller"),n=function(t){function e(){this.getProperties=i(this.getProperties,this),this.updateMarker=i(this.updateMarker,this),this.change=i(this.change,this),this.update=i(this.update,this),this.updatePanelSize=i(this.updatePanelSize,this),e.__super__.constructor.apply(this,arguments),this.refresh()}return function(t,e){for(var r in e)o.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,r),e.prototype.document=$(document),e.prototype.isTouch=s.call(window,"ontouchstart")>=0,e.prototype.elements={".positionPanelWrapper":"positionPanel",".dragPanel":"dragPanel","span.markDown":"marker",".reference-input":"referenceInput"},e.prototype.maxX=100,e.prototype.maxY=100,e.prototype.initW=275,e.prototype.initH=138,e.prototype.markerTop=0,e.prototype.markerLeft=0,e.prototype.reference={x:"center",y:"center"},e.prototype.updatePanelSize=function(t,e){var r,n,i,o;return i=parseFloat(this.initW/(e/this.initH)),n=parseFloat(this.initH/(t/this.initW)),o=this.initW*i/n,r=this.initH,o>this.initW&&(r=this.initH*n/i,o=this.initW),this.positionPanel.css({width:o,height:r})},e.prototype.prevent=function(t){if(null!=t.stopPropagation()&&t.stopPropagation(),null!=t.preventDefault())return t.preventDefault()},e.prototype.update=function(t,e,r){var n,i;if(null==r&&(r={}),t&&r.from!==this){for(n in t)i=t[n],this[n]=i;return this.updateMarker(),this.referenceInput.text(this.reference.y+" - "+this.reference.x)}},e.prototype.change=function(){return this.el.trigger("change",{attributes:{x:this.x,y:this.y,reference:this.reference},from:this})},e.prototype.updateMarker=function(){return this.marker.css({left:this.x+"%",top:this.y+"%"}).attr("reference",this.reference.x+" "+this.reference.y)},e.prototype.refresh=function(){return this.refreshElements(),this.getProperties()},e.prototype.setDocument=function(t){return this.document=t,this},e.prototype.getProperties=function(){return this.maxHeight=this.dragPanel.height(),this.maxWidth=this.dragPanel.width(),this.markerWidth=this.marker.outerWidth()/2,this.markerHeight=this.marker.outerHeight()/2,this.offset=this.dragPanel.offset()},e}(),t.exports=n},function(t,e,r){var n,i,o,s=function(t,e){return function(){return t.apply(e,arguments)}},a={}.hasOwnProperty;n=r(2),o=function(){return!1},i=function(t){function e(){this.updateOptions=s(this.updateOptions,this),this.focus=s(this.focus,this),this.blur=s(this.blur,this),this.deactivate=s(this.deactivate,this),this.enable=s(this.enable,this),this.disable=s(this.disable,this),this.click=s(this.click,this),this.update=s(this.update,this),this.reposition=s(this.reposition,this),this.calculateDimensions=s(this.calculateDimensions,this),this._onFocus=s(this._onFocus,this),this._onBlur=s(this._onBlur,this),this._onClick=s(this._onClick,this),e.__super__.constructor.apply(this,arguments),this.$window.bind("resize",this.reposition).bind("mousewheel scroll",this.blur),this.updateOptions(this.options)}return function(t,e){for(var r in e)a.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,n),e.prototype.className="control control-dropdown",e.prototype.template="core/views/dropdown",e.prototype.type="dropdown",e.prototype.elements={".input-dropdown":"input",".input-dropdown-default span":"default",".input-dropdown-list":"list",".input-dropdown-list li":"items"},e.prototype.events={"mousedown .input-dropdown":o,"mousedown .input-dropdown-list":o,"click .input-dropdown":"_onClick"},e.prototype._onClick=function(){return this[this.list.is(":visible")?"_onBlur":"_onFocus"]()},e.prototype._onBlur=function(){return this.list.hide()},e.prototype._onFocus=function(){return this.reposition().show(),this.delay(function(t){return function(){return $(t.window.document).on("click",t.blur)}}(this))},e.prototype.render=function(){var t;return e.__super__.render.apply(this,arguments),this.items.bind("mousedown",this.click),this.change((null!=(t=this.item)?t[this.attribute]:void 0)||this.options.default,{silent:!0}),this.reposition(),(this.body=$(this.window.document.body)).append(this.list),this},e.prototype.calculateDimensions=function(){return this.elHeight=this.el.height(),this.listHeight=this.list.height(),this.inputWidth=this.input.width(),this.offset=this.el.offset(),this.offset.bottom=this.offset.top+this.elHeight+this.listHeight-this.$window.scrollTop()},e.prototype.reposition=function(){var t,e,r;return this.calculateDimensions(),e=this.offset.bottom>this.$window.height()?this.input.offset().top-this.listHeight:this.offset.top+this.elHeight-1,t=this.offset.left,r=this.inputWidth-2,this.list.css({top:e,left:t,width:r})},e.prototype.update=function(t,e,r){var n;return null==r&&(r={}),r.from&&r.from===this?this:this.change(null!=(n=this.item)?n[this.attribute]:void 0,{silent:!0})},e.prototype.change=function(t){var r,n;if(e.__super__.change.apply(this,arguments),null!=t&&(n=RegExp("^"+t+"$","ig"),r=this.options.options.filter(function(t){return n.test(t.value+"")})[0]))return this.default.text(r.label),this.list.find("[data-value='"+r.value+"']").addClass("active").siblings().removeClass("active")},e.prototype.click=function(t){var e;return(e=$(t.target)).addClass("active").siblings().removeClass("active"),this.change(e.attr("data-value")),this.blur(),!1},e.prototype.disable=function(){return this.$addClass("disabled").default.text(this.options.disabledText)},e.prototype.enable=function(){var t,e;return this.$removeClass("disabled").change((null!=(t=this.item)?t[this.attribute]:void 0)||this.options.default||(null!=(e=this.options.options[0])?e.value:void 0))},e.prototype.deactivate=function(){return this.blur()},e.prototype.blur=function(){return $(this.window.document).unbind("click",this.blur),this._onBlur()},e.prototype.focus=function(){return this._onFocus()},e.prototype.updateOptions=function(t){return this.options=$.extend({},this.options,t),this.list.remove(),this.render(this._onBlur()),this.el.toggleClass("disabled",this.options.options.length<=1)},e}(),t.exports=i},function(t,e,r){var n,i,o,s,a={}.hasOwnProperty;o=window.require("spine/core/module"),i=window.require("spine/core/events"),n=r(9),s=function(t){function e(t,r){e.__super__.constructor.apply(this,arguments),this.title=t,this.root=new n({type:"folder",path:"/",root:!0}),this.options=r,this.listenTo(this,"auth",function(t){return function(){return clearTimeout(t.authFailInterval)}}(this))}return function(t,e){for(var r in e)a.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,o),e.browser="browser/controller",e.authenticating=!1,e.include(i),e.prototype.auth=function(){if(!this.authenticating)return this.authenticating=!0,setTimeout(function(t){return function(){return t.authenticating=!1}}(this),300),clearTimeout(this.authFailInterval),this.authFailInterval=setTimeout(function(t){return function(){return t.trigger("auth",t.authenticated=!1)}}(this),3e3),this._auth.apply(this,arguments)},e}(),t.exports=s},function(t,e){var r,n,i,o={}.hasOwnProperty;i=window.require("spine/core/module"),n=window.require("spine/core/events"),r=function(t){function e(t){var r,n;for(r in null==t&&(t={}),e.__super__.constructor.apply(this,arguments),t)n=t[r],t.hasOwnProperty(r)&&"function"==typeof this[r]?this[r](n):this[r]=n}return function(t,e){for(var r in e)o.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.include(n),e.prototype.stat=0,e}(),t.exports=r},function(t,e){var r,n,i,o,s=function(t,e){return function(){return t.apply(e,arguments)}},a=[].slice;i=new $.Deferred,o=i.promise(),r=function(){function t(){this._getFontList=s(this._getFontList,this),this.loadFontList=s(this.loadFontList,this),this.loadGoogleFont=s(this.loadGoogleFont,this),this.loadFontLoader()}return t.prototype.fontList={},t.prototype.loadFontLoader=function(){var t,e;return(e=document.createElement("script")).src="https://ajax.googleapis.com/ajax/libs/webfont/1.6.16/webfont.js",e.type="text/javascript",e.async="true",e.onload=function(){return i.resolve()},(t=document.getElementsByTagName("script")[0]).parentNode.insertBefore(e,t)},t.prototype.load=function(t,e,r){return null==t&&(t={}),null==e&&(e=window),o.then(function(){var i;return i=t.families[0],r||(r=t.source||"google"),null!=e.fontDefs&&null!=e.fontDefs[i]?e.fontDefs[i]:(e.fontDefs||(e.fontDefs={}),e.fontDefs[i]="local"===r?(new $.Deferred).resolve().promise():n.loadGoogleFont(t,e))})},t.prototype.loadGoogleFont=function(t,e){var r;return r=new $.Deferred,WebFont.load({google:t,context:e,fontactive:function(t){return function(){return t.resolve(arguments)}}(r),fontinactive:function(t){return function(){return t.resolve(arguments)}}(r),timeout:600}),r.promise()},t.prototype.loadFontList=function(){var t;return null!=this.fontListRdy?this.fontListRdy:(t=Blogvio.Aye.defer(),this._getFontList().then(function(e){return function(){var r,n;return t.resolve($.extend.apply($,[{}].concat(a.call(function(){var t,e;for(r in e=[],t=this.fontList)n=t[r],e.push(n);return e}.call(e)))))}}(this)),this.fontListRdy=t.promise)},t.prototype._getFontList=function(){var t,e;return t=new $.Deferred,e=function(e,r){var n;if(e){for(n in r)r[n],r[n].source=e;this.fontList[e]=r}else this.fontList=$.extend({},this.fontList,r);if(null!=this.fontList.google&&null!=this.fontList.local)return t.resolve()},$.getJSON("/fonts-list").then(e.bind(this,null)),$.getJSON("/fonts.json").then(e.bind(this,"local")),t.promise()},t}(),t.exports=n=new r},function(t,e,r){var n,i,o,s=function(t,e){return function(){return t.apply(e,arguments)}},a={}.hasOwnProperty;i=r(2),n=window.require("core/models/content"),o=function(t){function e(){this.isContentItem=s(this.isContentItem,this),this.destroy=s(this.destroy,this),this.isEmpty=s(this.isEmpty,this),this.isNew=s(this.isNew,this),this.onBlur=s(this.onBlur,this),this._change=s(this._change,this),this.update=s(this.update,this),this.render=s(this.render,this),e.__super__.constructor.apply(this,arguments),this.lengthLimit=this.options.lengthLimit||1e3,this.options.readonly?this.input.attr("readonly",!0):(this.input.bind("input",this._change),this.input.bind("blur",this.onBlur))}return function(t,e){for(var r in e)a.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.prototype.template="core/views/text",e.prototype.className="control-text",e.prototype.elements={"input[type=text]":"input"},e.prototype.render=function(){return e.__super__.render.apply(this,arguments),this.item&&this.update(this.item),this},e.prototype.update=function(t,e,r){var n;if(null==r&&(r={}),n=null!=t[this.attribute]?t[this.attribute]:this.options.default,this.unescapeHtmlEntities(n||"")!==this.input.val())return this.input.val(this.unescapeHtmlEntities(n||""))},e.prototype._change=function(){return this.change(this.htmlEntities(this.input.val().slice(0,this.lengthLimit)))},e.prototype.onBlur=function(){if(!this.isDetailInput)return this.isContentItem()&&!this.isNew()&&this.isEmpty()?this.destroy():void 0},e.prototype.isNew=function(){return!!this.item&&null==this.item[this.attribute]},e.prototype.isEmpty=function(){return!!this.item&&!this.item[this.attribute]},e.prototype.destroy=function(){return this.item.destroy()},e.prototype.isContentItem=function(){return this.item instanceof n},e}(),t.exports=o},function(t,e){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e){var r,n,i,o=function(t,e){return function(){return t.apply(e,arguments)}};n=function(t){var e;for(e=[];t;){if(e.push(t),"HTML"===t.tagName)return e.push(document),e.push(window),e;t=t.parentElement}},i=function(t){return new Promise(function(e,n){return e(new r(t))})},r=function(){function t(t){var e,r,n;e=t.anchor,n=t.topOffset,r=t.leftOffset,this.hideOnClickOutside=o(this.hideOnClickOutside,this),this.window=window,this.visible=!1,this.anchor=e[0],this.topOffset=n||0,this.leftOffset=r||0,this.el=document.createElement("div"),this.el.style="position:absolute;top: 0; left: 0; display: none;",document.body.appendChild(this.el)}return t.prototype.append=function(t){return this.el.appendChild(t[0])},t.prototype.hide=function(){return this.visible=!1,this.el.style.display="none",document.removeEventListener("click",this.hideOnClickOutside)},t.prototype.show=function(){return this.visible=!0,this.el.style.display="block",this.position(),setTimeout(function(t){return function(){return document.addEventListener("click",t.hideOnClickOutside)}}(this))},t.prototype.resize=function(){},t.prototype.position=function(){var t,e,r,n,i,o,s,a;return i=(r=this.anchor.getBoundingClientRect()).top,e=r.left,a=(n=this.el.getBoundingClientRect()).width,t=n.height,s=window.innerWidth,o=window.innerHeight,e+=this.leftOffset,i+=this.topOffset,e=Math.max(0,Math.min(s-a,e-a)),i=Math.max(0,Math.min(o-t,i)),this.el.style.left=e+"px",this.el.style.top=i+"px"},t.prototype.hideOnClickOutside=function(t){if(this.visible&&!(t.path||t.composedPath&&t.composedPath()||n(t.target)).includes(this.el))return this.hide()},t.prototype.release=function(){return this.el.parentNode.removeChild(this.el),document.removeEventListener("click",this.hideOnClickOutside)},t}(),t.exports={createPopup:i,Popup:r}},function(t,e,r){var n,i,o=function(t,e){return function(){return t.apply(e,arguments)}},s={}.hasOwnProperty;n=window.require("spine/controller"),i=function(t){function e(){this._close=o(this._close,this),this._remove=o(this._remove,this),this.pop=o(this.pop,this),this.onCancel=o(this.onCancel,this),this.onConfirm=o(this.onConfirm,this),this.close=o(this.close,this),this.cancel=o(this.cancel,this),this.confirm=o(this.confirm,this),e.__super__.constructor.apply(this,arguments),this.render(this)}return function(t,e){for(var r in e)s.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,n),e.prototype.className="popup",e.prototype.template=r(41),e.prototype._confirmBtnClass="confirm-button",e.prototype._cancelBtnClass="cancel-button",e.prototype.events={"click .close":"close","click .confirm-button":"confirm","click .cancel-button":"cancel",keyup:"keyup"},e.prototype.render=function(t){return this.el.html(this.template({confirmBtnClass:[this._confirmBtnClass,t.confirmBtnClass].join(" "),cancelBtnClass:[this._cancelBtnClass,t.cancelBtnClass].join(" "),title:t.title,content:t.content,note:t.note,confirm:t.confirmBtn,cancel:t.cancelBtn,separator:t.separator||!1})),this.item=t,this},e.prototype.keyup=function(t){if(13===t.keyCode)return this.confirm()},e.prototype.confirm=function(){return this._remove()&&this.onConfirm()},e.prototype.cancel=function(){return this._remove()&&this.onCancel()},e.prototype.close=function(){return this._remove()&&this.trigger("canceled")},e.prototype.onConfirm=function(){return this.trigger("confirmed")},e.prototype.onCancel=function(){return this.trigger("canceled")},e.prototype.pop=function(t,e,r){if(this.onConfirm=null!=e?e:this.onConfirm,this.onCancel=null!=r?r:this.onCancel,!this.el.is(":visible"))return t.append(this.el.stop(!0,!0).css({opacity:0}).show().animate({opacity:1},250)),this.el.unbind("click",this._close).bind("click",this._close)},e.prototype._remove=function(){return this.el.stop(!0,!0).animate({opacity:0},250,function(t){return function(){return t.el.hide().detach()}}(this))},e.prototype._close=function(t){if(this.el.is(t.target))return this.close()},e}(),t.exports=i},function(t,e,r){var n,i,o,s=function(t,e){return function(){return t.apply(e,arguments)}},a={}.hasOwnProperty;i=r(43),n=window.require("spine/controller/activateable"),o=function(t){function e(){this.refresh=s(this.refresh,this),this.getPreviewURL=s(this.getPreviewURL,this),e.__super__.constructor.apply(this,arguments),this.update({selected:this.selected}),this.selected&&this.activate(),this.listenTo(this.item,"refresh",this.refresh),this.refresh()}return function(t,e){for(var r in e)a.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.prototype.className="browser-entry",e.include(n),e.prototype.events={"click .browser-entry-prew":"toggle"},e.prototype.update=function(t){return null==t&&(t={}),this.el.toggleClass("active",t.selected)},e.prototype.toggle=function(){var t;if(this.isActive()||null==this.item.onActivate||("function"==typeof(t=this.item).onActivate?t.onActivate():void 0))return this.isActive()?this.deactivate():this.active()},e.prototype.getPreviewURL=function(){if(this.item)return this.getPreview(this.item)},e.prototype.refresh=function(){return this.item.isPrivate?(this.el.addClass("private-entry"),this.el.attr("data-tooltip-text","To use this item, make it public.")):this.el.removeClass("private-entry",this.el.removeAttr("data-tooltip-text"))},e}(),t.exports=o},function(t,e,r){"use strict";function n(){}function i(t){for(var e,r,n=1,i=arguments.length;n<i;n++)for(e in r=arguments[n])t[e]=r[e];return t}function o(t,e){e.appendChild(t)}function s(t,e,r){e.insertBefore(t,r)}function a(t){t.parentNode.removeChild(t)}function u(t,e,r){for(var n=r;n<t.length;n+=1)t[n]&&t[n].destroy(e)}function l(t){return document.createElement(t)}function c(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function p(t){return document.createTextNode(t)}function h(){return document.createComment("")}function d(t,e,r){t.addEventListener(e,r,!1)}function f(t,e,r){t.removeEventListener(e,r,!1)}function g(t,e,r){t.setAttribute(e,r)}function y(t,e,r){t.setAttributeNS("http://www.w3.org/1999/xlink",e,r)}r.d(e,"j",function(){return _}),r.d(e,"k",function(){return v}),r.d(e,"n",function(){return x}),r.d(e,"b",function(){return o}),r.d(e,"l",function(){return s}),r.d(e,"i",function(){return a}),r.d(e,"h",function(){return u}),r.d(e,"e",function(){return l}),r.d(e,"f",function(){return c}),r.d(e,"g",function(){return p}),r.d(e,"d",function(){return h}),r.d(e,"a",function(){return d}),r.d(e,"o",function(){return f}),r.d(e,"p",function(){return g}),r.d(e,"q",function(){return y}),r.d(e,"m",function(){return n}),r.d(e,"c",function(){return i});function _(t,e){return t!==e||t&&"object"==typeof t||"function"==typeof t}function v(t,e,r,n){for(var i in e)if(i in r){var o=r[i],s=n[i];if(_(o,s)){var a=e[i];if(!a)continue;for(var u=0;u<a.length;u+=1){var l=a[u];l.__calling||(l.__calling=!0,l.call(t,o,s),l.__calling=!1)}}}}function m(t){return t?this._state[t]:this._state}function b(t,e){var r=t in this._handlers&&this._handlers[t].slice();if(r)for(var n=0;n<r.length;n+=1)r[n].call(this,e)}function w(t,e,r){var n=r&&r.defer?this._observers.post:this._observers.pre;return(n[t]||(n[t]=[])).push(e),r&&!1===r.init||(e.__calling=!0,e.call(this,this._state[t]),e.__calling=!1),{cancel:function(){var r=n[t].indexOf(e);~r&&n[t].splice(r,1)}}}function E(t,e){if("teardown"===t)return this.on("destroy",e);var r=this._handlers[t]||(this._handlers[t]=[]);return r.push(e),{cancel:function(){var t=r.indexOf(e);~t&&r.splice(t,1)}}}function P(t){this._set(i({},t)),this._root._flush()}function S(){if(this._renderHooks)for(;this._renderHooks.length;)this._renderHooks.pop()()}var x={get:m,fire:b,observe:w,on:E,set:P,_flush:S}},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",i=t||{};return function(t,i){r=r+'<label class="font-item"'+n.attr("data-tag",t.toLowerCase()+" "+i.category,!0,!0)+'><input class="font-family-select" type="radio" name="font-select"'+n.attr("value",t,!0,!0)+'><span class="font-family-text"'+n.attr("style",n.style("font-family: "+t),!0,!0)+">"+n.escape(null==(e=t)?"":e)+"</span></label>"}.call(this,"font"in i?i.font:"undefined"!=typeof font?font:void 0,"fontData"in i?i.fontData:"undefined"!=typeof fontData?fontData:void 0),r}},function(t,e,r){r(0);t.exports=function(t){var e="";return e+='<div class="pixel-based"><div class="currentPositionWrapper"><div class="currentPositioningType"><div class="reference-icon"></div><div class="reference-input"></div></div></div><div class="positionPanel-center"><div class="positionPanelWrapper-visual"><div class="positionPanelWrapper"><div class="dragPanel"><span class="markDown"><div class="mark"></div></span></div></div></div></div><div class="positionFooter"><div class="switch-positioning-type">Switch to Grid Positioning</div></div></div><div class="grid-based"><div class="currentPositionWrapper"><div class="currentPositioningType"><div class="reference-icon"></div><div class="reference-input"></div></div></div><div class="positionPanel-center"><div class="positionPanelWrapper-visual"><div class="position-grid_modifiers"><span class="position-grid_modifier add colP"></span><span class="position-grid_modifier remove colM"></span><span class="position-grid_modifier add rowP"></span><span class="position-grid_modifier remove rowM"></span></div><div class="positionPanelWrapper"><div class="dragPanel"><span class="markDown"><div class="mark"></div></span></div><table class="position-grid"><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr></table></div></div></div><div class="positionFooter"><div class="switch-positioning-type">Switch to Pixel Positioning</div></div></div><div class="reference-panel"><div class="currentPositionWrapper"><div class="currentPositioningType"><div class="reference-input"></div><div class="reference-input_close-btn"></div></div></div><div class="positions input-reference-panel"><div class="centrate-all options"><span class="top left"></span><span class="top center"></span><span class="top right"></span><span class="center left"></span><span class="center center"></span><span class="center right"></span><span class="bottom left"></span><span class="bottom center"></span><span class="bottom right"></span><table class="background"><tr><td></td><td></td></tr><tr><td></td><td></td></tr></table></div></div></div>'}},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",i=t||{};return function(t,i){i.label&&(r=r+'<div class="control-label">'+n.escape(null==(e=i.label)?"":e)+"</div>"),t||(r+='<a class="control-upgrade" href="#">Upgrade to enable</a>'),i.help_text&&(r+='<div class="control-help"></div>'),i.editable&&(r+='<div class="control-edit-btn" data-tooltip-text="Edit this field"><input class="custom-checkbox-input" type="checkbox"><div class="custom-checkbox"></div></div>'),r+='<div class="input-position" tabIndex="0"><div class="input-position-x"><div class="property-label">x</div><div class="control"></div></div><div class="input-position-y"><div class="property-label">y</div><div class="control"></div></div><div class="input-position-panel"></div></div>'}.call(this,"isAccesible"in i?i.isAccesible:"undefined"!=typeof isAccesible?isAccesible:void 0,"options"in i?i.options:"undefined"!=typeof options?options:void 0),r}},function(t,e,r){var n,i,o=function(t,e){return function(){return t.apply(e,arguments)}},s={}.hasOwnProperty;i=r(4),n=function(t){function e(){this.onURL=o(this.onURL,this),this.status=o(this.status,this),this.update=o(this.update,this),e.__super__.constructor.apply(this,arguments),this.deflt={volume:100,onpause:this.status,onresume:this.status,onfinish:this.status,onplay:this.status}}return function(t,e){for(var r in e)s.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.prototype.className="control-audio",e.prototype.template="core/views/audio",e.prototype.elements={input:"input"},e.prototype.type="audio",e.prototype.elements={".url-thumb":"toggleBtn"},e.prototype.events={"click .play-btn,.pause-btn":"toggle"},e.prototype.render=function(){return e.__super__.render.apply(this,arguments),this.toggleBtn.toggle("undefined"!=typeof soundManager&&null!==soundManager),this.delay(function(t){return function(){return t.update(t.item)}}(this)),this},e.prototype.update=function(t,e,r){return null==r&&(r={}),this.input.val(this.lastURL=t[this.attribute]||""),this.onURL(!0,{silent:!0})},e.prototype.onInput=function(t){var r;return e.__super__.onInput.apply(this,arguments),null!=(r=this.sound)&&r.destruct(),this.status()},e.prototype.toggle=function(){var t;return null!=(t=this.sound)?t.togglePause():void 0},e.prototype.status=function(){var t,e;return this.el.toggleClass("playing",!(null!=(t=this.sound)?t.paused:void 0)&&1===(null!=(e=this.sound)?e.playState:void 0))},e.prototype.onURL=function(t){var r,n;return e.__super__.onURL.apply(this,arguments),"undefined"!=typeof soundManager&&null!==soundManager&&t&&(null!=(n=this.lastURL)?n.length:void 0)&&(r=function(t){return function(){return t.sound=soundManager.createSound($.extend({url:t.lastURL},t.deflt))||null}}(this),soundManager.enabled?r():soundManager.onready(r)),t&&!this.item[this.attribute]&&this.$removeClass("valid"),this},e.prototype.release=function(){var t,r;return null!=(t=e.__super__.release.apply(this,arguments))&&null!=(r=t.sound)?r.destruct():void 0},e}(),t.exports=n},function(t,e,r){var n,i,o,s,a,u=function(t,e){return function(){return t.apply(e,arguments)}},l={}.hasOwnProperty;o=window.require("spine/controller"),n=window.require("spine/controller/activateable"),s=r(22),a=r(23),i=function(t){function e(){this.triggerResize=u(this.triggerResize,this),this.years=u(this.years,this),this.months=u(this.months,this),this.calendar=u(this.calendar,this),this.view=u(this.view,this),this.nextView=u(this.nextView,this),this._yearChanged=u(this._yearChanged,this),this._monthChanged=u(this._monthChanged,this),this._change=u(this._change,this),e.__super__.constructor.apply(this,arguments),this.render(),this.input.bind("change",this._change),this.c=-1,this.l=this.views.length,this.nextView()}return function(t,e){for(var r in e)l.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,o),e.prototype.className="calendar",e.include(n),e.prototype.template="core/views/date-time/calendar",e.prototype.elements={".date-input":"input",".datepickr-wrapper":"calendarEl",".date_time-content":"content",".date_time-footer":"footer"},e.prototype.events={"click .datepickr-current-month":"nextView","click .date_time-current":"nextView","change:year":"_yearChanged","change:month":"_monthChanged","click .datepickr-next-month":"triggerResize","click .datepickr-prev-month":"triggerResize"},e.prototype.views=["calendar","months","years"],e.prototype.minYear=1889,e.prototype.maxYear=2189,e.prototype.update=function(t){var e,r,n,i,o,s,a,u;return this.date=t.date,e=(o=this.date.split("-"))[0],i=o[1],e=+e,i--,u=+(u=o[2]),this.datePickr.selectedDate={day:e,month:i,year:u},s=[e,i,u],this.datePickr.currentDayView=s[0],this.datePickr.currentMonthView=s[1],this.datePickr.currentYearView=s[2],this.datePickr.refresh(),this.yearsController.update({year:u}),this.monthsController.update({year:u,month:i}),r=(a=t.time.split(":"))[0],n=a[1],this.footer.html('<span class="hh">'+r+'</span>:<span class="mm">'+n+"</span>")},e.prototype.render=function(){return e.__super__.render.apply(this,arguments),this.datePickr=this.input.datepickr({dateFormat:"j-n-Y",firstDayOfWeek:1})[0],this.content.append((this.monthsController=new s({minYear:this.minYear,maxYear:this.maxYear})).el),this.content.append((this.yearsController=new a({min:this.minYear,max:this.maxYear})).el),this.refreshElements()},e.prototype._change=function(){var t;if((t=this.input.val())!==this.date)return this.el.trigger("change",{date:t})},e.prototype._monthChanged=function(t,e){var r;return r=this.date.replace(/-\d+-\d+$/,"-"+(e.month+1)+"-"+e.year),this.el.trigger("change",{date:r}),this.view("calendar")},e.prototype._yearChanged=function(t,e){var r;return r=this.date.replace(/\d+$/,e.year),this.el.trigger("change",{date:r}),this.view("months")},e.prototype.nextView=function(){return this.view(this.views[(this.c+1)%this.l])},e.prototype.view=function(t){return this.content.children().hide(),this.c=this.views.indexOf(t),this[t](),this.triggerResize()},e.prototype.calendar=function(){return this.calendarEl.show()},e.prototype.months=function(){return this.monthsController.render().show()},e.prototype.years=function(){return this.yearsController.render().show()},e.prototype.triggerResize=function(){return this.el.trigger("resize:popup")},e}(),t.exports=i},function(t,e){var r,n,i=function(t,e){return function(){return t.apply(e,arguments)}},o={}.hasOwnProperty;r=window.require("spine/controller"),n=function(t){function e(){this.prevYear=i(this.prevYear,this),this.nextYear=i(this.nextYear,this),this._change=i(this._change,this),e.__super__.constructor.apply(this,arguments),this.months=$.datepickr.prototype.l10n.months}return function(t,e){for(var r in e)o.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,r),e.prototype.className="months-view",e.prototype.template=window.require("core/views/date-time/grid"),e.prototype.table=window.require("core/views/date-time/table"),e.prototype.elements={".date_time-wrapper table":"tableEl",".date_time-current":"title",".selected":"selected"},e.prototype.events={"click .date_time-next":"nextYear","click .date_time-prev":"prevYear","click .date_time-cell":"_change"},e.prototype.render=function(){return e.__super__.render.apply(this,arguments),this.renderTable(),this.el},e.prototype.renderTable=function(){var t;return t=this.year===this.date.year?this.months.shorthand[this.month]:"",this.tableEl.html(this.table({cols:4,selected:t,data:this.months.shorthand})),this.refreshElements(),this.title.html(""+this.year)},e.prototype.update=function(t){var e;return this.date=t,e=this.date,this.month=e.month,this.year=e.year,this.renderTable()},e.prototype._change=function(t){var e,r;return this.selected.removeClass("selected"),(r=$(t.target)).parent().addClass("selected"),e=this.months.shorthand.indexOf(r.text()),this.el.trigger("change:month",{month:e,year:this.year})},e.prototype.nextYear=function(){return this.renderTable(++this.year)},e.prototype.prevYear=function(){return this.renderTable(--this.year)},e}(),t.exports=n},function(t,e){var r,n,i,o,s=function(t,e){return function(){return t.apply(e,arguments)}},a={}.hasOwnProperty,u=[].indexOf||function(t){for(var e=0,r=this.length;e<r;e++)if(e in this&&this[e]===t)return e;return-1};r=window.require("spine/controller"),o=function(t,e){return t+e},i=function(t,e){return Array.apply(null,{length:e-t}).map(o.call,o.bind(null,t))},n=function(t){function e(){this._change=s(this._change,this),this.update=s(this.update,this),this.prevPage=s(this.prevPage,this),this.nextPage=s(this.nextPage,this),e.__super__.constructor.apply(this,arguments),this.index=this.min}return function(t,e){for(var r in e)a.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,r),e.prototype.className="years-view",e.prototype.template=window.require("core/views/date-time/grid"),e.prototype.table=window.require("core/views/date-time/table"),e.prototype.elements={".date_time-wrapper table":"tableEl",".selected":"selected",".date_time-current":"title"},e.prototype.events={"click .date_time-next":"nextPage","click .date_time-prev":"prevPage","click .date_time-cell":"_change"},e.prototype.years=[],e.prototype.render=function(){return e.__super__.render.apply(this,arguments),this.renderTable(),this.el},e.prototype.renderTable=function(){return this.tableEl.html(this.table({cols:4,selected:this.year,data:this.years=i(this.index,this.index+16)})),this.refreshElements(),this.title.html(this.index+" - "+(this.index+16-1))},e.prototype.nextPage=function(){return this.renderTable(this.index=Math.min(this.max-16,this.index+16))},e.prototype.prevPage=function(){return this.renderTable(this.index=Math.max(this.min,this.index-16))},e.prototype.update=function(t){var e;return this.year=t.year,e=this.year,u.call(this.years,e)<0&&(this.index=this.year),this.renderTable()},e.prototype._change=function(t){var e,r;if(this.selected.removeClass("selected"),(e=$(t.target)).parent().addClass("selected"),(r=e.text())!==this.year)return this.el.trigger("change:year",{year:r})},e}(),t.exports=n},function(t,e){var r,n,i,o=function(t,e){return function(){return t.apply(e,arguments)}},s={}.hasOwnProperty;i=window.require("spine/controller"),r=window.require("spine/controller/activateable"),n=function(t){function e(){this.update=o(this.update,this),this.toggleView=o(this.toggleView,this),this.activate=o(this.activate,this),this.render=o(this.render,this),e.__super__.constructor.apply(this,arguments),this.months=$.datepickr.prototype.l10n.months,this.render()}return function(t,e){for(var r in e)s.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.prototype.className="clock",e.include(r),e.prototype.template=window.require("core/views/date-time/clock"),e.prototype.events={"click .date_time-current":"toggleView","change .clockpicker":"stopPropagation"},e.prototype.elements={".clockpicker":"picker",".clockpicker input":"pickrInput",".date_time-footer":"footer",".hh":"hoursEl",".mm":"minutesEl",".time-elements":"tElem"},e.prototype.hours="00",e.prototype.minutes="00",e.prototype.render=function(){return e.__super__.render.apply(this,arguments)},e.prototype.activate=function(){return r.activate.apply(this,arguments),this.picker.clockpicker({clockUpdate:function(t){return function(e,r){return t[e]=r,t.time=t.hours+":"+t.minutes,t.hoursEl.text(t.hours),t.minutesEl.text(t.minutes)}}(this),afterDone:function(t){return function(){return t.el.trigger("change",{time:t.time})}}(this),afterViewToggle:function(t){return function(e){return t.tElem.removeClass("active"),t[e+"El"].addClass("active")}}(this)})},e.prototype.toggleView=function(){return this.picker.clockpicker("toggleView")},e.prototype.update=function(t){var e,r,n,i;return this.date=t.date,this.time=t.time,r=this.time.split(":"),this.hours=r[0],this.minutes=r[1],this.pickrInput.val(this.time),(n=this.date.split("-"))[0],e=n[1],i=n[2],this.footer.html(this.months.longhand[e-1]+" "+i)},e.prototype.stopPropagation=function(t){return t.stopPropagation(),t.stopImmediatePropagation()},e}(),t.exports=n},function(t,e){var r;t.exports=r={setFormat:function(t){return null==t&&(t="d/m/Y H:i"),r.format.bind(r,t)},parseFrom:function(t,e){var r,n,i,o,s,a,u,l,c,p,h,d;for(c={},a=e.match(RegExp(""+t.replace(/\w+/g,"(\\w+|\\d+)"))).slice(1),i=o=0,s=(p=t.match(/\w+/g)).length;o<s;i=++o)c[p[i]]=a[i];return d=c.Y||c.y||0,l=(c.F||c.m||c.M||c.n||0)-1,r=c.d||c.D||c.j||0,n=c.g||c.G||c.h||c.H||0,u=c.i||0,h=c.s||0,new Date(d,l,r,n,u,h).getTime()},changeFormat:function(t,e,n){var i;return i=r.parseFrom(t,n),r.format(e,i)},format:function(t,e){var r;return null==t&&(t="d/m/Y H:i"),"string"==typeof e&&"Invalid Date"!==new Date(r=Date.parse(e))&&(e=r),"object"==typeof e&&null!=e.date&&null!=e.time&&(e=Date.parse(e.date.split("-").reverse().join("/")+" "+e.time)),$.datepickr.prototype.formatDate(t,e)}}},function(t,e,r){var n,i,o=function(t,e){return function(){return t.apply(e,arguments)}},s={}.hasOwnProperty;i=r(27),n=function(t){function e(){this.toggleViews=o(this.toggleViews,this),this.resize=o(this.resize,this),this.toggle=o(this.toggle,this),this.controllers=[],e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var r in e)s.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.prototype.className="control-popup date-time-popup",e.prototype.template=window.require("core/views/date-time/popup"),e.prototype.popupOptions={topOffset:3},e.prototype.events={change:"_change","resize:popup":"resize","click .date_time-footer":"toggleViews"},e.prototype.elements={".date_time-footer":"footer"},e.prototype.render=function(){var t,n,i,o;for(e.__super__.render.apply(this,arguments),"date"!==this.options.disable&&this.controllers.push(new(r(21))),"time"!==this.options.disable&&this.controllers.push(new(r(24))),n=0,i=(o=this.controllers).length;n<i;n++)t=o[n],this.el.append(t.el);return this.refreshElements(),this.footer.toggle(this.controllers.length>1),this.el.toggleClass("clock","date"===this.options.disable)},e.prototype.toggle=function(){return e.__super__.toggle.apply(this,arguments).then(function(t){return function(){if(setTimeout(t.resize,50),null==t.active)return t.controllers[t.active=0].activate()}}(this))},e.prototype.update=function(t){var e,r,n,i,o;for(this.date=t.date,this.time=t.time,o=[],r=0,n=(i=this.controllers).length;r<n;r++)e=i[r],o.push(e.update(t));return o},e.prototype._change=function(t,e){var r,n;for(r in e)n=e[r],this[r]=n;return this.trigger("change",{date:this.date,time:this.time})},e.prototype.resize=function(){return this.popup.resize()},e.prototype.toggleViews=function(){return this.controllers[this.active].deactivate(),this.controllers[this.active=(this.active+1)%this.controllers.length].activate()},e}(),t.exports=n},function(t,e){var r,n,i=function(t,e){return function(){return t.apply(e,arguments)}},o={}.hasOwnProperty;r=window.require("spine/controller"),n=function(t){function e(){return this.setPopupTargetWindow=i(this.setPopupTargetWindow,this),this.setPopupCSS=i(this.setPopupCSS,this),this.getPopupCSS=i(this.getPopupCSS,this),this.toggle=i(this.toggle,this),this.hide=i(this.hide,this),this.show=i(this.show,this),e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var r in e)o.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,r),e.prototype.document=$(document),e.prototype.window=$(window),e.prototype.show=function(){var t;return null!=(t=this.popup)&&t.show(),setTimeout(function(t){return function(){return t.document.bind("click",t.hide)}}(this))},e.prototype.hide=function(){var t;return null!=(t=this.popup)&&t.hide(),this.document.unbind("click",this.hide)},e.prototype.toggle=function(){return this._createPopup().then(function(t){return function(){return t.popup.visible?t.hide():t.show()}}(this))},e.prototype.release=function(){var t;return e.__super__.release.apply(this,arguments),null!=(t=this.popup)?t.release():void 0},e.prototype._createPopup=function(){return this.popupPromise?this.popupPromise:this.popupPromise=Blogvio.UI.popup.new($.extend({},{anchor:this.anchor,css:this.getPopupCSS(),targetWindow:this.targetWindow},this.popupOptions||{})).then(function(t){return function(e){return t.popup=e,t.popup.append(t.el)}}(this)).fail(function(t){return console.error(t.stack)})},e.prototype.getPopupCSS=function(){return this.css||(this.css=["https://widgetic.com/bundles/blogvioapp/css/editor/editor.css"])},e.prototype.setPopupCSS=function(t){return this.css=t,this},e.prototype.setPopupTargetWindow=function(t){return this.targetWindow=t,this},e}(),t.exports=n},function(t,e,r){var n,i,o=function(t,e){return function(){return t.apply(e,arguments)}},s={}.hasOwnProperty;i=r(4),$("body"),n=function(t){function e(){return this.onInvalidURL=o(this.onInvalidURL,this),this.onValidURL=o(this.onValidURL,this),this.update=o(this.update,this),e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var r in e)s.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.prototype.className="control control-image",e.prototype.template="core/views/image",e.prototype.type="photo",e.prototype.elements={input:"input",".url-thumb":"thumb"},e.prototype.update=function(t,e,r){return null==t&&(t=""),null==r&&(r={}),this.lastURL="string"==typeof t||t instanceof String?t:t[this.attribute]||"",this.input.val(this.lastURL),this.onURL(!0,{silent:!0})},e.prototype.onInput=function(t){return this.thumb.css({backgroundImage:"none"}),e.__super__.onInput.apply(this,arguments)},e.prototype.onValidURL=function(){return e.__super__.onValidURL.apply(this,arguments),this.thumb.attr({"data-tooltip-image":this.lastURL,"data-tooltip-position":"center top"}),this.thumb.toggle(this.lastURL.length>0).css({backgroundImage:"url("+(this.attachedBackground=this.lastURL)+")"})},e.prototype.onInvalidURL=function(){return e.__super__.onInvalidURL.apply(this,arguments),this.attachedBackground=null},e}(),t.exports=n},function(t,e,r){var n,i,o={}.hasOwnProperty;n=r(4),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var r in e)o.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,n),e.prototype.className="control-video",e.prototype.template="core/views/video",e.prototype.elements={input:"input"},e.prototype.type="video",e}(),t.exports=i},function(t,e,r){var n,i,o=function(t,e){return function(){return t.apply(e,arguments)}};i=r(10),n=function(){function t(t,e){this.font=t,this.fontData=e,this.show=o(this.show,this),this.loadFont=o(this.loadFont,this),this.render=o(this.render,this),this.render(),this.source=this.fontData.source,this.el.on("change",'input[type="radio"]',this.loadFont)}return t.prototype.template=r(17),t.prototype.render=function(){return this.el=$(this.template(this))},t.prototype.loadFont=function(){return i.load({families:[this.font],text:this.font,source:this.source},this.el.get(0).ownerDocument.defaultView).then(function(t){return function(){return t.el.addClass("loaded")}}(this))},t.prototype.show=function(){return this.loadFont()},t}(),t.exports=n},function(t,e,r){var n,i,o,s,a,u,l=function(t,e){return function(){return t.apply(e,arguments)}},c={}.hasOwnProperty;n=window.require("spine/controller"),u=r(5),a=r(42),i=r(30),s=r(10),o=function(t){function e(){this.getFontData=l(this.getFontData,this),this.lazyItems=l(this.lazyItems,this),this.whileScrolling=l(this.whileScrolling,this),this.scrollOnOpen=l(this.scrollOnOpen,this),this.ready=l(this.ready,this),this.refresh=l(this.refresh,this),this.render=l(this.render,this),this.clearSearch=l(this.clearSearch,this),this.filter=l(this.filter,this),this.onSearchInput=l(this.onSearchInput,this),this.update=l(this.update,this),this.onInput=l(this.onInput,this),this.fontCtrls={},e.__super__.constructor.apply(this,arguments),this.ready().then(function(t){return function(e){return t.fonts=e,t.refresh(t.render())}}(this))}return function(t,e){for(var r in e)c.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,n),e.include(u),e.include(a),e.prototype.template="core/views/font/fonts-list",e.prototype.className="font-list-wrapper",e.prototype.scrollOptions={},e.prototype.offsetToPreLoad=250,e.prototype.fonts={},e.prototype.fontCtrls={},e.prototype.elements={".search-input":"searchInput",".font-item":"fontItems",".font-list":"scrollContainer",".no-result":"noResult",".clear":"clearBtn"},e.prototype.events={'change input[type="radio"]':"onInput","keyup .search-input":"onSearchInput","click .clear":"clearSearch"},e.prototype.onInput=function(t){var e,r;return(e={})[this.attribute]=r=$(t.target).val(),e.style=this.fonts[r].styles[0],e.source=this.fonts[r].source,e.category=this.fonts[r].category,this.trigger("change",{attributes:e})},e.prototype.update=function(t,e,r){return null==r&&(r={}),this.ready().then(function(e){return function(){return e.el.find('[value="'+t[e.attribute]+'"]').prop("checked",!0),e.selected=e.fonts[t[e.attribute]]}}(this))},e.prototype.onSearchInput=function(){return clearTimeout(this.int),this.int=this.delay(function(t){return function(){return t.filter(t.searchInput.val())}}(this),150)},e.prototype.filter=function(t){var e;return(t=t.toLowerCase().replace(/\ /g,""))?(this.clearBtn.show(),e=this.fontItems.filter(":not([data-tag*="+t+"])").hide().end().filter("[data-tag*="+t+"]").show().length,this.noResult.toggle(!e),this.refresh()):(this.clearBtn.hide(),this.fontItems.show().first().hide(),this.refresh())},e.prototype.clearSearch=function(){return this.searchInput.val(""),this.onSearchInput()},e.prototype.render=function(){var t,r,n,o;for(r in e.__super__.render.apply(this,arguments),this.scrollOptions.documentContext=this.el.get(0).ownerDocument,o=this.fonts)n=o[r],this.scrollContainer.append(((t=this.fontCtrls)[r]||(t[r]=new i(r,n))).el);return this.refreshElements()},e.prototype.refresh=function(){return this.ready().then(function(t){return function(){return t.scroll().update(),t.lazyContainer=t.scrollContainer.find(".scroll-content"),t.lazyLoad()}}(this))},e.prototype.ready=function(){return s.loadFontList()},e.prototype.scrollOnOpen=function(t){return this.refresh(),this.first||this.scroll().scrollTo(t.parent()),this.first=!0},e.prototype.whileScrolling=function(){return this.lazyLoad()},e.prototype.lazyItems=function(){var t,e,r;for(t in r=[],e=this.fonts)e[t],this.fontCtrls[t].el.is(":visible")&&r.push(this.fontCtrls[t]);return r},e.prototype.getFontData=function(t){return this.fonts[t]},e}(),t.exports=o},function(t,e,r){var n,i,o,s,a,u,l=function(t,e){return function(){return t.apply(e,arguments)}},c={}.hasOwnProperty;n=window.require("spine/controller"),o=r(31),i=r(7),a=r(3),u=r(13).createPopup,s=function(t){function e(){this.setPopupTargetWindow=l(this.setPopupTargetWindow,this),this.deactivate=l(this.deactivate,this),this.activate=l(this.activate,this),this.toggle=l(this.toggle,this),this.update=l(this.update,this),this._change=l(this._change,this),e.__super__.constructor.apply(this,arguments),this.el.hide()}return function(t,e){for(var r in e)c.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,n),e.prototype.template="core/views/font/fonts-popup",e.prototype.elements={".font-list-wrapper":"fontListEl",".font-size":"fontSizeEl",".font-weight":"fontWeightEl"},e.prototype.render=function(){var t,r;return e.__super__.render.apply(this,arguments),this.el.toggleClass("no-size-input",this.disableSize),this.fontList=new o({el:this.fontListEl,attribute:"family",options:this.options}),this.fontSizeControl=new a({body:$(this.popup.window.document.body),el:this.fontSizeEl,attribute:"size",options:$.extend({label:"Size"},this.options.size)}),t=(null!=(r=this.options.default)?r.style:void 0)||this.options.style,this.fontWeightControl=new i({el:this.fontWeightEl,attribute:"style",options:{label:"Style",default:t,options:[{label:t,value:t}]}}),this.listenTo(this.fontList,"change",this._change),this.listenTo(this.fontSizeControl,"change:stepper",this._change),this.listenTo(this.fontWeightControl,"change:dropdown",this._change)},e.prototype._change=function(t){return this.trigger("change",t)},e.prototype.update=function(t,e,r){var n;if(null==r&&(r={}),t&&(this.item=t),this.popupPromise&&(this.fontList.update({family:this.item.family},e,r),this.fontSizeControl.update({size:this.item.size},e,r),this.fontList.selected&&this.family!==this.item.family))return n=this.fontList.getFontData(this.family=this.item.family)||{styles:[this.item.style]},this.fontWeightControl.updateOptions({default:n.styles[0],options:n.styles.slice(0,6).map(function(t){return{label:t,value:t}})})},e.prototype._createPopup=function(){return this.popupPromise?this.popupPromise:this.popupPromise=u({anchor:this.popupReference}).then(function(t){return function(e){return t.popup=e,t.el.show(),t.popup.append(t.el),t.render(),t.update(t.item,null,{silent:!0})}}(this)).catch(function(t){return console.error(t)})},e.prototype.toggle=function(){return this._createPopup().then(function(t){return function(){var e;return(null!=(e=t.popup)?e.visible:void 0)?t.deactivate():t.activate()}}(this))},e.prototype.activate=function(){var t;return null!=(t=this.popup)&&t.show(),this.fontList.refresh()},e.prototype.deactivate=function(){var t;return null!=(t=this.popup)?t.hide():void 0},e.prototype.release=function(){var t;return null!=(t=this.popup)&&t.release(),e.__super__.release.apply(this,arguments)},e.prototype.setPopupTargetWindow=function(t){return this.targetWindow=t,this},e}(),t.exports=s},function(t,e,r){var n,i,o,s,a,u=function(t,e){return function(){return t.apply(e,arguments)}},l={}.hasOwnProperty;o=r(6),n=window.require("spine/controller/activateable"),a=$("<tr>"),s=$("<td>"),i=function(t){function e(){this.subRows=u(this.subRows,this),this.addRows=u(this.addRows,this),this.subCols=u(this.subCols,this),this.addCols=u(this.addCols,this),this.updateSelf=u(this.updateSelf,this),this.deactivateCurentCell=u(this.deactivateCurentCell,this),this.activateCell=u(this.activateCell,this),e.__super__.constructor.apply(this,arguments),this.cols=this.rows=3,this.drawTable(this.cols,this.rows)}return function(t,e){for(var r in e)l.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,o),e.include(n),e.prototype.events={"click .position-grid td":"onCellClick","click .colP":"addCols","click .colM":"subCols","click .rowP":"addRows","click .rowM":"subRows"},e.prototype.elements={"table.position-grid":"grid",".position-grid td":"cells",".position-grid tr":"gridRows"},e.prototype.activeCell={},e.prototype.onCellClick=function(t){var e;return this.activeCell={col:(e=$(t.target)).index(),row:e.parent().index()},this.activateCell(e)},e.prototype.activateCell=function(t){var e,r;return this.cells.removeClass("active"),t.addClass("active"),e=t.offset().left-this.offset.left+t.width()/2+1,r=t.offset().top-this.offset.top+t.height()/2+1,e=Math.ceil(this.maxX*e/this.maxWidth),r=Math.ceil(this.maxY*r/this.maxHeight),this.update({x:e,y:r,reference:this.reference}),this.change()},e.prototype.deactivateCurentCell=function(){return this.cells.removeClass("active")},e.prototype.updateSelf=function(t,r){if(null==r&&(r={}),r.from!==this)return e.__super__.updateSelf.apply(this,arguments)&&this.deactivateCurentCell()},e.prototype.drawTable=function(t,e){var r,n,i,o,u,l;for(this.grid.html(""),this.rows=Math.max(1,Math.min(this.rows,10)),this.cols=Math.max(1,Math.min(this.cols,10)),u=a.clone(),r=1,i=this.cols;1<=i?r<=i:r>=i;1<=i?++r:--r)u.append(s.clone());for(n=1,o=this.rows;1<=o?n<=o:n>=o;1<=o?++n:--n)this.grid.append(u.clone());if(this.refreshElements(),(l=this.grid.find("tr:nth("+this.activeCell.row+") td:nth("+this.activeCell.col+")")).length)return this.activateCell(l)},e.prototype.addCols=function(){return this.drawTable(++this.cols,this.rows)},e.prototype.subCols=function(){return this.drawTable(--this.cols,this.rows)},e.prototype.addRows=function(){return this.drawTable(this.cols,++this.rows)},e.prototype.subRows=function(){return this.drawTable(this.cols,--this.rows)},e}(),t.exports=i},function(t,e,r){var n,i,o,s,a,u=function(t,e){return function(){return t.apply(e,arguments)}},l={}.hasOwnProperty;o=r(27),i=r(35),n=r(33),a=r(36),s=function(t){function e(){return this.change=u(this.change,this),this.update=u(this.update,this),this.toggleReference=u(this.toggleReference,this),this.toggleMode=u(this.toggleMode,this),this.refreshGrids=u(this.refreshGrids,this),e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var r in e)l.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,o),e.prototype.template=r(18),e.prototype.className="pixelPositionWrapper",e.prototype.elements={".pixel-based":"pixelPanel",".grid-based":"gridPanel",".reference-panel":"referencePanelEl"},e.prototype.events={"click .switch-positioning-type":"toggleMode",change:"change","click .currentPositionWrapper":"toggleReference"},e.prototype.mods=["pixel","grid"],e.prototype.refreshGrids=function(){return this.pixel.refresh(),this.grid.refresh()},e.prototype.toggleMode=function(){var t;return t=this.pixel.isActive(),this[this.mods[Number(!t)]].deactivate(),this[this.mods[Number(t)]].activate().refresh()},e.prototype.toggleReference=function(){var t;return t=this.referencePanel.isActive(),this.referencePanel[["activate","deactivate"][Number(t)]]()},e.prototype.release=function(){return this.pixel.release(),this.grid.release(),this.referencePanel.release(),e.__super__.release.apply(this,arguments)},e.prototype._createPopup=function(){return e.__super__._createPopup.apply(this,arguments).then(function(t){return function(){return t.pixel.setDocument($(t.popup.document)),t.refreshGrids(),$(t.popup.document.body).bind("mouseenter",t.pixel.mouseEnterBody)}}(this))},e.prototype.render=function(){return e.__super__.render.apply(this,arguments),this.referencePanel=new a({el:this.referencePanelEl}),this.grid=new n({el:this.gridPanel}),(this.pixel=new i({el:this.pixelPanel,x:this.x,y:this.y})).activate()},e.prototype.update=function(){var t,e,r;return(t=this.pixel).update.apply(t,arguments),(e=this.grid).update.apply(e,arguments),(r=this.referencePanel).update.apply(r,arguments)},e.prototype.change=function(t,e){return this.trigger("change",e)},e}(),t.exports=s},function(t,e,r){var n,i,o,s,a=[].slice,u=function(t,e){return function(){return t.apply(e,arguments)}},l={}.hasOwnProperty;i=r(6),n=window.require("spine/controller/activateable"),s=function(t,e){var r;return 0,r=!1,function(){var n;if(n=1<=arguments.length?a.call(arguments,0):[],!r)return r=!0,t.apply(null,n),setTimeout(function(){return r=!1},e)}},o=function(t){function e(){this.mouseEnterBody=u(this.mouseEnterBody,this),this.refresh=u(this.refresh,this),this.dragMove=u(this.dragMove,this),this.startDrag=u(this.startDrag,this),this.stopDrag=u(this.stopDrag,this),e.__super__.constructor.apply(this,arguments),this.dragMove=s(this.dragMove,15),this.dragEvents=this.isTouch?{touchmove:this.dragMove,touchend:this.stopDrag}:{mousemove:this.dragMove,mouseup:this.stopDrag}}return function(t,e){for(var r in e)l.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.include(n),e.prototype.isMouseDown=!1,e.prototype.stopDrag=function(t){return this.isMouseDown=!1,this.document.unbind(this.dragEvents),this.update()},e.prototype.startDrag=function(t){return this.isMouseDown=!0,this.prevent(t),this.dragMove(t),this.document.bind(this.dragEvents)},e.prototype.dragMove=function(t){var e,r;return e=Math.max(0,Math.min(t.pageX-this.offset.left,this.maxWidth)),r=Math.max(0,Math.min(t.pageY-this.offset.top,this.maxHeight)),e=Math.ceil(this.maxX*e/this.maxWidth),r=Math.ceil(this.maxY*r/this.maxHeight),this.update({x:e,y:r,reference:this.reference}),this.change()},e.prototype.refresh=function(){return e.__super__.refresh.apply(this,arguments),this.dragPanel.unbind("mousedown",this.startDrag),this.dragPanel.bind("mousedown",this.startDrag)},e.prototype.mouseEnterBody=function(t){if(this.isMouseDown)return 1!==(t.buttons||t.which)?this.stopDrag(t):void 0},e}(),t.exports=o},function(t,e,r){var n,i,o,s=function(t,e){return function(){return t.apply(e,arguments)}},a={}.hasOwnProperty;i=r(6),n=window.require("spine/controller/activateable"),o=function(t){function e(){return this.update=s(this.update,this),this.selectCurrent=s(this.selectCurrent,this),this._onClick=s(this._onClick,this),e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var r in e)a.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.include(n),e.prototype.events={"click .options span":"_onClick"},e.prototype.elements={".options":"options"},e.prototype._onClick=function(t){var e,r;return r=$(t.target),this.reference={y:(e=r.attr("class").split(" "))[0],x:e[1]},this.change()},e.prototype.selectCurrent=function(){return this.options.find("span[class='"+this.reference.y+" "+this.reference.x+"']").addClass("active").siblings().removeClass("active")},e.prototype.update=function(t,r,n){if(null==n&&(n={}),e.__super__.update.apply(this,arguments),null!=t.reference&&n.from!==this)return this.selectCurrent()},e}(),t.exports=o},,,function(t,e,r){var n,i;n=r(47),i=r(48),t.exports=function(t,e){var r,o;if(!t)return!0;try{return i.apply(t,e)}catch(t){}for(r in t)if(o=t[r],n(e,r.replace(/:/g,"."))!==o)return!1;return!0}},function(t,e,r){r(0);t.exports=function(t){var e="";return e+='<div class="skin-header"><div class="default"><span class="title">select a theme</span></div><div class="toggle-skin-edit-wrapper"><div class="toggle-skin-edit"><div class="content"><div class="back">Back</div><div class="edit">Edit Theme</div></div></div></div></div>'}},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",i=t||{};return function(t,i,o,s,a,u,l,c,p){r=r+'<div class="popup-wrapper"><div class="popup-inner"><div class="popup-header"><div class="popup-title">'+n.escape(null==(e=p)?"":e)+'</div><div class="close" data-icon="x"></div></div><div class="popup-content">'+(null==(e=u)?"":e),s&&(t=a||"green-button button--uc",r=r+"<div"+n.attr("class",n.classes(["confirm-button",t],[!1,!0]),!1,!0)+">"+n.escape(null==(e=s)?"":e)+"</div>"),c&&(r+='<div class="popup-content-separator"></div>'),i&&(t=o||"dim-button button--uc",r=r+"<div"+n.attr("class",n.classes(["cancel-button",t],[!1,!0]),!1,!0)+">"+n.escape(null==(e=i)?"":e)+"</div>"),l&&(r=r+"<label>"+n.escape(null==(e=l)?"":e)+"</label>"),r+="</div></div></div>"}.call(this,"c"in i?i.c:"undefined"!=typeof c?c:void 0,"cancel"in i?i.cancel:"undefined"!=typeof cancel?cancel:void 0,"cancelBtnClass"in i?i.cancelBtnClass:"undefined"!=typeof cancelBtnClass?cancelBtnClass:void 0,"confirm"in i?i.confirm:"undefined"!=typeof confirm?confirm:void 0,"confirmBtnClass"in i?i.confirmBtnClass:"undefined"!=typeof confirmBtnClass?confirmBtnClass:void 0,"content"in i?i.content:"undefined"!=typeof content?content:void 0,"note"in i?i.note:"undefined"!=typeof note?note:void 0,"separator"in i?i.separator:"undefined"!=typeof separator?separator:void 0,"title"in i?i.title:"undefined"!=typeof title?title:void 0),r}},function(t,e){var r;r={lazyLoad:function(){return clearTimeout(this.loadTimeout),this.loadTimeout=setTimeout(function(t){return function(){var e,r,n,i,o,s,a,u,l,c;for(c=(i=t.el.offset().top)-(t.offsetToPreLoad||150),e=i+t.el.height()+(t.offsetToPreLoad||150),l=[],o=s=0,u=(a=("function"==typeof t.lazyItems?t.lazyItems():void 0)||("function"==typeof t.children?t.children():void 0)||[]).length;s<u;o=++s)(n=(r=a[o]).el.offset().top)>c&&n<e?l.push("function"==typeof r.show?r.show():void 0):l.push(void 0);return l}}(this),50)}},t.exports=r},function(t,e){var r,n,i=function(t,e){return function(){return t.apply(e,arguments)}},o={}.hasOwnProperty;r=window.require("spine/controller"),n=function(t){function e(){var t,r;this.show=i(this.show,this),e.__super__.constructor.apply(this,arguments),t=(null!=(r=this.item.name)?r.replace(/\.[a-zA-Z]{3,4}$/,""):void 0)||"No Title",this.preview=$('<div class="browser-entry-prew"><span class="browser-entry-icon"></span></div>'),this.info=$('<div class="browser-entry-info">'+t+"</div>"),this.el.append(this.preview,this.info)}return function(t,e){for(var r in e)o.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,r),e.prototype.tag="span",e.prototype.className="browser-entry",e.prototype.show=function(){var t;return"function"==typeof(t=this.item).onShow?t.onShow():void 0},e}(),t.exports=n},,,function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,r){(function(e){var r="Expected a function",n="__lodash_hash_undefined__",i=1/0,o="[object Function]",s="[object GeneratorFunction]",a="[object Symbol]",u=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,l=/^\w*$/,c=/^\./,p=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,h=/\\(\\)?/g,d=/^\[object .+?Constructor\]$/,f="object"==typeof e&&e&&e.Object===Object&&e,g="object"==typeof self&&self&&self.Object===Object&&self,y=f||g||Function("return this")();var _=Array.prototype,v=Function.prototype,m=Object.prototype,b=y["__core-js_shared__"],w=function(){var t=/[^.]+$/.exec(b&&b.keys&&b.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),E=v.toString,P=m.hasOwnProperty,S=m.toString,x=RegExp("^"+E.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),k=y.Symbol,A=_.splice,O=j(y,"Map"),T=j(Object,"create"),R=k?k.prototype:void 0,C=R?R.toString:void 0;function I(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function M(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function D(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function L(t,e){for(var r=t.length;r--;)if(H(t[r][0],e))return r;return-1}function U(t,e){for(var r=0,n=(e=function(t,e){if(V(t))return!1;var r=typeof t;if("number"==r||"symbol"==r||"boolean"==r||null==t||G(t))return!0;return l.test(t)||!u.test(t)||null!=e&&t in Object(e)}(e,t)?[e]:function(t){return V(t)?t:B(t)}(e)).length;null!=t&&r<n;)t=t[z(e[r++])];return r&&r==n?t:void 0}function F(t){return!(!W(t)||function(t){return!!w&&w in t}(t))&&(function(t){var e=W(t)?S.call(t):"";return e==o||e==s}(t)||function(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}(t)?x:d).test(function(t){if(null!=t){try{return E.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function N(t,e){var r=t.__data__;return function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}(e)?r["string"==typeof e?"string":"hash"]:r.map}function j(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return F(r)?r:void 0}I.prototype.clear=function(){this.__data__=T?T(null):{}},I.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},I.prototype.get=function(t){var e=this.__data__;if(T){var r=e[t];return r===n?void 0:r}return P.call(e,t)?e[t]:void 0},I.prototype.has=function(t){var e=this.__data__;return T?void 0!==e[t]:P.call(e,t)},I.prototype.set=function(t,e){return this.__data__[t]=T&&void 0===e?n:e,this},M.prototype.clear=function(){this.__data__=[]},M.prototype.delete=function(t){var e=this.__data__,r=L(e,t);return!(r<0||(r==e.length-1?e.pop():A.call(e,r,1),0))},M.prototype.get=function(t){var e=this.__data__,r=L(e,t);return r<0?void 0:e[r][1]},M.prototype.has=function(t){return L(this.__data__,t)>-1},M.prototype.set=function(t,e){var r=this.__data__,n=L(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},D.prototype.clear=function(){this.__data__={hash:new I,map:new(O||M),string:new I}},D.prototype.delete=function(t){return N(this,t).delete(t)},D.prototype.get=function(t){return N(this,t).get(t)},D.prototype.has=function(t){return N(this,t).has(t)},D.prototype.set=function(t,e){return N(this,t).set(t,e),this};var B=q(function(t){t=function(t){return null==t?"":function(t){if("string"==typeof t)return t;if(G(t))return C?C.call(t):"";var e=t+"";return"0"==e&&1/t==-i?"-0":e}(t)}(t);var e=[];return c.test(t)&&e.push(""),t.replace(p,function(t,r,n,i){e.push(n?i.replace(h,"$1"):r||t)}),e});function z(t){if("string"==typeof t||G(t))return t;var e=t+"";return"0"==e&&1/t==-i?"-0":e}function q(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new TypeError(r);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=t.apply(this,r);return n.cache=o.set(i,s),s};return n.cache=new(q.Cache||D),n}function H(t,e){return t===e||t!=t&&e!=e}q.Cache=D;var V=Array.isArray;function W(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function G(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&S.call(t)==a}t.exports=function(t,e,r){var n=null==t?void 0:U(t,e);return void 0===n?r:n}}).call(e,r(12))},function(t,e,r){var n,i;!function(o,s){void 0===(i="function"==typeof(n=s)?n.call(e,r,e,t):n)||(t.exports=i)}(0,function(){"use strict";Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)});var t={},e={"==":function(t,e){return t==e},"===":function(t,e){return t===e},"!=":function(t,e){return t!=e},"!==":function(t,e){return t!==e},">":function(t,e){return t>e},">=":function(t,e){return t>=e},"<":function(t,e,r){return void 0===r?t<e:t<e&&e<r},"<=":function(t,e,r){return void 0===r?t<=e:t<=e&&e<=r},"!!":function(e){return t.truthy(e)},"!":function(e){return!t.truthy(e)},"%":function(t,e){return t%e},log:function(t){return console.log(t),t},in:function(t,e){return!(!e||void 0===e.indexOf)&&-1!==e.indexOf(t)},cat:function(){return Array.prototype.join.call(arguments,"")},substr:function(t,e,r){if(r<0){var n=String(t).substr(e);return n.substr(0,n.length+r)}return String(t).substr(e,r)},"+":function(){return Array.prototype.reduce.call(arguments,function(t,e){return parseFloat(t,10)+parseFloat(e,10)},0)},"*":function(){return Array.prototype.reduce.call(arguments,function(t,e){return parseFloat(t,10)*parseFloat(e,10)})},"-":function(t,e){return void 0===e?-t:t-e},"/":function(t,e){return t/e},min:function(){return Math.min.apply(this,arguments)},max:function(){return Math.max.apply(this,arguments)},merge:function(){return Array.prototype.reduce.call(arguments,function(t,e){return t.concat(e)},[])},var:function(t,e){var r=void 0===e?null:e,n=this;if(void 0===t||""===t||null===t)return n;for(var i=String(t).split("."),o=0;o<i.length;o++){if(null===n)return r;if(void 0===(n=n[i[o]]))return r}return n},missing:function(){for(var e=[],r=Array.isArray(arguments[0])?arguments[0]:arguments,n=0;n<r.length;n++){var i=r[n],o=t.apply({var:i},this);null!==o&&""!==o||e.push(i)}return e},missing_some:function(e,r){var n=t.apply({missing:r},this);return r.length-n.length>=e?[]:n},method:function(t,e,r){return t[e].apply(t,r)}};return t.is_logic=function(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)&&1===Object.keys(t).length},t.truthy=function(t){return(!Array.isArray(t)||0!==t.length)&&!!t},t.get_operator=function(t){return Object.keys(t)[0]},t.get_values=function(e){return e[t.get_operator(e)]},t.apply=function(r,n){if(Array.isArray(r))return r.map(function(e){return t.apply(e,n)});if(!t.is_logic(r))return r;n=n||{};var i,o,s,a,u,l=t.get_operator(r),c=r[l];if(Array.isArray(c)||(c=[c]),"if"===l||"?:"==l){for(i=0;i<c.length-1;i+=2)if(t.truthy(t.apply(c[i],n)))return t.apply(c[i+1],n);return c.length===i+1?t.apply(c[i],n):null}if("and"===l){for(i=0;i<c.length;i+=1)if(o=t.apply(c[i],n),!t.truthy(o))return o;return o}if("or"===l){for(i=0;i<c.length;i+=1)if(o=t.apply(c[i],n),t.truthy(o))return o;return o}if("filter"===l)return a=t.apply(c[0],n),s=c[1],Array.isArray(a)?a.filter(function(e){return t.truthy(t.apply(s,e))}):[];if("map"===l)return a=t.apply(c[0],n),s=c[1],Array.isArray(a)?a.map(function(e){return t.apply(s,e)}):[];if("reduce"===l)return a=t.apply(c[0],n),s=c[1],u=void 0!==c[2]?c[2]:null,Array.isArray(a)?a.reduce(function(e,r){return t.apply(s,{current:r,accumulator:e})},u):u;if("all"===l){if(a=t.apply(c[0],n),s=c[1],!a.length)return!1;for(i=0;i<a.length;i+=1)if(!t.truthy(t.apply(s,a[i])))return!1;return!0}if("none"===l)return 0===t.apply({filter:c},n).length;if("some"===l)return t.apply({filter:c},n).length>0;if(c=c.map(function(e){return t.apply(e,n)}),"function"==typeof e[l])return e[l].apply(n,c);if(l.indexOf(".")>0){var p=String(l).split("."),h=e;for(i=0;i<p.length;i++)if(void 0===(h=h[p[i]]))throw new Error("Unrecognized operation "+l+" (failed at "+p.slice(0,i+1).join(".")+")");return h.apply(n,c)}throw new Error("Unrecognized operation "+l)},t.uses_data=function(e){var r=[];if(t.is_logic(e)){var n=t.get_operator(e),i=e[n];Array.isArray(i)||(i=[i]),"var"===n?r.push(i[0]):i.map(function(e){r.push.apply(r,t.uses_data(e))})}return function(t){for(var e=[],r=0,n=t.length;r<n;r++)-1===e.indexOf(t[r])&&e.push(t[r]);return e}(r)},t.add_operation=function(t,r){e[t]=r},t.rm_operation=function(t){delete e[t]},t.rule_like=function(e,r){if(r===e)return!0;if("@"===r)return!0;if("number"===r)return"number"==typeof e;if("string"===r)return"string"==typeof e;if("array"===r)return Array.isArray(e)&&!t.is_logic(e);if(t.is_logic(r)){if(t.is_logic(e)){var n=t.get_operator(r),i=t.get_operator(e);if("@"===n||n===i)return t.rule_like(t.get_values(e,!1),t.get_values(r,!1))}return!1}if(Array.isArray(r)){if(Array.isArray(e)){if(r.length!==e.length)return!1;for(var o=0;o<r.length;o+=1)if(!t.rule_like(e[o],r[o]))return!1;return!0}return!1}return!1},t})},function(t,e){},function(t,e,r){var n,i,o,s,a,u,l,c,p,h=function(t,e){return function(){return t.apply(e,arguments)}},d={}.hasOwnProperty;s=window.require("spine/controller"),n=window.require("spine/controller/activateable"),o=window.require("spine/controller/container"),p=r(5),l=r(42),r(43),c=r(51),u=function(t){var e;return e="",(t.colors||t.icon||t.connectButton)&&(e='<div class="before" style="background: '+t.colors.dark+" url('"+t.icon+'\')"></div>\x3c!--\n\t\t --\x3e<div class="after" style="background: '+t.colors.light+'">'+t.connectButton.label+"</div>"),'<div class="browser-login">\n\t<div class="browser-login-cont">\n\t\t<div class="browser-login-message">add content from your account</div>\n\t\t<div class="browser-login-button" data-content="'+!!e+'">'+e+'</div>\n\t</div>\n</div>"'},a={folder:r(52),button:r(107),image:r(108),audio:r(109),video:r(110),rss:r(111)},i=function(t){function e(){this._requestAuth=h(this._requestAuth,this),this.getContentItemsInFolder=h(this.getContentItemsInFolder,this),this.whileScrolling=h(this.whileScrolling,this),this.getOptions=h(this.getOptions,this),this._deactivate=h(this._deactivate,this),this._activate=h(this._activate,this),this._release=h(this._release,this),this._active=h(this._active,this),this.onFolderRefresh=h(this.onFolderRefresh,this),this.updateCurrentCount=h(this.updateCurrentCount,this),this.refreshChildren=h(this.refreshChildren,this),this.setFolder=h(this.setFolder,this),this.onLogout=h(this.onLogout,this),this.onAuth=h(this.onAuth,this),this.deactivate=h(this.deactivate,this),e.__super__.constructor.apply(this,arguments),this.service=new this.Service(this.title,this.options),this.serviceTitle||(this.serviceTitle=this.service.title),this.currentContent=[],this.addNavBar(),this.intent=$(u(this.service.options)),this.el.addClass(this.title),this.el.attr("data-filetype",this.options.types[0]),this.on("activate",this.auth).listenTo(this.service,"auth",this.onAuth),this.listenTo(this.nav,"select",this.setFolder),this.listenTo(this.nav,"logout",this.onLogout),this.listenTo(this.service,"refresh",this.onFolderRefresh),this.listenTo(this.service,"auth-req",this._requestAuth),this.$bind("getURL",function(t){return function(e,r){return t.service.getURL($(e.target).controller().item,r)}}(this))}return function(t,e){for(var r in e)d.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,s),e.prototype.className="browser",e.include(o),e.include(n),e.include(p),e.include(l),e.prototype.scrollOptions={},e.prototype.events={"click .browser-login-button":"auth"},e.prototype.addNavBar=function(){return this.nav=new c({disconnectBtn:!this.service.hideDisconnectBtn})},e.prototype.active=function(){return n.active.apply(this,arguments),this.scrollOptions.documentContext=this.el.get(0).ownerDocument,this.scroll(),this.el.append(this.nav.el,this.intent),null!=this.service.faqLink&&this.el.append(this.service.faqLink),this.refreshChildren(),this.delay(function(t){return function(){return t.$trigger("editor:browser:active",{service:t.Service.name,authenticated:!0===t.authenticated&&t.nav.el.is(":visible")})}}(this))},e.prototype.deactivate=function(){return n.deactivate.apply(this,arguments),this.refreshChildren()},e.prototype.auth=function(t){if("true"!==String(this.el.attr("authenticated")))return this.service.auth("click"===(null!=t?t.type:void 0))},e.prototype.onAuth=function(t){return this.authenticated=t,this.currentContent=[],this.authenticated?this.updateCurrentCount():this.tab.count(0),this.el.attr({authenticated:this.authenticated}),this.authenticated&&this.setFolder(this.service.root),this.$trigger("editor:browser:auth",{service:this.Service.name,authenticated:!0===this.authenticated})},e.prototype.onLogout=function(){return this.service.deauth(),this.refreshChildren(),this.currentFolder=null},e.prototype.setFolder=function(t){var e;return(null!=(e=this.currentFolder)?e.path:void 0)===t.path||this.nav.addItem(t),t.children=[],this.currentFolder=t,this.empty().$addClass("loading"),this.service.refresh(t),this},e.prototype.refreshChildren=function(){return this.children(function(t){return"function"==typeof t.refresh?t.refresh():void 0})},e.prototype.refresh=function(){if(!this.refreshing)return this.refreshing=!0,this.currentFolder?this.setFolder(this.currentFolder):void 0},e.prototype.updateCurrentCount=function(){return this.tab.count(this.content.filter(function(t){return function(e){return t.currentContent.some(function(t){return e.id===t.id})}}(this)).length)},e.prototype.onFolderRefresh=function(t,e){var r,n,i,o,s,u,l;for(null==e&&(e={}),e.root&&(u=[],l=[],t.map(function(t){return function(e){return"folder"===e.type?l=l.concat(e.children.map(function(r){return t.service.newEntry("audio",r,e.id)})):u.push(e)}}(this)),l.length&&!this.currentContent.length&&(this.currentContent=this.currentContent.concat(l)),u.length&&(t=u=u.filter(function(t){return function(e){return!t.currentContent.some(function(t){return t.id===e.id})}}(this)),this.currentContent=this.currentContent.concat(u)),this.updateCurrentCount()),e.hard&&this.empty().$addClass("loading"),this.refreshing=!1,this.$removeClass("loading"),this.currentFolder.children=this.currentFolder.children.concat(t),this.el.toggleClass("no-items",!t.length&&!this.children().length),o=0,s=t.length;o<s;o++)i=t[o],/^\.[^\.]/.test(i.name)||(e={item:i,getPreview:function(t){return function(e){return t.service.preview(e)}}(this),getURL:function(t){return function(e,r){return t.service.getURL(e,r)}}(this),count:(n="folder"===i.type)?this.getContentItemsInFolder(i):void 0,selected:n?void 0:!!this.content.filter(function(t){return t.path===i.path}).length},r=new a[i.type](e),this.append(r),"folder"===i.type&&this.listenTo(r,"select",this.setFolder));return this.scroll().update(),this.lazyLoad()},e.prototype.afterAdd=function(t){return o.afterAdd.call(this,t),this.listenTo(t,"active",this._active),this.listenTo(t,"activate",this._activate),this.listenTo(t,"deactivate",this._deactivate),t},e.prototype._active=function(t,e){return null==e&&(e={}),this.trigger("canAdd",function(){return t.activate(e)})},e.prototype._release=function(){var t;return t=o._release.apply(this,arguments),this.stopListening(t),t},e.prototype._activate=function(t,e){var r;return this.addEntry(r=t.item),r.service=this.title,r.active=!0,r.getURLPromise=this.service.getURL(r,function(t){return function(e){return function(n){if(r.active&&r.stat===e)return r.url=n,t.trigger("add",r)}}}(this)(++r.stat))},e.prototype._deactivate=function(t,e){return t.item.active=!1,this.removeEntry(t.item),this.trigger("remove",t.item)},e.prototype.empty=function(){var t,e,r;for(t=0,e=(r=this.children()).length;t<e;t++)r[t].release();return this.scroll().update(),this},e.prototype.addEntry=function(t){var e,r,n,i,o;for(n=0,i=(o=this.content).length;n<i;n++)(e=o[n]).path===t.path&&(r=e);if(-1===this.content.indexOf(r))return this.content.push(t),this.updateCurrentCount()},e.prototype.removeEntry=function(t){var e,r,n,i,o,s,a,u,l,c,p;for(i=0,s=(u=this.content).length;i<s;i++)(r=u[i]).path===t.path&&(n=r);for(this.content.splice(this.content.indexOf(n),1),this.updateCurrentCount(),p=[],o=0,a=(l=this.children()).length;o<a;o++)("folder"===(c=(e=l[o]).item.type)||"button"===c||("function"==typeof e.isActive?e.isActive():void 0))&&p.push(e.update(this.getOptions(e.item)));return p},e.prototype.recount=function(){var t,e,r,n,i;for(i=[],e=0,r=(n=this.children()).length;e<r;e++)t=n[e],i.push(t.update(this.getOptions(t.item)));return i},e.prototype.getOptions=function(t){var e;return{count:(e="folder"===t.type)?this.content.filter(function(e){return!e.path.indexOf(t.path)}).length:void 0,selected:e?void 0:!!this.content.filter(function(e){return e.path===t.path}).length}},e.prototype.whileScrolling=function(){return this.lazyLoad()},e.prototype.getContentItemsInFolder=function(t){var e;return e=t.path.toLowerCase()+"/",this.content.filter(function(t){return 0===t.path.toLowerCase().indexOf(e)}).length},e.prototype._requestAuth=function(t){return this.$trigger("content:auth-req",t)},e}(),t.exports=i},function(t,e,r){var n,i,o,s,a,u,l=function(t,e){for(var r in e)c.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},c={}.hasOwnProperty;o=window.require("spine/controller"),i=window.require("spine/controller/activator"),n=window.require("spine/controller/activateable"),u=r(14),$("body"),a=function(t){function e(t){e.__super__.constructor.apply(this,arguments),this.item.root?this.el.attr("title",this.item.navTitle).addClass("root"):this.el.html(this.item.name),this.$bind("click",function(t){return function(){if(!t.isActive())return t.parent().trigger("select",t.item),t.active().el.nextAll().each(function(t,e){return $(e).controller().release()})}}(this))}return l(e,o),e.prototype.className="browser-nav-item",e.include(n),e}(),s=function(t){function e(){e.__super__.constructor.apply(this,arguments),this.disconnectBtn&&(this.popup=new u({title:"Sure about disconnecting?",confirmBtn:"Yes, Disconnect",cancelBtn:"Cancel",confirmBtnClass:"green-button button--uc no-icons",cancelBtnClass:"dim-button button--uc no-icons"}),this.append(this.logout=$("<div class='browser-logout' title='Disconnect from server' data-icon='↯'></div>")),this.logout.bind("click",function(t){return function(e){return e.stopPropagation(),t.popup.pop(t.el.closest("body"),function(){return t.$trigger("logout").trigger("logout"),t.children(function(t){return t.release()})})}}(this)))}return l(e,i),e.prototype.className="browser-nav",e.prototype.addItem=function(t){var e;return this.children(function(e){if(!e.item.root&&!RegExp("^"+e.item.path.replace(/\//gi,"/")+"(\\/|$)").test(t.path))return e.release()}),this.append(e=new a({item:t})),e.active()},e}(),t.exports=s},function(t,e,r){var n,i,o={}.hasOwnProperty;n=r(43),i=function(t){function e(){e.__super__.constructor.apply(this,arguments),this.update({count:this.count})}return function(t,e){for(var r in e)o.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,n),e.prototype.className="browser-folder",e.prototype.events={click:"click"},e.prototype.update=function(t){return null==t&&(t={}),this.el.attr("data-count",t.count||0)},e.prototype.click=function(){return this.trigger("select",this.item)},e}(),t.exports=i},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(113);e.default=n.default.instance},function(t,e,r){"use strict";e.a=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}},function(t,e,r){"use strict";var n=r(56),i=r.n(n),o=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}();e.a=function(t){return function(e){function r(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(r,t),o(r,[{key:"events",get:function(){return this._events},set:function(t){this._broadcast={},this._events={};var e=!0,r=!1,n=void 0;try{for(var o,s=t[Symbol.iterator]();!(e=(o=s.next()).done);e=!0){var a=o.value,u=new i.a;this._events[a]=u.listen,this._broadcast[a]=u.broadcast}}catch(t){r=!0,n=t}finally{try{!e&&s.return&&s.return()}finally{if(r)throw n}}}}]),r}()}},function(t,e){t.exports=function(){var t=[];return{broadcast:function(e){for(var r=t.slice(),n=0;n<r.length;n++)r[n].deleted||r[n].fn(e)},listen:function(e){return t.push(new function(t){this.fn=t,this.deleted=!1}(e)),function(){for(var r=0;r<t.length;r++)if(t[r].fn===e){t[r].deleted=!0,t.splice(r,1);break}}}}}},function(t,e,r){"use strict";var n=r(53),i=r(16);function o(t,e,r,n){(n||"service"in e&&i.j(t.service,r.service))&&(t.instance=e.instance=s.computed.instance(t.service))}var s={data:function(){return{service:null}},computed:{instance:function(t){return n.default[t]}},oncreate:function(){this._unsubscribes=[],this._proxiedProperties=[],this.observer=this.observe("instance",this._subscribe.bind(this))},ondestroy:function(){this._unsubscribe(),this.observer.cancel()},methods:{instance:function(){return this.get("instance")},_subscribe:function(t){var e=this;this._unsubscribe();var r=function(r){e._unsubscribes.push(t.events[r](function(t){e.fire(r,t)}))};for(var n in t.events)r(n)},_unsubscribe:function(){this._unsubscribes.forEach(function(t){return t()}),this._unsubscribes=[]}}};function a(t){t=t||{},this._state=i.c(s.data(),t.data),o(this._state,this._state,{},!0),this._observers={pre:Object.create(null),post:Object.create(null)},this._handlers=Object.create(null),this._root=t._root||this,this._yield=t._yield,this._torndown=!1,this._fragment=(this._state,{create:i.m,mount:i.m,unmount:i.m,destroy:i.m}),t.target&&(this._fragment.create(),this._fragment.mount(t.target,null)),t._root?t._root._renderHooks.push(s.oncreate.bind(this)):s.oncreate.call(this)}i.c(a.prototype,s.methods,i.n),a.prototype._set=function(t){var e=this._state;this._state=i.c({},e,t),o(this._state,t,e,!1),i.k(this,this._observers.pre,t,e),i.k(this,this._observers.post,t,e)},a.prototype.teardown=a.prototype.destroy=function(t){this.fire("destroy"),s.ondestroy.call(this),!1!==t&&this._fragment.unmount(),this._fragment.destroy(),this._fragment=null,this._state={},this._torndown=!0},e.a=a},function(t,e,r){var n={"./core/views/audio-details.pug":59,"./core/views/audio.pug":60,"./core/views/browser.pug":61,"./core/views/color.pug":62,"./core/views/date-time/calendar.pug":63,"./core/views/date-time/clock.pug":64,"./core/views/date-time/grid.pug":65,"./core/views/date-time/input.pug":66,"./core/views/date-time/popup.pug":67,"./core/views/date-time/table.pug":68,"./core/views/dropdown.pug":69,"./core/views/font/font-item.pug":17,"./core/views/font/fonts-list.pug":70,"./core/views/font/fonts-popup.pug":71,"./core/views/font/index.pug":72,"./core/views/image-details.pug":73,"./core/views/image.pug":74,"./core/views/input-layout.pug":75,"./core/views/order-items.pug":76,"./core/views/order-picker.pug":77,"./core/views/pixelpanel.pug":18,"./core/views/position.pug":19,"./core/views/range.pug":78,"./core/views/scale.pug":79,"./core/views/slider.pug":80,"./core/views/stepper.pug":81,"./core/views/text.pug":82,"./core/views/textarea.pug":83,"./core/views/toggle.pug":84,"./core/views/video-details.pug":85,"./core/views/video.pug":86,"./editor/views/embed.pug":87,"./editor/views/loginbutton.pug":88,"./editor/views/popup.pug":41,"./editor/views/presets.pug":89,"./editor/views/presetslist-header.pug":40,"./editor/views/skinitem.pug":90};function i(t){return r(o(t))}function o(t){var e=n[t];if(!(e+1))throw new Error("Cannot find module '"+t+"'.");return e}i.keys=function(){return Object.keys(n)},i.resolve=o,t.exports=i,i.id=58},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",i=t||{};return function(t,i){i.label&&(r=r+'<div class="control-label">'+n.escape(null==(e=i.label)?"":e)+"</div>"),t||(r+='<a class="control-upgrade" href="#">Upgrade to enable</a>'),i.help_text&&(r+='<div class="control-help"></div>'),i.editable&&(r+='<div class="control-edit-btn" data-tooltip-text="Edit this field"><input class="custom-checkbox-input" type="checkbox"><div class="custom-checkbox"></div></div>'),r=r+'<div class="input-audio"><span class="icon"></span><div class="audio-title"></div><input class="control-input input-text" type="text"'+n.attr("placeholder",i.placeholder,!0,!0)+n.attr("readonly",i.readonly,!0,!0)+' autocorrect="off" autocapitalize="off"><div class="url-thumb"><div class="play-btn" data-icon="►"></div><div class="pause-btn" data-icon="▮"></div></div></div>'}.call(this,"isAccesible"in i?i.isAccesible:"undefined"!=typeof isAccesible?isAccesible:void 0,"options"in i?i.options:"undefined"!=typeof options?options:void 0),r}},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",i=t||{};return function(t,i){i.label&&(r=r+'<div class="control-label">'+n.escape(null==(e=i.label)?"":e)+"</div>"),t||(r+='<a class="control-upgrade" href="#">Upgrade to enable</a>'),i.help_text&&(r+='<div class="control-help"></div>'),i.editable&&(r+='<div class="control-edit-btn" data-tooltip-text="Edit this field"><input class="custom-checkbox-input" type="checkbox"><div class="custom-checkbox"></div></div>'),r=r+'<div class="input-audio"><input class="control-input input-text" type="text"'+n.attr("placeholder",i.placeholder,!0,!0)+n.attr("readonly",i.readonly,!0,!0)+' autocorrect="off" autocapitalize="off"><div class="url-thumb"><div class="play-btn" data-icon="►"></div><div class="pause-btn" data-icon="▮"></div></div></div>'}.call(this,"isAccesible"in i?i.isAccesible:"undefined"!=typeof isAccesible?isAccesible:void 0,"options"in i?i.options:"undefined"!=typeof options?options:void 0),r}},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",i=t||{};return function(t,i){i.label&&(r=r+'<div class="control-label">'+n.escape(null==(e=i.label)?"":e)+"</div>"),t||(r+='<a class="control-upgrade" href="#">Upgrade to enable</a>'),i.help_text&&(r+='<div class="control-help"></div>'),i.editable&&(r+='<div class="control-edit-btn" data-tooltip-text="Edit this field"><input class="custom-checkbox-input" type="checkbox"><div class="custom-checkbox"></div></div>'),r+='<div class="input-browser"><div class="input-browser-browse"></div></div>'}.call(this,"isAccesible"in i?i.isAccesible:"undefined"!=typeof isAccesible?isAccesible:void 0,"options"in i?i.options:"undefined"!=typeof options?options:void 0),r}},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",i=t||{};return function(t,i){i.label&&(r=r+'<div class="control-label">'+n.escape(null==(e=i.label)?"":e)+"</div>"),t||(r+='<a class="control-upgrade" href="#">Upgrade to enable</a>'),i.help_text&&(r+='<div class="control-help"></div>'),i.editable&&(r+='<div class="control-edit-btn" data-tooltip-text="Edit this field"><input class="custom-checkbox-input" type="checkbox"><div class="custom-checkbox"></div></div>'),r+='<div class="input-color"><input class="control-input input-text" type="text"><input class="color-preview" type="text"><div class="sp-replacer color-preview-i"><div class="sp-preview"><div class="sp-preview-inner"></div></div></div></div>'}.call(this,"isAccesible"in i?i.isAccesible:"undefined"!=typeof isAccesible?isAccesible:void 0,"options"in i?i.options:"undefined"!=typeof options?options:void 0),r}},function(t,e,r){r(0);t.exports=function(t){var e="";return e+='<div class="date_time-content"><input class="date-input hidden"></div><div class="date_time-footer"></div>'}},function(t,e,r){r(0);t.exports=function(t){var e="";return e+='<div class="date_time-content"><div class="date_time-wrapper"><div class="date_time-header"><div class="date_time-current"><span class="time-elements hh hours"></span>:<span class="time-elements mm minutes"></span></div></div><div class="input-group clockpicker"><input class="form-control" type="text"><span class="input-group-addon"><span class="glyphicon glyphicon-time"></span></span></div></div></div><div class="date_time-footer"></div>'}},function(t,e,r){r(0);t.exports=function(t){var e="";return e+='<div class="date_time-wrapper"><div class="date_time-header"><div class="date_time-prev"></div><div class="date_time-next"></div><div class="date_time-current"></div></div><table></table></div>'}},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",i=t||{};return function(t,i){i.label&&(r=r+'<div class="control-label">'+n.escape(null==(e=i.label)?"":e)+"</div>"),t||(r+='<a class="control-upgrade" href="#">Upgrade to enable</a>'),i.help_text&&(r+='<div class="control-help"></div>'),i.editable&&(r+='<div class="control-edit-btn" data-tooltip-text="Edit this field"><input class="custom-checkbox-input" type="checkbox"><div class="custom-checkbox"></div></div>'),r=r+'<input class="control-input input-text input-with-icon" type="text"'+n.attr("placeholder",i.placeholder,!0,!0)+'><div class="input-icon"></div>'}.call(this,"isAccesible"in i?i.isAccesible:"undefined"!=typeof isAccesible?isAccesible:void 0,"options"in i?i.options:"undefined"!=typeof options?options:void 0),r}},function(t,e,r){r(0);t.exports=function(t){return""}},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",o=t||{};return function(t,i,o,s,a){for(r+="<tbody>",o=0;o<i.length/t;o++){for(r+="<tr>",s=o*t;s<(o+1)*t;s++)r=r+"<td"+n.attr("class",n.classes([i[s]==a?"selected":""],[!0]),!1,!0)+'><span class="date_time-cell">'+n.escape(null==(e=i[s])?"":e)+"</span></td>";r+="</tr>"}r+="</tbody>"}.call(this,"cols"in o?o.cols:"undefined"!=typeof cols?cols:void 0,"data"in o?o.data:"undefined"!=typeof data?data:void 0,"i"in o?o.i:"undefined"!=typeof i?i:void 0,"j"in o?o.j:"undefined"!=typeof j?j:void 0,"selected"in o?o.selected:"undefined"!=typeof selected?selected:void 0),r}},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",i=t||{};return function(t,i){i.label&&(r=r+'<div class="control-label">'+n.escape(null==(e=i.label)?"":e)+"</div>"),t||(r+='<a class="control-upgrade" href="#">Upgrade to enable</a>'),i.help_text&&(r+='<div class="control-help"></div>'),i.editable&&(r+='<div class="control-edit-btn" data-tooltip-text="Edit this field"><input class="custom-checkbox-input" type="checkbox"><div class="custom-checkbox"></div></div>'),r+='<div class="input-dropdown" tabIndex="0"><div class="input-dropdown-default"><span></span><div class="dropdown-arrow"></div></div><ul class="input-dropdown-list">',function(){var t=i.options;if("number"==typeof t.length)for(var o=0,s=t.length;o<s;o++){var a=t[o];r=r+"<li"+n.attr("data-value",a.value,!0,!0)+">"+n.escape(null==(e=a.label)?"":e)+"</li>"}else for(var o in s=0,t)s++,a=t[o],r=r+"<li"+n.attr("data-value",a.value,!0,!0)+">"+n.escape(null==(e=a.label)?"":e)+"</li>"}.call(this),r+="</ul></div>"}.call(this,"isAccesible"in i?i.isAccesible:"undefined"!=typeof isAccesible?isAccesible:void 0,"options"in i?i.options:"undefined"!=typeof options?options:void 0),r}},function(t,e,r){r(0);t.exports=function(t){var e="";return e+='<div class="search-input-control"><input class="search-input" placeholder="SEARCH"><div class="search-icon"></div><div class="clear clear-search-input" data-icon="x"></div></div><div class="font-list"><label class="font-item no-result loaded"><span class="font-family-text">No results</span></label></div>'}},function(t,e,r){r(0);t.exports=function(t){var e="";return e+='<div class="font-popup-wrapper"><div class="font-list-wrapper"></div><div class="font-footer"><div class="font-size"></div><div class="font-weight"></div></div></div>'}},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",i=t||{};return function(t,i){i.label&&(r=r+'<div class="control-label">'+n.escape(null==(e=i.label)?"":e)+"</div>"),t||(r+='<a class="control-upgrade" href="#">Upgrade to enable</a>'),i.help_text&&(r+='<div class="control-help"></div>'),i.editable&&(r+='<div class="control-edit-btn" data-tooltip-text="Edit this field"><input class="custom-checkbox-input" type="checkbox"><div class="custom-checkbox"></div></div>'),r=r+'<div class="font-size"></div><div class="control-input font-family"><div class="input-text">'+n.escape(null==(e=i.family)?"":e)+'</div><div class="font-family-icon"></div></div><div class="font-popup"></div>'}.call(this,"isAccesible"in i?i.isAccesible:"undefined"!=typeof isAccesible?isAccesible:void 0,"options"in i?i.options:"undefined"!=typeof options?options:void 0),r}},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",i=t||{};return function(t,i){i.label&&(r=r+'<div class="control-label">'+n.escape(null==(e=i.label)?"":e)+"</div>"),t||(r+='<a class="control-upgrade" href="#">Upgrade to enable</a>'),i.help_text&&(r+='<div class="control-help"></div>'),i.editable&&(r+='<div class="control-edit-btn" data-tooltip-text="Edit this field"><input class="custom-checkbox-input" type="checkbox"><div class="custom-checkbox"></div></div>'),r=r+'<div class="input-image"><div class="image-title"></div><input class="control-input input-text" type="text"'+n.attr("placeholder",i.placeholder,!0,!0)+n.attr("readonly",i.readonly,!0,!0)+' autocorrect="off" autocapitalize="off"><div class="url-thumb"></div></div>'}.call(this,"isAccesible"in i?i.isAccesible:"undefined"!=typeof isAccesible?isAccesible:void 0,"options"in i?i.options:"undefined"!=typeof options?options:void 0),r}},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",i=t||{};return function(t,i){i.label&&(r=r+'<div class="control-label">'+n.escape(null==(e=i.label)?"":e)+"</div>"),t||(r+='<a class="control-upgrade" href="#">Upgrade to enable</a>'),i.help_text&&(r+='<div class="control-help"></div>'),i.editable&&(r+='<div class="control-edit-btn" data-tooltip-text="Edit this field"><input class="custom-checkbox-input" type="checkbox"><div class="custom-checkbox"></div></div>'),r=r+'<div class="input-image"><input class="control-input input-text" type="text"'+n.attr("placeholder",i.placeholder,!0,!0)+n.attr("readonly",i.readonly,!0,!0)+' autocorrect="off" autocapitalize="off"><div class="url-thumb"></div></div>'}.call(this,"isAccesible"in i?i.isAccesible:"undefined"!=typeof isAccesible?isAccesible:void 0,"options"in i?i.options:"undefined"!=typeof options?options:void 0),r}},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",i=t||{};return function(t,i){i.label&&(r=r+'<div class="control-label">'+n.escape(null==(e=i.label)?"":e)+"</div>"),t||(r+='<a class="control-upgrade" href="#">Upgrade to enable</a>'),i.help_text&&(r+='<div class="control-help"></div>'),i.editable&&(r+='<div class="control-edit-btn" data-tooltip-text="Edit this field"><input class="custom-checkbox-input" type="checkbox"><div class="custom-checkbox"></div></div>')}.call(this,"isAccesible"in i?i.isAccesible:"undefined"!=typeof isAccesible?isAccesible:void 0,"options"in i?i.options:"undefined"!=typeof options?options:void 0),r}},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",i=t||{};return function(t){(function(){var i=t;if("number"==typeof i.length)for(var o=0,s=i.length;o<s;o++){var a=i[o];r=r+'<li class="list-item"'+n.attr("data-value",a.value,!0,!0)+'><span class="item-details-order">'+n.escape(null==(e=a.order)?"":e)+'</span><span class="input-text-label">'+n.escape(null==(e=a.label)?"":e)+'</span><span class="option-is-enabled"><input class="is-enabled custom-checkbox-input" type="checkbox"'+n.attr("checked",a.enabled,!0,!0)+'><div class="custom-checkbox"></div></span></li>'}else for(var o in s=0,i)s++,a=i[o],r=r+'<li class="list-item"'+n.attr("data-value",a.value,!0,!0)+'><span class="item-details-order">'+n.escape(null==(e=a.order)?"":e)+'</span><span class="input-text-label">'+n.escape(null==(e=a.label)?"":e)+'</span><span class="option-is-enabled"><input class="is-enabled custom-checkbox-input" type="checkbox"'+n.attr("checked",a.enabled,!0,!0)+'><div class="custom-checkbox"></div></span></li>'}).call(this)}.call(this,"options"in i?i.options:"undefined"!=typeof options?options:void 0),r}},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",i=t||{};return function(t,i){i.label&&(r=r+'<div class="control-label">'+n.escape(null==(e=i.label)?"":e)+"</div>"),t||(r+='<a class="control-upgrade" href="#">Upgrade to enable</a>'),i.help_text&&(r+='<div class="control-help"></div>'),i.editable&&(r+='<div class="control-edit-btn" data-tooltip-text="Edit this field"><input class="custom-checkbox-input" type="checkbox"><div class="custom-checkbox"></div></div>'),r=r+'<div class="input-dropdown" tabIndex="0"><div class="input-dropdown-default"><span>'+n.escape(null==(e=i.title)?"":e)+'</span><div class="dropdown-arrow"></div></div><ul class="input-dropdown-list order-picker-list"></ul></div>'}.call(this,"isAccesible"in i?i.isAccesible:"undefined"!=typeof isAccesible?isAccesible:void 0,"options"in i?i.options:"undefined"!=typeof options?options:void 0),r}},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",i=t||{};return function(t,i){i.label&&(r=r+'<div class="control-label">'+n.escape(null==(e=i.label)?"":e)+"</div>"),t||(r+='<a class="control-upgrade" href="#">Upgrade to enable</a>'),i.help_text&&(r+='<div class="control-help"></div>'),i.editable&&(r+='<div class="control-edit-btn" data-tooltip-text="Edit this field"><input class="custom-checkbox-input" type="checkbox"><div class="custom-checkbox"></div></div>'),r+='<div class="input-range" tabIndex="0"><input class="input-range-value min-value" type="text" value=""><div class="input-range-track"><div class="input-range-thumbs"><div class="input-range-thumb min-thumb" data-thumb="min"></div><div class="input-range-thumb max-thumb" data-thumb="max"></div></div></div><input class="input-range-value max-value" type="text" value=""></div>'}.call(this,"isAccesible"in i?i.isAccesible:"undefined"!=typeof isAccesible?isAccesible:void 0,"options"in i?i.options:"undefined"!=typeof options?options:void 0),r}},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",i=t||{};return function(t,i){i.label&&(r=r+'<div class="control-label">'+n.escape(null==(e=i.label)?"":e)+"</div>"),t||(r+='<a class="control-upgrade" href="#">Upgrade to enable</a>'),i.help_text&&(r+='<div class="control-help"></div>'),i.editable&&(r+='<div class="control-edit-btn" data-tooltip-text="Edit this field"><input class="custom-checkbox-input" type="checkbox"><div class="custom-checkbox"></div></div>'),r+='<div class="input-scale" tabIndex="0"><div class="input-scale-width"></div><div class="input-scale-height"></div><div class="input-scale-scaler"><span class="input-label">Scale </span></div></div>'}.call(this,"isAccesible"in i?i.isAccesible:"undefined"!=typeof isAccesible?isAccesible:void 0,"options"in i?i.options:"undefined"!=typeof options?options:void 0),r}},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",i=t||{};return function(t,i){i.label&&(r=r+'<div class="control-label">'+n.escape(null==(e=i.label)?"":e)+"</div>"),t||(r+='<a class="control-upgrade" href="#">Upgrade to enable</a>'),i.help_text&&(r+='<div class="control-help"></div>'),i.editable&&(r+='<div class="control-edit-btn" data-tooltip-text="Edit this field"><input class="custom-checkbox-input" type="checkbox"><div class="custom-checkbox"></div></div>'),r+='<input class="input-slider-value" type="text" value=""><div class="input-slider" tabIndex="0"><div class="input-slider-container"><div class="input-slider-thumb"></div></div></div>'}.call(this,"isAccesible"in i?i.isAccesible:"undefined"!=typeof isAccesible?isAccesible:void 0,"options"in i?i.options:"undefined"!=typeof options?options:void 0),r}},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",i=t||{};return function(t,i){i.label&&(r=r+'<div class="control-label">'+n.escape(null==(e=i.label)?"":e)+"</div>"),t||(r+='<a class="control-upgrade" href="#">Upgrade to enable</a>'),i.help_text&&(r+='<div class="control-help"></div>'),i.editable&&(r+='<div class="control-edit-btn" data-tooltip-text="Edit this field"><input class="custom-checkbox-input" type="checkbox"><div class="custom-checkbox"></div></div>'),r+='<div class="input-spinner"><div class="spinner-down spinner-button"></div><input class="control-input" type="text" autocorrect="off" autocapitalize="off"><div class="spinner-up spinner-button"></div></div>'}.call(this,"isAccesible"in i?i.isAccesible:"undefined"!=typeof isAccesible?isAccesible:void 0,"options"in i?i.options:"undefined"!=typeof options?options:void 0),r}},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",i=t||{};return function(t,i){i.label&&(r=r+'<div class="control-label">'+n.escape(null==(e=i.label)?"":e)+"</div>"),t||(r+='<a class="control-upgrade" href="#">Upgrade to enable</a>'),i.help_text&&(r+='<div class="control-help"></div>'),i.editable&&(r+='<div class="control-edit-btn" data-tooltip-text="Edit this field"><input class="custom-checkbox-input" type="checkbox"><div class="custom-checkbox"></div></div>'),r=r+'<input class="control-input input-text" type="text"'+n.attr("placeholder",i.placeholder,!0,!0)+'><div class="color-preview"></div>'}.call(this,"isAccesible"in i?i.isAccesible:"undefined"!=typeof isAccesible?isAccesible:void 0,"options"in i?i.options:"undefined"!=typeof options?options:void 0),r}},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",i=t||{};return function(t,i){i.label&&(r=r+'<div class="control-label">'+n.escape(null==(e=i.label)?"":e)+"</div>"),t||(r+='<a class="control-upgrade" href="#">Upgrade to enable</a>'),i.help_text&&(r+='<div class="control-help"></div>'),i.editable&&(r+='<div class="control-edit-btn" data-tooltip-text="Edit this field"><input class="custom-checkbox-input" type="checkbox"><div class="custom-checkbox"></div></div>'),r=r+'<div class="general-input input-textarea"><textarea'+n.attr("placeholder",i.placeholder,!0,!0)+'></textarea><div class="toolbar" style="display:none;"><a data-wysihtml5-command="bold" tabIndex="-1"></a><a data-wysihtml5-command="italic" tabIndex="-1"></a><a data-wysihtml5-command="underline" tabIndex="-1"></a></div></div>'}.call(this,"isAccesible"in i?i.isAccesible:"undefined"!=typeof isAccesible?isAccesible:void 0,"options"in i?i.options:"undefined"!=typeof options?options:void 0),r}},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",i=t||{};return function(t,i,o){o.label&&(r=r+'<div class="control-label">'+n.escape(null==(e=o.label)?"":e)+"</div>"),t||(r+='<a class="control-upgrade" href="#">Upgrade to enable</a>'),o.help_text&&(r+='<div class="control-help"></div>'),o.editable&&(r+='<div class="control-edit-btn" data-tooltip-text="Edit this field"><input class="custom-checkbox-input" type="checkbox"><div class="custom-checkbox"></div></div>'),r=r+'<div class="input-toggle" tabIndex="0"><div class="input-toggle-true">'+n.escape(null==(e=i.true||"On")?"":e)+'</div><div class="input-toggle-false">'+n.escape(null==(e=i.false||"Off")?"":e)+"</div></div>"}.call(this,"isAccesible"in i?i.isAccesible:"undefined"!=typeof isAccesible?isAccesible:void 0,"labels"in i?i.labels:"undefined"!=typeof labels?labels:void 0,"options"in i?i.options:"undefined"!=typeof options?options:void 0),r}},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",i=t||{};return function(t,i){i.label&&(r=r+'<div class="control-label">'+n.escape(null==(e=i.label)?"":e)+"</div>"),t||(r+='<a class="control-upgrade" href="#">Upgrade to enable</a>'),i.help_text&&(r+='<div class="control-help"></div>'),i.editable&&(r+='<div class="control-edit-btn" data-tooltip-text="Edit this field"><input class="custom-checkbox-input" type="checkbox"><div class="custom-checkbox"></div></div>'),r=r+'<div class="input-video"><span class="icon"></span><span class="video-prew"></span><div class="video-title"></div><input class="control-input input-text" type="text"'+n.attr("placeholder",i.placeholder,!0,!0)+n.attr("readonly",i.readonly,!0,!0)+' autocorrect="off" autocapitalize="off"></div>'}.call(this,"isAccesible"in i?i.isAccesible:"undefined"!=typeof isAccesible?isAccesible:void 0,"options"in i?i.options:"undefined"!=typeof options?options:void 0),r}},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",i=t||{};return function(t,i){i.label&&(r=r+'<div class="control-label">'+n.escape(null==(e=i.label)?"":e)+"</div>"),t||(r+='<a class="control-upgrade" href="#">Upgrade to enable</a>'),i.help_text&&(r+='<div class="control-help"></div>'),i.editable&&(r+='<div class="control-edit-btn" data-tooltip-text="Edit this field"><input class="custom-checkbox-input" type="checkbox"><div class="custom-checkbox"></div></div>'),r=r+'<div class="input-video"><input class="control-input input-text" type="text"'+n.attr("placeholder",i.placeholder,!0,!0)+n.attr("readonly",i.readonly,!0,!0)+' autocorrect="off" autocapitalize="off"></div>'}.call(this,"isAccesible"in i?i.isAccesible:"undefined"!=typeof isAccesible?isAccesible:void 0,"options"in i?i.options:"undefined"!=typeof options?options:void 0),r}},function(t,e,r){r(0);t.exports=function(t){var e="";return e+='<div class="save-editor_overlay"><div class="embedder-content"><div class="ready-icon-wrap"><div class="ready-icon"><div class="icon success-icon animate"><div class="line tip animateSuccessTip"></div><div class="line long animateSuccessLong"></div><div class="placeholder"></div><div class="fix"></div></div></div></div><div class="embedder-title">Published</div></div></div>'}},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",i=t||{};return function(t){r=r+'<div class="login-service #{serviceName}-login"><div class="login-service-title">upload photos from your account</div><div class="social-button social-button-#{serviceName} #{serviceName}-login-button"><div class="icon-area icon-area-#{serviceName}"></div><div class="label-area">Connect with '+n.escape(null==(e=t)?"":e)+"</div></div></div>"}.call(this,"title"in i?i.title:"undefined"!=typeof title?title:void 0),r}},function(t,e,r){r(0);t.exports=function(t){var e="";return e+='<div class="input-dropdown" tabIndex="0"><div class="input-dropdown-default"><span>All</span><div class="dropdown-arrow"></div></div><ul class="input-dropdown-list"><li class="active" data-value="skins">All</li><li data-value="presets">Presets</li><li data-value="yours">Skins</li></ul></div>'}},function(t,e,r){var n=r(0);t.exports=function(t){var e,r="",i=t||{};return function(t,i,o){r=r+'<div class="presets-list-colors"'+n.attr("data-tooltip-text",i.name,!0,!0)+' data-tooltip-position="right center"><span class="before"></span><div class="presets-list-delete" data-icon="⏍"></div>',function(){var e=t;if("number"==typeof e.length)for(var s=0,a=e.length;s<a;s++){var u=e[s];o="background-color:"+i[u]+";width:"+60/t.length+"px",r=r+'<div class="presets-list-color"'+n.attr("data-name",u,!0,!0)+n.attr("style",n.style(o),!0,!0)+"></div>"}else for(var s in a=0,e)a++,u=e[s],o="background-color:"+i[u]+";width:"+60/t.length+"px",r=r+'<div class="presets-list-color"'+n.attr("data-name",u,!0,!0)+n.attr("style",n.style(o),!0,!0)+"></div>"}.call(this),r=r+'</div><div class="presets-list-name"><span>'+n.escape(null==(e=i.name)?"":e)+'</span></div><div class="presets-list-changes"><div class="total">0</div><div class="text">changes</div><div class="save">Save</div><div class="cancel">Reset</div></div>'}.call(this,"colors"in i?i.colors:"undefined"!=typeof colors?colors:void 0,"item"in i?i.item:"undefined"!=typeof item?item:void 0,"style"in i?i.style:"undefined"!=typeof style?style:void 0),r}},function(t,e,r){var n,i,o,s,a=function(t,e){return function(){return t.apply(e,arguments)}},u={}.hasOwnProperty,l=[].slice;i=r(2),o=r(3),s=r(13).createPopup,n=function(t){function e(){return this.setPopupTargetWindow=a(this.setPopupTargetWindow,this),this.deactivate=a(this.deactivate,this),this.colorChange=a(this.colorChange,this),this._change=a(this._change,this),this._updateOpacity=a(this._updateOpacity,this),this.update=a(this.update,this),this.toggle=a(this.toggle,this),this.render=a(this.render,this),e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var r in e)u.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.prototype.template="core/views/color",e.prototype.className="control-color",e.prototype.events={"input .control-input":"_change","click .color-preview-i":"toggle"},e.prototype.elements={".control-input":"input",".color-preview":"color",".color-preview-i":"colorPreview"},e.prototype.render=function(){return e.__super__.render.apply(this,arguments),this._updatePreviewColor(),this},e.prototype.toggle=function(){return this._createPopup().then(function(t){return function(){return t.popup.visible?t.popup.hide():t.popup.show()}}(this))},e.prototype.update=function(t,e,r){var n,i,o;return null==r&&(r={}),o=null!=t[this.attribute]?t[this.attribute]:this.options.default,r.from!==this&&this.input.val(this.tinycolor(o).toString("hex6")),r.from!==this.color&&this.spectrum(this.color,"set",o),n=this.tinycolor(o).toRgb(),null!=(i=this.spinner)&&i.change(100*n.a,{silent:!0}),this._updatePreviewColor(t)},e.prototype._createPopup=function(){return this.popupPromise?this.popupPromise:this.popupPromise=s({anchor:this.colorPreview}).then(function(t){return function(e){var r,n,i;return t.popup=e,t.spectrum(t.color,{preview:t.colorPreview.find(".sp-preview-inner"),flat:!0,showAlpha:!0,showInitial:!0,showInput:!0,preferredFormat:"hex6",showButtons:!1,clickoutFiresChange:!0,change:t.colorChange,move:t.colorChange,color:t.item[t.attribute],input:function(e){var r;return(r=e.toRgb()).a=t.spinner.input.val()/100,t.spectrum(t.color,"setTemp",r),t.colorChange(t.tinycolor(r))}}),i=t.spectrum(t.color,"container"),n=null==(r=t.options.alpha)||!0===String(r),i.toggleClass("sp-alpha-enabled",n),t.spinner=new o({className:"control control-stepper sp-alpha-step",attribute:"opacity",options:{min:0,max:100,default:100*t.tinycolor(t.item[t.attribute]).toRgb().a}}),t.spinner.bind("change:stepper",t._updateOpacity),i.find(".sp-input-container").append(t.spinner.render().el),i.find(".sp-input-container .sp-input").attr("maxLength","7"),t.popup.append(i)}}(this)).catch(function(t){return console.error(t.stack)})},e.prototype._updatePreviewColor=function(t){return this.colorPreview.find(".sp-preview-inner").css({backgroundColor:(t||this.item)[this.attribute]})},e.prototype._updateOpacity=function(t){var e;if(null==t&&(t={}),this.popup.visible)return(e=this.spectrum(this.color,"get").toRgb()).a=t.val/100,this.spectrum(this.color,"setTemp",e),this.colorChange(this.tinycolor(e))},e.prototype._change=function(){return this.colorChange(this.tinycolor(this.input.val()),{from:this})},e.prototype.colorChange=function(t,e){return null==e&&(e={}),this.change(t.toRgbString(),$.extend({attribute:this.attribute,from:this.color},e))},e.prototype.deactivate=function(){var t;return null!=(t=this.popup)?t.hide():void 0},e.prototype.release=function(){var t;return this.spectrum(this.color,"destroy"),null!=(t=this.popup)&&t.release(),e.__super__.release.apply(this,arguments)},e.prototype.tinycolor=function(){return window.tinycolor.apply(window,arguments)},e.prototype.spectrum=function(){var t,e,r;return e=arguments[0],t=2<=arguments.length?l.call(arguments,1):[],(r=$(e)).spectrum.apply(r,t)},e.prototype.setPopupTargetWindow=function(t){return this.targetWindow=t,this},e}(),t.exports=n},function(t,e,r){var n,i,o,s,a,u=function(t,e){return function(){return t.apply(e,arguments)}},l={}.hasOwnProperty;i=r(11),n=window.require("spine/controller/container"),a=r(26),o=r(25),s=function(t){function e(){return this.setPopupTargetWindow=u(this.setPopupTargetWindow,this),this.setPopupCSS=u(this.setPopupCSS,this),this.deactivate=u(this.deactivate,this),this.blur=u(this.blur,this),this.toggle=u(this.toggle,this),this.change=u(this.change,this),this.update=u(this.update,this),this.render=u(this.render,this),e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var r in e)l.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.prototype.className="control control-date-time",e.prototype.template=window.require("core/views/date-time/input"),e.include(n),e.prototype.elements={".input-icon":"popupAnchor"},e.prototype.events={"click .input-icon":"toggle","click .control-input":"toggle","focus .control-input":"blur"},e.prototype._format="d-m-Y H:i",e.prototype.render=function(){return e.__super__.render.apply(this,arguments),(this.popup=new a({anchor:this.popupAnchor,options:this.options})).render(),this.listenTo(this.popup,"change",this.change)},e.prototype.update=function(t,e,r){var n,i,s,a;return null==r&&(r={}),this.value=null!=t[this.attribute]?t[this.attribute]:this.options.default,this.value&&this.input.val(o.format(this.options.format,new Date(this.value))),this.value||(this.value=1e3*+o.format("U",(new Date).getTime())),n=(i=o.format(this._format,new Date(this.value)).split(" "))[0],a=i[1],null!=(s=this.popup)?s.update({date:n,time:a}):void 0},e.prototype.change=function(t){return t=1e3*+o.format("U",t),e.__super__.change.call(this,t)},e.prototype.toggle=function(){var t;if(null==(t=this._parent||(this._parent=this.parent()))||!t.disabled)return this.blur(),this.popup.toggle()},e.prototype.blur=function(){return this.input.blur()},e.prototype.deactivate=function(){return this.popup.hide()},e.prototype.setPopupCSS=function(t){return this.popup.setPopupCSS(t)},e.prototype.setPopupTargetWindow=function(t){return this.popup.setPopupTargetWindow(t)},e}(),t.exports=s},function(t,e,r){var n,i,o,s=function(t,e){return function(){return t.apply(e,arguments)}},a={}.hasOwnProperty;i=r(20),n=$("body"),o=function(t){function e(){return this._forcePause=s(this._forcePause,this),this.toggle=s(this.toggle,this),this.onInvalidURL=s(this.onInvalidURL,this),e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var r in e)a.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.prototype.className="control control-url control-audio-details",e.prototype.template="core/views/audio-details",e.prototype.silent=!0,e.prototype.elements={".audio-title":"title",".audio-title, .icon":"toggleTarget"},e.prototype.events={"click .audio-title, .icon":"toggle"},e.prototype.onInvalidURL=function(){return this.$removeClass("invalid"),this.title.text("File missing.")},e.prototype.update=function(){var t;return e.__super__.update.apply(this,arguments),(t=this.item.path.split("/").pop().split(".")).pop(),this.title.text(unescape(t.join(".")).trim()||"No Title")},e.prototype.toggle=function(){return e.__super__.toggle.apply(this,arguments),this.delay(function(t){return function(){return n.one("click",t._forcePause)}}(this))},e.prototype._forcePause=function(t){if(!this.toggleTarget.is(t.target))return this.sound.pause()},e}(),t.exports=o},function(t,e,r){var n,i,o=function(t,e){return function(){return t.apply(e,arguments)}},s={}.hasOwnProperty;i=r(28),n=function(t){function e(){return this.onInvalidURL=o(this.onInvalidURL,this),e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var r in e)s.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.prototype.className="control control-url control-image-details",e.prototype.template="core/views/image-details",e.prototype.elements={".image-title":"title"},e.prototype.silent=!0,e.prototype.onInvalidURL=function(){return this.$removeClass("invalid"),this.title.text("File missing.")},e.prototype.update=function(){var t,r;return e.__super__.update.apply(this,arguments),(r=this.item.image.split("/").pop().split(".")).pop(),this.title.text(unescape(r.join(".")).trim()||(null!=(t=this.item.metadata)?t.name:void 0)||"No Title")},e}(),t.exports=n},function(t,e,r){var n,i,o={}.hasOwnProperty;i=r(29),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var r in e)o.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.prototype.className="control control-url control-video-details",e.prototype.template="core/views/video-details",e.prototype.elements={".video-title":"title"},e.prototype.update=function(){var t;return e.__super__.update.apply(this,arguments),(t=this.item.path.split("/").pop().split(".")).pop(),this.title.text(unescape(t.join(".")).trim()||"No Title")},e}(),t.exports=n},function(t,e,r){var n,i,o,s,a,u=function(t,e){return function(){return t.apply(e,arguments)}},l={}.hasOwnProperty;i=r(2),n=window.require("spine/controller/container"),a=r(3),s=r(32),o=function(t){function e(){return this.setPopupTargetWindow=u(this.setPopupTargetWindow,this),this.deactivate=u(this.deactivate,this),this.toggle=u(this.toggle,this),this._change=u(this._change,this),this.update=u(this.update,this),this.render=u(this.render,this),e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var r in e)l.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.include(n),e.prototype.template="core/views/font",e.prototype.className="control-font",e.prototype.elements={".font-size":"fontSizeEl",".input-text":"fontFamily",".font-family-icon":"icon",".font-popup":"popupEl"},e.prototype.events={"click .font-family":"toggle"},e.prototype.render=function(){return e.__super__.render.apply(this,arguments),this.lastVal||(this.lastVal={family:this.options.family,size:this.options.size.default||0,style:this.options.style}),this.fontSizeControl=new a({el:this.fontSizeEl,attribute:"size",options:this.options.size}),this.fontsPopup=new s({el:this.popupEl,options:this.options,popupReference:this.icon,default:this.lastVal,disableSize:!this.options.size}),this.listenTo(this.fontSizeControl,"change:stepper",this._change),this.listenTo(this.fontsPopup,"change",this._change),this.el.toggleClass("no-size-input",!this.options.size),this.delay(function(t){return function(){return t.update(t.item)}}(this))},e.prototype.update=function(t,e,r){if(null==r&&(r={}),t[this.attribute])return this.lastVal=$.extend({},t[this.attribute]),r=$.extend({},r,{silent:!0}),this.fontsPopup.update(this.lastVal,e,r),this.fontSizeControl.update({size:this.lastVal.size},e,r),this.fontFamily.text(this.lastVal.family)},e.prototype._change=function(t){var e,r,n;if(t.attributes)for(e in r=t.attributes)n=r[e],this.lastVal[e]=n;return t.attribute&&(this.lastVal[t.attribute]=t.value),this.change(this.lastVal)},e.prototype.toggle=function(){return this.fontsPopup.toggle()},e.prototype.deactivate=function(){return this.fontsPopup.deactivate()},e.prototype.setPopupTargetWindow=function(t){return this.fontsPopup.setPopupTargetWindow(t)},e}(),t.exports=o},function(t,e,r){var n,i,o=function(t,e){return function(){return t.apply(e,arguments)}},s={}.hasOwnProperty,a=[].slice;n=r(7),i=function(t){function e(){this.blur=o(this.blur,this),this.update=o(this.update,this),this._change=o(this._change,this),this.onDrop=o(this.onDrop,this),this.onDrag=o(this.onDrag,this),this.onDragStart=o(this.onDragStart,this),this.render=o(this.render,this),this.init=o(this.init,this),e.__super__.constructor.apply(this,arguments),this.sortable(this.list,{itemSelector:".list-item",handle:".item-details-order",onDragStart:this.onDragStart,onDrop:this.onDrop,onDrag:this.onDrag}),this.list.bind("change",this._change)}return function(t,e){for(var r in e)s.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,n),e.prototype.template="core/views/order-picker",e.prototype.itemsTmpl=window.require("core/views/order-items"),e.prototype.className="order-picker",e.prototype.init=function(){var t,e,r,n,i;for(i=[],t=0,e=(n=this.options.options).length;t<e;t++)r=n[t],i.push((this.labels||(this.labels={}))[r.value]=r.label);return i},e.prototype.render=function(){return e.__super__.render.apply(this,arguments),this.item&&this.update(this.item),this.default.text("Arrange Items"),this},e.prototype.onDragStart=function(t,e,r){return this.isDragging=!0,r(t,e)},e.prototype.onDrag=function(t,e,r){return r(t,e)},e.prototype.onDrop=function(t,e,r){return this.isDragging=!1,r(t,e),this._change()},e.prototype._change=function(){var t;return t={},this.list.find(".list-item").each(function(e,r){var n,i,o,s;return o=(n=$(r)).data("value"),s=1+n.index(),i=n.find(".is-enabled").is(":checked"),t[o]={order:s,enabled:i}}),this.change(t)},e.prototype.update=function(t,e,r){var n,i,o,s,a,u,l,c,p;if(null==r&&(r={}),!this.isDragging){for(p=null!=t[this.attribute]?t[this.attribute]:this.options.default,r=[],n=0,o=(l=this.options.options).length;n<o;n++)p[(a=l[n]).value]&&(r[(u=p[a.value].order)-1]=$.extend({order:u},a,{enabled:p[a.value].enabled}));for(i=0,s=(c=this.options.options).length;i<s;i++)p[(a=c[i]).value]||r.push($.extend({order:r.length},a,{enabled:!1}));return this.list.html(this.itemsTmpl({options:r}))}},e.prototype.sortable=function(){var t,e,r;return t=arguments[0],e=2<=arguments.length?a.call(arguments,1):[],(r=$(t)).sortable.apply(r,e)},e.prototype.blur=function(t){if(t&&("click"!==t.type||!$(t.target).closest(this.list).length))return e.__super__.blur.apply(this,arguments)},e}(),t.exports=i},function(t,e,r){var n,i,o,s,a,u,l,c=function(t,e){return function(){return t.apply(e,arguments)}},p={}.hasOwnProperty;o=r(2),i=window.require("spine/controller/container"),u=r(3),n=window.require("core/models/composition"),s=r(34),l=$.extend.bind(null,{}),a=function(t){function e(t){var r;this.setPopupTargetWindow=c(this.setPopupTargetWindow,this),this.setPopupCSS=c(this.setPopupCSS,this),this.deactivate=c(this.deactivate,this),this.update=c(this.update,this),this._change=c(this._change,this),this.showPixelPanel=c(this.showPixelPanel,this),this.render=c(this.render,this),this.compositionSizeUpdate=c(this.compositionSizeUpdate,this),r=t.options.default,this.x=r.x,this.y=r.y,this.reference=r.reference,e.__super__.constructor.apply(this,arguments),n.bind("update",this.compositionSizeUpdate),this.compositionSizeUpdate(null,{attribute:!0})}return function(t,e){for(var r in e)p.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,o),e.include(i),e.prototype.template=r(19),e.prototype.className="control-position",e.prototype.elements={".input-position-x .control":"xPos",".input-position-y .control":"yPos",".input-position-panel":"positionPanel"},e.prototype.events={"click .input-position-panel":"showPixelPanel",positionUpdate:"_change"},e.prototype.getComposition=function(){var t;if(this.composition)return this.composition;try{return this.item.composition()}catch(e){t=e,console.error(t)}},e.prototype.compositionSizeUpdate=function(t,e){var r,n,i;if((r=this.getComposition())&&null!=e.attribute)return n=r.width,i=r.height,this.panelsPopup.pixel.updatePanelSize(n,i),this.panelsPopup.grid.updatePanelSize(n,i)},e.prototype.render=function(){var t;return e.__super__.render.apply(this,arguments),t=l(this.options,{label:"",help_text:""}),this._x=new u({el:this.xPos,attribute:"x",options:l(t,{default:this.options.default.x})}),this._y=new u({el:this.yPos,attribute:"y",options:l(t,{default:this.options.default.y})}),this.listenTo(this._x,"change:stepper",this._change),this.listenTo(this._y,"change:stepper",this._change),(this.panelsPopup=new s({x:this.x,y:this.y,anchor:this.positionPanel,options:this.options})).render(),this.listenTo(this.panelsPopup,"change",this._change),this},e.prototype.showPixelPanel=function(){return this.panelsPopup.refreshGrids(this.panelsPopup.toggle())},e.prototype._change=function(t){var e,r,n;if(t.attributes)for(e in r=t.attributes)n=r[e],this[e]=n;return t.attribute&&(this[t.attribute]=t.value),this.change({x:this.x,y:this.y,reference:this.reference})},e.prototype.update=function(t,e,r){var n;return null==r&&(r={}),n=t[this.attribute],this.x=n.x,this.y=n.y,this.reference=n.reference,this._x.update(n,e,r),this._y.update(n,e,r),this.panelsPopup.update(n,e,r)},e.prototype.deactivate=function(){return this.panelsPopup.hide()},e.prototype.release=function(){return e.__super__.release.apply(this,arguments),this.panelsPopup.release()},e.prototype.setPopupCSS=function(t){return this.panelsPopup.setPopupCSS(t)},e.prototype.setPopupTargetWindow=function(t){return this.panelsPopup.setPopupTargetWindow(t)},e}(),t.exports=a},function(t,e,r){var n,i,o,s,a,u,l=function(t,e){return function(){return t.apply(e,arguments)}},c={}.hasOwnProperty;s=r(2),o=window.require("spine/controller/container"),u=function(t,e,r){return Math.max(Math.min(r,parseInt(t)),e)},i=$(document),n=$("body"),a=function(t){function e(){var t,r,i;this.eventX=l(this.eventX,this),this.maxInpVal=l(this.maxInpVal,this),this.minInpVal=l(this.minInpVal,this),this.blurMax=l(this.blurMax,this),this.blurMin=l(this.blurMin,this),this.minMaxFocus=l(this.minMaxFocus,this),this.liveUpdate=l(this.liveUpdate,this),this.updateInputs=l(this.updateInputs,this),this.focus=l(this.focus,this),this.update=l(this.update,this),this.dragStop=l(this.dragStop,this),this.drag=l(this.drag,this),this._onMouseDown=l(this._onMouseDown,this),this.trackWidth=l(this.trackWidth,this),this.added=l(this.added,this),this.mouseEnterBody=l(this.mouseEnterBody,this),e.__super__.constructor.apply(this,arguments),(t=this.options).min||(t.min=0),(r=this.options).max||(r.max=1),(i=this.options).unit||(i.unit=""),this.options.min>>=0,this.options.max>>=0,n.bind("mouseenter",this.mouseEnterBody),this.minInput.bind("blur",this.blurMin),this.maxInput.bind("blur",this.blurMax),this.el.find("input").bind("focus",this.focus),this.el.find(".min-value, .max-value").bind("focus",this.minMaxFocus)}return function(t,e){for(var r in e)c.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,s),e.include(o),e.prototype.template="core/views/range",e.prototype.className="control-range",e.prototype.elements={".min-thumb":"minThumb",".max-thumb":"maxThumb",".min-value":"minInput",".max-value":"maxInput",".input-range-track":"track",".input-range-thumbs":"thumbs",".input-range":"input"},e.prototype.events={"mousedown .input-range-thumb":"dragStart","keydown .min-value,.max-value":"onKeyDown","mousedown .input-range-track":"click"},e.prototype.offsetX=0,e.prototype.isMouseDown=!1,e.prototype.position={left:function(t){return u(t-this.offsetX+40,0,this.trackWidth()-this.thumbsCss("right"))},right:function(t){return u(this.width-(t-this.offsetX),0,this.trackWidth()-this.thumbsCss("left"))}},e.prototype.mouseEnterBody=function(t){if(this.isMouseDown)return 1!==(t.buttons||t.which)?this.dragStop(t):void 0},e.prototype.thumbsCss=function(t,e,r){return this._||(this._={left:0,right:0}),null==e?null!=r&&this.thumbs.css(t)||this._[t]:this.thumbs.css(t,this._[t]=e)},e.prototype.thumbsEase=function(t,e,r){var n;return null==r&&(r=function(){}),(n={})[t]=this._[t]=e,this.thumbs.animate(n,300,r)},e.prototype.added=function(){return e.__super__.added.apply(this,arguments),this.trackWidth(),this},e.prototype.trackWidth=function(){return this.width>0?this._trackWidth:(this.width=this.track.width(),this._trackWidth=this.width-2)},e.prototype.dragStart=function(t){var e;return e=$(t.target),this.current="max"===e.data("thumb")?"right":"left",this.offsetX=this.track.offset().left+(this.eventX(t)-e.offset().left),this._onMouseDown(t)},e.prototype.click=function(t){return this.current=this.eventX(t)-(this.thumbs.offset().left+this.thumbs.width()/2)<=0?"left":"right","left"===this.current&&this.minThumb||this.maxThumb,this.offsetX=this.track.offset().left+20,this._onMouseDown(t),this.thumbsEase(this.current,this.position[this.current].call(this,this.eventX(t)),this.liveUpdate)},e.prototype._onMouseDown=function(t){return this.isMouseDown=!0,t.preventDefault(),t.stopPropagation(),this.input.focus(),n.addClass("thumb-dragging"),i.bind("mousemove",this.drag).one("mouseup",this.dragStop),this.liveUpdate()},e.prototype.drag=function(t){return this.thumbs.stop(!0,!0),this.thumbsCss(this.current,this.position[this.current].call(this,this.eventX(t))),this.updateInputs(),this.timeout=setTimeout(this.liveUpdate,100)},e.prototype.dragStop=function(){return i.unbind("mousemove",this.drag),clearTimeout(this.timeout),n.removeClass("thumb-dragging"),this.liveUpdate(),this.isMouseDown=!1},e.prototype.update=function(t,e,r){var n;if(null==r&&(r={}),!r.from||r.from!==this)return(n=t[this.attribute]||{min:0,max:0}).min=parseInt(n.min||0)>>0,n.max=parseInt(n.max||0)>>0,this.minInpVal(n.min),this.maxInpVal(n.max),this.thumbsCss("left",(n.min-this.options.min)/(this.options.max-this.options.min)*this.trackWidth()),this.thumbsCss("right",this.trackWidth()-(n.max-this.options.min)/(this.options.max-this.options.min)*this.trackWidth())},e.prototype.focus=function(){return this.input.addClass("active")},e.prototype.updateInputs=function(){var t,e;return e=this.thumbsCss("left")/this.trackWidth()*(this.options.max-this.options.min)+this.options.min,t=(this.trackWidth()-this.thumbsCss("right"))/this.trackWidth()*(this.options.max-this.options.min)+this.options.min,this.minInpVal(Math.round(e)),this.maxInpVal(Math.round(Math.min(t,this.options.max))),{min:e,max:t}},e.prototype.liveUpdate=function(){return this.item.updateAttribute(this.attribute,this.updateInputs(),{attribute:this.attribute,from:this})},e.prototype.minMaxFocus=function(t){var e;return(e=$(t.target)).val(parseInt(e.val()))},e.prototype.blurMin=function(){var t;return this.min===(t=parseInt(this.minInpVal(null,!0)))?this.minInpVal(this.min):(t=Math.min(this.options.max,t),t=Math.max(this.options.min,t),t=Math.min(t,parseInt(this.maxInpVal())),this.thumbsCss("left",(t-this.options.min)/(this.options.max-this.options.min)*this.trackWidth()),this.minInpVal(parseInt(t)),this.input.removeClass("active"),this.liveUpdate())},e.prototype.blurMax=function(){var t;return this.max===(t=parseInt(this.maxInpVal(null,!0)))?this.maxInpVal(this.max):(t=Math.min(this.options.max,t),t=Math.max(this.options.min,t),t=Math.max(t,parseInt(this.minInpVal())),this.thumbsCss("right",this.trackWidth()-(t-this.options.min)/(this.options.max-this.options.min)*this.trackWidth()),this.maxInpVal(parseInt(t)),this.input.removeClass("active"),this.liveUpdate())},e.prototype.minInpVal=function(t,e){var r;return null!=t?this.minInput.val((this.min=t)+this.options.unit):null==e||isNaN(r=parseInt(this.minInput.val()))?this.min:r},e.prototype.maxInpVal=function(t,e){var r;return null!=t?this.maxInput.val((this.max=t)+this.options.unit):null==e||isNaN(r=parseInt(this.maxInput.val()))?this.max:r},e.prototype.onKeyDown=function(t){if(13===t.keyCode)return $(t.target).blur()},e.prototype.eventX=function(t){return t.pageX||t.clientX},e.prototype.setWindow=function(){return e.__super__.setWindow.apply(this,arguments),i=$(this.window.document),n=i.find("body")},e}(),t.exports=a},function(t,e,r){var n,i,o,s=function(t,e){return function(){return t.apply(e,arguments)}},a={}.hasOwnProperty;i=r(4),o=function(t){return $.ajax("//widgetic.com/feeds/?v=1.0&q="+encodeURIComponent(t),{dataType:"jsonp"})},n=function(t){function e(){return this._checkURL=s(this._checkURL,this),e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var r in e)a.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.prototype.type="rss",e.prototype.className="control-rss",e.prototype._checkURL=function(){return this.req=o(this.lastURL).done(function(t){return function(e){return 200===e.responseStatus&&t.def.resolve()||t.def.reject()}}(this)),(this.def=new $.Deferred).promise()},e}(),t.exports=n},function(t,e,r){var n,i,o,s,a=function(t,e){return function(){return t.apply(e,arguments)}},u={}.hasOwnProperty;i=r(2),n=window.require("spine/controller/container"),s=r(3),window.require("core/models/composition"),o=function(t){function e(){this.update=a(this.update,this),this.change=a(this.change,this),this.updateSteppers=a(this.updateSteppers,this),this.scaleUpdated=a(this.scaleUpdated,this),this.heightUpdated=a(this.heightUpdated,this),this.widthUpdated=a(this.widthUpdated,this),this.updateValues=a(this.updateValues,this),this.render=a(this.render,this),this.getProp=a(this.getProp,this),this.spinnerOptions=a(this.spinnerOptions,this),e.__super__.constructor.apply(this,arguments),this.getProp(),this.widthStepper=new s(this.spinnerOptions("width")),this.heightStepper=new s(this.spinnerOptions("height")),this.scalerStepper=new s({attribute:"scale",options:{label:"",unit:" %",min:parseInt(this.options.min),max:parseInt(this.options.max),default:100}}),this.steppers=[this.widthStepper,this.heightStepper,this.scalerStepper]}return function(t,e){for(var r in e)u.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.include(n),e.prototype.template="core/views/scale",e.prototype.className="control-scale",e.prototype.elements={".input-scale-width":"widthEl",".input-scale-height":"heightEl",".input-scale-scaler":"scaleEl"},e.prototype.events={"change:stepper":"updateValues"},e.prototype.spinnerOptions=function(t){return{attribute:t,options:{label:"",unit:" px",min:parseInt(this.options[t])*(parseInt(this.options.min)/100),max:parseInt(this.options[t])*(parseInt(this.options.max)/100),default:this.options[t]}}},e.prototype.getProp=function(){return this.dw=parseInt(this.options.width),this.dh=parseInt(this.options.height),this.ratio=this.dw/this.dh},e.prototype.render=function(){var t,r,n,i;for(e.__super__.render.apply(this,arguments),r=0,n=(i=this.steppers).length;r<n;r++)this[(t=i[r]).attribute+"El"].append(t.render().el);return this},e.prototype.updateValues=function(t,e){return null==e&&(e={}),null!=t&&t.stopPropagation(),this[e.attribute+"Updated"](e.val)},e.prototype.widthUpdated=function(t){return this.updateSteppers(t/this.dw)},e.prototype.heightUpdated=function(t){return this.updateSteppers(t/this.dh)},e.prototype.scaleUpdated=function(t){return this.updateSteppers(t/100)},e.prototype.updateSteppers=function(t,e){return this.height=this.dh*t,this.width=this.dw*t,this.scale=100*t,this.change(e)},e.prototype.change=function(t){var r,n,i,o;for(n=0,i=(o=this.steppers).length;n<i;n++)(r=o[n]).change(this[r.attribute],{silent:!0});return e.__super__.change.call(this,{width:this.width,height:this.height},t)},e.prototype.update=function(t,e,r){var n;if(null==r&&(r={}),!r.from||r.from!==this)return this.updateSteppers((null!=(n=this.item)?n[this.attribute].width:void 0)/this.dw,{silent:!0})},e}(),t.exports=o},function(t,e,r){var n,i,o,s,a,u=function(t,e){return function(){return t.apply(e,arguments)}},l={}.hasOwnProperty;o=r(2),i=window.require("spine/controller/container"),a=function(t,e,r){return Math.max(Math.min(r,Number(t)),e)},n=$("body"),s=function(t){function e(){var t,r,n;this.blur=u(this.blur,this),this._valToPos=u(this._valToPos,this),this._posToVal=u(this._posToVal,this),this.trackClick=u(this.trackClick,this),this.liveUpdate=u(this.liveUpdate,this),this.mouseToLocal=u(this.mouseToLocal,this),this.drag=u(this.drag,this),this.stopDrag=u(this.stopDrag,this),this.startDrag=u(this.startDrag,this),this.update=u(this.update,this),this.mouseEnterBody=u(this.mouseEnterBody,this),e.__super__.constructor.apply(this,arguments),(t=this.options).min||(t.min=0),(r=this.options).max||(r.max=1),(n=this.options).unit||(n.unit=""),this.text.bind("blur",this.blur)}return function(t,e){for(var r in e)l.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,o),e.include(i),e.prototype.template="core/views/slider",e.prototype.className="control-slider",e.prototype.elements={".input-slider-thumb":"thumb",".input-slider":"input",".input-slider-value":"text",".input-slider-container":"container"},e.prototype.events={"mousedown .input-slider-thumb":"startDrag","mousedown .input-slider":"trackClick","focus input":"focus","keydown input":"keydown"},e.prototype.pageX=0,e.prototype.isMouseDown=!1,e.prototype.mouseEnterBody=function(t){if(this.isMouseDown)return 1!==(t.buttons||t.which)?this.stopDrag(t):void 0},e.prototype.update=function(t,e,r){var n;if(null==r&&(r={}),!r.from||r.from!==this)return n=null!=t[this.attribute]?t[this.attribute]:this.options.default,this.thumb.css({left:this._valToPos(n)}),this.value(parseInt(a(n,this.options.min,this.options.max)))},e.prototype.startDrag=function(t){return this.isMouseDown=!0,t.stopPropagation(),t.preventDefault(),this.input.focus(),this.tw=this.thumb.width(),(n=$(this.el[0].ownerDocument.body)).bind("mousemove",this.drag).bind("mouseup",this.stopDrag).addClass("thumb-dragging").unbind("mouseenter",this.mouseEnterBody).bind("mouseenter",this.mouseEnterBody),clearInterval(this.interval),this.interval=setInterval(this.liveUpdate,100)},e.prototype.stopDrag=function(t){return n.unbind("mousemove",this.drag).unbind("mouseup",this.stopDrag).removeClass("thumb-dragging"),clearInterval(this.interval),this.liveUpdate(),this.isMouseDown=!1},e.prototype.drag=function(t){return t.preventDefault(),this.pageX=t.pageX,this.thumb.css({left:this.mouseToLocal()})},e.prototype.mouseToLocal=function(){return a(this.pageX-this.container.offset().left-this.tw/2,0,this.container.width()-this.tw)},e.prototype.liveUpdate=function(){var t;return t=this._posToVal(),this.value(parseInt(t)),this.item.updateAttribute(this.attribute,t,{attribute:this.attribute,from:this}),this},e.prototype.trackClick=function(t){return t.preventDefault(),this.tw=this.thumb.width(),this.pageX=t.pageX,this.thumb.animate({left:this.mouseToLocal()},300,this.liveUpdate)},e.prototype._posToVal=function(){return(this.options.max-this.options.min)*this.thumb.position().left/(this.container.width()-this.tw)+Number(this.options.min)},e.prototype._valToPos=function(t){var e,r;return e=this.container.width()-this.thumb.width(),r=100*(t-this.options.min)/(this.options.max-this.options.min)/100,e?a(e*r,0,e):a(100*r,0,100)+"%"},e.prototype.focus=function(){return this.text.val(this.lastValue)},e.prototype.value=function(t){var e;return null!=t?this.text.val((this.lastValue=t)+this.options.unit):isNaN(e=parseInt(this.text.val()))?+this.lastValue:e},e.prototype.blur=function(){var t;return t=a(this.value(),this.options.min,this.options.max),this.thumb.css({left:this._valToPos(t)}),this.value(parseInt(t)),this.item.updateAttribute(this.attribute,t,{attribute:this.attribute,from:this})},e.prototype.keydown=function(t){if(13===t.keyCode)return this.blur()},e.prototype.release=function(){return clearInterval(this.interval),e.__super__.release.apply(this,arguments)},e}(),t.exports=s},function(t,e,r){var n,i,o=function(t,e){return function(){return t.apply(e,arguments)}},s={}.hasOwnProperty;n=r(2),i=function(t){function e(){return this._editor=o(this._editor,this),this.release=o(this.release,this),this._change=o(this._change,this),this._load=o(this._load,this),this.render=o(this.render,this),this.update=o(this.update,this),e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var r in e)s.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,n),e.prototype.className="control-textarea loading",e.prototype.template="core/views/textarea",e.prototype.parserRules={tags:{b:{},i:{},u:{},br:{},a:{set_attributes:{target:"_blank",rel:"nofollow"},check_attributes:{href:"url"}}}},e.prototype.elements={textarea:"textarea",".toolbar":"toolbar"},e.prototype.update=function(t,e,r){var n;if(null==r&&(r={}),(n=null!=t[this.attribute]?t[this.attribute]:this.options.default)&&(!this.loaded||n!==this.editor.getValue()))return this.editor?this.editor.setValue(n):void 0},e.prototype.render=function(){var t;if(this.el.addClass("loading"),e.__super__.render.apply(this,arguments),null!=(t=this._editor()))return this.editor=new t(this.textarea[0],{parserRules:this.parserRules,placeholderText:this.options.placeholder,toolbar:this.toolbar[0],style:!0}).on("load",this._load).on("change",this._change),this.editor.on("focus",function(t){return function(e){if(!t.el.is(".focused"))return t.el.addClass("focused"),t.editor.currentView.element.style.overflow="auto"}}(this)),this.editor.on("blur",function(t){return function(e){if(t.el.is(".focused"))return t.el.removeClass("focused"),t.editor.currentView.element.scrollTop=0,t.editor.currentView.element.style.overflow="hidden"}}(this)),this},e.prototype.onDrop=function(){var t;return null!=(t=this.editor)&&t.stopObserving(),this.render()},e.prototype._load=function(){return this.loaded=!0,this.el.removeClass("loading")},e.prototype._change=function(){return this.change(this.editor.getValue())},e.prototype.release=function(){var t;return null!=(t=this.editor)&&t.stopObserving(),e.__super__.release.apply(this,arguments)},e.prototype._editor=function(){var t;return null!=(t=window.wysihtml5)?t.Editor:void 0},e}(),t.exports=i},function(t,e,r){var n,i,o,s=function(t,e){return function(){return t.apply(e,arguments)}},a={}.hasOwnProperty;i=r(2),n=window.require("spine/controller/container"),o=function(t){function e(){return this.render=s(this.render,this),this.toggle=s(this.toggle,this),this.update=s(this.update,this),e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var r in e)a.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.include(n),e.prototype.template="core/views/toggle",e.prototype.className="control-toggle",e.prototype.elements={".input-toggle-true":"true",".input-toggle-false":"false",".input-toggle":"input"},e.prototype.events={"click .input-toggle":"toggle"},e.prototype.update=function(t){var e;return e=null!=t[this.attribute]?t[this.attribute]:this.options.default,this.input.attr("data-value",String(e))},e.prototype.toggle=function(t){return null!=t&&t.stopPropagation(),this.item.updateAttribute(this.attribute,!("true"===this.input.attr("data-value")),{attribute:this.attribute,from:this})},e.prototype.render=function(){return this.labels=this.options.values_labels||[],e.__super__.render.apply(this,arguments)},e}(),t.exports=o},,function(t,e){var r,n,i,o={}.hasOwnProperty;r=window.require("spine/controller/activateable"),n=window.require("spine/controller/index"),i=function(t){function e(){var t,r;e.__super__.constructor.apply(this,arguments),r=(r=null!=this.panel.serviceTitle?this.panel.serviceTitle:this.panel.title)[0].toUpperCase()+r.slice(1),this.el.append(this.len=$('<div data-count="0"></div>')).addClass(this.panel.title).attr({"data-tooltip-text":r,"data-tooltip-position":"right center"}),(t=this.panel.options.icon)&&this.el.append('<div class="browser-tab--icon" style="background-image: url(\''+t+"')\"></div>")}return function(t,e){for(var r in e)o.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,n),e.prototype.className="browser-tab",e.prototype.events={click:"active"},e.include(r),e.prototype.count=function(t){return this.len.attr("data-count",t)},e}(),t.exports=i},function(t,e,r){var n,i,o={}.hasOwnProperty;i=r(52),n=function(t){function e(){var t;e.__super__.constructor.apply(this,arguments),null!=(t=this.item.className)&&this.el.addClass(t)}return function(t,e){for(var r in e)o.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.prototype.className="browser-entry browser-folder",e.prototype.events={click:"click"},e.prototype.update=function(){return this.el.attr("data-count",0)},e.prototype.click=function(){return this.item.trigger("select")},e}(),t.exports=n},function(t,e,r){var n,i,o=function(t,e){return function(){return t.apply(e,arguments)}},s={}.hasOwnProperty;n=r(15),i=function(t){function e(){return this.previewUrl=o(this.previewUrl,this),this.url=o(this.url,this),this.saveURL=o(this.saveURL,this),this.appendPreview=o(this.appendPreview,this),this.show=o(this.show,this),e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var r in e)s.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,n),e.prototype.className="browser-image",e.prototype.img=function(){return $('<span class="browser-image-prew_img"></span>').css({background:"url("+this.previewUrl()+") center center no-repeat",opacity:1})},e.prototype.show=function(){return e.__super__.show.apply(this,arguments),this.appendPreview()},e.prototype.appendPreview=function(){return!this._previewUrl&&this.preview.append(this.img())},e.prototype.saveURL=function(t){return this._previewUrl=t,this.appendPreview()},e.prototype.url=function(){return"function"==typeof this.getURL?this.getURL(this.item,this.saveURL):void 0},e.prototype.previewUrl=function(){return this._previewUrl||(this._previewUrl="function"==typeof this.getPreviewURL?this.getPreviewURL(this.item):void 0)||this.url()},e}(),t.exports=i},function(t,e,r){var n,i,o=function(t,e){return function(){return t.apply(e,arguments)}},s={}.hasOwnProperty;i=r(15),n=function(t){function e(){this.refresh=o(this.refresh,this),this.status=o(this.status,this),e.__super__.constructor.apply(this,arguments),this.deflt={volume:100,onpause:this.status,onstop:this.status,onresume:this.status,onfinish:this.status,onplay:this.status,fromController:"browser-audio"}}return function(t,e){for(var r in e)s.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.prototype.className="browser-audio",e.prototype.events={"click .browser-entry-info":"togglePlay"},e.prototype.status=function(){if(this.sound)return this.el.toggleClass("playing",!this.sound.paused&&1===this.sound.playState)},e.prototype.togglePlay=function(){var t,e,r,n;if(this.el.toggleClass("loading",!this.sound),n=function(t){return function(e){return t.item.url=e,t.sound=soundManager.createSound($.extend({url:e},t.deflt))||null,t.togglePlay()}}(this),this.sound){if(!this.el.is(".playing"))for(t in e=soundManager.sounds)"browser-audio"===(r=e[t]).instanceOptions.fromController&&r.id!==this.sound.id&&r.stop().setPosition(0);return this.sound.togglePause()}return this.$trigger("getURL",n)},e.prototype.release=function(){try{this.sound.destruct()}catch(t){}return this.sound=null,e.__super__.release.apply(this,arguments)},e.prototype.refresh=function(){var t;return null!=(t=this.sound)?t.pause():void 0},e}(),t.exports=n},function(t,e,r){var n,i,o={}.hasOwnProperty;n=r(15),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var r in e)o.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,n),e.prototype.className="browser-video",e}(),t.exports=i},function(t,e,r){var n,i,o={}.hasOwnProperty;n=r(15),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var r in e)o.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,n),e.prototype.className="browser-rss",e}(),t.exports=i},function(t,e,r){var n,i,o,s={}.hasOwnProperty,a=[].slice;i=window.require("spine/controller"),n=window.require("spine/controller/activateable"),r(53).default,o=r(149).default,t.exports=function(t){function e(t){var r,n;e.__super__.constructor.apply(this,arguments),this._initilized=new Promise(function(t){return function(e){return t._resolve=e}}(this)),r=(r=null!=(n=t.filetypes)?n:[]).join(","),this.options=Object.assign(t,{filetypes:r}),this.on("activate",function(t){return function(){return t.component||t._init(),t.component.activate()}}(this))}return function(t,e){for(var r in e)s.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.include(n),e.isCompatible=function(t){return!!t&&t.some(function(t){return"audio"===t||"image"===t||"video"===t})},e.prototype.className="browser activateable upload-browser",e.prototype.attributes={authenticated:!0},e.prototype.title="uploads",e.prototype._init=function(){return this.component=new o({target:this.el[0],data:this.options}),this.component.on("error",function(t){return function(e){return t.$trigger("error","Error: "+e.message)}}(this)),this.component.on("toggle",function(t){return function(e){return t.trigger("toggle",e)}}(this)),this.component.on("clearContent",function(t){return function(e){return t.trigger("clearContent",e)}}(this)),this.component.observe("loading",function(t){return function(e){return t.el.toggleClass("loading",e)}}(this)),this._resolve()},e.prototype.set=function(t){return this._initilized.then(function(e){return function(){return e.component.set(t)}}(this))},e.prototype.observe=function(){var t;return t=1<=arguments.length?a.call(arguments,0):[],this._initilized.then(function(e){return function(){var r;return(r=e.component).observe.apply(r,t)}}(this))},e}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(145),i=r.n(n),o=r(146),s=r(147),a=r(148),u=new i.a;e.default={init:function(t){u.constant("user",t.user),u.constant("uploadToken",t.uploadToken),u.service("Content",o.a,"user"),u.service("Uploads",s.a,"user","uploadToken"),u.service("Sounds",a.a)},instance:u.container}},function(t,e,r){"use strict";const n=["B","kB","MB","GB","TB","PB","EB","ZB","YB"];t.exports=function(t){if(!Number.isFinite(t))throw new TypeError("Expected a finite number, got "+typeof t+": "+t);const e=t<0;if(e&&(t=-t),t<1)return(e?"-":"")+t+" B";const r=Math.min(Math.floor(Math.log(t)/Math.log(1e3)),n.length-1),i=Number((t/Math.pow(1e3,r)).toPrecision(3));return(e?"-":"")+i+" "+n[r]}},function(t,e,r){"use strict";function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,o(n.key),n)}}function o(t){var e=function(t,e){if("object"!=n(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==n(e)?e:String(e)}function s(t,e,r){return e=c(e),function(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,u()?Reflect.construct(e,r||[],c(t).constructor):e.apply(t,r))}function a(t){var e="function"==typeof Map?new Map:void 0;return(a=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return function(t,e,r){if(u())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var i=new(t.bind.apply(t,n));return r&&l(i,r.prototype),i}(t,arguments,c(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),l(r,t)})(t)}function u(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(u=function(){return!!t})()}function l(t,e){return(l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function c(t){return(c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var p=function(t){function e(t){var r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=s(this,e,[t])).originalRequest=i,r.originalResponse=o,r.causingError=n,null!=n&&(t+=", caused by ".concat(n.toString())),null!=i){var a=i.getHeader("X-Request-ID")||"n/a",u=i.getMethod(),l=i.getURL(),c=o?o.getStatus():"n/a",p=o?o.getBody()||"":"n/a";t+=", originated from request (method: ".concat(u,", url: ").concat(l,", response code: ").concat(c,", response text: ").concat(p,", request id: ").concat(a,")")}return r.message=t,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&l(t,e)}(e,a(Error)),function(t,e,r){return e&&i(t.prototype,e),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}(e)}();e.a=p},function(t,e,r){"use strict";e.a=function(t){if(!n)return;console.log(t)};var n=!1},function(t,e,r){"use strict";e.a=function(){return"undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase()}},function(t,e){var r,n,i,o=function(t,e){return function(){return t.apply(e,arguments)}},s={}.hasOwnProperty;i=window.require("spine/controller"),n=window.require("spine/controller/container"),r=function(t){function e(){var t,r,n,i,s,a;for(r in this.deactivate=o(this.deactivate,this),this.update=o(this.update,this),e.__super__.constructor.apply(this,arguments),this.length=0,a=this.options)s=a[r],this.isEditable(s)&&(t=window.require(s.control),void 0!==i&&null!==i||(i=t=window.require(this.det(s.control))),n=new t({options:$.extend(!0,{},s.options||{}),attribute:r,item:this.item,isDetailInput:!0,conditions:s.if}),this.append(n),this.el.toggleClass("no-attributes",++this.length<2))}return function(t,e){for(var r in e)s.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.prototype.className="item-details-attributes",e.include(n),e.prototype.update=function(){return this.delay(function(t){return function(){var e,r,n,i,o;for(o=[],r=0,n=(i=t.children()).length;r<n;r++)e=i[r],o.push(e.setItem(t.item));return o}}(this))},e.prototype.det=function(t){return/audio|video|image/.test(t)?t.replace("core/controls/","core/controls/details/"):t},e.prototype.deactivate=function(){return this.children(function(t){return"function"==typeof t.deactivate?t.deactivate():void 0})},e.prototype.isEditable=function(t){return!1!==t.options.editable},e.prototype.onDrop=function(){return this.children(function(t){return"function"==typeof t.onDrop?t.onDrop():void 0})},e}(),t.exports=r},function(t,e){var r,n,i=function(t,e){return function(){return t.apply(e,arguments)}},o={}.hasOwnProperty,s=[].indexOf||function(t){for(var e=0,r=this.length;e<r;e++)if(e in this&&this[e]===t)return e;return-1};r=window.require("spine/controller/activator"),window.require("core/models/content"),window.require("core/models/composition"),n=function(t){function e(){return this.setOptions=i(this.setOptions,this),this._active=i(this._active,this),this.init=i(this.init,this),e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var r in e)o.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,r),e.prototype.className="editor-footer",e.prototype.containerClass="editor-breadcrumbs",e.prototype.events={"click .editor-next-btn":"getStep","click .editor-prev-btn":"getStep"},e.prototype.init=function(){return this.prevBtn=$("<div class='editor-prev-btn' data-dir='prev'>prev</div>"),this.nextBtn=$("<div class='editor-next-btn' data-dir='next'></div>"),this.append(this.prevBtn,this.nextBtn),e.__super__.init.apply(this,arguments)},e.prototype.getStep=function(t){var e,r;if(e=this.children(function(t){return t.isActive()})[0])return r=e.el[$(t.target).data("dir")]().controller().panel.title.toLowerCase(),this.$trigger("Footer:step",r)},e.prototype._active=function(t){return this.ctrl=t,e.__super__._active.apply(this,arguments),this.prevBtn.toggleClass("disabled",null==this.ctrl.el.prev().controller())},e.prototype.setOptions=function(t){if(null!=t.enabled&&this.el.toggle(t.enabled),t.steps)return this.children(function(e){var r;if(r=e.panel.title.toLowerCase(),s.call(t.steps,r)<0)return e.el.remove()}),this._active(this.ctrl)},e}(),t.exports=n},function(t,e){t.exports=function(){var t,e;return"e_gd_c",e=1e4,t={},{init:function(t,r){return t,e=r},clear:function(e,r){var n;return r?null!=(n=t[e])?n[r]=null:void 0:t[e]={}},set:function(r,n,i){return(t[r]||(t[r]={}))[n]=i,t[r][n].__exp__=+new Date+e},check:function(e,r){var n,i;return(null!=(n=t[e])&&null!=(i=n[r])?i.__exp__:void 0)>+new Date},get:function(e,r){var n;return null!=(n=t[e])?n[r]:void 0}}}()},function(t,e){t.exports=new Promise(function(t){var e,r,n;return e=function(){return gapi.load("client:auth2",function(){return gapi.client.init({apiKey:"AIzaSyDNHyaQxinEYqwuGTTy1pJeEC09ewAxNNM",clientId:"30789742875.apps.googleusercontent.com",discoveryDocs:["https://www.googleapis.com/discovery/v1/apis/drive/v3/rest"],scope:"https://www.googleapis.com/auth/drive"}).then(t)})},(r=document.createElement("script")).type="text/javascript",r.async=!0,r.src="https://apis.google.com/js/api.js",r.onload=e,(n=document.getElementsByTagName("script")[0]).parentNode.insertBefore(r,n)})},function(t,e,r){var n,i,o={}.hasOwnProperty;n=r(14),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var r in e)o.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,n),e.prototype.className="popup login-popup share-file-popup",e.prototype.confirmBtnClass="green-button button--uc",e.prototype.cancelBtnClass="dim-button button--uc",e.prototype.title="Only public files can be embedded.",e.prototype.content="Do you want to share this file publicly?",e.prototype.note="",e.prototype.separator=!1,e.prototype.confirmBtn="Make public",e.prototype.cancelBtn="Cancel",e}(),t.exports=new i},,,,,,function(t,e,r){function n(t,e,r){this.name="AjaxError",this.message=e,this.jqXHR=t,this.errorThrown=r}n.prototype=new Error,n.prototype.constructor=n,function(t){var e=t.ajax;t.ajax=function(){var t=Array.prototype.slice.call(arguments),r=e.apply(this,t);return function t(e){return e.done=function(r){return t(e.then(r))},e.fail=function(r){return t(e.then(null,r))},e.complete=function(r){return t(e.then(r,r))},e}(new Promise(function(t,e){r.then(function(e,r,n){t(e)},function(t,r,i){e(new n(t,r,i))})}))}}(jQuery);var i=function(t,e){return e?function(r,n,i){i.exports=t(e)}:function(e,r,n){n.exports=t}};function o(t,e){var r=/^\.\/(.+)\.(pug|coffee)$/;t.keys().forEach(function(n){var o=r.exec(n)[1];e&&(o=e+o),window.require.define(o,i(t,n))})}window.soundManager=r(129).soundManager,window.require.define({"editor/listeners/embed-listener":i(r(130))}),o(r(58)),o(r(183),"core/controls/"),o(r(185),"editor/content/service/"),o(r(196),"browser/controller/")},function(t,e,r){(function(t){var n;
|
|
2
2
|
/** @license
|
|
3
3
|
*
|
|
4
4
|
* SoundManager 2: JavaScript Sound for the Web
|
|
@@ -23,14 +23,14 @@
|
|
|
23
23
|
*
|
|
24
24
|
* V2.97a.20170601
|
|
25
25
|
*/
|
|
26
|
-
!function(i,o){"use strict";if(!i||!i.document)throw new Error("SoundManager requires a browser with window and document objects.");var s=null;function a(t,e){this.setupOptions={url:t||null,flashVersion:8,debugMode:!0,debugFlash:!1,useConsole:!0,consoleOnly:!0,waitForWindowLoad:!1,bgColor:"#ffffff",useHighPerformance:!1,flashPollingInterval:null,html5PollingInterval:null,flashLoadTimeout:1e3,wmode:null,allowScriptAccess:"always",useFlashBlock:!1,useHTML5Audio:!0,forceUseGlobalHTML5Audio:!1,ignoreMobileRestrictions:!1,html5Test:/^(probably|maybe)$/i,preferFlash:!1,noSWFCache:!1,idPrefix:"sound"},this.defaultOptions={autoLoad:!1,autoPlay:!1,from:null,loops:1,onid3:null,onerror:null,onload:null,whileloading:null,onplay:null,onpause:null,onresume:null,whileplaying:null,onposition:null,onstop:null,onfinish:null,multiShot:!0,multiShotEvents:!1,position:null,pan:0,playbackRate:1,stream:!0,to:null,type:null,usePolicyFile:!1,volume:100},this.flash9Options={onfailure:null,isMovieStar:null,usePeakData:!1,useWaveformData:!1,useEQData:!1,onbufferchange:null,ondataerror:null},this.movieStarOptions={bufferTime:3,serverURL:null,onconnect:null,duration:null},this.audioFormats={mp3:{type:['audio/mpeg; codecs="mp3"',"audio/mpeg","audio/mp3","audio/MPA","audio/mpa-robust"],required:!0},mp4:{related:["aac","m4a","m4b"],type:['audio/mp4; codecs="mp4a.40.2"',"audio/aac","audio/x-m4a","audio/MP4A-LATM","audio/mpeg4-generic"],required:!1},ogg:{type:["audio/ogg; codecs=vorbis"],required:!1},opus:{type:["audio/ogg; codecs=opus","audio/opus"],required:!1},wav:{type:['audio/wav; codecs="1"',"audio/wav","audio/wave","audio/x-wav"],required:!1},flac:{type:["audio/flac"],required:!1}},this.movieID="sm2-container",this.id=e||"sm2movie",this.debugID="soundmanager-debug",this.debugURLParam=/([#?&])debug=1/i,this.versionNumber="V2.97a.20170601",this.version=null,this.movieURL=null,this.altURL=null,this.swfLoaded=!1,this.enabled=!1,this.oMC=null,this.sounds={},this.soundIDs=[],this.muted=!1,this.didFlashBlock=!1,this.filePattern=null,this.filePatterns={flash8:/\.mp3(\?.*)?$/i,flash9:/\.mp3(\?.*)?$/i},this.features={buffering:!1,peakData:!1,waveformData:!1,eqData:!1,movieStar:!1},this.sandbox={},this.html5={usingFlash:null},this.flash={},this.html5Only=!1,this.ignoreFlash=!1;var r,n,s,a,u,l,c,p,h,d,f,g,y,_,v,m,b,w,E,P,S,x,k,A,O,T,R,C,I,M,D,L,U,F,N,j,B,z,q,H,V,W,G,$,Y,J,Q,K,X,Z,tt,et,rt,nt,it,ot,st,at,ut=this,lt=null,ct=null,pt=navigator.userAgent,ht=i.location.href.toString(),dt=document,ft=[],gt=!1,yt=!1,_t=!1,vt=!1,mt=!1,bt=null,wt=null,Et=!1,Pt=!1,St=0,xt=null,kt=[],At=null,Ot=Array.prototype.slice,Tt=!1,Rt=0,Ct=pt.match(/(ipad|iphone|ipod)/i),It=pt.match(/android/i),Mt=pt.match(/msie|trident/i),Dt=pt.match(/webkit/i),Lt=pt.match(/safari/i)&&!pt.match(/chrome/i),Ut=pt.match(/opera/i),Ft=pt.match(/(mobile|pre\/|xoom)/i)||Ct||It,Nt=!ht.match(/usehtml5audio/i)&&!ht.match(/sm2-ignorebadua/i)&&Lt&&!pt.match(/silk/i)&&pt.match(/OS\sX\s10_6_([3-7])/i),jt=(i.console!==o&&console.log,dt.hasFocus!==o?dt.hasFocus():null),Bt=Lt&&(dt.hasFocus===o||!dt.hasFocus()),zt=!Bt,qt=/(mp3|mp4|mpa|m4a|m4b)/i,Ht=dt.location?dt.location.protocol.match(/http/i):null,Vt=Ht?"":"//",Wt=/^\s*audio\/(?:x-)?(?:mpeg4|aac|flv|mov|mp4|m4v|m4a|m4b|mp4v|3gp|3g2)\s*(?:$|;)/i,Gt=["mpeg4","aac","flv","mov","mp4","m4v","f4v","m4a","m4b","mp4v","3gp","3g2"],$t=new RegExp("\\.("+Gt.join("|")+")(\\?.*)?$","i");function Yt(t){return ut.preferFlash&&rt&&!ut.ignoreFlash&&ut.flash[t]!==o&&ut.flash[t]}function Jt(t){return function(e){var r=this._s;return r&&r._a?t.call(this,e):null}}this.mimePattern=/^\s*audio\/(?:x-)?(?:mp(?:eg|3))\s*(?:$|;)/i,this.useAltURL=!Ht,F={swfBox:"sm2-object-box",swfDefault:"movieContainer",swfError:"swf_error",swfTimedout:"swf_timedout",swfLoaded:"swf_loaded",swfUnblocked:"swf_unblocked",sm2Debug:"sm2_debug",highPerf:"high_performance",flashDebug:"flash_debug"},J=[null,"MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED"],this.hasHTML5=function(){try{return Audio!==o&&(Ut&&opera!==o&&opera.version()<10?new Audio(null):new Audio).canPlayType!==o}catch(t){return!1}}(),this.setup=function(t){var e=!ut.url;return t!==o&&_t&&At&&ut.ok()&&(t.flashVersion!==o||t.url!==o||t.html5Test),h(t),Tt||(Ft?ut.setupOptions.ignoreMobileRestrictions&&!ut.setupOptions.forceUseGlobalHTML5Audio||(kt.push(E.globalHTML5),Tt=!0):ut.setupOptions.forceUseGlobalHTML5Audio&&(kt.push(E.globalHTML5),Tt=!0)),!at&&Ft&&(ut.setupOptions.ignoreMobileRestrictions?kt.push(E.ignoreMobile):(ut.setupOptions.useHTML5Audio=!0,ut.setupOptions.preferFlash=!1,Ct?ut.ignoreFlash=!0:(It&&!pt.match(/android\s2\.3/i)||!It)&&(Tt=!0))),t&&(e&&k&&t.url!==o&&ut.beginDelayedInit(),k||t.url===o||"complete"!==dt.readyState||setTimeout(S,1)),at=!0,ut},this.ok=function(){return At?_t&&!vt:ut.useHTML5Audio&&ut.hasHTML5},this.supported=this.ok,this.getMovie=function(t){return n(t)||dt[t]||i[t]},this.createSound=function(t,e){var n,i=null;if(!_t||!ut.ok())return!1;if(e!==o&&(t={id:t,url:e}),(n=p(t)).url=V(n.url),n.id===o&&(n.id=ut.setupOptions.idPrefix+Rt++),B(n.id,!0))return ut.sounds[n.id];function s(){return n=N(n),ut.sounds[n.id]=new r(n),ut.soundIDs.push(n.id),ut.sounds[n.id]}if($(n))(i=s())._setup_html5(n);else{if(ut.html5Only)return s();if(ut.html5.usingFlash&&n.url&&n.url.match(/data:/i))return s();l>8&&null===n.isMovieStar&&(n.isMovieStar=!!(n.serverURL||n.type&&n.type.match(Wt)||n.url&&n.url.match($t))),n=j(n,void 0),i=s(),8===l?ct._createSound(n.id,n.loops||1,n.usePolicyFile):(ct._createSound(n.id,n.url,n.usePeakData,n.useWaveformData,n.useEQData,n.isMovieStar,!!n.isMovieStar&&n.bufferTime,n.loops||1,n.serverURL,n.duration||null,n.autoPlay,!0,n.autoLoad,n.usePolicyFile),n.serverURL||(i.connected=!0,n.onconnect&&n.onconnect.apply(i))),n.serverURL||!n.autoLoad&&!n.autoPlay||i.load(n)}return!n.serverURL&&n.autoPlay&&i.play(),i},this.destroySound=function(t,e){if(!B(t))return!1;var r,n=ut.sounds[t];for(n.stop(),n._iO={},n.unload(),r=0;r<ut.soundIDs.length;r++)if(ut.soundIDs[r]===t){ut.soundIDs.splice(r,1);break}return e||n.destruct(!0),n=null,delete ut.sounds[t],!0},this.load=function(t,e){return!!B(t)&&ut.sounds[t].load(e)},this.unload=function(t){return!!B(t)&&ut.sounds[t].unload()},this.onPosition=function(t,e,r,n){return!!B(t)&&ut.sounds[t].onposition(e,r,n)},this.onposition=this.onPosition,this.clearOnPosition=function(t,e,r){return!!B(t)&&ut.sounds[t].clearOnPosition(e,r)},this.play=function(t,e){var r=null,n=e&&!(e instanceof Object);if(!_t||!ut.ok())return!1;if(B(t,n))n&&(e={url:e});else{if(!n)return!1;n&&(e={url:e}),e&&e.url&&(e.id=t,r=ut.createSound(e).play())}return null===r&&(r=ut.sounds[t].play(e)),r},this.start=this.play,this.setPlaybackRate=function(t,e,r){return!!B(t)&&ut.sounds[t].setPlaybackRate(e,r)},this.setPosition=function(t,e){return!!B(t)&&ut.sounds[t].setPosition(e)},this.stop=function(t){return!!B(t)&&ut.sounds[t].stop()},this.stopAll=function(){var t;for(t in ut.sounds)ut.sounds.hasOwnProperty(t)&&ut.sounds[t].stop()},this.pause=function(t){return!!B(t)&&ut.sounds[t].pause()},this.pauseAll=function(){var t;for(t=ut.soundIDs.length-1;t>=0;t--)ut.sounds[ut.soundIDs[t]].pause()},this.resume=function(t){return!!B(t)&&ut.sounds[t].resume()},this.resumeAll=function(){var t;for(t=ut.soundIDs.length-1;t>=0;t--)ut.sounds[ut.soundIDs[t]].resume()},this.togglePause=function(t){return!!B(t)&&ut.sounds[t].togglePause()},this.setPan=function(t,e){return!!B(t)&&ut.sounds[t].setPan(e)},this.setVolume=function(t,e){var r,n;if(t!==o&&!isNaN(t)&&e===o){for(r=0,n=ut.soundIDs.length;r<n;r++)ut.sounds[ut.soundIDs[r]].setVolume(t);return!1}return!!B(t)&&ut.sounds[t].setVolume(e)},this.mute=function(t){var e=0;if(t instanceof String&&(t=null),t)return!!B(t)&&ut.sounds[t].mute();for(e=ut.soundIDs.length-1;e>=0;e--)ut.sounds[ut.soundIDs[e]].mute();return ut.muted=!0,!0},this.muteAll=function(){ut.mute()},this.unmute=function(t){var e;if(t instanceof String&&(t=null),t)return!!B(t)&&ut.sounds[t].unmute();for(e=ut.soundIDs.length-1;e>=0;e--)ut.sounds[ut.soundIDs[e]].unmute();return ut.muted=!1,!0},this.unmuteAll=function(){ut.unmute()},this.toggleMute=function(t){return!!B(t)&&ut.sounds[t].toggleMute()},this.getMemoryUse=function(){var t=0;return ct&&8!==l&&(t=parseInt(ct._getMemoryUse(),10)),t},this.disable=function(t){var e;if(t===o&&(t=!1),vt)return!1;for(vt=!0,e=ut.soundIDs.length-1;e>=0;e--)C(ut.sounds[ut.soundIDs[e]]);return C(ut),c(t),tt.remove(i,"load",y),!0},this.canPlayMIME=function(t){var e;return ut.hasHTML5&&(e=Y({type:t})),!e&&At&&(e=t&&ut.ok()?!!(l>8&&t.match(Wt)||t.match(ut.mimePattern)):null),e},this.canPlayURL=function(t){var e;return ut.hasHTML5&&(e=Y({url:t})),!e&&At&&(e=t&&ut.ok()?!!t.match(ut.filePattern):null),e},this.canPlayLink=function(t){return!(t.type===o||!t.type||!ut.canPlayMIME(t.type))||ut.canPlayURL(t.href)},this.getSoundById=function(t,e){return t?ut.sounds[t]:null},this.onready=function(t,e){if("function"!=typeof t)throw D("needFunction","onready");return e||(e=i),f("onready",t,e),g(),!0},this.ontimeout=function(t,e){if("function"!=typeof t)throw D("needFunction","ontimeout");return e||(e=i),f("ontimeout",t,e),g({type:"ontimeout"}),!0},this._writeDebug=function(t,e){return!0},this._wD=this._writeDebug,this._debug=function(){},this.reboot=function(t,e){var r,n,o;for(r=ut.soundIDs.length-1;r>=0;r--)ut.sounds[ut.soundIDs[r]].destruct();if(ct)try{Mt&&(wt=ct.innerHTML),bt=ct.parentNode.removeChild(ct)}catch(t){}if(wt=bt=At=ct=null,ut.enabled=k=_t=Et=Pt=gt=yt=vt=Tt=ut.swfLoaded=!1,ut.soundIDs=[],ut.sounds={},Rt=0,at=!1,t)ft=[];else for(r in ft)if(ft.hasOwnProperty(r))for(n=0,o=ft[r].length;n<o;n++)ft[r][n].fired=!1;return ut.html5={usingFlash:null},ut.flash={},ut.html5Only=!1,ut.ignoreFlash=!1,i.setTimeout(function(){e||ut.beginDelayedInit()},20),ut},this.reset=function(){return ut.reboot(!0,!0)},this.getMoviePercent=function(){return ct&&"PercentLoaded"in ct?ct.PercentLoaded():null},this.beginDelayedInit=function(){mt=!0,S(),setTimeout(function(){return!Pt&&(O(),P(),Pt=!0,!0)},20),_()},this.destruct=function(){ut.disable(!0)},r=function(t){var e,r,n,i,s,a,u,c,h,d,f=this,g=!1,y=[],_=0,v=null;h={duration:null,time:null},this.id=t.id,this.sID=this.id,this.url=t.url,this.options=p(t),this.instanceOptions=this.options,this._iO=this.instanceOptions,this.pan=this.options.pan,this.volume=this.options.volume,this.isHTML5=!1,this._a=null,d=!this.url,this.id3={},this._debug=function(){},this.load=function(t){var e;if(t!==o?f._iO=p(t,f.options):(t=f.options,f._iO=t,v&&v!==f.url&&(f._iO.url=f.url,f.url=null)),f._iO.url||(f._iO.url=f.url),f._iO.url=V(f._iO.url),f.instanceOptions=f._iO,!(e=f._iO).url&&!f.url)return f;if(e.url===f.url&&0!==f.readyState&&2!==f.readyState)return 3===f.readyState&&e.onload&&st(f,function(){e.onload.apply(f,[!!f.duration])}),f;if(f.loaded=!1,f.readyState=1,f.playState=0,f.id3={},$(e))f._setup_html5(e)._called_load||(f._html5_canplay=!1,f.url!==e.url&&(f._a.src=e.url,f.setPosition(0)),f._a.autobuffer="auto",f._a.preload="auto",f._a._called_load=!0);else{if(ut.html5Only)return f;if(f._iO.url&&f._iO.url.match(/data:/i))return f;try{f.isHTML5=!1,f._iO=j(N(e)),f._iO.autoPlay&&(f._iO.position||f._iO.from)&&(f._iO.autoPlay=!1),e=f._iO,8===l?ct._load(f.id,e.url,e.stream,e.autoPlay,e.usePolicyFile):ct._load(f.id,e.url,!!e.stream,!!e.autoPlay,e.loops||1,!!e.autoLoad,e.usePolicyFile)}catch(t){T({type:"SMSOUND_LOAD_JS_EXCEPTION",fatal:!0})}}return f.url=e.url,f},this.unload=function(){return 0!==f.readyState&&(f.isHTML5?(i(),f._a&&(f._a.pause(),v=K(f._a))):8===l?ct._unload(f.id,"about:blank"):ct._unload(f.id),e()),f},this.destruct=function(t){f.isHTML5?(i(),f._a&&(f._a.pause(),K(f._a),Tt||n(),f._a._s=null,f._a=null)):(f._iO.onfailure=null,ct._destroySound(f.id)),t||ut.destroySound(f.id,!0)},this.play=function(t,e){var r,n,i,u,h,y=!0;if(e=e===o||e,t||(t={}),f.url&&(f._iO.url=f.url),f._iO=p(f._iO,f.options),f._iO=p(t,f._iO),f._iO.url=V(f._iO.url),f.instanceOptions=f._iO,!f.isHTML5&&f._iO.serverURL&&!f.connected)return f.getAutoPlay()||f.setAutoPlay(!0),f;if($(f._iO)&&(f._setup_html5(f._iO),s()),1===f.playState&&!f.paused&&!f._iO.multiShot)return f.isHTML5&&f.setPosition(f._iO.position),f;if(t.url&&t.url!==f.url&&(f.readyState||f.isHTML5||8!==l||!d?f.load(f._iO):d=!1),!f.loaded)if(0===f.readyState){if(f.isHTML5||ut.html5Only){if(!f.isHTML5)return f;f.load(f._iO)}else f._iO.autoPlay=!0,f.load(f._iO);f.instanceOptions=f._iO}else if(2===f.readyState)return f;return!f.isHTML5&&9===l&&f.position>0&&f.position===f.duration&&(t.position=0),f.paused&&f.position>=0&&(!f._iO.serverURL||f.position>0)?f.resume():(f._iO=p(t,f._iO),(!f.isHTML5&&null!==f._iO.position&&f._iO.position>0||null!==f._iO.from&&f._iO.from>0||null!==f._iO.to)&&0===f.instanceCount&&0===f.playState&&!f._iO.serverURL&&(n=function(){f._iO=p(t,f._iO),f.play(f._iO)},f.isHTML5&&!f._html5_canplay?f.load({_oncanplay:n}):f.isHTML5||f.loaded||f.readyState&&2===f.readyState||f.load({onload:n}),f._iO=c()),(!f.instanceCount||f._iO.multiShotEvents||f.isHTML5&&f._iO.multiShot&&!Tt||!f.isHTML5&&l>8&&!f.getAutoPlay())&&f.instanceCount++,f._iO.onposition&&0===f.playState&&a(f),f.playState=1,f.paused=!1,f.position=f._iO.position===o||isNaN(f._iO.position)?0:f._iO.position,f.isHTML5||(f._iO=j(N(f._iO))),f._iO.onplay&&e&&(f._iO.onplay.apply(f),g=!0),f.setVolume(f._iO.volume,!0),f.setPan(f._iO.pan,!0),1!==f._iO.playbackRate&&f.setPlaybackRate(f._iO.playbackRate),f.isHTML5?f.instanceCount<2?(s(),r=f._setup_html5(),f.setPosition(f._iO.position),r.play()):(i=new Audio(f._iO.url),u=function(){tt.remove(i,"ended",u),f._onfinish(f),K(i),i=null},h=function(){tt.remove(i,"canplay",h);try{i.currentTime=f._iO.position/1e3}catch(t){}i.play()},tt.add(i,"ended",u),f._iO.volume!==o&&(i.volume=Math.max(0,Math.min(1,f._iO.volume/100))),f.muted&&(i.muted=!0),f._iO.position?tt.add(i,"canplay",h):i.play()):(y=ct._start(f.id,f._iO.loops||1,9===l?f.position:f.position/1e3,f._iO.multiShot||!1),9!==l||y||f._iO.onplayerror&&f._iO.onplayerror.apply(f))),f},this.start=this.play,this.stop=function(t){var e,r=f._iO;return 1===f.playState&&(f._onbufferchange(0),f._resetOnPosition(0),f.paused=!1,f.isHTML5||(f.playState=0),u(),r.to&&f.clearOnPosition(r.to),f.isHTML5?f._a&&(e=f.position,f.setPosition(0),f.position=e,f._a.pause(),f.playState=0,f._onTimer(),i()):(ct._stop(f.id,t),r.serverURL&&f.unload()),f.instanceCount=0,f._iO={},r.onstop&&r.onstop.apply(f)),f},this.setAutoPlay=function(t){f._iO.autoPlay=t,f.isHTML5||(ct._setAutoPlay(f.id,t),t&&(f.instanceCount||1!==f.readyState||f.instanceCount++))},this.getAutoPlay=function(){return f._iO.autoPlay},this.setPlaybackRate=function(t){var e=Math.max(.5,Math.min(4,t));if(f.isHTML5)try{f._iO.playbackRate=e,f._a.playbackRate=e}catch(t){}return f},this.setPosition=function(t){t===o&&(t=0);var e,r,n=f.isHTML5?Math.max(t,0):Math.min(f.duration||f._iO.duration,Math.max(t,0));if(f.position=n,r=f.position/1e3,f._resetOnPosition(f.position),f._iO.position=n,f.isHTML5){if(f._a){if(f._html5_canplay){if(f._a.currentTime.toFixed(3)!==r.toFixed(3))try{f._a.currentTime=r,(0===f.playState||f.paused)&&f._a.pause()}catch(t){}}else if(r)return f;f.paused&&f._onTimer(!0)}}else e=9===l?f.position:r,f.readyState&&2!==f.readyState&&ct._setPosition(f.id,e,f.paused||!f.playState,f._iO.multiShot);return f},this.pause=function(t){return f.paused||0===f.playState&&1!==f.readyState?f:(f.paused=!0,f.isHTML5?(f._setup_html5().pause(),i()):(t||t===o)&&ct._pause(f.id,f._iO.multiShot),f._iO.onpause&&f._iO.onpause.apply(f),f)},this.resume=function(){var t=f._iO;return f.paused?(f.paused=!1,f.playState=1,f.isHTML5?(f._setup_html5().play(),s()):(t.isMovieStar&&!t.serverURL&&f.setPosition(f.position),ct._pause(f.id,t.multiShot)),!g&&t.onplay?(t.onplay.apply(f),g=!0):t.onresume&&t.onresume.apply(f),f):f},this.togglePause=function(){return 0===f.playState?(f.play({position:9!==l||f.isHTML5?f.position/1e3:f.position}),f):(f.paused?f.resume():f.pause(),f)},this.setPan=function(t,e){return t===o&&(t=0),e===o&&(e=!1),f.isHTML5||ct._setPan(f.id,t),f._iO.pan=t,e||(f.pan=t,f.options.pan=t),f},this.setVolume=function(t,e){return t===o&&(t=100),e===o&&(e=!1),f.isHTML5?f._a&&(ut.muted&&!f.muted&&(f.muted=!0,f._a.muted=!0),f._a.volume=Math.max(0,Math.min(1,t/100))):ct._setVolume(f.id,ut.muted&&!f.muted||f.muted?0:t),f._iO.volume=t,e||(f.volume=t,f.options.volume=t),f},this.mute=function(){return f.muted=!0,f.isHTML5?f._a&&(f._a.muted=!0):ct._setVolume(f.id,0),f},this.unmute=function(){f.muted=!1;var t=f._iO.volume!==o;return f.isHTML5?f._a&&(f._a.muted=!1):ct._setVolume(f.id,t?f._iO.volume:f.options.volume),f},this.toggleMute=function(){return f.muted?f.unmute():f.mute()},this.onPosition=function(t,e,r){return y.push({position:parseInt(t,10),method:e,scope:r!==o?r:f,fired:!1}),f},this.onposition=this.onPosition,this.clearOnPosition=function(t,e){var r;if(t=parseInt(t,10),!isNaN(t))for(r=0;r<y.length;r++)t===y[r].position&&(e&&e!==y[r].method||(y[r].fired&&_--,y.splice(r,1)))},this._processOnPosition=function(){var t,e,r=y.length;if(!r||!f.playState||_>=r)return!1;for(t=r-1;t>=0;t--)!(e=y[t]).fired&&f.position>=e.position&&(e.fired=!0,_++,e.method.apply(e.scope,[e.position]),r=y.length);return!0},this._resetOnPosition=function(t){var e,r,n=y.length;if(!n)return!1;for(e=n-1;e>=0;e--)(r=y[e]).fired&&t<=r.position&&(r.fired=!1,_--);return!0},c=function(){var t,e,r=f._iO,n=r.from,i=r.to;return e=function(){f.clearOnPosition(i,e),f.stop()},t=function(){null===i||isNaN(i)||f.onPosition(i,e)},null===n||isNaN(n)||(r.position=n,r.multiShot=!1,t()),r},a=function(){var t,e=f._iO.onposition;if(e)for(t in e)e.hasOwnProperty(t)&&f.onPosition(parseInt(t,10),e[t])},u=function(){var t,e=f._iO.onposition;if(e)for(t in e)e.hasOwnProperty(t)&&f.clearOnPosition(parseInt(t,10))},s=function(){f.isHTML5&&z(f)},i=function(){f.isHTML5&&q(f)},(e=function(t){t||(y=[],_=0),g=!1,f._hasTimer=null,f._a=null,f._html5_canplay=!1,f.bytesLoaded=null,f.bytesTotal=null,f.duration=f._iO&&f._iO.duration?f._iO.duration:null,f.durationEstimate=null,f.buffered=[],f.eqData=[],f.eqData.left=[],f.eqData.right=[],f.failures=0,f.isBuffering=!1,f.instanceOptions={},f.instanceCount=0,f.loaded=!1,f.metadata={},f.readyState=0,f.muted=!1,f.paused=!1,f.peakData={left:0,right:0},f.waveformData={left:[],right:[]},f.playState=0,f.position=null,f.id3={}})(),this._onTimer=function(t){var e,r,n=!1,i={};return(f._hasTimer||t)&&f._a&&(t||(f.playState>0||1===f.readyState)&&!f.paused)&&((e=f._get_html5_duration())!==h.duration&&(h.duration=e,f.duration=e,n=!0),f.durationEstimate=f.duration,(r=1e3*f._a.currentTime||0)!==h.time&&(h.time=r,n=!0),(n||t)&&f._whileplaying(r,i,i,i,i)),n},this._get_html5_duration=function(){var t=f._iO,e=f._a&&f._a.duration?1e3*f._a.duration:t&&t.duration?t.duration:null;return e&&!isNaN(e)&&e!==1/0?e:null},this._apply_loop=function(t,e){t.loop=e>1?"loop":""},this._setup_html5=function(t){var n,i=p(f._iO,t),o=Tt?lt:f._a,s=decodeURI(i.url);if(Tt?s===decodeURI(et)&&(n=!0):s===decodeURI(v)&&(n=!0),o){if(o._s)if(Tt)o._s&&o._s.playState&&!n&&o._s.stop();else if(!Tt&&s===decodeURI(v))return f._apply_loop(o,i.loops),o;n||(v&&e(!1),o.src=i.url,f.url=i.url,v=i.url,et=i.url,o._called_load=!1)}else i.autoLoad||i.autoPlay?(f._a=new Audio(i.url),f._a.load()):f._a=Ut&&opera.version()<10?new Audio(null):new Audio,(o=f._a)._called_load=!1,Tt&&(lt=o);return f.isHTML5=!0,f._a=o,o._s=f,r(),f._apply_loop(o,i.loops),i.autoLoad||i.autoPlay?f.load():(o.autobuffer=!1,o.preload="auto"),o},r=function(){if(f._a._added_events)return!1;var t;function e(t,e,r){return f._a?f._a.addEventListener(t,e,r||!1):null}for(t in f._a._added_events=!0,ot)ot.hasOwnProperty(t)&&e(t,ot[t]);return!0},n=function(){var t;function e(t,e,r){return f._a?f._a.removeEventListener(t,e,r||!1):null}for(t in f._a._added_events=!1,ot)ot.hasOwnProperty(t)&&e(t,ot[t])},this._onload=function(t){var e=!!t||!f.isHTML5&&8===l&&f.duration;return f.loaded=e,f.readyState=e?3:2,f._onbufferchange(0),e||f.isHTML5||f._onerror(),f._iO.onload&&st(f,function(){f._iO.onload.apply(f,[e])}),!0},this._onerror=function(t,e){f._iO.onerror&&st(f,function(){f._iO.onerror.apply(f,[t,e])})},this._onbufferchange=function(t){return 0!==f.playState&&(!(t&&f.isBuffering||!t&&!f.isBuffering)&&(f.isBuffering=1===t,f._iO.onbufferchange&&f._iO.onbufferchange.apply(f,[t]),!0))},this._onsuspend=function(){return f._iO.onsuspend&&f._iO.onsuspend.apply(f),!0},this._onfailure=function(t,e,r){f.failures++,f._iO.onfailure&&1===f.failures&&f._iO.onfailure(t,e,r)},this._onwarning=function(t,e,r){f._iO.onwarning&&f._iO.onwarning(t,e,r)},this._onfinish=function(){var t=f._iO.onfinish;f._onbufferchange(0),f._resetOnPosition(0),f.instanceCount&&(f.instanceCount--,f.instanceCount||(u(),f.playState=0,f.paused=!1,f.instanceCount=0,f.instanceOptions={},f._iO={},i(),f.isHTML5&&(f.position=0)),f.instanceCount&&!f._iO.multiShotEvents||t&&st(f,function(){t.apply(f)}))},this._whileloading=function(t,e,r,n){var i=f._iO;f.bytesLoaded=t,f.bytesTotal=e,f.duration=Math.floor(r),f.bufferLength=n,f.isHTML5||i.isMovieStar?f.durationEstimate=f.duration:i.duration?f.durationEstimate=f.duration>i.duration?f.duration:i.duration:f.durationEstimate=parseInt(f.bytesTotal/f.bytesLoaded*f.duration,10),f.isHTML5||(f.buffered=[{start:0,end:f.duration}]),(3!==f.readyState||f.isHTML5)&&i.whileloading&&i.whileloading.apply(f)},this._whileplaying=function(t,e,r,n,i){var s,a=f._iO;return!isNaN(t)&&null!==t&&(f.position=Math.max(0,t),f._processOnPosition(),!f.isHTML5&&l>8&&(a.usePeakData&&e!==o&&e&&(f.peakData={left:e.leftPeak,right:e.rightPeak}),a.useWaveformData&&r!==o&&r&&(f.waveformData={left:r.split(","),right:n.split(",")}),a.useEQData&&i!==o&&i&&i.leftEQ&&(s=i.leftEQ.split(","),f.eqData=s,f.eqData.left=s,i.rightEQ!==o&&i.rightEQ&&(f.eqData.right=i.rightEQ.split(",")))),1===f.playState&&(f.isHTML5||8!==l||f.position||!f.isBuffering||f._onbufferchange(0),a.whileplaying&&a.whileplaying.apply(f)),!0)},this._oncaptiondata=function(t){f.captiondata=t,f._iO.oncaptiondata&&f._iO.oncaptiondata.apply(f,[t])},this._onmetadata=function(t,e){var r,n,i={};for(r=0,n=t.length;r<n;r++)i[t[r]]=e[r];f.metadata=i,f._iO.onmetadata&&f._iO.onmetadata.call(f,f.metadata)},this._onid3=function(t,e){var r,n,i=[];for(r=0,n=t.length;r<n;r++)i[t[r]]=e[r];f.id3=p(f.id3,i),f._iO.onid3&&f._iO.onid3.apply(f)},this._onconnect=function(t){t=1===t,f.connected=t,t&&(f.failures=0,B(f.id)&&(f.getAutoPlay()?f.play(o,f.getAutoPlay()):f._iO.autoLoad&&f.load()),f._iO.onconnect&&f._iO.onconnect.apply(f,[t]))},this._ondataerror=function(t){f.playState>0&&f._iO.ondataerror&&f._iO.ondataerror.apply(f)}},A=function(){return dt.body||dt.getElementsByTagName("div")[0]},n=function(t){return dt.getElementById(t)},p=function(t,e){var r,n,i=t||{};for(n in r=e===o?ut.defaultOptions:e)r.hasOwnProperty(n)&&i[n]===o&&("object"!=typeof r[n]||null===r[n]?i[n]=r[n]:i[n]=p(i[n],r[n]));return i},st=function(t,e){t.isHTML5||8!==l?e():i.setTimeout(e,0)},d={onready:1,ontimeout:1,defaultOptions:1,flash9Options:1,movieStarOptions:1},h=function(t,e){var r,n=!0,i=e!==o,s=ut.setupOptions,a=d;for(r in t)if(t.hasOwnProperty(r))if("object"!=typeof t[r]||null===t[r]||t[r]instanceof Array||t[r]instanceof RegExp)i&&a[e]!==o?ut[e][r]=t[r]:s[r]!==o?(ut.setupOptions[r]=t[r],ut[r]=t[r]):a[r]===o?n=!1:ut[r]instanceof Function?ut[r].apply(ut,t[r]instanceof Array?t[r]:[t[r]]):ut[r]=t[r];else{if(a[r]!==o)return h(t[r],r);n=!1}return n},tt=function(){var t=i.attachEvent,e={add:t?"attachEvent":"addEventListener",remove:t?"detachEvent":"removeEventListener"};function r(e){var r=Ot.call(e),n=r.length;return t?(r[1]="on"+r[1],n>3&&r.pop()):3===n&&r.push(!1),r}function n(r,n){var i=r.shift(),o=[e[n]];t?i[o](r[0],r[1]):i[o].apply(i,r)}return{add:function(){n(r(arguments),"add")},remove:function(){n(r(arguments),"remove")}}}(),ot={abort:Jt(function(){}),canplay:Jt(function(){var t,e=this._s;if(!e._html5_canplay){if(e._html5_canplay=!0,e._onbufferchange(0),t=e._iO.position===o||isNaN(e._iO.position)?null:e._iO.position/1e3,this.currentTime!==t)try{this.currentTime=t}catch(t){}e._iO._oncanplay&&e._iO._oncanplay()}}),canplaythrough:Jt(function(){var t=this._s;t.loaded||(t._onbufferchange(0),t._whileloading(t.bytesLoaded,t.bytesTotal,t._get_html5_duration()),t._onload(!0))}),durationchange:Jt(function(){var t,e=this._s;t=e._get_html5_duration(),isNaN(t)||t===e.duration||(e.durationEstimate=e.duration=t)}),ended:Jt(function(){this._s._onfinish()}),error:Jt(function(){var t=J[this.error.code]||null;this._s._onload(!1),this._s._onerror(this.error.code,t)}),loadeddata:Jt(function(){var t=this._s;t._loaded||Lt||(t.duration=t._get_html5_duration())}),loadedmetadata:Jt(function(){}),loadstart:Jt(function(){this._s._onbufferchange(1)}),play:Jt(function(){this._s._onbufferchange(0)}),playing:Jt(function(){this._s._onbufferchange(0)}),progress:Jt(function(t){var e,r,n=this._s,i=0,o=(t.type,t.target.buffered),s=t.loaded||0,a=t.total||1;if(n.buffered=[],o&&o.length){for(e=0,r=o.length;e<r;e++)n.buffered.push({start:1e3*o.start(e),end:1e3*o.end(e)});i=1e3*(o.end(0)-o.start(0)),s=Math.min(1,i/(1e3*t.target.duration))}isNaN(s)||(n._whileloading(s,a,n._get_html5_duration()),s&&a&&s===a&&ot.canplaythrough.call(this,t))}),ratechange:Jt(function(){}),suspend:Jt(function(t){var e=this._s;ot.progress.call(this,t),e._onsuspend()}),stalled:Jt(function(){}),timeupdate:Jt(function(){this._s._onTimer()}),waiting:Jt(function(){this._s._onbufferchange(1)})},$=function(t){return!(!t||!(t.type||t.url||t.serverURL))&&(!(t.serverURL||t.type&&Yt(t.type))&&(t.type?Y({type:t.type}):Y({url:t.url})||ut.html5Only||t.url.match(/data:/i)))},K=function(t){var e;return t&&(e=Lt?"about:blank":ut.html5.canPlayType("audio/wav")?"data:audio/wave;base64,/UklGRiYAAABXQVZFZm10IBAAAAABAAEARKwAAIhYAQACABAAZGF0YQIAAAD//w==":"about:blank",t.src=e,t._called_unload!==o&&(t._called_load=!1)),Tt&&(et=null),e},Y=function(t){if(!ut.useHTML5Audio||!ut.hasHTML5)return!1;var e,r,n,i,s=t.url||null,a=t.type||null,u=ut.audioFormats;if(a&&ut.html5[a]!==o)return ut.html5[a]&&!Yt(a);if(!Q){for(i in Q=[],u)u.hasOwnProperty(i)&&(Q.push(i),u[i].related&&(Q=Q.concat(u[i].related)));Q=new RegExp("\\.("+Q.join("|")+")(\\?.*)?$","i")}return(n=s?s.toLowerCase().match(Q):null)&&n.length?n=n[1]:a?n=(-1!==(r=a.indexOf(";"))?a.substr(0,r):a).substr(6):e=!1,n&&ut.html5[n]!==o?e=ut.html5[n]&&!Yt(n):(a="audio/"+n,e=ut.html5.canPlayType({type:a}),ut.html5[n]=e,e=e&&ut.html5[a]&&!Yt(a)),e},Z=function(){if(!ut.useHTML5Audio||!ut.hasHTML5)return ut.html5.usingFlash=!0,At=!0,!1;var t,e,r,n,i=Audio!==o?Ut&&opera.version()<10?new Audio(null):new Audio:null,s={};function a(t){var e,r,o=!1,s=!1;if(!i||"function"!=typeof i.canPlayType)return o;if(t instanceof Array){for(n=0,r=t.length;n<r;n++)(ut.html5[t[n]]||i.canPlayType(t[n]).match(ut.html5Test))&&(s=!0,ut.html5[t[n]]=!0,ut.flash[t[n]]=!!t[n].match(qt));o=s}else o=!(!(e=!(!i||"function"!=typeof i.canPlayType)&&i.canPlayType(t))||!e.match(ut.html5Test));return o}for(t in r=ut.audioFormats)if(r.hasOwnProperty(t)&&(e="audio/"+t,s[t]=a(r[t].type),s[e]=s[t],t.match(qt)?(ut.flash[t]=!0,ut.flash[e]=!0):(ut.flash[t]=!1,ut.flash[e]=!1),r[t]&&r[t].related))for(n=r[t].related.length-1;n>=0;n--)s["audio/"+r[t].related[n]]=s[t],ut.html5[r[t].related[n]]=s[t],ut.flash[r[t].related[n]]=s[t];return s.canPlayType=i?a:null,ut.html5=p(ut.html5,s),ut.html5.usingFlash=G(),At=ut.html5.usingFlash,!0},E={},D=function(){},N=function(t){return 8===l&&t.loops>1&&t.stream&&(t.stream=!1),t},j=function(t,e){return t&&!t.usePolicyFile&&(t.onid3||t.usePeakData||t.useWaveformData||t.useEQData)&&(t.usePolicyFile=!0),t},s=function(){return!1},C=function(t){var e;for(e in t)t.hasOwnProperty(e)&&"function"==typeof t[e]&&(t[e]=s);e=null},I=function(t){t===o&&(t=!1),(vt||t)&&ut.disable(t)},M=function(t){var e;if(t)if(t.match(/\.swf(\?.*)?$/i)){if(t.substr(t.toLowerCase().lastIndexOf(".swf?")+4))return t}else t.lastIndexOf("/")!==t.length-1&&(t+="/");return e=(t&&-1!==t.lastIndexOf("/")?t.substr(0,t.lastIndexOf("/")+1):"./")+ut.movieURL,ut.noSWFCache&&(e+="?ts="+(new Date).getTime()),e},b=function(){8!==(l=parseInt(ut.flashVersion,10))&&9!==l&&(ut.flashVersion=l=8);var t=ut.debugMode||ut.debugFlash?"_debug.swf":".swf";ut.useHTML5Audio&&!ut.html5Only&&ut.audioFormats.mp4.required&&l<9&&(ut.flashVersion=l=9),ut.version=ut.versionNumber+(ut.html5Only?" (HTML5-only mode)":9===l?" (AS3/Flash 9)":" (AS2/Flash 8)"),l>8?(ut.defaultOptions=p(ut.defaultOptions,ut.flash9Options),ut.features.buffering=!0,ut.defaultOptions=p(ut.defaultOptions,ut.movieStarOptions),ut.filePatterns.flash9=new RegExp("\\.(mp3|"+Gt.join("|")+")(\\?.*)?$","i"),ut.features.movieStar=!0):ut.features.movieStar=!1,ut.filePattern=ut.filePatterns[8!==l?"flash9":"flash8"],ut.movieURL=(8===l?"soundmanager2.swf":"soundmanager2_flash9.swf").replace(".swf",t),ut.features.peakData=ut.features.waveformData=ut.features.eqData=l>8},R=function(t,e){ct&&ct._setPolling(t,e)},B=this.getSoundById,U=function(){var t=[];return ut.debugMode&&t.push(F.sm2Debug),ut.debugFlash&&t.push(F.flashDebug),ut.useHighPerformance&&t.push(F.highPerf),t.join(" ")},L=function(){D("fbHandler");var t=ut.getMoviePercent(),e=F,r={type:"FLASHBLOCK"};ut.html5Only||(ut.ok()?ut.oMC&&(ut.oMC.className=[U(),e.swfDefault,e.swfLoaded+(ut.didFlashBlock?" "+e.swfUnblocked:"")].join(" ")):(At&&(ut.oMC.className=U()+" "+e.swfDefault+" "+(null===t?e.swfTimedout:e.swfError)),ut.didFlashBlock=!0,g({type:"ontimeout",ignoreInit:!0,error:r}),T(r)))},f=function(t,e,r){ft[t]===o&&(ft[t]=[]),ft[t].push({method:e,scope:r||null,fired:!1})},g=function(t){if(t||(t={type:ut.ok()?"onready":"ontimeout"}),!_t&&t&&!t.ignoreInit)return!1;if("ontimeout"===t.type&&(ut.ok()||vt&&!t.ignoreInit))return!1;var e,r,n={success:t&&t.ignoreInit?ut.ok():!vt},i=t&&t.type&&ft[t.type]||[],o=[],s=[n],a=At&&!ut.ok();for(t.error&&(s[0].error=t.error),e=0,r=i.length;e<r;e++)!0!==i[e].fired&&o.push(i[e]);if(o.length)for(e=0,r=o.length;e<r;e++)o[e].scope?o[e].method.apply(o[e].scope,s):o[e].method.apply(this,s),a||(o[e].fired=!0);return!0},y=function(){i.setTimeout(function(){ut.useFlashBlock&&L(),g(),"function"==typeof ut.onload&&ut.onload.apply(i),ut.waitForWindowLoad&&tt.add(i,"load",y)},1)},nt=function(){if(rt!==o)return rt;var t,e,r,n,s=!1,a=navigator,u=i.ActiveXObject;try{n=a.plugins}catch(t){n=void 0}if(n&&n.length)e="application/x-shockwave-flash",(r=a.mimeTypes)&&r[e]&&r[e].enabledPlugin&&r[e].enabledPlugin.description&&(s=!0);else if(u!==o&&!pt.match(/MSAppHost/i)){try{t=new u("ShockwaveFlash.ShockwaveFlash")}catch(e){t=null}s=!!t,t=null}return rt=s,s},G=function(){var t,e,r=ut.audioFormats;if(Ct&&!!pt.match(/os (1|2|3_0|3_1)\s/i)?(ut.hasHTML5=!1,ut.html5Only=!0,ut.oMC&&(ut.oMC.style.display="none")):ut.useHTML5Audio&&(ut.html5&&ut.html5.canPlayType||(ut.hasHTML5=!1)),ut.useHTML5Audio&&ut.hasHTML5)for(e in W=!0,r)r.hasOwnProperty(e)&&r[e].required&&(ut.html5.canPlayType(r[e].type)?ut.preferFlash&&(ut.flash[e]||ut.flash[r[e].type])&&(t=!0):(W=!1,t=!0));return ut.ignoreFlash&&(t=!1,W=!0),ut.html5Only=ut.hasHTML5&&ut.useHTML5Audio&&!t,!ut.html5Only},V=function(t){var e,r,n,i=0;if(t instanceof Array){for(e=0,r=t.length;e<r;e++)if(t[e]instanceof Object){if(ut.canPlayMIME(t[e].type)){i=e;break}}else if(ut.canPlayURL(t[e])){i=e;break}t[i].url&&(t[i]=t[i].url),n=t[i]}else n=t;return n},z=function(t){t._hasTimer||(t._hasTimer=!0,!Ft&&ut.html5PollingInterval&&(null===xt&&0===St&&(xt=setInterval(H,ut.html5PollingInterval)),St++))},q=function(t){t._hasTimer&&(t._hasTimer=!1,!Ft&&ut.html5PollingInterval&&St--)},H=function(){var t;if(null!==xt&&!St)return clearInterval(xt),void(xt=null);for(t=ut.soundIDs.length-1;t>=0;t--)ut.sounds[ut.soundIDs[t]].isHTML5&&ut.sounds[ut.soundIDs[t]]._hasTimer&&ut.sounds[ut.soundIDs[t]]._onTimer()},T=function(t){t=t!==o?t:{},"function"==typeof ut.onerror&&ut.onerror.apply(i,[{type:t.type!==o?t.type:null}]),t.fatal!==o&&t.fatal&&ut.disable()},it=function(){if(Nt&&nt()){var t,e,r=ut.audioFormats;for(e in r)if(r.hasOwnProperty(e)&&("mp3"===e||"mp4"===e)&&(ut.html5[e]=!1,r[e]&&r[e].related))for(t=r[e].related.length-1;t>=0;t--)ut.html5[r[e].related[t]]=!1}},this._setSandboxType=function(t){},this._externalInterfaceOK=function(t){ut.swfLoaded||(ut.swfLoaded=!0,Bt=!1,Nt&&it(),setTimeout(u,Mt?100:1))},O=function(t,e){if(gt&&yt)return!1;if(ut.html5Only)return b(),ut.oMC=n(ut.movieID),u(),gt=!0,yt=!0,!1;var r,i,s,a,l,c,p,h,d,f=e||ut.url,g=ut.altURL||f,y=A(),_=U(),v=dt.getElementsByTagName("html")[0];function m(t,e){return'<param name="'+t+'" value="'+e+'" />'}if(r=v&&v.dir&&v.dir.match(/rtl/i),t=t===o?ut.id:t,b(),ut.url=M(Ht?f:g),e=ut.url,ut.wmode=!ut.wmode&&ut.useHighPerformance?"transparent":ut.wmode,null!==ut.wmode&&(pt.match(/msie 8/i)||!Mt&&!ut.useHighPerformance)&&navigator.platform.match(/win32|win64/i)&&(kt.push(E.spcWmode),ut.wmode=null),i={name:t,id:t,src:e,quality:"high",allowScriptAccess:ut.allowScriptAccess,bgcolor:ut.bgColor,pluginspage:Vt+"www.macromedia.com/go/getflashplayer",title:"JS/Flash audio component (SoundManager 2)",type:"application/x-shockwave-flash",wmode:ut.wmode,hasPriority:"true"},ut.debugFlash&&(i.FlashVars="debug=1"),ut.wmode||delete i.wmode,Mt)s=dt.createElement("div"),l=['<object id="'+t+'" data="'+e+'" type="'+i.type+'" title="'+i.title+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0">',m("movie",e),m("AllowScriptAccess",ut.allowScriptAccess),m("quality",i.quality),ut.wmode?m("wmode",ut.wmode):"",m("bgcolor",ut.bgColor),m("hasPriority","true"),ut.debugFlash?m("FlashVars",i.FlashVars):"","</object>"].join("");else for(a in s=dt.createElement("embed"),i)i.hasOwnProperty(a)&&s.setAttribute(a,i[a]);if(_=U(),y=A())if(ut.oMC=n(ut.movieID)||dt.createElement("div"),ut.oMC.id)d=ut.oMC.className,ut.oMC.className=(d?d+" ":F.swfDefault)+(_?" "+_:""),ut.oMC.appendChild(s),Mt&&((c=ut.oMC.appendChild(dt.createElement("div"))).className=F.swfBox,c.innerHTML=l),yt=!0;else{if(ut.oMC.id=ut.movieID,ut.oMC.className=F.swfDefault+" "+_,p=null,c=null,ut.useFlashBlock||(ut.useHighPerformance?p={position:"fixed",width:"8px",height:"8px",bottom:"0px",left:"0px",overflow:"hidden"}:(p={position:"absolute",width:"6px",height:"6px",top:"-9999px",left:"-9999px"},r&&(p.left=Math.abs(parseInt(p.left,10))+"px"))),Dt&&(ut.oMC.style.zIndex=1e4),!ut.debugFlash)for(h in p)p.hasOwnProperty(h)&&(ut.oMC.style[h]=p[h]);try{Mt||ut.oMC.appendChild(s),y.appendChild(ut.oMC),Mt&&((c=ut.oMC.appendChild(dt.createElement("div"))).className=F.swfBox,c.innerHTML=l),yt=!0}catch(t){throw new Error(D("domError")+" \n"+t.toString())}}return gt=!0,!0},P=function(){return ut.html5Only?(O(),!1):!ct&&(!!ut.url&&((ct=ut.getMovie(ut.id))||(bt?(Mt?ut.oMC.innerHTML=wt:ut.oMC.appendChild(bt),bt=null,gt=!0):O(ut.id,ut.url),ct=ut.getMovie(ut.id)),"function"==typeof ut.oninitmovie&&setTimeout(ut.oninitmovie,1),!0))},_=function(){setTimeout(v,1e3)},m=function(){i.setTimeout(function(){ut.setup({preferFlash:!1}).reboot(),ut.didFlashBlock=!0,ut.beginDelayedInit()},1)},v=function(){var t,e=!1;ut.url&&(Et||(Et=!0,tt.remove(i,"load",_),rt&&Bt&&!jt||(_t||(t=ut.getMoviePercent())>0&&t<100&&(e=!0),setTimeout(function(){if(t=ut.getMoviePercent(),e)return Et=!1,void i.setTimeout(_,1);!_t&&zt&&(null===t?ut.useFlashBlock||0===ut.flashLoadTimeout?ut.useFlashBlock&&L():!ut.useFlashBlock&&W?m():g({type:"ontimeout",ignoreInit:!0,error:{type:"INIT_FLASHBLOCK"}}):0===ut.flashLoadTimeout||(!ut.useFlashBlock&&W?m():I(!0)))},ut.flashLoadTimeout))))},w=function(){function t(){tt.remove(i,"focus",w)}return jt||!Bt?(t(),!0):(zt=!0,jt=!0,Et=!1,_(),t(),!0)},c=function(t){if(_t)return!1;if(ut.html5Only)return _t=!0,y(),!0;var e,r=!0;return ut.useFlashBlock&&ut.flashLoadTimeout&&!ut.getMoviePercent()||(_t=!0),e={type:!rt&&At?"NO_FLASH":"INIT_TIMEOUT"},(vt||t)&&(ut.useFlashBlock&&ut.oMC&&(ut.oMC.className=U()+" "+(null===ut.getMoviePercent()?F.swfTimedout:F.swfError)),g({type:"ontimeout",error:e,ignoreInit:!0}),T(e),r=!1),vt||(ut.waitForWindowLoad&&!mt?tt.add(i,"load",y):y()),r},a=function(){var t,e=ut.setupOptions;for(t in e)e.hasOwnProperty(t)&&(ut[t]===o?ut[t]=e[t]:ut[t]!==e[t]&&(ut.setupOptions[t]=ut[t]))},u=function(){if(_t)return!1;function t(){tt.remove(i,"load",ut.beginDelayedInit)}if(ut.html5Only)return _t||(t(),ut.enabled=!0,c()),!0;P();try{ct._externalInterfaceTest(!1),R(!0,ut.flashPollingInterval||(ut.useHighPerformance?10:50)),ut.debugMode||ct._disableDebug(),ut.enabled=!0,ut.html5Only||tt.add(i,"unload",s)}catch(t){return T({type:"JS_TO_FLASH_EXCEPTION",fatal:!0}),I(!0),c(),!1}return c(),t(),!0},S=function(){return!k&&(k=!0,a(),!rt&&ut.hasHTML5&&ut.setup({useHTML5Audio:!0,preferFlash:!1}),Z(),!rt&&At&&(kt.push(E.needFlash),ut.setup({flashLoadTimeout:1})),dt.removeEventListener&&dt.removeEventListener("DOMContentLoaded",S,!1),P(),!0)},X=function(){return"complete"===dt.readyState&&(S(),dt.detachEvent("onreadystatechange",X)),!0},x=function(){mt=!0,S(),tt.remove(i,"load",x)},nt(),tt.add(i,"focus",w),tt.add(i,"load",_),tt.add(i,"load",x),dt.addEventListener?dt.addEventListener("DOMContentLoaded",S,!1):dt.attachEvent?dt.attachEvent("onreadystatechange",X):T({type:"NO_DOM2_EVENTS",fatal:!0})}i.SM2_DEFER!==o&&SM2_DEFER||(s=new a),"object"==typeof t&&t&&"object"==typeof t.exports?(t.exports.SoundManager=a,t.exports.soundManager=s):void 0===(n=function(){return{constructor:a,getInstance:function(t){if(!i.soundManager&&t instanceof Function){var e=t(a);e instanceof a&&(i.soundManager=e)}return i.soundManager}}}.call(e,r,e,t))||(t.exports=n),i.SoundManager=a,i.soundManager=s}(window)}).call(e,r(46)(t))},function(t,e,r){var n,i,o,s,a,u,l,c,p,h,d;d=function(t){return(window.opener||window.parent).postMessage(JSON.stringify(t),"*")},o=window.location.hash.replace("#",""),a={},n=null,u={load:function(){return d({t:"w",id:o})},notify:function(t,e){return t=t.type||t,d({t:"ee",id:o,d:e,e:t})}},c=function(t,e){var r,i,a,u,l;if(null==e&&(e={}),i=e.preview||e.source.frames[o])return i.Blogvio.auth.token(n),window.require._require.push(i.require),r=(a=i.getData()).composition,l=a.widget,(u=a.user)||(u={id:"591bf4ecd85c6d076c787001",premium:!1,upload_token:"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI1OTFiZjRlY2Q4NWM2ZDA3NmM3ODcwMDEiLCJjb250ZXh0Ijp7ImlkIjoiYXBwIiwibmFtZSI6ImFwcCJ9LCJtYXhRdW90YSI6MTAwMDAwMDAwMCwiYXVkIjoiZmlsZS11cGxvYWQiLCJleHAiOjE2MjI2MjY4NTF9.Hg_6L3taBamqc9hkxk9cMWh3HihwyvtMzev_K384xPE"}),s(r,l,i,u)},s=function(t,e,n,i){var o,s,c;return(o=$("body")).toggleClass("is-popup",!!window.opener),s=r(132),c=(null!=i?i.premium:void 0)||!1,r(113).default.init({user:i,uploadToken:(null!=i?i.upload_token:void 0)||""}),window.editor=new s({el:o,remote:n,initOptions:a,premium:c}),t?editor.edit(t.id).then(l).fail(function(t){return console.log(t.stack)}):editor.new(e.id).then(l).fail(function(t){return console.log(t.stack)}),editor.bind("skin:select",function(t){return u.notify("skin:select",t)}),editor.$bind("skin:save",function(t,e){return u.notify("skin:save",e)}),editor.$bind("skin:destroy",function(t,e){return u.notify("skin:destroy",e)}),editor.$bind("composition:save",u.notify),editor.$bind("composition:temporary:save",u.notify),editor.$bind("content:auth-req",u.notify),editor.$bind("step:intent",u.notify),editor.$bind("Control:upgrade",u.notify),editor.$bind("Content:upgrade",u.notify),$(window).on("unload",window.editor.release.bind(editor)),editor},l=function(){return u.notify("editor:init")},i=function(t){var e,r,n;for(e in r={},t)"object"!=typeof(n=t[e])&&(r[e]=n);return r},p=function(t){return Widgetic.Event.on(window,t,function(t){return u.notify(Widgetic.UI.Editor.RELAY,i(t))})},h=function(){var t,e,r,i;return r={ready:c,step:function(t){return window.editor.step(t.d)},token:function(t){var e;return t.d?(Blogvio.auth.token(n=t.d),null!=(e=window.editor)?e.preview.remote.Blogvio.auth.token(n):void 0):Blogvio.auth.disconnect()},cont:function(t){return window.editor.el.trigger("content:"+t.d.source+":add",{items:t.d.data})},opts:function(t){return window.editor?window.editor.composition?window.editor.setOptions(t.d):window.editor.setInitOptions(t.d):a=t.d},ree:function(t){return p(t.d)}},i=window.location,t=decodeURIComponent((i.search.match(/(?:lo=)([^\#\&$]*)/)||[0,i.origin])[1]),e=function(e){var n,i,o,s;if(e.origin===t)try{n=JSON.parse(e.data),"function"==typeof r[o=n.t]&&r[o](n,{source:e.source})}catch(t){i=t,null!=(s=window.localStorage)&&s.debug_on_error,console.error(i.stack)}},Blogvio.Event.on(window,"load",function(){return Blogvio.Event.on(window,"message",e),u.load()}),Blogvio.Event.on(window,"unload",function(){return window.editor.release()})},t.exports={run:h,ready:c}},function(t,e,r){var n,i,o,s,a,u,l,c=function(t,e){return function(){return t.apply(e,arguments)}},p={}.hasOwnProperty;o=window.require("spine/controller"),i=window.require("spine/controller/container"),l=r(133),a=r(182),u=window.require("core/models/widget"),n=window.require("core/models/composition"),window.require("core/models/skin"),window.require("core/models/content"),s=function(t){function e(t){if(this._onSkinItemSelected=c(this._onSkinItemSelected,this),this._initialize=c(this._initialize,this),this._editComposition=c(this._editComposition,this),this._newComposition=c(this._newComposition,this),!t.remote)throw new Error("Remote UI.composition is missing!");t.premium||(t.premium=!1),e.__super__.constructor.apply(this,arguments),this.preview=new a(this.remote),this.editor=new l({premium:this.premium}),this.append(this.editor),$("html").toggleClass("isTouch",!(void 0===document.documentElement.ontouchstart))}return function(t,e){for(var r in e)p.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,o),e.include(i),e.VERSION="1.9.24",e.prototype.events={"SkinItem:selected":"_onSkinItemSelected"},e.prototype.hasPendingChange=function(){return this.editor.hasPendingChange()},e.prototype.initSave=function(){return this.editor.initSave()},e.prototype.new=function(t){return this.preview.startLoading(),u.load(t).then(this._newComposition).then(this._initialize).then(function(t){return function(){return t.setOptions()}}(this)).fail(function(t){return console.error(t)})},e.prototype.edit=function(t){return n.load(t).then(this._editComposition).then(this._initialize).then(function(t){return function(){return t.setOptions()}}(this)).fail(function(t){return console.error(t)})},e.prototype.step=function(){var t;return(t=this.editor).step.apply(t,arguments)},e.prototype.selectSkin=function(t){return this.editor.selectSkin(t)},e.prototype._newComposition=function(t){return this.widget=t,this.composition=new n({widget_id:this.widget.id,width:this.widget.width,height:this.widget.height}),this.composition.save({ajax:!1})},e.prototype._editComposition=function(t){return this.composition=t,this.widget=this.composition.getWidget()},e.prototype._initialize=function(){return this.editor.for(this.composition),this.preview.load(this.composition)},e.prototype._onSkinItemSelected=function(t,e){return this.trigger("skin:select",e),this.preview.setSkin(e)},e.prototype.setInitOptions=function(t){this.initOptions=t},e.prototype.setOptions=function(t){return this.editor.setOptions($.extend({step:"skin"},t||this.initOptions))},e.prototype.release=function(){return this._release(this),this.preview.release(),e.__super__.release.apply(this,arguments)},e}(),t.exports=s},function(t,e,r){var n,i,o,s,a,u,l,c,p=function(t,e){return function(){return t.apply(e,arguments)}},h={}.hasOwnProperty;u=window.require("spine/controller/tabs"),window.require("core/models/content"),window.require("core/models/skin"),window.require("core/models/composition"),window.require("core/models/widget"),a=r(134),n=r(142),i=r(175),s=r(179),r(120),c=window.require("spine/utils/timestamp"),o=r(180),l=function(t){function e(){this.onBeforeUnload=p(this.onBeforeUnload,this),this.activateSource=p(this.activateSource,this),this.setCompositionName=p(this.setCompositionName,this),this.skin_editor=p(this.skin_editor,this),this.navigation=p(this.navigation,this),this._onInitialized=p(this._onInitialized,this),this._waitForInit=p(this._waitForInit,this),this._onViewChange=p(this._onViewChange,this),this._updateLoggedInStatus=p(this._updateLoggedInStatus,this),this._updatePersistedStatus=p(this._updatePersistedStatus,this),this._onValidateLength=p(this._onValidateLength,this),c("WidgetEditor:constructor"),e.__super__.constructor.apply(this,arguments),this.children(function(t){return function(e){return"function"==typeof e.setPremium?e.setPremium(t.premium):void 0}}(this)),this.refreshElements(),this.el.append(this.tabs.el),o.place(this.el),Blogvio.pubsub.subscribe("api/token/update",this._updateLoggedInStatus),this.el.attr("editorVersion","3.11.2")}return function(t,e){for(var r in e)h.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,u),e.prototype.tabContainer=r(120),e.prototype.tabRenderer=r(181),e.prototype.className="editor",e.prototype.tabContainerClass="editor-footer",e.prototype.containerClass="editor-container",e.prototype.events={viewChange:"_onViewChange","Footer:step":"_onStep","Breadcrumb:step":"_onStep","Save:close":"_onSaveClose","DetailsEditor:empty":"_onDetailsEditorEmpty","editor:content:notification":"_onContentNotification","editor:content:browserState":"_onContentBrowserState"},e.prototype.controllers={skin:a,content:n,details:i,save:s},e.prototype.steps={skin:"skin",edit_skin:"skin",theme:"skin",content:"content",details:"details",done:"save"},e.prototype.stepValidators={skin:function(){return!!this.composition||console.warn("No composition set")},edit_skin:function(){return this.stepValidators.skin.call(this)&&null==this.canEditSkin||this.canEditSkin},theme:function(){return this.stepValidators.skin.call(this)},content:function(){return!!this.stepValidators.skin.call(this)&&(!this.hasPendingChange()||(this.initSave(),this.step("skin"),!1))},details:function(){return!!this.stepValidators.content.call(this)&&(!!this.composition.hasEnoughContent()||(this.content.notificator.notify(this.composition.validateLength().errorMsg),this.step("content"),!1))},done:function(){return!!this.stepValidators.details.call(this)}},e.prototype.for=function(t){return c("WidgetEditor:for"),this.initialize(t),this.skin.for(this.composition),this.content.for(this.composition),this.details.for(this.composition),this.save.for(this.composition),this},e.prototype.initialize=function(t){return c("WidgetEditor:initialize"),this.stopListening(this.composition),this.composition=t,this._waitForInit(),this._updatePersistedStatus(),this._updateLoggedInStatus(),this.listenTo(this.composition,"validateLength",this._onValidateLength),this.composition.validateLength(),$(window).on("beforeunload",this.onBeforeUnload)},e.prototype.hasPendingChange=function(){return this.skin.hasPendingChange()},e.prototype.initSave=function(){return this.skin.initSave()},e.prototype.step=function(t){var e;return this.steps[t]?(e=this[this.steps[t]],this.stepValidators[t].call(this)&&e.active(t),this._updatePersistedStatus()):console.warn("The editor does not have the "+t+" step.")},e.prototype.selectSkin=function(t,e){return null==e&&(e=!0),this.skin.select(t,e)},e.prototype._onStep=function(t,e){return this.step(e),this.$trigger("step:intent",{step:e,skin_pending:this.hasPendingChange(),content:this.composition.hasEnoughContent()})},e.prototype._onValidateLength=function(t,e,r){if(this.composition)return this.el.attr({minValid:e||"min"!==r,maxValid:e||"max"!==r})},e.prototype._updatePersistedStatus=function(){return this.el.attr("persisted-comp",this.composition.isPersisted())},e.prototype._updateLoggedInStatus=function(){var t;return t="connected"===Blogvio.auth.status().status,this.el.toggleClass("anonymous-user",!t)},e.prototype._onViewChange=function(t,e){return this.el.attr("current-view",e)},e.prototype._waitForInit=function(){return this.initCount=0,this.listenToOnce(this.skin,"initialized",this._onInitialized),this.listenToOnce(this.content,"initialized",this._onInitialized),this.listenToOnce(this.details,"initialized",this._onInitialized)},e.prototype._onInitialized=function(){if(3==++this.initCount)return this.trigger("initialized")},e.prototype._onContentNotification=function(t,e){return this.el.attr("notification-visible",e.show)},e.prototype._onContentBrowserState=function(t,e){return this.el.attr("content-browser-service",e.service),this.el.attr("content-browser-auth",e.authenticated)},e.prototype._onDetailsEditorEmpty=function(){return this.step("content")},e.prototype._onSaveClose=function(){return this.step("details")},e.prototype.setOptions=function(){var t;return t={skin_editor:"skin_editor",step:"step",navigation:"navigation",skin:"selectSkin",composition:"setCompositionName",sources:"addContentSources",active_source:"activateSource"},function(e){var r,n,i,o;for(i in null==e&&(e={}),o=[],t)r=t[i],(n=e[i])&&o.push("function"==typeof this[r]?this[r](n):void 0);return o}}(),e.prototype.navigation=function(t){var e;return null!=t.steps&&this.el.attr("data-steps",t.steps.join(" ")),(e=this.tabs).setOptions.apply(e,arguments)},e.prototype.skin_editor=function(t){return null==t&&(t={}),null!=t.enabled&&(this.canEditSkin=t.enabled),this.skin.setOptions(t)},e.prototype.addContentSources=function(t){var e,r,n;for(n in null==t&&(t={}),e=[],t)r=t[n],e.push(this.content.addBrowser(r,n));return e},e.prototype.setCompositionName=function(t){if(null==t&&(t={}),null!=t.name)return this.composition.name=t.name},e.prototype.activateSource=function(t){return this.content.focusBrowser(t)},e.prototype.release=function(){return this._release(this),e.__super__.release.apply(this,arguments)},e.prototype.onBeforeUnload=function(){if(this.hasPendingChange())return"There are some unsaved changes!"},e}(),t.exports=l},function(t,e,r){var n,i,o,s,a,u,l,c,p,h=function(t,e){return function(){return t.apply(e,arguments)}},d={}.hasOwnProperty;o=window.require("spine/controller"),i=window.require("spine/controller/container"),n=window.require("spine/controller/activateable"),l=r(135),a=r(138),u=r(140),s=r(141),p=window.require("core/models/skin"),window.require("core/models/composition"),c=function(t){function e(){this.release=h(this.release,this),this.setOptions=h(this.setOptions,this),this.edit_skin=h(this.edit_skin,this),this.activate=h(this.activate,this),this._onSkinChange=h(this._onSkinChange,this),this._onSkinItemSelected=h(this._onSkinItemSelected,this),this._onSkinCreate=h(this._onSkinCreate,this),this._onSkinDestroy=h(this._onSkinDestroy,this),this._onSkinSave=h(this._onSkinSave,this),this.initialize=h(this.initialize,this),e.__super__.constructor.apply(this,arguments),this.savePopup=new u({place:this.el}),this.deletePopup=new s({place:this.el})}return function(t,e){for(var r in e)d.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,o),e.prototype.className="skin-config",e.prototype.title="Theme",e.prototype.nextTitle="Skin",e.include(i),e.include(n),e.prototype.controllers={selector:l,editor:a},e.prototype.events={saveItem:"saveItem",deleteItem:"deleteItem","SkinItem:selected":"_onSkinItemSelected"},e.prototype.setPremium=function(t){return this.premium=t,this.editor.setAccessLevel(+this.premium)},e.prototype.initSave=function(){return this.selector.initSave()},e.prototype.hasPendingChange=function(){return this.selector.hasPendingChange()},e.prototype.saveItem=function(t,e){return null==e&&(e={}),t.stopPropagation(),this.savePopup.saveItem(e.controller,e.item)},e.prototype.deleteItem=function(t,e){return null==e&&(e={}),t.stopPropagation(),this.deletePopup.deleteItem(e.controller,e.item)},e.prototype.select=function(t,e){var r;return null==e&&(e=!1),t.widget_id===this.widget.id&&(r=t,this.selector.select(r.id,e))},e.prototype.for=function(t){return this.composition=t,this.widget=this.composition.getWidget(),this.initialize(),this},e.prototype.initialize=function(t){var e,r;return this.composition?this.widget?(this.stopListening(),this.listenTo(p,"save",this._onSkinSave),this.listenTo(p,"destroy",this._onSkinDestroy),this.listenTo(p,"create",this._onSkinCreate),this.listenTo(p,"change",this._onSkinChange),r=(r=p.findAllByAttribute("widget_id",this.widget.id)).filter(function(t){return t.isPreset()}).concat(r.filter(function(t){return!t.isPreset()})),e=this.widget.skinMeta,this.editor.parseMeta(e,this.composition),this.selector.refresh(r),this.editor.display(),this.select(this.composition.getSkin()||r[0]),this.trigger("initialized")):console.warn("No widget set"):console.warn("No composition set")},e.prototype._onSkinSave=function(t,e){if(null==e&&(e={}),e.ajax||e.fromApi)return this.$trigger("skin:save",t)},e.prototype._onSkinDestroy=function(t,e){return this.$trigger("skin:destroy",t)},e.prototype._onSkinCreate=function(t){var e;if(t.widget_id===(null!=(e=this.widget)?e.id:void 0))return this.initialize(),this.selector.toggleBtn(),this.selector.select(t.id)},e.prototype._onSkinItemSelected=function(t,e){var r;return this.composition.updateAttribute("skin_id",e.id,{ajax:!1}),null!=(r=this.currentSkin)&&r.used(-1),this.currentSkin=e,this.currentSkin.used(1),this.editor.setSkin(e)},e.prototype._onSkinChange=function(t,e,r){var n;if(this.editor.skinChanged(t),(null!=(n=this.currentSkin)?n.eql(t):void 0)&&r.changedID)return this.composition.updateAttribute("skin_id",t.id,{ajax:!1})},e.prototype.activate=function(t){return n.activate.apply(this,arguments),this.$trigger("viewChange","skin"),"function"==typeof this[t]&&this[t](),this},e.prototype.edit_skin=function(){return this.delay(this.selector.editSkinState,15)},e.prototype.setOptions=function(t){if(null!=t.enabled&&!t.enabled)return this.selector.hideEditBtn()},e.prototype.release=function(){return this.currentSkin.reset(),e.__super__.release.apply(this,arguments)},e}(),t.exports=c},function(t,e,r){var n,i,o,s,a=function(t,e){return function(){return t.apply(e,arguments)}},u={}.hasOwnProperty;i=window.require("spine/controller"),n=window.require("spine/controller/container"),o=r(136),r(7),window.require("core/models/skin"),s=function(t){function e(){this.onMouseLeaveBtn=a(this.onMouseLeaveBtn,this),this.hideEditBtn=a(this.hideEditBtn,this),this.toggleBtn=a(this.toggleBtn,this),this.editSkinState=a(this.editSkinState,this),this.expand=a(this.expand,this),this.toggleState=a(this.toggleState,this),this.hasPendingChange=a(this.hasPendingChange,this),e.__super__.constructor.apply(this,arguments),this.prepend(r(40),$('<span class="after">')),this.toggleState()}return function(t,e){for(var r in e)u.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.prototype.className="skin-presets",e.include(n),e.prototype.canExpand=!0,e.prototype.controllers={list:o},e.prototype.elements={".toggle-skin-edit":"btn"},e.prototype.events={"click .toggle-skin-edit":"toggleState","mouseleave .toggle-skin-edit":"onMouseLeaveBtn"},e.prototype.hasPendingChange=function(){return this.list.pending},e.prototype.initSave=function(){return this.list.initSave()},e.prototype.refresh=function(t){return this.list.refresh(t)},e.prototype.select=function(t,e){return this.list.select(t,e)},e.prototype.toggleState=function(){return(this.canExpand&&"expanded"===this.state?this.editSkinState:this.expand)()},e.prototype.expand=function(){return this.hasPendingChange()?this.initSave():(this.btn.addClass("no-hover"),this.el.addClass("expanded"),this.list.setState(this.state="expanded"))},e.prototype.editSkinState=function(){return this.btn.addClass("no-hover"),this.el.removeClass("expanded"),this.list.setState(this.state="contracted")},e.prototype.toggleBtn=function(t){return this.btn.toggleClass("no-action",null!=t&&"boolean"==typeof t?t:this.hasPendingChange())},e.prototype.hideEditBtn=function(){return this.canExpand=!this.btn.hide()},e.prototype.onMouseLeaveBtn=function(){return this.btn.removeClass("no-hover")},e}(),t.exports=s},function(t,e,r){var n,i,o,s,a,u=function(t,e){return function(){return t.apply(e,arguments)}},l={}.hasOwnProperty;n=window.require("spine/controller/activator"),a=window.require("core/models/skin"),s=r(5),i=r(137),o=function(t){function e(){this.onItemDestroy=u(this.onItemDestroy,this),this.repositionChild=u(this.repositionChild,this),this.refreshScroll=u(this.refreshScroll,this),this.scrollToItem=u(this.scrollToItem,this),this.scrollToActive=u(this.scrollToActive,this),this.setState=u(this.setState,this),this._canceled=u(this._canceled,this),this._changed=u(this._changed,this),this.refresh=u(this.refresh,this),this.select=u(this.select,this),e.__super__.constructor.apply(this,arguments),this.last_scroll={expanded:0,contracted:0},this.pending=!1,this.state="expanded",this.$bind("changed",this._changed).$bind("cancel",this._canceled),this.listenTo(a,"destroy",this.onItemDestroy),this.$bind("SkinItem:activate",function(t){return function(e,r){return t.activeChild=r.item,t.scrollToActive()}}(this)),this.listenTo(a,"create",this.scrollToActive)}return function(t,e){for(var r in e)l.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,n),e.prototype.className="presets-list",e.include(s),e.prototype.select=function(t,e){return this.activeChild=t?this.children().filter(function(e){return e.item.id===t})[0]:this.children()[0],this.activeChild.active({force:e})},e.prototype.refresh=function(t){var e;return this.children(function(t){return t.release()}),this.append.apply(this,function(){var r,n,o;for(o=[],r=0,n=t.length;r<n;r++)e=t[r],o.push(new i({item:e}));return o}()),this.pending=!1,this.delay(this.refreshScroll,850),this},e.prototype.initSave=function(){return this.children(function(t){return t.isActive()})[0].initSave()},e.prototype._changed=function(t,e){var r,n;if(!this.pending)return this.pending=!0,this.scroll().disable(),r=this.activeChild.el.index(),n=this.scroll().offset().top,this.children(function(t){return t.positionOnChange(r,n)})},e.prototype._canceled=function(){if(this.pending)return this.pending=!1,this.repositionChild(),this.scroll().disable(),this.delay(function(t){return function(){return t.refreshScroll(),t.skin=t.activeChild.item,t.scrollToActive()}}(this),850)},e.prototype.setState=function(t){var e;return this.last_scroll[this.state]=(null!=(e=this.container)?e.scrollTop():void 0)||0,this.state=t,this.repositionChild(),this.scroll().disable(),this.delay(function(t){return function(){return t.scrollToItem(t.activeChild,t.refreshScroll)}}(this),750)},e.prototype.scrollToActive=function(t){return t instanceof a?this.skin=t:this.skin&&this.skin.id===this.activeChild.item.id?(this.skin=null,this.scrollToItem(this.activeChild)):void 0},e.prototype.scrollToItem=function(t,e){var r;return null==t&&(t=this.activeChild),null==e&&(e=function(){}),r=(null!=t?t.el.get(0).offsetTop:void 0)+parseInt(null!=t?t.el.css("padding-top"):void 0)||0,(r-=this.container.height()-(null!=t?t.el.height():void 0))>0?this.container.animate({scrollTop:r},450,e):e()},e.prototype.refreshScroll=function(t){if(t||!this.pending)return this.scroll().enable()},e.prototype.repositionChild=function(t){return this.children(function(e){return e.reposition(null!=t?t.destroyed:void 0)}),this.scroll().update()},e.prototype.onItemDestroy=function(){return this.scroll().disable(),this.repositionChild.apply(this,arguments),this.delay(this.refreshScroll,850)},e}(),t.exports=o},function(t,e){var r,n,i,o,s=function(t,e){return function(){return t.apply(e,arguments)}},a={}.hasOwnProperty;r=window.require("spine/controller/activateable"),n=window.require("spine/controller"),i=window.require("core/models/skin"),o=function(t){function e(t){this.positionOnChange=s(this.positionOnChange,this),this.reposition=s(this.reposition,this),this.getPosition=s(this.getPosition,this),this.width=s(this.width,this),this.state=s(this.state,this),this._enter=s(this._enter,this),this.cancelSave=s(this.cancelSave,this),this.allChanges=s(this.allChanges,this),this.deactivate=s(this.deactivate,this),this.activate=s(this.activate,this),this.uses=s(this.uses,this),this.added=s(this.added,this),t.tag=null==t.item.user_id?"span":"div",e.__super__.constructor.apply(this,arguments),this.uses(this.item,{used:!0}).$addClass(null==this.item.user_id?"is-preset":"isnt-preset"),this.colors=i.meta(this.item.widget_id).colorAttributes.concat(),this.render(),this.item.freeze(),this.listenTo(this.item,"update",this.uses),this.listenTo(this.item,"update",this.allChanges)}return function(t,e){for(var r in e)a.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,n),e.prototype.className="presets-list-item",e.include(r),e.prototype.template="editor/views/skinitem",e.prototype.events={click:"active","mouseenter .presets-list-colors":"_enter","click .presets-list-delete":"initDelete","click .cancel":"cancelSave","click .save":"initSave"},e.prototype.interval=0,e.prototype.height=60,e.prototype.added=function(){return e.__super__.added.apply(this,arguments),this.reposition(!0),this.delay(function(t){return function(){return t.el.addClass("skin--added")}}(this)),this},e.prototype.initSave=function(){return this.$trigger("saveItem",{item:this.item,controller:this})},e.prototype.uses=function(t,e){return null==e&&(e={}),e.used?(this.el.toggleClass("can-delete",null!=t.user_id&&!Boolean(t.uses>>0)),this):this},e.prototype.activate=function(t){return this.isActive()&&!0!==t.force?this:(r.activate.apply(this,arguments),this.$trigger("SkinItem:activate",$.extend({},t,{item:this})),this.$trigger("SkinItem:selected",this.item),this)},e.prototype.deactivate=function(){return r.deactivate.apply(this,arguments),this._countChanges()>0&&this.cancelSave(),this},e.prototype.allChanges=function(t,e){var r,n,o,s,a,u,l,c;if(null==e&&(e={}),!(e.used||(r=e.attribute,o=i.meta(t.widget_id).colorAttributes,null!=r&&((this.changes||(this.changes={}))[r]=1,this.$trigger("changed").$addClass("changed").$(".total").text(a=this._countChanges()),this.$(".text").text(1===a?"change":"changes"),o.indexOf(r)<0)))){for(c=[],u=0,l=(s=null!=r?[r]:o).length;u<l;u++)n=s[u],c.push(this.$("[data-name='"+n+"']").css({backgroundColor:this.item[n]}));return c}},e.prototype.cancelSave=function(){return this.changes={},this.$removeClass("changed").$trigger("cancel").item.reset()},e.prototype.override=function(){return this.changes={},this.$removeClass("changed").$trigger("cancel").item.freeze()},e.prototype.initDelete=function(t){return t.stopImmediatePropagation(),t.preventDefault(),this.$trigger("deleteItem",{item:this.item,controller:this})},e.prototype._countChanges=function(){var t;return function(){var e,r;for(t in r=[],e=this.changes)e[t],r.push(t);return r}.call(this).length},e.prototype._enter=function(t){if("expanded"===this.state())return t.preventDefault()},e.prototype.state=function(){return this.parent().state},e.prototype.width=function(){return{expanded:245,contracted:100}[this.state()]},e.prototype.getPosition=function(){return"expanded"===this.state()?{top:this.height*parseInt(this.index/2)-20,left:this.width()*(this.index%2)}:{top:this.height*this.index-20,left:0}},e.prototype.reposition=function(t){return t&&(this.index=this.el.index()||0),this.el.css(this.getPosition())},e.prototype.positionOnChange=function(t,e){return this.isActive()?this.el.css({top:e-20,left:0}):this.el.css({left:0,top:this.height*(this.index-t)-20+(t<this.index?440+e:e)})},e}(),t.exports=o},function(t,e,r){var n,i,o,s,a,u,l,c,p,h,d,f=function(t,e){return function(){return t.apply(e,arguments)}},g=function(t,e){for(var r in e)y.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},y={}.hasOwnProperty;c=window.require("spine/controller/tabs"),s=r(139),window.require("core/models/skin"),i=window.require("spine/controller/activator"),n=window.require("spine/controller/activateable"),o=window.require("spine/controller"),p=r(13).createPopup,d=r(39),h=function(t,e,r){if(-1!==r&&(e[r].before(t.el),!t.isVisible()))return h(t,e,r-1)},u=function(t){function e(){return this.isVisible=f(this.isVisible,this),e.__super__.constructor.apply(this,arguments)}return g(e,o),e.include(n),e.prototype.events={click:"active"},e.prototype.isVisible=function(){return 0===this.el.position().top},e}(),l=function(t){function e(){this._onChildActivate=f(this._onChildActivate,this),this.tabClick=f(this.tabClick,this),this.afterAdd=f(this.afterAdd,this),this.clear=f(this.clear,this),this.toggleItem=f(this.toggleItem,this),this.hideList=f(this.hideList,this),e.__super__.constructor.apply(this,arguments),this.tabsByName={},this.listenTo($(document),"click",function(t){return function(e){var r;if(!$(e.target).is(".multi-tabs-toggle"))return null!=(r=t.popup)?r.hide():void 0}}(this)),this.el.prepend(this.toggle=$("<div class='multi-tabs-toggle' data-icon='❯'></div>")),this.list=$("<div class='multi-tabs-list'></div>"),this.list.on("click",".multi-tab-item",this.tabClick)}return g(e,i),e.prototype.containerClass="skin-editor-tabs-list",e.prototype.events={"click .multi-tabs-toggle":"toggleItem","click .activateable":"hideList"},e.prototype.hideList=function(t){var e,r;return null!=(r=this.popup)&&r.hide(),(e=$(t.target).controller()).el.hasClass("hidden")||this.list.children().removeClass("active"),this.list.children().each(function(t,r){var n;if((n=$(r)).data("tab")===e)return n.addClass("active").siblings().removeClass("active")})},e.prototype.toggleItem=function(t){return this._createPopup().then(function(t){return function(){return t.popup.visible?t.popup.hide():t.popup.show()}}(this))},e.prototype.clear=function(){return this.list.empty(),this.tabsByName={},this.children().forEach(function(t){return function(e){return t.stopListening(e)}}(this)),this.toggle.hide()},e.prototype.afterAdd=function(t){var r;return e.__super__.afterAdd.apply(this,arguments),this.listenTo(t,"activate",this._onChildActivate),this.list.append(r=$("<div class='multi-tab-item'>"+t.panel.tabTitle+"</div>")),this.tabsByName[t.panel.tabTitle]=t,r.data("tab",t),t.el.data("multi-tab-list-item",r)},e.prototype.tabClick=function(t){var e;return null!=(e=this.popup)&&e.hide(),$(t.target).data("tab").active()},e.prototype.update=function(t,e){var r,n,i,o,s,a,u;for(u in o={},t)for(r in n=t[u],o[u]=!0,n)if(a=n[r],d(a.if,e)){o[u]=!1;break}for(u in o)i=o[u],this.tabsByName[u].el.toggleClass("empty",i),null!=(s=this.tabsByName[u].el.data("multi-tab-list-item"))&&s.toggleClass("empty",i);return this.children(function(t){return t.el.is(".active.empty")}).map(function(t){return function(){return t.children(function(t){return t.el.is(":not(.empty)")})}}(this)).forEach(function(t){return t[0].active()}),this._updateVisibleTabs(),!0},e.prototype._onChildActivate=function(t,e){return this.children().forEach(function(t){return t.$removeClass("active")}),t.$addClass("active"),t.isVisible()||h(t,this.children().map(function(t){return t.el}),2),this._updateVisibleTabs()},e.prototype._updateVisibleTabs=function(){var t,e,r;if((r=this.children().map(function(t){return{tab:t,visible:t.isVisible()}})).forEach(function(t){return t.tab.el.data("multi-tab-list-item").toggle(!t.visible)}),t=r.map(function(t){return t.visible}).reduce(function(t,e){return t&&e}),this.toggle.toggle(!t),t)return null!=(e=this.popup)?e.hide():void 0},e.prototype._createPopup=function(){return this.popupPromise?this.popupPromise:this.popupPromise=p({topOffset:25,leftOffset:23,anchor:this.toggle}).then(function(t){return function(e){return t.popup=e,t.popup.append(t.list)}}(this)).catch(function(t){return console.error(t.stack)})},e}(),a=function(t){function e(){return this.updateSkin=f(this.updateSkin,this),this.parseMeta=f(this.parseMeta,this),e.__super__.constructor.apply(this,arguments)}return g(e,c),e.prototype.tabRenderer=u,e.prototype.className="skin-editor",e.prototype.tabContainerClass="skin-editor-tabs",e.prototype.tabContainer=l,e.prototype.containerClass="skin-editor-container",e.prototype.tabTemplate=function(t){return t.panel.tabTitle},e.prototype.setAccessLevel=function(t){this.accessLevel=t},e.prototype.parseMeta=function(t,e){var r,n,i,o,a,u;for(this.meta=t,r=0,n=(o=this.children()).length;r<n;r++)o[r].release();for(u in this.tabs.clear(),a=this.meta.tabs)i=a[u],this.append(new s({meta:i,tabTitle:u,composition:e,accessLevel:this.accessLevel}));return this.tabs.update(this.meta.tabs,e.getSkin())},e.prototype.display=function(t){var e;return null==t&&(t=0),null!=(e=this.children()[t])?e.active():void 0},e.prototype.updateSkin=function(t){var e,r,n,i,o,s;for(e in i=!1,s=this.meta.tabs)for(n in o=s[e])r=o[n],null==t[n]&&((i||(i={}))[n]=r.options.default);if(i)return t.updateAttributes(i,{from:this,ajax:!1})},e.prototype.setSkin=function(t){return this.updateSkin(t),this.children(function(e){return e.skinLoad(t)})},e.prototype.skinChanged=function(t){return this.tabs.update(this.meta.tabs,t)},e}(),t.exports=a},function(t,e,r){var n,i,o,s,a,u=function(t,e){return function(){return t.apply(e,arguments)}},l={}.hasOwnProperty;o=window.require("spine/controller"),i=window.require("spine/controller/container"),n=window.require("spine/controller/activateable"),window.require("core/models/skin"),s=r(5),a=function(t){function e(){this.onScroll=u(this.onScroll,this),this.skinLoad=u(this.skinLoad,this),e.__super__.constructor.apply(this,arguments),this.bind("activate",function(t){return function(){if(t.skin)return t.skinLoad(t.skin)}}(this))}return function(t,e){for(var r in e)l.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,o),e.prototype.className="controls",e.include(i),e.include(n),e.include(s),e.prototype.skinLoad=function(t){var e,r,n,i,o,s,a;if(null==this.skin)for(r in a=this.meta)i=a[r],e=window.require(i.control),o=this.accessLevel>=(i.access||0),s=i.options,n=i.if,o||(s.readonly=!0),this.append(new e({item:t,attribute:r,options:s,composition:this.composition,isAccesible:o,conditions:n}));return this.children(function(e){return e.setItem(t)}),this.skin=t,this.scroll().update()},e.prototype.onScroll=function(){return this.children(function(t){return"function"==typeof t.deactivate?t.deactivate():void 0})},e}(),t.exports=a},function(t,e,r){var n,i,o,s,a,u,l=function(t,e){return function(){return t.apply(e,arguments)}},c={}.hasOwnProperty;n=window.require("spine/controller"),s=window.require("core/models/skin"),i=r(14),a={confirmBtnClass:(u={confirmBtnClass:"green-button button--uc button--save create-button",cancelBtnClass:"dim-button button--uc button--overwrite override-button",title:"How do you want to proceed?",content:'<input class="general-input skin-name" type="text" placeholder="Untitled Theme" />',note:"Changes will also apply to previous uses of this theme.",confirmBtn:"Create a new theme",cancelBtn:"Overwrite previous theme",separator:!0}).confirmBtnClass,cancelBtnClass:u.cancelBtnClass,title:"Create a new theme?",content:u.content,confirmBtn:"Create",separator:!1},o=function(t){function e(){this._closePopup=l(this._closePopup,this),this._onSaveCanceled=l(this._onSaveCanceled,this),this.override=l(this.override,this),this.save=l(this.save,this),e.__super__.constructor.apply(this,arguments),this.popup=new i({className:"popup skin-save-popup"}),this.listenTo(this.popup,"canceled",this._onSaveCanceled)}return function(t,e){for(var r in e)c.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,n),e.prototype.saveItem=function(t){return this.model=(this.item=t).item,this.popup.render(null!=this.model.user_id?u:a).pop(this.place,this.save,this.override)},e.prototype.save=function(){var t;return delete(t=this.model.attributes()).id,delete t.uses,t=$.extend({},t,{name:this.popup.el.find("input").val(),user_id:1}),this.item.item.reset(),new s(t).save(),this.item.changes={}},e.prototype.override=function(){return this.item.override(),this.item.item.save()},e.prototype._onSaveCanceled=function(){return this.model.trigger("save-canceled")},e.prototype._closePopup=function(){return this.popup.close()},e}(),t.exports=o},function(t,e,r){var n,i,o,s,a,u=function(t,e){return function(){return t.apply(e,arguments)}},l={}.hasOwnProperty;n=window.require("spine/controller"),o=r(14),s=window.require("core/models/skin"),a=function(t){return{confirmBtnClass:"green-button button--uc popup-button red-button",cancelBtnClass:"dim-button button--uc popup-button dark-purple-button",title:'Delete Theme "'+t.name+'"?',confirmBtn:"Delete",cancelBtn:"Cancel"}},i=function(t){function e(){this._closePopup=u(this._closePopup,this),this.deleteit=u(this.deleteit,this),this.deleteItem=u(this.deleteItem,this),e.__super__.constructor.apply(this,arguments),this.popup=new o({className:"popup skin-delete-popup"})}return function(t,e){for(var r in e)l.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,n),e.prototype.deleteItem=function(t){return this.model=(this.item=t).item,this.popup.render(a(this.model)).pop(this.place,this.deleteit),this.listenToOnce(s,"selected",this._closePopup)},e.prototype.deleteit=function(t){var e;return this.stopListening(s,"selected",this._closePopup),this.item.isActive()&&(e=this.item.el).next().add(e.prev()).first().controller().active(),this.item.release(),this.model.destroy()},e.prototype._closePopup=function(){return this.popup.close()},e}(),t.exports=i},function(t,e,r){var n,i,o,s,a,u,l,c,p,h,d=function(t,e){return function(){return t.apply(e,arguments)}},f={}.hasOwnProperty;n=window.require("spine/controller/activateable"),p=window.require("spine/controller/tabs"),a=window.require("core/models/content"),window.require("core/models/composition"),c=r(106),i=r(50),u=r(143),l=r(145),h=r(112),o=r(53).default,s=function(t){function e(){this.afterAdd=d(this.afterAdd,this),this._onBrowserState=d(this._onBrowserState,this),this.showError=d(this.showError,this),this._onItemUpdate=d(this._onItemUpdate,this),this._onItemCreate=d(this._onItemCreate,this),this.onItemDestroy=d(this.onItemDestroy,this),this.contentUpdate=d(this.contentUpdate,this),this.contentRemove=d(this.contentRemove,this),this.contentAdd=d(this.contentAdd,this),this._freeContentCanAdd=d(this._freeContentCanAdd,this),this._premiumContentCanAdd=d(this._premiumContentCanAdd,this),this.contentCanAdd=d(this.contentCanAdd,this),this.focusBrowser=d(this.focusBrowser,this),this.legacyAddBrowser=d(this.legacyAddBrowser,this),this.addBrowser=d(this.addBrowser,this),this.initialize=d(this.initialize,this),this.deactivate=d(this.deactivate,this),this.activate=d(this.activate,this),this.browsers={},e.__super__.constructor.apply(this,arguments),this.el.prepend((this.notificator=new l).el),o.Content.events.error(this.showError),this.$bind("error",function(t){return function(e,r){return t.showError(r)}}(this))}return function(t,e){for(var r in e)f.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,p),e.prototype.className="content-browser",e.prototype.tabContainerClass="content-browser-tabs",e.prototype.containerClass="content-browser-container",e.prototype.title="Content",e.prototype.nextTitle="Edit Content",e.prototype.tabRenderer=c,e.include(n),e.prototype.interval=0,e.prototype.events={"editor:browser:active":"_onBrowserState","editor:browser:auth":"_onBrowserState"},e.prototype.children=function(t){var e,r,n,i;for(e in null==t&&(t=function(){return!0}),i=[],n=this.browsers)t(r=n[e])&&i.push(r);return i},e.prototype.setPremium=function(t){this.premium=t},e.prototype.activate=function(){var t,e;return n.activate.apply(this,arguments),null!=(t=this.children(function(t){return t.isActive()}))&&null!=(e=t[0])&&"function"==typeof e.auth&&e.auth(),this.$trigger("viewChange","content"),this},e.prototype.deactivate=function(){var t;return n.deactivate.apply(this,arguments),null!=(t=this.children(function(t){return t.isActive()})[0])&&"function"==typeof t.refreshChildren?t.refreshChildren():void 0},e.prototype.for=function(t){return this.composition=t,this.initialize(),this},e.prototype.initialize=function(){var t,e,r,n,i;if(!this.composition)return console.warn("No composition set");for(t in this.children(function(t){return t.release()}),this.stopListening(),this.meta=this.composition.contentMeta(),this.browserOptions=null!=(e=this.meta.browser)?e.options:void 0,this.addBrowser(h),(i=null!=(r=this.meta.browser)?r.sources:void 0)&&(delete i.facebook,delete i.websearch,delete i.blogvio,delete i.dropbox,delete i.flickr,delete i["google-drive"]),i)n=i[t],this.legacyAddBrowser(n,t);return this.meta.input&&(this.append(this.input=new u({control:this.meta.input,composition:this.composition})),this.browsers.input=this.input,this.listenTo(this.input,"canAdd",this.contentCanAdd)),this.listenTo(a,"destroy",this.onItemDestroy),this.listenTo(a,"update",this._onItemUpdate),this.listenTo(a,"create",this._onItemCreate),this.listenTo(a,"change",function(t){return function(){return t.el.toggleClass("has-reached-max",t.composition.maxContentReached())}}(this)),this.children()[0].active(),this.trigger("initialized")},e.prototype.addBrowser=function(t){var e,r,n,i;if(t.isCompatible(null!=(r=this.browserOptions)?r.types:void 0))return(e=new t({filetypes:null!=(n=this.browserOptions)?n.types:void 0})).on("toggle",function(e){return function(r){var n,i,s;if(i=r.file,!((null!=(s=r.options)?s.afterUpload:void 0)&&o.Content.maxContentReached(e.composition)))try{return o.Content.toggleItem(e.composition,t.name,i.id,i.url,e.meta.attributes.title?{title:i.name}:void 0)}catch(t){return n=t,console.warn(n)}}}(this)),e.on("clearContent",function(e){return function(){return o.Content.clearContent(e.composition,t.name)}}(this)),e.observe("selected",function(t){return e.tab.count(t.length)}),i=function(){var r;return r=o.Content.getItemsByService(t.name).map(function(t){return t.metadata.id}),e.set({selected:r})},o.Content.events.change(i),i(),this.append(this.browsers[t.name]=e)},e.prototype.legacyAddBrowser=function(t,e){var r,n,o;return r=window.require(t.module||"editor/content/service/default"),o=this.composition.getContent().filter(function(t){var r;return(null!=(r=t.metadata)?r.service:void 0)===e}).map(function(t){return t.metadata}),i=window.require(t.browser||r.browser),this.browsers[e]=n=new i({content:o,title:e,Service:r,options:$.extend({},this.browserOptions,t.options||{})}),this.listenTo(n,"add",this.contentAdd),this.listenTo(n,"remove",this.contentRemove),this.listenTo(n,"update",this.contentUpdate),this.listenTo(n,"canAdd",this.contentCanAdd),this.append(n)},e.prototype.focusBrowser=function(t){var e;return null!=(e=this.browsers[t]||{links:this.input}[t])?e.active():void 0},e.prototype.contentCanAdd=function(t,e){return this.premium?this._premiumContentCanAdd(t,e):this._freeContentCanAdd(t,e)},e.prototype._premiumContentCanAdd=function(t,e){return this.composition.maxContentReached()?e?void 0:this.showError("max",!0):t.call(this)},e.prototype._freeContentCanAdd=function(t,e){var r;return r=this.composition.contentMeta().options.free_user_limit,this.composition.maxContentReached(r)?e?void 0:this.showError("maxFree",!0):t.call(this)},e.prototype.contentAdd=function(t){var e,r,n;for(e in r={},n=this.meta.attributes)n[e],null!=t[e]&&(r[e]=t[e]);return r.metadata=t,r.composition_id=this.composition.id,r[this.meta.browser.options.attribute]=t.url,new a(r).save()},e.prototype.contentRemove=function(t){var e,r;if(this.stopListening(a,"destroy",this.onItemDestroy),r=a.all().filter(function(e){return function(r){var n;return(null!=(n=r.metadata)?n.id:void 0)===t.id&&r.composition_id===e.composition.id}}(this)),null!=(e=r[0])&&e.destroy(),this.listenTo(a,"destroy",this.onItemDestroy),!this.composition.hasEnoughContent())return this.showError("min",!0)},e.prototype.contentUpdate=function(t,e,r){var n;if((n=a.all().filter(function(e){return e.metadata===t})).length)return n[0].updateAttribute(e,r)},e.prototype.onItemDestroy=function(t){var e,r,n;if(t.composition_id===this.composition.id)return(n=null!=(e=t.metadata)?e.service:void 0)&&"directinput"!==n&&null!=(r=this.browsers[n])&&"function"==typeof r.removeEntry&&r.removeEntry(t.metadata),!0},e.prototype._onItemCreate=function(t){var e,r,n;if(t.composition_id===this.composition.id)return(n=null!=(e=t.metadata)?e.service:void 0)&&"directinput"!==n?null!=(r=this.browsers[n])&&"function"==typeof r.addEntry&&r.addEntry(t.metadata):this.input.addEntry(t),!0},e.prototype._onItemUpdate=function(t){var e,r,n;if(t.composition_id===this.composition.id)return(n=null!=(e=t.metadata)?e.service:void 0)&&"directinput"!==n&&null!=(r=this.browsers[n])&&"function"==typeof r.updateEntry&&r.updateEntry(t,t.metadata),!0},e.prototype.showError=function(t,e){var r;return null==e&&(e=!1),r=this.composition[t+"ErrorMsg"]?this.composition[t+"ErrorMsg"]():t,this.notificator.notify(r,{timeout:1e4,onClick:e?function(t){return function(){return t.$trigger("Content:upgrade")}}(this):void 0})},e.prototype._onBrowserState=function(t,e){return this.$trigger("editor:content:browserState",e)},e.prototype.afterAdd=function(t){if(e.__super__.afterAdd.apply(this,arguments),t.options.pos)return this.tabs.el.children(":nth-child("+t.options.pos+")").before(t.tab.el)},e.prototype.release=function(){return this._release(this),e.__super__.release.apply(this,arguments)},e}(),t.exports=s},function(t,e,r){var n,i,o,s,a,u,l,c,p=function(t,e){return function(){return t.apply(e,arguments)}},h={}.hasOwnProperty;s=window.require("spine/controller"),i=window.require("spine/controller/container"),n=window.require("spine/controller/activateable"),l=r(5),o=window.require("core/models/content"),u=r(144),window.require("core/models/composition"),c=function(t){return function(e){return e.item.eql(t)}},a=function(t){function e(){this._onCompositionSave=p(this._onCompositionSave,this),this.activate=p(this.activate,this),this.active=p(this.active,this),this._release=p(this._release,this),this.onItemCreated=p(this.onItemCreated,this),this.new=p(this.new,this),this._new=p(this._new,this),this.contentItems=p(this.contentItems,this),e.__super__.constructor.apply(this,arguments),this.append.apply(this,this.contentItems()),this.delay(function(t){return function(){return t.new(),t.tab.el.attr("control",t.control.control),t._updateTabCount()}}(this)),this.listenTo(this.composition,"save",this._onCompositionSave),this.listenTo(o,"destroy",this.delay.bind(this,this.new))}return function(t,e){for(var r in e)h.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,s),e.prototype.className="directinput browser",e.prototype.title="directinput",e.prototype.serviceTitle="link",e.include(i),e.include(n),e.include(l),e.prototype.attributes={authenticated:!0},e.prototype.contentItems=function(){return this.composition.getContent().filter(function(t){var e,r;return!(null!=(e=t.metadata)?e.service:void 0)||"directinput"===(null!=(r=t.metadata)?r.service:void 0)}).map(function(t){return function(e){return new u({control:t.control,item:e})}}(this))},e.prototype.addEntry=function(t){var e;if(!this.children(c(t)).length)return this.append(e=new u({control:this.control,item:t})),this._getNewField().el.insertAfter(e.el),this._updateTabCount(),this.scroll().update(),this},e.prototype._new=function(t){return null!=this.field?this.field.enable():(this.item=new o({metadata:{service:"directinput"},composition_id:this.composition.id}),this.field=new u({control:this.control,item:this.item}),this.item.one("create",this.onItemCreated),this.append(this.field),this._updateTabCount(),this.scroll().update(),t?this.scroll().scrollTo("bottom",{inertia:!1}):void 0)},e.prototype.new=function(t){if(this._updateTabCount(),this._new(t),this.field.disable(),this.trigger("canAdd",this.field.enable,!0),!this._count())return this._new()},e.prototype.onItemCreated=function(){return this.item=this.field=null,this.new()},e.prototype._release=function(t){return i._release.apply(this,[t]),this._updateTabCount(),this.scroll().update()},e.prototype.active=function(){return n.active.apply(this,arguments),this.$trigger("editor:browser:active",{service:"directinput",authenticated:!1}),this.scroll().update()},e.prototype.activate=function(){if(n.activate.apply(this,arguments),null!=this.field)return this.field.disable(),this.trigger("canAdd",this.field.enable,!0)},e.prototype._updateTabCount=function(){var t;return null!=(t=this.tab)?t.count(this._count()):void 0},e.prototype._count=function(){return this.children(function(t){return!t.item.isNew()}).length},e.prototype._getNewField=function(){return this.children(function(t){return t.item.isNew()})[0]},e.prototype._onCompositionSave=function(t,e){var r;if(e.changedID)return null!=(r=this._getNewField())?r.item.composition_id=this.composition.id:void 0},e}(),t.exports=a},function(t,e){var r,n,i,o=function(t,e){return function(){return t.apply(e,arguments)}},s={}.hasOwnProperty;n=window.require("spine/controller"),r=window.require("spine/controller/container"),i=function(t){function e(){var t;this.onInputFocus=o(this.onInputFocus,this),this.disable=o(this.disable,this),this.enable=o(this.enable,this),e.__super__.constructor.apply(this,arguments),this.control=$.extend(!0,{},this.control),this.item.isNew()&&this.$addClass("new"),this.listenTo(this.item,"create",function(t){return function(){return t.$removeClass("new")}}(this)),this.listenTo(this.item,"destroy",this.release),t=window.require(this.control.control),this.control=new t({item:this.item,attribute:this.control.attribute,options:this.control.options}),this.append(this.control,"<span class='field-delete' data-icon='⏍'></span>")}return function(t,e){for(var r in e)s.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,n),e.prototype.className="directinput-field",e.prototype.title="directinput",e.include(r),e.prototype.elements={".field-delete":"del",input:"input"},e.prototype.events={"click .field-delete":"_delete","focus input":"onInputFocus","click .input-textarea":"onInputFocus"},e.prototype._delete=function(){return this.item.destroy()},e.prototype.enable=function(){return this.el.toggleClass("disabled",this.disabled=!1)},e.prototype.disable=function(){return this.el.toggleClass("disabled",this.disabled=!0)},e.prototype.onInputFocus=function(){if(this.parent().trigger("canAdd",function(){},!this.disabled),this.disabled)return this.input.blur()},e}(),t.exports=i},function(t,e){var r,n=function(t,e){return function(){return t.apply(e,arguments)}};r=function(){function t(){this._onClick=n(this._onClick,this),this.notify=n(this.notify,this),this.close=n(this.close,this),this.render=n(this.render,this),this.template=n(this.template,this),this.el=$('<div class="'+this.className+'">'),this.message="",this.el.on("click",".close",this.close),this.el.on("click",this._onClick)}return t.prototype.className="message notification",t.prototype.template=function(t){return"<div class='text'>"+t+"</div><div class='close' data-icon='x'></div>"},t.prototype.render=function(t){return this.message=null!=t?t:this.message,this.el.html(this.template(this.message))},t.prototype.close=function(t){return null!=t&&t.stopPropagation(),clearTimeout(this.interval),this.el.transition({top:-60,queue:!1}),this.el.trigger("editor:notification",{show:!1})},t.prototype.notify=function(t,e){return null==e&&(e={}),this.el.trigger("editor:notification",{show:!0}),this.render(t),clearTimeout(this.interval),this.clickAction=e.onClick,this.el.show().stop(!0,!1).transition({top:0},function(t){return function(){return t.interval=setTimeout(t.close,e.interval||3e3)}}(this))},t.prototype._onClick=function(t){return t.preventDefault(),"function"==typeof this.clickAction&&this.clickAction(),this.close(t)},t}(),t.exports=r},function(t,e,r){(function(t,n){var i;(function(o){"use strict";var s=0,a=Array.prototype.slice,u=function(t,e){var r=t[e];if(r===o&&A.strict)throw new Error("Bottle was unable to resolve a service. `"+e+"` is undefined.");return r},l=function(t){return this.nested[t]||(this.nested[t]=k.pop())},c=function(t){return t.split(".").reduce(u,this)},p=function(t,e){Object.defineProperty(this,t,{configurable:!1,enumerable:!0,value:e,writable:!1})},h=function(t,e){var r,n;return"function"==typeof t&&(e=t,t="__global__"),n=(r=t.split(".")).shift(),r.length?l.call(this,n).decorator(r.join("."),e):(this.decorators[n]||(this.decorators[n]=[]),this.decorators[n].push(e)),this},d=function(t,e){return v.call(this,t,function(){this.$get=e})},f=function(t){return!/^\$(?:decorator|register|list)$|Provider$/.test(t)},g=function(t){return Object.keys(t||this.container||{}).filter(f)},y={},_=function(t,e){return e(t)},v=function(t,e){var r,n;return r=t.split("."),this.providerMap[t]&&1===r.length&&!this.container[t+"Provider"]?console.error(t+" provider already instantiated."):(this.originalProviders[t]=e,this.providerMap[t]=!0,n=r.shift(),r.length?(w.call(this,n,e,r),this):b.call(this,n,e))},m=function(t,e){return(t[e]||[]).concat(t.__global__||[])},b=function(t,e){var r,n,i,s,a;return this.id,i=this.container,s=this.decorators,a=this.middlewares,r=t+"Provider",(n=Object.create(null))[r]={configurable:!0,enumerable:!0,get:function(){var t=new e;return delete i[r],i[r]=t,t}},n[t]={configurable:!0,enumerable:!0,get:function(){var e,n=i[r];return n&&(e=m(s,t).reduce(_,n.$get(i)),delete i[r],delete i[t]),e===o?e:function(t,e,r,n){var i={configurable:!0,enumerable:!0};return t.length?i.get=function(){var e=0,n=function(i){if(i)throw i;t[e]&&t[e++](r,n)};return n(),r}:(i.value=r,i.writable=!0),Object.defineProperty(n,e,i),n[e]}(m(a,t),t,e,i)}},Object.defineProperties(i,n),this},w=function(t,e,r){var n;return n=l.call(this,t),this.factory(t,function(){return n.container}),n.provider(r.join("."),e)},E=function(t){var e=t.$value===o?t:t.$value;return this[t.$type||"service"].apply(this,[t.$name,e].concat(t.$inject||[]))},P=function(t){delete this.providerMap[t],delete this.container[t],delete this.container[t+"Provider"]},S=function(t,e){var r=t[e];return r||(r={},x.call(t,e,r)),r},x=function(t,e){Object.defineProperty(this,t,{configurable:!0,enumerable:!0,value:e,writable:!0})},k=function t(e){if(!(this instanceof t))return t.pop(e);this.id=s++,this.decorators={},this.middlewares={},this.nested={},this.providerMap={},this.originalProviders={},this.deferred=[],this.container={$decorator:h.bind(this),$register:E.bind(this),$list:g.bind(this)}};k.prototype={constant:function(t,e){var r=t.split(".");return t=r.pop(),p.call(r.reduce(S,this.container),t,e),this},decorator:h,defer:function(t){return this.deferred.push(t),this},digest:function(t){return(t||[]).map(c,this.container)},factory:d,instanceFactory:function(t,e){return d.call(this,t,function(t){return{instance:e.bind(e,t)}})},list:g,middleware:function(t,e){var r,n;return"function"==typeof t&&(e=t,t="__global__"),n=(r=t.split(".")).shift(),r.length?l.call(this,n).middleware(r.join("."),e):(this.middlewares[n]||(this.middlewares[n]=[]),this.middlewares[n].push(e)),this},provider:v,resetProviders:function(){var t=this.originalProviders;Object.keys(this.originalProviders).forEach(function(e){var r=e.split(".");r.length>1&&(P.call(this,r[0]),r.forEach(P,l.call(this,r[0]))),P.call(this,e),this.provider(e,t[e])},this)},register:E,resolve:function(t){return this.deferred.forEach(function(e){e(t)}),this},service:function(t,e){var r=arguments.length>2?a.call(arguments,2):null,n=this;return d.call(this,t,function(){var t=e;if(r){var i=r.map(c,n.container);i.unshift(e),t=e.bind.apply(e,i)}return new t})},value:function(t,e){var r;return t=(r=t.split(".")).pop(),x.call(r.reduce(S,this.container),t,e),this}},k.pop=function(t){var e;return"string"==typeof t?((e=y[t])||(y[t]=e=new k,e.constant("BOTTLE_NAME",t)),e):new k},k.clear=function(t){"string"==typeof t?delete y[t]:y={}},k.list=g;var A=k.config={strict:!1},O={function:!0,object:!0};!function(s){var a=O[typeof e]&&e&&!e.nodeType&&e,u=O[typeof t]&&t&&!t.nodeType&&t,l=(u&&u.exports,O[typeof n]&&n);!l||l.global!==l&&l.window!==l||(s=l),s.Bottle=k,(i=function(){return k}.call(e,r,e,t))===o||(t.exports=i)}(O[typeof window]&&window||this)}).call(this)}).call(e,r(46)(t),r(12))},function(t,e,r){"use strict";var n=r(54),i=r(55),o=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}();var s=window.require("core/models/content"),a=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return r.userIsPremium=t.premium,r.events=["change","error"],s.on("change",r._broadcast.change),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,i["a"](n["a"])),o(e,[{key:"getItemsByService",value:function(t){return s.select(function(e){return!!e.metadata&&e.metadata.service===t})}},{key:"maxContentReached",value:function(t){var e=t.contentMeta(),r=this.userIsPremium?e.options.max:e.options.free_user_limit;return t.maxContentReached(r)}},{key:"toggleItem",value:function(t,e,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},s=this.getItemsByService(e).filter(function(t){return t.metadata.id===r}).pop();s?s.destroy():this.addItem(t,n,i,Object.assign({},o,{id:r,service:e}))}},{key:"clearContent",value:function(t,e){this.getItemsByService(e).forEach(function(t){return t.destroy()})}},{key:"addItem",value:function(t,e,r,n){var i=t.contentMeta();if(this.maxContentReached(t)&&i.options.max>1)throw this._broadcast.error(this.userIsPremium?"max":"maxFree"),new Error("Cannot add more than max items");this.maxContentReached(t)&&1===i.options.max&&s.select(function(e){return e.composition_id===t.id}).forEach(function(t){return t.destroy()}),new s(Object.assign({},r,function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}({composition_id:t.id,metadata:n},i.options.mainAttribute,e))).save()}}]),e}();e.a=a},function(t,e,r){"use strict";var n=r(54),i=r(55),o=r(114),s=r.n(o),a=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}();function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var l=function t(e){u(this,t),this.id=++t.guid,Object.assign(this,t.defaults,e)};l.defaults={lastModified:void 0,state:"complete",thumbnail:void 0,url:void 0,error:void 0,name:void 0,progress:0,size:0,type:"*",uploadFile:void 0},l.guid=0;var c=function(t){return t.indexOf("/")>0?t.slice(0,t.indexOf("/")):t},p=function(t){function e(t,r){u(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return n.user=t.id,n.token=r,n.refreshed={},n.files=[],n.maxFilesize=t.premium?250:25,n.chunkSize=90,n.quota=1e3*(t.premium?1e4:250)*1e3,n.used=0,n.events=["update","complete"],n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,i["a"](n["a"])),a(e,[{key:"getMaxFileSize",value:function(){return this.maxFilesize}},{key:"getChunkSize",value:function(){return this.chunkSize}},{key:"getUploadURL",value:function(){return"/upload?user="+this.user}},{key:"getAuthHeaders",value:function(){return{"w-utoken":this.token}}},{key:"getFiles",value:function(t){var e=this;return t=c(t),this.refreshed[t]?Promise.resolve(this.files.filter(function(e){return e.type===t})):this._fetch(t).then(function(t){return e.files.push.apply(e.files,t)}).then(this._broadcast.update).then(function(r){return e.files.filter(function(e){return e.type===t})})}},{key:"get",value:function(t){return this.files.filter(function(e){return e.id===t})[0]}},{key:"getUser",value:function(){return this.user}},{key:"upload",value:function(t){console.log("Uploads Service onUploadStart:",t);var e=new l({state:"new",size:t.size,name:t.name,type:c(t.type),lastModified:Date.now(),uploadFile:t});this.files.push(e),this.used+=t.size,this._broadcast.update()}},{key:"uploadComplete",value:function(t,e){if("error"!==t.status){var r=t.xhr&&t.xhr.response?t.xhr.response:"";if(!r)return console.error("Error parsing uploadComplete response:",error),this.setError(t,"Error uploading file!");var n=JSON.parse(r),i=n.files.data[0];this.used=n.quota.used,this._update(t,function(t){t.state="complete",t.id=i.id,t.path=i.path,t.url=n.hostUrl+i.path,t.lastModified=i.lastModified}),this._broadcast.complete([this.get(i.id),e])}}},{key:"accept",value:function(t,e){if(this.used<this.quota)return e();e("The file exceeds the quota by "+s.a(this.used-this.quota)+".")}},{key:"remove",value:function(t){this.files=this.files.filter(function(e){return e.id!==t.id}),this.used-=t.size,"complete"===t.state&&this._remove(t),this._broadcast.update()}},{key:"setThumbnail",value:function(t,e){console.log("Uploads Service setThumbnail:",t,e),this._update(t,function(t){return t.thumbnail=e})}},{key:"setError",value:function(t,e){this.used-=t.size,this._update(t,function(t){t.error=e,t.size=0})}},{key:"setUploadProgress",value:function(t,e,r){this._update(t,function(t){return t.progress=e})}},{key:"setUploadState",value:function(t,e){this._update(t,function(t){return t.state=e})}},{key:"_update",value:function(t,e){this.files=this.files.map(function(r){var n=r.uploadFile?r.uploadFile:r;return n.name===t.name&&n.size===t.size&&n.lastModified===t.lastModified&&e(r),r}),this._broadcast.update()}},{key:"_fetch",value:function(t){var e=this;return jQuery.ajax({url:"/upload/?user="+this.user+"&type="+t,headers:this.getAuthHeaders()}).then(function(r){return e.refreshed[t]=!0,e.used=r.quota.used,r.files.data.map(function(t){var e=c(t.mime),n=r.hostUrl+t.path,i="image"===e?n:void 0;return new l({id:t.id,type:e,url:n,thumbnail:i,path:t.path,name:t.name,size:t.size,lastModified:t.lastModified})})})}},{key:"_remove",value:function(t){return jQuery.ajax({method:"DELETE",url:"/upload/?user="+this.user+"&filePath="+t.path,headers:this.getAuthHeaders()}).then(function(t){}).then(this._broadcast.update).catch(console.error.bind(console))}}]),e}();e.a=p},function(t,e,r){"use strict";var n=r(54),i=r(55),o=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}();var s=function(t){function e(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var t=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.events=["state"],t.sounds={},t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,i["a"](n["a"])),o(e,[{key:"load",value:function(t,e){this.sounds[t]||this._initSound(t,e)}},{key:"getState",value:function(t){return this.sounds[t]?this.sounds[t].state:"uninitialized"}},{key:"togglePlay",value:function(t){this._isPlaying(t)?this.stop(t):this.play(t)}},{key:"play",value:function(t){if(!this.sounds[t])throw new Error("Sound must be loaded first");var e=this.sounds[t].sound;window.soundManager.stopAll(),this.sounds[t].state="loading",e.setPosition(0).play()}},{key:"stop",value:function(t){if(!this.sounds[t])throw new Error("Sound must be loaded first");this.sounds[t].sound.stop()}},{key:"_initSound",value:function(t,e){var r=this._onStatusChange.bind(this,t),n={url:e,volume:100,onpause:r,onstop:r,onresume:r,onfinish:r,onload:r,onplay:r};return this.sounds[t]={sound:window.soundManager.createSound(n),state:"paused"}}},{key:"_onStatusChange",value:function(t){this.sounds[t].state=this._isPlaying(t)?"playing":this._isLoading(t)?"loading":"paused",this._broadcast.state(t)}},{key:"_isPlaying",value:function(t){var e=this.sounds[t].sound;return!!e&&(!e.paused&&1===e.playState&&3===e.readyState)}},{key:"_isLoading",value:function(t){var e=this.sounds[t].sound;return!!e&&1===e.readyState}}]),e}();e.a=s},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(151),i=r(173),o=r(174),s=r(57),a=(r(115),r(16)),u=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var r=[],n=!0,i=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(n=(s=a.next()).done)&&(r.push(s.value),!e||r.length!==e);n=!0);}catch(t){i=!0,o=t}finally{try{!n&&a.return&&a.return()}finally{if(i)throw o}}return r}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){var t=0;return{data:function(){return{instanceId:++t,loading:!0,error:null,files:[],dragging:!1,filetypes:"*",deleteMode:!1,selected:[],selectedForDeletion:[],allowDelete:!0,allowClear:!0,uploadProgress:0}},helpers:{isSelected:function(t,e,r,n){return e?n.includes(t):r.includes(t)}},oncreate:function(){this.Uploads=this.refs.Uploads.instance(),this.set({maxFilesize:this.Uploads.getMaxFileSize()}),this.set({chunkSize:this.Uploads.getChunkSize()}),this.refresh(),this.scrollToListBottom()},ondestroy:function(){this.observer.cancel()},methods:{toggle:function(t){if(t.error)return this.Uploads.remove(t),this.refresh();this.get("deleteMode")?this._toggleDelete(t):this._toggleSelect(t)},activate:function(){this.refs.scrollPane&&(this.refs.scrollPane.update(),this.scrollToListBottom())},refresh:function(t){var e=this;return t&&t.preventDefault(),this.Uploads.getFiles(this.get("filetypes")).then(function(t){return t=t.sort(function(t,e){var r=t.lastModified;if(!r&&t.id){var n=t.id.indexOf("_u");n&&(r=t.id.substring(n+3))}r||(r=0);var i=e.lastModified;if(!i&&e.id){var o=e.id.indexOf("_u");o&&(i=e.id.substring(o+3))}return i||(i=0),r-i}),e.set({files:t})}).then(this.activate.bind(this)).catch(this._reportError.bind(this)).then(function(t){e.set({loading:!1,error:null}),e.scrollToListBottom()})},deleteSelected:function(){var t=this,e=this.get("selected");this.get("selectedForDeletion").forEach(function(r){var n=t.Uploads.get(r);e.includes(r)&&t._toggleSelect(n),t.Uploads.remove(n)}),this.set({deleteMode:!1,selectedForDeletion:[]})},_toggleSelect:function(t,e){this.fire("toggle",{file:t,options:e})},_toggleDelete:function(t){var e=this.get("selectedForDeletion");e.includes(t.id)?e=e.filter(function(e){return e!==t.id}):e.push(t.id),this.set({selectedForDeletion:e})},_reportError:function(t){var e=t;"string"==typeof t&&(e={message:t}),t.jqXHR&&(e={message:t.jqXHR.statusText+" ("+t.jqXHR.responseText+")"}),console.error(t),this.set({error:e}),this.fire("error",e)},_onDropZoneUploadStart:function(t){this.scrollToListBottom()},scrollToListBottom:function(){this.refs.scrollPane&&this.refs.scrollPane.scrollBottom()},_onDropZoneUploadToggle:function(t){console.log("Editor DropZone Upload Toggle:",t),this.toggle(t)},_onUploadsUpdate:function(t){this.refresh()},_onUploadComplete:function(t){var e=u(t,2),r=e[0];e[1]===this.get("instanceId")&&this._toggleSelect(r,{afterUpload:!0})}}}}();function c(t,e){var r,n,i,o;return{create:function(){r=a.e("span"),i=a.g(n=t.selectedForDeletion.length),o=a.g(" files selected for removal")},mount:function(t,e){a.l(r,t,e),a.b(i,r),a.b(o,r)},update:function(t,e){n!==(n=e.selectedForDeletion.length)&&(i.data=n)},unmount:function(){a.i(r)},destroy:a.m}}function p(t,e){var r,n;return{create:function(){r=a.e("span"),n=a.g("Select files to be removed from the server")},mount:function(t,e){a.l(r,t,e),a.b(n,r)},update:a.m,unmount:function(){a.i(r)},destroy:a.m}}function h(t,e){var r;function n(t){e.set({deleteMode:!0})}return{create:function(){r=a.e("div"),this.hydrate()},hydrate:function(t){r.className="browser-logout",a.p(r,"data-tooltip-text","Permanently remove files from server"),a.p(r,"data-tooltip-position","80% 3%"),a.p(r,"data-icon","⏍"),a.a(r,"click",n)},mount:function(t,e){a.l(r,t,e)},unmount:function(){a.i(r)},destroy:function(){a.o(r,"click",n)}}}function d(t,e){var r,n,i,o;function s(t){e.fire("clearContent")}return{create:function(){r=a.e("div"),n=a.f("svg"),i=a.f("path"),o=a.f("path"),this.hydrate()},hydrate:function(t){r.className="browser-logout clear-content",a.p(r,"data-tooltip-text","Clear Content"),a.a(r,"click",s),a.p(n,"xmlns","http://www.w3.org/2000/svg"),a.p(n,"viewBox","0 0 512 512"),a.p(i,"d","M490.667 85.333h-64v-64C426.667 9.551 417.115 0 405.333 0h-384C9.551 0 0 9.551 0 21.333V448c0 11.782 9.551 21.333 21.333 21.333h64v21.333c0 11.782 9.551 21.333 21.333 21.333h384c11.782 0 21.333-9.551 21.333-21.333v-384c.001-11.781-9.55-21.333-21.332-21.333zm-448 341.334v-384H384v42.667H106.667c-11.782 0-21.333 9.551-21.333 21.333v320H42.667zm426.666 42.666H128V128h341.333v341.333z"),a.p(o,"d","M389.176 208.158c-8.331-8.331-21.839-8.331-30.17 0l-60.339 60.339-60.339-60.339c-8.331-8.331-21.839-8.331-30.17 0s-8.331 21.839 0 30.17l60.339 60.339-60.339 60.339c-8.331 8.331-8.331 21.839 0 30.17s21.839 8.331 30.17 0l60.339-60.339 60.339 60.339c8.331 8.331 21.839 8.331 30.17 0s8.331-21.839 0-30.17l-60.339-60.339 60.339-60.339c8.331-8.332 8.331-21.839 0-30.17z")},mount:function(t,e){a.l(r,t,e),a.b(n,r),a.b(i,n),a.b(o,n)},unmount:function(){a.i(r)},destroy:function(){a.o(r,"click",s)}}}function f(t,e){var r,n,i,o,s;function u(t){e.deleteSelected()}function l(t){e.set({deleteMode:!1,selectedForDeletion:[]})}function h(t){return t.selectedForDeletion.length?c:p}var d=h(t),f=d(t,e);return{create:function(){r=a.e("div"),n=a.g("\n "),i=a.e("div"),o=a.g("\n "),f.create(),s=a.d(),this.hydrate()},hydrate:function(t){r.className="browser-logout",a.p(r,"data-tooltip-text","Permanently remove selected files from server (action cannot be undone)"),a.p(r,"data-tooltip-position","80% 3%"),a.p(r,"data-icon","✓"),a.a(r,"click",u),i.className="browser-logout",a.p(i,"data-tooltip-text","Cancel action"),a.p(i,"data-icon","x"),a.a(i,"click",l)},mount:function(t,e){a.l(r,t,e),a.l(n,t,e),a.l(i,t,e),a.l(o,t,e),f.mount(t,e),a.l(s,t,e)},update:function(t,r){d===(d=h(r))&&f?f.update(t,r):(f.unmount(),f.destroy(),(f=d(r,e)).create(),f.mount(s.parentNode,s))},unmount:function(){a.i(r),a.i(n),a.i(i),a.i(o),f.unmount(),a.i(s)},destroy:function(){a.o(r,"click",u),a.o(i,"click",l),f.destroy()}}}function g(t,e){var r,n,i=t.allowDelete&&h(0,e),o=t.allowClear&&d(0,e);return{create:function(){i&&i.create(),r=a.g("\n "),o&&o.create(),n=a.d()},mount:function(t,e){i&&i.mount(t,e),a.l(r,t,e),o&&o.mount(t,e),a.l(n,t,e)},update:function(t,s){s.allowDelete?i||((i=h(0,e)).create(),i.mount(r.parentNode,r)):i&&(i.unmount(),i.destroy(),i=null),s.allowClear?o||((o=d(0,e)).create(),o.mount(n.parentNode,n)):o&&(o.unmount(),o.destroy(),o=null)},unmount:function(){i&&i.unmount(),a.i(r),o&&o.unmount(),a.i(n)},destroy:function(){i&&i.destroy(),o&&o.destroy()}}}function y(t,e,r,n,i){var s=new o.a({_root:i._root,data:{file:r,selected:l.helpers.isSelected(r.id,t.deleteMode,t.selected,t.selectedForDeletion),selectedIcon:t.deleteMode?"delete":"check"}});return s.on("select",function(t){i.toggle(t)}),{create:function(){s._fragment.create()},mount:function(t,e){s._fragment.mount(t,e)},update:function(t,e,r,n,i){var o={};"files"in t&&(o.file=n),("files"in t||"deleteMode"in t||"selected"in t||"selectedForDeletion"in t)&&(o.selected=l.helpers.isSelected(n.id,e.deleteMode,e.selected,e.selectedForDeletion)),"deleteMode"in t&&(o.selectedIcon=e.deleteMode?"delete":"check"),Object.keys(o).length&&s.set(o)},unmount:function(){s._fragment.unmount()},destroy:function(){s.destroy(!1)}}}function _(t,e){var r=function(t,e){for(var r,n=t.files,i=[],o=0;o<n.length;o+=1)i[o]=y(t,0,n[o],0,e);return{create:function(){for(var t=0;t<i.length;t+=1)i[t].create();r=a.d()},mount:function(t,e){for(var n=0;n<i.length;n+=1)i[n].mount(t,e);a.l(r,t,e)},update:function(t,n){var o=n.files;if("files"in t||"deleteMode"in t||"selected"in t||"selectedForDeletion"in t){for(var s=0;s<o.length;s+=1)i[s]?i[s].update(t,n,o,o[s],s):(i[s]=y(n,0,o[s],0,e),i[s].create(),i[s].mount(r.parentNode,r));for(;s<i.length;s+=1)i[s].unmount(),i[s].destroy();i.length=o.length}},unmount:function(){for(var t=0;t<i.length;t+=1)i[t].unmount();a.i(r)},destroy:function(){a.h(i,!1,0)}}}(t,e),n=new i.a({_root:e._root,_yield:r,data:{class:"content-list"}});return e.refs.scrollPane=n,{create:function(){r.create(),n._fragment.create()},mount:function(t,e){n._fragment.mount(t,e)},update:function(t,e){r.update(t,e)},unmount:function(){n._fragment.unmount()},destroy:function(){e.refs.scrollPane===n&&(e.refs.scrollPane=null),r.destroy(),n.destroy(!1)}}}function v(t,e){var r,n,i,o,s,u,l,c,p,h,d,f;return{create:function(){r=a.e("div"),n=a.e("h2"),i=a.g("Hey there!"),o=a.g("\n "),s=a.e("h3"),u=a.g("You haven't uploaded any "),c=a.g(l=t.filetypes),p=a.g(" files yet."),h=a.g("\n "),d=a.e("span"),f=a.g("Drag some over or click below!"),this.hydrate()},hydrate:function(t){r.className="error-panel",r.style.cssText="height: 100%",n.className="blogvio-browser-title"},mount:function(t,e){a.l(r,t,e),a.b(n,r),a.b(i,n),a.b(o,r),a.b(s,r),a.b(u,s),a.b(c,s),a.b(p,s),a.b(h,r),a.b(d,r),a.b(f,d)},update:function(t,e){l!==(l=e.filetypes)&&(c.data=l)},unmount:function(){a.i(r)},destroy:a.m}}function m(t,e){var r,n,i,o,s,u,l,c,p,h,d,f,g,y,_,v,m;function b(t){e.refresh(t)}return{create:function(){r=a.e("div"),n=a.e("h2"),i=a.g("Failed to load uploaded files."),o=a.g("\n "),s=a.e("p"),l=a.g(u=t.error.message),c=a.g("\n "),p=a.e("a"),h=a.g("Click here to try again"),d=a.e("br"),f=a.g("\n "),g=a.e("span"),y=a.g("or "),_=a.e("a"),v=a.g("contact support"),m=a.g(" if the error persists."),this.hydrate()},hydrate:function(t){a.p(r,"svelte-2398355497",""),r.className="error-panel",n.className="blogvio-browser-title",p.href="#",a.a(p,"click",b),_.href="mailto:support@widgetic.com"},mount:function(t,e){a.l(r,t,e),a.b(n,r),a.b(i,n),a.b(o,r),a.b(s,r),a.b(l,s),a.b(c,r),a.b(p,r),a.b(h,p),a.b(d,r),a.b(f,r),a.b(g,r),a.b(y,g),a.b(_,g),a.b(v,_),a.b(m,g)},update:function(t,e){u!==(u=e.error.message)&&(l.data=u)},unmount:function(){a.i(r)},destroy:function(){a.o(p,"click",b)}}}function b(t,e){var r,i,o,s,u,l,c,p,h;function d(t){return t.deleteMode?f:g}var y=d(t),m=y(t,e);function b(t){return t.files.length?_:v}var w=b(t),E=w(t,e),P=new n.a({_root:e._root,data:{filetypes:t.filetypes+"/*",maxFilesize:t.maxFilesize,chunkSize:t.chunkSize,instanceId:t.instanceId}});return P.on("new",function(t){e._onDropZoneUploadStart(t)}),P.on("upload",function(t){e._onDropZoneUploadToggle(t)}),P.on("dragging",function(t){e.set({dragging:t})}),P.on("error",function(t){e.fire("error",t)}),e.refs.dropzone=P,{create:function(){r=a.e("div"),m.create(),i=a.g("\n "),o=a.e("section"),u=a.g("\n "),E.create(),l=a.g("\n\n\n \n "),c=a.e("div"),h=a.g("\n "),P._fragment.create(),this.hydrate()},hydrate:function(e){a.p(r,"svelte-2398355497",""),r.className="browser-nav",a.p(o,"svelte-2398355497",""),o.className=s=t.dragging?"dropzone--dragging":"",c.className=p="dropzone_plchldr "+(t.files.length?"":"dropzone--large")},mount:function(t,e){a.l(r,t,e),m.mount(r,null),a.l(i,t,e),a.l(o,t,e),a.b(u,o),E.mount(o,null),a.b(l,o),a.b(c,o),a.b(h,c),P._fragment.mount(c,null)},update:function(t,n){y===(y=d(n))&&m?m.update(t,n):(m.unmount(),m.destroy(),(m=y(n,e)).create(),m.mount(r,null)),s!==(s=n.dragging?"dropzone--dragging":"")&&(o.className=s),w===(w=b(n))&&E?E.update(t,n):(E.unmount(),E.destroy(),(E=w(n,e)).create(),E.mount(o,l)),p!==(p="dropzone_plchldr "+(n.files.length?"":"dropzone--large"))&&(c.className=p);var i={};"filetypes"in t&&(i.filetypes=n.filetypes+"/*"),"maxFilesize"in t&&(i.maxFilesize=n.maxFilesize),"chunkSize"in t&&(i.chunkSize=n.chunkSize),"instanceId"in t&&(i.instanceId=n.instanceId),Object.keys(i).length&&P.set(i)},unmount:function(){a.i(r),m.unmount(),a.i(i),a.i(o),E.unmount()},destroy:function(){m.destroy(),E.destroy(),e.refs.dropzone===P&&(e.refs.dropzone=null),P.destroy(!1)}}}function w(t,e){var r;function n(t){return t.error?m:b}var i=n(t),o=i(t,e);return{create:function(){o.create(),r=a.d()},mount:function(t,e){o.mount(t,e),a.l(r,t,e)},update:function(t,s){i===(i=n(s))&&o?o.update(t,s):(o.unmount(),o.destroy(),(o=i(s,e)).create(),o.mount(r.parentNode,r))},unmount:function(){o.unmount(),a.i(r)},destroy:function(){o.destroy()}}}function E(t){t=t||{},this.refs={},this._state=a.c(l.data(),t.data),this._observers={pre:Object.create(null),post:Object.create(null)},this._handlers=Object.create(null),this._root=t._root||this,this._yield=t._yield,this._torndown=!1,document.getElementById("svelte-2398355497-style")||function(){var t=a.e("style");t.id="svelte-2398355497-style",t.textContent='\n section[svelte-2398355497], [svelte-2398355497] section {\n display: flex;\n flex-direction: column;\n padding-left: 20px;\n height: calc(100% - 25px);\n color: #665b68;\n }\n\n a[svelte-2398355497]:focus, [svelte-2398355497] a:focus {\n outline: none;\n }\n\n [svelte-2398355497].error-panel, [svelte-2398355497] .error-panel {\n position: relative;\n top: 50%;\n transform: translateY(-50%);\n text-align: center;\n padding-right: 20px;\n }\n\n [svelte-2398355497].browser-nav, [svelte-2398355497] .browser-nav {\n position: static;\n\n font-family: ProximaNova-Regular;\n font-size: 16px;\n color: #0055FF;\n }\n\n [svelte-2398355497].blogvio-browser-title, [svelte-2398355497] .blogvio-browser-title {\n margin-top: 0;\n font: 30px/60px "ProximaNova-Regular";\n color: #0055FF;\n }\n\n [svelte-2398355497].nano, [svelte-2398355497] .nano {\n flex: 1;\n }\n\n strong[svelte-2398355497], [svelte-2398355497] strong {\n color: #0055FF;\n }\n\n [svelte-2398355497].dropzone_plchldr, [svelte-2398355497] .dropzone_plchldr {\n position: relative;\n margin: 20px 20px 20px 0;\n height: 75px;\n }\n\n [svelte-2398355497].dropzone, [svelte-2398355497] .dropzone {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 22px;\n }\n [svelte-2398355497].upload-input, [svelte-2398355497] .upload-input {\n \n }\n\n [svelte-2398355497].scrolling-container, [svelte-2398355497] .scrolling-container {\n transition: opacity 200ms ease-in;\n }\n\n [svelte-2398355497].dropzone--dragging .scrolling-container, [svelte-2398355497] .dropzone--dragging .scrolling-container {\n opacity: 0.4;\n }\n\n [svelte-2398355497].dropzone--dragging .dropzone, [svelte-2398355497] .dropzone--dragging .dropzone {\n top: -100px;\n }\n\n [svelte-2398355497].dropzone--large .dropzone, [svelte-2398355497] .dropzone--large .dropzone,\n [svelte-2398355497].dropzone--dragging .dropzone--large .dropzone, [svelte-2398355497] .dropzone--dragging .dropzone--large .dropzone {\n top: -200px;\n }\n\n [svelte-2398355497].icon, [svelte-2398355497] .icon {\n display: inline-block;\n width: 1em;\n height: 1em;\n stroke-width: 0;\n stroke: currentColor;\n fill: currentColor\n }\n\n [svelte-2398355497].clear-content svg, [svelte-2398355497] .clear-content svg {\n width: 14px;\n fill: #a0a0a0;\n position: relative;\n top: 1px;\n right: 2px;\n }\n\n [svelte-2398355497].clear-content:hover svg, [svelte-2398355497] .clear-content:hover svg {\n fill: #665b68;\n }\n',a.b(t,document.head)}(),this._renderHooks=[],this._fragment=function(t,e){var r,n,i,o,u,l,c,p,h,d,f,g,y,_=new s.a({_root:e._root,data:{service:"Uploads"}});_.on("update",function(t){e._onUploadsUpdate(t)}),_.on("complete",function(t){e._onUploadComplete(t)}),e.refs.Uploads=_;var v=!t.loading&&w(t,e);return{create:function(){_._fragment.create(),r=a.g("\n\n"),n=a.f("svg"),i=a.f("symbol"),o=a.f("title"),u=a.g("upload"),l=a.f("path"),c=a.f("path"),p=a.f("symbol"),h=a.f("title"),d=a.g("error"),f=a.f("path"),g=a.g("\n\n"),v&&v.create(),y=a.d(),this.hydrate()},hydrate:function(t){a.p(n,"svelte-2398355497",""),a.p(n,"style","position: absolute; width: 0; height: 0; overflow: hidden"),a.p(n,"version","1.1"),a.p(n,"xmlns","http://www.w3.org/2000/svg"),a.p(n,"xmlns:xlink","http://www.w3.org/1999/xlink"),a.p(i,"id","icon-upload"),a.p(i,"viewBox","0 0 32 32"),a.p(l,"d","M30.038 19.938c-0.706 0-1.275 0.569-1.275 1.275v7.544h-25.525v-7.544c0-0.706-0.569-1.275-1.275-1.275s-1.275 0.569-1.275 1.275v8.825c0 0.706 0.569 1.275 1.275 1.275h28.075c0.706 0 1.275-0.569 1.275-1.275v-8.825c0-0.706-0.569-1.275-1.275-1.275z"),a.p(c,"d","M9.137 10.625l5.588-5.581v16.194c0 0.706 0.569 1.275 1.275 1.275s1.275-0.569 1.275-1.275v-16.194l5.587 5.581c0.769 0.713 1.556 0.25 1.806 0 0.5-0.5 0.5-1.306 0-1.806l-7.769-7.756c-0.5-0.5-1.306-0.5-1.806 0l-7.756 7.756c-0.5 0.5-0.5 1.306 0 1.806 0.494 0.5 1.306 0.5 1.8 0z"),a.p(p,"id","icon-error"),a.p(p,"viewBox","0 0 21.9 21.9"),a.p(f,"d","M14.1 11.3c-.2-.2-.2-.5 0-.7l7.5-7.5c.2-.2.3-.5.3-.7s-.1-.5-.3-.7L20.2.3c-.2-.2-.5-.3-.7-.3-.3 0-.5.1-.7.3l-7.5 7.5c-.2.2-.5.2-.7 0L3.1.3C2.9.1 2.6 0 2.4 0s-.5.1-.7.3L.3 1.7c-.2.2-.3.5-.3.7s.1.5.3.7l7.5 7.5c.2.2.2.5 0 .7L.3 18.8c-.2.2-.3.5-.3.7s.1.5.3.7l1.4 1.4c.2.2.5.3.7.3s.5-.1.7-.3l7.5-7.5c.2-.2.5-.2.7 0l7.5 7.5c.2.2.5.3.7.3s.5-.1.7-.3l1.4-1.4c.2-.2.3-.5.3-.7s-.1-.5-.3-.7l-7.5-7.5z"),a.p(f,"fill","#de2618")},mount:function(t,e){_._fragment.mount(t,e),a.l(r,t,e),a.l(n,t,e),a.b(i,n),a.b(o,i),a.b(u,o),a.b(l,i),a.b(c,i),a.b(p,n),a.b(h,p),a.b(d,h),a.b(f,p),a.l(g,t,e),v&&v.mount(t,e),a.l(y,t,e)},update:function(t,r){r.loading?v&&(v.unmount(),v.destroy(),v=null):v?v.update(t,r):((v=w(r,e)).create(),v.mount(y.parentNode,y))},unmount:function(){_._fragment.unmount(),a.i(r),a.i(n),a.i(g),v&&v.unmount(),a.i(y)},destroy:function(){e.refs.Uploads===_&&(e.refs.Uploads=null),_.destroy(!1),v&&v.destroy()}}}(this._state,this),t.target&&(this._fragment.create(),this._fragment.mount(t.target,null)),this._flush(),t._root?t._root._renderHooks.push(l.oncreate.bind(this)):l.oncreate.call(this)}a.c(E.prototype,l.methods,a.n),E.prototype._set=function(t){var e=this._state;this._state=a.c({},e,t),a.k(this,this._observers.pre,t,e),this._fragment.update(t,this._state),a.k(this,this._observers.post,t,e),this._flush()},E.prototype.teardown=E.prototype.destroy=function(t){this.fire("destroy"),l.ondestroy.call(this),!1!==t&&this._fragment.unmount(),this._fragment.destroy(),this._fragment=null,this._state={},this._torndown=!0},e.default=E},function(t,e,r){"use strict";var n=r(152),i=r.n(n),o=r(57),s=r(114),a=r.n(s),u=r(115),l=r(16);function c(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function p(t,e,r,n){(n||"quota"in e&&l.j(t.quota,r.quota))&&(t.prettyQuota=e.prettyQuota=h.computed.prettyQuota(t.quota)),(n||"used"in e&&l.j(t.used,r.used))&&(t.prettyUsed=e.prettyUsed=h.computed.prettyUsed(t.used))}var h={data:function(){return{filetypes:"*",used:0,quota:0,uploading:{total:0,now:0},dragging:!1,maxFilesize:10,chunkSize:0,instanceId:0}},computed:{prettyQuota:function(t){return a.a(t)},prettyUsed:function(t){return a.a(t)}},oncreate:function(){var t;this.Uploads=this.refs.Uploads.instance(),this.set({quota:this.Uploads.quota,used:this.Uploads.used});var e=!this.get("chunkSize");this.dropzone=new i.a(this.refs.dropzone,{acceptedFiles:this.get("filetypes")||"application/offset+octet",url:this.Uploads.getUploadURL(),headers:this.Uploads.getAuthHeaders(),accept:this.Uploads.accept.bind(this.Uploads),uploadMultiple:!1,maxFilesize:this.get("maxFilesize"),autoProcessQueue:e});var r=(c(t={dragenter:this._onDragEnter.bind(this),dragleave:this._onDragLeave.bind(this),drop:this._onDragLeave.bind(this),addedfile:this._onUploadStart.bind(this),thumbnail:this._onThumbnail.bind(this),error:this._onError.bind(this),uploadprogress:this._onUploadProgress.bind(this),processing:this._updateFileState.bind(this,"processing"),sending:this._updateFileState.bind(this,"sending"),success:this._updateFileState.bind(this,"success"),complete:this._updateFileState.bind(this,"complete"),canceled:this._updateFileState.bind(this,"canceled")},"complete",this._onUploadComplete.bind(this)),c(t,"totaluploadprogress",this._onTotalUploadProgress.bind(this)),c(t,"queuecomplete",this._onQueueComplete.bind(this)),t);for(var n in r)this.dropzone.on(n,r[n])},methods:{_onDragEnter:function(){this.set({dragging:!0}),this.fire("dragging",!0)},_onDragLeave:function(){this.set({dragging:!1}),this.fire("dragging",!1)},_onUploadStart:function(t){var e=this;console.log("Dropzone _onUploadStart file:",t);var r=this.get("chunkSize");if(console.log("Dropzone _onUploadStart TUS endpoint:",this.Uploads.getUploadURL()),r){var n=new u.a(t,{endpoint:this.Uploads.getUploadURL(),headers:this.Uploads.getAuthHeaders(),retryDelays:[0,3e3,5e3,1e4,2e4],chunkSize:1024*r*1024,metadata:{filename:t.name,filetype:t.type},onError:function(r){e._onError(t,r)},onProgress:function(r,n){var i=r/n*100;e._onUploadProgress(t,i,r)},onSuccess:function(r){if(""==n._req._xhr.response)console.log("Dropzone TUS Client Upload Complete to server for file:",n),e._updateFileState("sending",t);else{console.log("Dropzone TUS Client Upload Complete to B2 with response:",n._req._xhr.response);var i=n.file;i.xhr=n._req._xhr,e._onUploadComplete(i)}}});n.start()}this.fire("new",t),this.Uploads.upload(t),this._updateFileState("sending",t)},_onThumbnail:function(t,e){this.Uploads.setThumbnail(t,e)},_onError:function(t,e){this.fire("error",{message:e}),this.Uploads.setError(t,e)},_onUploadProgress:function(t,e,r){this.Uploads.setUploadProgress(t,e,r)},_onUploadComplete:function(t){this.Uploads.uploadComplete(t,this.get("instanceId"))},_updateFileState:function(t,e){this.Uploads.setUploadState(e,t)},_onTotalUploadProgress:function(){var t=this.dropzone.getAcceptedFiles().length,e=this.dropzone.getQueuedFiles().length,r=(this.dropzone.getUploadingFiles().length,t-e);this.set({uploading:{total:t,now:r}})},_onQueueComplete:function(){this.dropzone.removeAllFiles()},_onUploadsUpdate:function(){this.set({quota:this.Uploads.quota,used:this.Uploads.used})}}};function d(t,e){var r,n,i,o,s,a,u;return{create:function(){r=l.e("strong"),n=l.g("Uploading "),o=l.g(i=t.uploading.now),s=l.g(" / "),u=l.g(a=t.uploading.total)},mount:function(t,e){l.l(r,t,e),l.b(n,r),l.b(o,r),l.b(s,r),l.b(u,r)},update:function(t,e){i!==(i=e.uploading.now)&&(o.data=i),a!==(a=e.uploading.total)&&(u.data=a)},unmount:function(){l.i(r)},destroy:l.m}}function f(t,e){var r,n,i,o,s,a,u,c,p,h,d,f,g,y;return{create:function(){r=l.f("svg"),n=l.f("use"),i=l.g("\n "),o=l.e("br"),s=l.g("\n "),a=l.e("span"),u=l.e("strong"),p=l.g(c=t.prettyUsed),h=l.g(" out of "),d=l.e("strong"),g=l.g(f=t.prettyQuota),y=l.g(" used."),this.hydrate()},hydrate:function(t){l.p(r,"class","icon icon-upload"),l.q(n,"xlink:href","#icon-upload")},mount:function(t,e){l.l(r,t,e),l.b(n,r),l.l(i,t,e),l.l(o,t,e),l.l(s,t,e),l.l(a,t,e),l.b(u,a),l.b(p,u),l.b(h,a),l.b(d,a),l.b(g,d),l.b(y,a)},update:function(t,e){c!==(c=e.prettyUsed)&&(p.data=c),f!==(f=e.prettyQuota)&&(g.data=f)},unmount:function(){l.i(r),l.i(i),l.i(o),l.i(s),l.i(a)},destroy:l.m}}function g(t){t=t||{},this.refs={},this._state=l.c(h.data(),t.data),p(this._state,this._state,{},!0),this._observers={pre:Object.create(null),post:Object.create(null)},this._handlers=Object.create(null),this._root=t._root||this,this._yield=t._yield,this._torndown=!1,document.getElementById("svelte-2786463615-style")||function(){var t=l.e("style");t.id="svelte-2786463615-style",t.textContent='\n [svelte-2786463615].dropzone, [svelte-2786463615] .dropzone {\n display: flex;\n align-items: center;\n justify-content: center;\n\n background: #fff;\n border: 1px dashed #b8b8b8;\n\n font-size: 14px;\n font-family: "ProximaNova-Regular";\n text-align: center;\n cursor: pointer;\n\n transition: top 300ms ease-in, background 150ms ease-in 50ms;\n }\n\n [svelte-2786463615].dropzone_stats, [svelte-2786463615] .dropzone_stats {\n pointer-events: none;\n }\n\n [svelte-2786463615].dropzone_stats span, [svelte-2786463615] .dropzone_stats span {\n transition: opacity 150ms ease-in 150ms;\n }\n\n [svelte-2786463615].dropzone:hover, [svelte-2786463615] .dropzone:hover {\n border-color: #888;\n }\n\n [svelte-2786463615].dropzone.dropzone--dragging, [svelte-2786463615] .dropzone.dropzone--dragging,\n [svelte-2786463615].dropzone:hover, [svelte-2786463615] .dropzone:hover {\n background: #f4f5f8;\n }\n\n [svelte-2786463615].dropzone--dragging .dropzone_stats span, [svelte-2786463615] .dropzone--dragging .dropzone_stats span {\n opacity: 0;\n transition: opacity 150ms ease-in;\n }\n\n [svelte-2786463615].dropzone--dragging .dropzone_stats .icon, [svelte-2786463615] .dropzone--dragging .dropzone_stats .icon {\n transform: scale(3) translateY(20%);\n }\n\n [svelte-2786463615].dz-message, [svelte-2786463615] .dz-message, [svelte-2786463615].dz-preview, [svelte-2786463615] .dz-preview {\n display: none\n }\n\n [svelte-2786463615].icon, [svelte-2786463615] .icon {\n fill: #929292;\n transition: transform 300ms ease-in;\n }\n',l.b(t,document.head)}(),this._renderHooks=[],this._fragment=function(t,e){var r,n,i,s,a=new o.a({_root:e._root,data:{service:"Uploads"}});function u(t){return t.uploading.total>0?d:f}a.on("update",function(t){e._onUploadsUpdate()}),e.refs.Uploads=a;var c=u(t),p=c(t,e);return{create:function(){a._fragment.create(),r=l.g("\n\n"),n=l.e("div"),s=l.e("div"),p.create(),this.hydrate()},hydrate:function(e){l.p(n,"svelte-2786463615",""),n.className=i="dropzone "+(t.dragging?"dropzone--dragging":""),s.className="dropzone_stats"},mount:function(t,i){a._fragment.mount(t,i),l.l(r,t,i),l.l(n,t,i),e.refs.dropzone=n,l.b(s,n),p.mount(s,null)},update:function(t,r){i!==(i="dropzone "+(r.dragging?"dropzone--dragging":""))&&(n.className=i),c===(c=u(r))&&p?p.update(t,r):(p.unmount(),p.destroy(),(p=c(r,e)).create(),p.mount(s,null))},unmount:function(){a._fragment.unmount(),l.i(r),l.i(n),e.refs.dropzone===n&&(e.refs.dropzone=null),p.unmount()},destroy:function(){e.refs.Uploads===a&&(e.refs.Uploads=null),a.destroy(!1),p.destroy()}}}(this._state,this),t.target&&(this._fragment.create(),this._fragment.mount(t.target,null)),this._flush(),t._root?t._root._renderHooks.push(h.oncreate.bind(this)):h.oncreate.call(this)}l.c(g.prototype,h.methods,l.n),g.prototype._set=function(t){var e=this._state;this._state=l.c({},e,t),p(this._state,t,e,!1),l.k(this,this._observers.pre,t,e),this._fragment.update(t,this._state),l.k(this,this._observers.post,t,e),this._flush()},g.prototype.teardown=g.prototype.destroy=function(t){this.fire("destroy"),!1!==t&&this._fragment.unmount(),this._fragment.destroy(),this._fragment=null,this._state={},this._torndown=!0},e.a=g},function(t,e,r){(function(t){(function(){var e,r,n,i,o,s,a,u,l=[].slice,c={}.hasOwnProperty;a=function(){},r=function(){function t(){}return t.prototype.addEventListener=t.prototype.on,t.prototype.on=function(t,e){return this._callbacks=this._callbacks||{},this._callbacks[t]||(this._callbacks[t]=[]),this._callbacks[t].push(e),this},t.prototype.emit=function(){var t,e,r,n,i;if(r=arguments[0],t=2<=arguments.length?l.call(arguments,1):[],this._callbacks=this._callbacks||{},e=this._callbacks[r])for(n=0,i=e.length;n<i;n++)e[n].apply(this,t);return this},t.prototype.removeListener=t.prototype.off,t.prototype.removeAllListeners=t.prototype.off,t.prototype.removeEventListener=t.prototype.off,t.prototype.off=function(t,e){var r,n,i,o;if(!this._callbacks||0===arguments.length)return this._callbacks={},this;if(!(r=this._callbacks[t]))return this;if(1===arguments.length)return delete this._callbacks[t],this;for(n=i=0,o=r.length;i<o;n=++i)if(r[n]===e){r.splice(n,1);break}return this},t}(),(e=function(t){var e,n;function i(t,r){var n,o,s;if(this.element=t,this.version=i.version,this.defaultOptions.previewTemplate=this.defaultOptions.previewTemplate.replace(/\n*/g,""),this.clickableElements=[],this.listeners=[],this.files=[],"string"==typeof this.element&&(this.element=document.querySelector(this.element)),!this.element||null==this.element.nodeType)throw new Error("Invalid dropzone element.");if(this.element.dropzone)throw new Error("Dropzone already attached.");if(i.instances.push(this),this.element.dropzone=this,n=null!=(s=i.optionsForElement(this.element))?s:{},this.options=e({},this.defaultOptions,n,null!=r?r:{}),this.options.forceFallback||!i.isBrowserSupported())return this.options.fallback.call(this);if(null==this.options.url&&(this.options.url=this.element.getAttribute("action")),!this.options.url)throw new Error("No URL provided.");if(this.options.acceptedFiles&&this.options.acceptedMimeTypes)throw new Error("You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'. 'acceptedMimeTypes' is deprecated.");this.options.acceptedMimeTypes&&(this.options.acceptedFiles=this.options.acceptedMimeTypes,delete this.options.acceptedMimeTypes),this.options.method=this.options.method.toUpperCase(),(o=this.getExistingFallback())&&o.parentNode&&o.parentNode.removeChild(o),!1!==this.options.previewsContainer&&(this.options.previewsContainer?this.previewsContainer=i.getElement(this.options.previewsContainer,"previewsContainer"):this.previewsContainer=this.element),this.options.clickable&&(!0===this.options.clickable?this.clickableElements=[this.element]:this.clickableElements=i.getElements(this.options.clickable,"clickable")),this.init()}return function(t,e){for(var r in e)c.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(i,r),i.prototype.Emitter=r,i.prototype.events=["drop","dragstart","dragend","dragenter","dragover","dragleave","addedfile","addedfiles","removedfile","thumbnail","error","errormultiple","processing","processingmultiple","uploadprogress","totaluploadprogress","sending","sendingmultiple","success","successmultiple","canceled","canceledmultiple","complete","completemultiple","reset","maxfilesexceeded","maxfilesreached","queuecomplete"],i.prototype.defaultOptions={url:null,method:"post",withCredentials:!1,parallelUploads:2,uploadMultiple:!1,maxFilesize:256,paramName:"file",createImageThumbnails:!0,maxThumbnailFilesize:10,thumbnailWidth:120,thumbnailHeight:120,filesizeBase:1e3,maxFiles:null,params:{},clickable:!0,ignoreHiddenFiles:!0,acceptedFiles:null,acceptedMimeTypes:null,autoProcessQueue:!0,autoQueue:!0,addRemoveLinks:!1,previewsContainer:null,hiddenInputContainer:"body",capture:null,renameFilename:null,dictDefaultMessage:"Drop files here to upload",dictFallbackMessage:"Your browser does not support drag'n'drop file uploads.",dictFallbackText:"Please use the fallback form below to upload your files like in the olden days.",dictFileTooBig:"File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.",dictInvalidFileType:"You can't upload files of this type.",dictResponseError:"Server responded with {{statusCode}} code.",dictCancelUpload:"Cancel upload",dictCancelUploadConfirmation:"Are you sure you want to cancel this upload?",dictRemoveFile:"Remove file",dictRemoveFileConfirmation:null,dictMaxFilesExceeded:"You can not upload any more files.",accept:function(t,e){return e()},init:function(){return a},forceFallback:!1,fallback:function(){var t,e,r,n,o,s;for(this.element.className=this.element.className+" dz-browser-not-supported",n=0,o=(s=this.element.getElementsByTagName("div")).length;n<o;n++)t=s[n],/(^| )dz-message($| )/.test(t.className)&&(e=t,t.className="dz-message");return e||(e=i.createElement('<div class="dz-message"><span></span></div>'),this.element.appendChild(e)),(r=e.getElementsByTagName("span")[0])&&(null!=r.textContent?r.textContent=this.options.dictFallbackMessage:null!=r.innerText&&(r.innerText=this.options.dictFallbackMessage)),this.element.appendChild(this.getFallbackForm())},resize:function(t){var e,r,n;return e={srcX:0,srcY:0,srcWidth:t.width,srcHeight:t.height},r=t.width/t.height,e.optWidth=this.options.thumbnailWidth,e.optHeight=this.options.thumbnailHeight,null==e.optWidth&&null==e.optHeight?(e.optWidth=e.srcWidth,e.optHeight=e.srcHeight):null==e.optWidth?e.optWidth=r*e.optHeight:null==e.optHeight&&(e.optHeight=1/r*e.optWidth),n=e.optWidth/e.optHeight,t.height<e.optHeight||t.width<e.optWidth?(e.trgHeight=e.srcHeight,e.trgWidth=e.srcWidth):r>n?(e.srcHeight=t.height,e.srcWidth=e.srcHeight*n):(e.srcWidth=t.width,e.srcHeight=e.srcWidth/n),e.srcX=(t.width-e.srcWidth)/2,e.srcY=(t.height-e.srcHeight)/2,e},drop:function(t){return this.element.classList.remove("dz-drag-hover")},dragstart:a,dragend:function(t){return this.element.classList.remove("dz-drag-hover")},dragenter:function(t){return this.element.classList.add("dz-drag-hover")},dragover:function(t){return this.element.classList.add("dz-drag-hover")},dragleave:function(t){return this.element.classList.remove("dz-drag-hover")},paste:a,reset:function(){return this.element.classList.remove("dz-started")},addedfile:function(t){var e,r,n,o,s,a,u,l,c,p,h,d;if(this.element===this.previewsContainer&&this.element.classList.add("dz-started"),this.previewsContainer){for(t.previewElement=i.createElement(this.options.previewTemplate.trim()),t.previewTemplate=t.previewElement,this.previewsContainer.appendChild(t.previewElement),n=0,a=(c=t.previewElement.querySelectorAll("[data-dz-name]")).length;n<a;n++)c[n].textContent=this._renameFilename(t.name);for(o=0,u=(p=t.previewElement.querySelectorAll("[data-dz-size]")).length;o<u;o++)p[o].innerHTML=this.filesize(t.size);for(this.options.addRemoveLinks&&(t._removeLink=i.createElement('<a class="dz-remove" href="javascript:undefined;" data-dz-remove>'+this.options.dictRemoveFile+"</a>"),t.previewElement.appendChild(t._removeLink)),e=function(e){return function(r){return r.preventDefault(),r.stopPropagation(),t.status===i.UPLOADING?i.confirm(e.options.dictCancelUploadConfirmation,function(){return e.removeFile(t)}):e.options.dictRemoveFileConfirmation?i.confirm(e.options.dictRemoveFileConfirmation,function(){return e.removeFile(t)}):e.removeFile(t)}}(this),d=[],s=0,l=(h=t.previewElement.querySelectorAll("[data-dz-remove]")).length;s<l;s++)r=h[s],d.push(r.addEventListener("click",e));return d}},removedfile:function(t){var e;return t.previewElement&&null!=(e=t.previewElement)&&e.parentNode.removeChild(t.previewElement),this._updateMaxFilesReachedClass()},thumbnail:function(t,e){var r,n,i,o;if(t.previewElement){for(t.previewElement.classList.remove("dz-file-preview"),n=0,i=(o=t.previewElement.querySelectorAll("[data-dz-thumbnail]")).length;n<i;n++)(r=o[n]).alt=t.name,r.src=e;return setTimeout(function(){return t.previewElement.classList.add("dz-image-preview")},1)}},error:function(t,e){var r,n,i,o,s;if(t.previewElement){for(t.previewElement.classList.add("dz-error"),"String"!=typeof e&&e.error&&(e=e.error),s=[],n=0,i=(o=t.previewElement.querySelectorAll("[data-dz-errormessage]")).length;n<i;n++)r=o[n],s.push(r.textContent=e);return s}},errormultiple:a,processing:function(t){if(t.previewElement&&(t.previewElement.classList.add("dz-processing"),t._removeLink))return t._removeLink.textContent=this.options.dictCancelUpload},processingmultiple:a,uploadprogress:function(t,e,r){var n,i,o,s,a;if(t.previewElement){for(a=[],i=0,o=(s=t.previewElement.querySelectorAll("[data-dz-uploadprogress]")).length;i<o;i++)"PROGRESS"===(n=s[i]).nodeName?a.push(n.value=e):a.push(n.style.width=e+"%");return a}},totaluploadprogress:a,sending:a,sendingmultiple:a,success:function(t){if(t.previewElement)return t.previewElement.classList.add("dz-success")},successmultiple:a,canceled:function(t){return this.emit("error",t,"Upload canceled.")},canceledmultiple:a,complete:function(t){if(t._removeLink&&(t._removeLink.textContent=this.options.dictRemoveFile),t.previewElement)return t.previewElement.classList.add("dz-complete")},completemultiple:a,maxfilesexceeded:a,maxfilesreached:a,queuecomplete:a,addedfiles:a,previewTemplate:'<div class="dz-preview dz-file-preview">\n <div class="dz-image"><img data-dz-thumbnail /></div>\n <div class="dz-details">\n <div class="dz-size"><span data-dz-size></span></div>\n <div class="dz-filename"><span data-dz-name></span></div>\n </div>\n <div class="dz-progress"><span class="dz-upload" data-dz-uploadprogress></span></div>\n <div class="dz-error-message"><span data-dz-errormessage></span></div>\n <div class="dz-success-mark">\n <svg width="54px" height="54px" viewBox="0 0 54 54" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">\n <title>Check</title>\n <defs></defs>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">\n <path d="M23.5,31.8431458 L17.5852419,25.9283877 C16.0248253,24.3679711 13.4910294,24.366835 11.9289322,25.9289322 C10.3700136,27.4878508 10.3665912,30.0234455 11.9283877,31.5852419 L20.4147581,40.0716123 C20.5133999,40.1702541 20.6159315,40.2626649 20.7218615,40.3488435 C22.2835669,41.8725651 24.794234,41.8626202 26.3461564,40.3106978 L43.3106978,23.3461564 C44.8771021,21.7797521 44.8758057,19.2483887 43.3137085,17.6862915 C41.7547899,16.1273729 39.2176035,16.1255422 37.6538436,17.6893022 L23.5,31.8431458 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z" id="Oval-2" stroke-opacity="0.198794158" stroke="#747474" fill-opacity="0.816519475" fill="#FFFFFF" sketch:type="MSShapeGroup"></path>\n </g>\n </svg>\n </div>\n <div class="dz-error-mark">\n <svg width="54px" height="54px" viewBox="0 0 54 54" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">\n <title>Error</title>\n <defs></defs>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">\n <g id="Check-+-Oval-2" sketch:type="MSLayerGroup" stroke="#747474" stroke-opacity="0.198794158" fill="#FFFFFF" fill-opacity="0.816519475">\n <path d="M32.6568542,29 L38.3106978,23.3461564 C39.8771021,21.7797521 39.8758057,19.2483887 38.3137085,17.6862915 C36.7547899,16.1273729 34.2176035,16.1255422 32.6538436,17.6893022 L27,23.3431458 L21.3461564,17.6893022 C19.7823965,16.1255422 17.2452101,16.1273729 15.6862915,17.6862915 C14.1241943,19.2483887 14.1228979,21.7797521 15.6893022,23.3461564 L21.3431458,29 L15.6893022,34.6538436 C14.1228979,36.2202479 14.1241943,38.7516113 15.6862915,40.3137085 C17.2452101,41.8726271 19.7823965,41.8744578 21.3461564,40.3106978 L27,34.6568542 L32.6538436,40.3106978 C34.2176035,41.8744578 36.7547899,41.8726271 38.3137085,40.3137085 C39.8758057,38.7516113 39.8771021,36.2202479 38.3106978,34.6538436 L32.6568542,29 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z" id="Oval-2" sketch:type="MSShapeGroup"></path>\n </g>\n </g>\n </svg>\n </div>\n</div>'},e=function(){var t,e,r,n,i,o,s;for(n=arguments[0],o=0,s=(r=2<=arguments.length?l.call(arguments,1):[]).length;o<s;o++)for(t in e=r[o])i=e[t],n[t]=i;return n},i.prototype.getAcceptedFiles=function(){var t,e,r,n,i;for(i=[],e=0,r=(n=this.files).length;e<r;e++)(t=n[e]).accepted&&i.push(t);return i},i.prototype.getRejectedFiles=function(){var t,e,r,n,i;for(i=[],e=0,r=(n=this.files).length;e<r;e++)(t=n[e]).accepted||i.push(t);return i},i.prototype.getFilesWithStatus=function(t){var e,r,n,i,o;for(o=[],r=0,n=(i=this.files).length;r<n;r++)(e=i[r]).status===t&&o.push(e);return o},i.prototype.getQueuedFiles=function(){return this.getFilesWithStatus(i.QUEUED)},i.prototype.getUploadingFiles=function(){return this.getFilesWithStatus(i.UPLOADING)},i.prototype.getAddedFiles=function(){return this.getFilesWithStatus(i.ADDED)},i.prototype.getActiveFiles=function(){var t,e,r,n,o;for(o=[],e=0,r=(n=this.files).length;e<r;e++)(t=n[e]).status!==i.UPLOADING&&t.status!==i.QUEUED||o.push(t);return o},i.prototype.init=function(){var t,e,r,n,o,s,a;for("form"===this.element.tagName&&this.element.setAttribute("enctype","multipart/form-data"),this.element.classList.contains("dropzone")&&!this.element.querySelector(".dz-message")&&this.element.appendChild(i.createElement('<div class="dz-default dz-message"><span>'+this.options.dictDefaultMessage+"</span></div>")),this.clickableElements.length&&(r=function(t){return function(){return t.hiddenFileInput&&t.hiddenFileInput.parentNode.removeChild(t.hiddenFileInput),t.hiddenFileInput=document.createElement("input"),t.hiddenFileInput.setAttribute("type","file"),(null==t.options.maxFiles||t.options.maxFiles>1)&&t.hiddenFileInput.setAttribute("multiple","multiple"),t.hiddenFileInput.className="dz-hidden-input",null!=t.options.acceptedFiles&&t.hiddenFileInput.setAttribute("accept",t.options.acceptedFiles),null!=t.options.capture&&t.hiddenFileInput.setAttribute("capture",t.options.capture),t.hiddenFileInput.style.visibility="hidden",t.hiddenFileInput.style.position="absolute",t.hiddenFileInput.style.top="0",t.hiddenFileInput.style.left="0",t.hiddenFileInput.style.height="0",t.hiddenFileInput.style.width="0",document.querySelector(t.options.hiddenInputContainer).appendChild(t.hiddenFileInput),t.hiddenFileInput.addEventListener("change",function(){var e,n,i,o;if((n=t.hiddenFileInput.files).length)for(i=0,o=n.length;i<o;i++)e=n[i],t.addFile(e);return t.emit("addedfiles",n),r()})}}(this))(),this.URL=null!=(s=window.URL)?s:window.webkitURL,n=0,o=(a=this.events).length;n<o;n++)t=a[n],this.on(t,this.options[t]);return this.on("uploadprogress",function(t){return function(){return t.updateTotalUploadProgress()}}(this)),this.on("removedfile",function(t){return function(){return t.updateTotalUploadProgress()}}(this)),this.on("canceled",function(t){return function(e){return t.emit("complete",e)}}(this)),this.on("complete",function(t){return function(e){if(0===t.getAddedFiles().length&&0===t.getUploadingFiles().length&&0===t.getQueuedFiles().length)return setTimeout(function(){return t.emit("queuecomplete")},0)}}(this)),e=function(t){return t.stopPropagation(),t.preventDefault?t.preventDefault():t.returnValue=!1},this.listeners=[{element:this.element,events:{dragstart:function(t){return function(e){return t.emit("dragstart",e)}}(this),dragenter:function(t){return function(r){return e(r),t.emit("dragenter",r)}}(this),dragover:function(t){return function(r){var n;try{n=r.dataTransfer.effectAllowed}catch(t){}return r.dataTransfer.dropEffect="move"===n||"linkMove"===n?"move":"copy",e(r),t.emit("dragover",r)}}(this),dragleave:function(t){return function(e){return t.emit("dragleave",e)}}(this),drop:function(t){return function(r){return e(r),t.drop(r)}}(this),dragend:function(t){return function(e){return t.emit("dragend",e)}}(this)}}],this.clickableElements.forEach(function(t){return function(e){return t.listeners.push({element:e,events:{click:function(r){return(e!==t.element||r.target===t.element||i.elementInside(r.target,t.element.querySelector(".dz-message")))&&t.hiddenFileInput.click(),!0}}})}}(this)),this.enable(),this.options.init.call(this)},i.prototype.destroy=function(){var t;return this.disable(),this.removeAllFiles(!0),(null!=(t=this.hiddenFileInput)?t.parentNode:void 0)&&(this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput),this.hiddenFileInput=null),delete this.element.dropzone,i.instances.splice(i.instances.indexOf(this),1)},i.prototype.updateTotalUploadProgress=function(){var t,e,r,n,i,o,s;if(r=0,e=0,this.getActiveFiles().length){for(i=0,o=(s=this.getActiveFiles()).length;i<o;i++)r+=(t=s[i]).upload.bytesSent,e+=t.upload.total;n=100*r/e}else n=100;return this.emit("totaluploadprogress",n,e,r)},i.prototype._getParamName=function(t){return"function"==typeof this.options.paramName?this.options.paramName(t):this.options.paramName+(this.options.uploadMultiple?"["+t+"]":"")},i.prototype._renameFilename=function(t){return"function"!=typeof this.options.renameFilename?t:this.options.renameFilename(t)},i.prototype.getFallbackForm=function(){var t,e,r,n;return(t=this.getExistingFallback())?t:(r='<div class="dz-fallback">',this.options.dictFallbackText&&(r+="<p>"+this.options.dictFallbackText+"</p>"),r+='<input type="file" name="'+this._getParamName(0)+'" '+(this.options.uploadMultiple?'multiple="multiple"':void 0)+' /><input type="submit" value="Upload!"></div>',e=i.createElement(r),"FORM"!==this.element.tagName?(n=i.createElement('<form action="'+this.options.url+'" enctype="multipart/form-data" method="'+this.options.method+'"></form>')).appendChild(e):(this.element.setAttribute("enctype","multipart/form-data"),this.element.setAttribute("method",this.options.method)),null!=n?n:e)},i.prototype.getExistingFallback=function(){var t,e,r,n,i,o;for(e=function(t){var e,r,n;for(r=0,n=t.length;r<n;r++)if(e=t[r],/(^| )fallback($| )/.test(e.className))return e},n=0,i=(o=["div","form"]).length;n<i;n++)if(r=o[n],t=e(this.element.getElementsByTagName(r)))return t},i.prototype.setupEventListeners=function(){var t,e,r,n,i,o,s;for(s=[],n=0,i=(o=this.listeners).length;n<i;n++)t=o[n],s.push(function(){var n,i;for(e in i=[],n=t.events)r=n[e],i.push(t.element.addEventListener(e,r,!1));return i}());return s},i.prototype.removeEventListeners=function(){var t,e,r,n,i,o,s;for(s=[],n=0,i=(o=this.listeners).length;n<i;n++)t=o[n],s.push(function(){var n,i;for(e in i=[],n=t.events)r=n[e],i.push(t.element.removeEventListener(e,r,!1));return i}());return s},i.prototype.disable=function(){var t,e,r,n,i;for(this.clickableElements.forEach(function(t){return t.classList.remove("dz-clickable")}),this.removeEventListeners(),i=[],e=0,r=(n=this.files).length;e<r;e++)t=n[e],i.push(this.cancelUpload(t));return i},i.prototype.enable=function(){return this.clickableElements.forEach(function(t){return t.classList.add("dz-clickable")}),this.setupEventListeners()},i.prototype.filesize=function(t){var e,r,n,i,o,s,a;if(r=0,n="b",t>0){for(e=s=0,a=(o=["TB","GB","MB","KB","b"]).length;s<a;e=++s)if(i=o[e],t>=Math.pow(this.options.filesizeBase,4-e)/10){r=t/Math.pow(this.options.filesizeBase,4-e),n=i;break}r=Math.round(10*r)/10}return"<strong>"+r+"</strong> "+n},i.prototype._updateMaxFilesReachedClass=function(){return null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(this.getAcceptedFiles().length===this.options.maxFiles&&this.emit("maxfilesreached",this.files),this.element.classList.add("dz-max-files-reached")):this.element.classList.remove("dz-max-files-reached")},i.prototype.drop=function(t){var e,r;t.dataTransfer&&(this.emit("drop",t),e=t.dataTransfer.files,this.emit("addedfiles",e),e.length&&((r=t.dataTransfer.items)&&r.length&&null!=r[0].webkitGetAsEntry?this._addFilesFromItems(r):this.handleFiles(e)))},i.prototype.paste=function(t){var e,r;if(null!=(null!=t&&null!=(r=t.clipboardData)?r.items:void 0))return this.emit("paste",t),(e=t.clipboardData.items).length?this._addFilesFromItems(e):void 0},i.prototype.handleFiles=function(t){var e,r,n,i;for(i=[],r=0,n=t.length;r<n;r++)e=t[r],i.push(this.addFile(e));return i},i.prototype._addFilesFromItems=function(t){var e,r,n,i,o;for(o=[],n=0,i=t.length;n<i;n++)null!=(r=t[n]).webkitGetAsEntry&&(e=r.webkitGetAsEntry())?e.isFile?o.push(this.addFile(r.getAsFile())):e.isDirectory?o.push(this._addFilesFromDirectory(e,e.name)):o.push(void 0):null!=r.getAsFile&&(null==r.kind||"file"===r.kind)?o.push(this.addFile(r.getAsFile())):o.push(void 0);return o},i.prototype._addFilesFromDirectory=function(t,e){var r,n,i;return r=t.createReader(),n=function(t){return"undefined"!=typeof console&&null!==console&&"function"==typeof console.log?console.log(t):void 0},(i=function(t){return function(){return r.readEntries(function(r){var n,o,s;if(r.length>0){for(o=0,s=r.length;o<s;o++)(n=r[o]).isFile?n.file(function(r){if(!t.options.ignoreHiddenFiles||"."!==r.name.substring(0,1))return r.fullPath=e+"/"+r.name,t.addFile(r)}):n.isDirectory&&t._addFilesFromDirectory(n,e+"/"+n.name);i()}return null},n)}}(this))()},i.prototype.accept=function(t,e){return t.size>1024*this.options.maxFilesize*1024?e(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(t.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxFilesize)):i.isValidFile(t,this.options.acceptedFiles)?null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(e(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles)),this.emit("maxfilesexceeded",t)):this.options.accept.call(this,t,e):e(this.options.dictInvalidFileType)},i.prototype.addFile=function(t){return t.upload={progress:0,total:t.size,bytesSent:0},this.files.push(t),t.status=i.ADDED,this.emit("addedfile",t),this._enqueueThumbnail(t),this.accept(t,function(e){return function(r){return r?(t.accepted=!1,e._errorProcessing([t],r)):(t.accepted=!0,e.options.autoQueue&&e.enqueueFile(t)),e._updateMaxFilesReachedClass()}}(this))},i.prototype.enqueueFiles=function(t){var e,r,n;for(r=0,n=t.length;r<n;r++)e=t[r],this.enqueueFile(e);return null},i.prototype.enqueueFile=function(t){if(t.status!==i.ADDED||!0!==t.accepted)throw new Error("This file can't be queued because it has already been processed or was rejected.");if(t.status=i.QUEUED,this.options.autoProcessQueue)return setTimeout(function(t){return function(){return t.processQueue()}}(this),0)},i.prototype._thumbnailQueue=[],i.prototype._processingThumbnail=!1,i.prototype._enqueueThumbnail=function(t){if(this.options.createImageThumbnails&&t.type.match(/image.*/)&&t.size<=1024*this.options.maxThumbnailFilesize*1024)return this._thumbnailQueue.push(t),setTimeout(function(t){return function(){return t._processThumbnailQueue()}}(this),0)},i.prototype._processThumbnailQueue=function(){if(!this._processingThumbnail&&0!==this._thumbnailQueue.length)return this._processingThumbnail=!0,this.createThumbnail(this._thumbnailQueue.shift(),function(t){return function(){return t._processingThumbnail=!1,t._processThumbnailQueue()}}(this))},i.prototype.removeFile=function(t){if(t.status===i.UPLOADING&&this.cancelUpload(t),this.files=u(this.files,t),this.emit("removedfile",t),0===this.files.length)return this.emit("reset")},i.prototype.removeAllFiles=function(t){var e,r,n,o;for(null==t&&(t=!1),r=0,n=(o=this.files.slice()).length;r<n;r++)((e=o[r]).status!==i.UPLOADING||t)&&this.removeFile(e);return null},i.prototype.createThumbnail=function(t,e){var r;return(r=new FileReader).onload=function(n){return function(){return"image/svg+xml"===t.type?(n.emit("thumbnail",t,r.result),void(null!=e&&e())):n.createThumbnailFromUrl(t,r.result,e)}}(this),r.readAsDataURL(t)},i.prototype.createThumbnailFromUrl=function(t,e,r,n){var i;return i=document.createElement("img"),n&&(i.crossOrigin=n),i.onload=function(e){return function(){var n,o,a,u,l,c,p,h;if(t.width=i.width,t.height=i.height,null==(a=e.options.resize.call(e,t)).trgWidth&&(a.trgWidth=a.optWidth),null==a.trgHeight&&(a.trgHeight=a.optHeight),o=(n=document.createElement("canvas")).getContext("2d"),n.width=a.trgWidth,n.height=a.trgHeight,s(o,i,null!=(l=a.srcX)?l:0,null!=(c=a.srcY)?c:0,a.srcWidth,a.srcHeight,null!=(p=a.trgX)?p:0,null!=(h=a.trgY)?h:0,a.trgWidth,a.trgHeight),u=n.toDataURL("image/png"),e.emit("thumbnail",t,u),null!=r)return r()}}(this),null!=r&&(i.onerror=r),i.src=e},i.prototype.processQueue=function(){var t,e,r,n;if(e=this.options.parallelUploads,t=r=this.getUploadingFiles().length,!(r>=e)&&(n=this.getQueuedFiles()).length>0){if(this.options.uploadMultiple)return this.processFiles(n.slice(0,e-r));for(;t<e;){if(!n.length)return;this.processFile(n.shift()),t++}}},i.prototype.processFile=function(t){return this.processFiles([t])},i.prototype.processFiles=function(t){var e,r,n;for(r=0,n=t.length;r<n;r++)(e=t[r]).processing=!0,e.status=i.UPLOADING,this.emit("processing",e);return this.options.uploadMultiple&&this.emit("processingmultiple",t),this.uploadFiles(t)},i.prototype._getFilesWithXhr=function(t){var e;return function(){var r,n,i,o;for(o=[],r=0,n=(i=this.files).length;r<n;r++)(e=i[r]).xhr===t&&o.push(e);return o}.call(this)},i.prototype.cancelUpload=function(t){var e,r,n,o,s,a,u;if(t.status===i.UPLOADING){for(n=0,s=(r=this._getFilesWithXhr(t.xhr)).length;n<s;n++)(e=r[n]).status=i.CANCELED;for(t.xhr.abort(),o=0,a=r.length;o<a;o++)e=r[o],this.emit("canceled",e);this.options.uploadMultiple&&this.emit("canceledmultiple",r)}else(u=t.status)!==i.ADDED&&u!==i.QUEUED||(t.status=i.CANCELED,this.emit("canceled",t),this.options.uploadMultiple&&this.emit("canceledmultiple",[t]));if(this.options.autoProcessQueue)return this.processQueue()},n=function(){var t,e;return e=arguments[0],t=2<=arguments.length?l.call(arguments,1):[],"function"==typeof e?e.apply(this,t):e},i.prototype.uploadFile=function(t){return this.uploadFiles([t])},i.prototype.uploadFiles=function(t){var r,o,s,a,u,l,c,p,h,d,f,g,y,_,v,m,b,w,E,P,S,x,k,A,O,T,R,C,I,M,D,L,U;for(w=new XMLHttpRequest,E=0,k=t.length;E<k;E++)(r=t[E]).xhr=w;for(a in g=n(this.options.method,t),m=n(this.options.url,t),w.open(g,m,!0),w.withCredentials=!!this.options.withCredentials,_=null,s=function(e){return function(){var n,i,o;for(o=[],n=0,i=t.length;n<i;n++)r=t[n],o.push(e._errorProcessing(t,_||e.options.dictResponseError.replace("{{statusCode}}",w.status),w));return o}}(this),v=function(e){return function(n){var i,o,s,a,u,l,c,p,h;if(null!=n)for(o=100*n.loaded/n.total,s=0,l=t.length;s<l;s++)(r=t[s]).upload={progress:o,total:n.total,bytesSent:n.loaded};else{for(i=!0,o=100,a=0,c=t.length;a<c;a++)100===(r=t[a]).upload.progress&&r.upload.bytesSent===r.upload.total||(i=!1),r.upload.progress=o,r.upload.bytesSent=r.upload.total;if(i)return}for(h=[],u=0,p=t.length;u<p;u++)r=t[u],h.push(e.emit("uploadprogress",r,o,r.upload.bytesSent));return h}}(this),w.onload=function(e){return function(r){var n;if(t[0].status!==i.CANCELED&&4===w.readyState){if(_=w.responseText,w.getResponseHeader("content-type")&&~w.getResponseHeader("content-type").indexOf("application/json"))try{_=JSON.parse(_)}catch(t){r=t,_="Invalid JSON response from server."}return v(),200<=(n=w.status)&&n<300?e._finished(t,_,r):s()}}}(this),w.onerror=function(){if(t[0].status!==i.CANCELED)return s()},(null!=(C=w.upload)?C:w).onprogress=v,l={Accept:"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"},this.options.headers&&e(l,this.options.headers),l)(u=l[a])&&w.setRequestHeader(a,u);if(o=new FormData,this.options.params)for(f in I=this.options.params)b=I[f],o.append(f,b);for(P=0,A=t.length;P<A;P++)r=t[P],this.emit("sending",r,w,o);if(this.options.uploadMultiple&&this.emit("sendingmultiple",t,w,o),"FORM"===this.element.tagName)for(S=0,O=(M=this.element.querySelectorAll("input, textarea, select, button")).length;S<O;S++)if(h=(p=M[S]).getAttribute("name"),d=p.getAttribute("type"),"SELECT"===p.tagName&&p.hasAttribute("multiple"))for(x=0,T=(D=p.options).length;x<T;x++)(y=D[x]).selected&&o.append(h,y.value);else(!d||"checkbox"!==(L=d.toLowerCase())&&"radio"!==L||p.checked)&&o.append(h,p.value);for(c=R=0,U=t.length-1;0<=U?R<=U:R>=U;c=0<=U?++R:--R)o.append(this._getParamName(c),t[c],this._renameFilename(t[c].name));return this.submitRequest(w,o,t)},i.prototype.submitRequest=function(t,e,r){return t.send(e)},i.prototype._finished=function(t,e,r){var n,o,s;for(o=0,s=t.length;o<s;o++)(n=t[o]).status=i.SUCCESS,this.emit("success",n,e,r),this.emit("complete",n);if(this.options.uploadMultiple&&(this.emit("successmultiple",t,e,r),this.emit("completemultiple",t)),this.options.autoProcessQueue)return this.processQueue()},i.prototype._errorProcessing=function(t,e,r){var n,o,s;for(o=0,s=t.length;o<s;o++)(n=t[o]).status=i.ERROR,this.emit("error",n,e,r),this.emit("complete",n);if(this.options.uploadMultiple&&(this.emit("errormultiple",t,e,r),this.emit("completemultiple",t)),this.options.autoProcessQueue)return this.processQueue()},i}()).version="4.3.0",e.options={},e.optionsForElement=function(t){return t.getAttribute("id")?e.options[n(t.getAttribute("id"))]:void 0},e.instances=[],e.forElement=function(t){if("string"==typeof t&&(t=document.querySelector(t)),null==(null!=t?t.dropzone:void 0))throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone.");return t.dropzone},e.autoDiscover=!0,e.discover=function(){var t,r,n,i,o,s;for(document.querySelectorAll?n=document.querySelectorAll(".dropzone"):(n=[],(t=function(t){var e,r,i,o;for(o=[],r=0,i=t.length;r<i;r++)e=t[r],/(^| )dropzone($| )/.test(e.className)?o.push(n.push(e)):o.push(void 0);return o})(document.getElementsByTagName("div")),t(document.getElementsByTagName("form"))),s=[],i=0,o=n.length;i<o;i++)r=n[i],!1!==e.optionsForElement(r)?s.push(new e(r)):s.push(void 0);return s},e.blacklistedBrowsers=[/opera.*Macintosh.*version\/12/i],e.isBrowserSupported=function(){var t,r,n,i;if(t=!0,window.File&&window.FileReader&&window.FileList&&window.Blob&&window.FormData&&document.querySelector)if("classList"in document.createElement("a"))for(r=0,n=(i=e.blacklistedBrowsers).length;r<n;r++)i[r].test(navigator.userAgent)&&(t=!1);else t=!1;else t=!1;return t},u=function(t,e){var r,n,i,o;for(o=[],n=0,i=t.length;n<i;n++)(r=t[n])!==e&&o.push(r);return o},n=function(t){return t.replace(/[\-_](\w)/g,function(t){return t.charAt(1).toUpperCase()})},e.createElement=function(t){var e;return(e=document.createElement("div")).innerHTML=t,e.childNodes[0]},e.elementInside=function(t,e){if(t===e)return!0;for(;t=t.parentNode;)if(t===e)return!0;return!1},e.getElement=function(t,e){var r;if("string"==typeof t?r=document.querySelector(t):null!=t.nodeType&&(r=t),null==r)throw new Error("Invalid `"+e+"` option provided. Please provide a CSS selector or a plain HTML element.");return r},e.getElements=function(t,e){var r,n,i,o,s,a,u;if(t instanceof Array){n=[];try{for(i=0,s=t.length;i<s;i++)r=t[i],n.push(this.getElement(r,e))}catch(t){t,n=null}}else if("string"==typeof t)for(n=[],o=0,a=(u=document.querySelectorAll(t)).length;o<a;o++)r=u[o],n.push(r);else null!=t.nodeType&&(n=[t]);if(null==n||!n.length)throw new Error("Invalid `"+e+"` option provided. Please provide a CSS selector, a plain HTML element or a list of those.");return n},e.confirm=function(t,e,r){return window.confirm(t)?e():null!=r?r():void 0},e.isValidFile=function(t,e){var r,n,i,o,s;if(!e)return!0;for(e=e.split(","),r=(n=t.type).replace(/\/.*$/,""),o=0,s=e.length;o<s;o++)if("."===(i=(i=e[o]).trim()).charAt(0)){if(-1!==t.name.toLowerCase().indexOf(i.toLowerCase(),t.name.length-i.length))return!0}else if(/\/\*$/.test(i)){if(r===i.replace(/\/.*$/,""))return!0}else if(n===i)return!0;return!1},"undefined"!=typeof jQuery&&null!==jQuery&&(jQuery.fn.dropzone=function(t){return this.each(function(){return new e(this,t)})}),void 0!==t&&null!==t?t.exports=e:window.Dropzone=e,e.ADDED="added",e.QUEUED="queued",e.ACCEPTED=e.QUEUED,e.UPLOADING="uploading",e.PROCESSING=e.UPLOADING,e.CANCELED="canceled",e.ERROR="error",e.SUCCESS="success",o=function(t){var e,r,n,i,o,s,a,u;for(t.naturalWidth,o=t.naturalHeight,(e=document.createElement("canvas")).width=1,e.height=o,(r=e.getContext("2d")).drawImage(t,0,0),n=r.getImageData(0,0,1,o).data,u=0,i=o,s=o;s>u;)0===n[4*(s-1)+3]?i=s:u=s,s=i+u>>1;return 0===(a=s/o)?1:a},s=function(t,e,r,n,i,s,a,u,l,c){var p;return p=o(e),t.drawImage(e,r,n,i,s,a,u,l,c/p)},i=function(t,e){var r,n,i,o,s,a,u,l,c;if(i=!1,c=!0,n=t.document,l=n.documentElement,r=n.addEventListener?"addEventListener":"attachEvent",u=n.addEventListener?"removeEventListener":"detachEvent",a=n.addEventListener?"":"on",o=function(r){if("readystatechange"!==r.type||"complete"===n.readyState)return("load"===r.type?t:n)[u](a+r.type,o,!1),!i&&(i=!0)?e.call(t,r.type||r):void 0},s=function(){try{l.doScroll("left")}catch(t){return t,void setTimeout(s,50)}return o("poll")},"complete"!==n.readyState){if(n.createEventObject&&l.doScroll){try{c=!t.frameElement}catch(t){}c&&s()}return n[r](a+"DOMContentLoaded",o,!1),n[r](a+"readystatechange",o,!1),t[r](a+"load",o,!1)}},e._autoDiscoverFunction=function(){if(e.autoDiscover)return e.discover()},i(window,e._autoDiscoverFunction)}).call(this)}).call(e,r(46)(t))},function(t,e,r){"use strict";var n=r(154),i=r(159),o=r.n(i),s=r(116),a=r(117),u=r(162);function l(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */l=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var o=e&&e.prototype instanceof m?e:m,s=Object.create(o.prototype),a=new I(n||[]);return i(s,"_invoke",{value:O(t,r,a)}),s}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=p;var f="suspendedStart",g="suspendedYield",y="executing",_="completed",v={};function m(){}function b(){}function w(){}var E={};c(E,s,function(){return this});var P=Object.getPrototypeOf,S=P&&P(P(M([])));S&&S!==r&&n.call(S,s)&&(E=S);var x=w.prototype=m.prototype=Object.create(E);function k(t){["next","throw","return"].forEach(function(e){c(t,e,function(t){return this._invoke(e,t)})})}function A(t,e){function r(i,o,s,a){var u=h(t[i],t,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==d(c)&&n.call(c,"__await")?e.resolve(c.__await).then(function(t){r("next",t,s,a)},function(t){r("throw",t,s,a)}):e.resolve(c).then(function(t){l.value=t,s(l)},function(t){return r("throw",t,s,a)})}a(u.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e(function(e,i){r(t,n,e,i)})}return o=o?o.then(i,i):i()}})}function O(e,r,n){var i=f;return function(o,s){if(i===y)throw new Error("Generator is already running");if(i===_){if("throw"===o)throw s;return{value:t,done:!0}}for(n.method=o,n.arg=s;;){var a=n.delegate;if(a){var u=T(a,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===f)throw i=_,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=y;var l=h(e,r,n);if("normal"===l.type){if(i=n.done?_:g,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=_,n.method="throw",n.arg=l.arg)}}}function T(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,T(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var o=h(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var s=o.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function R(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(R,this),this.reset(!0)}function M(e){if(e||""===e){var r=e[s];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}throw new TypeError(d(e)+" is not iterable")}return b.prototype=w,i(x,"constructor",{value:w,configurable:!0}),i(w,"constructor",{value:b,configurable:!0}),b.displayName=c(w,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,c(t,u,"GeneratorFunction")),t.prototype=Object.create(x),t},e.awrap=function(t){return{__await:t}},k(A.prototype),c(A.prototype,a,function(){return this}),e.AsyncIterator=A,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var s=new A(p(t,r,n,i),o);return e.isGeneratorFunction(r)?s:s.next().then(function(t){return t.done?t.value:s.next()})},k(x),c(x,u,"Generator"),c(x,s,function(){return this}),c(x,"toString",function(){return"[object Generator]"}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=M,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return a.type="throw",a.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return i("end");if(s.tryLoc<=this.prev){var u=n.call(s,"catchLoc"),l=n.call(s,"finallyLoc");if(u&&l){if(this.prev<s.catchLoc)return i(s.catchLoc,!0);if(this.prev<s.finallyLoc)return i(s.finallyLoc)}else if(u){if(this.prev<s.catchLoc)return i(s.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return i(s.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=t,s.arg=e,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;C(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function c(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,i)}function p(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,s,a=[],u=!0,l=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(a.push(n.value),a.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(l)throw i}}return a}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return h(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return h(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function d(t){"@babel/helpers - typeof";return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function f(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function g(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?f(Object(r),!0).forEach(function(e){y(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function y(t,e,r){return(e=v(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,v(n.key),n)}}function v(t){var e=function(t,e){if("object"!=d(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=d(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==d(e)?e:String(e)}var m="tus-v1",b="ietf-draft-03",w={endpoint:null,uploadUrl:null,metadata:{},fingerprint:null,uploadSize:null,onProgress:null,onChunkComplete:null,onSuccess:null,onError:null,onUploadUrlAvailable:null,overridePatchMethod:!1,headers:{},addRequestId:!1,onBeforeRequest:null,onAfterResponse:null,onShouldRetry:T,chunkSize:1/0,retryDelays:[0,1e3,3e3,5e3],parallelUploads:1,parallelUploadBoundaries:null,storeFingerprintForResuming:!0,removeFingerprintOnSuccess:!1,uploadLengthDeferred:!1,uploadDataDuringCreation:!1,urlStorage:null,fileReader:null,httpStack:null,protocol:m},E=function(){function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),"resume"in r&&console.log("tus: The `resume` option has been removed in tus-js-client v2. Please use the URL storage API instead."),this.options=r,this.options.chunkSize=Number(this.options.chunkSize),this._urlStorage=this.options.urlStorage,this.file=e,this.url=null,this._req=null,this._fingerprint=null,this._urlStorageKey=null,this._offset=null,this._aborted=!1,this._size=null,this._source=null,this._retryAttempt=0,this._retryTimeout=null,this._offsetBeforeRetry=0,this._parallelUploads=null,this._parallelUploadUrls=null}return function(t,e,r){e&&_(t.prototype,e),r&&_(t,r),Object.defineProperty(t,"prototype",{writable:!1})}(t,[{key:"findPreviousUploads",value:function(){var t=this;return this.options.fingerprint(this.file,this.options).then(function(e){return t._urlStorage.findUploadsByFingerprint(e)})}},{key:"resumeFromPreviousUpload",value:function(t){this.url=t.uploadUrl||null,this._parallelUploadUrls=t.parallelUploadUrls||null,this._urlStorageKey=t.urlStorageKey}},{key:"start",value:function(){var t=this,e=this.file;if(e)if([m,b].includes(this.options.protocol))if(this.options.endpoint||this.options.uploadUrl||this.url){var r=this.options.retryDelays;if(null==r||"[object Array]"===Object.prototype.toString.call(r)){if(this.options.parallelUploads>1)for(var n=0,i=["uploadUrl","uploadSize","uploadLengthDeferred"];n<i.length;n++){var o=i[n];if(this.options[o])return void this._emitError(new Error("tus: cannot use the ".concat(o," option when parallelUploads is enabled")))}if(this.options.parallelUploadBoundaries){if(this.options.parallelUploads<=1)return void this._emitError(new Error("tus: cannot use the `parallelUploadBoundaries` option when `parallelUploads` is disabled"));if(this.options.parallelUploads!==this.options.parallelUploadBoundaries.length)return void this._emitError(new Error("tus: the `parallelUploadBoundaries` must have the same length as the value of `parallelUploads`"))}this.options.fingerprint(e,this.options).then(function(r){return null==r?a.a("No fingerprint was calculated meaning that the upload cannot be stored in the URL storage."):a.a("Calculated fingerprint: ".concat(r)),t._fingerprint=r,t._source?t._source:t.options.fileReader.openFile(e,t.options.chunkSize)}).then(function(e){if(t._source=e,t.options.uploadLengthDeferred)t._size=null;else if(null!=t.options.uploadSize){if(t._size=Number(t.options.uploadSize),Number.isNaN(t._size))return void t._emitError(new Error("tus: cannot convert `uploadSize` option into a number"))}else if(t._size=t._source.size,null==t._size)return void t._emitError(new Error("tus: cannot automatically derive upload's size from input. Specify it manually using the `uploadSize` option or use the `uploadLengthDeferred` option"));t.options.parallelUploads>1||null!=t._parallelUploadUrls?t._startParallelUpload():t._startSingleUpload()}).catch(function(e){t._emitError(e)})}else this._emitError(new Error("tus: the `retryDelays` option must either be an array or null"))}else this._emitError(new Error("tus: neither an endpoint or an upload URL is provided"));else this._emitError(new Error("tus: unsupported protocol ".concat(this.options.protocol)));else this._emitError(new Error("tus: no file or stream to upload provided"))}},{key:"_startParallelUpload",value:function(){var e,r=this,n=this._size,i=0;this._parallelUploads=[];var o=null!=this._parallelUploadUrls?this._parallelUploadUrls.length:this.options.parallelUploads,s=null!==(e=this.options.parallelUploadBoundaries)&&void 0!==e?e:function(t,e){for(var r=Math.floor(t/e),n=[],i=0;i<e;i++)n.push({start:r*i,end:r*(i+1)});return n[e-1].end=t,n}(this._source.size,o);this._parallelUploadUrls&&s.forEach(function(t,e){t.uploadUrl=r._parallelUploadUrls[e]||null}),this._parallelUploadUrls=new Array(s.length);var u,l=s.map(function(e,o){var a=0;return r._source.slice(e.start,e.end).then(function(u){var l=u.value;return new Promise(function(u,c){var p=g(g({},r.options),{},{uploadUrl:e.uploadUrl||null,storeFingerprintForResuming:!1,removeFingerprintOnSuccess:!1,parallelUploads:1,parallelUploadBoundaries:null,metadata:{},headers:g(g({},r.options.headers),{},{"Upload-Concat":"partial"}),onSuccess:u,onError:c,onProgress:function(t){i=i-a+t,a=t,r._emitProgress(i,n)},onUploadUrlAvailable:function(){r._parallelUploadUrls[o]=h.url,r._parallelUploadUrls.filter(function(t){return Boolean(t)}).length===s.length&&r._saveUploadInUrlStorage()}}),h=new t(l,p);h.start(),r._parallelUploads.push(h)})})});Promise.all(l).then(function(){(u=r._openRequest("POST",r.options.endpoint)).setHeader("Upload-Concat","final;".concat(r._parallelUploadUrls.join(" ")));var t=P(r.options.metadata);return""!==t&&u.setHeader("Upload-Metadata",t),r._sendRequest(u,null)}).then(function(t){if(S(t.getStatus(),200)){var e=t.getHeader("Location");null!=e?(r.url=R(r.options.endpoint,e),a.a("Created upload at ".concat(r.url)),r._emitSuccess()):r._emitHttpError(u,t,"tus: invalid or missing Location header")}else r._emitHttpError(u,t,"tus: unexpected response while creating upload")}).catch(function(t){r._emitError(t)})}},{key:"_startSingleUpload",value:function(){return this._aborted=!1,null!=this.url?(a.a("Resuming upload from previous URL: ".concat(this.url)),void this._resumeUpload()):null!=this.options.uploadUrl?(a.a("Resuming upload from provided URL: ".concat(this.options.uploadUrl)),this.url=this.options.uploadUrl,void this._resumeUpload()):(a.a("Creating a new upload"),void this._createUpload())}},{key:"abort",value:function(e){var r=this;return null!=this._parallelUploads&&this._parallelUploads.forEach(function(t){t.abort(e)}),null!==this._req&&this._req.abort(),this._aborted=!0,null!=this._retryTimeout&&(clearTimeout(this._retryTimeout),this._retryTimeout=null),e&&null!=this.url?t.terminate(this.url,this.options).then(function(){return r._removeFromUrlStorage()}):Promise.resolve()}},{key:"_emitHttpError",value:function(t,e,r,n){this._emitError(new s.a(r,n,t,e))}},{key:"_emitError",value:function(t){var e=this;if(!this._aborted){if(null!=this.options.retryDelays)if(null!=this._offset&&this._offset>this._offsetBeforeRetry&&(this._retryAttempt=0),O(t,this._retryAttempt,this.options)){var r=this.options.retryDelays[this._retryAttempt++];return this._offsetBeforeRetry=this._offset,void(this._retryTimeout=setTimeout(function(){e.start()},r))}if("function"!=typeof this.options.onError)throw t;this.options.onError(t)}}},{key:"_emitSuccess",value:function(){this.options.removeFingerprintOnSuccess&&this._removeFromUrlStorage(),"function"==typeof this.options.onSuccess&&this.options.onSuccess()}},{key:"_emitProgress",value:function(t,e){"function"==typeof this.options.onProgress&&this.options.onProgress(t,e)}},{key:"_emitChunkComplete",value:function(t,e,r){"function"==typeof this.options.onChunkComplete&&this.options.onChunkComplete(t,e,r)}},{key:"_createUpload",value:function(){var t=this;if(this.options.endpoint){var e=this._openRequest("POST",this.options.endpoint);this.options.uploadLengthDeferred?e.setHeader("Upload-Defer-Length",1):e.setHeader("Upload-Length",this._size);var r,n=P(this.options.metadata);""!==n&&e.setHeader("Upload-Metadata",n),this.options.uploadDataDuringCreation&&!this.options.uploadLengthDeferred?(this._offset=0,r=this._addChunkToRequest(e)):(this.options.protocol===b&&e.setHeader("Upload-Complete","?0"),r=this._sendRequest(e,null)),r.then(function(r){if(S(r.getStatus(),200)){var n=r.getHeader("Location");if(null!=n){if(t.url=R(t.options.endpoint,n),a.a("Created upload at ".concat(t.url)),"function"==typeof t.options.onUploadUrlAvailable&&t.options.onUploadUrlAvailable(),0===t._size)return t._emitSuccess(),void t._source.close();t._saveUploadInUrlStorage().then(function(){t.options.uploadDataDuringCreation?t._handleUploadResponse(e,r):(t._offset=0,t._performUpload())})}else t._emitHttpError(e,r,"tus: invalid or missing Location header")}else t._emitHttpError(e,r,"tus: unexpected response while creating upload")}).catch(function(r){t._emitHttpError(e,null,"tus: failed to create upload",r)})}else this._emitError(new Error("tus: unable to create upload because no endpoint is provided"))}},{key:"_resumeUpload",value:function(){var t=this,e=this._openRequest("HEAD",this.url);this._sendRequest(e,null).then(function(r){var n=r.getStatus();if(!S(n,200))return 423===n?void t._emitHttpError(e,r,"tus: upload is currently locked; retry later"):(S(n,400)&&t._removeFromUrlStorage(),t.options.endpoint?(t.url=null,void t._createUpload()):void t._emitHttpError(e,r,"tus: unable to resume upload (new upload cannot be created without an endpoint)"));var i=parseInt(r.getHeader("Upload-Offset"),10);if(Number.isNaN(i))t._emitHttpError(e,r,"tus: invalid or missing offset value");else{var o=parseInt(r.getHeader("Upload-Length"),10);!Number.isNaN(o)||t.options.uploadLengthDeferred||t.options.protocol!==m?("function"==typeof t.options.onUploadUrlAvailable&&t.options.onUploadUrlAvailable(),t._saveUploadInUrlStorage().then(function(){if(i===o)return t._emitProgress(o,o),void t._emitSuccess();t._offset=i,t._performUpload()})):t._emitHttpError(e,r,"tus: invalid or missing length value")}}).catch(function(r){t._emitHttpError(e,null,"tus: failed to resume upload",r)})}},{key:"_performUpload",value:function(){var t,e=this;this._aborted||(this.options.overridePatchMethod?(t=this._openRequest("POST",this.url)).setHeader("X-HTTP-Method-Override","PATCH"):t=this._openRequest("PATCH",this.url),t.setHeader("Upload-Offset",this._offset),this._addChunkToRequest(t).then(function(r){S(r.getStatus(),200)?e._handleUploadResponse(t,r):e._emitHttpError(t,r,"tus: unexpected response while uploading chunk")}).catch(function(r){e._aborted||e._emitHttpError(t,null,"tus: failed to upload chunk at offset ".concat(e._offset),r)}))}},{key:"_addChunkToRequest",value:function(t){var e=this,r=this._offset,n=this._offset+this.options.chunkSize;return t.setProgressHandler(function(t){e._emitProgress(r+t,e._size)}),t.setHeader("Content-Type","application/offset+octet-stream"),(n===1/0||n>this._size)&&!this.options.uploadLengthDeferred&&(n=this._size),this._source.slice(r,n).then(function(r){var n=r.value,i=r.done,o=n&&n.size?n.size:0;e.options.uploadLengthDeferred&&i&&(e._size=e._offset+o,t.setHeader("Upload-Length",e._size));var s=e._offset+o;return!e.options.uploadLengthDeferred&&i&&s!==e._size?Promise.reject(new Error("upload was configured with a size of ".concat(e._size," bytes, but the source is done after ").concat(s," bytes"))):null===n?e._sendRequest(t):(e.options.protocol===b&&t.setHeader("Upload-Complete",i?"?1":"?0"),e._emitProgress(e._offset,e._size),e._sendRequest(t,n))})}},{key:"_handleUploadResponse",value:function(t,e){var r=parseInt(e.getHeader("Upload-Offset"),10);if(Number.isNaN(r))this._emitHttpError(t,e,"tus: invalid or missing offset value");else{if(this._emitProgress(r,this._size),this._emitChunkComplete(r-this._offset,r,this._size),this._offset=r,r===this._size)return this._emitSuccess(),void this._source.close();this._performUpload()}}},{key:"_openRequest",value:function(t,e){var r=x(t,e,this.options);return this._req=r,r}},{key:"_removeFromUrlStorage",value:function(){var t=this;this._urlStorageKey&&(this._urlStorage.removeUpload(this._urlStorageKey).catch(function(e){t._emitError(e)}),this._urlStorageKey=null)}},{key:"_saveUploadInUrlStorage",value:function(){var t=this;if(!this.options.storeFingerprintForResuming||!this._fingerprint||null!==this._urlStorageKey)return Promise.resolve();var e={size:this._size,metadata:this.options.metadata,creationTime:(new Date).toString()};return this._parallelUploads?e.parallelUploadUrls=this._parallelUploadUrls:e.uploadUrl=this.url,this._urlStorage.addUpload(this._fingerprint,e).then(function(e){t._urlStorageKey=e})}},{key:"_sendRequest",value:function(t){return k(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,this.options)}}],[{key:"terminate",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=x("DELETE",e,r);return k(n,null,r).then(function(t){if(204!==t.getStatus())throw new s.a("tus: unexpected response while terminating upload",null,n,t)}).catch(function(i){if(i instanceof s.a||(i=new s.a("tus: failed to terminate upload",i,n,null)),!O(i,0,r))throw i;var o=r.retryDelays[0],a=r.retryDelays.slice(1),u=g(g({},r),{},{retryDelays:a});return new Promise(function(t){return setTimeout(t,o)}).then(function(){return t.terminate(e,u)})})}}]),t}();function P(t){return Object.entries(t).map(function(t){var e=p(t,2),r=e[0],i=e[1];return"".concat(r," ").concat(n.a.encode(String(i)))}).join(",")}function S(t,e){return t>=e&&t<e+100}function x(t,e,r){var n=r.httpStack.createRequest(t,e);r.protocol===b?n.setHeader("Upload-Draft-Interop-Version","5"):n.setHeader("Tus-Resumable","1.0.0");var i=r.headers||{};if(Object.entries(i).forEach(function(t){var e=p(t,2),r=e[0],i=e[1];n.setHeader(r,i)}),r.addRequestId){var o=u.a();n.setHeader("X-Request-ID",o)}return n}function k(t,e,r){return A.apply(this,arguments)}function A(){return(A=function(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(t){c(o,n,i,s,a,"next",t)}function a(t){c(o,n,i,s,a,"throw",t)}s(void 0)})}}(l().mark(function t(e,r,n){var i;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if("function"!=typeof n.onBeforeRequest){t.next=3;break}return t.next=3,n.onBeforeRequest(e);case 3:return t.next=5,e.send(r);case 5:if(i=t.sent,"function"!=typeof n.onAfterResponse){t.next=9;break}return t.next=9,n.onAfterResponse(e,i);case 9:return t.abrupt("return",i);case 10:case"end":return t.stop()}},t)}))).apply(this,arguments)}function O(t,e,r){return!(null==r.retryDelays||e>=r.retryDelays.length||null==t.originalRequest)&&(r&&"function"==typeof r.onShouldRetry?r.onShouldRetry(t,e,r):T(t))}function T(t){var e=t.originalResponse?t.originalResponse.getStatus():0;return(!S(e,400)||409===e||423===e)&&function(){var t=!0;return"undefined"!=typeof navigator&&!1===navigator.onLine&&(t=!1),t}()}function R(t,e){return new o.a(e,t).toString()}E.defaultOptions=w,e.a=E},function(t,e,r){"use strict";(function(t){r.d(e,"a",function(){return U});const n="function"==typeof t,i="function"==typeof TextDecoder?new TextDecoder:void 0,o="function"==typeof TextEncoder?new TextEncoder:void 0,s=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),a=(t=>{let e={};return s.forEach((t,r)=>e[t]=r),e})(),u=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,l=String.fromCharCode.bind(String),c="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):t=>new Uint8Array(Array.prototype.slice.call(t,0)),p=t=>t.replace(/=/g,"").replace(/[+\/]/g,t=>"+"==t?"-":"_"),h=t=>t.replace(/[^A-Za-z0-9\+\/]/g,""),d=t=>{let e,r,n,i,o="";const a=t.length%3;for(let a=0;a<t.length;){if((r=t.charCodeAt(a++))>255||(n=t.charCodeAt(a++))>255||(i=t.charCodeAt(a++))>255)throw new TypeError("invalid character found");o+=s[(e=r<<16|n<<8|i)>>18&63]+s[e>>12&63]+s[e>>6&63]+s[63&e]}return a?o.slice(0,a-3)+"===".substring(a):o},f="function"==typeof btoa?t=>btoa(t):n?e=>t.from(e,"binary").toString("base64"):d,g=n?e=>t.from(e).toString("base64"):t=>{let e=[];for(let r=0,n=t.length;r<n;r+=4096)e.push(l.apply(null,t.subarray(r,r+4096)));return f(e.join(""))},y=(t,e=!1)=>e?p(g(t)):g(t),_=t=>{if(t.length<2)return(e=t.charCodeAt(0))<128?t:e<2048?l(192|e>>>6)+l(128|63&e):l(224|e>>>12&15)+l(128|e>>>6&63)+l(128|63&e);var e=65536+1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320);return l(240|e>>>18&7)+l(128|e>>>12&63)+l(128|e>>>6&63)+l(128|63&e)},v=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,m=t=>t.replace(v,_),b=n?e=>t.from(e,"utf8").toString("base64"):o?t=>g(o.encode(t)):t=>f(m(t)),w=(t,e=!1)=>e?p(b(t)):b(t),E=t=>w(t,!0),P=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,S=t=>{switch(t.length){case 4:var e=((7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3))-65536;return l(55296+(e>>>10))+l(56320+(1023&e));case 3:return l((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return l((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},x=t=>t.replace(P,S),k=t=>{if(t=t.replace(/\s+/g,""),!u.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(3&t.length));let e,r,n,i="";for(let o=0;o<t.length;)e=a[t.charAt(o++)]<<18|a[t.charAt(o++)]<<12|(r=a[t.charAt(o++)])<<6|(n=a[t.charAt(o++)]),i+=64===r?l(e>>16&255):64===n?l(e>>16&255,e>>8&255):l(e>>16&255,e>>8&255,255&e);return i},A="function"==typeof atob?t=>atob(h(t)):n?e=>t.from(e,"base64").toString("binary"):k,O=n?e=>c(t.from(e,"base64")):t=>c(A(t).split("").map(t=>t.charCodeAt(0))),T=t=>O(C(t)),R=n?e=>t.from(e,"base64").toString("utf8"):i?t=>i.decode(O(t)):t=>x(A(t)),C=t=>h(t.replace(/[-_]/g,t=>"-"==t?"+":"/")),I=t=>R(C(t)),M=t=>({value:t,enumerable:!1,writable:!0,configurable:!0}),D=function(){const t=(t,e)=>Object.defineProperty(String.prototype,t,M(e));t("fromBase64",function(){return I(this)}),t("toBase64",function(t){return w(this,t)}),t("toBase64URI",function(){return w(this,!0)}),t("toBase64URL",function(){return w(this,!0)}),t("toUint8Array",function(){return T(this)})},L=function(){const t=(t,e)=>Object.defineProperty(Uint8Array.prototype,t,M(e));t("toBase64",function(t){return y(this,t)}),t("toBase64URI",function(){return y(this,!0)}),t("toBase64URL",function(){return y(this,!0)})},U={version:"3.7.7",VERSION:"3.7.7",atob:A,atobPolyfill:k,btoa:f,btoaPolyfill:d,fromBase64:I,toBase64:w,encode:w,encodeURI:E,encodeURL:E,utob:m,btou:x,decode:I,isValid:t=>{if("string"!=typeof t)return!1;const e=t.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(e)||!/[^\s0-9a-zA-Z\-_]/.test(e)},fromUint8Array:y,toUint8Array:T,extendString:D,extendUint8Array:L,extendBuiltins:()=>{D(),L()}}}).call(e,r(155).Buffer)},function(t,e,r){"use strict";(function(t){
|
|
26
|
+
!function(i,o){"use strict";if(!i||!i.document)throw new Error("SoundManager requires a browser with window and document objects.");var s=null;function a(t,e){this.setupOptions={url:t||null,flashVersion:8,debugMode:!0,debugFlash:!1,useConsole:!0,consoleOnly:!0,waitForWindowLoad:!1,bgColor:"#ffffff",useHighPerformance:!1,flashPollingInterval:null,html5PollingInterval:null,flashLoadTimeout:1e3,wmode:null,allowScriptAccess:"always",useFlashBlock:!1,useHTML5Audio:!0,forceUseGlobalHTML5Audio:!1,ignoreMobileRestrictions:!1,html5Test:/^(probably|maybe)$/i,preferFlash:!1,noSWFCache:!1,idPrefix:"sound"},this.defaultOptions={autoLoad:!1,autoPlay:!1,from:null,loops:1,onid3:null,onerror:null,onload:null,whileloading:null,onplay:null,onpause:null,onresume:null,whileplaying:null,onposition:null,onstop:null,onfinish:null,multiShot:!0,multiShotEvents:!1,position:null,pan:0,playbackRate:1,stream:!0,to:null,type:null,usePolicyFile:!1,volume:100},this.flash9Options={onfailure:null,isMovieStar:null,usePeakData:!1,useWaveformData:!1,useEQData:!1,onbufferchange:null,ondataerror:null},this.movieStarOptions={bufferTime:3,serverURL:null,onconnect:null,duration:null},this.audioFormats={mp3:{type:['audio/mpeg; codecs="mp3"',"audio/mpeg","audio/mp3","audio/MPA","audio/mpa-robust"],required:!0},mp4:{related:["aac","m4a","m4b"],type:['audio/mp4; codecs="mp4a.40.2"',"audio/aac","audio/x-m4a","audio/MP4A-LATM","audio/mpeg4-generic"],required:!1},ogg:{type:["audio/ogg; codecs=vorbis"],required:!1},opus:{type:["audio/ogg; codecs=opus","audio/opus"],required:!1},wav:{type:['audio/wav; codecs="1"',"audio/wav","audio/wave","audio/x-wav"],required:!1},flac:{type:["audio/flac"],required:!1}},this.movieID="sm2-container",this.id=e||"sm2movie",this.debugID="soundmanager-debug",this.debugURLParam=/([#?&])debug=1/i,this.versionNumber="V2.97a.20170601",this.version=null,this.movieURL=null,this.altURL=null,this.swfLoaded=!1,this.enabled=!1,this.oMC=null,this.sounds={},this.soundIDs=[],this.muted=!1,this.didFlashBlock=!1,this.filePattern=null,this.filePatterns={flash8:/\.mp3(\?.*)?$/i,flash9:/\.mp3(\?.*)?$/i},this.features={buffering:!1,peakData:!1,waveformData:!1,eqData:!1,movieStar:!1},this.sandbox={},this.html5={usingFlash:null},this.flash={},this.html5Only=!1,this.ignoreFlash=!1;var r,n,s,a,u,l,c,p,h,d,f,g,y,_,v,m,b,w,E,P,S,x,k,A,O,T,R,C,I,M,D,L,U,F,N,j,B,z,q,H,V,W,G,$,Y,J,Q,K,X,Z,tt,et,rt,nt,it,ot,st,at,ut=this,lt=null,ct=null,pt=navigator.userAgent,ht=i.location.href.toString(),dt=document,ft=[],gt=!1,yt=!1,_t=!1,vt=!1,mt=!1,bt=null,wt=null,Et=!1,Pt=!1,St=0,xt=null,kt=[],At=null,Ot=Array.prototype.slice,Tt=!1,Rt=0,Ct=pt.match(/(ipad|iphone|ipod)/i),It=pt.match(/android/i),Mt=pt.match(/msie|trident/i),Dt=pt.match(/webkit/i),Lt=pt.match(/safari/i)&&!pt.match(/chrome/i),Ut=pt.match(/opera/i),Ft=pt.match(/(mobile|pre\/|xoom)/i)||Ct||It,Nt=!ht.match(/usehtml5audio/i)&&!ht.match(/sm2-ignorebadua/i)&&Lt&&!pt.match(/silk/i)&&pt.match(/OS\sX\s10_6_([3-7])/i),jt=(i.console!==o&&console.log,dt.hasFocus!==o?dt.hasFocus():null),Bt=Lt&&(dt.hasFocus===o||!dt.hasFocus()),zt=!Bt,qt=/(mp3|mp4|mpa|m4a|m4b)/i,Ht=dt.location?dt.location.protocol.match(/http/i):null,Vt=Ht?"":"//",Wt=/^\s*audio\/(?:x-)?(?:mpeg4|aac|flv|mov|mp4|m4v|m4a|m4b|mp4v|3gp|3g2)\s*(?:$|;)/i,Gt=["mpeg4","aac","flv","mov","mp4","m4v","f4v","m4a","m4b","mp4v","3gp","3g2"],$t=new RegExp("\\.("+Gt.join("|")+")(\\?.*)?$","i");function Yt(t){return ut.preferFlash&&rt&&!ut.ignoreFlash&&ut.flash[t]!==o&&ut.flash[t]}function Jt(t){return function(e){var r=this._s;return r&&r._a?t.call(this,e):null}}this.mimePattern=/^\s*audio\/(?:x-)?(?:mp(?:eg|3))\s*(?:$|;)/i,this.useAltURL=!Ht,F={swfBox:"sm2-object-box",swfDefault:"movieContainer",swfError:"swf_error",swfTimedout:"swf_timedout",swfLoaded:"swf_loaded",swfUnblocked:"swf_unblocked",sm2Debug:"sm2_debug",highPerf:"high_performance",flashDebug:"flash_debug"},J=[null,"MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED"],this.hasHTML5=function(){try{return Audio!==o&&(Ut&&opera!==o&&opera.version()<10?new Audio(null):new Audio).canPlayType!==o}catch(t){return!1}}(),this.setup=function(t){var e=!ut.url;return t!==o&&_t&&At&&ut.ok()&&(t.flashVersion!==o||t.url!==o||t.html5Test),h(t),Tt||(Ft?ut.setupOptions.ignoreMobileRestrictions&&!ut.setupOptions.forceUseGlobalHTML5Audio||(kt.push(E.globalHTML5),Tt=!0):ut.setupOptions.forceUseGlobalHTML5Audio&&(kt.push(E.globalHTML5),Tt=!0)),!at&&Ft&&(ut.setupOptions.ignoreMobileRestrictions?kt.push(E.ignoreMobile):(ut.setupOptions.useHTML5Audio=!0,ut.setupOptions.preferFlash=!1,Ct?ut.ignoreFlash=!0:(It&&!pt.match(/android\s2\.3/i)||!It)&&(Tt=!0))),t&&(e&&k&&t.url!==o&&ut.beginDelayedInit(),k||t.url===o||"complete"!==dt.readyState||setTimeout(S,1)),at=!0,ut},this.ok=function(){return At?_t&&!vt:ut.useHTML5Audio&&ut.hasHTML5},this.supported=this.ok,this.getMovie=function(t){return n(t)||dt[t]||i[t]},this.createSound=function(t,e){var n,i=null;if(!_t||!ut.ok())return!1;if(e!==o&&(t={id:t,url:e}),(n=p(t)).url=V(n.url),n.id===o&&(n.id=ut.setupOptions.idPrefix+Rt++),B(n.id,!0))return ut.sounds[n.id];function s(){return n=N(n),ut.sounds[n.id]=new r(n),ut.soundIDs.push(n.id),ut.sounds[n.id]}if($(n))(i=s())._setup_html5(n);else{if(ut.html5Only)return s();if(ut.html5.usingFlash&&n.url&&n.url.match(/data:/i))return s();l>8&&null===n.isMovieStar&&(n.isMovieStar=!!(n.serverURL||n.type&&n.type.match(Wt)||n.url&&n.url.match($t))),n=j(n,void 0),i=s(),8===l?ct._createSound(n.id,n.loops||1,n.usePolicyFile):(ct._createSound(n.id,n.url,n.usePeakData,n.useWaveformData,n.useEQData,n.isMovieStar,!!n.isMovieStar&&n.bufferTime,n.loops||1,n.serverURL,n.duration||null,n.autoPlay,!0,n.autoLoad,n.usePolicyFile),n.serverURL||(i.connected=!0,n.onconnect&&n.onconnect.apply(i))),n.serverURL||!n.autoLoad&&!n.autoPlay||i.load(n)}return!n.serverURL&&n.autoPlay&&i.play(),i},this.destroySound=function(t,e){if(!B(t))return!1;var r,n=ut.sounds[t];for(n.stop(),n._iO={},n.unload(),r=0;r<ut.soundIDs.length;r++)if(ut.soundIDs[r]===t){ut.soundIDs.splice(r,1);break}return e||n.destruct(!0),n=null,delete ut.sounds[t],!0},this.load=function(t,e){return!!B(t)&&ut.sounds[t].load(e)},this.unload=function(t){return!!B(t)&&ut.sounds[t].unload()},this.onPosition=function(t,e,r,n){return!!B(t)&&ut.sounds[t].onposition(e,r,n)},this.onposition=this.onPosition,this.clearOnPosition=function(t,e,r){return!!B(t)&&ut.sounds[t].clearOnPosition(e,r)},this.play=function(t,e){var r=null,n=e&&!(e instanceof Object);if(!_t||!ut.ok())return!1;if(B(t,n))n&&(e={url:e});else{if(!n)return!1;n&&(e={url:e}),e&&e.url&&(e.id=t,r=ut.createSound(e).play())}return null===r&&(r=ut.sounds[t].play(e)),r},this.start=this.play,this.setPlaybackRate=function(t,e,r){return!!B(t)&&ut.sounds[t].setPlaybackRate(e,r)},this.setPosition=function(t,e){return!!B(t)&&ut.sounds[t].setPosition(e)},this.stop=function(t){return!!B(t)&&ut.sounds[t].stop()},this.stopAll=function(){var t;for(t in ut.sounds)ut.sounds.hasOwnProperty(t)&&ut.sounds[t].stop()},this.pause=function(t){return!!B(t)&&ut.sounds[t].pause()},this.pauseAll=function(){var t;for(t=ut.soundIDs.length-1;t>=0;t--)ut.sounds[ut.soundIDs[t]].pause()},this.resume=function(t){return!!B(t)&&ut.sounds[t].resume()},this.resumeAll=function(){var t;for(t=ut.soundIDs.length-1;t>=0;t--)ut.sounds[ut.soundIDs[t]].resume()},this.togglePause=function(t){return!!B(t)&&ut.sounds[t].togglePause()},this.setPan=function(t,e){return!!B(t)&&ut.sounds[t].setPan(e)},this.setVolume=function(t,e){var r,n;if(t!==o&&!isNaN(t)&&e===o){for(r=0,n=ut.soundIDs.length;r<n;r++)ut.sounds[ut.soundIDs[r]].setVolume(t);return!1}return!!B(t)&&ut.sounds[t].setVolume(e)},this.mute=function(t){var e=0;if(t instanceof String&&(t=null),t)return!!B(t)&&ut.sounds[t].mute();for(e=ut.soundIDs.length-1;e>=0;e--)ut.sounds[ut.soundIDs[e]].mute();return ut.muted=!0,!0},this.muteAll=function(){ut.mute()},this.unmute=function(t){var e;if(t instanceof String&&(t=null),t)return!!B(t)&&ut.sounds[t].unmute();for(e=ut.soundIDs.length-1;e>=0;e--)ut.sounds[ut.soundIDs[e]].unmute();return ut.muted=!1,!0},this.unmuteAll=function(){ut.unmute()},this.toggleMute=function(t){return!!B(t)&&ut.sounds[t].toggleMute()},this.getMemoryUse=function(){var t=0;return ct&&8!==l&&(t=parseInt(ct._getMemoryUse(),10)),t},this.disable=function(t){var e;if(t===o&&(t=!1),vt)return!1;for(vt=!0,e=ut.soundIDs.length-1;e>=0;e--)C(ut.sounds[ut.soundIDs[e]]);return C(ut),c(t),tt.remove(i,"load",y),!0},this.canPlayMIME=function(t){var e;return ut.hasHTML5&&(e=Y({type:t})),!e&&At&&(e=t&&ut.ok()?!!(l>8&&t.match(Wt)||t.match(ut.mimePattern)):null),e},this.canPlayURL=function(t){var e;return ut.hasHTML5&&(e=Y({url:t})),!e&&At&&(e=t&&ut.ok()?!!t.match(ut.filePattern):null),e},this.canPlayLink=function(t){return!(t.type===o||!t.type||!ut.canPlayMIME(t.type))||ut.canPlayURL(t.href)},this.getSoundById=function(t,e){return t?ut.sounds[t]:null},this.onready=function(t,e){if("function"!=typeof t)throw D("needFunction","onready");return e||(e=i),f("onready",t,e),g(),!0},this.ontimeout=function(t,e){if("function"!=typeof t)throw D("needFunction","ontimeout");return e||(e=i),f("ontimeout",t,e),g({type:"ontimeout"}),!0},this._writeDebug=function(t,e){return!0},this._wD=this._writeDebug,this._debug=function(){},this.reboot=function(t,e){var r,n,o;for(r=ut.soundIDs.length-1;r>=0;r--)ut.sounds[ut.soundIDs[r]].destruct();if(ct)try{Mt&&(wt=ct.innerHTML),bt=ct.parentNode.removeChild(ct)}catch(t){}if(wt=bt=At=ct=null,ut.enabled=k=_t=Et=Pt=gt=yt=vt=Tt=ut.swfLoaded=!1,ut.soundIDs=[],ut.sounds={},Rt=0,at=!1,t)ft=[];else for(r in ft)if(ft.hasOwnProperty(r))for(n=0,o=ft[r].length;n<o;n++)ft[r][n].fired=!1;return ut.html5={usingFlash:null},ut.flash={},ut.html5Only=!1,ut.ignoreFlash=!1,i.setTimeout(function(){e||ut.beginDelayedInit()},20),ut},this.reset=function(){return ut.reboot(!0,!0)},this.getMoviePercent=function(){return ct&&"PercentLoaded"in ct?ct.PercentLoaded():null},this.beginDelayedInit=function(){mt=!0,S(),setTimeout(function(){return!Pt&&(O(),P(),Pt=!0,!0)},20),_()},this.destruct=function(){ut.disable(!0)},r=function(t){var e,r,n,i,s,a,u,c,h,d,f=this,g=!1,y=[],_=0,v=null;h={duration:null,time:null},this.id=t.id,this.sID=this.id,this.url=t.url,this.options=p(t),this.instanceOptions=this.options,this._iO=this.instanceOptions,this.pan=this.options.pan,this.volume=this.options.volume,this.isHTML5=!1,this._a=null,d=!this.url,this.id3={},this._debug=function(){},this.load=function(t){var e;if(t!==o?f._iO=p(t,f.options):(t=f.options,f._iO=t,v&&v!==f.url&&(f._iO.url=f.url,f.url=null)),f._iO.url||(f._iO.url=f.url),f._iO.url=V(f._iO.url),f.instanceOptions=f._iO,!(e=f._iO).url&&!f.url)return f;if(e.url===f.url&&0!==f.readyState&&2!==f.readyState)return 3===f.readyState&&e.onload&&st(f,function(){e.onload.apply(f,[!!f.duration])}),f;if(f.loaded=!1,f.readyState=1,f.playState=0,f.id3={},$(e))f._setup_html5(e)._called_load||(f._html5_canplay=!1,f.url!==e.url&&(f._a.src=e.url,f.setPosition(0)),f._a.autobuffer="auto",f._a.preload="auto",f._a._called_load=!0);else{if(ut.html5Only)return f;if(f._iO.url&&f._iO.url.match(/data:/i))return f;try{f.isHTML5=!1,f._iO=j(N(e)),f._iO.autoPlay&&(f._iO.position||f._iO.from)&&(f._iO.autoPlay=!1),e=f._iO,8===l?ct._load(f.id,e.url,e.stream,e.autoPlay,e.usePolicyFile):ct._load(f.id,e.url,!!e.stream,!!e.autoPlay,e.loops||1,!!e.autoLoad,e.usePolicyFile)}catch(t){T({type:"SMSOUND_LOAD_JS_EXCEPTION",fatal:!0})}}return f.url=e.url,f},this.unload=function(){return 0!==f.readyState&&(f.isHTML5?(i(),f._a&&(f._a.pause(),v=K(f._a))):8===l?ct._unload(f.id,"about:blank"):ct._unload(f.id),e()),f},this.destruct=function(t){f.isHTML5?(i(),f._a&&(f._a.pause(),K(f._a),Tt||n(),f._a._s=null,f._a=null)):(f._iO.onfailure=null,ct._destroySound(f.id)),t||ut.destroySound(f.id,!0)},this.play=function(t,e){var r,n,i,u,h,y=!0;if(e=e===o||e,t||(t={}),f.url&&(f._iO.url=f.url),f._iO=p(f._iO,f.options),f._iO=p(t,f._iO),f._iO.url=V(f._iO.url),f.instanceOptions=f._iO,!f.isHTML5&&f._iO.serverURL&&!f.connected)return f.getAutoPlay()||f.setAutoPlay(!0),f;if($(f._iO)&&(f._setup_html5(f._iO),s()),1===f.playState&&!f.paused&&!f._iO.multiShot)return f.isHTML5&&f.setPosition(f._iO.position),f;if(t.url&&t.url!==f.url&&(f.readyState||f.isHTML5||8!==l||!d?f.load(f._iO):d=!1),!f.loaded)if(0===f.readyState){if(f.isHTML5||ut.html5Only){if(!f.isHTML5)return f;f.load(f._iO)}else f._iO.autoPlay=!0,f.load(f._iO);f.instanceOptions=f._iO}else if(2===f.readyState)return f;return!f.isHTML5&&9===l&&f.position>0&&f.position===f.duration&&(t.position=0),f.paused&&f.position>=0&&(!f._iO.serverURL||f.position>0)?f.resume():(f._iO=p(t,f._iO),(!f.isHTML5&&null!==f._iO.position&&f._iO.position>0||null!==f._iO.from&&f._iO.from>0||null!==f._iO.to)&&0===f.instanceCount&&0===f.playState&&!f._iO.serverURL&&(n=function(){f._iO=p(t,f._iO),f.play(f._iO)},f.isHTML5&&!f._html5_canplay?f.load({_oncanplay:n}):f.isHTML5||f.loaded||f.readyState&&2===f.readyState||f.load({onload:n}),f._iO=c()),(!f.instanceCount||f._iO.multiShotEvents||f.isHTML5&&f._iO.multiShot&&!Tt||!f.isHTML5&&l>8&&!f.getAutoPlay())&&f.instanceCount++,f._iO.onposition&&0===f.playState&&a(f),f.playState=1,f.paused=!1,f.position=f._iO.position===o||isNaN(f._iO.position)?0:f._iO.position,f.isHTML5||(f._iO=j(N(f._iO))),f._iO.onplay&&e&&(f._iO.onplay.apply(f),g=!0),f.setVolume(f._iO.volume,!0),f.setPan(f._iO.pan,!0),1!==f._iO.playbackRate&&f.setPlaybackRate(f._iO.playbackRate),f.isHTML5?f.instanceCount<2?(s(),r=f._setup_html5(),f.setPosition(f._iO.position),r.play()):(i=new Audio(f._iO.url),u=function(){tt.remove(i,"ended",u),f._onfinish(f),K(i),i=null},h=function(){tt.remove(i,"canplay",h);try{i.currentTime=f._iO.position/1e3}catch(t){}i.play()},tt.add(i,"ended",u),f._iO.volume!==o&&(i.volume=Math.max(0,Math.min(1,f._iO.volume/100))),f.muted&&(i.muted=!0),f._iO.position?tt.add(i,"canplay",h):i.play()):(y=ct._start(f.id,f._iO.loops||1,9===l?f.position:f.position/1e3,f._iO.multiShot||!1),9!==l||y||f._iO.onplayerror&&f._iO.onplayerror.apply(f))),f},this.start=this.play,this.stop=function(t){var e,r=f._iO;return 1===f.playState&&(f._onbufferchange(0),f._resetOnPosition(0),f.paused=!1,f.isHTML5||(f.playState=0),u(),r.to&&f.clearOnPosition(r.to),f.isHTML5?f._a&&(e=f.position,f.setPosition(0),f.position=e,f._a.pause(),f.playState=0,f._onTimer(),i()):(ct._stop(f.id,t),r.serverURL&&f.unload()),f.instanceCount=0,f._iO={},r.onstop&&r.onstop.apply(f)),f},this.setAutoPlay=function(t){f._iO.autoPlay=t,f.isHTML5||(ct._setAutoPlay(f.id,t),t&&(f.instanceCount||1!==f.readyState||f.instanceCount++))},this.getAutoPlay=function(){return f._iO.autoPlay},this.setPlaybackRate=function(t){var e=Math.max(.5,Math.min(4,t));if(f.isHTML5)try{f._iO.playbackRate=e,f._a.playbackRate=e}catch(t){}return f},this.setPosition=function(t){t===o&&(t=0);var e,r,n=f.isHTML5?Math.max(t,0):Math.min(f.duration||f._iO.duration,Math.max(t,0));if(f.position=n,r=f.position/1e3,f._resetOnPosition(f.position),f._iO.position=n,f.isHTML5){if(f._a){if(f._html5_canplay){if(f._a.currentTime.toFixed(3)!==r.toFixed(3))try{f._a.currentTime=r,(0===f.playState||f.paused)&&f._a.pause()}catch(t){}}else if(r)return f;f.paused&&f._onTimer(!0)}}else e=9===l?f.position:r,f.readyState&&2!==f.readyState&&ct._setPosition(f.id,e,f.paused||!f.playState,f._iO.multiShot);return f},this.pause=function(t){return f.paused||0===f.playState&&1!==f.readyState?f:(f.paused=!0,f.isHTML5?(f._setup_html5().pause(),i()):(t||t===o)&&ct._pause(f.id,f._iO.multiShot),f._iO.onpause&&f._iO.onpause.apply(f),f)},this.resume=function(){var t=f._iO;return f.paused?(f.paused=!1,f.playState=1,f.isHTML5?(f._setup_html5().play(),s()):(t.isMovieStar&&!t.serverURL&&f.setPosition(f.position),ct._pause(f.id,t.multiShot)),!g&&t.onplay?(t.onplay.apply(f),g=!0):t.onresume&&t.onresume.apply(f),f):f},this.togglePause=function(){return 0===f.playState?(f.play({position:9!==l||f.isHTML5?f.position/1e3:f.position}),f):(f.paused?f.resume():f.pause(),f)},this.setPan=function(t,e){return t===o&&(t=0),e===o&&(e=!1),f.isHTML5||ct._setPan(f.id,t),f._iO.pan=t,e||(f.pan=t,f.options.pan=t),f},this.setVolume=function(t,e){return t===o&&(t=100),e===o&&(e=!1),f.isHTML5?f._a&&(ut.muted&&!f.muted&&(f.muted=!0,f._a.muted=!0),f._a.volume=Math.max(0,Math.min(1,t/100))):ct._setVolume(f.id,ut.muted&&!f.muted||f.muted?0:t),f._iO.volume=t,e||(f.volume=t,f.options.volume=t),f},this.mute=function(){return f.muted=!0,f.isHTML5?f._a&&(f._a.muted=!0):ct._setVolume(f.id,0),f},this.unmute=function(){f.muted=!1;var t=f._iO.volume!==o;return f.isHTML5?f._a&&(f._a.muted=!1):ct._setVolume(f.id,t?f._iO.volume:f.options.volume),f},this.toggleMute=function(){return f.muted?f.unmute():f.mute()},this.onPosition=function(t,e,r){return y.push({position:parseInt(t,10),method:e,scope:r!==o?r:f,fired:!1}),f},this.onposition=this.onPosition,this.clearOnPosition=function(t,e){var r;if(t=parseInt(t,10),!isNaN(t))for(r=0;r<y.length;r++)t===y[r].position&&(e&&e!==y[r].method||(y[r].fired&&_--,y.splice(r,1)))},this._processOnPosition=function(){var t,e,r=y.length;if(!r||!f.playState||_>=r)return!1;for(t=r-1;t>=0;t--)!(e=y[t]).fired&&f.position>=e.position&&(e.fired=!0,_++,e.method.apply(e.scope,[e.position]),r=y.length);return!0},this._resetOnPosition=function(t){var e,r,n=y.length;if(!n)return!1;for(e=n-1;e>=0;e--)(r=y[e]).fired&&t<=r.position&&(r.fired=!1,_--);return!0},c=function(){var t,e,r=f._iO,n=r.from,i=r.to;return e=function(){f.clearOnPosition(i,e),f.stop()},t=function(){null===i||isNaN(i)||f.onPosition(i,e)},null===n||isNaN(n)||(r.position=n,r.multiShot=!1,t()),r},a=function(){var t,e=f._iO.onposition;if(e)for(t in e)e.hasOwnProperty(t)&&f.onPosition(parseInt(t,10),e[t])},u=function(){var t,e=f._iO.onposition;if(e)for(t in e)e.hasOwnProperty(t)&&f.clearOnPosition(parseInt(t,10))},s=function(){f.isHTML5&&z(f)},i=function(){f.isHTML5&&q(f)},(e=function(t){t||(y=[],_=0),g=!1,f._hasTimer=null,f._a=null,f._html5_canplay=!1,f.bytesLoaded=null,f.bytesTotal=null,f.duration=f._iO&&f._iO.duration?f._iO.duration:null,f.durationEstimate=null,f.buffered=[],f.eqData=[],f.eqData.left=[],f.eqData.right=[],f.failures=0,f.isBuffering=!1,f.instanceOptions={},f.instanceCount=0,f.loaded=!1,f.metadata={},f.readyState=0,f.muted=!1,f.paused=!1,f.peakData={left:0,right:0},f.waveformData={left:[],right:[]},f.playState=0,f.position=null,f.id3={}})(),this._onTimer=function(t){var e,r,n=!1,i={};return(f._hasTimer||t)&&f._a&&(t||(f.playState>0||1===f.readyState)&&!f.paused)&&((e=f._get_html5_duration())!==h.duration&&(h.duration=e,f.duration=e,n=!0),f.durationEstimate=f.duration,(r=1e3*f._a.currentTime||0)!==h.time&&(h.time=r,n=!0),(n||t)&&f._whileplaying(r,i,i,i,i)),n},this._get_html5_duration=function(){var t=f._iO,e=f._a&&f._a.duration?1e3*f._a.duration:t&&t.duration?t.duration:null;return e&&!isNaN(e)&&e!==1/0?e:null},this._apply_loop=function(t,e){t.loop=e>1?"loop":""},this._setup_html5=function(t){var n,i=p(f._iO,t),o=Tt?lt:f._a,s=decodeURI(i.url);if(Tt?s===decodeURI(et)&&(n=!0):s===decodeURI(v)&&(n=!0),o){if(o._s)if(Tt)o._s&&o._s.playState&&!n&&o._s.stop();else if(!Tt&&s===decodeURI(v))return f._apply_loop(o,i.loops),o;n||(v&&e(!1),o.src=i.url,f.url=i.url,v=i.url,et=i.url,o._called_load=!1)}else i.autoLoad||i.autoPlay?(f._a=new Audio(i.url),f._a.load()):f._a=Ut&&opera.version()<10?new Audio(null):new Audio,(o=f._a)._called_load=!1,Tt&&(lt=o);return f.isHTML5=!0,f._a=o,o._s=f,r(),f._apply_loop(o,i.loops),i.autoLoad||i.autoPlay?f.load():(o.autobuffer=!1,o.preload="auto"),o},r=function(){if(f._a._added_events)return!1;var t;function e(t,e,r){return f._a?f._a.addEventListener(t,e,r||!1):null}for(t in f._a._added_events=!0,ot)ot.hasOwnProperty(t)&&e(t,ot[t]);return!0},n=function(){var t;function e(t,e,r){return f._a?f._a.removeEventListener(t,e,r||!1):null}for(t in f._a._added_events=!1,ot)ot.hasOwnProperty(t)&&e(t,ot[t])},this._onload=function(t){var e=!!t||!f.isHTML5&&8===l&&f.duration;return f.loaded=e,f.readyState=e?3:2,f._onbufferchange(0),e||f.isHTML5||f._onerror(),f._iO.onload&&st(f,function(){f._iO.onload.apply(f,[e])}),!0},this._onerror=function(t,e){f._iO.onerror&&st(f,function(){f._iO.onerror.apply(f,[t,e])})},this._onbufferchange=function(t){return 0!==f.playState&&(!(t&&f.isBuffering||!t&&!f.isBuffering)&&(f.isBuffering=1===t,f._iO.onbufferchange&&f._iO.onbufferchange.apply(f,[t]),!0))},this._onsuspend=function(){return f._iO.onsuspend&&f._iO.onsuspend.apply(f),!0},this._onfailure=function(t,e,r){f.failures++,f._iO.onfailure&&1===f.failures&&f._iO.onfailure(t,e,r)},this._onwarning=function(t,e,r){f._iO.onwarning&&f._iO.onwarning(t,e,r)},this._onfinish=function(){var t=f._iO.onfinish;f._onbufferchange(0),f._resetOnPosition(0),f.instanceCount&&(f.instanceCount--,f.instanceCount||(u(),f.playState=0,f.paused=!1,f.instanceCount=0,f.instanceOptions={},f._iO={},i(),f.isHTML5&&(f.position=0)),f.instanceCount&&!f._iO.multiShotEvents||t&&st(f,function(){t.apply(f)}))},this._whileloading=function(t,e,r,n){var i=f._iO;f.bytesLoaded=t,f.bytesTotal=e,f.duration=Math.floor(r),f.bufferLength=n,f.isHTML5||i.isMovieStar?f.durationEstimate=f.duration:i.duration?f.durationEstimate=f.duration>i.duration?f.duration:i.duration:f.durationEstimate=parseInt(f.bytesTotal/f.bytesLoaded*f.duration,10),f.isHTML5||(f.buffered=[{start:0,end:f.duration}]),(3!==f.readyState||f.isHTML5)&&i.whileloading&&i.whileloading.apply(f)},this._whileplaying=function(t,e,r,n,i){var s,a=f._iO;return!isNaN(t)&&null!==t&&(f.position=Math.max(0,t),f._processOnPosition(),!f.isHTML5&&l>8&&(a.usePeakData&&e!==o&&e&&(f.peakData={left:e.leftPeak,right:e.rightPeak}),a.useWaveformData&&r!==o&&r&&(f.waveformData={left:r.split(","),right:n.split(",")}),a.useEQData&&i!==o&&i&&i.leftEQ&&(s=i.leftEQ.split(","),f.eqData=s,f.eqData.left=s,i.rightEQ!==o&&i.rightEQ&&(f.eqData.right=i.rightEQ.split(",")))),1===f.playState&&(f.isHTML5||8!==l||f.position||!f.isBuffering||f._onbufferchange(0),a.whileplaying&&a.whileplaying.apply(f)),!0)},this._oncaptiondata=function(t){f.captiondata=t,f._iO.oncaptiondata&&f._iO.oncaptiondata.apply(f,[t])},this._onmetadata=function(t,e){var r,n,i={};for(r=0,n=t.length;r<n;r++)i[t[r]]=e[r];f.metadata=i,f._iO.onmetadata&&f._iO.onmetadata.call(f,f.metadata)},this._onid3=function(t,e){var r,n,i=[];for(r=0,n=t.length;r<n;r++)i[t[r]]=e[r];f.id3=p(f.id3,i),f._iO.onid3&&f._iO.onid3.apply(f)},this._onconnect=function(t){t=1===t,f.connected=t,t&&(f.failures=0,B(f.id)&&(f.getAutoPlay()?f.play(o,f.getAutoPlay()):f._iO.autoLoad&&f.load()),f._iO.onconnect&&f._iO.onconnect.apply(f,[t]))},this._ondataerror=function(t){f.playState>0&&f._iO.ondataerror&&f._iO.ondataerror.apply(f)}},A=function(){return dt.body||dt.getElementsByTagName("div")[0]},n=function(t){return dt.getElementById(t)},p=function(t,e){var r,n,i=t||{};for(n in r=e===o?ut.defaultOptions:e)r.hasOwnProperty(n)&&i[n]===o&&("object"!=typeof r[n]||null===r[n]?i[n]=r[n]:i[n]=p(i[n],r[n]));return i},st=function(t,e){t.isHTML5||8!==l?e():i.setTimeout(e,0)},d={onready:1,ontimeout:1,defaultOptions:1,flash9Options:1,movieStarOptions:1},h=function(t,e){var r,n=!0,i=e!==o,s=ut.setupOptions,a=d;for(r in t)if(t.hasOwnProperty(r))if("object"!=typeof t[r]||null===t[r]||t[r]instanceof Array||t[r]instanceof RegExp)i&&a[e]!==o?ut[e][r]=t[r]:s[r]!==o?(ut.setupOptions[r]=t[r],ut[r]=t[r]):a[r]===o?n=!1:ut[r]instanceof Function?ut[r].apply(ut,t[r]instanceof Array?t[r]:[t[r]]):ut[r]=t[r];else{if(a[r]!==o)return h(t[r],r);n=!1}return n},tt=function(){var t=i.attachEvent,e={add:t?"attachEvent":"addEventListener",remove:t?"detachEvent":"removeEventListener"};function r(e){var r=Ot.call(e),n=r.length;return t?(r[1]="on"+r[1],n>3&&r.pop()):3===n&&r.push(!1),r}function n(r,n){var i=r.shift(),o=[e[n]];t?i[o](r[0],r[1]):i[o].apply(i,r)}return{add:function(){n(r(arguments),"add")},remove:function(){n(r(arguments),"remove")}}}(),ot={abort:Jt(function(){}),canplay:Jt(function(){var t,e=this._s;if(!e._html5_canplay){if(e._html5_canplay=!0,e._onbufferchange(0),t=e._iO.position===o||isNaN(e._iO.position)?null:e._iO.position/1e3,this.currentTime!==t)try{this.currentTime=t}catch(t){}e._iO._oncanplay&&e._iO._oncanplay()}}),canplaythrough:Jt(function(){var t=this._s;t.loaded||(t._onbufferchange(0),t._whileloading(t.bytesLoaded,t.bytesTotal,t._get_html5_duration()),t._onload(!0))}),durationchange:Jt(function(){var t,e=this._s;t=e._get_html5_duration(),isNaN(t)||t===e.duration||(e.durationEstimate=e.duration=t)}),ended:Jt(function(){this._s._onfinish()}),error:Jt(function(){var t=J[this.error.code]||null;this._s._onload(!1),this._s._onerror(this.error.code,t)}),loadeddata:Jt(function(){var t=this._s;t._loaded||Lt||(t.duration=t._get_html5_duration())}),loadedmetadata:Jt(function(){}),loadstart:Jt(function(){this._s._onbufferchange(1)}),play:Jt(function(){this._s._onbufferchange(0)}),playing:Jt(function(){this._s._onbufferchange(0)}),progress:Jt(function(t){var e,r,n=this._s,i=0,o=(t.type,t.target.buffered),s=t.loaded||0,a=t.total||1;if(n.buffered=[],o&&o.length){for(e=0,r=o.length;e<r;e++)n.buffered.push({start:1e3*o.start(e),end:1e3*o.end(e)});i=1e3*(o.end(0)-o.start(0)),s=Math.min(1,i/(1e3*t.target.duration))}isNaN(s)||(n._whileloading(s,a,n._get_html5_duration()),s&&a&&s===a&&ot.canplaythrough.call(this,t))}),ratechange:Jt(function(){}),suspend:Jt(function(t){var e=this._s;ot.progress.call(this,t),e._onsuspend()}),stalled:Jt(function(){}),timeupdate:Jt(function(){this._s._onTimer()}),waiting:Jt(function(){this._s._onbufferchange(1)})},$=function(t){return!(!t||!(t.type||t.url||t.serverURL))&&(!(t.serverURL||t.type&&Yt(t.type))&&(t.type?Y({type:t.type}):Y({url:t.url})||ut.html5Only||t.url.match(/data:/i)))},K=function(t){var e;return t&&(e=Lt?"about:blank":ut.html5.canPlayType("audio/wav")?"data:audio/wave;base64,/UklGRiYAAABXQVZFZm10IBAAAAABAAEARKwAAIhYAQACABAAZGF0YQIAAAD//w==":"about:blank",t.src=e,t._called_unload!==o&&(t._called_load=!1)),Tt&&(et=null),e},Y=function(t){if(!ut.useHTML5Audio||!ut.hasHTML5)return!1;var e,r,n,i,s=t.url||null,a=t.type||null,u=ut.audioFormats;if(a&&ut.html5[a]!==o)return ut.html5[a]&&!Yt(a);if(!Q){for(i in Q=[],u)u.hasOwnProperty(i)&&(Q.push(i),u[i].related&&(Q=Q.concat(u[i].related)));Q=new RegExp("\\.("+Q.join("|")+")(\\?.*)?$","i")}return(n=s?s.toLowerCase().match(Q):null)&&n.length?n=n[1]:a?n=(-1!==(r=a.indexOf(";"))?a.substr(0,r):a).substr(6):e=!1,n&&ut.html5[n]!==o?e=ut.html5[n]&&!Yt(n):(a="audio/"+n,e=ut.html5.canPlayType({type:a}),ut.html5[n]=e,e=e&&ut.html5[a]&&!Yt(a)),e},Z=function(){if(!ut.useHTML5Audio||!ut.hasHTML5)return ut.html5.usingFlash=!0,At=!0,!1;var t,e,r,n,i=Audio!==o?Ut&&opera.version()<10?new Audio(null):new Audio:null,s={};function a(t){var e,r,o=!1,s=!1;if(!i||"function"!=typeof i.canPlayType)return o;if(t instanceof Array){for(n=0,r=t.length;n<r;n++)(ut.html5[t[n]]||i.canPlayType(t[n]).match(ut.html5Test))&&(s=!0,ut.html5[t[n]]=!0,ut.flash[t[n]]=!!t[n].match(qt));o=s}else o=!(!(e=!(!i||"function"!=typeof i.canPlayType)&&i.canPlayType(t))||!e.match(ut.html5Test));return o}for(t in r=ut.audioFormats)if(r.hasOwnProperty(t)&&(e="audio/"+t,s[t]=a(r[t].type),s[e]=s[t],t.match(qt)?(ut.flash[t]=!0,ut.flash[e]=!0):(ut.flash[t]=!1,ut.flash[e]=!1),r[t]&&r[t].related))for(n=r[t].related.length-1;n>=0;n--)s["audio/"+r[t].related[n]]=s[t],ut.html5[r[t].related[n]]=s[t],ut.flash[r[t].related[n]]=s[t];return s.canPlayType=i?a:null,ut.html5=p(ut.html5,s),ut.html5.usingFlash=G(),At=ut.html5.usingFlash,!0},E={},D=function(){},N=function(t){return 8===l&&t.loops>1&&t.stream&&(t.stream=!1),t},j=function(t,e){return t&&!t.usePolicyFile&&(t.onid3||t.usePeakData||t.useWaveformData||t.useEQData)&&(t.usePolicyFile=!0),t},s=function(){return!1},C=function(t){var e;for(e in t)t.hasOwnProperty(e)&&"function"==typeof t[e]&&(t[e]=s);e=null},I=function(t){t===o&&(t=!1),(vt||t)&&ut.disable(t)},M=function(t){var e;if(t)if(t.match(/\.swf(\?.*)?$/i)){if(t.substr(t.toLowerCase().lastIndexOf(".swf?")+4))return t}else t.lastIndexOf("/")!==t.length-1&&(t+="/");return e=(t&&-1!==t.lastIndexOf("/")?t.substr(0,t.lastIndexOf("/")+1):"./")+ut.movieURL,ut.noSWFCache&&(e+="?ts="+(new Date).getTime()),e},b=function(){8!==(l=parseInt(ut.flashVersion,10))&&9!==l&&(ut.flashVersion=l=8);var t=ut.debugMode||ut.debugFlash?"_debug.swf":".swf";ut.useHTML5Audio&&!ut.html5Only&&ut.audioFormats.mp4.required&&l<9&&(ut.flashVersion=l=9),ut.version=ut.versionNumber+(ut.html5Only?" (HTML5-only mode)":9===l?" (AS3/Flash 9)":" (AS2/Flash 8)"),l>8?(ut.defaultOptions=p(ut.defaultOptions,ut.flash9Options),ut.features.buffering=!0,ut.defaultOptions=p(ut.defaultOptions,ut.movieStarOptions),ut.filePatterns.flash9=new RegExp("\\.(mp3|"+Gt.join("|")+")(\\?.*)?$","i"),ut.features.movieStar=!0):ut.features.movieStar=!1,ut.filePattern=ut.filePatterns[8!==l?"flash9":"flash8"],ut.movieURL=(8===l?"soundmanager2.swf":"soundmanager2_flash9.swf").replace(".swf",t),ut.features.peakData=ut.features.waveformData=ut.features.eqData=l>8},R=function(t,e){ct&&ct._setPolling(t,e)},B=this.getSoundById,U=function(){var t=[];return ut.debugMode&&t.push(F.sm2Debug),ut.debugFlash&&t.push(F.flashDebug),ut.useHighPerformance&&t.push(F.highPerf),t.join(" ")},L=function(){D("fbHandler");var t=ut.getMoviePercent(),e=F,r={type:"FLASHBLOCK"};ut.html5Only||(ut.ok()?ut.oMC&&(ut.oMC.className=[U(),e.swfDefault,e.swfLoaded+(ut.didFlashBlock?" "+e.swfUnblocked:"")].join(" ")):(At&&(ut.oMC.className=U()+" "+e.swfDefault+" "+(null===t?e.swfTimedout:e.swfError)),ut.didFlashBlock=!0,g({type:"ontimeout",ignoreInit:!0,error:r}),T(r)))},f=function(t,e,r){ft[t]===o&&(ft[t]=[]),ft[t].push({method:e,scope:r||null,fired:!1})},g=function(t){if(t||(t={type:ut.ok()?"onready":"ontimeout"}),!_t&&t&&!t.ignoreInit)return!1;if("ontimeout"===t.type&&(ut.ok()||vt&&!t.ignoreInit))return!1;var e,r,n={success:t&&t.ignoreInit?ut.ok():!vt},i=t&&t.type&&ft[t.type]||[],o=[],s=[n],a=At&&!ut.ok();for(t.error&&(s[0].error=t.error),e=0,r=i.length;e<r;e++)!0!==i[e].fired&&o.push(i[e]);if(o.length)for(e=0,r=o.length;e<r;e++)o[e].scope?o[e].method.apply(o[e].scope,s):o[e].method.apply(this,s),a||(o[e].fired=!0);return!0},y=function(){i.setTimeout(function(){ut.useFlashBlock&&L(),g(),"function"==typeof ut.onload&&ut.onload.apply(i),ut.waitForWindowLoad&&tt.add(i,"load",y)},1)},nt=function(){if(rt!==o)return rt;var t,e,r,n,s=!1,a=navigator,u=i.ActiveXObject;try{n=a.plugins}catch(t){n=void 0}if(n&&n.length)e="application/x-shockwave-flash",(r=a.mimeTypes)&&r[e]&&r[e].enabledPlugin&&r[e].enabledPlugin.description&&(s=!0);else if(u!==o&&!pt.match(/MSAppHost/i)){try{t=new u("ShockwaveFlash.ShockwaveFlash")}catch(e){t=null}s=!!t,t=null}return rt=s,s},G=function(){var t,e,r=ut.audioFormats;if(Ct&&!!pt.match(/os (1|2|3_0|3_1)\s/i)?(ut.hasHTML5=!1,ut.html5Only=!0,ut.oMC&&(ut.oMC.style.display="none")):ut.useHTML5Audio&&(ut.html5&&ut.html5.canPlayType||(ut.hasHTML5=!1)),ut.useHTML5Audio&&ut.hasHTML5)for(e in W=!0,r)r.hasOwnProperty(e)&&r[e].required&&(ut.html5.canPlayType(r[e].type)?ut.preferFlash&&(ut.flash[e]||ut.flash[r[e].type])&&(t=!0):(W=!1,t=!0));return ut.ignoreFlash&&(t=!1,W=!0),ut.html5Only=ut.hasHTML5&&ut.useHTML5Audio&&!t,!ut.html5Only},V=function(t){var e,r,n,i=0;if(t instanceof Array){for(e=0,r=t.length;e<r;e++)if(t[e]instanceof Object){if(ut.canPlayMIME(t[e].type)){i=e;break}}else if(ut.canPlayURL(t[e])){i=e;break}t[i].url&&(t[i]=t[i].url),n=t[i]}else n=t;return n},z=function(t){t._hasTimer||(t._hasTimer=!0,!Ft&&ut.html5PollingInterval&&(null===xt&&0===St&&(xt=setInterval(H,ut.html5PollingInterval)),St++))},q=function(t){t._hasTimer&&(t._hasTimer=!1,!Ft&&ut.html5PollingInterval&&St--)},H=function(){var t;if(null!==xt&&!St)return clearInterval(xt),void(xt=null);for(t=ut.soundIDs.length-1;t>=0;t--)ut.sounds[ut.soundIDs[t]].isHTML5&&ut.sounds[ut.soundIDs[t]]._hasTimer&&ut.sounds[ut.soundIDs[t]]._onTimer()},T=function(t){t=t!==o?t:{},"function"==typeof ut.onerror&&ut.onerror.apply(i,[{type:t.type!==o?t.type:null}]),t.fatal!==o&&t.fatal&&ut.disable()},it=function(){if(Nt&&nt()){var t,e,r=ut.audioFormats;for(e in r)if(r.hasOwnProperty(e)&&("mp3"===e||"mp4"===e)&&(ut.html5[e]=!1,r[e]&&r[e].related))for(t=r[e].related.length-1;t>=0;t--)ut.html5[r[e].related[t]]=!1}},this._setSandboxType=function(t){},this._externalInterfaceOK=function(t){ut.swfLoaded||(ut.swfLoaded=!0,Bt=!1,Nt&&it(),setTimeout(u,Mt?100:1))},O=function(t,e){if(gt&&yt)return!1;if(ut.html5Only)return b(),ut.oMC=n(ut.movieID),u(),gt=!0,yt=!0,!1;var r,i,s,a,l,c,p,h,d,f=e||ut.url,g=ut.altURL||f,y=A(),_=U(),v=dt.getElementsByTagName("html")[0];function m(t,e){return'<param name="'+t+'" value="'+e+'" />'}if(r=v&&v.dir&&v.dir.match(/rtl/i),t=t===o?ut.id:t,b(),ut.url=M(Ht?f:g),e=ut.url,ut.wmode=!ut.wmode&&ut.useHighPerformance?"transparent":ut.wmode,null!==ut.wmode&&(pt.match(/msie 8/i)||!Mt&&!ut.useHighPerformance)&&navigator.platform.match(/win32|win64/i)&&(kt.push(E.spcWmode),ut.wmode=null),i={name:t,id:t,src:e,quality:"high",allowScriptAccess:ut.allowScriptAccess,bgcolor:ut.bgColor,pluginspage:Vt+"www.macromedia.com/go/getflashplayer",title:"JS/Flash audio component (SoundManager 2)",type:"application/x-shockwave-flash",wmode:ut.wmode,hasPriority:"true"},ut.debugFlash&&(i.FlashVars="debug=1"),ut.wmode||delete i.wmode,Mt)s=dt.createElement("div"),l=['<object id="'+t+'" data="'+e+'" type="'+i.type+'" title="'+i.title+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0">',m("movie",e),m("AllowScriptAccess",ut.allowScriptAccess),m("quality",i.quality),ut.wmode?m("wmode",ut.wmode):"",m("bgcolor",ut.bgColor),m("hasPriority","true"),ut.debugFlash?m("FlashVars",i.FlashVars):"","</object>"].join("");else for(a in s=dt.createElement("embed"),i)i.hasOwnProperty(a)&&s.setAttribute(a,i[a]);if(_=U(),y=A())if(ut.oMC=n(ut.movieID)||dt.createElement("div"),ut.oMC.id)d=ut.oMC.className,ut.oMC.className=(d?d+" ":F.swfDefault)+(_?" "+_:""),ut.oMC.appendChild(s),Mt&&((c=ut.oMC.appendChild(dt.createElement("div"))).className=F.swfBox,c.innerHTML=l),yt=!0;else{if(ut.oMC.id=ut.movieID,ut.oMC.className=F.swfDefault+" "+_,p=null,c=null,ut.useFlashBlock||(ut.useHighPerformance?p={position:"fixed",width:"8px",height:"8px",bottom:"0px",left:"0px",overflow:"hidden"}:(p={position:"absolute",width:"6px",height:"6px",top:"-9999px",left:"-9999px"},r&&(p.left=Math.abs(parseInt(p.left,10))+"px"))),Dt&&(ut.oMC.style.zIndex=1e4),!ut.debugFlash)for(h in p)p.hasOwnProperty(h)&&(ut.oMC.style[h]=p[h]);try{Mt||ut.oMC.appendChild(s),y.appendChild(ut.oMC),Mt&&((c=ut.oMC.appendChild(dt.createElement("div"))).className=F.swfBox,c.innerHTML=l),yt=!0}catch(t){throw new Error(D("domError")+" \n"+t.toString())}}return gt=!0,!0},P=function(){return ut.html5Only?(O(),!1):!ct&&(!!ut.url&&((ct=ut.getMovie(ut.id))||(bt?(Mt?ut.oMC.innerHTML=wt:ut.oMC.appendChild(bt),bt=null,gt=!0):O(ut.id,ut.url),ct=ut.getMovie(ut.id)),"function"==typeof ut.oninitmovie&&setTimeout(ut.oninitmovie,1),!0))},_=function(){setTimeout(v,1e3)},m=function(){i.setTimeout(function(){ut.setup({preferFlash:!1}).reboot(),ut.didFlashBlock=!0,ut.beginDelayedInit()},1)},v=function(){var t,e=!1;ut.url&&(Et||(Et=!0,tt.remove(i,"load",_),rt&&Bt&&!jt||(_t||(t=ut.getMoviePercent())>0&&t<100&&(e=!0),setTimeout(function(){if(t=ut.getMoviePercent(),e)return Et=!1,void i.setTimeout(_,1);!_t&&zt&&(null===t?ut.useFlashBlock||0===ut.flashLoadTimeout?ut.useFlashBlock&&L():!ut.useFlashBlock&&W?m():g({type:"ontimeout",ignoreInit:!0,error:{type:"INIT_FLASHBLOCK"}}):0===ut.flashLoadTimeout||(!ut.useFlashBlock&&W?m():I(!0)))},ut.flashLoadTimeout))))},w=function(){function t(){tt.remove(i,"focus",w)}return jt||!Bt?(t(),!0):(zt=!0,jt=!0,Et=!1,_(),t(),!0)},c=function(t){if(_t)return!1;if(ut.html5Only)return _t=!0,y(),!0;var e,r=!0;return ut.useFlashBlock&&ut.flashLoadTimeout&&!ut.getMoviePercent()||(_t=!0),e={type:!rt&&At?"NO_FLASH":"INIT_TIMEOUT"},(vt||t)&&(ut.useFlashBlock&&ut.oMC&&(ut.oMC.className=U()+" "+(null===ut.getMoviePercent()?F.swfTimedout:F.swfError)),g({type:"ontimeout",error:e,ignoreInit:!0}),T(e),r=!1),vt||(ut.waitForWindowLoad&&!mt?tt.add(i,"load",y):y()),r},a=function(){var t,e=ut.setupOptions;for(t in e)e.hasOwnProperty(t)&&(ut[t]===o?ut[t]=e[t]:ut[t]!==e[t]&&(ut.setupOptions[t]=ut[t]))},u=function(){if(_t)return!1;function t(){tt.remove(i,"load",ut.beginDelayedInit)}if(ut.html5Only)return _t||(t(),ut.enabled=!0,c()),!0;P();try{ct._externalInterfaceTest(!1),R(!0,ut.flashPollingInterval||(ut.useHighPerformance?10:50)),ut.debugMode||ct._disableDebug(),ut.enabled=!0,ut.html5Only||tt.add(i,"unload",s)}catch(t){return T({type:"JS_TO_FLASH_EXCEPTION",fatal:!0}),I(!0),c(),!1}return c(),t(),!0},S=function(){return!k&&(k=!0,a(),!rt&&ut.hasHTML5&&ut.setup({useHTML5Audio:!0,preferFlash:!1}),Z(),!rt&&At&&(kt.push(E.needFlash),ut.setup({flashLoadTimeout:1})),dt.removeEventListener&&dt.removeEventListener("DOMContentLoaded",S,!1),P(),!0)},X=function(){return"complete"===dt.readyState&&(S(),dt.detachEvent("onreadystatechange",X)),!0},x=function(){mt=!0,S(),tt.remove(i,"load",x)},nt(),tt.add(i,"focus",w),tt.add(i,"load",_),tt.add(i,"load",x),dt.addEventListener?dt.addEventListener("DOMContentLoaded",S,!1):dt.attachEvent?dt.attachEvent("onreadystatechange",X):T({type:"NO_DOM2_EVENTS",fatal:!0})}i.SM2_DEFER!==o&&SM2_DEFER||(s=new a),"object"==typeof t&&t&&"object"==typeof t.exports?(t.exports.SoundManager=a,t.exports.soundManager=s):void 0===(n=function(){return{constructor:a,getInstance:function(t){if(!i.soundManager&&t instanceof Function){var e=t(a);e instanceof a&&(i.soundManager=e)}return i.soundManager}}}.call(e,r,e,t))||(t.exports=n),i.SoundManager=a,i.soundManager=s}(window)}).call(e,r(46)(t))},function(t,e,r){var n,i,o,s,a,u,l,c,p,h,d;d=function(t){return(window.opener||window.parent).postMessage(JSON.stringify(t),"*")},o=window.location.hash.replace("#",""),a={},n=null,u={load:function(){return d({t:"w",id:o})},notify:function(t,e){return t=t.type||t,d({t:"ee",id:o,d:e,e:t})}},c=function(t,e){var r,i,a,u,l;if(null==e&&(e={}),i=e.preview||e.source.frames[o])return i.Blogvio.auth.token(n),window.require._require.push(i.require),r=(a=i.getData()).composition,l=a.widget,(u=a.user)||(u={id:"591bf4ecd85c6d076c787001",premium:!1,upload_token:"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI1OTFiZjRlY2Q4NWM2ZDA3NmM3ODcwMDEiLCJjb250ZXh0Ijp7ImlkIjoiYXBwIiwibmFtZSI6ImFwcCJ9LCJtYXhRdW90YSI6MTAwMDAwMDAwMCwiYXVkIjoiZmlsZS11cGxvYWQiLCJleHAiOjE2MjI2MjY4NTF9.Hg_6L3taBamqc9hkxk9cMWh3HihwyvtMzev_K384xPE"}),s(r,l,i,u)},s=function(t,e,n,i){var o,s,c;return(o=$("body")).toggleClass("is-popup",!!window.opener),s=r(131),c=(null!=i?i.premium:void 0)||!1,r(113).default.init({user:i,uploadToken:(null!=i?i.upload_token:void 0)||""}),window.editor=new s({el:o,remote:n,initOptions:a,premium:c}),t?editor.edit(t.id).then(l).fail(function(t){return console.log(t.stack)}):editor.new(e.id).then(l).fail(function(t){return console.log(t.stack)}),editor.bind("skin:select",function(t){return u.notify("skin:select",t)}),editor.$bind("skin:save",function(t,e){return u.notify("skin:save",e)}),editor.$bind("skin:destroy",function(t,e){return u.notify("skin:destroy",e)}),editor.$bind("composition:save",u.notify),editor.$bind("composition:temporary:save",u.notify),editor.$bind("content:auth-req",u.notify),editor.$bind("step:intent",u.notify),editor.$bind("Control:upgrade",u.notify),editor.$bind("Content:upgrade",u.notify),$(window).on("unload",window.editor.release.bind(editor)),editor},l=function(){return u.notify("editor:init")},i=function(t){var e,r,n;for(e in r={},t)"object"!=typeof(n=t[e])&&(r[e]=n);return r},p=function(t){return Widgetic.Event.on(window,t,function(t){return u.notify(Widgetic.UI.Editor.RELAY,i(t))})},h=function(){var t,e,r,i;return r={ready:c,step:function(t){return window.editor.step(t.d)},token:function(t){var e;return t.d?(Blogvio.auth.token(n=t.d),null!=(e=window.editor)?e.preview.remote.Blogvio.auth.token(n):void 0):Blogvio.auth.disconnect()},cont:function(t){return window.editor.el.trigger("content:"+t.d.source+":add",{items:t.d.data})},opts:function(t){return window.editor?window.editor.composition?window.editor.setOptions(t.d):window.editor.setInitOptions(t.d):a=t.d},ree:function(t){return p(t.d)}},i=window.location,t=decodeURIComponent((i.search.match(/(?:lo=)([^\#\&$]*)/)||[0,i.origin])[1]),e=function(e){var n,i,o,s;if(e.origin===t)try{n=JSON.parse(e.data),"function"==typeof r[o=n.t]&&r[o](n,{source:e.source})}catch(t){i=t,null!=(s=window.localStorage)&&s.debug_on_error,console.error(i.stack)}},Blogvio.Event.on(window,"load",function(){return Blogvio.Event.on(window,"message",e),u.load()}),Blogvio.Event.on(window,"unload",function(){return window.editor.release()})},t.exports={run:h,ready:c}},function(t,e,r){var n,i,o,s,a,u,l,c=function(t,e){return function(){return t.apply(e,arguments)}},p={}.hasOwnProperty;o=window.require("spine/controller"),i=window.require("spine/controller/container"),l=r(132),a=r(182),u=window.require("core/models/widget"),n=window.require("core/models/composition"),window.require("core/models/skin"),window.require("core/models/content"),s=function(t){function e(t){if(this._onSkinItemSelected=c(this._onSkinItemSelected,this),this._initialize=c(this._initialize,this),this._editComposition=c(this._editComposition,this),this._newComposition=c(this._newComposition,this),!t.remote)throw new Error("Remote UI.composition is missing!");t.premium||(t.premium=!1),e.__super__.constructor.apply(this,arguments),this.preview=new a(this.remote),this.editor=new l({premium:this.premium}),this.append(this.editor),$("html").toggleClass("isTouch",!(void 0===document.documentElement.ontouchstart))}return function(t,e){for(var r in e)p.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,o),e.include(i),e.VERSION="1.9.24",e.prototype.events={"SkinItem:selected":"_onSkinItemSelected"},e.prototype.hasPendingChange=function(){return this.editor.hasPendingChange()},e.prototype.initSave=function(){return this.editor.initSave()},e.prototype.new=function(t){return this.preview.startLoading(),u.load(t).then(this._newComposition).then(this._initialize).then(function(t){return function(){return t.setOptions()}}(this)).fail(function(t){return console.error(t)})},e.prototype.edit=function(t){return n.load(t).then(this._editComposition).then(this._initialize).then(function(t){return function(){return t.setOptions()}}(this)).fail(function(t){return console.error(t)})},e.prototype.step=function(){var t;return(t=this.editor).step.apply(t,arguments)},e.prototype.selectSkin=function(t){return this.editor.selectSkin(t)},e.prototype._newComposition=function(t){return this.widget=t,this.composition=new n({widget_id:this.widget.id,width:this.widget.width,height:this.widget.height}),this.composition.save({ajax:!1})},e.prototype._editComposition=function(t){return this.composition=t,this.widget=this.composition.getWidget()},e.prototype._initialize=function(){return this.editor.for(this.composition),this.preview.load(this.composition)},e.prototype._onSkinItemSelected=function(t,e){return this.trigger("skin:select",e),this.preview.setSkin(e)},e.prototype.setInitOptions=function(t){this.initOptions=t},e.prototype.setOptions=function(t){return this.editor.setOptions($.extend({step:"skin"},t||this.initOptions))},e.prototype.release=function(){return this._release(this),this.preview.release(),e.__super__.release.apply(this,arguments)},e}(),t.exports=s},function(t,e,r){var n,i,o,s,a,u,l,c,p=function(t,e){return function(){return t.apply(e,arguments)}},h={}.hasOwnProperty;u=window.require("spine/controller/tabs"),window.require("core/models/content"),window.require("core/models/skin"),window.require("core/models/composition"),window.require("core/models/widget"),a=r(133),n=r(141),i=r(175),s=r(179),r(119),c=window.require("spine/utils/timestamp"),o=r(180),l=function(t){function e(){this.onBeforeUnload=p(this.onBeforeUnload,this),this.activateSource=p(this.activateSource,this),this.setCompositionName=p(this.setCompositionName,this),this.skin_editor=p(this.skin_editor,this),this.navigation=p(this.navigation,this),this._onInitialized=p(this._onInitialized,this),this._waitForInit=p(this._waitForInit,this),this._onViewChange=p(this._onViewChange,this),this._updateLoggedInStatus=p(this._updateLoggedInStatus,this),this._updatePersistedStatus=p(this._updatePersistedStatus,this),this._onValidateLength=p(this._onValidateLength,this),c("WidgetEditor:constructor"),e.__super__.constructor.apply(this,arguments),this.children(function(t){return function(e){return"function"==typeof e.setPremium?e.setPremium(t.premium):void 0}}(this)),this.refreshElements(),this.el.append(this.tabs.el),o.place(this.el),Blogvio.pubsub.subscribe("api/token/update",this._updateLoggedInStatus),this.el.attr("editorVersion","3.11.3")}return function(t,e){for(var r in e)h.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,u),e.prototype.tabContainer=r(119),e.prototype.tabRenderer=r(181),e.prototype.className="editor",e.prototype.tabContainerClass="editor-footer",e.prototype.containerClass="editor-container",e.prototype.events={viewChange:"_onViewChange","Footer:step":"_onStep","Breadcrumb:step":"_onStep","Save:close":"_onSaveClose","DetailsEditor:empty":"_onDetailsEditorEmpty","editor:content:notification":"_onContentNotification","editor:content:browserState":"_onContentBrowserState"},e.prototype.controllers={skin:a,content:n,details:i,save:s},e.prototype.steps={skin:"skin",edit_skin:"skin",theme:"skin",content:"content",details:"details",done:"save"},e.prototype.stepValidators={skin:function(){return!!this.composition||console.warn("No composition set")},edit_skin:function(){return this.stepValidators.skin.call(this)&&null==this.canEditSkin||this.canEditSkin},theme:function(){return this.stepValidators.skin.call(this)},content:function(){return!!this.stepValidators.skin.call(this)&&(!this.hasPendingChange()||(this.initSave(),this.step("skin"),!1))},details:function(){return!!this.stepValidators.content.call(this)&&(!!this.composition.hasEnoughContent()||(this.content.notificator.notify(this.composition.validateLength().errorMsg),this.step("content"),!1))},done:function(){return!!this.stepValidators.details.call(this)}},e.prototype.for=function(t){return c("WidgetEditor:for"),this.initialize(t),this.skin.for(this.composition),this.content.for(this.composition),this.details.for(this.composition),this.save.for(this.composition),this},e.prototype.initialize=function(t){return c("WidgetEditor:initialize"),this.stopListening(this.composition),this.composition=t,this._waitForInit(),this._updatePersistedStatus(),this._updateLoggedInStatus(),this.listenTo(this.composition,"validateLength",this._onValidateLength),this.composition.validateLength(),$(window).on("beforeunload",this.onBeforeUnload)},e.prototype.hasPendingChange=function(){return this.skin.hasPendingChange()},e.prototype.initSave=function(){return this.skin.initSave()},e.prototype.step=function(t){var e;return this.steps[t]?(e=this[this.steps[t]],this.stepValidators[t].call(this)&&e.active(t),this._updatePersistedStatus()):console.warn("The editor does not have the "+t+" step.")},e.prototype.selectSkin=function(t,e){return null==e&&(e=!0),this.skin.select(t,e)},e.prototype._onStep=function(t,e){return this.step(e),this.$trigger("step:intent",{step:e,skin_pending:this.hasPendingChange(),content:this.composition.hasEnoughContent()})},e.prototype._onValidateLength=function(t,e,r){if(this.composition)return this.el.attr({minValid:e||"min"!==r,maxValid:e||"max"!==r})},e.prototype._updatePersistedStatus=function(){return this.el.attr("persisted-comp",this.composition.isPersisted())},e.prototype._updateLoggedInStatus=function(){var t;return t="connected"===Blogvio.auth.status().status,this.el.toggleClass("anonymous-user",!t)},e.prototype._onViewChange=function(t,e){return this.el.attr("current-view",e)},e.prototype._waitForInit=function(){return this.initCount=0,this.listenToOnce(this.skin,"initialized",this._onInitialized),this.listenToOnce(this.content,"initialized",this._onInitialized),this.listenToOnce(this.details,"initialized",this._onInitialized)},e.prototype._onInitialized=function(){if(3==++this.initCount)return this.trigger("initialized")},e.prototype._onContentNotification=function(t,e){return this.el.attr("notification-visible",e.show)},e.prototype._onContentBrowserState=function(t,e){return this.el.attr("content-browser-service",e.service),this.el.attr("content-browser-auth",e.authenticated)},e.prototype._onDetailsEditorEmpty=function(){return this.step("content")},e.prototype._onSaveClose=function(){return this.step("details")},e.prototype.setOptions=function(){var t;return t={skin_editor:"skin_editor",step:"step",navigation:"navigation",skin:"selectSkin",composition:"setCompositionName",sources:"addContentSources",active_source:"activateSource"},function(e){var r,n,i,o;for(i in null==e&&(e={}),o=[],t)r=t[i],(n=e[i])&&o.push("function"==typeof this[r]?this[r](n):void 0);return o}}(),e.prototype.navigation=function(t){var e;return null!=t.steps&&this.el.attr("data-steps",t.steps.join(" ")),(e=this.tabs).setOptions.apply(e,arguments)},e.prototype.skin_editor=function(t){return null==t&&(t={}),null!=t.enabled&&(this.canEditSkin=t.enabled),this.skin.setOptions(t)},e.prototype.addContentSources=function(t){var e,r,n;for(n in null==t&&(t={}),e=[],t)r=t[n],e.push(this.content.addBrowser(r,n));return e},e.prototype.setCompositionName=function(t){if(null==t&&(t={}),null!=t.name)return this.composition.name=t.name},e.prototype.activateSource=function(t){return this.content.focusBrowser(t)},e.prototype.release=function(){return this._release(this),e.__super__.release.apply(this,arguments)},e.prototype.onBeforeUnload=function(){if(this.hasPendingChange())return"There are some unsaved changes!"},e}(),t.exports=l},function(t,e,r){var n,i,o,s,a,u,l,c,p,h=function(t,e){return function(){return t.apply(e,arguments)}},d={}.hasOwnProperty;o=window.require("spine/controller"),i=window.require("spine/controller/container"),n=window.require("spine/controller/activateable"),l=r(134),a=r(137),u=r(139),s=r(140),p=window.require("core/models/skin"),window.require("core/models/composition"),c=function(t){function e(){this.release=h(this.release,this),this.setOptions=h(this.setOptions,this),this.edit_skin=h(this.edit_skin,this),this.activate=h(this.activate,this),this._onSkinChange=h(this._onSkinChange,this),this._onSkinItemSelected=h(this._onSkinItemSelected,this),this._onSkinCreate=h(this._onSkinCreate,this),this._onSkinDestroy=h(this._onSkinDestroy,this),this._onSkinSave=h(this._onSkinSave,this),this.initialize=h(this.initialize,this),e.__super__.constructor.apply(this,arguments),this.savePopup=new u({place:this.el}),this.deletePopup=new s({place:this.el})}return function(t,e){for(var r in e)d.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,o),e.prototype.className="skin-config",e.prototype.title="Theme",e.prototype.nextTitle="Skin",e.include(i),e.include(n),e.prototype.controllers={selector:l,editor:a},e.prototype.events={saveItem:"saveItem",deleteItem:"deleteItem","SkinItem:selected":"_onSkinItemSelected"},e.prototype.setPremium=function(t){return this.premium=t,this.editor.setAccessLevel(+this.premium)},e.prototype.initSave=function(){return this.selector.initSave()},e.prototype.hasPendingChange=function(){return this.selector.hasPendingChange()},e.prototype.saveItem=function(t,e){return null==e&&(e={}),t.stopPropagation(),this.savePopup.saveItem(e.controller,e.item)},e.prototype.deleteItem=function(t,e){return null==e&&(e={}),t.stopPropagation(),this.deletePopup.deleteItem(e.controller,e.item)},e.prototype.select=function(t,e){var r;return null==e&&(e=!1),t.widget_id===this.widget.id&&(r=t,this.selector.select(r.id,e))},e.prototype.for=function(t){return this.composition=t,this.widget=this.composition.getWidget(),this.initialize(),this},e.prototype.initialize=function(t){var e,r;return this.composition?this.widget?(this.stopListening(),this.listenTo(p,"save",this._onSkinSave),this.listenTo(p,"destroy",this._onSkinDestroy),this.listenTo(p,"create",this._onSkinCreate),this.listenTo(p,"change",this._onSkinChange),r=(r=p.findAllByAttribute("widget_id",this.widget.id)).filter(function(t){return t.isPreset()}).concat(r.filter(function(t){return!t.isPreset()})),e=this.widget.skinMeta,this.editor.parseMeta(e,this.composition),this.selector.refresh(r),this.editor.display(),this.select(this.composition.getSkin()||r[0]),this.trigger("initialized")):console.warn("No widget set"):console.warn("No composition set")},e.prototype._onSkinSave=function(t,e){if(null==e&&(e={}),e.ajax||e.fromApi)return this.$trigger("skin:save",t)},e.prototype._onSkinDestroy=function(t,e){return this.$trigger("skin:destroy",t)},e.prototype._onSkinCreate=function(t){var e;if(t.widget_id===(null!=(e=this.widget)?e.id:void 0))return this.initialize(),this.selector.toggleBtn(),this.selector.select(t.id)},e.prototype._onSkinItemSelected=function(t,e){var r;return this.composition.updateAttribute("skin_id",e.id,{ajax:!1}),null!=(r=this.currentSkin)&&r.used(-1),this.currentSkin=e,this.currentSkin.used(1),this.editor.setSkin(e)},e.prototype._onSkinChange=function(t,e,r){var n;if(this.editor.skinChanged(t),(null!=(n=this.currentSkin)?n.eql(t):void 0)&&r.changedID)return this.composition.updateAttribute("skin_id",t.id,{ajax:!1})},e.prototype.activate=function(t){return n.activate.apply(this,arguments),this.$trigger("viewChange","skin"),"function"==typeof this[t]&&this[t](),this},e.prototype.edit_skin=function(){return this.delay(this.selector.editSkinState,15)},e.prototype.setOptions=function(t){if(null!=t.enabled&&!t.enabled)return this.selector.hideEditBtn()},e.prototype.release=function(){return this.currentSkin.reset(),e.__super__.release.apply(this,arguments)},e}(),t.exports=c},function(t,e,r){var n,i,o,s,a=function(t,e){return function(){return t.apply(e,arguments)}},u={}.hasOwnProperty;i=window.require("spine/controller"),n=window.require("spine/controller/container"),o=r(135),r(7),window.require("core/models/skin"),s=function(t){function e(){this.onMouseLeaveBtn=a(this.onMouseLeaveBtn,this),this.hideEditBtn=a(this.hideEditBtn,this),this.toggleBtn=a(this.toggleBtn,this),this.editSkinState=a(this.editSkinState,this),this.expand=a(this.expand,this),this.toggleState=a(this.toggleState,this),this.hasPendingChange=a(this.hasPendingChange,this),e.__super__.constructor.apply(this,arguments),this.prepend(r(40),$('<span class="after">')),this.toggleState()}return function(t,e){for(var r in e)u.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.prototype.className="skin-presets",e.include(n),e.prototype.canExpand=!0,e.prototype.controllers={list:o},e.prototype.elements={".toggle-skin-edit":"btn"},e.prototype.events={"click .toggle-skin-edit":"toggleState","mouseleave .toggle-skin-edit":"onMouseLeaveBtn"},e.prototype.hasPendingChange=function(){return this.list.pending},e.prototype.initSave=function(){return this.list.initSave()},e.prototype.refresh=function(t){return this.list.refresh(t)},e.prototype.select=function(t,e){return this.list.select(t,e)},e.prototype.toggleState=function(){return(this.canExpand&&"expanded"===this.state?this.editSkinState:this.expand)()},e.prototype.expand=function(){return this.hasPendingChange()?this.initSave():(this.btn.addClass("no-hover"),this.el.addClass("expanded"),this.list.setState(this.state="expanded"))},e.prototype.editSkinState=function(){return this.btn.addClass("no-hover"),this.el.removeClass("expanded"),this.list.setState(this.state="contracted")},e.prototype.toggleBtn=function(t){return this.btn.toggleClass("no-action",null!=t&&"boolean"==typeof t?t:this.hasPendingChange())},e.prototype.hideEditBtn=function(){return this.canExpand=!this.btn.hide()},e.prototype.onMouseLeaveBtn=function(){return this.btn.removeClass("no-hover")},e}(),t.exports=s},function(t,e,r){var n,i,o,s,a,u=function(t,e){return function(){return t.apply(e,arguments)}},l={}.hasOwnProperty;n=window.require("spine/controller/activator"),a=window.require("core/models/skin"),s=r(5),i=r(136),o=function(t){function e(){this.onItemDestroy=u(this.onItemDestroy,this),this.repositionChild=u(this.repositionChild,this),this.refreshScroll=u(this.refreshScroll,this),this.scrollToItem=u(this.scrollToItem,this),this.scrollToActive=u(this.scrollToActive,this),this.setState=u(this.setState,this),this._canceled=u(this._canceled,this),this._changed=u(this._changed,this),this.refresh=u(this.refresh,this),this.select=u(this.select,this),e.__super__.constructor.apply(this,arguments),this.last_scroll={expanded:0,contracted:0},this.pending=!1,this.state="expanded",this.$bind("changed",this._changed).$bind("cancel",this._canceled),this.listenTo(a,"destroy",this.onItemDestroy),this.$bind("SkinItem:activate",function(t){return function(e,r){return t.activeChild=r.item,t.scrollToActive()}}(this)),this.listenTo(a,"create",this.scrollToActive)}return function(t,e){for(var r in e)l.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,n),e.prototype.className="presets-list",e.include(s),e.prototype.select=function(t,e){return this.activeChild=t?this.children().filter(function(e){return e.item.id===t})[0]:this.children()[0],this.activeChild.active({force:e})},e.prototype.refresh=function(t){var e;return this.children(function(t){return t.release()}),this.append.apply(this,function(){var r,n,o;for(o=[],r=0,n=t.length;r<n;r++)e=t[r],o.push(new i({item:e}));return o}()),this.pending=!1,this.delay(this.refreshScroll,850),this},e.prototype.initSave=function(){return this.children(function(t){return t.isActive()})[0].initSave()},e.prototype._changed=function(t,e){var r,n;if(!this.pending)return this.pending=!0,this.scroll().disable(),r=this.activeChild.el.index(),n=this.scroll().offset().top,this.children(function(t){return t.positionOnChange(r,n)})},e.prototype._canceled=function(){if(this.pending)return this.pending=!1,this.repositionChild(),this.scroll().disable(),this.delay(function(t){return function(){return t.refreshScroll(),t.skin=t.activeChild.item,t.scrollToActive()}}(this),850)},e.prototype.setState=function(t){var e;return this.last_scroll[this.state]=(null!=(e=this.container)?e.scrollTop():void 0)||0,this.state=t,this.repositionChild(),this.scroll().disable(),this.delay(function(t){return function(){return t.scrollToItem(t.activeChild,t.refreshScroll)}}(this),750)},e.prototype.scrollToActive=function(t){return t instanceof a?this.skin=t:this.skin&&this.skin.id===this.activeChild.item.id?(this.skin=null,this.scrollToItem(this.activeChild)):void 0},e.prototype.scrollToItem=function(t,e){var r;return null==t&&(t=this.activeChild),null==e&&(e=function(){}),r=(null!=t?t.el.get(0).offsetTop:void 0)+parseInt(null!=t?t.el.css("padding-top"):void 0)||0,(r-=this.container.height()-(null!=t?t.el.height():void 0))>0?this.container.animate({scrollTop:r},450,e):e()},e.prototype.refreshScroll=function(t){if(t||!this.pending)return this.scroll().enable()},e.prototype.repositionChild=function(t){return this.children(function(e){return e.reposition(null!=t?t.destroyed:void 0)}),this.scroll().update()},e.prototype.onItemDestroy=function(){return this.scroll().disable(),this.repositionChild.apply(this,arguments),this.delay(this.refreshScroll,850)},e}(),t.exports=o},function(t,e){var r,n,i,o,s=function(t,e){return function(){return t.apply(e,arguments)}},a={}.hasOwnProperty;r=window.require("spine/controller/activateable"),n=window.require("spine/controller"),i=window.require("core/models/skin"),o=function(t){function e(t){this.positionOnChange=s(this.positionOnChange,this),this.reposition=s(this.reposition,this),this.getPosition=s(this.getPosition,this),this.width=s(this.width,this),this.state=s(this.state,this),this._enter=s(this._enter,this),this.cancelSave=s(this.cancelSave,this),this.allChanges=s(this.allChanges,this),this.deactivate=s(this.deactivate,this),this.activate=s(this.activate,this),this.uses=s(this.uses,this),this.added=s(this.added,this),t.tag=null==t.item.user_id?"span":"div",e.__super__.constructor.apply(this,arguments),this.uses(this.item,{used:!0}).$addClass(null==this.item.user_id?"is-preset":"isnt-preset"),this.colors=i.meta(this.item.widget_id).colorAttributes.concat(),this.render(),this.item.freeze(),this.listenTo(this.item,"update",this.uses),this.listenTo(this.item,"update",this.allChanges)}return function(t,e){for(var r in e)a.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,n),e.prototype.className="presets-list-item",e.include(r),e.prototype.template="editor/views/skinitem",e.prototype.events={click:"active","mouseenter .presets-list-colors":"_enter","click .presets-list-delete":"initDelete","click .cancel":"cancelSave","click .save":"initSave"},e.prototype.interval=0,e.prototype.height=60,e.prototype.added=function(){return e.__super__.added.apply(this,arguments),this.reposition(!0),this.delay(function(t){return function(){return t.el.addClass("skin--added")}}(this)),this},e.prototype.initSave=function(){return this.$trigger("saveItem",{item:this.item,controller:this})},e.prototype.uses=function(t,e){return null==e&&(e={}),e.used?(this.el.toggleClass("can-delete",null!=t.user_id&&!Boolean(t.uses>>0)),this):this},e.prototype.activate=function(t){return this.isActive()&&!0!==t.force?this:(r.activate.apply(this,arguments),this.$trigger("SkinItem:activate",$.extend({},t,{item:this})),this.$trigger("SkinItem:selected",this.item),this)},e.prototype.deactivate=function(){return r.deactivate.apply(this,arguments),this._countChanges()>0&&this.cancelSave(),this},e.prototype.allChanges=function(t,e){var r,n,o,s,a,u,l,c;if(null==e&&(e={}),!(e.used||(r=e.attribute,o=i.meta(t.widget_id).colorAttributes,null!=r&&((this.changes||(this.changes={}))[r]=1,this.$trigger("changed").$addClass("changed").$(".total").text(a=this._countChanges()),this.$(".text").text(1===a?"change":"changes"),o.indexOf(r)<0)))){for(c=[],u=0,l=(s=null!=r?[r]:o).length;u<l;u++)n=s[u],c.push(this.$("[data-name='"+n+"']").css({backgroundColor:this.item[n]}));return c}},e.prototype.cancelSave=function(){return this.changes={},this.$removeClass("changed").$trigger("cancel").item.reset()},e.prototype.override=function(){return this.changes={},this.$removeClass("changed").$trigger("cancel").item.freeze()},e.prototype.initDelete=function(t){return t.stopImmediatePropagation(),t.preventDefault(),this.$trigger("deleteItem",{item:this.item,controller:this})},e.prototype._countChanges=function(){var t;return function(){var e,r;for(t in r=[],e=this.changes)e[t],r.push(t);return r}.call(this).length},e.prototype._enter=function(t){if("expanded"===this.state())return t.preventDefault()},e.prototype.state=function(){return this.parent().state},e.prototype.width=function(){return{expanded:245,contracted:100}[this.state()]},e.prototype.getPosition=function(){return"expanded"===this.state()?{top:this.height*parseInt(this.index/2)-20,left:this.width()*(this.index%2)}:{top:this.height*this.index-20,left:0}},e.prototype.reposition=function(t){return t&&(this.index=this.el.index()||0),this.el.css(this.getPosition())},e.prototype.positionOnChange=function(t,e){return this.isActive()?this.el.css({top:e-20,left:0}):this.el.css({left:0,top:this.height*(this.index-t)-20+(t<this.index?440+e:e)})},e}(),t.exports=o},function(t,e,r){var n,i,o,s,a,u,l,c,p,h,d,f=function(t,e){return function(){return t.apply(e,arguments)}},g=function(t,e){for(var r in e)y.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},y={}.hasOwnProperty;c=window.require("spine/controller/tabs"),s=r(138),window.require("core/models/skin"),i=window.require("spine/controller/activator"),n=window.require("spine/controller/activateable"),o=window.require("spine/controller"),p=r(13).createPopup,d=r(39),h=function(t,e,r){if(-1!==r&&(e[r].before(t.el),!t.isVisible()))return h(t,e,r-1)},u=function(t){function e(){return this.isVisible=f(this.isVisible,this),e.__super__.constructor.apply(this,arguments)}return g(e,o),e.include(n),e.prototype.events={click:"active"},e.prototype.isVisible=function(){return 0===this.el.position().top},e}(),l=function(t){function e(){this._onChildActivate=f(this._onChildActivate,this),this.tabClick=f(this.tabClick,this),this.afterAdd=f(this.afterAdd,this),this.clear=f(this.clear,this),this.toggleItem=f(this.toggleItem,this),this.hideList=f(this.hideList,this),e.__super__.constructor.apply(this,arguments),this.tabsByName={},this.listenTo($(document),"click",function(t){return function(e){var r;if(!$(e.target).is(".multi-tabs-toggle"))return null!=(r=t.popup)?r.hide():void 0}}(this)),this.el.prepend(this.toggle=$("<div class='multi-tabs-toggle' data-icon='❯'></div>")),this.list=$("<div class='multi-tabs-list'></div>"),this.list.on("click",".multi-tab-item",this.tabClick)}return g(e,i),e.prototype.containerClass="skin-editor-tabs-list",e.prototype.events={"click .multi-tabs-toggle":"toggleItem","click .activateable":"hideList"},e.prototype.hideList=function(t){var e,r;return null!=(r=this.popup)&&r.hide(),(e=$(t.target).controller()).el.hasClass("hidden")||this.list.children().removeClass("active"),this.list.children().each(function(t,r){var n;if((n=$(r)).data("tab")===e)return n.addClass("active").siblings().removeClass("active")})},e.prototype.toggleItem=function(t){return this._createPopup().then(function(t){return function(){return t.popup.visible?t.popup.hide():t.popup.show()}}(this))},e.prototype.clear=function(){return this.list.empty(),this.tabsByName={},this.children().forEach(function(t){return function(e){return t.stopListening(e)}}(this)),this.toggle.hide()},e.prototype.afterAdd=function(t){var r;return e.__super__.afterAdd.apply(this,arguments),this.listenTo(t,"activate",this._onChildActivate),this.list.append(r=$("<div class='multi-tab-item'>"+t.panel.tabTitle+"</div>")),this.tabsByName[t.panel.tabTitle]=t,r.data("tab",t),t.el.data("multi-tab-list-item",r)},e.prototype.tabClick=function(t){var e;return null!=(e=this.popup)&&e.hide(),$(t.target).data("tab").active()},e.prototype.update=function(t,e){var r,n,i,o,s,a,u;for(u in o={},t)for(r in n=t[u],o[u]=!0,n)if(a=n[r],d(a.if,e)){o[u]=!1;break}for(u in o)i=o[u],this.tabsByName[u].el.toggleClass("empty",i),null!=(s=this.tabsByName[u].el.data("multi-tab-list-item"))&&s.toggleClass("empty",i);return this.children(function(t){return t.el.is(".active.empty")}).map(function(t){return function(){return t.children(function(t){return t.el.is(":not(.empty)")})}}(this)).forEach(function(t){return t[0].active()}),this._updateVisibleTabs(),!0},e.prototype._onChildActivate=function(t,e){return this.children().forEach(function(t){return t.$removeClass("active")}),t.$addClass("active"),t.isVisible()||h(t,this.children().map(function(t){return t.el}),2),this._updateVisibleTabs()},e.prototype._updateVisibleTabs=function(){var t,e,r;if((r=this.children().map(function(t){return{tab:t,visible:t.isVisible()}})).forEach(function(t){return t.tab.el.data("multi-tab-list-item").toggle(!t.visible)}),t=r.map(function(t){return t.visible}).reduce(function(t,e){return t&&e}),this.toggle.toggle(!t),t)return null!=(e=this.popup)?e.hide():void 0},e.prototype._createPopup=function(){return this.popupPromise?this.popupPromise:this.popupPromise=p({topOffset:25,leftOffset:23,anchor:this.toggle}).then(function(t){return function(e){return t.popup=e,t.popup.append(t.list)}}(this)).catch(function(t){return console.error(t.stack)})},e}(),a=function(t){function e(){return this.updateSkin=f(this.updateSkin,this),this.parseMeta=f(this.parseMeta,this),e.__super__.constructor.apply(this,arguments)}return g(e,c),e.prototype.tabRenderer=u,e.prototype.className="skin-editor",e.prototype.tabContainerClass="skin-editor-tabs",e.prototype.tabContainer=l,e.prototype.containerClass="skin-editor-container",e.prototype.tabTemplate=function(t){return t.panel.tabTitle},e.prototype.setAccessLevel=function(t){this.accessLevel=t},e.prototype.parseMeta=function(t,e){var r,n,i,o,a,u;for(this.meta=t,r=0,n=(o=this.children()).length;r<n;r++)o[r].release();for(u in this.tabs.clear(),a=this.meta.tabs)i=a[u],this.append(new s({meta:i,tabTitle:u,composition:e,accessLevel:this.accessLevel}));return this.tabs.update(this.meta.tabs,e.getSkin())},e.prototype.display=function(t){var e;return null==t&&(t=0),null!=(e=this.children()[t])?e.active():void 0},e.prototype.updateSkin=function(t){var e,r,n,i,o,s;for(e in i=!1,s=this.meta.tabs)for(n in o=s[e])r=o[n],null==t[n]&&((i||(i={}))[n]=r.options.default);if(i)return t.updateAttributes(i,{from:this,ajax:!1})},e.prototype.setSkin=function(t){return this.updateSkin(t),this.children(function(e){return e.skinLoad(t)})},e.prototype.skinChanged=function(t){return this.tabs.update(this.meta.tabs,t)},e}(),t.exports=a},function(t,e,r){var n,i,o,s,a,u=function(t,e){return function(){return t.apply(e,arguments)}},l={}.hasOwnProperty;o=window.require("spine/controller"),i=window.require("spine/controller/container"),n=window.require("spine/controller/activateable"),window.require("core/models/skin"),s=r(5),a=function(t){function e(){this.onScroll=u(this.onScroll,this),this.skinLoad=u(this.skinLoad,this),e.__super__.constructor.apply(this,arguments),this.bind("activate",function(t){return function(){if(t.skin)return t.skinLoad(t.skin)}}(this))}return function(t,e){for(var r in e)l.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,o),e.prototype.className="controls",e.include(i),e.include(n),e.include(s),e.prototype.skinLoad=function(t){var e,r,n,i,o,s,a;if(null==this.skin)for(r in a=this.meta)i=a[r],e=window.require(i.control),o=this.accessLevel>=(i.access||0),s=i.options,n=i.if,o||(s.readonly=!0),this.append(new e({item:t,attribute:r,options:s,composition:this.composition,isAccesible:o,conditions:n}));return this.children(function(e){return e.setItem(t)}),this.skin=t,this.scroll().update()},e.prototype.onScroll=function(){return this.children(function(t){return"function"==typeof t.deactivate?t.deactivate():void 0})},e}(),t.exports=a},function(t,e,r){var n,i,o,s,a,u,l=function(t,e){return function(){return t.apply(e,arguments)}},c={}.hasOwnProperty;n=window.require("spine/controller"),s=window.require("core/models/skin"),i=r(14),a={confirmBtnClass:(u={confirmBtnClass:"green-button button--uc button--save create-button",cancelBtnClass:"dim-button button--uc button--overwrite override-button",title:"How do you want to proceed?",content:'<input class="general-input skin-name" type="text" placeholder="Untitled Theme" />',note:"Changes will also apply to previous uses of this theme.",confirmBtn:"Create a new theme",cancelBtn:"Overwrite previous theme",separator:!0}).confirmBtnClass,cancelBtnClass:u.cancelBtnClass,title:"Create a new theme?",content:u.content,confirmBtn:"Create",separator:!1},o=function(t){function e(){this._closePopup=l(this._closePopup,this),this._onSaveCanceled=l(this._onSaveCanceled,this),this.override=l(this.override,this),this.save=l(this.save,this),e.__super__.constructor.apply(this,arguments),this.popup=new i({className:"popup skin-save-popup"}),this.listenTo(this.popup,"canceled",this._onSaveCanceled)}return function(t,e){for(var r in e)c.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,n),e.prototype.saveItem=function(t){return this.model=(this.item=t).item,this.popup.render(null!=this.model.user_id?u:a).pop(this.place,this.save,this.override)},e.prototype.save=function(){var t;return delete(t=this.model.attributes()).id,delete t.uses,t=$.extend({},t,{name:this.popup.el.find("input").val(),user_id:1}),this.item.item.reset(),new s(t).save(),this.item.changes={}},e.prototype.override=function(){return this.item.override(),this.item.item.save()},e.prototype._onSaveCanceled=function(){return this.model.trigger("save-canceled")},e.prototype._closePopup=function(){return this.popup.close()},e}(),t.exports=o},function(t,e,r){var n,i,o,s,a,u=function(t,e){return function(){return t.apply(e,arguments)}},l={}.hasOwnProperty;n=window.require("spine/controller"),o=r(14),s=window.require("core/models/skin"),a=function(t){return{confirmBtnClass:"green-button button--uc popup-button red-button",cancelBtnClass:"dim-button button--uc popup-button dark-purple-button",title:'Delete Theme "'+t.name+'"?',confirmBtn:"Delete",cancelBtn:"Cancel"}},i=function(t){function e(){this._closePopup=u(this._closePopup,this),this.deleteit=u(this.deleteit,this),this.deleteItem=u(this.deleteItem,this),e.__super__.constructor.apply(this,arguments),this.popup=new o({className:"popup skin-delete-popup"})}return function(t,e){for(var r in e)l.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,n),e.prototype.deleteItem=function(t){return this.model=(this.item=t).item,this.popup.render(a(this.model)).pop(this.place,this.deleteit),this.listenToOnce(s,"selected",this._closePopup)},e.prototype.deleteit=function(t){var e;return this.stopListening(s,"selected",this._closePopup),this.item.isActive()&&(e=this.item.el).next().add(e.prev()).first().controller().active(),this.item.release(),this.model.destroy()},e.prototype._closePopup=function(){return this.popup.close()},e}(),t.exports=i},function(t,e,r){var n,i,o,s,a,u,l,c,p,h,d=function(t,e){return function(){return t.apply(e,arguments)}},f={}.hasOwnProperty;n=window.require("spine/controller/activateable"),p=window.require("spine/controller/tabs"),a=window.require("core/models/content"),window.require("core/models/composition"),c=r(106),i=r(50),u=r(142),l=r(144),h=r(112),o=r(53).default,s=function(t){function e(){this.afterAdd=d(this.afterAdd,this),this._onBrowserState=d(this._onBrowserState,this),this.showError=d(this.showError,this),this._onItemUpdate=d(this._onItemUpdate,this),this._onItemCreate=d(this._onItemCreate,this),this.onItemDestroy=d(this.onItemDestroy,this),this.contentUpdate=d(this.contentUpdate,this),this.contentRemove=d(this.contentRemove,this),this.contentAdd=d(this.contentAdd,this),this._freeContentCanAdd=d(this._freeContentCanAdd,this),this._premiumContentCanAdd=d(this._premiumContentCanAdd,this),this.contentCanAdd=d(this.contentCanAdd,this),this.focusBrowser=d(this.focusBrowser,this),this.legacyAddBrowser=d(this.legacyAddBrowser,this),this.addBrowser=d(this.addBrowser,this),this.initialize=d(this.initialize,this),this.deactivate=d(this.deactivate,this),this.activate=d(this.activate,this),this.browsers={},e.__super__.constructor.apply(this,arguments),this.el.prepend((this.notificator=new l).el),o.Content.events.error(this.showError),this.$bind("error",function(t){return function(e,r){return t.showError(r)}}(this))}return function(t,e){for(var r in e)f.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,p),e.prototype.className="content-browser",e.prototype.tabContainerClass="content-browser-tabs",e.prototype.containerClass="content-browser-container",e.prototype.title="Content",e.prototype.nextTitle="Edit Content",e.prototype.tabRenderer=c,e.include(n),e.prototype.interval=0,e.prototype.events={"editor:browser:active":"_onBrowserState","editor:browser:auth":"_onBrowserState"},e.prototype.children=function(t){var e,r,n,i;for(e in null==t&&(t=function(){return!0}),i=[],n=this.browsers)t(r=n[e])&&i.push(r);return i},e.prototype.setPremium=function(t){this.premium=t},e.prototype.activate=function(){var t,e;return n.activate.apply(this,arguments),null!=(t=this.children(function(t){return t.isActive()}))&&null!=(e=t[0])&&"function"==typeof e.auth&&e.auth(),this.$trigger("viewChange","content"),this},e.prototype.deactivate=function(){var t;return n.deactivate.apply(this,arguments),null!=(t=this.children(function(t){return t.isActive()})[0])&&"function"==typeof t.refreshChildren?t.refreshChildren():void 0},e.prototype.for=function(t){return this.composition=t,this.initialize(),this},e.prototype.initialize=function(){var t,e,r,n,i;if(!this.composition)return console.warn("No composition set");for(t in this.children(function(t){return t.release()}),this.stopListening(),this.meta=this.composition.contentMeta(),this.browserOptions=null!=(e=this.meta.browser)?e.options:void 0,this.addBrowser(h),(i=null!=(r=this.meta.browser)?r.sources:void 0)&&(delete i.facebook,delete i.websearch,delete i.blogvio,delete i.dropbox,delete i.flickr,delete i["google-drive"]),i)n=i[t],this.legacyAddBrowser(n,t);return this.meta.input&&(this.append(this.input=new u({control:this.meta.input,composition:this.composition})),this.browsers.input=this.input,this.listenTo(this.input,"canAdd",this.contentCanAdd)),this.listenTo(a,"destroy",this.onItemDestroy),this.listenTo(a,"update",this._onItemUpdate),this.listenTo(a,"create",this._onItemCreate),this.listenTo(a,"change",function(t){return function(){return t.el.toggleClass("has-reached-max",t.composition.maxContentReached())}}(this)),this.children()[0].active(),this.trigger("initialized")},e.prototype.addBrowser=function(t){var e,r,n,i;if(t.isCompatible(null!=(r=this.browserOptions)?r.types:void 0))return(e=new t({filetypes:null!=(n=this.browserOptions)?n.types:void 0})).on("toggle",function(e){return function(r){var n,i,s;if(i=r.file,!((null!=(s=r.options)?s.afterUpload:void 0)&&o.Content.maxContentReached(e.composition)))try{return o.Content.toggleItem(e.composition,t.name,i.id,i.url,e.meta.attributes.title?{title:i.name}:void 0)}catch(t){return n=t,console.warn(n)}}}(this)),e.on("clearContent",function(e){return function(){return o.Content.clearContent(e.composition,t.name)}}(this)),e.observe("selected",function(t){return e.tab.count(t.length)}),i=function(){var r;return r=o.Content.getItemsByService(t.name).map(function(t){return t.metadata.id}),e.set({selected:r})},o.Content.events.change(i),i(),this.append(this.browsers[t.name]=e)},e.prototype.legacyAddBrowser=function(t,e){var r,n,o;return r=window.require(t.module||"editor/content/service/default"),o=this.composition.getContent().filter(function(t){var r;return(null!=(r=t.metadata)?r.service:void 0)===e}).map(function(t){return t.metadata}),i=window.require(t.browser||r.browser),this.browsers[e]=n=new i({content:o,title:e,Service:r,options:$.extend({},this.browserOptions,t.options||{})}),this.listenTo(n,"add",this.contentAdd),this.listenTo(n,"remove",this.contentRemove),this.listenTo(n,"update",this.contentUpdate),this.listenTo(n,"canAdd",this.contentCanAdd),this.append(n)},e.prototype.focusBrowser=function(t){var e;return null!=(e=this.browsers[t]||{links:this.input}[t])?e.active():void 0},e.prototype.contentCanAdd=function(t,e){return this.premium?this._premiumContentCanAdd(t,e):this._freeContentCanAdd(t,e)},e.prototype._premiumContentCanAdd=function(t,e){return this.composition.maxContentReached()?e?void 0:this.showError("max",!0):t.call(this)},e.prototype._freeContentCanAdd=function(t,e){var r;return r=this.composition.contentMeta().options.free_user_limit,this.composition.maxContentReached(r)?e?void 0:this.showError("maxFree",!0):t.call(this)},e.prototype.contentAdd=function(t){var e,r,n;for(e in r={},n=this.meta.attributes)n[e],null!=t[e]&&(r[e]=t[e]);return r.metadata=t,r.composition_id=this.composition.id,r[this.meta.browser.options.attribute]=t.url,new a(r).save()},e.prototype.contentRemove=function(t){var e,r;if(this.stopListening(a,"destroy",this.onItemDestroy),r=a.all().filter(function(e){return function(r){var n;return(null!=(n=r.metadata)?n.id:void 0)===t.id&&r.composition_id===e.composition.id}}(this)),null!=(e=r[0])&&e.destroy(),this.listenTo(a,"destroy",this.onItemDestroy),!this.composition.hasEnoughContent())return this.showError("min",!0)},e.prototype.contentUpdate=function(t,e,r){var n;if((n=a.all().filter(function(e){return e.metadata===t})).length)return n[0].updateAttribute(e,r)},e.prototype.onItemDestroy=function(t){var e,r,n;if(t.composition_id===this.composition.id)return(n=null!=(e=t.metadata)?e.service:void 0)&&"directinput"!==n&&null!=(r=this.browsers[n])&&"function"==typeof r.removeEntry&&r.removeEntry(t.metadata),!0},e.prototype._onItemCreate=function(t){var e,r,n;if(t.composition_id===this.composition.id)return(n=null!=(e=t.metadata)?e.service:void 0)&&"directinput"!==n?null!=(r=this.browsers[n])&&"function"==typeof r.addEntry&&r.addEntry(t.metadata):this.input.addEntry(t),!0},e.prototype._onItemUpdate=function(t){var e,r,n;if(t.composition_id===this.composition.id)return(n=null!=(e=t.metadata)?e.service:void 0)&&"directinput"!==n&&null!=(r=this.browsers[n])&&"function"==typeof r.updateEntry&&r.updateEntry(t,t.metadata),!0},e.prototype.showError=function(t,e){var r;return null==e&&(e=!1),r=this.composition[t+"ErrorMsg"]?this.composition[t+"ErrorMsg"]():t,this.notificator.notify(r,{timeout:1e4,onClick:e?function(t){return function(){return t.$trigger("Content:upgrade")}}(this):void 0})},e.prototype._onBrowserState=function(t,e){return this.$trigger("editor:content:browserState",e)},e.prototype.afterAdd=function(t){if(e.__super__.afterAdd.apply(this,arguments),t.options.pos)return this.tabs.el.children(":nth-child("+t.options.pos+")").before(t.tab.el)},e.prototype.release=function(){return this._release(this),e.__super__.release.apply(this,arguments)},e}(),t.exports=s},function(t,e,r){var n,i,o,s,a,u,l,c,p=function(t,e){return function(){return t.apply(e,arguments)}},h={}.hasOwnProperty;s=window.require("spine/controller"),i=window.require("spine/controller/container"),n=window.require("spine/controller/activateable"),l=r(5),o=window.require("core/models/content"),u=r(143),window.require("core/models/composition"),c=function(t){return function(e){return e.item.eql(t)}},a=function(t){function e(){this._onCompositionSave=p(this._onCompositionSave,this),this.activate=p(this.activate,this),this.active=p(this.active,this),this._release=p(this._release,this),this.onItemCreated=p(this.onItemCreated,this),this.new=p(this.new,this),this._new=p(this._new,this),this.contentItems=p(this.contentItems,this),e.__super__.constructor.apply(this,arguments),this.append.apply(this,this.contentItems()),this.delay(function(t){return function(){return t.new(),t.tab.el.attr("control",t.control.control),t._updateTabCount()}}(this)),this.listenTo(this.composition,"save",this._onCompositionSave),this.listenTo(o,"destroy",this.delay.bind(this,this.new))}return function(t,e){for(var r in e)h.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,s),e.prototype.className="directinput browser",e.prototype.title="directinput",e.prototype.serviceTitle="link",e.include(i),e.include(n),e.include(l),e.prototype.attributes={authenticated:!0},e.prototype.contentItems=function(){return this.composition.getContent().filter(function(t){var e,r;return!(null!=(e=t.metadata)?e.service:void 0)||"directinput"===(null!=(r=t.metadata)?r.service:void 0)}).map(function(t){return function(e){return new u({control:t.control,item:e})}}(this))},e.prototype.addEntry=function(t){var e;if(!this.children(c(t)).length)return this.append(e=new u({control:this.control,item:t})),this._getNewField().el.insertAfter(e.el),this._updateTabCount(),this.scroll().update(),this},e.prototype._new=function(t){return null!=this.field?this.field.enable():(this.item=new o({metadata:{service:"directinput"},composition_id:this.composition.id}),this.field=new u({control:this.control,item:this.item}),this.item.one("create",this.onItemCreated),this.append(this.field),this._updateTabCount(),this.scroll().update(),t?this.scroll().scrollTo("bottom",{inertia:!1}):void 0)},e.prototype.new=function(t){if(this._updateTabCount(),this._new(t),this.field.disable(),this.trigger("canAdd",this.field.enable,!0),!this._count())return this._new()},e.prototype.onItemCreated=function(){return this.item=this.field=null,this.new()},e.prototype._release=function(t){return i._release.apply(this,[t]),this._updateTabCount(),this.scroll().update()},e.prototype.active=function(){return n.active.apply(this,arguments),this.$trigger("editor:browser:active",{service:"directinput",authenticated:!1}),this.scroll().update()},e.prototype.activate=function(){if(n.activate.apply(this,arguments),null!=this.field)return this.field.disable(),this.trigger("canAdd",this.field.enable,!0)},e.prototype._updateTabCount=function(){var t;return null!=(t=this.tab)?t.count(this._count()):void 0},e.prototype._count=function(){return this.children(function(t){return!t.item.isNew()}).length},e.prototype._getNewField=function(){return this.children(function(t){return t.item.isNew()})[0]},e.prototype._onCompositionSave=function(t,e){var r;if(e.changedID)return null!=(r=this._getNewField())?r.item.composition_id=this.composition.id:void 0},e}(),t.exports=a},function(t,e){var r,n,i,o=function(t,e){return function(){return t.apply(e,arguments)}},s={}.hasOwnProperty;n=window.require("spine/controller"),r=window.require("spine/controller/container"),i=function(t){function e(){var t;this.onInputFocus=o(this.onInputFocus,this),this.disable=o(this.disable,this),this.enable=o(this.enable,this),e.__super__.constructor.apply(this,arguments),this.control=$.extend(!0,{},this.control),this.item.isNew()&&this.$addClass("new"),this.listenTo(this.item,"create",function(t){return function(){return t.$removeClass("new")}}(this)),this.listenTo(this.item,"destroy",this.release),t=window.require(this.control.control),this.control=new t({item:this.item,attribute:this.control.attribute,options:this.control.options}),this.append(this.control,"<span class='field-delete' data-icon='⏍'></span>")}return function(t,e){for(var r in e)s.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,n),e.prototype.className="directinput-field",e.prototype.title="directinput",e.include(r),e.prototype.elements={".field-delete":"del",input:"input"},e.prototype.events={"click .field-delete":"_delete","focus input":"onInputFocus","click .input-textarea":"onInputFocus"},e.prototype._delete=function(){return this.item.destroy()},e.prototype.enable=function(){return this.el.toggleClass("disabled",this.disabled=!1)},e.prototype.disable=function(){return this.el.toggleClass("disabled",this.disabled=!0)},e.prototype.onInputFocus=function(){if(this.parent().trigger("canAdd",function(){},!this.disabled),this.disabled)return this.input.blur()},e}(),t.exports=i},function(t,e){var r,n=function(t,e){return function(){return t.apply(e,arguments)}};r=function(){function t(){this._onClick=n(this._onClick,this),this.notify=n(this.notify,this),this.close=n(this.close,this),this.render=n(this.render,this),this.template=n(this.template,this),this.el=$('<div class="'+this.className+'">'),this.message="",this.el.on("click",".close",this.close),this.el.on("click",this._onClick)}return t.prototype.className="message notification",t.prototype.template=function(t){return"<div class='text'>"+t+"</div><div class='close' data-icon='x'></div>"},t.prototype.render=function(t){return this.message=null!=t?t:this.message,this.el.html(this.template(this.message))},t.prototype.close=function(t){return null!=t&&t.stopPropagation(),clearTimeout(this.interval),this.el.transition({top:-60,queue:!1}),this.el.trigger("editor:notification",{show:!1})},t.prototype.notify=function(t,e){return null==e&&(e={}),this.el.trigger("editor:notification",{show:!0}),this.render(t),clearTimeout(this.interval),this.clickAction=e.onClick,this.el.show().stop(!0,!1).transition({top:0},function(t){return function(){return t.interval=setTimeout(t.close,e.interval||3e3)}}(this))},t.prototype._onClick=function(t){return t.preventDefault(),"function"==typeof this.clickAction&&this.clickAction(),this.close(t)},t}(),t.exports=r},function(t,e,r){(function(t,n){var i;(function(o){"use strict";var s=0,a=Array.prototype.slice,u=function(t,e){var r=t[e];if(r===o&&A.strict)throw new Error("Bottle was unable to resolve a service. `"+e+"` is undefined.");return r},l=function(t){return this.nested[t]||(this.nested[t]=k.pop())},c=function(t){return t.split(".").reduce(u,this)},p=function(t,e){Object.defineProperty(this,t,{configurable:!1,enumerable:!0,value:e,writable:!1})},h=function(t,e){var r,n;return"function"==typeof t&&(e=t,t="__global__"),n=(r=t.split(".")).shift(),r.length?l.call(this,n).decorator(r.join("."),e):(this.decorators[n]||(this.decorators[n]=[]),this.decorators[n].push(e)),this},d=function(t,e){return v.call(this,t,function(){this.$get=e})},f=function(t){return!/^\$(?:decorator|register|list)$|Provider$/.test(t)},g=function(t){return Object.keys(t||this.container||{}).filter(f)},y={},_=function(t,e){return e(t)},v=function(t,e){var r,n;return r=t.split("."),this.providerMap[t]&&1===r.length&&!this.container[t+"Provider"]?console.error(t+" provider already instantiated."):(this.originalProviders[t]=e,this.providerMap[t]=!0,n=r.shift(),r.length?(w.call(this,n,e,r),this):b.call(this,n,e))},m=function(t,e){return(t[e]||[]).concat(t.__global__||[])},b=function(t,e){var r,n,i,s,a;return this.id,i=this.container,s=this.decorators,a=this.middlewares,r=t+"Provider",(n=Object.create(null))[r]={configurable:!0,enumerable:!0,get:function(){var t=new e;return delete i[r],i[r]=t,t}},n[t]={configurable:!0,enumerable:!0,get:function(){var e,n=i[r];return n&&(e=m(s,t).reduce(_,n.$get(i)),delete i[r],delete i[t]),e===o?e:function(t,e,r,n){var i={configurable:!0,enumerable:!0};return t.length?i.get=function(){var e=0,n=function(i){if(i)throw i;t[e]&&t[e++](r,n)};return n(),r}:(i.value=r,i.writable=!0),Object.defineProperty(n,e,i),n[e]}(m(a,t),t,e,i)}},Object.defineProperties(i,n),this},w=function(t,e,r){var n;return n=l.call(this,t),this.factory(t,function(){return n.container}),n.provider(r.join("."),e)},E=function(t){var e=t.$value===o?t:t.$value;return this[t.$type||"service"].apply(this,[t.$name,e].concat(t.$inject||[]))},P=function(t){delete this.providerMap[t],delete this.container[t],delete this.container[t+"Provider"]},S=function(t,e){var r=t[e];return r||(r={},x.call(t,e,r)),r},x=function(t,e){Object.defineProperty(this,t,{configurable:!0,enumerable:!0,value:e,writable:!0})},k=function t(e){if(!(this instanceof t))return t.pop(e);this.id=s++,this.decorators={},this.middlewares={},this.nested={},this.providerMap={},this.originalProviders={},this.deferred=[],this.container={$decorator:h.bind(this),$register:E.bind(this),$list:g.bind(this)}};k.prototype={constant:function(t,e){var r=t.split(".");return t=r.pop(),p.call(r.reduce(S,this.container),t,e),this},decorator:h,defer:function(t){return this.deferred.push(t),this},digest:function(t){return(t||[]).map(c,this.container)},factory:d,instanceFactory:function(t,e){return d.call(this,t,function(t){return{instance:e.bind(e,t)}})},list:g,middleware:function(t,e){var r,n;return"function"==typeof t&&(e=t,t="__global__"),n=(r=t.split(".")).shift(),r.length?l.call(this,n).middleware(r.join("."),e):(this.middlewares[n]||(this.middlewares[n]=[]),this.middlewares[n].push(e)),this},provider:v,resetProviders:function(){var t=this.originalProviders;Object.keys(this.originalProviders).forEach(function(e){var r=e.split(".");r.length>1&&(P.call(this,r[0]),r.forEach(P,l.call(this,r[0]))),P.call(this,e),this.provider(e,t[e])},this)},register:E,resolve:function(t){return this.deferred.forEach(function(e){e(t)}),this},service:function(t,e){var r=arguments.length>2?a.call(arguments,2):null,n=this;return d.call(this,t,function(){var t=e;if(r){var i=r.map(c,n.container);i.unshift(e),t=e.bind.apply(e,i)}return new t})},value:function(t,e){var r;return t=(r=t.split(".")).pop(),x.call(r.reduce(S,this.container),t,e),this}},k.pop=function(t){var e;return"string"==typeof t?((e=y[t])||(y[t]=e=new k,e.constant("BOTTLE_NAME",t)),e):new k},k.clear=function(t){"string"==typeof t?delete y[t]:y={}},k.list=g;var A=k.config={strict:!1},O={function:!0,object:!0};!function(s){var a=O[typeof e]&&e&&!e.nodeType&&e,u=O[typeof t]&&t&&!t.nodeType&&t,l=(u&&u.exports,O[typeof n]&&n);!l||l.global!==l&&l.window!==l||(s=l),s.Bottle=k,(i=function(){return k}.call(e,r,e,t))===o||(t.exports=i)}(O[typeof window]&&window||this)}).call(this)}).call(e,r(46)(t),r(12))},function(t,e,r){"use strict";var n=r(54),i=r(55),o=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}();var s=window.require("core/models/content"),a=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return r.userIsPremium=t.premium,r.events=["change","error"],s.on("change",r._broadcast.change),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,i["a"](n["a"])),o(e,[{key:"getItemsByService",value:function(t){return s.select(function(e){return!!e.metadata&&e.metadata.service===t})}},{key:"maxContentReached",value:function(t){var e=t.contentMeta(),r=this.userIsPremium?e.options.max:e.options.free_user_limit;return t.maxContentReached(r)}},{key:"toggleItem",value:function(t,e,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},s=this.getItemsByService(e).filter(function(t){return t.metadata.id===r}).pop();s?s.destroy():this.addItem(t,n,i,Object.assign({},o,{id:r,service:e}))}},{key:"clearContent",value:function(t,e){this.getItemsByService(e).forEach(function(t){return t.destroy()})}},{key:"addItem",value:function(t,e,r,n){var i=t.contentMeta();if(this.maxContentReached(t)&&i.options.max>1)throw this._broadcast.error(this.userIsPremium?"max":"maxFree"),new Error("Cannot add more than max items");this.maxContentReached(t)&&1===i.options.max&&s.select(function(e){return e.composition_id===t.id}).forEach(function(t){return t.destroy()}),new s(Object.assign({},r,function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}({composition_id:t.id,metadata:n},i.options.mainAttribute,e))).save()}}]),e}();e.a=a},function(t,e,r){"use strict";var n=r(54),i=r(55),o=r(114),s=r.n(o),a=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}();function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var l=function t(e){u(this,t),this.id=++t.guid,Object.assign(this,t.defaults,e)};l.defaults={lastModified:void 0,state:"complete",thumbnail:void 0,url:void 0,error:void 0,name:void 0,progress:0,size:0,type:"*",uploadFile:void 0},l.guid=0;var c=function(t){return t.indexOf("/")>0?t.slice(0,t.indexOf("/")):t},p=function(t){function e(t,r){u(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return n.user=t.id,n.token=r,n.refreshed={},n.files=[],n.maxFilesize=t.premium?250:25,n.chunkSize=90,n.quota=1e3*(t.premium?1e4:250)*1e3,n.used=0,n.events=["update","complete"],n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,i["a"](n["a"])),a(e,[{key:"getMaxFileSize",value:function(){return this.maxFilesize}},{key:"getChunkSize",value:function(){return this.chunkSize}},{key:"getUploadURL",value:function(){return"https://widgetic.com//upload?user="+this.user}},{key:"getAuthHeaders",value:function(){return{"w-utoken":this.token}}},{key:"getFiles",value:function(t){var e=this;return t=c(t),this.refreshed[t]?Promise.resolve(this.files.filter(function(e){return e.type===t})):this._fetch(t).then(function(t){return e.files.push.apply(e.files,t)}).then(this._broadcast.update).then(function(r){return e.files.filter(function(e){return e.type===t})})}},{key:"get",value:function(t){return this.files.filter(function(e){return e.id===t})[0]}},{key:"getUser",value:function(){return this.user}},{key:"upload",value:function(t){console.log("Uploads Service onUploadStart:",t);var e=new l({state:"new",size:t.size,name:t.name,type:c(t.type),lastModified:Date.now(),uploadFile:t});this.files.push(e),this.used+=t.size,this._broadcast.update()}},{key:"uploadComplete",value:function(t,e){if("error"!==t.status){var r=t.xhr&&t.xhr.response?t.xhr.response:"";if(!r)return console.error("Error parsing uploadComplete response:",error),this.setError(t,"Error uploading file!");var n=JSON.parse(r),i=n.files.data[0];this.used=n.quota.used,this._update(t,function(t){t.state="complete",t.id=i.id,t.path=i.path,t.url=n.hostUrl+i.path,t.lastModified=i.lastModified}),this._broadcast.complete([this.get(i.id),e])}}},{key:"accept",value:function(t,e){if(this.used<this.quota)return e();e("The file exceeds the quota by "+s.a(this.used-this.quota)+".")}},{key:"remove",value:function(t){this.files=this.files.filter(function(e){return e.id!==t.id}),this.used-=t.size,"complete"===t.state&&this._remove(t),this._broadcast.update()}},{key:"setThumbnail",value:function(t,e){console.log("Uploads Service setThumbnail:",t,e),this._update(t,function(t){return t.thumbnail=e})}},{key:"setError",value:function(t,e){this.used-=t.size,this._update(t,function(t){t.error=e,t.size=0})}},{key:"setUploadProgress",value:function(t,e,r){this._update(t,function(t){return t.progress=e})}},{key:"setUploadState",value:function(t,e){this._update(t,function(t){return t.state=e})}},{key:"_update",value:function(t,e){this.files=this.files.map(function(r){var n=r.uploadFile?r.uploadFile:r;return n.name===t.name&&n.size===t.size&&n.lastModified===t.lastModified&&e(r),r}),this._broadcast.update()}},{key:"_fetch",value:function(t){var e=this;return jQuery.ajax({url:this.getUploadURL()+"&type="+t,headers:this.getAuthHeaders()}).then(function(r){return e.refreshed[t]=!0,e.used=r.quota.used,r.files.data.map(function(t){var e=c(t.mime),n=r.hostUrl+t.path,i="image"===e?n:void 0;return new l({id:t.id,type:e,url:n,thumbnail:i,path:t.path,name:t.name,size:t.size,lastModified:t.lastModified})})})}},{key:"_remove",value:function(t){return jQuery.ajax({method:"DELETE",url:"/upload/?user="+this.user+"&filePath="+t.path,headers:this.getAuthHeaders()}).then(function(t){}).then(this._broadcast.update).catch(console.error.bind(console))}}]),e}();e.a=p},function(t,e,r){"use strict";var n=r(54),i=r(55),o=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}();var s=function(t){function e(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var t=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.events=["state"],t.sounds={},t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,i["a"](n["a"])),o(e,[{key:"load",value:function(t,e){this.sounds[t]||this._initSound(t,e)}},{key:"getState",value:function(t){return this.sounds[t]?this.sounds[t].state:"uninitialized"}},{key:"togglePlay",value:function(t){this._isPlaying(t)?this.stop(t):this.play(t)}},{key:"play",value:function(t){if(!this.sounds[t])throw new Error("Sound must be loaded first");var e=this.sounds[t].sound;window.soundManager.stopAll(),this.sounds[t].state="loading",e.setPosition(0).play()}},{key:"stop",value:function(t){if(!this.sounds[t])throw new Error("Sound must be loaded first");this.sounds[t].sound.stop()}},{key:"_initSound",value:function(t,e){var r=this._onStatusChange.bind(this,t),n={url:e,volume:100,onpause:r,onstop:r,onresume:r,onfinish:r,onload:r,onplay:r};return this.sounds[t]={sound:window.soundManager.createSound(n),state:"paused"}}},{key:"_onStatusChange",value:function(t){this.sounds[t].state=this._isPlaying(t)?"playing":this._isLoading(t)?"loading":"paused",this._broadcast.state(t)}},{key:"_isPlaying",value:function(t){var e=this.sounds[t].sound;return!!e&&(!e.paused&&1===e.playState&&3===e.readyState)}},{key:"_isLoading",value:function(t){var e=this.sounds[t].sound;return!!e&&1===e.readyState}}]),e}();e.a=s},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(150),i=r(173),o=r(174),s=r(57),a=r(16),u=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var r=[],n=!0,i=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(n=(s=a.next()).done)&&(r.push(s.value),!e||r.length!==e);n=!0);}catch(t){i=!0,o=t}finally{try{!n&&a.return&&a.return()}finally{if(i)throw o}}return r}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){var t=0;return{data:function(){return{instanceId:++t,loading:!0,error:null,files:[],dragging:!1,filetypes:"*",deleteMode:!1,selected:[],selectedForDeletion:[],allowDelete:!0,allowClear:!0,uploadProgress:0}},helpers:{isSelected:function(t,e,r,n){return e?n.includes(t):r.includes(t)}},oncreate:function(){this.Uploads=this.refs.Uploads.instance(),this.set({maxFilesize:this.Uploads.getMaxFileSize()}),this.set({chunkSize:this.Uploads.getChunkSize()}),this.refresh(),this.scrollToListBottom()},ondestroy:function(){this.observer.cancel()},methods:{toggle:function(t){if(t.error)return this.Uploads.remove(t),this.refresh();this.get("deleteMode")?this._toggleDelete(t):this._toggleSelect(t)},activate:function(){this.refs.scrollPane&&(this.refs.scrollPane.update(),this.scrollToListBottom())},refresh:function(t){var e=this;return t&&t.preventDefault(),this.Uploads.getFiles(this.get("filetypes")).then(function(t){return t=t.sort(function(t,e){var r=t.lastModified;if(!r&&t.id){var n=t.id.indexOf("_u");n&&(r=t.id.substring(n+3))}r||(r=0);var i=e.lastModified;if(!i&&e.id){var o=e.id.indexOf("_u");o&&(i=e.id.substring(o+3))}return i||(i=0),r-i}),e.set({files:t})}).then(this.activate.bind(this)).catch(this._reportError.bind(this)).then(function(t){e.set({loading:!1,error:null}),e.scrollToListBottom()})},deleteSelected:function(){var t=this,e=this.get("selected");this.get("selectedForDeletion").forEach(function(r){var n=t.Uploads.get(r);e.includes(r)&&t._toggleSelect(n),t.Uploads.remove(n)}),this.set({deleteMode:!1,selectedForDeletion:[]})},_toggleSelect:function(t,e){this.fire("toggle",{file:t,options:e})},_toggleDelete:function(t){var e=this.get("selectedForDeletion");e.includes(t.id)?e=e.filter(function(e){return e!==t.id}):e.push(t.id),this.set({selectedForDeletion:e})},_reportError:function(t){var e=t;"string"==typeof t&&(e={message:t}),t.jqXHR&&(e={message:t.jqXHR.statusText+" ("+t.jqXHR.responseText+")"}),console.error(t),this.set({error:e}),this.fire("error",e)},_onDropZoneUploadStart:function(t){this.scrollToListBottom()},scrollToListBottom:function(){this.refs.scrollPane&&this.refs.scrollPane.scrollBottom()},_onDropZoneUploadToggle:function(t){console.log("Editor DropZone Upload Toggle:",t),this.toggle(t)},_onUploadsUpdate:function(t){this.refresh()},_onUploadComplete:function(t){var e=u(t,2),r=e[0];e[1]===this.get("instanceId")&&this._toggleSelect(r,{afterUpload:!0})}}}}();function c(t,e){var r,n,i,o;return{create:function(){r=a.e("span"),i=a.g(n=t.selectedForDeletion.length),o=a.g(" files selected for removal")},mount:function(t,e){a.l(r,t,e),a.b(i,r),a.b(o,r)},update:function(t,e){n!==(n=e.selectedForDeletion.length)&&(i.data=n)},unmount:function(){a.i(r)},destroy:a.m}}function p(t,e){var r,n;return{create:function(){r=a.e("span"),n=a.g("Select files to be removed from the server")},mount:function(t,e){a.l(r,t,e),a.b(n,r)},update:a.m,unmount:function(){a.i(r)},destroy:a.m}}function h(t,e){var r;function n(t){e.set({deleteMode:!0})}return{create:function(){r=a.e("div"),this.hydrate()},hydrate:function(t){r.className="browser-logout",a.p(r,"data-tooltip-text","Permanently remove files from server"),a.p(r,"data-tooltip-position","80% 3%"),a.p(r,"data-icon","⏍"),a.a(r,"click",n)},mount:function(t,e){a.l(r,t,e)},unmount:function(){a.i(r)},destroy:function(){a.o(r,"click",n)}}}function d(t,e){var r,n,i,o;function s(t){e.fire("clearContent")}return{create:function(){r=a.e("div"),n=a.f("svg"),i=a.f("path"),o=a.f("path"),this.hydrate()},hydrate:function(t){r.className="browser-logout clear-content",a.p(r,"data-tooltip-text","Clear Content"),a.a(r,"click",s),a.p(n,"xmlns","http://www.w3.org/2000/svg"),a.p(n,"viewBox","0 0 512 512"),a.p(i,"d","M490.667 85.333h-64v-64C426.667 9.551 417.115 0 405.333 0h-384C9.551 0 0 9.551 0 21.333V448c0 11.782 9.551 21.333 21.333 21.333h64v21.333c0 11.782 9.551 21.333 21.333 21.333h384c11.782 0 21.333-9.551 21.333-21.333v-384c.001-11.781-9.55-21.333-21.332-21.333zm-448 341.334v-384H384v42.667H106.667c-11.782 0-21.333 9.551-21.333 21.333v320H42.667zm426.666 42.666H128V128h341.333v341.333z"),a.p(o,"d","M389.176 208.158c-8.331-8.331-21.839-8.331-30.17 0l-60.339 60.339-60.339-60.339c-8.331-8.331-21.839-8.331-30.17 0s-8.331 21.839 0 30.17l60.339 60.339-60.339 60.339c-8.331 8.331-8.331 21.839 0 30.17s21.839 8.331 30.17 0l60.339-60.339 60.339 60.339c8.331 8.331 21.839 8.331 30.17 0s8.331-21.839 0-30.17l-60.339-60.339 60.339-60.339c8.331-8.332 8.331-21.839 0-30.17z")},mount:function(t,e){a.l(r,t,e),a.b(n,r),a.b(i,n),a.b(o,n)},unmount:function(){a.i(r)},destroy:function(){a.o(r,"click",s)}}}function f(t,e){var r,n,i,o,s;function u(t){e.deleteSelected()}function l(t){e.set({deleteMode:!1,selectedForDeletion:[]})}function h(t){return t.selectedForDeletion.length?c:p}var d=h(t),f=d(t,e);return{create:function(){r=a.e("div"),n=a.g("\n "),i=a.e("div"),o=a.g("\n "),f.create(),s=a.d(),this.hydrate()},hydrate:function(t){r.className="browser-logout",a.p(r,"data-tooltip-text","Permanently remove selected files from server (action cannot be undone)"),a.p(r,"data-tooltip-position","80% 3%"),a.p(r,"data-icon","✓"),a.a(r,"click",u),i.className="browser-logout",a.p(i,"data-tooltip-text","Cancel action"),a.p(i,"data-icon","x"),a.a(i,"click",l)},mount:function(t,e){a.l(r,t,e),a.l(n,t,e),a.l(i,t,e),a.l(o,t,e),f.mount(t,e),a.l(s,t,e)},update:function(t,r){d===(d=h(r))&&f?f.update(t,r):(f.unmount(),f.destroy(),(f=d(r,e)).create(),f.mount(s.parentNode,s))},unmount:function(){a.i(r),a.i(n),a.i(i),a.i(o),f.unmount(),a.i(s)},destroy:function(){a.o(r,"click",u),a.o(i,"click",l),f.destroy()}}}function g(t,e){var r,n,i=t.allowDelete&&h(0,e),o=t.allowClear&&d(0,e);return{create:function(){i&&i.create(),r=a.g("\n "),o&&o.create(),n=a.d()},mount:function(t,e){i&&i.mount(t,e),a.l(r,t,e),o&&o.mount(t,e),a.l(n,t,e)},update:function(t,s){s.allowDelete?i||((i=h(0,e)).create(),i.mount(r.parentNode,r)):i&&(i.unmount(),i.destroy(),i=null),s.allowClear?o||((o=d(0,e)).create(),o.mount(n.parentNode,n)):o&&(o.unmount(),o.destroy(),o=null)},unmount:function(){i&&i.unmount(),a.i(r),o&&o.unmount(),a.i(n)},destroy:function(){i&&i.destroy(),o&&o.destroy()}}}function y(t,e,r,n,i){var s=new o.a({_root:i._root,data:{file:r,selected:l.helpers.isSelected(r.id,t.deleteMode,t.selected,t.selectedForDeletion),selectedIcon:t.deleteMode?"delete":"check"}});return s.on("select",function(t){i.toggle(t)}),{create:function(){s._fragment.create()},mount:function(t,e){s._fragment.mount(t,e)},update:function(t,e,r,n,i){var o={};"files"in t&&(o.file=n),("files"in t||"deleteMode"in t||"selected"in t||"selectedForDeletion"in t)&&(o.selected=l.helpers.isSelected(n.id,e.deleteMode,e.selected,e.selectedForDeletion)),"deleteMode"in t&&(o.selectedIcon=e.deleteMode?"delete":"check"),Object.keys(o).length&&s.set(o)},unmount:function(){s._fragment.unmount()},destroy:function(){s.destroy(!1)}}}function _(t,e){var r=function(t,e){for(var r,n=t.files,i=[],o=0;o<n.length;o+=1)i[o]=y(t,0,n[o],0,e);return{create:function(){for(var t=0;t<i.length;t+=1)i[t].create();r=a.d()},mount:function(t,e){for(var n=0;n<i.length;n+=1)i[n].mount(t,e);a.l(r,t,e)},update:function(t,n){var o=n.files;if("files"in t||"deleteMode"in t||"selected"in t||"selectedForDeletion"in t){for(var s=0;s<o.length;s+=1)i[s]?i[s].update(t,n,o,o[s],s):(i[s]=y(n,0,o[s],0,e),i[s].create(),i[s].mount(r.parentNode,r));for(;s<i.length;s+=1)i[s].unmount(),i[s].destroy();i.length=o.length}},unmount:function(){for(var t=0;t<i.length;t+=1)i[t].unmount();a.i(r)},destroy:function(){a.h(i,!1,0)}}}(t,e),n=new i.a({_root:e._root,_yield:r,data:{class:"content-list"}});return e.refs.scrollPane=n,{create:function(){r.create(),n._fragment.create()},mount:function(t,e){n._fragment.mount(t,e)},update:function(t,e){r.update(t,e)},unmount:function(){n._fragment.unmount()},destroy:function(){e.refs.scrollPane===n&&(e.refs.scrollPane=null),r.destroy(),n.destroy(!1)}}}function v(t,e){var r,n,i,o,s,u,l,c,p,h,d,f;return{create:function(){r=a.e("div"),n=a.e("h2"),i=a.g("Hey there!"),o=a.g("\n "),s=a.e("h3"),u=a.g("You haven't uploaded any "),c=a.g(l=t.filetypes),p=a.g(" files yet."),h=a.g("\n "),d=a.e("span"),f=a.g("Drag some over or click below!"),this.hydrate()},hydrate:function(t){r.className="error-panel",r.style.cssText="height: 100%",n.className="blogvio-browser-title"},mount:function(t,e){a.l(r,t,e),a.b(n,r),a.b(i,n),a.b(o,r),a.b(s,r),a.b(u,s),a.b(c,s),a.b(p,s),a.b(h,r),a.b(d,r),a.b(f,d)},update:function(t,e){l!==(l=e.filetypes)&&(c.data=l)},unmount:function(){a.i(r)},destroy:a.m}}function m(t,e){var r,n,i,o,s,u,l,c,p,h,d,f,g,y,_,v,m;function b(t){e.refresh(t)}return{create:function(){r=a.e("div"),n=a.e("h2"),i=a.g("Failed to load uploaded files."),o=a.g("\n "),s=a.e("p"),l=a.g(u=t.error.message),c=a.g("\n "),p=a.e("a"),h=a.g("Click here to try again"),d=a.e("br"),f=a.g("\n "),g=a.e("span"),y=a.g("or "),_=a.e("a"),v=a.g("contact support"),m=a.g(" if the error persists."),this.hydrate()},hydrate:function(t){a.p(r,"svelte-2819349553",""),r.className="error-panel",n.className="blogvio-browser-title",p.href="#",a.a(p,"click",b),_.href="mailto:support@widgetic.com"},mount:function(t,e){a.l(r,t,e),a.b(n,r),a.b(i,n),a.b(o,r),a.b(s,r),a.b(l,s),a.b(c,r),a.b(p,r),a.b(h,p),a.b(d,r),a.b(f,r),a.b(g,r),a.b(y,g),a.b(_,g),a.b(v,_),a.b(m,g)},update:function(t,e){u!==(u=e.error.message)&&(l.data=u)},unmount:function(){a.i(r)},destroy:function(){a.o(p,"click",b)}}}function b(t,e){var r,i,o,s,u,l,c,p,h;function d(t){return t.deleteMode?f:g}var y=d(t),m=y(t,e);function b(t){return t.files.length?_:v}var w=b(t),E=w(t,e),P=new n.a({_root:e._root,data:{filetypes:t.filetypes+"/*",maxFilesize:t.maxFilesize,chunkSize:t.chunkSize,instanceId:t.instanceId}});return P.on("new",function(t){e._onDropZoneUploadStart(t)}),P.on("upload",function(t){e._onDropZoneUploadToggle(t)}),P.on("dragging",function(t){e.set({dragging:t})}),P.on("error",function(t){e.fire("error",t)}),e.refs.dropzone=P,{create:function(){r=a.e("div"),m.create(),i=a.g("\n "),o=a.e("section"),u=a.g("\n "),E.create(),l=a.g("\n\n\n \n "),c=a.e("div"),h=a.g("\n "),P._fragment.create(),this.hydrate()},hydrate:function(e){a.p(r,"svelte-2819349553",""),r.className="browser-nav",a.p(o,"svelte-2819349553",""),o.className=s=t.dragging?"dropzone--dragging":"",c.className=p="dropzone_plchldr "+(t.files.length?"":"dropzone--large")},mount:function(t,e){a.l(r,t,e),m.mount(r,null),a.l(i,t,e),a.l(o,t,e),a.b(u,o),E.mount(o,null),a.b(l,o),a.b(c,o),a.b(h,c),P._fragment.mount(c,null)},update:function(t,n){y===(y=d(n))&&m?m.update(t,n):(m.unmount(),m.destroy(),(m=y(n,e)).create(),m.mount(r,null)),s!==(s=n.dragging?"dropzone--dragging":"")&&(o.className=s),w===(w=b(n))&&E?E.update(t,n):(E.unmount(),E.destroy(),(E=w(n,e)).create(),E.mount(o,l)),p!==(p="dropzone_plchldr "+(n.files.length?"":"dropzone--large"))&&(c.className=p);var i={};"filetypes"in t&&(i.filetypes=n.filetypes+"/*"),"maxFilesize"in t&&(i.maxFilesize=n.maxFilesize),"chunkSize"in t&&(i.chunkSize=n.chunkSize),"instanceId"in t&&(i.instanceId=n.instanceId),Object.keys(i).length&&P.set(i)},unmount:function(){a.i(r),m.unmount(),a.i(i),a.i(o),E.unmount()},destroy:function(){m.destroy(),E.destroy(),e.refs.dropzone===P&&(e.refs.dropzone=null),P.destroy(!1)}}}function w(t,e){var r;function n(t){return t.error?m:b}var i=n(t),o=i(t,e);return{create:function(){o.create(),r=a.d()},mount:function(t,e){o.mount(t,e),a.l(r,t,e)},update:function(t,s){i===(i=n(s))&&o?o.update(t,s):(o.unmount(),o.destroy(),(o=i(s,e)).create(),o.mount(r.parentNode,r))},unmount:function(){o.unmount(),a.i(r)},destroy:function(){o.destroy()}}}function E(t){t=t||{},this.refs={},this._state=a.c(l.data(),t.data),this._observers={pre:Object.create(null),post:Object.create(null)},this._handlers=Object.create(null),this._root=t._root||this,this._yield=t._yield,this._torndown=!1,document.getElementById("svelte-2819349553-style")||function(){var t=a.e("style");t.id="svelte-2819349553-style",t.textContent='\n section[svelte-2819349553], [svelte-2819349553] section {\n display: flex;\n flex-direction: column;\n padding-left: 20px;\n height: calc(100% - 25px);\n color: #665b68;\n }\n\n a[svelte-2819349553]:focus, [svelte-2819349553] a:focus {\n outline: none;\n }\n\n [svelte-2819349553].error-panel, [svelte-2819349553] .error-panel {\n position: relative;\n top: 50%;\n transform: translateY(-50%);\n text-align: center;\n padding-right: 20px;\n }\n\n [svelte-2819349553].browser-nav, [svelte-2819349553] .browser-nav {\n position: static;\n\n font-family: ProximaNova-Regular;\n font-size: 16px;\n color: #0055FF;\n }\n\n [svelte-2819349553].blogvio-browser-title, [svelte-2819349553] .blogvio-browser-title {\n margin-top: 0;\n font: 30px/60px "ProximaNova-Regular";\n color: #0055FF;\n }\n\n [svelte-2819349553].nano, [svelte-2819349553] .nano {\n flex: 1;\n }\n\n strong[svelte-2819349553], [svelte-2819349553] strong {\n color: #0055FF;\n }\n\n [svelte-2819349553].dropzone_plchldr, [svelte-2819349553] .dropzone_plchldr {\n position: relative;\n margin: 20px 20px 20px 0;\n height: 75px;\n }\n\n [svelte-2819349553].dropzone, [svelte-2819349553] .dropzone {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 22px;\n }\n [svelte-2819349553].upload-input, [svelte-2819349553] .upload-input {\n \n }\n\n [svelte-2819349553].scrolling-container, [svelte-2819349553] .scrolling-container {\n transition: opacity 200ms ease-in;\n }\n\n [svelte-2819349553].dropzone--dragging .scrolling-container, [svelte-2819349553] .dropzone--dragging .scrolling-container {\n opacity: 0.4;\n }\n\n [svelte-2819349553].dropzone--dragging .dropzone, [svelte-2819349553] .dropzone--dragging .dropzone {\n top: -100px;\n }\n\n [svelte-2819349553].dropzone--large .dropzone, [svelte-2819349553] .dropzone--large .dropzone,\n [svelte-2819349553].dropzone--dragging .dropzone--large .dropzone, [svelte-2819349553] .dropzone--dragging .dropzone--large .dropzone {\n top: -200px;\n }\n\n [svelte-2819349553].icon, [svelte-2819349553] .icon {\n display: inline-block;\n width: 1em;\n height: 1em;\n stroke-width: 0;\n stroke: currentColor;\n fill: currentColor\n }\n\n [svelte-2819349553].clear-content svg, [svelte-2819349553] .clear-content svg {\n width: 14px;\n fill: #a0a0a0;\n position: relative;\n top: 1px;\n right: 2px;\n }\n\n [svelte-2819349553].clear-content:hover svg, [svelte-2819349553] .clear-content:hover svg {\n fill: #665b68;\n }\n',a.b(t,document.head)}(),this._renderHooks=[],this._fragment=function(t,e){var r,n,i,o,u,l,c,p,h,d,f,g,y,_=new s.a({_root:e._root,data:{service:"Uploads"}});_.on("update",function(t){e._onUploadsUpdate(t)}),_.on("complete",function(t){e._onUploadComplete(t)}),e.refs.Uploads=_;var v=!t.loading&&w(t,e);return{create:function(){_._fragment.create(),r=a.g("\n\n"),n=a.f("svg"),i=a.f("symbol"),o=a.f("title"),u=a.g("upload"),l=a.f("path"),c=a.f("path"),p=a.f("symbol"),h=a.f("title"),d=a.g("error"),f=a.f("path"),g=a.g("\n\n"),v&&v.create(),y=a.d(),this.hydrate()},hydrate:function(t){a.p(n,"svelte-2819349553",""),a.p(n,"style","position: absolute; width: 0; height: 0; overflow: hidden"),a.p(n,"version","1.1"),a.p(n,"xmlns","http://www.w3.org/2000/svg"),a.p(n,"xmlns:xlink","http://www.w3.org/1999/xlink"),a.p(i,"id","icon-upload"),a.p(i,"viewBox","0 0 32 32"),a.p(l,"d","M30.038 19.938c-0.706 0-1.275 0.569-1.275 1.275v7.544h-25.525v-7.544c0-0.706-0.569-1.275-1.275-1.275s-1.275 0.569-1.275 1.275v8.825c0 0.706 0.569 1.275 1.275 1.275h28.075c0.706 0 1.275-0.569 1.275-1.275v-8.825c0-0.706-0.569-1.275-1.275-1.275z"),a.p(c,"d","M9.137 10.625l5.588-5.581v16.194c0 0.706 0.569 1.275 1.275 1.275s1.275-0.569 1.275-1.275v-16.194l5.587 5.581c0.769 0.713 1.556 0.25 1.806 0 0.5-0.5 0.5-1.306 0-1.806l-7.769-7.756c-0.5-0.5-1.306-0.5-1.806 0l-7.756 7.756c-0.5 0.5-0.5 1.306 0 1.806 0.494 0.5 1.306 0.5 1.8 0z"),a.p(p,"id","icon-error"),a.p(p,"viewBox","0 0 21.9 21.9"),a.p(f,"d","M14.1 11.3c-.2-.2-.2-.5 0-.7l7.5-7.5c.2-.2.3-.5.3-.7s-.1-.5-.3-.7L20.2.3c-.2-.2-.5-.3-.7-.3-.3 0-.5.1-.7.3l-7.5 7.5c-.2.2-.5.2-.7 0L3.1.3C2.9.1 2.6 0 2.4 0s-.5.1-.7.3L.3 1.7c-.2.2-.3.5-.3.7s.1.5.3.7l7.5 7.5c.2.2.2.5 0 .7L.3 18.8c-.2.2-.3.5-.3.7s.1.5.3.7l1.4 1.4c.2.2.5.3.7.3s.5-.1.7-.3l7.5-7.5c.2-.2.5-.2.7 0l7.5 7.5c.2.2.5.3.7.3s.5-.1.7-.3l1.4-1.4c.2-.2.3-.5.3-.7s-.1-.5-.3-.7l-7.5-7.5z"),a.p(f,"fill","#de2618")},mount:function(t,e){_._fragment.mount(t,e),a.l(r,t,e),a.l(n,t,e),a.b(i,n),a.b(o,i),a.b(u,o),a.b(l,i),a.b(c,i),a.b(p,n),a.b(h,p),a.b(d,h),a.b(f,p),a.l(g,t,e),v&&v.mount(t,e),a.l(y,t,e)},update:function(t,r){r.loading?v&&(v.unmount(),v.destroy(),v=null):v?v.update(t,r):((v=w(r,e)).create(),v.mount(y.parentNode,y))},unmount:function(){_._fragment.unmount(),a.i(r),a.i(n),a.i(g),v&&v.unmount(),a.i(y)},destroy:function(){e.refs.Uploads===_&&(e.refs.Uploads=null),_.destroy(!1),v&&v.destroy()}}}(this._state,this),t.target&&(this._fragment.create(),this._fragment.mount(t.target,null)),this._flush(),t._root?t._root._renderHooks.push(l.oncreate.bind(this)):l.oncreate.call(this)}a.c(E.prototype,l.methods,a.n),E.prototype._set=function(t){var e=this._state;this._state=a.c({},e,t),a.k(this,this._observers.pre,t,e),this._fragment.update(t,this._state),a.k(this,this._observers.post,t,e),this._flush()},E.prototype.teardown=E.prototype.destroy=function(t){this.fire("destroy"),l.ondestroy.call(this),!1!==t&&this._fragment.unmount(),this._fragment.destroy(),this._fragment=null,this._state={},this._torndown=!0},e.default=E},function(t,e,r){"use strict";var n=r(151),i=r.n(n),o=r(57),s=r(114),a=r.n(s),u=r(152),l=r(16);function c(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function p(t,e,r,n){(n||"quota"in e&&l.j(t.quota,r.quota))&&(t.prettyQuota=e.prettyQuota=h.computed.prettyQuota(t.quota)),(n||"used"in e&&l.j(t.used,r.used))&&(t.prettyUsed=e.prettyUsed=h.computed.prettyUsed(t.used))}var h={data:function(){return{filetypes:"*",used:0,quota:0,uploading:{total:0,now:0},dragging:!1,maxFilesize:10,chunkSize:0,instanceId:0}},computed:{prettyQuota:function(t){return a.a(t)},prettyUsed:function(t){return a.a(t)}},oncreate:function(){var t;this.Uploads=this.refs.Uploads.instance(),this.set({quota:this.Uploads.quota,used:this.Uploads.used});var e=!this.get("chunkSize");this.dropzone=new i.a(this.refs.dropzone,{acceptedFiles:this.get("filetypes")||"application/offset+octet",url:this.Uploads.getUploadURL(),headers:this.Uploads.getAuthHeaders(),accept:this.Uploads.accept.bind(this.Uploads),uploadMultiple:!1,maxFilesize:this.get("maxFilesize"),autoProcessQueue:e});var r=(c(t={dragenter:this._onDragEnter.bind(this),dragleave:this._onDragLeave.bind(this),drop:this._onDragLeave.bind(this),addedfile:this._onUploadStart.bind(this),thumbnail:this._onThumbnail.bind(this),error:this._onError.bind(this),uploadprogress:this._onUploadProgress.bind(this),processing:this._updateFileState.bind(this,"processing"),sending:this._updateFileState.bind(this,"sending"),success:this._updateFileState.bind(this,"success"),complete:this._updateFileState.bind(this,"complete"),canceled:this._updateFileState.bind(this,"canceled")},"complete",this._onUploadComplete.bind(this)),c(t,"totaluploadprogress",this._onTotalUploadProgress.bind(this)),c(t,"queuecomplete",this._onQueueComplete.bind(this)),t);for(var n in r)this.dropzone.on(n,r[n])},methods:{_onDragEnter:function(){this.set({dragging:!0}),this.fire("dragging",!0)},_onDragLeave:function(){this.set({dragging:!1}),this.fire("dragging",!1)},_onUploadStart:function(t){var e=this;console.log("Dropzone _onUploadStart file:",t);var r=this.get("chunkSize"),n=this.Uploads.getUploadURL();if(console.log("Dropzone _onUploadStart TUS endpoint:",n),r){var i=new u.a(t,{endpoint:n,headers:this.Uploads.getAuthHeaders(),retryDelays:[0,3e3,5e3,1e4,2e4],chunkSize:1024*r*1024,metadata:{filename:t.name,filetype:t.type},onError:function(r){e._onError(t,r)},onProgress:function(r,n){var i=r/n*100;e._onUploadProgress(t,i,r)},onSuccess:function(r){if(""==i._req._xhr.response)console.log("Dropzone TUS Client Upload Complete to server for file:",i),e._updateFileState("sending",t);else{console.log("Dropzone TUS Client Upload Complete to B2 with response:",i._req._xhr.response);var n=i.file;n.xhr=i._req._xhr,e._onUploadComplete(n)}}});i.start()}this.fire("new",t),this.Uploads.upload(t),this._updateFileState("sending",t)},_onThumbnail:function(t,e){this.Uploads.setThumbnail(t,e)},_onError:function(t,e){this.fire("error",{message:e}),this.Uploads.setError(t,e)},_onUploadProgress:function(t,e,r){this.Uploads.setUploadProgress(t,e,r)},_onUploadComplete:function(t){this.Uploads.uploadComplete(t,this.get("instanceId"))},_updateFileState:function(t,e){this.Uploads.setUploadState(e,t)},_onTotalUploadProgress:function(){var t=this.dropzone.getAcceptedFiles().length,e=this.dropzone.getQueuedFiles().length,r=(this.dropzone.getUploadingFiles().length,t-e);this.set({uploading:{total:t,now:r}})},_onQueueComplete:function(){this.dropzone.removeAllFiles()},_onUploadsUpdate:function(){this.set({quota:this.Uploads.quota,used:this.Uploads.used})}}};function d(t,e){var r,n,i,o,s,a,u;return{create:function(){r=l.e("strong"),n=l.g("Uploading "),o=l.g(i=t.uploading.now),s=l.g(" / "),u=l.g(a=t.uploading.total)},mount:function(t,e){l.l(r,t,e),l.b(n,r),l.b(o,r),l.b(s,r),l.b(u,r)},update:function(t,e){i!==(i=e.uploading.now)&&(o.data=i),a!==(a=e.uploading.total)&&(u.data=a)},unmount:function(){l.i(r)},destroy:l.m}}function f(t,e){var r,n,i,o,s,a,u,c,p,h,d,f,g,y;return{create:function(){r=l.f("svg"),n=l.f("use"),i=l.g("\n "),o=l.e("br"),s=l.g("\n "),a=l.e("span"),u=l.e("strong"),p=l.g(c=t.prettyUsed),h=l.g(" out of "),d=l.e("strong"),g=l.g(f=t.prettyQuota),y=l.g(" used."),this.hydrate()},hydrate:function(t){l.p(r,"class","icon icon-upload"),l.q(n,"xlink:href","#icon-upload")},mount:function(t,e){l.l(r,t,e),l.b(n,r),l.l(i,t,e),l.l(o,t,e),l.l(s,t,e),l.l(a,t,e),l.b(u,a),l.b(p,u),l.b(h,a),l.b(d,a),l.b(g,d),l.b(y,a)},update:function(t,e){c!==(c=e.prettyUsed)&&(p.data=c),f!==(f=e.prettyQuota)&&(g.data=f)},unmount:function(){l.i(r),l.i(i),l.i(o),l.i(s),l.i(a)},destroy:l.m}}function g(t){t=t||{},this.refs={},this._state=l.c(h.data(),t.data),p(this._state,this._state,{},!0),this._observers={pre:Object.create(null),post:Object.create(null)},this._handlers=Object.create(null),this._root=t._root||this,this._yield=t._yield,this._torndown=!1,document.getElementById("svelte-87397042-style")||function(){var t=l.e("style");t.id="svelte-87397042-style",t.textContent='\n [svelte-87397042].dropzone, [svelte-87397042] .dropzone {\n display: flex;\n align-items: center;\n justify-content: center;\n\n background: #fff;\n border: 1px dashed #b8b8b8;\n\n font-size: 14px;\n font-family: "ProximaNova-Regular";\n text-align: center;\n cursor: pointer;\n\n transition: top 300ms ease-in, background 150ms ease-in 50ms;\n }\n\n [svelte-87397042].dropzone_stats, [svelte-87397042] .dropzone_stats {\n pointer-events: none;\n }\n\n [svelte-87397042].dropzone_stats span, [svelte-87397042] .dropzone_stats span {\n transition: opacity 150ms ease-in 150ms;\n }\n\n [svelte-87397042].dropzone:hover, [svelte-87397042] .dropzone:hover {\n border-color: #888;\n }\n\n [svelte-87397042].dropzone.dropzone--dragging, [svelte-87397042] .dropzone.dropzone--dragging,\n [svelte-87397042].dropzone:hover, [svelte-87397042] .dropzone:hover {\n background: #f4f5f8;\n }\n\n [svelte-87397042].dropzone--dragging .dropzone_stats span, [svelte-87397042] .dropzone--dragging .dropzone_stats span {\n opacity: 0;\n transition: opacity 150ms ease-in;\n }\n\n [svelte-87397042].dropzone--dragging .dropzone_stats .icon, [svelte-87397042] .dropzone--dragging .dropzone_stats .icon {\n transform: scale(3) translateY(20%);\n }\n\n [svelte-87397042].dz-message, [svelte-87397042] .dz-message, [svelte-87397042].dz-preview, [svelte-87397042] .dz-preview {\n display: none\n }\n\n [svelte-87397042].icon, [svelte-87397042] .icon {\n fill: #929292;\n transition: transform 300ms ease-in;\n }\n',l.b(t,document.head)}(),this._renderHooks=[],this._fragment=function(t,e){var r,n,i,s,a=new o.a({_root:e._root,data:{service:"Uploads"}});function u(t){return t.uploading.total>0?d:f}a.on("update",function(t){e._onUploadsUpdate()}),e.refs.Uploads=a;var c=u(t),p=c(t,e);return{create:function(){a._fragment.create(),r=l.g("\n\n"),n=l.e("div"),s=l.e("div"),p.create(),this.hydrate()},hydrate:function(e){l.p(n,"svelte-87397042",""),n.className=i="dropzone "+(t.dragging?"dropzone--dragging":""),s.className="dropzone_stats"},mount:function(t,i){a._fragment.mount(t,i),l.l(r,t,i),l.l(n,t,i),e.refs.dropzone=n,l.b(s,n),p.mount(s,null)},update:function(t,r){i!==(i="dropzone "+(r.dragging?"dropzone--dragging":""))&&(n.className=i),c===(c=u(r))&&p?p.update(t,r):(p.unmount(),p.destroy(),(p=c(r,e)).create(),p.mount(s,null))},unmount:function(){a._fragment.unmount(),l.i(r),l.i(n),e.refs.dropzone===n&&(e.refs.dropzone=null),p.unmount()},destroy:function(){e.refs.Uploads===a&&(e.refs.Uploads=null),a.destroy(!1),p.destroy()}}}(this._state,this),t.target&&(this._fragment.create(),this._fragment.mount(t.target,null)),this._flush(),t._root?t._root._renderHooks.push(h.oncreate.bind(this)):h.oncreate.call(this)}l.c(g.prototype,h.methods,l.n),g.prototype._set=function(t){var e=this._state;this._state=l.c({},e,t),p(this._state,t,e,!1),l.k(this,this._observers.pre,t,e),this._fragment.update(t,this._state),l.k(this,this._observers.post,t,e),this._flush()},g.prototype.teardown=g.prototype.destroy=function(t){this.fire("destroy"),!1!==t&&this._fragment.unmount(),this._fragment.destroy(),this._fragment=null,this._state={},this._torndown=!0},e.a=g},function(t,e,r){(function(t){(function(){var e,r,n,i,o,s,a,u,l=[].slice,c={}.hasOwnProperty;a=function(){},r=function(){function t(){}return t.prototype.addEventListener=t.prototype.on,t.prototype.on=function(t,e){return this._callbacks=this._callbacks||{},this._callbacks[t]||(this._callbacks[t]=[]),this._callbacks[t].push(e),this},t.prototype.emit=function(){var t,e,r,n,i;if(r=arguments[0],t=2<=arguments.length?l.call(arguments,1):[],this._callbacks=this._callbacks||{},e=this._callbacks[r])for(n=0,i=e.length;n<i;n++)e[n].apply(this,t);return this},t.prototype.removeListener=t.prototype.off,t.prototype.removeAllListeners=t.prototype.off,t.prototype.removeEventListener=t.prototype.off,t.prototype.off=function(t,e){var r,n,i,o;if(!this._callbacks||0===arguments.length)return this._callbacks={},this;if(!(r=this._callbacks[t]))return this;if(1===arguments.length)return delete this._callbacks[t],this;for(n=i=0,o=r.length;i<o;n=++i)if(r[n]===e){r.splice(n,1);break}return this},t}(),(e=function(t){var e,n;function i(t,r){var n,o,s;if(this.element=t,this.version=i.version,this.defaultOptions.previewTemplate=this.defaultOptions.previewTemplate.replace(/\n*/g,""),this.clickableElements=[],this.listeners=[],this.files=[],"string"==typeof this.element&&(this.element=document.querySelector(this.element)),!this.element||null==this.element.nodeType)throw new Error("Invalid dropzone element.");if(this.element.dropzone)throw new Error("Dropzone already attached.");if(i.instances.push(this),this.element.dropzone=this,n=null!=(s=i.optionsForElement(this.element))?s:{},this.options=e({},this.defaultOptions,n,null!=r?r:{}),this.options.forceFallback||!i.isBrowserSupported())return this.options.fallback.call(this);if(null==this.options.url&&(this.options.url=this.element.getAttribute("action")),!this.options.url)throw new Error("No URL provided.");if(this.options.acceptedFiles&&this.options.acceptedMimeTypes)throw new Error("You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'. 'acceptedMimeTypes' is deprecated.");this.options.acceptedMimeTypes&&(this.options.acceptedFiles=this.options.acceptedMimeTypes,delete this.options.acceptedMimeTypes),this.options.method=this.options.method.toUpperCase(),(o=this.getExistingFallback())&&o.parentNode&&o.parentNode.removeChild(o),!1!==this.options.previewsContainer&&(this.options.previewsContainer?this.previewsContainer=i.getElement(this.options.previewsContainer,"previewsContainer"):this.previewsContainer=this.element),this.options.clickable&&(!0===this.options.clickable?this.clickableElements=[this.element]:this.clickableElements=i.getElements(this.options.clickable,"clickable")),this.init()}return function(t,e){for(var r in e)c.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(i,r),i.prototype.Emitter=r,i.prototype.events=["drop","dragstart","dragend","dragenter","dragover","dragleave","addedfile","addedfiles","removedfile","thumbnail","error","errormultiple","processing","processingmultiple","uploadprogress","totaluploadprogress","sending","sendingmultiple","success","successmultiple","canceled","canceledmultiple","complete","completemultiple","reset","maxfilesexceeded","maxfilesreached","queuecomplete"],i.prototype.defaultOptions={url:null,method:"post",withCredentials:!1,parallelUploads:2,uploadMultiple:!1,maxFilesize:256,paramName:"file",createImageThumbnails:!0,maxThumbnailFilesize:10,thumbnailWidth:120,thumbnailHeight:120,filesizeBase:1e3,maxFiles:null,params:{},clickable:!0,ignoreHiddenFiles:!0,acceptedFiles:null,acceptedMimeTypes:null,autoProcessQueue:!0,autoQueue:!0,addRemoveLinks:!1,previewsContainer:null,hiddenInputContainer:"body",capture:null,renameFilename:null,dictDefaultMessage:"Drop files here to upload",dictFallbackMessage:"Your browser does not support drag'n'drop file uploads.",dictFallbackText:"Please use the fallback form below to upload your files like in the olden days.",dictFileTooBig:"File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.",dictInvalidFileType:"You can't upload files of this type.",dictResponseError:"Server responded with {{statusCode}} code.",dictCancelUpload:"Cancel upload",dictCancelUploadConfirmation:"Are you sure you want to cancel this upload?",dictRemoveFile:"Remove file",dictRemoveFileConfirmation:null,dictMaxFilesExceeded:"You can not upload any more files.",accept:function(t,e){return e()},init:function(){return a},forceFallback:!1,fallback:function(){var t,e,r,n,o,s;for(this.element.className=this.element.className+" dz-browser-not-supported",n=0,o=(s=this.element.getElementsByTagName("div")).length;n<o;n++)t=s[n],/(^| )dz-message($| )/.test(t.className)&&(e=t,t.className="dz-message");return e||(e=i.createElement('<div class="dz-message"><span></span></div>'),this.element.appendChild(e)),(r=e.getElementsByTagName("span")[0])&&(null!=r.textContent?r.textContent=this.options.dictFallbackMessage:null!=r.innerText&&(r.innerText=this.options.dictFallbackMessage)),this.element.appendChild(this.getFallbackForm())},resize:function(t){var e,r,n;return e={srcX:0,srcY:0,srcWidth:t.width,srcHeight:t.height},r=t.width/t.height,e.optWidth=this.options.thumbnailWidth,e.optHeight=this.options.thumbnailHeight,null==e.optWidth&&null==e.optHeight?(e.optWidth=e.srcWidth,e.optHeight=e.srcHeight):null==e.optWidth?e.optWidth=r*e.optHeight:null==e.optHeight&&(e.optHeight=1/r*e.optWidth),n=e.optWidth/e.optHeight,t.height<e.optHeight||t.width<e.optWidth?(e.trgHeight=e.srcHeight,e.trgWidth=e.srcWidth):r>n?(e.srcHeight=t.height,e.srcWidth=e.srcHeight*n):(e.srcWidth=t.width,e.srcHeight=e.srcWidth/n),e.srcX=(t.width-e.srcWidth)/2,e.srcY=(t.height-e.srcHeight)/2,e},drop:function(t){return this.element.classList.remove("dz-drag-hover")},dragstart:a,dragend:function(t){return this.element.classList.remove("dz-drag-hover")},dragenter:function(t){return this.element.classList.add("dz-drag-hover")},dragover:function(t){return this.element.classList.add("dz-drag-hover")},dragleave:function(t){return this.element.classList.remove("dz-drag-hover")},paste:a,reset:function(){return this.element.classList.remove("dz-started")},addedfile:function(t){var e,r,n,o,s,a,u,l,c,p,h,d;if(this.element===this.previewsContainer&&this.element.classList.add("dz-started"),this.previewsContainer){for(t.previewElement=i.createElement(this.options.previewTemplate.trim()),t.previewTemplate=t.previewElement,this.previewsContainer.appendChild(t.previewElement),n=0,a=(c=t.previewElement.querySelectorAll("[data-dz-name]")).length;n<a;n++)c[n].textContent=this._renameFilename(t.name);for(o=0,u=(p=t.previewElement.querySelectorAll("[data-dz-size]")).length;o<u;o++)p[o].innerHTML=this.filesize(t.size);for(this.options.addRemoveLinks&&(t._removeLink=i.createElement('<a class="dz-remove" href="javascript:undefined;" data-dz-remove>'+this.options.dictRemoveFile+"</a>"),t.previewElement.appendChild(t._removeLink)),e=function(e){return function(r){return r.preventDefault(),r.stopPropagation(),t.status===i.UPLOADING?i.confirm(e.options.dictCancelUploadConfirmation,function(){return e.removeFile(t)}):e.options.dictRemoveFileConfirmation?i.confirm(e.options.dictRemoveFileConfirmation,function(){return e.removeFile(t)}):e.removeFile(t)}}(this),d=[],s=0,l=(h=t.previewElement.querySelectorAll("[data-dz-remove]")).length;s<l;s++)r=h[s],d.push(r.addEventListener("click",e));return d}},removedfile:function(t){var e;return t.previewElement&&null!=(e=t.previewElement)&&e.parentNode.removeChild(t.previewElement),this._updateMaxFilesReachedClass()},thumbnail:function(t,e){var r,n,i,o;if(t.previewElement){for(t.previewElement.classList.remove("dz-file-preview"),n=0,i=(o=t.previewElement.querySelectorAll("[data-dz-thumbnail]")).length;n<i;n++)(r=o[n]).alt=t.name,r.src=e;return setTimeout(function(){return t.previewElement.classList.add("dz-image-preview")},1)}},error:function(t,e){var r,n,i,o,s;if(t.previewElement){for(t.previewElement.classList.add("dz-error"),"String"!=typeof e&&e.error&&(e=e.error),s=[],n=0,i=(o=t.previewElement.querySelectorAll("[data-dz-errormessage]")).length;n<i;n++)r=o[n],s.push(r.textContent=e);return s}},errormultiple:a,processing:function(t){if(t.previewElement&&(t.previewElement.classList.add("dz-processing"),t._removeLink))return t._removeLink.textContent=this.options.dictCancelUpload},processingmultiple:a,uploadprogress:function(t,e,r){var n,i,o,s,a;if(t.previewElement){for(a=[],i=0,o=(s=t.previewElement.querySelectorAll("[data-dz-uploadprogress]")).length;i<o;i++)"PROGRESS"===(n=s[i]).nodeName?a.push(n.value=e):a.push(n.style.width=e+"%");return a}},totaluploadprogress:a,sending:a,sendingmultiple:a,success:function(t){if(t.previewElement)return t.previewElement.classList.add("dz-success")},successmultiple:a,canceled:function(t){return this.emit("error",t,"Upload canceled.")},canceledmultiple:a,complete:function(t){if(t._removeLink&&(t._removeLink.textContent=this.options.dictRemoveFile),t.previewElement)return t.previewElement.classList.add("dz-complete")},completemultiple:a,maxfilesexceeded:a,maxfilesreached:a,queuecomplete:a,addedfiles:a,previewTemplate:'<div class="dz-preview dz-file-preview">\n <div class="dz-image"><img data-dz-thumbnail /></div>\n <div class="dz-details">\n <div class="dz-size"><span data-dz-size></span></div>\n <div class="dz-filename"><span data-dz-name></span></div>\n </div>\n <div class="dz-progress"><span class="dz-upload" data-dz-uploadprogress></span></div>\n <div class="dz-error-message"><span data-dz-errormessage></span></div>\n <div class="dz-success-mark">\n <svg width="54px" height="54px" viewBox="0 0 54 54" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">\n <title>Check</title>\n <defs></defs>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">\n <path d="M23.5,31.8431458 L17.5852419,25.9283877 C16.0248253,24.3679711 13.4910294,24.366835 11.9289322,25.9289322 C10.3700136,27.4878508 10.3665912,30.0234455 11.9283877,31.5852419 L20.4147581,40.0716123 C20.5133999,40.1702541 20.6159315,40.2626649 20.7218615,40.3488435 C22.2835669,41.8725651 24.794234,41.8626202 26.3461564,40.3106978 L43.3106978,23.3461564 C44.8771021,21.7797521 44.8758057,19.2483887 43.3137085,17.6862915 C41.7547899,16.1273729 39.2176035,16.1255422 37.6538436,17.6893022 L23.5,31.8431458 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z" id="Oval-2" stroke-opacity="0.198794158" stroke="#747474" fill-opacity="0.816519475" fill="#FFFFFF" sketch:type="MSShapeGroup"></path>\n </g>\n </svg>\n </div>\n <div class="dz-error-mark">\n <svg width="54px" height="54px" viewBox="0 0 54 54" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">\n <title>Error</title>\n <defs></defs>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">\n <g id="Check-+-Oval-2" sketch:type="MSLayerGroup" stroke="#747474" stroke-opacity="0.198794158" fill="#FFFFFF" fill-opacity="0.816519475">\n <path d="M32.6568542,29 L38.3106978,23.3461564 C39.8771021,21.7797521 39.8758057,19.2483887 38.3137085,17.6862915 C36.7547899,16.1273729 34.2176035,16.1255422 32.6538436,17.6893022 L27,23.3431458 L21.3461564,17.6893022 C19.7823965,16.1255422 17.2452101,16.1273729 15.6862915,17.6862915 C14.1241943,19.2483887 14.1228979,21.7797521 15.6893022,23.3461564 L21.3431458,29 L15.6893022,34.6538436 C14.1228979,36.2202479 14.1241943,38.7516113 15.6862915,40.3137085 C17.2452101,41.8726271 19.7823965,41.8744578 21.3461564,40.3106978 L27,34.6568542 L32.6538436,40.3106978 C34.2176035,41.8744578 36.7547899,41.8726271 38.3137085,40.3137085 C39.8758057,38.7516113 39.8771021,36.2202479 38.3106978,34.6538436 L32.6568542,29 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z" id="Oval-2" sketch:type="MSShapeGroup"></path>\n </g>\n </g>\n </svg>\n </div>\n</div>'},e=function(){var t,e,r,n,i,o,s;for(n=arguments[0],o=0,s=(r=2<=arguments.length?l.call(arguments,1):[]).length;o<s;o++)for(t in e=r[o])i=e[t],n[t]=i;return n},i.prototype.getAcceptedFiles=function(){var t,e,r,n,i;for(i=[],e=0,r=(n=this.files).length;e<r;e++)(t=n[e]).accepted&&i.push(t);return i},i.prototype.getRejectedFiles=function(){var t,e,r,n,i;for(i=[],e=0,r=(n=this.files).length;e<r;e++)(t=n[e]).accepted||i.push(t);return i},i.prototype.getFilesWithStatus=function(t){var e,r,n,i,o;for(o=[],r=0,n=(i=this.files).length;r<n;r++)(e=i[r]).status===t&&o.push(e);return o},i.prototype.getQueuedFiles=function(){return this.getFilesWithStatus(i.QUEUED)},i.prototype.getUploadingFiles=function(){return this.getFilesWithStatus(i.UPLOADING)},i.prototype.getAddedFiles=function(){return this.getFilesWithStatus(i.ADDED)},i.prototype.getActiveFiles=function(){var t,e,r,n,o;for(o=[],e=0,r=(n=this.files).length;e<r;e++)(t=n[e]).status!==i.UPLOADING&&t.status!==i.QUEUED||o.push(t);return o},i.prototype.init=function(){var t,e,r,n,o,s,a;for("form"===this.element.tagName&&this.element.setAttribute("enctype","multipart/form-data"),this.element.classList.contains("dropzone")&&!this.element.querySelector(".dz-message")&&this.element.appendChild(i.createElement('<div class="dz-default dz-message"><span>'+this.options.dictDefaultMessage+"</span></div>")),this.clickableElements.length&&(r=function(t){return function(){return t.hiddenFileInput&&t.hiddenFileInput.parentNode.removeChild(t.hiddenFileInput),t.hiddenFileInput=document.createElement("input"),t.hiddenFileInput.setAttribute("type","file"),(null==t.options.maxFiles||t.options.maxFiles>1)&&t.hiddenFileInput.setAttribute("multiple","multiple"),t.hiddenFileInput.className="dz-hidden-input",null!=t.options.acceptedFiles&&t.hiddenFileInput.setAttribute("accept",t.options.acceptedFiles),null!=t.options.capture&&t.hiddenFileInput.setAttribute("capture",t.options.capture),t.hiddenFileInput.style.visibility="hidden",t.hiddenFileInput.style.position="absolute",t.hiddenFileInput.style.top="0",t.hiddenFileInput.style.left="0",t.hiddenFileInput.style.height="0",t.hiddenFileInput.style.width="0",document.querySelector(t.options.hiddenInputContainer).appendChild(t.hiddenFileInput),t.hiddenFileInput.addEventListener("change",function(){var e,n,i,o;if((n=t.hiddenFileInput.files).length)for(i=0,o=n.length;i<o;i++)e=n[i],t.addFile(e);return t.emit("addedfiles",n),r()})}}(this))(),this.URL=null!=(s=window.URL)?s:window.webkitURL,n=0,o=(a=this.events).length;n<o;n++)t=a[n],this.on(t,this.options[t]);return this.on("uploadprogress",function(t){return function(){return t.updateTotalUploadProgress()}}(this)),this.on("removedfile",function(t){return function(){return t.updateTotalUploadProgress()}}(this)),this.on("canceled",function(t){return function(e){return t.emit("complete",e)}}(this)),this.on("complete",function(t){return function(e){if(0===t.getAddedFiles().length&&0===t.getUploadingFiles().length&&0===t.getQueuedFiles().length)return setTimeout(function(){return t.emit("queuecomplete")},0)}}(this)),e=function(t){return t.stopPropagation(),t.preventDefault?t.preventDefault():t.returnValue=!1},this.listeners=[{element:this.element,events:{dragstart:function(t){return function(e){return t.emit("dragstart",e)}}(this),dragenter:function(t){return function(r){return e(r),t.emit("dragenter",r)}}(this),dragover:function(t){return function(r){var n;try{n=r.dataTransfer.effectAllowed}catch(t){}return r.dataTransfer.dropEffect="move"===n||"linkMove"===n?"move":"copy",e(r),t.emit("dragover",r)}}(this),dragleave:function(t){return function(e){return t.emit("dragleave",e)}}(this),drop:function(t){return function(r){return e(r),t.drop(r)}}(this),dragend:function(t){return function(e){return t.emit("dragend",e)}}(this)}}],this.clickableElements.forEach(function(t){return function(e){return t.listeners.push({element:e,events:{click:function(r){return(e!==t.element||r.target===t.element||i.elementInside(r.target,t.element.querySelector(".dz-message")))&&t.hiddenFileInput.click(),!0}}})}}(this)),this.enable(),this.options.init.call(this)},i.prototype.destroy=function(){var t;return this.disable(),this.removeAllFiles(!0),(null!=(t=this.hiddenFileInput)?t.parentNode:void 0)&&(this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput),this.hiddenFileInput=null),delete this.element.dropzone,i.instances.splice(i.instances.indexOf(this),1)},i.prototype.updateTotalUploadProgress=function(){var t,e,r,n,i,o,s;if(r=0,e=0,this.getActiveFiles().length){for(i=0,o=(s=this.getActiveFiles()).length;i<o;i++)r+=(t=s[i]).upload.bytesSent,e+=t.upload.total;n=100*r/e}else n=100;return this.emit("totaluploadprogress",n,e,r)},i.prototype._getParamName=function(t){return"function"==typeof this.options.paramName?this.options.paramName(t):this.options.paramName+(this.options.uploadMultiple?"["+t+"]":"")},i.prototype._renameFilename=function(t){return"function"!=typeof this.options.renameFilename?t:this.options.renameFilename(t)},i.prototype.getFallbackForm=function(){var t,e,r,n;return(t=this.getExistingFallback())?t:(r='<div class="dz-fallback">',this.options.dictFallbackText&&(r+="<p>"+this.options.dictFallbackText+"</p>"),r+='<input type="file" name="'+this._getParamName(0)+'" '+(this.options.uploadMultiple?'multiple="multiple"':void 0)+' /><input type="submit" value="Upload!"></div>',e=i.createElement(r),"FORM"!==this.element.tagName?(n=i.createElement('<form action="'+this.options.url+'" enctype="multipart/form-data" method="'+this.options.method+'"></form>')).appendChild(e):(this.element.setAttribute("enctype","multipart/form-data"),this.element.setAttribute("method",this.options.method)),null!=n?n:e)},i.prototype.getExistingFallback=function(){var t,e,r,n,i,o;for(e=function(t){var e,r,n;for(r=0,n=t.length;r<n;r++)if(e=t[r],/(^| )fallback($| )/.test(e.className))return e},n=0,i=(o=["div","form"]).length;n<i;n++)if(r=o[n],t=e(this.element.getElementsByTagName(r)))return t},i.prototype.setupEventListeners=function(){var t,e,r,n,i,o,s;for(s=[],n=0,i=(o=this.listeners).length;n<i;n++)t=o[n],s.push(function(){var n,i;for(e in i=[],n=t.events)r=n[e],i.push(t.element.addEventListener(e,r,!1));return i}());return s},i.prototype.removeEventListeners=function(){var t,e,r,n,i,o,s;for(s=[],n=0,i=(o=this.listeners).length;n<i;n++)t=o[n],s.push(function(){var n,i;for(e in i=[],n=t.events)r=n[e],i.push(t.element.removeEventListener(e,r,!1));return i}());return s},i.prototype.disable=function(){var t,e,r,n,i;for(this.clickableElements.forEach(function(t){return t.classList.remove("dz-clickable")}),this.removeEventListeners(),i=[],e=0,r=(n=this.files).length;e<r;e++)t=n[e],i.push(this.cancelUpload(t));return i},i.prototype.enable=function(){return this.clickableElements.forEach(function(t){return t.classList.add("dz-clickable")}),this.setupEventListeners()},i.prototype.filesize=function(t){var e,r,n,i,o,s,a;if(r=0,n="b",t>0){for(e=s=0,a=(o=["TB","GB","MB","KB","b"]).length;s<a;e=++s)if(i=o[e],t>=Math.pow(this.options.filesizeBase,4-e)/10){r=t/Math.pow(this.options.filesizeBase,4-e),n=i;break}r=Math.round(10*r)/10}return"<strong>"+r+"</strong> "+n},i.prototype._updateMaxFilesReachedClass=function(){return null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(this.getAcceptedFiles().length===this.options.maxFiles&&this.emit("maxfilesreached",this.files),this.element.classList.add("dz-max-files-reached")):this.element.classList.remove("dz-max-files-reached")},i.prototype.drop=function(t){var e,r;t.dataTransfer&&(this.emit("drop",t),e=t.dataTransfer.files,this.emit("addedfiles",e),e.length&&((r=t.dataTransfer.items)&&r.length&&null!=r[0].webkitGetAsEntry?this._addFilesFromItems(r):this.handleFiles(e)))},i.prototype.paste=function(t){var e,r;if(null!=(null!=t&&null!=(r=t.clipboardData)?r.items:void 0))return this.emit("paste",t),(e=t.clipboardData.items).length?this._addFilesFromItems(e):void 0},i.prototype.handleFiles=function(t){var e,r,n,i;for(i=[],r=0,n=t.length;r<n;r++)e=t[r],i.push(this.addFile(e));return i},i.prototype._addFilesFromItems=function(t){var e,r,n,i,o;for(o=[],n=0,i=t.length;n<i;n++)null!=(r=t[n]).webkitGetAsEntry&&(e=r.webkitGetAsEntry())?e.isFile?o.push(this.addFile(r.getAsFile())):e.isDirectory?o.push(this._addFilesFromDirectory(e,e.name)):o.push(void 0):null!=r.getAsFile&&(null==r.kind||"file"===r.kind)?o.push(this.addFile(r.getAsFile())):o.push(void 0);return o},i.prototype._addFilesFromDirectory=function(t,e){var r,n,i;return r=t.createReader(),n=function(t){return"undefined"!=typeof console&&null!==console&&"function"==typeof console.log?console.log(t):void 0},(i=function(t){return function(){return r.readEntries(function(r){var n,o,s;if(r.length>0){for(o=0,s=r.length;o<s;o++)(n=r[o]).isFile?n.file(function(r){if(!t.options.ignoreHiddenFiles||"."!==r.name.substring(0,1))return r.fullPath=e+"/"+r.name,t.addFile(r)}):n.isDirectory&&t._addFilesFromDirectory(n,e+"/"+n.name);i()}return null},n)}}(this))()},i.prototype.accept=function(t,e){return t.size>1024*this.options.maxFilesize*1024?e(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(t.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxFilesize)):i.isValidFile(t,this.options.acceptedFiles)?null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(e(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles)),this.emit("maxfilesexceeded",t)):this.options.accept.call(this,t,e):e(this.options.dictInvalidFileType)},i.prototype.addFile=function(t){return t.upload={progress:0,total:t.size,bytesSent:0},this.files.push(t),t.status=i.ADDED,this.emit("addedfile",t),this._enqueueThumbnail(t),this.accept(t,function(e){return function(r){return r?(t.accepted=!1,e._errorProcessing([t],r)):(t.accepted=!0,e.options.autoQueue&&e.enqueueFile(t)),e._updateMaxFilesReachedClass()}}(this))},i.prototype.enqueueFiles=function(t){var e,r,n;for(r=0,n=t.length;r<n;r++)e=t[r],this.enqueueFile(e);return null},i.prototype.enqueueFile=function(t){if(t.status!==i.ADDED||!0!==t.accepted)throw new Error("This file can't be queued because it has already been processed or was rejected.");if(t.status=i.QUEUED,this.options.autoProcessQueue)return setTimeout(function(t){return function(){return t.processQueue()}}(this),0)},i.prototype._thumbnailQueue=[],i.prototype._processingThumbnail=!1,i.prototype._enqueueThumbnail=function(t){if(this.options.createImageThumbnails&&t.type.match(/image.*/)&&t.size<=1024*this.options.maxThumbnailFilesize*1024)return this._thumbnailQueue.push(t),setTimeout(function(t){return function(){return t._processThumbnailQueue()}}(this),0)},i.prototype._processThumbnailQueue=function(){if(!this._processingThumbnail&&0!==this._thumbnailQueue.length)return this._processingThumbnail=!0,this.createThumbnail(this._thumbnailQueue.shift(),function(t){return function(){return t._processingThumbnail=!1,t._processThumbnailQueue()}}(this))},i.prototype.removeFile=function(t){if(t.status===i.UPLOADING&&this.cancelUpload(t),this.files=u(this.files,t),this.emit("removedfile",t),0===this.files.length)return this.emit("reset")},i.prototype.removeAllFiles=function(t){var e,r,n,o;for(null==t&&(t=!1),r=0,n=(o=this.files.slice()).length;r<n;r++)((e=o[r]).status!==i.UPLOADING||t)&&this.removeFile(e);return null},i.prototype.createThumbnail=function(t,e){var r;return(r=new FileReader).onload=function(n){return function(){return"image/svg+xml"===t.type?(n.emit("thumbnail",t,r.result),void(null!=e&&e())):n.createThumbnailFromUrl(t,r.result,e)}}(this),r.readAsDataURL(t)},i.prototype.createThumbnailFromUrl=function(t,e,r,n){var i;return i=document.createElement("img"),n&&(i.crossOrigin=n),i.onload=function(e){return function(){var n,o,a,u,l,c,p,h;if(t.width=i.width,t.height=i.height,null==(a=e.options.resize.call(e,t)).trgWidth&&(a.trgWidth=a.optWidth),null==a.trgHeight&&(a.trgHeight=a.optHeight),o=(n=document.createElement("canvas")).getContext("2d"),n.width=a.trgWidth,n.height=a.trgHeight,s(o,i,null!=(l=a.srcX)?l:0,null!=(c=a.srcY)?c:0,a.srcWidth,a.srcHeight,null!=(p=a.trgX)?p:0,null!=(h=a.trgY)?h:0,a.trgWidth,a.trgHeight),u=n.toDataURL("image/png"),e.emit("thumbnail",t,u),null!=r)return r()}}(this),null!=r&&(i.onerror=r),i.src=e},i.prototype.processQueue=function(){var t,e,r,n;if(e=this.options.parallelUploads,t=r=this.getUploadingFiles().length,!(r>=e)&&(n=this.getQueuedFiles()).length>0){if(this.options.uploadMultiple)return this.processFiles(n.slice(0,e-r));for(;t<e;){if(!n.length)return;this.processFile(n.shift()),t++}}},i.prototype.processFile=function(t){return this.processFiles([t])},i.prototype.processFiles=function(t){var e,r,n;for(r=0,n=t.length;r<n;r++)(e=t[r]).processing=!0,e.status=i.UPLOADING,this.emit("processing",e);return this.options.uploadMultiple&&this.emit("processingmultiple",t),this.uploadFiles(t)},i.prototype._getFilesWithXhr=function(t){var e;return function(){var r,n,i,o;for(o=[],r=0,n=(i=this.files).length;r<n;r++)(e=i[r]).xhr===t&&o.push(e);return o}.call(this)},i.prototype.cancelUpload=function(t){var e,r,n,o,s,a,u;if(t.status===i.UPLOADING){for(n=0,s=(r=this._getFilesWithXhr(t.xhr)).length;n<s;n++)(e=r[n]).status=i.CANCELED;for(t.xhr.abort(),o=0,a=r.length;o<a;o++)e=r[o],this.emit("canceled",e);this.options.uploadMultiple&&this.emit("canceledmultiple",r)}else(u=t.status)!==i.ADDED&&u!==i.QUEUED||(t.status=i.CANCELED,this.emit("canceled",t),this.options.uploadMultiple&&this.emit("canceledmultiple",[t]));if(this.options.autoProcessQueue)return this.processQueue()},n=function(){var t,e;return e=arguments[0],t=2<=arguments.length?l.call(arguments,1):[],"function"==typeof e?e.apply(this,t):e},i.prototype.uploadFile=function(t){return this.uploadFiles([t])},i.prototype.uploadFiles=function(t){var r,o,s,a,u,l,c,p,h,d,f,g,y,_,v,m,b,w,E,P,S,x,k,A,O,T,R,C,I,M,D,L,U;for(w=new XMLHttpRequest,E=0,k=t.length;E<k;E++)(r=t[E]).xhr=w;for(a in g=n(this.options.method,t),m=n(this.options.url,t),w.open(g,m,!0),w.withCredentials=!!this.options.withCredentials,_=null,s=function(e){return function(){var n,i,o;for(o=[],n=0,i=t.length;n<i;n++)r=t[n],o.push(e._errorProcessing(t,_||e.options.dictResponseError.replace("{{statusCode}}",w.status),w));return o}}(this),v=function(e){return function(n){var i,o,s,a,u,l,c,p,h;if(null!=n)for(o=100*n.loaded/n.total,s=0,l=t.length;s<l;s++)(r=t[s]).upload={progress:o,total:n.total,bytesSent:n.loaded};else{for(i=!0,o=100,a=0,c=t.length;a<c;a++)100===(r=t[a]).upload.progress&&r.upload.bytesSent===r.upload.total||(i=!1),r.upload.progress=o,r.upload.bytesSent=r.upload.total;if(i)return}for(h=[],u=0,p=t.length;u<p;u++)r=t[u],h.push(e.emit("uploadprogress",r,o,r.upload.bytesSent));return h}}(this),w.onload=function(e){return function(r){var n;if(t[0].status!==i.CANCELED&&4===w.readyState){if(_=w.responseText,w.getResponseHeader("content-type")&&~w.getResponseHeader("content-type").indexOf("application/json"))try{_=JSON.parse(_)}catch(t){r=t,_="Invalid JSON response from server."}return v(),200<=(n=w.status)&&n<300?e._finished(t,_,r):s()}}}(this),w.onerror=function(){if(t[0].status!==i.CANCELED)return s()},(null!=(C=w.upload)?C:w).onprogress=v,l={Accept:"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"},this.options.headers&&e(l,this.options.headers),l)(u=l[a])&&w.setRequestHeader(a,u);if(o=new FormData,this.options.params)for(f in I=this.options.params)b=I[f],o.append(f,b);for(P=0,A=t.length;P<A;P++)r=t[P],this.emit("sending",r,w,o);if(this.options.uploadMultiple&&this.emit("sendingmultiple",t,w,o),"FORM"===this.element.tagName)for(S=0,O=(M=this.element.querySelectorAll("input, textarea, select, button")).length;S<O;S++)if(h=(p=M[S]).getAttribute("name"),d=p.getAttribute("type"),"SELECT"===p.tagName&&p.hasAttribute("multiple"))for(x=0,T=(D=p.options).length;x<T;x++)(y=D[x]).selected&&o.append(h,y.value);else(!d||"checkbox"!==(L=d.toLowerCase())&&"radio"!==L||p.checked)&&o.append(h,p.value);for(c=R=0,U=t.length-1;0<=U?R<=U:R>=U;c=0<=U?++R:--R)o.append(this._getParamName(c),t[c],this._renameFilename(t[c].name));return this.submitRequest(w,o,t)},i.prototype.submitRequest=function(t,e,r){return t.send(e)},i.prototype._finished=function(t,e,r){var n,o,s;for(o=0,s=t.length;o<s;o++)(n=t[o]).status=i.SUCCESS,this.emit("success",n,e,r),this.emit("complete",n);if(this.options.uploadMultiple&&(this.emit("successmultiple",t,e,r),this.emit("completemultiple",t)),this.options.autoProcessQueue)return this.processQueue()},i.prototype._errorProcessing=function(t,e,r){var n,o,s;for(o=0,s=t.length;o<s;o++)(n=t[o]).status=i.ERROR,this.emit("error",n,e,r),this.emit("complete",n);if(this.options.uploadMultiple&&(this.emit("errormultiple",t,e,r),this.emit("completemultiple",t)),this.options.autoProcessQueue)return this.processQueue()},i}()).version="4.3.0",e.options={},e.optionsForElement=function(t){return t.getAttribute("id")?e.options[n(t.getAttribute("id"))]:void 0},e.instances=[],e.forElement=function(t){if("string"==typeof t&&(t=document.querySelector(t)),null==(null!=t?t.dropzone:void 0))throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone.");return t.dropzone},e.autoDiscover=!0,e.discover=function(){var t,r,n,i,o,s;for(document.querySelectorAll?n=document.querySelectorAll(".dropzone"):(n=[],(t=function(t){var e,r,i,o;for(o=[],r=0,i=t.length;r<i;r++)e=t[r],/(^| )dropzone($| )/.test(e.className)?o.push(n.push(e)):o.push(void 0);return o})(document.getElementsByTagName("div")),t(document.getElementsByTagName("form"))),s=[],i=0,o=n.length;i<o;i++)r=n[i],!1!==e.optionsForElement(r)?s.push(new e(r)):s.push(void 0);return s},e.blacklistedBrowsers=[/opera.*Macintosh.*version\/12/i],e.isBrowserSupported=function(){var t,r,n,i;if(t=!0,window.File&&window.FileReader&&window.FileList&&window.Blob&&window.FormData&&document.querySelector)if("classList"in document.createElement("a"))for(r=0,n=(i=e.blacklistedBrowsers).length;r<n;r++)i[r].test(navigator.userAgent)&&(t=!1);else t=!1;else t=!1;return t},u=function(t,e){var r,n,i,o;for(o=[],n=0,i=t.length;n<i;n++)(r=t[n])!==e&&o.push(r);return o},n=function(t){return t.replace(/[\-_](\w)/g,function(t){return t.charAt(1).toUpperCase()})},e.createElement=function(t){var e;return(e=document.createElement("div")).innerHTML=t,e.childNodes[0]},e.elementInside=function(t,e){if(t===e)return!0;for(;t=t.parentNode;)if(t===e)return!0;return!1},e.getElement=function(t,e){var r;if("string"==typeof t?r=document.querySelector(t):null!=t.nodeType&&(r=t),null==r)throw new Error("Invalid `"+e+"` option provided. Please provide a CSS selector or a plain HTML element.");return r},e.getElements=function(t,e){var r,n,i,o,s,a,u;if(t instanceof Array){n=[];try{for(i=0,s=t.length;i<s;i++)r=t[i],n.push(this.getElement(r,e))}catch(t){t,n=null}}else if("string"==typeof t)for(n=[],o=0,a=(u=document.querySelectorAll(t)).length;o<a;o++)r=u[o],n.push(r);else null!=t.nodeType&&(n=[t]);if(null==n||!n.length)throw new Error("Invalid `"+e+"` option provided. Please provide a CSS selector, a plain HTML element or a list of those.");return n},e.confirm=function(t,e,r){return window.confirm(t)?e():null!=r?r():void 0},e.isValidFile=function(t,e){var r,n,i,o,s;if(!e)return!0;for(e=e.split(","),r=(n=t.type).replace(/\/.*$/,""),o=0,s=e.length;o<s;o++)if("."===(i=(i=e[o]).trim()).charAt(0)){if(-1!==t.name.toLowerCase().indexOf(i.toLowerCase(),t.name.length-i.length))return!0}else if(/\/\*$/.test(i)){if(r===i.replace(/\/.*$/,""))return!0}else if(n===i)return!0;return!1},"undefined"!=typeof jQuery&&null!==jQuery&&(jQuery.fn.dropzone=function(t){return this.each(function(){return new e(this,t)})}),void 0!==t&&null!==t?t.exports=e:window.Dropzone=e,e.ADDED="added",e.QUEUED="queued",e.ACCEPTED=e.QUEUED,e.UPLOADING="uploading",e.PROCESSING=e.UPLOADING,e.CANCELED="canceled",e.ERROR="error",e.SUCCESS="success",o=function(t){var e,r,n,i,o,s,a,u;for(t.naturalWidth,o=t.naturalHeight,(e=document.createElement("canvas")).width=1,e.height=o,(r=e.getContext("2d")).drawImage(t,0,0),n=r.getImageData(0,0,1,o).data,u=0,i=o,s=o;s>u;)0===n[4*(s-1)+3]?i=s:u=s,s=i+u>>1;return 0===(a=s/o)?1:a},s=function(t,e,r,n,i,s,a,u,l,c){var p;return p=o(e),t.drawImage(e,r,n,i,s,a,u,l,c/p)},i=function(t,e){var r,n,i,o,s,a,u,l,c;if(i=!1,c=!0,n=t.document,l=n.documentElement,r=n.addEventListener?"addEventListener":"attachEvent",u=n.addEventListener?"removeEventListener":"detachEvent",a=n.addEventListener?"":"on",o=function(r){if("readystatechange"!==r.type||"complete"===n.readyState)return("load"===r.type?t:n)[u](a+r.type,o,!1),!i&&(i=!0)?e.call(t,r.type||r):void 0},s=function(){try{l.doScroll("left")}catch(t){return t,void setTimeout(s,50)}return o("poll")},"complete"!==n.readyState){if(n.createEventObject&&l.doScroll){try{c=!t.frameElement}catch(t){}c&&s()}return n[r](a+"DOMContentLoaded",o,!1),n[r](a+"readystatechange",o,!1),t[r](a+"load",o,!1)}},e._autoDiscoverFunction=function(){if(e.autoDiscover)return e.discover()},i(window,e._autoDiscoverFunction)}).call(this)}).call(e,r(46)(t))},function(t,e,r){"use strict";r.d(e,"a",function(){return m});var n=r(153),i=r(163),o=(r(116),r(115),r(164)),s=r(165),a=r(166),u=r(172);function l(t){"@babel/helpers - typeof";return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function c(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,_(n.key),n)}}function p(t,e,r){return e=h(e),function(t,e){if(e&&("object"===l(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,r||[],h(t).constructor):e.apply(t,r))}function h(t){return(h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function d(t,e){return(d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function f(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function g(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?f(Object(r),!0).forEach(function(e){y(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function y(t,e,r){return(e=_(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _(t){var e=function(t,e){if("object"!=l(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==l(e)?e:String(e)}var v=g(g({},n.a.defaultOptions),{},{httpStack:new s.a,fileReader:new a.a,urlStorage:o.b?new o.a:new i.a,fingerprint:u.a}),m=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),p(this,e,[t,r=g(g({},v),r)])}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&d(t,e)}(e,n["a"]),function(t,e,r){e&&c(t.prototype,e),r&&c(t,r),Object.defineProperty(t,"prototype",{writable:!1})}(e,null,[{key:"terminate",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e=g(g({},v),e),n.a.terminate(t,e)}}]),e}();"function"==typeof XMLHttpRequest&&"function"==typeof Blob&&Blob.prototype.slice},function(t,e,r){"use strict";var n=r(154),i=r(159),o=r.n(i),s=r(115),a=r(116),u=r(162);function l(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */l=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var o=e&&e.prototype instanceof m?e:m,s=Object.create(o.prototype),a=new I(n||[]);return i(s,"_invoke",{value:O(t,r,a)}),s}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=p;var f="suspendedStart",g="suspendedYield",y="executing",_="completed",v={};function m(){}function b(){}function w(){}var E={};c(E,s,function(){return this});var P=Object.getPrototypeOf,S=P&&P(P(M([])));S&&S!==r&&n.call(S,s)&&(E=S);var x=w.prototype=m.prototype=Object.create(E);function k(t){["next","throw","return"].forEach(function(e){c(t,e,function(t){return this._invoke(e,t)})})}function A(t,e){function r(i,o,s,a){var u=h(t[i],t,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==d(c)&&n.call(c,"__await")?e.resolve(c.__await).then(function(t){r("next",t,s,a)},function(t){r("throw",t,s,a)}):e.resolve(c).then(function(t){l.value=t,s(l)},function(t){return r("throw",t,s,a)})}a(u.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e(function(e,i){r(t,n,e,i)})}return o=o?o.then(i,i):i()}})}function O(e,r,n){var i=f;return function(o,s){if(i===y)throw new Error("Generator is already running");if(i===_){if("throw"===o)throw s;return{value:t,done:!0}}for(n.method=o,n.arg=s;;){var a=n.delegate;if(a){var u=T(a,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===f)throw i=_,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=y;var l=h(e,r,n);if("normal"===l.type){if(i=n.done?_:g,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=_,n.method="throw",n.arg=l.arg)}}}function T(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,T(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var o=h(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var s=o.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function R(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(R,this),this.reset(!0)}function M(e){if(e||""===e){var r=e[s];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}throw new TypeError(d(e)+" is not iterable")}return b.prototype=w,i(x,"constructor",{value:w,configurable:!0}),i(w,"constructor",{value:b,configurable:!0}),b.displayName=c(w,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,c(t,u,"GeneratorFunction")),t.prototype=Object.create(x),t},e.awrap=function(t){return{__await:t}},k(A.prototype),c(A.prototype,a,function(){return this}),e.AsyncIterator=A,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var s=new A(p(t,r,n,i),o);return e.isGeneratorFunction(r)?s:s.next().then(function(t){return t.done?t.value:s.next()})},k(x),c(x,u,"Generator"),c(x,s,function(){return this}),c(x,"toString",function(){return"[object Generator]"}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=M,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return a.type="throw",a.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return i("end");if(s.tryLoc<=this.prev){var u=n.call(s,"catchLoc"),l=n.call(s,"finallyLoc");if(u&&l){if(this.prev<s.catchLoc)return i(s.catchLoc,!0);if(this.prev<s.finallyLoc)return i(s.finallyLoc)}else if(u){if(this.prev<s.catchLoc)return i(s.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return i(s.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=t,s.arg=e,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;C(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function c(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,i)}function p(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,s,a=[],u=!0,l=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(a.push(n.value),a.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(l)throw i}}return a}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return h(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return h(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function d(t){"@babel/helpers - typeof";return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function f(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function g(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?f(Object(r),!0).forEach(function(e){y(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function y(t,e,r){return(e=v(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,v(n.key),n)}}function v(t){var e=function(t,e){if("object"!=d(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=d(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==d(e)?e:String(e)}var m="tus-v1",b="ietf-draft-03",w={endpoint:null,uploadUrl:null,metadata:{},fingerprint:null,uploadSize:null,onProgress:null,onChunkComplete:null,onSuccess:null,onError:null,onUploadUrlAvailable:null,overridePatchMethod:!1,headers:{},addRequestId:!1,onBeforeRequest:null,onAfterResponse:null,onShouldRetry:T,chunkSize:1/0,retryDelays:[0,1e3,3e3,5e3],parallelUploads:1,parallelUploadBoundaries:null,storeFingerprintForResuming:!0,removeFingerprintOnSuccess:!1,uploadLengthDeferred:!1,uploadDataDuringCreation:!1,urlStorage:null,fileReader:null,httpStack:null,protocol:m},E=function(){function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),"resume"in r&&console.log("tus: The `resume` option has been removed in tus-js-client v2. Please use the URL storage API instead."),this.options=r,this.options.chunkSize=Number(this.options.chunkSize),this._urlStorage=this.options.urlStorage,this.file=e,this.url=null,this._req=null,this._fingerprint=null,this._urlStorageKey=null,this._offset=null,this._aborted=!1,this._size=null,this._source=null,this._retryAttempt=0,this._retryTimeout=null,this._offsetBeforeRetry=0,this._parallelUploads=null,this._parallelUploadUrls=null}return function(t,e,r){e&&_(t.prototype,e),r&&_(t,r),Object.defineProperty(t,"prototype",{writable:!1})}(t,[{key:"findPreviousUploads",value:function(){var t=this;return this.options.fingerprint(this.file,this.options).then(function(e){return t._urlStorage.findUploadsByFingerprint(e)})}},{key:"resumeFromPreviousUpload",value:function(t){this.url=t.uploadUrl||null,this._parallelUploadUrls=t.parallelUploadUrls||null,this._urlStorageKey=t.urlStorageKey}},{key:"start",value:function(){var t=this,e=this.file;if(e)if([m,b].includes(this.options.protocol))if(this.options.endpoint||this.options.uploadUrl||this.url){var r=this.options.retryDelays;if(null==r||"[object Array]"===Object.prototype.toString.call(r)){if(this.options.parallelUploads>1)for(var n=0,i=["uploadUrl","uploadSize","uploadLengthDeferred"];n<i.length;n++){var o=i[n];if(this.options[o])return void this._emitError(new Error("tus: cannot use the ".concat(o," option when parallelUploads is enabled")))}if(this.options.parallelUploadBoundaries){if(this.options.parallelUploads<=1)return void this._emitError(new Error("tus: cannot use the `parallelUploadBoundaries` option when `parallelUploads` is disabled"));if(this.options.parallelUploads!==this.options.parallelUploadBoundaries.length)return void this._emitError(new Error("tus: the `parallelUploadBoundaries` must have the same length as the value of `parallelUploads`"))}this.options.fingerprint(e,this.options).then(function(r){return null==r?a.a("No fingerprint was calculated meaning that the upload cannot be stored in the URL storage."):a.a("Calculated fingerprint: ".concat(r)),t._fingerprint=r,t._source?t._source:t.options.fileReader.openFile(e,t.options.chunkSize)}).then(function(e){if(t._source=e,t.options.uploadLengthDeferred)t._size=null;else if(null!=t.options.uploadSize){if(t._size=Number(t.options.uploadSize),Number.isNaN(t._size))return void t._emitError(new Error("tus: cannot convert `uploadSize` option into a number"))}else if(t._size=t._source.size,null==t._size)return void t._emitError(new Error("tus: cannot automatically derive upload's size from input. Specify it manually using the `uploadSize` option or use the `uploadLengthDeferred` option"));t.options.parallelUploads>1||null!=t._parallelUploadUrls?t._startParallelUpload():t._startSingleUpload()}).catch(function(e){t._emitError(e)})}else this._emitError(new Error("tus: the `retryDelays` option must either be an array or null"))}else this._emitError(new Error("tus: neither an endpoint or an upload URL is provided"));else this._emitError(new Error("tus: unsupported protocol ".concat(this.options.protocol)));else this._emitError(new Error("tus: no file or stream to upload provided"))}},{key:"_startParallelUpload",value:function(){var e,r=this,n=this._size,i=0;this._parallelUploads=[];var o=null!=this._parallelUploadUrls?this._parallelUploadUrls.length:this.options.parallelUploads,s=null!==(e=this.options.parallelUploadBoundaries)&&void 0!==e?e:function(t,e){for(var r=Math.floor(t/e),n=[],i=0;i<e;i++)n.push({start:r*i,end:r*(i+1)});return n[e-1].end=t,n}(this._source.size,o);this._parallelUploadUrls&&s.forEach(function(t,e){t.uploadUrl=r._parallelUploadUrls[e]||null}),this._parallelUploadUrls=new Array(s.length);var u,l=s.map(function(e,o){var a=0;return r._source.slice(e.start,e.end).then(function(u){var l=u.value;return new Promise(function(u,c){var p=g(g({},r.options),{},{uploadUrl:e.uploadUrl||null,storeFingerprintForResuming:!1,removeFingerprintOnSuccess:!1,parallelUploads:1,parallelUploadBoundaries:null,metadata:{},headers:g(g({},r.options.headers),{},{"Upload-Concat":"partial"}),onSuccess:u,onError:c,onProgress:function(t){i=i-a+t,a=t,r._emitProgress(i,n)},onUploadUrlAvailable:function(){r._parallelUploadUrls[o]=h.url,r._parallelUploadUrls.filter(function(t){return Boolean(t)}).length===s.length&&r._saveUploadInUrlStorage()}}),h=new t(l,p);h.start(),r._parallelUploads.push(h)})})});Promise.all(l).then(function(){(u=r._openRequest("POST",r.options.endpoint)).setHeader("Upload-Concat","final;".concat(r._parallelUploadUrls.join(" ")));var t=P(r.options.metadata);return""!==t&&u.setHeader("Upload-Metadata",t),r._sendRequest(u,null)}).then(function(t){if(S(t.getStatus(),200)){var e=t.getHeader("Location");null!=e?(r.url=R(r.options.endpoint,e),a.a("Created upload at ".concat(r.url)),r._emitSuccess()):r._emitHttpError(u,t,"tus: invalid or missing Location header")}else r._emitHttpError(u,t,"tus: unexpected response while creating upload")}).catch(function(t){r._emitError(t)})}},{key:"_startSingleUpload",value:function(){return this._aborted=!1,null!=this.url?(a.a("Resuming upload from previous URL: ".concat(this.url)),void this._resumeUpload()):null!=this.options.uploadUrl?(a.a("Resuming upload from provided URL: ".concat(this.options.uploadUrl)),this.url=this.options.uploadUrl,void this._resumeUpload()):(a.a("Creating a new upload"),void this._createUpload())}},{key:"abort",value:function(e){var r=this;return null!=this._parallelUploads&&this._parallelUploads.forEach(function(t){t.abort(e)}),null!==this._req&&this._req.abort(),this._aborted=!0,null!=this._retryTimeout&&(clearTimeout(this._retryTimeout),this._retryTimeout=null),e&&null!=this.url?t.terminate(this.url,this.options).then(function(){return r._removeFromUrlStorage()}):Promise.resolve()}},{key:"_emitHttpError",value:function(t,e,r,n){this._emitError(new s.a(r,n,t,e))}},{key:"_emitError",value:function(t){var e=this;if(!this._aborted){if(null!=this.options.retryDelays)if(null!=this._offset&&this._offset>this._offsetBeforeRetry&&(this._retryAttempt=0),O(t,this._retryAttempt,this.options)){var r=this.options.retryDelays[this._retryAttempt++];return this._offsetBeforeRetry=this._offset,void(this._retryTimeout=setTimeout(function(){e.start()},r))}if("function"!=typeof this.options.onError)throw t;this.options.onError(t)}}},{key:"_emitSuccess",value:function(){this.options.removeFingerprintOnSuccess&&this._removeFromUrlStorage(),"function"==typeof this.options.onSuccess&&this.options.onSuccess()}},{key:"_emitProgress",value:function(t,e){"function"==typeof this.options.onProgress&&this.options.onProgress(t,e)}},{key:"_emitChunkComplete",value:function(t,e,r){"function"==typeof this.options.onChunkComplete&&this.options.onChunkComplete(t,e,r)}},{key:"_createUpload",value:function(){var t=this;if(this.options.endpoint){var e=this._openRequest("POST",this.options.endpoint);this.options.uploadLengthDeferred?e.setHeader("Upload-Defer-Length",1):e.setHeader("Upload-Length",this._size);var r,n=P(this.options.metadata);""!==n&&e.setHeader("Upload-Metadata",n),this.options.uploadDataDuringCreation&&!this.options.uploadLengthDeferred?(this._offset=0,r=this._addChunkToRequest(e)):(this.options.protocol===b&&e.setHeader("Upload-Complete","?0"),r=this._sendRequest(e,null)),r.then(function(r){if(S(r.getStatus(),200)){var n=r.getHeader("Location");if(null!=n){if(t.url=R(t.options.endpoint,n),a.a("Created upload at ".concat(t.url)),"function"==typeof t.options.onUploadUrlAvailable&&t.options.onUploadUrlAvailable(),0===t._size)return t._emitSuccess(),void t._source.close();t._saveUploadInUrlStorage().then(function(){t.options.uploadDataDuringCreation?t._handleUploadResponse(e,r):(t._offset=0,t._performUpload())})}else t._emitHttpError(e,r,"tus: invalid or missing Location header")}else t._emitHttpError(e,r,"tus: unexpected response while creating upload")}).catch(function(r){t._emitHttpError(e,null,"tus: failed to create upload",r)})}else this._emitError(new Error("tus: unable to create upload because no endpoint is provided"))}},{key:"_resumeUpload",value:function(){var t=this,e=this._openRequest("HEAD",this.url);this._sendRequest(e,null).then(function(r){var n=r.getStatus();if(!S(n,200))return 423===n?void t._emitHttpError(e,r,"tus: upload is currently locked; retry later"):(S(n,400)&&t._removeFromUrlStorage(),t.options.endpoint?(t.url=null,void t._createUpload()):void t._emitHttpError(e,r,"tus: unable to resume upload (new upload cannot be created without an endpoint)"));var i=parseInt(r.getHeader("Upload-Offset"),10);if(Number.isNaN(i))t._emitHttpError(e,r,"tus: invalid or missing offset value");else{var o=parseInt(r.getHeader("Upload-Length"),10);!Number.isNaN(o)||t.options.uploadLengthDeferred||t.options.protocol!==m?("function"==typeof t.options.onUploadUrlAvailable&&t.options.onUploadUrlAvailable(),t._saveUploadInUrlStorage().then(function(){if(i===o)return t._emitProgress(o,o),void t._emitSuccess();t._offset=i,t._performUpload()})):t._emitHttpError(e,r,"tus: invalid or missing length value")}}).catch(function(r){t._emitHttpError(e,null,"tus: failed to resume upload",r)})}},{key:"_performUpload",value:function(){var t,e=this;this._aborted||(this.options.overridePatchMethod?(t=this._openRequest("POST",this.url)).setHeader("X-HTTP-Method-Override","PATCH"):t=this._openRequest("PATCH",this.url),t.setHeader("Upload-Offset",this._offset),this._addChunkToRequest(t).then(function(r){S(r.getStatus(),200)?e._handleUploadResponse(t,r):e._emitHttpError(t,r,"tus: unexpected response while uploading chunk")}).catch(function(r){e._aborted||e._emitHttpError(t,null,"tus: failed to upload chunk at offset ".concat(e._offset),r)}))}},{key:"_addChunkToRequest",value:function(t){var e=this,r=this._offset,n=this._offset+this.options.chunkSize;return t.setProgressHandler(function(t){e._emitProgress(r+t,e._size)}),t.setHeader("Content-Type","application/offset+octet-stream"),(n===1/0||n>this._size)&&!this.options.uploadLengthDeferred&&(n=this._size),this._source.slice(r,n).then(function(r){var n=r.value,i=r.done,o=n&&n.size?n.size:0;e.options.uploadLengthDeferred&&i&&(e._size=e._offset+o,t.setHeader("Upload-Length",e._size));var s=e._offset+o;return!e.options.uploadLengthDeferred&&i&&s!==e._size?Promise.reject(new Error("upload was configured with a size of ".concat(e._size," bytes, but the source is done after ").concat(s," bytes"))):null===n?e._sendRequest(t):(e.options.protocol===b&&t.setHeader("Upload-Complete",i?"?1":"?0"),e._emitProgress(e._offset,e._size),e._sendRequest(t,n))})}},{key:"_handleUploadResponse",value:function(t,e){var r=parseInt(e.getHeader("Upload-Offset"),10);if(Number.isNaN(r))this._emitHttpError(t,e,"tus: invalid or missing offset value");else{if(this._emitProgress(r,this._size),this._emitChunkComplete(r-this._offset,r,this._size),this._offset=r,r===this._size)return this._emitSuccess(),void this._source.close();this._performUpload()}}},{key:"_openRequest",value:function(t,e){var r=x(t,e,this.options);return this._req=r,r}},{key:"_removeFromUrlStorage",value:function(){var t=this;this._urlStorageKey&&(this._urlStorage.removeUpload(this._urlStorageKey).catch(function(e){t._emitError(e)}),this._urlStorageKey=null)}},{key:"_saveUploadInUrlStorage",value:function(){var t=this;if(!this.options.storeFingerprintForResuming||!this._fingerprint||null!==this._urlStorageKey)return Promise.resolve();var e={size:this._size,metadata:this.options.metadata,creationTime:(new Date).toString()};return this._parallelUploads?e.parallelUploadUrls=this._parallelUploadUrls:e.uploadUrl=this.url,this._urlStorage.addUpload(this._fingerprint,e).then(function(e){t._urlStorageKey=e})}},{key:"_sendRequest",value:function(t){return k(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,this.options)}}],[{key:"terminate",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=x("DELETE",e,r);return k(n,null,r).then(function(t){if(204!==t.getStatus())throw new s.a("tus: unexpected response while terminating upload",null,n,t)}).catch(function(i){if(i instanceof s.a||(i=new s.a("tus: failed to terminate upload",i,n,null)),!O(i,0,r))throw i;var o=r.retryDelays[0],a=r.retryDelays.slice(1),u=g(g({},r),{},{retryDelays:a});return new Promise(function(t){return setTimeout(t,o)}).then(function(){return t.terminate(e,u)})})}}]),t}();function P(t){return Object.entries(t).map(function(t){var e=p(t,2),r=e[0],i=e[1];return"".concat(r," ").concat(n.a.encode(String(i)))}).join(",")}function S(t,e){return t>=e&&t<e+100}function x(t,e,r){var n=r.httpStack.createRequest(t,e);r.protocol===b?n.setHeader("Upload-Draft-Interop-Version","5"):n.setHeader("Tus-Resumable","1.0.0");var i=r.headers||{};if(Object.entries(i).forEach(function(t){var e=p(t,2),r=e[0],i=e[1];n.setHeader(r,i)}),r.addRequestId){var o=u.a();n.setHeader("X-Request-ID",o)}return n}function k(t,e,r){return A.apply(this,arguments)}function A(){return(A=function(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(t){c(o,n,i,s,a,"next",t)}function a(t){c(o,n,i,s,a,"throw",t)}s(void 0)})}}(l().mark(function t(e,r,n){var i;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if("function"!=typeof n.onBeforeRequest){t.next=3;break}return t.next=3,n.onBeforeRequest(e);case 3:return t.next=5,e.send(r);case 5:if(i=t.sent,"function"!=typeof n.onAfterResponse){t.next=9;break}return t.next=9,n.onAfterResponse(e,i);case 9:return t.abrupt("return",i);case 10:case"end":return t.stop()}},t)}))).apply(this,arguments)}function O(t,e,r){return!(null==r.retryDelays||e>=r.retryDelays.length||null==t.originalRequest)&&(r&&"function"==typeof r.onShouldRetry?r.onShouldRetry(t,e,r):T(t))}function T(t){var e=t.originalResponse?t.originalResponse.getStatus():0;return(!S(e,400)||409===e||423===e)&&function(){var t=!0;return"undefined"!=typeof navigator&&!1===navigator.onLine&&(t=!1),t}()}function R(t,e){return new o.a(e,t).toString()}E.defaultOptions=w,e.a=E},function(t,e,r){"use strict";(function(t){r.d(e,"a",function(){return U});const n="function"==typeof t,i="function"==typeof TextDecoder?new TextDecoder:void 0,o="function"==typeof TextEncoder?new TextEncoder:void 0,s=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),a=(t=>{let e={};return s.forEach((t,r)=>e[t]=r),e})(),u=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,l=String.fromCharCode.bind(String),c="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):t=>new Uint8Array(Array.prototype.slice.call(t,0)),p=t=>t.replace(/=/g,"").replace(/[+\/]/g,t=>"+"==t?"-":"_"),h=t=>t.replace(/[^A-Za-z0-9\+\/]/g,""),d=t=>{let e,r,n,i,o="";const a=t.length%3;for(let a=0;a<t.length;){if((r=t.charCodeAt(a++))>255||(n=t.charCodeAt(a++))>255||(i=t.charCodeAt(a++))>255)throw new TypeError("invalid character found");o+=s[(e=r<<16|n<<8|i)>>18&63]+s[e>>12&63]+s[e>>6&63]+s[63&e]}return a?o.slice(0,a-3)+"===".substring(a):o},f="function"==typeof btoa?t=>btoa(t):n?e=>t.from(e,"binary").toString("base64"):d,g=n?e=>t.from(e).toString("base64"):t=>{let e=[];for(let r=0,n=t.length;r<n;r+=4096)e.push(l.apply(null,t.subarray(r,r+4096)));return f(e.join(""))},y=(t,e=!1)=>e?p(g(t)):g(t),_=t=>{if(t.length<2)return(e=t.charCodeAt(0))<128?t:e<2048?l(192|e>>>6)+l(128|63&e):l(224|e>>>12&15)+l(128|e>>>6&63)+l(128|63&e);var e=65536+1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320);return l(240|e>>>18&7)+l(128|e>>>12&63)+l(128|e>>>6&63)+l(128|63&e)},v=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,m=t=>t.replace(v,_),b=n?e=>t.from(e,"utf8").toString("base64"):o?t=>g(o.encode(t)):t=>f(m(t)),w=(t,e=!1)=>e?p(b(t)):b(t),E=t=>w(t,!0),P=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,S=t=>{switch(t.length){case 4:var e=((7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3))-65536;return l(55296+(e>>>10))+l(56320+(1023&e));case 3:return l((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return l((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},x=t=>t.replace(P,S),k=t=>{if(t=t.replace(/\s+/g,""),!u.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(3&t.length));let e,r,n,i="";for(let o=0;o<t.length;)e=a[t.charAt(o++)]<<18|a[t.charAt(o++)]<<12|(r=a[t.charAt(o++)])<<6|(n=a[t.charAt(o++)]),i+=64===r?l(e>>16&255):64===n?l(e>>16&255,e>>8&255):l(e>>16&255,e>>8&255,255&e);return i},A="function"==typeof atob?t=>atob(h(t)):n?e=>t.from(e,"base64").toString("binary"):k,O=n?e=>c(t.from(e,"base64")):t=>c(A(t).split("").map(t=>t.charCodeAt(0))),T=t=>O(C(t)),R=n?e=>t.from(e,"base64").toString("utf8"):i?t=>i.decode(O(t)):t=>x(A(t)),C=t=>h(t.replace(/[-_]/g,t=>"-"==t?"+":"/")),I=t=>R(C(t)),M=t=>({value:t,enumerable:!1,writable:!0,configurable:!0}),D=function(){const t=(t,e)=>Object.defineProperty(String.prototype,t,M(e));t("fromBase64",function(){return I(this)}),t("toBase64",function(t){return w(this,t)}),t("toBase64URI",function(){return w(this,!0)}),t("toBase64URL",function(){return w(this,!0)}),t("toUint8Array",function(){return T(this)})},L=function(){const t=(t,e)=>Object.defineProperty(Uint8Array.prototype,t,M(e));t("toBase64",function(t){return y(this,t)}),t("toBase64URI",function(){return y(this,!0)}),t("toBase64URL",function(){return y(this,!0)})},U={version:"3.7.7",VERSION:"3.7.7",atob:A,atobPolyfill:k,btoa:f,btoaPolyfill:d,fromBase64:I,toBase64:w,encode:w,encodeURI:E,encodeURL:E,utob:m,btou:x,decode:I,isValid:t=>{if("string"!=typeof t)return!1;const e=t.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(e)||!/[^\s0-9a-zA-Z\-_]/.test(e)},fromUint8Array:y,toUint8Array:T,extendString:D,extendUint8Array:L,extendBuiltins:()=>{D(),L()}}}).call(e,r(155).Buffer)},function(t,e,r){"use strict";(function(t){
|
|
27
27
|
/*!
|
|
28
28
|
* The buffer module from node.js, for the browser.
|
|
29
29
|
*
|
|
30
30
|
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
31
31
|
* @license MIT
|
|
32
32
|
*/
|
|
33
|
-
var n=r(156),i=r(157),o=r(158);function s(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(s()<e)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=u.prototype:(null===t&&(t=new u(e)),t.length=e),t}function u(t,e,r){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return p(this,t)}return l(this,t,e,r)}function l(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n);u.TYPED_ARRAY_SUPPORT?(t=e).__proto__=u.prototype:t=h(t,e);return t}(t,e,r,n):"string"==typeof e?function(t,e,r){"string"==typeof r&&""!==r||(r="utf8");if(!u.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|f(e,r),i=(t=a(t,n)).write(e,r);i!==n&&(t=t.slice(0,i));return t}(t,e,r):function(t,e){if(u.isBuffer(e)){var r=0|d(e.length);return 0===(t=a(t,r)).length?t:(e.copy(t,0,0,r),t)}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||function(t){return t!=t}(e.length)?a(t,0):h(t,e);if("Buffer"===e.type&&o(e.data))return h(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function c(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function p(t,e){if(c(e),t=a(t,e<0?0:0|d(e)),!u.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function h(t,e){var r=e.length<0?0:0|d(e.length);t=a(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function d(t){if(t>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function f(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return B(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(t).length;default:if(n)return B(t).length;e=(""+e).toLowerCase(),n=!0}}function g(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function y(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:_(t,e,r,n,i);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):_(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function _(t,e,r,n,i){var o,s=1,a=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,r/=2}function l(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var c=-1;for(o=r;o<a;o++)if(l(t,o)===l(e,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===u)return c*s}else-1!==c&&(o-=o-c),c=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){for(var p=!0,h=0;h<u;h++)if(l(t,o+h)!==l(e,h)){p=!1;break}if(p)return o}return-1}function v(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s<n;++s){var a=parseInt(e.substr(2*s,2),16);if(isNaN(a))return s;t[r+s]=a}return s}function m(t,e,r,n){return q(B(e,t.length-r),t,r,n)}function b(t,e,r,n){return q(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function w(t,e,r,n){return b(t,e,r,n)}function E(t,e,r,n){return q(z(e),t,r,n)}function P(t,e,r,n){return q(function(t,e){for(var r,n,i,o=[],s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function S(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function x(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o,s,a,u,l=t[i],c=null,p=l>239?4:l>223?3:l>191?2:1;if(i+p<=r)switch(p){case 1:l<128&&(c=l);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&l)<<6|63&o)>127&&(c=u);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(u=(15&l)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&l)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(c=u)}null===c?(c=65533,p=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=p}return function(t){var e=t.length;if(e<=k)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=k));return r}(n)}e.Buffer=u,e.SlowBuffer=function(t){+t!=t&&(t=0);return u.alloc(+t)},e.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=s(),u.poolSize=8192,u._augment=function(t){return t.__proto__=u.prototype,t},u.from=function(t,e,r){return l(null,t,e,r)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(t,e,r){return function(t,e,r,n){return c(e),e<=0?a(t,e):void 0!==r?"string"==typeof n?a(t,e).fill(r,n):a(t,e).fill(r):a(t,e)}(null,t,e,r)},u.allocUnsafe=function(t){return p(null,t)},u.allocUnsafeSlow=function(t){return p(null,t)},u.isBuffer=function(t){return!(null==t||!t._isBuffer)},u.compare=function(t,e){if(!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(t,e){if(!o(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=u.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var s=t[r];if(!u.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,i),i+=s.length}return n},u.byteLength=f,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)g(this,e,e+1);return this},u.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},u.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},u.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?x(this,0,t):function(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return T(this,e,r);case"utf8":case"utf-8":return x(this,e,r);case"ascii":return A(this,e,r);case"latin1":case"binary":return O(this,e,r);case"base64":return S(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},u.prototype.compare=function(t,e,r,n,i){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;for(var o=i-n,s=r-e,a=Math.min(o,s),l=this.slice(n,i),c=t.slice(e,r),p=0;p<a;++p)if(l[p]!==c[p]){o=l[p],s=c[p];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},u.prototype.indexOf=function(t,e,r){return y(this,t,e,r,!0)},u.prototype.lastIndexOf=function(t,e,r){return y(this,t,e,r,!1)},u.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return v(this,t,e,r);case"utf8":case"utf-8":return m(this,t,e,r);case"ascii":return b(this,t,e,r);case"latin1":case"binary":return w(this,t,e,r);case"base64":return E(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var k=4096;function A(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function O(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function T(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=j(t[o]);return i}function R(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function C(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function I(t,e,r,n,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function M(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i<o;++i)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function D(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i<o;++i)t[r+i]=e>>>8*(n?i:3-i)&255}function L(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function U(t,e,r,n,o){return o||L(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function F(t,e,r,n,o){return o||L(t,0,r,8),i.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){var r,n=this.length;if(t=~~t,e=void 0===e?n:~~e,t<0?(t+=n)<0&&(t=0):t>n&&(t=n),e<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),u.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=u.prototype;else{var i=e-t;r=new u(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+t]}return r},u.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||C(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},u.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||C(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},u.prototype.readUInt8=function(t,e){return e||C(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||C(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||C(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||C(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||C(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||C(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||C(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return e||C(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||C(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){e||C(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return e||C(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||C(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||C(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||C(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||C(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||C(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||I(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},u.prototype.writeUIntBE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||I(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},u.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):M(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):M(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):D(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):D(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);I(this,t,e,r,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o<r&&(s*=256);)t<0&&0===a&&0!==this[e+o-1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);I(this,t,e,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):M(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):M(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):D(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):D(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,r){return U(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return U(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return F(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return F(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i,o=n-r;if(this===t&&r<e&&e<n)for(i=o-1;i>=0;--i)t[i+e]=this[i+r];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+o),e);return o},u.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var o;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var s=u.isBuffer(t)?t:B(new u(t,n).toString()),a=s.length;for(o=0;o<r-e;++o)this[o+e]=s[o%a]}return this};var N=/[^+\/0-9A-Za-z-_]/g;function j(t){return t<16?"0"+t.toString(16):t.toString(16)}function B(t,e){var r;e=e||1/0;for(var n=t.length,i=null,o=[],s=0;s<n;++s){if((r=t.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function z(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(N,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function q(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}}).call(e,r(12))},function(t,e,r){"use strict";e.byteLength=function(t){return 3*t.length/4-l(t)},e.toByteArray=function(t){var e,r,n,s,a,u=t.length;s=l(t),a=new o(3*u/4-s),r=s>0?u-4:u;var c=0;for(e=0;e<r;e+=4)n=i[t.charCodeAt(e)]<<18|i[t.charCodeAt(e+1)]<<12|i[t.charCodeAt(e+2)]<<6|i[t.charCodeAt(e+3)],a[c++]=n>>16&255,a[c++]=n>>8&255,a[c++]=255&n;2===s?(n=i[t.charCodeAt(e)]<<2|i[t.charCodeAt(e+1)]>>4,a[c++]=255&n):1===s&&(n=i[t.charCodeAt(e)]<<10|i[t.charCodeAt(e+1)]<<4|i[t.charCodeAt(e+2)]>>2,a[c++]=n>>8&255,a[c++]=255&n);return a},e.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o="",s=[],a=0,u=r-i;a<u;a+=16383)s.push(p(t,a,a+16383>u?u:a+16383));1===i?(e=t[r-1],o+=n[e>>2],o+=n[e<<4&63],o+="=="):2===i&&(e=(t[r-2]<<8)+t[r-1],o+=n[e>>10],o+=n[e>>4&63],o+=n[e<<2&63],o+="=");return s.push(o),s.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=s.length;a<u;++a)n[a]=s[a],i[s.charCodeAt(a)]=a;function l(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function c(t){return n[t>>18&63]+n[t>>12&63]+n[t>>6&63]+n[63&t]}function p(t,e,r){for(var n,i=[],o=e;o<r;o+=3)n=(t[o]<<16)+(t[o+1]<<8)+t[o+2],i.push(c(n));return i.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,l=u>>1,c=-7,p=r?i-1:0,h=r?-1:1,d=t[e+p];for(p+=h,o=d&(1<<-c)-1,d>>=-c,c+=a;c>0;o=256*o+t[e+p],p+=h,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=n;c>0;s=256*s+t[e+p],p+=h,c-=8);if(0===o)o=1-l;else{if(o===u)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=l}return(d?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,u,l=8*o-i-1,c=(1<<l)-1,p=c>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,f=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=c):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+p>=1?h/u:h*Math.pow(2,1-p))*u>=2&&(s++,u/=2),s+p>=c?(a=0,s=c):s+p>=1?(a=(e*u-1)*Math.pow(2,i),s+=p):(a=e*Math.pow(2,p-1)*Math.pow(2,i),s=0));i>=8;t[r+d]=255&a,d+=f,a/=256,i-=8);for(s=s<<i|a,l+=i;l>0;t[r+d]=255&s,d+=f,s/=256,l-=8);t[r+d-f]|=128*g}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){"use strict";(function(e){var n=r(160),i=r(161),o=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,s=/[\n\r\t]/g,a=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,u=/:\d+$/,l=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,c=/^[a-zA-Z]:/;function p(t){return(t||"").toString().replace(o,"")}var h=[["#","hash"],["?","query"],function(t,e){return g(e.protocol)?t.replace(/\\/g,"/"):t},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],d={hash:1,query:1};function f(t){var r,n=("undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{}).location||{},i={},o=typeof(t=t||n);if("blob:"===t.protocol)i=new _(unescape(t.pathname),{});else if("string"===o)for(r in i=new _(t,{}),d)delete i[r];else if("object"===o){for(r in t)r in d||(i[r]=t[r]);void 0===i.slashes&&(i.slashes=a.test(t.href))}return i}function g(t){return"file:"===t||"ftp:"===t||"http:"===t||"https:"===t||"ws:"===t||"wss:"===t}function y(t,e){t=(t=p(t)).replace(s,""),e=e||{};var r,n=l.exec(t),i=n[1]?n[1].toLowerCase():"",o=!!n[2],a=!!n[3],u=0;return o?a?(r=n[2]+n[3]+n[4],u=n[2].length+n[3].length):(r=n[2]+n[4],u=n[2].length):a?(r=n[3]+n[4],u=n[3].length):r=n[4],"file:"===i?u>=2&&(r=r.slice(2)):g(i)?r=n[4]:i?o&&(r=r.slice(2)):u>=2&&g(e.protocol)&&(r=n[4]),{protocol:i,slashes:o||g(i),slashesCount:u,rest:r}}function _(t,e,r){if(t=(t=p(t)).replace(s,""),!(this instanceof _))return new _(t,e,r);var o,a,u,l,d,v,m=h.slice(),b=typeof e,w=this,E=0;for("object"!==b&&"string"!==b&&(r=e,e=null),r&&"function"!=typeof r&&(r=i.parse),e=f(e),o=!(a=y(t||"",e)).protocol&&!a.slashes,w.slashes=a.slashes||o&&e.slashes,w.protocol=a.protocol||e.protocol||"",t=a.rest,("file:"===a.protocol&&(2!==a.slashesCount||c.test(t))||!a.slashes&&(a.protocol||a.slashesCount<2||!g(w.protocol)))&&(m[3]=[/(.*)/,"pathname"]);E<m.length;E++)"function"!=typeof(l=m[E])?(u=l[0],v=l[1],u!=u?w[v]=t:"string"==typeof u?~(d="@"===u?t.lastIndexOf(u):t.indexOf(u))&&("number"==typeof l[2]?(w[v]=t.slice(0,d),t=t.slice(d+l[2])):(w[v]=t.slice(d),t=t.slice(0,d))):(d=u.exec(t))&&(w[v]=d[1],t=t.slice(0,d.index)),w[v]=w[v]||o&&l[3]&&e[v]||"",l[4]&&(w[v]=w[v].toLowerCase())):t=l(t,w);r&&(w.query=r(w.query)),o&&e.slashes&&"/"!==w.pathname.charAt(0)&&(""!==w.pathname||""!==e.pathname)&&(w.pathname=function(t,e){if(""===t)return e;for(var r=(e||"/").split("/").slice(0,-1).concat(t.split("/")),n=r.length,i=r[n-1],o=!1,s=0;n--;)"."===r[n]?r.splice(n,1):".."===r[n]?(r.splice(n,1),s++):s&&(0===n&&(o=!0),r.splice(n,1),s--);return o&&r.unshift(""),"."!==i&&".."!==i||r.push(""),r.join("/")}(w.pathname,e.pathname)),"/"!==w.pathname.charAt(0)&&g(w.protocol)&&(w.pathname="/"+w.pathname),n(w.port,w.protocol)||(w.host=w.hostname,w.port=""),w.username=w.password="",w.auth&&(~(d=w.auth.indexOf(":"))?(w.username=w.auth.slice(0,d),w.username=encodeURIComponent(decodeURIComponent(w.username)),w.password=w.auth.slice(d+1),w.password=encodeURIComponent(decodeURIComponent(w.password))):w.username=encodeURIComponent(decodeURIComponent(w.auth)),w.auth=w.password?w.username+":"+w.password:w.username),w.origin="file:"!==w.protocol&&g(w.protocol)&&w.host?w.protocol+"//"+w.host:"null",w.href=w.toString()}_.prototype={set:function(t,e,r){var o=this;switch(t){case"query":"string"==typeof e&&e.length&&(e=(r||i.parse)(e)),o[t]=e;break;case"port":o[t]=e,n(e,o.protocol)?e&&(o.host=o.hostname+":"+e):(o.host=o.hostname,o[t]="");break;case"hostname":o[t]=e,o.port&&(e+=":"+o.port),o.host=e;break;case"host":o[t]=e,u.test(e)?(e=e.split(":"),o.port=e.pop(),o.hostname=e.join(":")):(o.hostname=e,o.port="");break;case"protocol":o.protocol=e.toLowerCase(),o.slashes=!r;break;case"pathname":case"hash":if(e){var s="pathname"===t?"/":"#";o[t]=e.charAt(0)!==s?s+e:e}else o[t]=e;break;case"username":case"password":o[t]=encodeURIComponent(e);break;case"auth":var a=e.indexOf(":");~a?(o.username=e.slice(0,a),o.username=encodeURIComponent(decodeURIComponent(o.username)),o.password=e.slice(a+1),o.password=encodeURIComponent(decodeURIComponent(o.password))):o.username=encodeURIComponent(decodeURIComponent(e))}for(var l=0;l<h.length;l++){var c=h[l];c[4]&&(o[c[1]]=o[c[1]].toLowerCase())}return o.auth=o.password?o.username+":"+o.password:o.username,o.origin="file:"!==o.protocol&&g(o.protocol)&&o.host?o.protocol+"//"+o.host:"null",o.href=o.toString(),o},toString:function(t){t&&"function"==typeof t||(t=i.stringify);var e,r=this,n=r.host,o=r.protocol;o&&":"!==o.charAt(o.length-1)&&(o+=":");var s=o+(r.protocol&&r.slashes||g(r.protocol)?"//":"");return r.username?(s+=r.username,r.password&&(s+=":"+r.password),s+="@"):r.password?(s+=":"+r.password,s+="@"):"file:"!==r.protocol&&g(r.protocol)&&!n&&"/"!==r.pathname&&(s+="@"),(":"===n[n.length-1]||u.test(r.hostname)&&!r.port)&&(n+=":"),s+=n+r.pathname,(e="object"==typeof r.query?t(r.query):r.query)&&(s+="?"!==e.charAt(0)?"?"+e:e),r.hash&&(s+=r.hash),s}},_.extractProtocol=y,_.location=f,_.trimLeft=p,_.qs=i,t.exports=_}).call(e,r(12))},function(t,e,r){"use strict";t.exports=function(t,e){if(e=e.split(":")[0],!(t=+t))return!1;switch(e){case"http":case"ws":return 80!==t;case"https":case"wss":return 443!==t;case"ftp":return 21!==t;case"gopher":return 70!==t;case"file":return!1}return 0!==t}},function(t,e,r){"use strict";var n,i=Object.prototype.hasOwnProperty;function o(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch(t){return null}}function s(t){try{return encodeURIComponent(t)}catch(t){return null}}e.stringify=function(t,e){e=e||"";var r,o,a=[];for(o in"string"!=typeof e&&(e="?"),t)if(i.call(t,o)){if((r=t[o])||null!==r&&r!==n&&!isNaN(r)||(r=""),o=s(o),r=s(r),null===o||null===r)continue;a.push(o+"="+r)}return a.length?e+a.join("&"):""},e.parse=function(t){for(var e,r=/([^=?#&]+)=?([^&]*)/g,n={};e=r.exec(t);){var i=o(e[1]),s=o(e[2]);null===i||null===s||i in n||(n[i]=s)}return n}},function(t,e,r){"use strict";e.a=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0,r="x"===t?e:3&e|8;return r.toString(16)})}},function(t,e,r){"use strict";function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,o(n.key),n)}}function o(t){var e=function(t,e){if("object"!=n(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==n(e)?e:String(e)}r.d(e,"a",function(){return s});var s=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return function(t,e,r){e&&i(t.prototype,e),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1})}(t,[{key:"listAllUploads",value:function(){return Promise.resolve([])}},{key:"findUploadsByFingerprint",value:function(t){return Promise.resolve([])}},{key:"removeUpload",value:function(t){return Promise.resolve()}},{key:"addUpload",value:function(t,e){return Promise.resolve(null)}}]),t}()},function(t,e,r){"use strict";function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,o(n.key),n)}}function o(t){var e=function(t,e){if("object"!=n(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==n(e)?e:String(e)}r.d(e,"b",function(){return l}),r.d(e,"a",function(){return c});var s=!1;try{s="localStorage"in window;var a="tusSupport",u=localStorage.getItem(a);localStorage.setItem(a,u),null===u&&localStorage.removeItem(a)}catch(t){if(t.code!==t.SECURITY_ERR&&t.code!==t.QUOTA_EXCEEDED_ERR)throw t;s=!1}var l=s,c=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return function(t,e,r){e&&i(t.prototype,e),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1})}(t,[{key:"findAllUploads",value:function(){var t=this._findEntries("tus::");return Promise.resolve(t)}},{key:"findUploadsByFingerprint",value:function(t){var e=this._findEntries("tus::".concat(t,"::"));return Promise.resolve(e)}},{key:"removeUpload",value:function(t){return localStorage.removeItem(t),Promise.resolve()}},{key:"addUpload",value:function(t,e){var r=Math.round(1e12*Math.random()),n="tus::".concat(t,"::").concat(r);return localStorage.setItem(n,JSON.stringify(e)),Promise.resolve(n)}},{key:"_findEntries",value:function(t){for(var e=[],r=0;r<localStorage.length;r++){var n=localStorage.key(r);if(0===n.indexOf(t))try{var i=JSON.parse(localStorage.getItem(n));i.urlStorageKey=n,e.push(i)}catch(t){}}return e}}]),t}()},function(t,e,r){"use strict";function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,a(n.key),n)}}function s(t,e,r){return e&&o(t.prototype,e),r&&o(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function a(t){var e=function(t,e){if("object"!=n(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==n(e)?e:String(e)}r.d(e,"a",function(){return u});var u=function(){function t(){i(this,t)}return s(t,[{key:"createRequest",value:function(t,e){return new l(t,e)}},{key:"getName",value:function(){return"XHRHttpStack"}}]),t}(),l=function(){function t(e,r){i(this,t),this._xhr=new XMLHttpRequest,this._xhr.open(e,r,!0),this._method=e,this._url=r,this._headers={}}return s(t,[{key:"getMethod",value:function(){return this._method}},{key:"getURL",value:function(){return this._url}},{key:"setHeader",value:function(t,e){this._xhr.setRequestHeader(t,e),this._headers[t]=e}},{key:"getHeader",value:function(t){return this._headers[t]}},{key:"setProgressHandler",value:function(t){"upload"in this._xhr&&(this._xhr.upload.onprogress=function(e){e.lengthComputable&&t(e.loaded)})}},{key:"send",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return new Promise(function(r,n){t._xhr.onload=function(){r(new c(t._xhr))},t._xhr.onerror=function(t){n(t)},t._xhr.send(e)})}},{key:"abort",value:function(){return this._xhr.abort(),Promise.resolve()}},{key:"getUnderlyingObject",value:function(){return this._xhr}}]),t}(),c=function(){function t(e){i(this,t),this._xhr=e}return s(t,[{key:"getStatus",value:function(){return this._xhr.status}},{key:"getHeader",value:function(t){return this._xhr.getResponseHeader(t)}},{key:"getBody",value:function(){return this._xhr.responseText}},{key:"getUnderlyingObject",value:function(){return this._xhr}}]),t}()},function(t,e,r){"use strict";r.d(e,"a",function(){return h});var n=r(118),i=r(167),o=r(168),s=r(171);function a(t){"@babel/helpers - typeof";return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function u(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */u=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",l=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function p(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{p({},"")}catch(t){p=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var o=e&&e.prototype instanceof m?e:m,s=Object.create(o.prototype),a=new I(n||[]);return i(s,"_invoke",{value:O(t,r,a)}),s}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var f="suspendedStart",g="suspendedYield",y="executing",_="completed",v={};function m(){}function b(){}function w(){}var E={};p(E,s,function(){return this});var P=Object.getPrototypeOf,S=P&&P(P(M([])));S&&S!==r&&n.call(S,s)&&(E=S);var x=w.prototype=m.prototype=Object.create(E);function k(t){["next","throw","return"].forEach(function(e){p(t,e,function(t){return this._invoke(e,t)})})}function A(t,e){function r(i,o,s,u){var l=d(t[i],t,o);if("throw"!==l.type){var c=l.arg,p=c.value;return p&&"object"==a(p)&&n.call(p,"__await")?e.resolve(p.__await).then(function(t){r("next",t,s,u)},function(t){r("throw",t,s,u)}):e.resolve(p).then(function(t){c.value=t,s(c)},function(t){return r("throw",t,s,u)})}u(l.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e(function(e,i){r(t,n,e,i)})}return o=o?o.then(i,i):i()}})}function O(e,r,n){var i=f;return function(o,s){if(i===y)throw new Error("Generator is already running");if(i===_){if("throw"===o)throw s;return{value:t,done:!0}}for(n.method=o,n.arg=s;;){var a=n.delegate;if(a){var u=T(a,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===f)throw i=_,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=y;var l=d(e,r,n);if("normal"===l.type){if(i=n.done?_:g,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=_,n.method="throw",n.arg=l.arg)}}}function T(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,T(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var o=d(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var s=o.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function R(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(R,this),this.reset(!0)}function M(e){if(e||""===e){var r=e[s];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}throw new TypeError(a(e)+" is not iterable")}return b.prototype=w,i(x,"constructor",{value:w,configurable:!0}),i(w,"constructor",{value:b,configurable:!0}),b.displayName=p(w,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,p(t,c,"GeneratorFunction")),t.prototype=Object.create(x),t},e.awrap=function(t){return{__await:t}},k(A.prototype),p(A.prototype,l,function(){return this}),e.AsyncIterator=A,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var s=new A(h(t,r,n,i),o);return e.isGeneratorFunction(r)?s:s.next().then(function(t){return t.done?t.value:s.next()})},k(x),p(x,c,"Generator"),p(x,s,function(){return this}),p(x,"toString",function(){return"[object Generator]"}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=M,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return a.type="throw",a.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return i("end");if(s.tryLoc<=this.prev){var u=n.call(s,"catchLoc"),l=n.call(s,"finallyLoc");if(u&&l){if(this.prev<s.catchLoc)return i(s.catchLoc,!0);if(this.prev<s.finallyLoc)return i(s.finallyLoc)}else if(u){if(this.prev<s.catchLoc)return i(s.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return i(s.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=t,s.arg=e,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;C(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function l(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,i)}function c(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,p(n.key),n)}}function p(t){var e=function(t,e){if("object"!=a(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==a(e)?e:String(e)}var h=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return function(t,e,r){e&&c(t.prototype,e),r&&c(t,r),Object.defineProperty(t,"prototype",{writable:!1})}(t,[{key:"openFile",value:function(){var t=function(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(t){l(o,n,i,s,a,"next",t)}function a(t){l(o,n,i,s,a,"throw",t)}s(void 0)})}}(u().mark(function t(e,r){var a;return u().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!n.a()||!e||void 0===e.uri){t.next=11;break}return t.prev=1,t.next=4,i.a(e.uri);case 4:return a=t.sent,t.abrupt("return",new o.a(a));case 8:throw t.prev=8,t.t0=t.catch(1),new Error("tus: cannot fetch `file.uri` as Blob, make sure the uri is correct and accessible. ".concat(t.t0));case 11:if("function"!=typeof e.slice||void 0===e.size){t.next=13;break}return t.abrupt("return",Promise.resolve(new o.a(e)));case 13:if("function"!=typeof e.read){t.next=18;break}if(r=Number(r),Number.isFinite(r)){t.next=17;break}return t.abrupt("return",Promise.reject(new Error("cannot create source for stream without a finite value for the `chunkSize` option")));case 17:return t.abrupt("return",Promise.resolve(new s.a(e,r)));case 18:return t.abrupt("return",Promise.reject(new Error("source object may only be an instance of File, Blob, or Reader in this environment")));case 19:case"end":return t.stop()}},t,null,[[1,8]])}));return function(e,r){return t.apply(this,arguments)}}()}]),t}()},function(t,e,r){"use strict";e.a=function(t){return new Promise(function(e,r){var n=new XMLHttpRequest;n.responseType="blob",n.onload=function(){var t=n.response;e(t)},n.onerror=function(t){r(t)},n.open("GET",t),n.send()})}},function(t,e,r){"use strict";r.d(e,"a",function(){return u});var n=r(169),i=r(170);function o(t){"@babel/helpers - typeof";return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,a(n.key),n)}}function a(t){var e=function(t,e){if("object"!=o(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==o(e)?e:String(e)}var u=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._file=e,this.size=e.size}return function(t,e,r){e&&s(t.prototype,e),r&&s(t,r),Object.defineProperty(t,"prototype",{writable:!1})}(t,[{key:"slice",value:function(t,e){if(n.a())return i.a(this._file.slice(t,e));var r=this._file.slice(t,e),o=e>=this.size;return Promise.resolve({value:r,done:o})}},{key:"close",value:function(){}}]),t}()},function(t,e,r){"use strict";e.a=function(){return"undefined"!=typeof window&&(void 0!==window.PhoneGap||void 0!==window.Cordova||void 0!==window.cordova)}},function(t,e,r){"use strict";e.a=function(t){return new Promise(function(e,r){var n=new FileReader;n.onload=function(){var t=new Uint8Array(n.result);e({value:t})},n.onerror=function(t){r(t)},n.readAsArrayBuffer(t)})}},function(t,e,r){"use strict";function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,o(n.key),n)}}function o(t){var e=function(t,e){if("object"!=n(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==n(e)?e:String(e)}function s(t){return void 0===t?0:void 0!==t.size?t.size:t.length}r.d(e,"a",function(){return a});var a=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._buffer=void 0,this._bufferOffset=0,this._reader=e,this._done=!1}return function(t,e,r){e&&i(t.prototype,e),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1})}(t,[{key:"slice",value:function(t,e){return t<this._bufferOffset?Promise.reject(new Error("Requested data is before the reader's current offset")):this._readUntilEnoughDataOrDone(t,e)}},{key:"_readUntilEnoughDataOrDone",value:function(t,e){var r=this,n=e<=this._bufferOffset+s(this._buffer);if(this._done||n){var i=this._getDataFromBuffer(t,e),o=null==i&&this._done;return Promise.resolve({value:i,done:o})}return this._reader.read().then(function(n){var i=n.value;return n.done?r._done=!0:void 0===r._buffer?r._buffer=i:r._buffer=function(t,e){if(t.concat)return t.concat(e);if(t instanceof Blob)return new Blob([t,e],{type:t.type});if(t.set){var r=new t.constructor(t.length+e.length);return r.set(t),r.set(e,t.length),r}throw new Error("Unknown data type")}(r._buffer,i),r._readUntilEnoughDataOrDone(t,e)})}},{key:"_getDataFromBuffer",value:function(t,e){t>this._bufferOffset&&(this._buffer=this._buffer.slice(t-this._bufferOffset),this._bufferOffset=t);var r=0===s(this._buffer);return this._done&&r?null:this._buffer.slice(0,e-t)}},{key:"close",value:function(){this._reader.cancel&&this._reader.cancel()}}]),t}()},function(t,e,r){"use strict";e.a=function(t,e){if(n.a())return Promise.resolve(function(t,e){var r=t.exif?function(t){var e=0;if(0===t.length)return e;for(var r=0;r<t.length;r++){var n=t.charCodeAt(r);e=(e<<5)-e+n,e&=e}return e}(JSON.stringify(t.exif)):"noexif";return["tus-rn",t.name||"noname",t.size||"nosize",r,e.endpoint].join("/")}(t,e));return Promise.resolve(["tus-br",t.name,t.type,t.size,t.lastModified,e.endpoint].join("-"))};var n=r(118)},function(t,e,r){"use strict";var n=r(16),i={oncreate:function(){$(this.refs.nano).nanoScroller({preventPageScrolling:!0,disableResize:!0,contentClass:"scroll-content",paneClass:"scroll-pane"})},ondestroy:function(){$(this.refs.nano).nanoScroller({destroy:!0})},methods:{update:function(){$(this.refs.nano).nanoScroller()},scrollTop:function(){$(this.refs.nano).find(".scroll-content").animate({scrollTop:0},500)},scrollBottom:function(){$(this.refs.nano).nanoScroller({scroll:"bottom"})}}};function o(t){t=t||{},this.refs={},this._state=t.data||{},this._observers={pre:Object.create(null),post:Object.create(null)},this._handlers=Object.create(null),this._root=t._root||this,this._yield=t._yield,this._torndown=!1,this._fragment=function(t,e){var r,i;return{create:function(){r=n.e("div"),i=n.e("div"),this.hydrate()},hydrate:function(t){r.className="nano scrolling-container",i.className="scroll-content"},mount:function(t,o){n.l(r,t,o),e.refs.nano=r,n.b(i,r),e._yield&&e._yield.mount(i,null)},unmount:function(){n.i(r),e.refs.nano===r&&(e.refs.nano=null),e._yield&&e._yield.unmount()},destroy:n.m}}(this._state,this),t.target&&(this._fragment.create(),this._fragment.mount(t.target,null)),t._root?t._root._renderHooks.push(i.oncreate.bind(this)):i.oncreate.call(this)}n.c(o.prototype,i.methods,n.n),o.prototype._set=function(t){var e=this._state;this._state=n.c({},e,t),n.k(this,this._observers.pre,t,e),n.k(this,this._observers.post,t,e)},o.prototype.teardown=o.prototype.destroy=function(t){this.fire("destroy"),i.ondestroy.call(this),!1!==t&&this._fragment.unmount(),this._fragment.destroy(),this._fragment=null,this._state={},this._torndown=!0},e.a=o},function(t,e,r){"use strict";var n=r(57),i=r(16),o={data:function(){return{file:void 0,selected:!1,state:"paused",selectedIcon:"check"}},methods:{togglePlay:function(){var t=this.get("file");if("audio"!==t.type)return this.fire("select",t);if(!t.url)throw new Error("File is missing the URL");this.refs.Sounds.instance().load(t.id,t.url),this.refs.Sounds.instance().togglePlay(t.id)},_onSoundsStateChange:function(t){this.set({state:this.refs.Sounds.instance().getState(t)})}}};function s(t,e){var r,n;return{create:function(){r=i.f("svg"),n=i.f("use"),this.hydrate()},hydrate:function(t){i.p(r,"class","icon icon-error"),i.q(n,"xlink:href","#icon-error")},mount:function(t,e){i.l(r,t,e),i.b(n,r)},unmount:function(){i.i(r)},destroy:i.m}}function a(t,e){var r,n;return{create:function(){r=i.e("div"),this.hydrate()},hydrate:function(e){r.className="browser-image-prew_img",r.style.cssText=n="background-image: url('"+t.file.thumbnail+"')",i.p(r,"width","112"),i.p(r,"height","71")},mount:function(t,e){i.l(r,t,e)},update:function(t,e){n!==(n="background-image: url('"+e.file.thumbnail+"')")&&(r.style.cssText=n)},unmount:function(){i.i(r)},destroy:i.m}}function u(t,e){var r,n;return{create:function(){r=i.e("div"),n=i.g("Processing..."),this.hydrate()},hydrate:function(t){r.style.cssText="width: 100%"},mount:function(t,e){i.l(r,t,e),i.b(n,r)},update:i.m,unmount:function(){i.i(r)},destroy:i.m}}function l(t,e){var r,n;return{create:function(){r=i.e("div"),this.hydrate()},hydrate:function(e){r.className="progress-bar_fill",r.style.cssText=n="width: "+t.file.progress+"%"},mount:function(t,e){i.l(r,t,e)},update:function(t,e){n!==(n="width: "+e.file.progress+"%")&&(r.style.cssText=n)},unmount:function(){i.i(r)},destroy:i.m}}function c(t){t=t||{},this.refs={},this._state=i.c(o.data(),t.data),this._observers={pre:Object.create(null),post:Object.create(null)},this._handlers=Object.create(null),this._root=t._root||this,this._yield=t._yield,this._torndown=!1,document.getElementById("svelte-1106586334-style")||function(){var t=i.e("style");t.id="svelte-1106586334-style",t.textContent="\n [svelte-1106586334].browser-entry-icon, [svelte-1106586334] .browser-entry-icon {\n display: none;\n }\n\n [svelte-1106586334].upload--is-complete .browser-entry-icon, [svelte-1106586334] .upload--is-complete .browser-entry-icon {\n display: block;\n }\n\n [svelte-1106586334].browser-entry-info:before, [svelte-1106586334] .browser-entry-info:before {\n display: none;\n }\n\n [svelte-1106586334].browser-audio.upload--is-complete .browser-entry-info:before, [svelte-1106586334] .browser-audio.upload--is-complete .browser-entry-info:before {\n display: inline-block;\n }\n\n [svelte-1106586334].icon-error, [svelte-1106586334] .icon-error {\n position: absolute;\n top: 0;\n left: 45px;\n width: 20px;\n height: 100%;\n z-index: 1;\n }\n\n [svelte-1106586334].browser-image-prew_img, [svelte-1106586334] .browser-image-prew_img {\n opacity: 1;\n }\n\n [svelte-1106586334].upload-error .browser-entry-prew:after, [svelte-1106586334] .upload-error .browser-entry-prew:after {\n display: none;\n }\n\n [svelte-1106586334].upload--is-sending .browser-image-prew_img, [svelte-1106586334] .upload--is-sending .browser-image-prew_img,\n [svelte-1106586334].upload-error .browser-image-prew_img, [svelte-1106586334] .upload-error .browser-image-prew_img {\n opacity: .2;\n }\n\n [svelte-1106586334].progress-bar, [svelte-1106586334] .progress-bar {\n background: #cccacf;\n position: absolute;\n top: 32px;\n width: 80px;\n left: 15px;\n height: 7px;\n border-radius: 3px;\n font-family: 'ProximaNova-Regular';\n font-size: 12px;\n }\n [svelte-1106586334].progress-bar_fill, [svelte-1106586334] .progress-bar_fill {\n background: #adadb3;\n height: 100%;\n border-radius: inherit;\n transition: width 100ms linear;\n }\n\n [svelte-1106586334].upload--is-sending .progress-bar, [svelte-1106586334] .upload--is-sending .progress-bar {\n background: transparent;\n }\n\n [svelte-1106586334].upload--is-complete .progress-bar, [svelte-1106586334] .upload--is-complete .progress-bar {\n display: none;\n }\n",i.b(t,document.head)}(),this._renderHooks=[],this._fragment=function(t,e){var r,o,c,p,h,d,f,g,y,_,v,m,b,w,E=new n.a({_root:e._root,data:{service:"Sounds"}});function P(t){var r=e.get();e.fire("select",r.file)}E.on("state",function(t){var r=this._context.state;e._onSoundsStateChange(r.file.id)}),e.refs.Sounds=E,E._context={state:t};var S=t.file.error&&s(),x=t.file.thumbnail&&a(t);function k(t){return 100===t.file.progress&&"sending"===t.file.state?u:l}var A=k(t),O=A(t,e);function T(t){e.togglePlay()}return{create:function(){E._fragment.create(),r=i.g("\n\n"),o=i.e("div"),p=i.e("div"),d=i.e("span"),f=i.g("\n "),S&&S.create(),g=i.g("\n "),x&&x.create(),y=i.g("\n\n "),_=i.e("div"),O.create(),v=i.g("\n "),m=i.e("div"),w=i.g(b=t.file.name),this.hydrate()},hydrate:function(e){i.p(o,"svelte-1106586334",""),o.className=c="browser-"+t.file.type+" "+t.state+" browser-entry activateable upload--is-"+t.file.state+" "+(t.selected?"active":"")+" "+(t.file.error?"upload-error":""),p.className=h="browser-entry-prew browser-entry-prew--"+t.selectedIcon,i.a(p,"click",P),d.className="browser-entry-icon",_.className="progress-bar",m.className="browser-entry-info",i.a(m,"click",T)},mount:function(t,e){E._fragment.mount(t,e),i.l(r,t,e),i.l(o,t,e),i.b(p,o),i.b(d,p),i.b(f,p),S&&S.mount(p,null),i.b(g,p),x&&x.mount(p,null),i.b(y,p),i.b(_,p),O.mount(_,null),i.b(v,o),i.b(m,o),i.b(w,m)},update:function(t,r){E._context.state=r,c!==(c="browser-"+r.file.type+" "+r.state+" browser-entry activateable upload--is-"+r.file.state+" "+(r.selected?"active":"")+" "+(r.file.error?"upload-error":""))&&(o.className=c),h!==(h="browser-entry-prew browser-entry-prew--"+r.selectedIcon)&&(p.className=h),r.file.error?S||((S=s()).create(),S.mount(p,g)):S&&(S.unmount(),S.destroy(),S=null),r.file.thumbnail?x?x.update(t,r):((x=a(r)).create(),x.mount(p,y)):x&&(x.unmount(),x.destroy(),x=null),A===(A=k(r))&&O?O.update(t,r):(O.unmount(),O.destroy(),(O=A(r,e)).create(),O.mount(_,null)),b!==(b=r.file.name)&&(w.data=b)},unmount:function(){E._fragment.unmount(),i.i(r),i.i(o),S&&S.unmount(),x&&x.unmount(),O.unmount()},destroy:function(){e.refs.Sounds===E&&(e.refs.Sounds=null),E.destroy(!1),i.o(p,"click",P),S&&S.destroy(),x&&x.destroy(),O.destroy(),i.o(m,"click",T)}}}(this._state,this),t.target&&(this._fragment.create(),this._fragment.mount(t.target,null)),this._flush()}i.c(c.prototype,o.methods,i.n),c.prototype._set=function(t){var e=this._state;this._state=i.c({},e,t),i.k(this,this._observers.pre,t,e),this._fragment.update(t,this._state),i.k(this,this._observers.post,t,e),this._flush()},c.prototype.teardown=c.prototype.destroy=function(t){this.fire("destroy"),!1!==t&&this._fragment.unmount(),this._fragment.destroy(),this._fragment=null,this._state={},this._torndown=!0},e.a=c},function(t,e,r){var n,i,o,s,a,u,l,c=function(t,e){return function(){return t.apply(e,arguments)}},p={}.hasOwnProperty;i=window.require("spine/controller/activator"),n=window.require("spine/controller/activateable"),l=r(5),u=r(176),s=window.require("core/models/content"),o=r(177),a=function(t){function e(){this.onScroll=c(this.onScroll,this),this.activate=c(this.activate,this),this._onActivate=c(this._onActivate,this),this.addItem=c(this.addItem,this),this._release=c(this._release,this),this._relocate=c(this._relocate,this),this.scrollBottom=c(this.scrollBottom,this),this.scrollTop=c(this.scrollTop,this),this.onDrop=c(this.onDrop,this),this.onDrag=c(this.onDrag,this),this.onDragStart=c(this.onDragStart,this),this.initialize=c(this.initialize,this),e.__super__.constructor.apply(this,arguments),this.scroll(),this.container.sortable({itemSelector:".item-details",handle:".item-details-order",onDragStart:this.onDragStart,onDrop:this.onDrop,onDrag:this.onDrag}),this.bulkEditor=new o,this.bulkEditor.toggle(),this.bulkEditor.bind("toggle",function(t){return function(e){return setTimeout(function(){return t.scroll().update()},500)}}(this)),this.items=[]}return function(t,e){for(var r in e)p.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.prototype.className="editor-content",e.prototype.autoDeactivate=!1,e.prototype.title="Details",e.prototype.nextTitle="Edit Details",e.prototype.interval=0,e.prototype.vh=0,e.prototype.eof=0,e.include(n),e.include(l),e.prototype.for=function(t){return this.composition=t,this.initialize(),this.el.prepend(this.bulkEditor.el),this.bulkEditor.for(this.composition),this},e.prototype.initialize=function(t){return this.composition?(this.children(function(t){return t.release()}),this.stopListening(),this.listenTo(s,"create",this.addItem),this.composition.getContent().forEach(this.addItem),this.trigger("initialized")):console.warn("No composition set")},e.prototype.onDragStart=function(t,e,r){return t.controller().deactivate(),r(t,e),t.controller().deactivate(),this.scroll().update(),this.$item=$(t),this.vh=this.container.parent().height(),this.oh=this.container[0].scrollHeight,this.eof=this.el.offset()},e.prototype.onDrag=function(t,e,r){var n,i,o;if(r(t,e),i=this.$item.offset(),this.position=e,this.offset=i,this.dragged=this.$item,o=i.top-this.eof.top<30,n=i.top-this.eof.top>this.vh-10,!o&&!n)return clearInterval(this.interval),this.interval=0;if(o){if(0===this.interval)return this.interval=setInterval(this.scrollTop,10)}else if(n&&0===this.interval)return this.interval=setInterval(this.scrollBottom,10)},e.prototype.onDrop=function(t,e,r){return r(t,e),t.controller().onDrop(),this.$item=null,this._relocate(),clearInterval(this.interval),this.interval=0},e.prototype.scrollTop=function(){var t;if((t=this.container.scrollTop())>0)return this.scroll().scrollTo(t-4),this.dragged.css({top:parseInt(this.dragged.css("top"))-4})},e.prototype.scrollBottom=function(){var t,e;if(e=this.container.scrollTop(),(t=parseInt(this.dragged.css("top")))<this.oh-4)return this.scroll().scrollTo(e+4),this.dragged.css({top:4+t})},e.prototype._relocate=function(){return this.children(function(t){return t.item.order!==t.el.index()+1}).forEach(function(t){return t.item.updateAttribute("order",t.el.index()+1,{attribute:"order"})}),this.scroll().update()},e.prototype._release=function(){return e.__super__._release.apply(this,arguments),setTimeout(this._relocate,100),this.delay(function(t){return function(){if(t.isActive()&&0===t.children().length)return t.$trigger("DetailsEditor:empty")}}(this))},e.prototype.addItem=function(t){var e;if(t.composition_id===this.composition.id)return this.append(e=new u({item:t,meta:t.meta()})),t.updateAttribute("order",e.el.index()+1,{attribute:"order"}),this.scroll().update(),this.items.push(e)},e.prototype._onActivate=function(){var t;if(!this.children(function(t){return t.isActive()}).length)return null!=(t=this.children(function(t){return!t.isInvalid})[0])&&t.activate({animate:!0}),this.scroll().update()},e.prototype.activate=function(){return n.activate.apply(this,arguments),this.$trigger("viewChange","details"),this.delay(this._onActivate),this},e.prototype.onScroll=function(){return this.children(function(t){var e;return"function"==typeof(e=t.attributes).deactivate?e.deactivate():void 0})},e}(),t.exports=a},function(t,e,r){var n,i,o,s,a,u=function(t,e){return function(){return t.apply(e,arguments)}},l={}.hasOwnProperty;s=window.require("spine/controller"),o=window.require("spine/controller/container"),n=window.require("spine/controller/activateable"),i=r(119),a=function(t){function e(){var t,r,n,o;this._onItemValidation=u(this._onItemValidation,this),this.destroy=u(this.destroy,this),this.toggle=u(this.toggle,this),this._change=u(this._change,this),e.__super__.constructor.apply(this,arguments),this.item.bind("destroy",this.release),this.item.bind("change",this._change),r="<div class='item-details-order'></div>",o="<div class='item-details-toggle'></div>",t="<div class='item-details-delete' data-icon='⏍'></div>",n=$("<div class='item-details-right'></div>"),this.attributes=new i({options:this.meta.attributes,item:this.item}),n.append(o,t),this.append(r,this.attributes,n)}return function(t,e){for(var r in e)l.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,s),e.prototype.className="item-details",e.prototype.tag="li",e.include(o),e.include(n),e.prototype.elements={".item-details-order":"place",".item-details-toggle":"toggleButton"},e.prototype.events={"click .item-details-toggle":"toggle","click .item-details-delete":"destroy",invalid:"_onItemValidation",valid:"_onItemValidation"},e.prototype._change=function(t,e,r){if("order"===r.attribute)return this.place.html(t.order)},e.prototype.activate=function(t){if(null==t&&(t={}),!(this.attributes.length<2||this.isInvalid))return n.activate.apply(this,[t]),t.animate&&this.animateFirstAttribute(),this.attributes.update()},e.prototype.deactivate=function(){return n.deactivate.apply(this,arguments),this.attributes.deactivate()},e.prototype.toggle=function(){return this.isActive()?this.deactivate():this.activate(),this.parent().scroll().update()},e.prototype.destroy=function(){return this.item.destroy()},e.prototype._onItemValidation=function(t){if(this.isInvalid="invalid"===t.type&&this.attributes.el.children().first().is(t.target),this.el.toggleClass("item-invalid",this.isInvalid),this.isInvalid)return this.deactivate()},e.prototype.animateFirstAttribute=function(){var t;return t=this.el.height(),this.el.height(this.el.css("minHeight")),this.el.addClass("transitions").on("transitionend webkitTransitionEnd",function(t){return function(e){if($(e.target).is(t.el))return t.el.removeAttr("style").removeClass("transitions"),t.parent().scroll().update(),t.el.off("transitionend webkitTransitionEnd")}}(this)).height(t)},e.prototype.onDrop=function(){return this.attributes.onDrop()},e}(),t.exports=a},function(t,e,r){var n,i,o,s,a=function(t,e){return function(){return t.apply(e,arguments)}},u={}.hasOwnProperty;s=window.require("spine/controller"),o=window.require("core/models/content"),n=r(178),i=function(t){function e(){return this.onItemChange=a(this.onItemChange,this),this.updateItemAttributes=a(this.updateItemAttributes,this),this.onItemAdded=a(this.onItemAdded,this),this._change=a(this._change,this),this.initialize=a(this.initialize,this),this.for=a(this.for,this),this.toggle=a(this.toggle,this),e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var r in e)u.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,s),e.prototype.className="details_bulk-editor activateable",e.prototype.elements={".item-details":"attributesEl"},e.prototype.events={"click .item-toggle":"toggle"},e.prototype._isActive=!1,e.prototype.template=function(){return'<div class="bulk-editor-header">\n\t<div class="bulk-editor-title">'+this.options.title+"</div>\n\t<div class='item-details-right'>\n\t\t"+(this.options.help_text?'<div class="control-help" data-tooltip-text="'+this.options.help_text+'"></div>':"")+'\n\t\t<div class="item-toggle multi-tabs-toggle" data-icon="❯">\n\t\t\t<span data-icon="❯"></span>\n\t\t</div>\n\t</div>\n</div>\n<div class="item-details"></div>'},e.prototype.toggle=function(){return this._isActive=!this._isActive,this.trigger("toggle",this._isActive),this.el.toggleClass("active",this._isActive),this.attributesEl.css({"margin-bottom":this._isActive?0:-this.attributesElHeight})},e.prototype.for=function(t){return this.composition=t,null==this.composition.contentMeta().bulkEditor?this.el.addClass("empty"):(this.item=this.composition.bulkContent(),this.item.bind("change",this._change),this.listenTo(o,"create",this.onItemAdded),this.listenTo(o,"change",this.onItemChange),this.initialize(this.composition.contentMeta()))},e.prototype.initialize=function(t){var e,r,i,o;for(this.options=t.bulkEditor,this.render(),this.numAttributes=this.options.attributes.length,this.el.toggleClass("single-attribute",1===this.numAttributes),r=0,i=(o=this.options.attributes).length;r<i;r++)e=o[r],(this.attributes||(this.attributes={}))[e]=t.attributes[e];return this.attrPanel=new n({options:this.attributes,item:this.item,el:this.attributesEl}),this.attributesElHeight=this.attributesEl.outerHeight()},e.prototype._change=function(t,e,r){var n;if("metadata"!==(n=r.attribute))return this.composition.getContent().forEach(function(t){return function(e){if(e.id!==t.item.id&&!e.editedMeta(n))return e.attrMeta(n,!1),e.updateAttribute(n,t.item[n],{attribute:n,from:t})}}(this))},e.prototype.onItemAdded=function(t){if(t.composition_id===this.composition.id)return this.updateItemAttributes(o.find(t.id))},e.prototype.updateItemAttributes=function(t){var e,r,n;if(t.composition_id===this.composition.id){for(e in n=[],r=this.attributes)r[e],t.editedMeta(e)||t[e]===this.item[e]||(t.attrMeta(e,!1,{silent:!0}),n.push(t.updateAttribute(e,this.item[e],{attribute:e,from:this})));return n}},e.prototype.onItemChange=function(t,e,r){var n,i,o,s,a;if("metadata"===r.attribute&&!r.silent){for(a=[],i=0,o=(s=this.composition.getContent()).length;i<o;i++)(n=s[i]).id===t.id&&a.push(this.updateItemAttributes(n));return a}},e}(),t.exports=i},function(t,e,r){var n,i,o,s={}.hasOwnProperty;o=window.require("spine/controller"),n=r(119),i=function(t){function e(){e.__super__.constructor.apply(this,arguments),this.attributes=new n({options:this.options,item:this.item,isEditable:function(){return!0}}),this.el.append(this.attributes.el)}return function(t,e){for(var r in e)s.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,o),e}(),t.exports=i},function(t,e){var r,n,i,o,s=function(t,e){return function(){return t.apply(e,arguments)}},a={}.hasOwnProperty;n=window.require("spine/controller"),r=window.require("spine/controller/activateable"),window.require("core/models/composition"),o=window.require("core/models/widget"),window.require("core/models/user"),i=function(t){function e(){this.onPopupClose=s(this.onPopupClose,this),this.notifyShareIntent=s(this.notifyShareIntent,this),this.publishComposition=s(this.publishComposition,this),this.ready=s(this.ready,this),this._activate=s(this._activate,this),e.__super__.constructor.apply(this,arguments),this.render()}return function(t,e){for(var r in e)a.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,n),e.prototype.className="embedder",e.prototype.template="editor/views/embed",e.prototype.nextTitle="Publish",e.prototype.title="Done",e.include(r),e.prototype.elements={".view-comp-btn":"compBtn",".ready-icon":"readyIcon"},e.prototype.events={"click .share-btn":"notifyShareIntent"},e.prototype.for=function(t){if(this.composition=t,this.composition.isPersisted())return this.widget||(this.widget=o.find(this.composition.widget_id))},e.prototype.activate=function(){if(!this.isActive())return this.$trigger("viewChange","save"),this.publishComposition().then(this.for.bind(this,this.composition)).then(this._activate).then(this.ready)},e.prototype._activate=function(){return r.activate.apply(this,arguments)},e.prototype.ready=function(){return this.delay($.fn.show.bind(this.readyIcon))},e.prototype.publishComposition=function(){return this.composition.persist().then(function(t){return function(e){return t.$trigger("composition:save",e)}}(this)).fail(function(t){return function(e){return console.warn("Persisting the composition failed. Saved as temporary."),t.$trigger("composition:temporary:save",t.composition)}}(this))},e.prototype.notifyShareIntent=function(t){return t.preventDefault(),this.$trigger("sharew-intent",$(t.target).data("target"))},e.prototype.onPopupClose=function(){if(this.pop)return this.$trigger("Save:close",this.pop=!1)},e}(),t.exports=i},function(t,e,r){var n,i,o={}.hasOwnProperty;i=r(14),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var r in e)o.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.prototype.className="popup login-popup",e.prototype.confirmBtnClass="dim-button button--uc login-button",e.prototype.cancelBtnClass="green-button button--uc button--icon-right button--go register-button",e.prototype.title="Login or sign up.",e.prototype.content="",e.prototype.note="",e.prototype.separator=!1,e.prototype.confirmBtn="Log in",e.prototype.cancelBtn="Sign up free",e.prototype.setTitle=function(t){return null==t&&(t="Login or sign up."),this.title=t,this.render(this),this},e.prototype.place=function(t){return this.pop=this.pop.bind(this,t)},e.prototype.onConfirm=function(){return this.$trigger("login-intent")},e.prototype.onCancel=function(){return this.$trigger("signup-intent")},e}(),t.exports=new n},function(t,e){var r,n,i,o=function(t,e){return function(){return t.apply(e,arguments)}},s={}.hasOwnProperty;i=window.require("spine/controller"),r=window.require("spine/controller/activateable"),n=function(t){function e(){return this.render=o(this.render,this),e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var r in e)s.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.include(r),e.prototype.tag="a",e.prototype.events={click:"click"},e.prototype.render=function(){return this.$addClass(this.panel.title.toLowerCase()).html(this.panel.title),this},e.prototype.click=function(){return this.$trigger("Breadcrumb:step",this.panel.title.toLowerCase())},e}(),t.exports=n},function(t,e){var r,n,i,o,s=function(t,e){return function(){return t.apply(e,arguments)}},a={}.hasOwnProperty;window.require("core/models/skin"),r=window.require("core/models/content"),n=window.require("spine/core/events"),i=window.require("spine/core/module"),o=function(t){function e(t){this.remote=t,this.release=s(this.release,this),this.removeDemoContent=s(this.removeDemoContent,this),this.addContent=s(this.addContent,this),this.resize=s(this.resize,this),this.load=s(this.load,this),this.style=$('<style type="text/css">'),e.__super__.constructor.apply(this,arguments),this.currentWidget=this.remote.getPreview().widget(),this._loadDependencies()}return function(t,e){for(var r in e)a.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.include(n),e.prototype.load=function(t){return this.composition=t,this.stopListening(r,"create",this.removeDemoContent),this.stopListening(r,"create",this.addContent),this.composition.getContent().length||this.listenTo(r,"create",this.removeDemoContent),this.listenTo(r,"create",this.addContent),this.listenTo(this.composition,"update",this.resize),this.lastSkin&&this.setSkin(this.lastSkin),this.trigger("initialized"),this},e.prototype.resize=function(t){return this.currentWidget.resize()},e.prototype.addContent=function(t){if(t.composition_id===this.composition.id)return this.currentWidget.addContent(t)},e.prototype.removeDemoContent=function(t){if(t.composition_id===this.composition.id)return r.all().filter(function(t){return t._isDemoContent}).forEach(function(t){return t.destroy()}),this.currentWidget.clearContent(),this.stopListening(r,"create",this.removeDemoContent)},e.prototype.setSkin=function(t){return this.lastSkin=t,this.currentWidget.setSkin(this.lastSkin)},e.prototype._loadDependencies=function(){var t;if(null!=this.remote.window.SoundManager&&(t=new this.remote.window.SoundManager),null!=this.remote.window.soundManager&&(t=this.remote.window.soundManager),t&&(window.soundManager=t,t.setup(this.remote.window.soundManager.setup())),!window.videojs)return window.videojs=this.remote.window.videojs},e.prototype.release=function(){return this.trigger("release",this),this.unbind(),this.stopListening()},e}(),t.exports=o},function(t,e,r){var n={"./audio.coffee":20,"./browser.coffee":184,"./color.coffee":91,"./date-time/calendar/index.coffee":21,"./date-time/calendar/months.coffee":22,"./date-time/calendar/years.coffee":23,"./date-time/clock.coffee":24,"./date-time/helper.coffee":25,"./date-time/index.coffee":92,"./date-time/popup.coffee":26,"./details/audio.coffee":93,"./details/image.coffee":94,"./details/video.coffee":95,"./dropdown.coffee":7,"./font/font-item.coffee":30,"./font/font-list.coffee":31,"./font/fonts-popup.coffee":32,"./font/index.coffee":96,"./image.coffee":28,"./index.coffee":2,"./orderPicker.coffee":97,"./position/grid-panel.coffee":33,"./position/index.coffee":98,"./position/panel.coffee":6,"./position/pixel-panel.coffee":35,"./position/popup.coffee":34,"./position/reference-panel.coffee":36,"./range.coffee":99,"./rss.coffee":100,"./scale.coffee":101,"./slider.coffee":102,"./stepper.coffee":3,"./text.coffee":11,"./textarea.coffee":103,"./toggle.coffee":104,"./url.coffee":4,"./video.coffee":29};function i(t){return r(o(t))}function o(t){var e=n[t];if(!(e+1))throw new Error("Cannot find module '"+t+"'.");return e}i.keys=function(){return Object.keys(n)},i.resolve=o,t.exports=i,i.id=183},function(t,e,r){var n,i,o,s,a,u,l,c,p,h,d,f=function(t,e){return function(){return t.apply(e,arguments)}},g=function(t,e){for(var r in e)y.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},y={}.hasOwnProperty;u=r(2),l=window.require("spine/controller"),n=window.require("spine/controller/activateable"),a=window.require("spine/controller/container"),h=window.require("spine/controller/tabs"),p=r(106),i=r(50),d=r(112),c=function(t){function e(t){var r;this.onChange=f(this.onChange,this),this.clear=f(this.clear,this),e.__super__.constructor.apply(this,arguments),$.extend(t.options,{readonly:!1}),r=window.require(t.control),this.control=new r({attribute:this.attribute,options:t.options}),this.append(this.control,"<span class='field-delete' data-icon='⏍'></span>"),this.control.bind("change:"+this.control.type,this.onChange),this.recount=function(){},this.addEntry=function(t){return function(e){var r;return null==e&&(e={}),t.control.update(e.url),t.tab.count((r=Boolean(e.url||!1))>>0),t.el.toggleClass("old",r)}}(this),this.removeEntry=function(t){return function(e){return null==e&&(e={}),t.control.update(""),t.tab.count(0),t.el.toggleClass("old",!1)}}(this)}return g(e,l),e.prototype.title="directinput",e.prototype.serviceTitle="link",e.prototype.className="directinput directinputpopup",e.include(n),e.include(a),e.prototype.attributes={authenticated:!0},e.prototype.containerClass="directinput-field",e.prototype.events={"click .field-delete":"clear"},e.prototype.clear=function(){return this.control.update(""),this.onChange()},e.prototype.onChange=function(t){var e;return null==t&&(t={}),this.tab.count((e=Boolean(t.value||!1))>>0),this.el.toggleClass("old",e),this.trigger("beforeChange"),e?this.trigger("urlChange",{url:t.value,service:null}):this.trigger("urlRemove")},e.prototype.release=function(){return this.control.release(),e.__super__.release.apply(this,arguments)},e}(),s=function(t){function e(t,r,n){this.anchor=n,this.activate=f(this.activate,this),this.deactivate=f(this.deactivate,this),this.set=f(this.set,this),this.clearServices=f(this.clearServices,this),this.contentRemove=f(this.contentRemove,this),this.contentCanAdd=f(this.contentCanAdd,this),this.contentAdd=f(this.contentAdd,this),this.addBrowser=f(this.addBrowser,this),e.__super__.constructor.apply(this,arguments),this.input=new c(r),this.browsers=[],this.input.bind("beforeChange",this.clearServices),this.input.bind("urlChange",this.contentAdd),this.input.bind("urlRemove",this.contentRemove),delete this.sources.websearch,delete this.sources.blogvio,delete this.sources.dropbox,delete this.sources.flickr,delete this.sources["google-drive"],this.$bind("click",function(t){return t.stopPropagation()}),this.listenTo($("body"),"click",function(t){return function(){if(t.isActive())return t.deactivate()}}(this))}return g(e,h),e.prototype.className="content-browser browser-popup",e.prototype.tabContainerClass="content-browser-tabs",e.prototype.containerClass="content-browser-container",e.prototype.tabRenderer=p,e.include(n),e.prototype.interval=0,e.prototype.events={"click .message .close":"closeMessage","click .browser-logout":"deactivate"},e.prototype.elements={".message":"message",".message .text":"text"},e.prototype.children=function(t){var e,r,n,i;for(e in null==t&&(t=function(){return!0}),i=[],n=this.browsers)t(r=n[e])&&i.push(r);return i},e.prototype._initBrowsers=function(t){var e,r,n,o,s;for(n in t.append(this.el),this.addBrowser(d,{allowDelete:!1,allowClear:!1}),o=this.sources)s=o[n],e=window.require(s.module),r=null!=s.browser?window.require(s.browser):i,this.browsers[n]=r=new r({content:[],title:n,Service:e,options:$.extend({},this.options,s.options||{})}),this.listenTo(r,"add",this.contentAdd),this.listenTo(r,"remove",this.contentRemove),this.listenTo(r,"canAdd",this.contentCanAdd),this.append(r);return this.browsers.inpt=this.input,this.append(this.input)},e.prototype.addBrowser=function(t,e){var r,n;if(t.isCompatible(this.options.types))return(r=new t(Object.assign({filetypes:this.options.types},e))).on("toggle",function(e){return function(r){var n,i,o;return n=r.file,r.options,e.clear(),n.id!==(null!=(o=e.item)?o.id:void 0)?(i={id:n.id,url:n.url,service:t.name},e.item=i,e.trigger("select",i)):(e.item=null,e.trigger("select"))}}(this)),r.observe("selected",function(t){return r.tab.count(t.length)}),r.observe("loading",function(t){return function(e){var r;return r=$("style[id^=svelte]"),$(t.popup.head).append(r.clone())}}(this),{defer:!0}),n=function(e){return function(){var n;return(null!=(n=e.item)?n.service:void 0)===t.name?r.set({selected:[e.item.id]}):r.set({selected:[]})}}(this),this.on("select",n),n(),this.append(this.browsers[t.name]=r)},e.prototype.contentAdd=function(t){return t&&(this.item=t),this.trigger("select",t)},e.prototype.contentCanAdd=function(t){return this.clear(),null!=t?t.call(this):void 0},e.prototype.contentRemove=function(t){if(null!=this.item)return this.item=null,this.trigger("select")},e.prototype.clearServices=function(){var t;if(this.item)return null!=(t=this.browsers[this.item.service])&&"function"==typeof t.removeEntry?t.removeEntry(this.item):void 0},e.prototype.clear=function(){var t;if(this.item)return"function"==typeof(t=this.browsers[this.item.service||"inpt"]).removeEntry?t.removeEntry(this.item):void 0},e.prototype.set=function(t){return this.clear(),this.item=t},e.prototype.deactivate=function(){var t;return null!=(t=this.popup)&&t.hide(),n.deactivate.apply(this,arguments)},e.prototype.activate=function(){return this._createPopup().then(function(t){return function(){var e;return t.popup.show(),t.item?((e=t.browsers[t.item.service||"inpt"]).active(),t.set(t.item),e.recount()):t.children(function(t){return t.isActive()}).length<1&&t.children()[0].active(),n.activate.apply(t,arguments)}}(this))},e.prototype.release=function(){var t,r,n;for(t in this.input.release(),r=this.browsers)r[t].release();return null!=(n=this.popup)&&n.release(),e.__super__.release.apply(this,arguments)},e.prototype._createPopup=function(){return this.popupPromise?this.popupPromise:this.popupPromise=Blogvio.UI.popup.new({anchor:this.anchor,topOffset:6,leftOffset:-9,css:["https://widgetic.com/bundles/blogvioapp/css/editor/editor.css"]}).then(function(t){return function(e){return t.popup=e,t._initBrowsers(t.popup),t.popup.append(t.el)}}(this)).fail(function(t){return console.error(t.stack)})},e}(),o=function(t){function e(){var t,r;this.deactivate=f(this.deactivate,this),this.browse=f(this.browse,this),this.select=f(this.select,this),this.setItem=f(this.setItem,this),this.update=f(this.update,this),e.__super__.constructor.apply(this,arguments),(r=$.extend({},this.options.input))&&(r.options.readonly=!0,t=window.require(r.control),this.control=new t({item:this.item,attribute:this.attribute,options:r.options,isDetailInput:this.isDetailInput}),this.input.prepend(this.control.el)),this.options.browser&&(this.browserPopup=new s(this.options.browser,this.options.input,this.browseButton),this.browserPopup.bind("select",this.select))}return g(e,u),e.prototype.template="core/views/browser",e.prototype.className="control control-browser",e.prototype.elements={".input-browser":"input",".input-browser-browse":"browseButton"},e.prototype.events={"click .input-browser-browse, input:text, .url-thumb":"browse"},e.prototype.update=function(t,e,r){var n;if(null==r&&(r={}),t[this.attribute]&&r.from!==this&&this.browserPopup)return this.browserPopup.set(("function"==typeof t.attrMeta?t.attrMeta(this.attribute):void 0)||(null!=(n=t.metas)?n[this.attribute]:void 0)||{url:t[this.attribute]})},e.prototype.setItem=function(t){return e.__super__.setItem.apply(this,arguments),this.control.setItem(t)},e.prototype.select=function(t){var e,r;return this.change(r=t?t.url:""),"function"==typeof(e=this.item).attrMeta&&e.attrMeta(this.attribute,(null!=t?t.service:void 0)?t:null),this.control.$addClass("valid"),this.trigger("change:"+(this.type||"control"),{attribute:this.attribute,val:r,value:r})},e.prototype.browse=function(t){return t.stopPropagation(),this.browserPopup.isActive()?this.browserPopup.deactivate():this.browserPopup.activate()},e.prototype.release=function(){var t,r;return null!=(t=this.control)&&t.release(),null!=(r=this.browserPopup)&&r.release(),e.__super__.release.apply(this,arguments)},e.prototype.deactivate=function(){return this.browserPopup.deactivate()},e}(),t.exports=o},function(t,e,r){var n={"./base/photoitem.coffee":186,"./cache.coffee":121,"./default.coffee":187,"./dropbox.coffee":188,"./facebook.coffee":189,"./flickr.coffee":190,"./google-drive-sdk.coffee":122,"./google-drive.coffee":191,"./instagram-social.coffee":192,"./instagram.coffee":193,"./share-popup.coffee":123,"./soundcloud.coffee":194};function i(t){return r(o(t))}function o(t){var e=n[t];if(!(e+1))throw new Error("Cannot find module '"+t+"'.");return e}i.keys=function(){return Object.keys(n)},i.resolve=o,t.exports=i,i.id=185},function(t,e){var r,n,i,o,s=function(t,e){return function(){return t.apply(e,arguments)}},a={}.hasOwnProperty;i=window.require("spine/controller"),r=window.require("spine/controller/activateable"),n=window.require("core/models/content"),o=function(t){function e(){this._create=s(this._create,this),this._destroy=s(this._destroy,this),this.error=s(this.error,this),this.done=s(this.done,this),this.toggle=s(this.toggle,this),e.__super__.constructor.apply(this,arguments),this.$bind("click",this.toggle),this.item=new n,this.listenTo(n,"destroy",this._destroy),this.listenTo(n,"create",this._create)}return function(t,e){for(var r in e)a.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.prototype.className="service-photo-item loading",e.prototype.elements={img:"img"},e.include(r),e.prototype.photoOptions=null,e.prototype.photoData=null,e.prototype.toggle=function(t){var e;if(!this.el.is(".loading"))return this.isActive()?this.item.destroy():((e={})[""+this.attribute]=this.photoData,e.options=this.photoOptions,this.item.updateAttributes(e,{attribute:this.attribute,from:this}))},e.prototype.done=function(){return this.$trigger("itemReady").$removeClass("loading")},e.prototype.error=function(){return this.$trigger("itemReady").release()},e.prototype._destroy=function(t){if(this.item&&t&&t.eql(this.item))return this.deactivate(),this.item=new n},e.prototype._create=function(t){if(this.item&&t&&t.eql(this.item))return this.activate()},e}(),t.exports=o},function(t,e,r){var n,i,o,s=function(t,e){return function(){return t.apply(e,arguments)}},a={}.hasOwnProperty;o=r(8),i=r(9),n=function(t){function e(){this.triggerAuthRequire=s(this.triggerAuthRequire,this),this.newEntry=s(this.newEntry,this),this.addContentEntry=s(this.addContentEntry,this),this.addItems=s(this.addItems,this),e.__super__.constructor.apply(this,arguments),this.title=""+this.title[0].toUpperCase()+this.title.slice(1),this.authenticated=!1,this.authPromise=(this.authDef=new $.Deferred).promise(),window.editor.el.bind("content:"+this.title.toLowerCase()+":add",this.addItems)}return function(t,e){for(var r in e)a.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,o),e.prototype.hideDisconnectBtn=!0,e.prototype._auth=function(t){if(this.triggerAuthRequire(t),this.trigger("auth",this.authenticated),this.authenticated)return setTimeout(function(t){return function(){return t.authDef.resolve()}}(this))},e.prototype.addItems=function(t,e){return null==e&&(e={items:[]}),this.authenticated||this.auth(!(this.authenticated=!0)),this.authPromise.then(function(t){return function(){return t.hasAddContentEntry||t.trigger("refresh",[t.addContentEntry()]),t.trigger("refresh",(e.items||[]).map(t.newEntry))}}(this))},e.prototype.refresh=function(t){return t},e.prototype.addContentEntry=function(){var t;return this.hasAddContentEntry=!0,(t=this.newEntry({name:"Add content",url:"/",type:"button"})).className="add-content-entity",t.bind("select",this.triggerAuthRequire.bind(this,!0)),t},e.prototype.newEntry=function(t){var e,r,n;for(r in e=new i({service:this,name:t.name||t.title||t.url,path:t.url,type:t.type,url:t.url}),t)n=t[r],e[r]=n;return e},e.prototype.getURL=function(t,e){return e(t.url)},e.prototype.preview=function(t){return t.url},e.prototype.deauth=function(){},e.prototype.triggerAuthRequire=function(t){return this.trigger("auth-req",{interactive:t,source:this.title,"content-type":this.options.types})},e}(),t.exports=n},function(t,e,r){var n,i,o,s,a,u,l,c=function(t,e){for(var r in e)p.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},p={}.hasOwnProperty,h=function(t,e){return function(){return t.apply(e,arguments)}};a=r(8),o=r(9),u='<a class="add-content-instr-link" target="_blank" href="http://blog.widgetic.com/post/101481120261/how-to-load-your-content-from-dropbox">How to load your content?</a>',n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return c(e,t),e.prototype.openWindow=function(t){return this.popup.location.href=t},e.prototype.openPopup=function(){return this.popup=window.open("/connect/dropbox.html","_dropboxOauthSigninWindow",this.popupWindowSpec(980,700))},e}(Dropbox.Drivers.Popup),l={client:{key:"ekn9VjZx0VA=|nnWESTkqe31UYqt/Qllbpa2sjX1YmmcmNEPH/vwn0w==",sandbox:!0,fileRoot:"auto"},driver:{receiverUrl:"https://widgetic.com/connect/dropbox",rememberUser:!0}},s={image:["image/png","image/jpeg","image/jpg","image/gif","image/bmp"],audio:["audio/mp3","audio/mpeg"],video:["video/mp4"],folder:["inode/directory"]},Dropbox.Stat.prototype.entry=function(t,e){var r,n;for(r in n={name:this.name,path:this.path,id:this.path},s)s[r].indexOf(this.mimeType)>-1&&(n.type=r);return new o(n)},i=function(t){function e(){var t;this.onAuth=h(this.onAuth,this),e.__super__.constructor.apply(this,arguments),this.authenticated=!1,(this.client=new Dropbox.Client(l.client)).authDriver(new n(l.driver)),this.allMime=[].concat.apply([],function(){var e,r,n,i;for(i=[],e=0,r=(n=this.options.types).length;e<r;e++)t=n[e],null!=s[t]&&i.push(s[t]);return i}.call(this)).concat(s.folder),this.root.navTitle="Dropbox/Apps/Blogvio"}return c(e,a),e.prototype.responses={},e.prototype.faqLink=$(u),e.prototype._auth=function(t){return null==t&&(t=!0),t&&n.prototype.openPopup(),this.client.authenticate({interactive:t},this.onAuth)},e.prototype.onAuth=function(t,e){if(this.trigger("auth",!t&&e.isAuthenticated()),t)return this.client.reset()},e.prototype.refresh=function(t){return this.client.stat(t.path,{readDir:!0,cacheHash:t.hash},function(e){return function(r,n,i){return t.hash=(null!=n?n.versionTag:void 0)||t.hash,r&&(r.status=304)?i=e.responses[t.hash]||[]:(i=i.filter(function(t){return e.allMime.indexOf(t.mimeType)>-1}).map(function(t){return t.entry()}),e.responses[t.hash]=i),e.trigger("refresh",i)}}(this))},e.prototype.getURL=function(t,e){return t.url?e(t.url):this.client.makeUrl(t.path,{downloadHack:!0,long:!0},function(t,r){return e(r.url)})},e.prototype.preview=function(t){return this.client.thumbnailUrl(t.path,{size:"m"})},e.prototype.deauth=function(){return this.client.signOut(function(t){return function(){return t.trigger("auth",!1)}}(this))},e}(),t.exports=i},function(t,e,r){var n,i,o,s=function(t,e){return function(){return t.apply(e,arguments)}},a={}.hasOwnProperty,u=[].indexOf||function(t){for(var e=0,r=this.length;e<r;e++)if(e in this&&this[e]===t)return e;return-1};o=r(8),n=r(9),i=function(t){function e(){this.getPermissions=s(this.getPermissions,this),this._onFBRespond=s(this._onFBRespond,this),this._requestFBPages=s(this._requestFBPages,this),this._requestFBPhotoSet=s(this._requestFBPhotoSet,this),this.getEntryFetchPath=s(this.getEntryFetchPath,this),e.__super__.constructor.apply(this,arguments),this.permissions={},this.authenticated=!1,this.root.id="me",this.root.album=!0,this.apiReady=e.initFB()}return function(t,e){for(var r in e)a.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,o),e.initFB=function(){return new Promise(function(t,e){return window.fbAsyncInit=function(){return FB.init({status:!0,cookie:!0,xfbml:!1,appId:"126231267555748"}),t()},function(t,e,r){var n,i;if(n=t.getElementsByTagName(e)[0],!t.getElementById(r))return(i=t.createElement(e)).id=r,i.src="//connect.facebook.net/en_US/all.js",n.parentNode.insertBefore(i,n)}(document,"script","facebook-jssdk")})},e.prototype.refresh=function(t){return this.entry=t,this.entry.children=[],this.pages=!1,this._requestFBPhotoSet(this.getEntryFetchPath(this.entry),this._onFBRespond)},e.prototype.getEntryFetchPath=function(t){var e,r;return r={},!!~this.options.types.indexOf("image")?(e="photos",r={fields:"id,images,name"}):(e="videos/uploaded",r={fields:"id,source,picture,description,format"}),t.album&&(e="albums",r={fields:"id, name, count"}),{path:t.id+"/"+e,options:r}},e.prototype._requestFBPhotoSet=function(t,e){var r,n;return r={},t.constructor===Object&&(t=(n=t).path,r=n.options),FB.api(t,"GET",r,e)},e.prototype._requestFBPages=function(){return FB.api("me/accounts",this._onFBRespond)},e.prototype._onFBRespond=function(t){var e,r,i,o,s,a,u,l;return e=t.data||[],(this.entry.root||this.entry.album)&&(e=e.filter(function(t){return t.count>0||t.perms&&t.category&&null==t.count})),e=this.mapEntries(e),!this.entry.root&&!this.entry.album||(null!=(s=this.entry.children)?s.filter(function(t){return t.my_album}).length:void 0)||(e||(e=[]),r=(a=!!~this.options.types.indexOf("image")?["Photos",this.entry.path+"/photos"]:["Videos",this.entry.path+"/videos"])[0],o=a[1],"me"===this.entry.id&&(r="My "+r),e.push(new n({service:this,name:r,path:o,id:this.entry.id,type:"folder",my_album:!0}))),!this.entry.root||null==this.permissions.manage_pages||this.permissions.manage_pages||(null!=(u=this.entry.children)?u.filter(function(t){return t.pages}).length:void 0)||(e.push(i=new n({service:this,name:"Pages",path:"accept_pages",type:"button",pages:!0})),i.bind("select",this._auth.bind(this,!0))),this.trigger("refresh",e),null!=(o=null!=(l=t.paging)?l.next:void 0)?this._requestFBPhotoSet(o,this._onFBRespond):this.entry.root&&!this.pages?(this.pages=!0,this._requestFBPages()):void 0},e.prototype.mapEntries=function(t){return t.map(function(t){return function(e){var r;return(r={images:e.images,id:e.id,name:e.name}).type=null!=e.images?"image":e.format?"video":"folder","folder"===r.type&&(r.album=!(!e.perms||!e.category)),r.path=t.entry.path+"/"+e.id,r.preview="image"===r.type?e.images[Math.max(0,e.images.length-4)].source:t.entry.picture,"video"===r.type&&(r.source=e.source),new n(r)}}(this))},e.prototype.preview=function(t){return t.preview},e.prototype.getURL=function(t,e){return e("image"===t.type?t.images[0].source:t.source)},e.prototype._auth=function(t){var e;return null==t&&(t=!0),e=function(t){return function(e){return"connected"===e.status?t.getPermissions():t.trigger("auth",t.authenticated=!1)}}(this),t?FB.login(e,{scope:"user_photos,user_videos,manage_pages"}):FB.getLoginStatus(e)},e.prototype.deauth=function(){return FB.logout(function(t){return function(){return t.trigger("auth",!1)}}(this))},e.prototype.getPermissions=function(){return FB.api("/me/permissions",function(t){return function(e){var r,n;return t.permissions={},e.data.forEach(function(e){return t.permissions[e.permission]="granted"===e.status}),r=u.call(t.options.types,"image")>=0||u.call(t.options.types,"photo")>=0,n=u.call(t.options.types,"video")>=0,(r&&t.permissions.user_photos||n&&t.permissions.user_videos)&&null!=t.permissions.manage_pages?t.trigger("auth",t.authenticated=!0):t.trigger("auth",t.authenticated=!1)}}(this))},e}(),t.exports=i},function(t,e,r){var n,i,o,s,a,u,l,c=function(t,e){return function(){return t.apply(e,arguments)}},p={}.hasOwnProperty,h=[].indexOf||function(t){for(var e=0,r=this.length;e<r;e++)if(e in this&&this[e]===t)return e;return-1};o=r(8),n=r(9),a="e80667fd637788dde877f5684d496d85",localStorage.getItem("flickrTokenFor")!==a&&localStorage.removeItem("flickrAuthToken"),localStorage.setItem("flickrTokenFor",a),s={key:a,secret:"5a90030ecac5b4fc",sig:"05eb1494ce939ce3098bbcdc7300b5e3",token:null!=(u=localStorage.getItem("flickrAuthToken"))?u.split("::")[0]:void 0,nsid:null!=(l=localStorage.getItem("flickrAuthToken"))?l.split("::")[1]:void 0,perms:"read",rest:"https://api.flickr.com/services/rest/"},i=function(t){function e(){this.call=c(this.call,this),this._onRespond=c(this._onRespond,this),this.listEntries=c(this.listEntries,this),this.doAuth=c(this.doAuth,this),this.refresh=c(this.refresh,this),e.__super__.constructor.apply(this,arguments),this.authenticated=null!=s.token&&null!=s.nsid,h.call(this.options.types,"image")>=0&&this.options.types.push("photo")}return function(t,e){for(var r in e)p.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,o),e.prototype.auth_url="https://flickr.com/services/auth/?api_key="+s.key+"&perms="+s.perms+"&api_sig="+s.sig,e.prototype.refresh=function(t){return this.entry=t,this.getMediaList().done(this._onRespond)},e.prototype._auth=function(t){return null==t&&(t=!0),this.trigger("auth",this.authenticated),!this.authenticated&&t&&this.doAuth()},e.prototype.doAuth=function(){if(window.flickrReady=function(t){return function(e){return t.call({api_key:s.key,frob:e,method:"flickr.auth.getToken"}).done(function(e){return e=$(e),s.nsid=e.find("user").attr("nsid"),s.token=e.find("token").text(),localStorage.setItem("flickrAuthToken",s.token+"::"+s.nsid),t.trigger("auth",t.authenticated=!0)})}}(this),null==s.token)return window.open(this.auth_url,"Flickr connect","width=990,height=825")},e.prototype.deauth=function(){return this.trigger("auth",this.authenticated=!1),localStorage.removeItem("flickrAuthToken")},e.prototype.getMediaList=function(){return this.call({api_key:s.key,auth_token:s.token,extras:"media",format:"json",method:"flickr.people.getPhotos",nojsoncallback:1,user_id:s.nsid})},e.prototype.listEntries=function(t){var e,r,i,o,s;for(s=[],e=0,r=t.length;e<r;e++)o=(i=t[e]).media,h.call(this.options.types,o)>=0&&(i.type=this.options.types[0],i.path="/"+i.id,s.push(new n(i)));return s},e.prototype._onRespond=function(t){return t.photos.total?this.trigger("refresh",this.entry.children=this.listEntries(t.photos.photo)):this.trigger("refresh",this.entry.children=[])},e.prototype.call=function(t,e){var r,n;return null==t&&(t={}),t.api_sig=s.secret+function(){var e;for(r in e=[],t)n=t[r],e.push(""+r+n);return e}().join(""),t.api_sig=Crypto.MD5(t.api_sig),$.ajax(s.rest,{data:t})},e.prototype.preview=function(t){return"https://farm"+t.farm+".staticflickr.com/"+t.server+"/"+t.id+"_"+t.secret+"_q.jpg"},e.prototype.getURL=function(t,e){return"image"===t.type?e("https://farm"+t.farm+".staticflickr.com/"+t.server+"/"+t.id+"_"+t.secret+".jpg"):this.getVideoSizes(t).done(function(t){return function(r){return t.videoUrl(r.sizes.size,e)}}(this))},e.prototype.getVideoSizes=function(t){return this.call({api_key:s.key,auth_token:s.token,format:"json",method:"flickr.photos.getSizes",nojsoncallback:1,photo_id:t.id,user_id:s.nsid})},e.prototype.videoUrl=function(t,e){var r,n,i;for(r=0,n=t.length;r<n;r++)if("Site MP4"===(i=t[r]).label)return e(i.source)},e}(),t.exports=i},function(t,e,r){var n,i,o,s,a,u,l=function(t,e){return function(){return t.apply(e,arguments)}},c={}.hasOwnProperty,p=[].slice;o=r(8),n=r(9),s=r(123),u=r(122),a=r(121),i=function(t){function e(){this.createQuery=l(this.createQuery,this),this.requestDriverFiles=l(this.requestDriverFiles,this),this.getDriverFiles=l(this.getDriverFiles,this),this.getDriverFolders=l(this.getDriverFolders,this),this.checkEmpty=l(this.checkEmpty,this),this.gotResponse=l(this.gotResponse,this),this.getDriverData=l(this.getDriverData,this),this.refresh=l(this.refresh,this),this.onGoglAuth=l(this.onGoglAuth,this),this._auth=l(this._auth,this),e.__super__.constructor.apply(this,arguments),this.title="Google Drive",~this.options.types.indexOf("image")&&(this.type="image"),~this.options.types.indexOf("video")&&(this.type="video"),~this.options.types.indexOf("audio")&&(this.type="audio"),this.root.id="root",u.then(function(t){return function(){return gapi.auth2.getAuthInstance().isSignedIn.listen(t.onGoglAuth)}}(this))}return function(t,e){for(var r in e)c.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,o),e.prototype.scope="https://www.googleapis.com/auth/drive.readonly",e.prototype._auth=function(t){return u.then(function(t){return function(){return gapi.auth2.getAuthInstance().isSignedIn.get()?t.trigger("auth",!0):gapi.auth2.getAuthInstance().signIn()}}(this))},e.prototype.onGoglAuth=function(t){return t?this.trigger("auth",!0):this.trigger("auth",!1)},e.prototype.refresh=function(t){var e;return this.entry=t,e=function(e){return function(){return e.gotResponse.apply(e,[t.id].concat(p.call(arguments)))}}(this),this.getDriverData(t,e)},e.prototype.getDriverData=function(t,e){return this.getDriverFolders(t.id,e).then(function(r){return function(){return r.getDriverFiles(t.id,r.type,e).then(e.bind(r,[],!0))}}(this))},e.prototype.gotResponse=function(t,e,r){var i,o;if(this.entry.id===t)return o=this,(i=(e.files||[]).map(function(t){return function(e){var r,u,l;if(e)return r=!e.permissions.filter(function(t){return"anyone"===t.id||"anyoneWithLink"===t.id}).length,l=e.mimeType.match(/image|video|folder|audio/)[0],new n({id:e.id,type:l,path:t.entry.path+"/"+e.name,name:e.name,preview:null!=(u=e.thumbnailLink)?u.replace(/s\d+$/,"s250"):void 0,url:e.webContentLink,parent:e.parents[0].id,isPrivate:r,order:.5*("folder"===l)+parseFloat("0."+new Date(e.createdDate).getTime()),webLink:e.webViewLink,onActivate:function(){return!this.isPrivate||(s.pop($("body")),s.off("confirmed"),s.bind("confirmed",function(t){return function(){return gapi.client.drive.permissions.create({resource:{type:"anyone",role:"reader"},fileId:e.id,fields:"id"}).execute(function(r){return r.error?(console.error(r.error),alert("An error has occurred. The permissions have not been modified.")):(a.clear(e.parents[0]),t.isPrivate=!1,o.trigger("refresh",i,{hard:!0}))})}}(this)),!this.isPrivate)}})}}(this)).filter(function(t){return!(!t||!t.id)}).sort(function(t,e){return-(t.order-e.order)})).length&&this.trigger("refresh",i),r&&!this.entry.children.length?this.trigger("refresh",[]):void 0},e.prototype.checkEmpty=function(){return this.trigger("refresh",[])},e.prototype.getURL=function(t,e){return e(t.url)},e.prototype.preview=function(t){return t.preview},e.prototype.deauth=function(){return this.trigger("auth",this.authenticated=!1)},e.prototype.getDriverFolders=function(t,e){return this.getDriverFiles(t,"folder",e)},e.prototype.getDriverFiles=function(t,e,r){var n,i;return n=new $.Deferred,(i=function(o){return function(s){return o.requestDriverFiles(t,e,s).then(function(e){var s;if(r(e),!e.nextPageToken)return n.resolve();o.entry.id===t&&(s=o.entry.children.slice(-1)[0])&&(s.onShow=function(){return i(e.nextPageToken),this.onShow=function(){}}.bind(s))})}}(this))(null),n.promise()},e.prototype.requestDriverFiles=function(t,e,r){var n,i;return i=new $.Deferred,(n=a.get(t,r||e))&&i.resolve(n),a.check(t,r||e)||gapi.client.drive.files.list({q:this.createQuery(t,e),fields:"nextPageToken, files(id, name, mimeType, thumbnailLink, createdTime, permissions, parents, webContentLink, webViewLink)",pageToken:r}).execute(function(n){return null!=n.result&&delete n.result,a.set(t,r||e,n),i.resolve(n)}),i.promise()},e.prototype.createQuery=function(t,e,r){var n,i;return n="mimeType contains '"+e+"/'","folder"===e&&(n="mimeType='application/vnd.google-apps.folder'"),i="trashed=false and ("+n+") and '"+t+"' in parents",r&&(i+=" and modifiedDate > '"+r+"'"),i},e}(),t.exports=i},function(t,e,r){var n,i,o,s,a,u,l=function(t,e){return function(){return t.apply(e,arguments)}},c={}.hasOwnProperty;o=r(8),n={client_id:"542808610040105",client_secret:"0a88504381f577dbbef400d4232a4258",redirect_uri:(u="https://widgetic.com/services/instagram")+"/auth_token",scope:"user_profile,user_media",response_type:"code",api_url:u,demo:"IGQVJVNUw5cHB5cUFiZATFxVmgyeWtSVFJjTDYyRmNnWDZAJZA3llVXREa1BsS1EtVGJ2UEdlbHJNbDV1UUQ2YkVSZA3YwS1dPWXJzYXFGQzdZAMlhBLTBWWWNkTVNHTGNDLW10dkdhNW0wMDVqMkhZAWEhqbgZDZD",token_storage:"redis",encodeToken:!1,redis_db:0,redis_prefix:"nstgrm:",port:8082},s=window.INSTAGRAM_SERVICE_CONFIG||n;try{s.token=localStorage.getItem("instagramAuthToken")}catch(t){}console.log("Editor Instagram Service current user's token:",s.token),a="https://api.instagram.com/oauth/authorize/?client_id="+s.client_id+"&redirect_uri="+s.redirect_uri+"&response_type="+s.response_type+"&scope="+s.scope,i=function(t){function e(){this.refresh=l(this.refresh,this),e.__super__.constructor.apply(this,arguments),this.user={},this.authenticated=!1}return function(t,e){for(var r in e)c.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,o),e.browser="browser/controller/instagram",e.prototype.getToken=function(){return s.token},e.prototype.getUser=function(t){var e;return e=s.api_url+"/me",$.ajax({url:e,type:"GET",dataType:"json",headers:{"X-Token":t}})},e.prototype._auth=function(t){return null==t&&(t=!0),console.log("Editor Instagram Service _auth method:",t,s.token),null!=s.token&&this.getUser(s.token).then(function(t){return function(e){return console.log("Editor Instagram Service getUser result:",e),t.user=e,t.trigger("auth",t.authenticated=!0)}}(this)).catch(function(t){return function(){return console.log("Editor Instagram Service getUser error:",error),t.deauth()}}(this)),!this.authenticated&&t&&this.showAuthPopup()},e.prototype.showAuthPopup=function(){return window.instagramReady=function(t){return function(e,r){s.token=e;try{localStorage.setItem("instagramAuthToken",s.token=e)}catch(t){}return t.user=r,t.trigger("auth",t.authenticated=!0)}}(this),window.open(a,"Instagram connect","width=450,height=600")},e.prototype.refresh=function(t){return this.entry=t,this.trigger("refresh",[])},e.prototype.deauth=function(){this.authenticated=!1,s.token=null,this.trigger("auth",this.authenticated);try{return localStorage.removeItem("instagramAuthToken")}catch(t){}},e}(),t.exports=i},function(t,e,r){var n,i,o,s,a,u,l,c,p,h=function(t,e){return function(){return t.apply(e,arguments)}},d={}.hasOwnProperty,f=[].indexOf||function(t){for(var e=0,r=this.length;e<r;e++)if(e in this&&this[e]===t)return e;return-1};s=r(8),n=r(9),i={client_id:"542808610040105",client_secret:"0a88504381f577dbbef400d4232a4258",redirect_uri:(c="https://widgetic.com/services/instagram/")+"auth_token",scope:"user_profile,user_media",response_type:"code",api_url:c,demo:"IGQVJVNUw5cHB5cUFiZATFxVmgyeWtSVFJjTDYyRmNnWDZAJZA3llVXREa1BsS1EtVGJ2UEdlbHJNbDV1UUQ2YkVSZA3YwS1dPWXJzYXFGQzdZAMlhBLTBWWWNkTVNHTGNDLW10dkdhNW0wMDVqMkhZAWEhqbgZDZD",token_storage:"redis",encodeToken:!1,redis_db:0,redis_prefix:"nstgrm:",port:8082},a=window.INSTAGRAM_SERVICE_CONFIG||i;try{a.token=localStorage.getItem("instagramAuthToken")}catch(t){}u="https://api.instagram.com/oauth/authorize/?client_id="+a.client_id+"&redirect_uri="+a.redirect_uri+"&response_type="+a.response_type+"&scope="+a.scope,p=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],l={_cache:{},def:function(){return new $.Deferred},has:function(t){return null!=l._cache[t]},get:function(t){return l.def().resolve(l._cache[t]).promise()},set:function(t,e){return l._cache[t]=e,l}},o=function(t){function e(){this.listEntries=h(this.listEntries,this),this.makeFolders=h(this.makeFolders,this),this._onRespond=h(this._onRespond,this),this.fetchFotos=h(this.fetchFotos,this),this.refresh=h(this.refresh,this),e.__super__.constructor.apply(this,arguments),this.user={},this.authenticated=!1,this.ajaxReqs=[]}return function(t,e){for(var r in e)d.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,s),e.prototype.getUser=function(t){var e;return e=a.api_url+"me",$.ajax({url:e,type:"GET",dataType:"json",headers:{"X-Token":t}})},e.prototype._auth=function(t){return null==t&&(t=!0),null!=a.token&&this.getUser(a.token).then(function(t){return function(e){return t.user=e,t.trigger("auth",t.authenticated=!0)}}(this)).catch(function(t){return function(e){return t.deauth()}}(this)),!this.authenticated&&t&&this.showAuthPopup()},e.prototype.showAuthPopup=function(){return window.instagramReady=function(t){return function(e,r){a.token=e;try{localStorage.setItem("instagramAuthToken",a.token=e)}catch(t){}return t.user=r,t.trigger("auth",t.authenticated=!0)}}(this),window.open(u,"Instagram connect","width=450,height=600")},e.prototype.deauth=function(){this.authenticated=!1,a.token=null,this.trigger("auth",this.authenticated);try{return localStorage.removeItem("instagramAuthToken")}catch(t){}},e.prototype.refresh=function(t){return this.entry=t,this.entry.children=[],this.children={},this.fetchFotos().done(this._onRespond)},e.prototype.fetchFotos=function(t){var e;return null==t&&(t=""),e=a.api_url+"?num=999&q="+this.user.id+"&max_id="+t,this.ajaxReqs[t]=$.ajax({url:e,type:"GET",dataType:"json",headers:{"X-Token":a.token},success:function(e){return l.set(t,e)},fail:function(t){return console.log("Fetch photos failed:",t)}}),l.has(t)?l.get(t):this.ajaxReqs[t]},e.prototype._onRespond=function(t){var e,r,n;if(e=t.media.filter(function(t){return function(e){var r;return r=e.type=e.media_type.toLowerCase(),f.call(t.options.types,r)>=0}}(this)),e=this.listEntries(e),this.entry.children=this.entry.children.concat(e),this.trigger("refresh",e),r=null!=(n=t.pagination)?n.next_max_id:void 0)return this.fetchFotos(r).done(this._onRespond)},e.prototype.makeFolders=function(t){var e,r,i,o,s,a,u,l,c,h;for(s={},u=0,l=t.length;u<l;u++)a=t[u],e=new Date(a.timestamp),o=p[e.getMonth()]+" "+e.getFullYear(),function(){var t,e,n,i;for(i=[],t=0,e=(n=this.entry.children).length;t<e;t++)(r=n[t]).name===o&&i.push(r);return i}.call(this).length||(s[o]=new n({service:this,name:o,path:"/"+o,type:"folder",year:e.getFullYear(),month:e.getMonth()}));for(c in h=[],s)i=s[c],h.push(i);return h},e.prototype.listEntries=function(t){var e,r,i,o,s;for(e=[],i=0,o=t.length;i<o;i++)s={id:(r=t[i]).id,type:r.type,media_url:r.media_url,thumbnail_url:r.thumbnail_url,caption:r.caption,images:{image:r.media_url,thumbnail:r.thumbnail_url}},null!=r.videos&&(s.videos=r.videos),s.path=this.entry.path+"/"+r.id,this.children[r.id]=new n(s),e.push(this.children[r.id]);return e},e.prototype.preview=function(t){return t.images.image||t.images.thumbnail},e.prototype.getURL=function(t,e){return e(t[t.type+"s"].image)},e}(),t.exports=o},function(t,e,r){var n,i,o,s,a,u=function(t,e){return function(){return t.apply(e,arguments)}},l={}.hasOwnProperty;o=r(8),n=r(9),a={api_url:"https://api.soundcloud.com",client_id:"aed0aa63baf747a83ad0b6b246acddca",redirect_uri:"https://widgetic.com/connect/soundcloud",tracks_url:"https://widgetic.com/wservices/soundcloud/tracks/",grant_type:"refresh_token"},(i=r(195)).initialize(a),i.client_id=a.client_id,i.api_url=a.api_url,i.tracks_url=a.tracks_url;try{i.auth_token=localStorage.getItem("soundcloudAuthToken")}catch(t){}try{i.userId=localStorage.getItem("soundcloudUserId")}catch(t){}s=function(t){function e(){this.newEntry=u(this.newEntry,this),this.fetchTracks=u(this.fetchTracks,this),this.fetchPlaylists=u(this.fetchPlaylists,this),this.checkAuth=u(this.checkAuth,this),this.auth=u(this.auth,this),e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var r in e)l.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,o),e.prototype.SCGet=function(t){var e;return e=""+i.api_url+t,$.ajax({url:e,type:"GET",dataType:"json",headers:{Authorization:"OAuth "+i.auth_token}})},e.prototype.auth=function(t){return!i.userId&&t?this.showAuthPopup():this.checkAuth()},e.prototype.showAuthPopup=function(){return i.connect().then(function(t){return function(e){i.auth_token=e.oauth_token;try{localStorage.setItem("soundcloudAuthToken",i.auth_token)}catch(t){}return t.SCGet("/me").then(function(e){i.userId=e.id;try{localStorage.setItem("soundcloudUserId",i.userId)}catch(t){}return t.checkAuth()}).catch(function(e){return console.log("Editor getUser error:",e),t.deauth()})}}(this)).catch(function(t){return function(e){return console.log("SC Connect Error: "+e.message),t.deauth()}}(this))},e.prototype.checkAuth=function(){return this.trigger("auth",null!==i.userId)},e.prototype.deauth=function(){i.auth_token=null;try{localStorage.removeItem("soundcloudAuthToken")}catch(t){}i.userId=null;try{localStorage.removeItem("soundcloudUserId")}catch(t){}return this.checkAuth()},e.prototype.refresh=function(t){return this.currentFolder=t,this.currentFolder.root?this.fetchPlaylists():this.fetchTracks(this.currentFolder.id)},e.prototype.fetchPlaylists=function(){return this.SCGet("/users/"+i.userId+"/playlists").then(function(t){return function(e){return t.trigger("refresh",e.map(t.newEntry.bind(t,"folder")),{root:!0}),t.fetchTracks(t.currentFolder.id)}}(this)).catch(function(t){return console.log("Fetch Playlist error: "+t.message)})},e.prototype.fetchTracks=function(t){var e;return e=t?"/playlists/"+t:"/users/"+i.userId+"/tracks",e+="?access=playable",this.SCGet(e).then(function(e){return function(r){var n;return n=r,r.tracks&&(n=r.tracks),e.trigger("refresh",n.map(function(t){return e.newEntry("audio",t)}),{root:!t})}}(this)).catch(function(t){return console.log("Fetch Tracks error: "+t.message)})},e.prototype.newEntry=function(t,e,r){var i,o,s,a,u,l,c;return r?u=r+"/":(u=this.currentFolder.path,this.currentFolder.root||(u+="/")),u+=e.id,"folder"===t&&(o=e.tracks),i=e.artwork_url,a=e.id,s=e.duration,c=e.title,l=e.stream_url,new n($.extend({},{service:this,type:t,path:u,artwork_url:i,id:a,children:o,duration:s/1e3,title:c,stream_url:l,name:e.title}))},e.prototype.getURL=function(t,e){return e(i.tracks_url+"?id="+t.id+"&atoken="+i.auth_token)},e}(),t.exports=s},function(t,e,r){!function(e,r){t.exports=r()}(0,function(){return function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return t[n].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){(function(e){"use strict";var n=r(4),i=r(8),o=r(3),s=r(9),a=r(2).Promise,u=r(16),l=r(17);t.exports=e.SC={initialize:function(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];o.set("oauth_token",t.oauth_token),o.set("client_id",t.client_id),o.set("redirect_uri",t.redirect_uri),o.set("baseURL",t.baseURL),o.set("connectURL",t.connectURL)},get:function(t,e){return n.request("GET",t,e)},post:function(t,e){return n.request("POST",t,e)},put:function(t,e){return n.request("PUT",t,e)},delete:function(t){return n.request("DELETE",t)},upload:function(t){return n.upload(t)},connect:function(t){return s(t)},isConnected:function(){return void 0!==o.get("oauth_token")},oEmbed:function(t,e){return n.oEmbed(t,e)},resolve:function(t){return n.resolve(t)},Recorder:u,Promise:a,stream:function(t,e){return l(t,e)},connectCallback:function(){i.notifyDialog(this.location)}}}).call(e,function(){return this}())},function(t,e){t.exports=function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return t[n].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){t.exports={SCAudio:r(1),SCAudioControllerHTML5Player:r(3),SCAudioControllerHLSMSEPlayer:r(5),SCAudioPublicApiStreamURLRetriever:r(12),MaestroCore:r(2),MaestroLoaders:r(11)}},function(t,e,r){window,t.exports=function(t){return function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var r={};return e.m=t,e.c=r,e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:n})},e.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=99)}([function(e,r){e.exports=t},function(t,e,r){"use strict";var n=r(5);t.exports=function(t){if(!n(t))throw new TypeError("Cannot use null or undefined");return t}},function(t,e,r){"use strict";t.exports=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");return t}},function(t,e,r){"use strict";t.exports=r(55)()?Symbol:r(54)},function(t,e,r){"use strict";var n=r(11),i=r(18),o=r(59),s=r(17);(t.exports=function(t,e){var r,o,a,u,l;return arguments.length<2||"string"!=typeof t?(u=e,e=t,t=null):u=arguments[2],null==t?(r=a=!0,o=!1):(r=s.call(t,"c"),o=s.call(t,"e"),a=s.call(t,"w")),l={value:e,configurable:r,enumerable:o,writable:a},u?n(i(u),l):l}).gs=function(t,e,r){var a,u,l,c;return"string"!=typeof t?(l=r,r=e,e=t,t=null):l=arguments[3],null==e?e=void 0:o(e)?null==r?r=void 0:o(r)||(l=r,r=void 0):(l=e,e=r=void 0),null==t?(a=!0,u=!1):(a=s.call(t,"c"),u=s.call(t,"e")),c={get:e,set:r,configurable:a,enumerable:u},l?n(i(l),c):c}},function(t,e,r){"use strict";var n=r(22)();t.exports=function(t){return t!==n&&null!==t}},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=r(0),o=function(t){function e(e){return t.call(this,e||"There was no format available that a player was able to play.")||this}return n(e,t),e.prototype.getCode=function(){return"SCAUDIO.NOT_SUPPORTED_ERROR"},e}(i.errors.PlayerFatalError);e.NotSupportedError=o},function(t,e,r){"use strict";var n=Object.prototype.toString,i=n.call("");t.exports=function(t){return"string"==typeof t||t&&"object"==typeof t&&(t instanceof String||n.call(t)===i)||!1}},function(t,e,r){"use strict";var n=Object.prototype.toString,i=n.call(function(){return arguments}());t.exports=function(t){return n.call(t)===i}},function(t,e,r){"use strict";t.exports=r(20)()?Object.setPrototypeOf:r(19)},function(t,e,r){"use strict";var n,i=r(23),o=r(11),s=r(2),a=r(1),u=r(4),l=r(47),c=r(3),p=Object.defineProperty,h=Object.defineProperties;t.exports=n=function(t,e){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");h(this,{__list__:u("w",a(t)),__context__:u("w",e),__nextIndex__:u("w",0)}),e&&(s(e.on),e.on("_add",this._onAdd),e.on("_delete",this._onDelete),e.on("_clear",this._onClear))},delete n.prototype.constructor,h(n.prototype,o({_next:u(function(){var t;if(this.__list__)return this.__redo__&&void 0!==(t=this.__redo__.shift())?t:this.__nextIndex__<this.__list__.length?this.__nextIndex__++:void this._unBind()}),next:u(function(){return this._createResult(this._next())}),_createResult:u(function(t){return void 0===t?{done:!0,value:void 0}:{done:!1,value:this._resolve(t)}}),_resolve:u(function(t){return this.__list__[t]}),_unBind:u(function(){this.__list__=null,delete this.__redo__,this.__context__&&(this.__context__.off("_add",this._onAdd),this.__context__.off("_delete",this._onDelete),this.__context__.off("_clear",this._onClear),this.__context__=null)}),toString:u(function(){return"[object "+(this[c.toStringTag]||"Object")+"]"})},l({_onAdd:u(function(t){if(!(t>=this.__nextIndex__)){if(++this.__nextIndex__,!this.__redo__)return void p(this,"__redo__",u("c",[t]));this.__redo__.forEach(function(e,r){e>=t&&(this.__redo__[r]=++e)},this),this.__redo__.push(t)}}),_onDelete:u(function(t){var e;t>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(-1!==(e=this.__redo__.indexOf(t))&&this.__redo__.splice(e,1),this.__redo__.forEach(function(e,r){e>t&&(this.__redo__[r]=--e)},this)))}),_onClear:u(function(){this.__redo__&&i.call(this.__redo__),this.__nextIndex__=0})}))),p(n.prototype,c.iterator,u(function(){return this}))},function(t,e,r){"use strict";t.exports=r(64)()?Object.assign:r(63)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getAppState=function(){switch(window.document.hidden){case!0:return"background";case!1:return"foreground";default:return}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(97),i=r(96),o=r(95),s=r(94),a=r(93),u=r(92),l=r(91),c=r(90),p=r(89),h=r(88);e.renditions={httpMp3:n.httpMp3,httpAACHQ:h.httpAACHQ,hlsMp3:i.hlsMp3,encryptedHlsMp3:o.encryptedHlsMp3,hlsOpus:c.hlsOpus,encryptedHlsOpus:p.encryptedHlsOpus,hlsAACHQ:s.hlsAACHQ,encryptedHlsAACHQ:a.encryptedHlsAACHQ,apiMobile:u.apiMobile,maestroChromecast:l.maestroChromecast},e.allRenditions=Object.keys(e.renditions).map(function(t){return e.renditions[t]})},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=r(6),o=function(t){function e(){return t.call(this,"Failed to retrieve stream url.")||this}return n(e,t),e.prototype.getCode=function(){return"SCAUDIO.FAILED_RETRIEVING_URL"},e}(i.NotSupportedError);e.FailedRetrievingUrlError=o},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=r(6),o=function(t){function e(){return t.call(this,"There were no stream URLs.")||this}return n(e,t),e.prototype.getCode=function(){return"SCAUDIO.NO_STREAMS"},e}(i.NotSupportedError);e.NoStreamsError=o},function(t,e,r){"use strict";var n=r(51);t.exports=function(t){if(!n(t))throw new TypeError(t+" is not iterable");return t}},function(t,e,r){"use strict";t.exports=r(58)()?String.prototype.contains:r(57)},function(t,e,r){"use strict";var n=r(5),i=Array.prototype.forEach,o=Object.create;t.exports=function(t){var e=o(null);return i.call(arguments,function(t){n(t)&&function(t,e){var r;for(r in t)e[r]=t[r]}(Object(t),e)}),e}},function(t,e,r){"use strict";var n,i=r(66),o=r(1),s=Object.prototype.isPrototypeOf,a=Object.defineProperty,u={configurable:!0,enumerable:!1,writable:!0,value:void 0};n=function(t,e){if(o(t),null===e||i(e))return t;throw new TypeError("Prototype must be null or an object")},t.exports=function(t){var e,r;return t?(2===t.level?t.set?(r=t.set,e=function(t,e){return r.call(n(t,e),e),t}):e=function(t,e){return n(t,e).__proto__=e,t}:e=function t(e,r){var i;return n(e,r),(i=s.call(t.nullPolyfill,e))&&delete t.nullPolyfill.__proto__,null===r&&(r=t.nullPolyfill),e.__proto__=r,i&&a(t.nullPolyfill,"__proto__",u),e},Object.defineProperty(e,"level",{configurable:!1,enumerable:!1,writable:!1,value:t.level})):null}(function(){var t,e=Object.create(null),r={},n=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__");if(n){try{(t=n.set).call(e,r)}catch(t){}if(Object.getPrototypeOf(e)===r)return{set:t,level:2}}return e.__proto__=r,Object.getPrototypeOf(e)===r?{level:2}:((e={}).__proto__=r,Object.getPrototypeOf(e)===r&&{level:1})}()),r(65)},function(t,e,r){"use strict";var n=Object.create,i=Object.getPrototypeOf,o={};t.exports=function(){var t=Object.setPrototypeOf,e=arguments[0]||n;return"function"==typeof t&&i(t(e(null),o))===o}},function(t,e,r){"use strict";var n=r(70),i=Math.max;t.exports=function(t){return i(0,n(t))}},function(t,e,r){"use strict";t.exports=function(){}},function(t,e,r){"use strict";var n=r(1);t.exports=function(){return n(this).length=0,this}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.notSupportedError=new Error("Not supported.");var n=function(){this.supportsVolumeAutomation=!0,this.syncConfig={}};e.BaseController=n},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){};e.BaseStreamUrlRetriever=n},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.buildFadeIn=function(t){return new n({startPos:0,endPos:t,startLevel:0,endLevel:1,fromEnd:!1})},e.buildFadeOut=function(t){return new n({startPos:t,endPos:0,startLevel:1,endLevel:0,fromEnd:!0})};var n=function(){function t(t){var e=t.startPos,r=t.endPos,n=t.startLevel,i=t.endLevel,o=t.fromEnd,s=void 0!==o&&o;if(e<0)throw new Error("startPos invalid.");if(r<0||!s&&r<e||s&&e<r)throw new Error("endPos invalid.");if(n<0||n>1)throw new Error("startLevel invalid.");if(i<0||i>1)throw new Error("endLevel invalid.");this._startPos=e,this._endPos=r,this._startLevel=n,this._endLevel=i,this._fromEnd=s}return t.prototype.calculate=function(t,e){var r=this._fromEnd?e-500-this._startPos:this._startPos,n=this._fromEnd?e-500-this._endPos:this._endPos;if(t<r)return{level:this._startLevel,nextCalculatePosition:r-t};if(t<=n){var i=(t-r)/(n-r),o=Math.cos(i*Math.PI)/-2+.5,s=this._startLevel+(this._endLevel-this._startLevel)*o;return{level:s,nextCalculatePosition:t}}return{level:this._endLevel,nextCalculatePosition:1/0}},t}();e.Fade=n},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(6),i=r(15),o=r(14);!function(t){t.NotSupportedError=n.NotSupportedError,t.NoStreamsError=i.NoStreamsError,t.FailedRetrievingUrlError=o.FailedRetrievingUrlError}(e.errors||(e.errors={}))},function(t,e,r){"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.SQ="sq",t.HQ="hq"}(n=e.Quality||(e.Quality={})),e.resolveQuality=function(t){switch(t){case n.SQ:return n.SQ;case n.HQ:return n.HQ}return null}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),i=function(){function t(t){var e=this;this._player=t,this._onConnectionRequired=new n.eventDispatcher.EventDispatcher,this._onConnectionRecovered=new n.eventDispatcher.EventDispatcher,this._connectionRequired=!1,this._connectionLossTimer=null,this.onConnectionRequired=this._onConnectionRequired.getHandle(),this.onConnectionRecovered=this._onConnectionRecovered.getHandle();var r=function(){return e._calculateIfConnectionRequired()};window.addEventListener("online",r),window.addEventListener("offline",r),this._calculateIfConnectionRequired(),t.onChange.subscribe(function(n){var i=n.loading,o=n.dead;o&&null!==e._connectionLossTimer&&(window.clearTimeout(e._connectionLossTimer),window.removeEventListener("online",r),window.removeEventListener("offline",r)),t.isDead()||void 0===i||e._calculateIfConnectionRequired()})}return t.prototype.isConnectionRequired=function(){return this._connectionRequired},t.prototype._calculateIfConnectionRequired=function(){var t=this,e=this._player.isLoading()&&"navigator"in window&&!window.navigator.onLine;e?null===this._connectionLossTimer&&(this._connectionLossTimer=window.setTimeout(function(){t._connectionLossTimer=null,t._connectionRequired=!0,t._onConnectionRequired.dispatch(void 0)},1500)):this._connectionRequired?(this._connectionRequired=!1,this._onConnectionRecovered.dispatch(void 0)):null!==this._connectionLossTimer&&(window.clearTimeout(this._connectionLossTimer),this._connectionLossTimer=null)},t}();e.ConnectionRequiredHelper=i},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.generateLogId=function(){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e="",r=0;r<20;r++)e+=t.charAt(Math.floor(Math.random()*t.length));return e}},function(t,e,r){"use strict";function n(t,e){return void 0!==t?t:e}Object.defineProperty(e,"__esModule",{value:!0});var i=r(25),o=r(0);e.validatePlayerDependencies=function(t){if(!(t.streamUrlRetriever instanceof i.BaseStreamUrlRetriever))throw new Error("StreamUrlRetriever invalid.");if(void 0!==t.duration&&("number"!=typeof t.duration||t.duration<0))throw new Error("duration invalid.");if(void 0!==t.getURLOpts&&"object"!=typeof t.getURLOpts)throw new Error("getURLOpts invalid.");if(void 0!==t.preloadingEnabled&&"boolean"!=typeof t.preloadingEnabled)throw new Error("preloadingEnabled invalid.");if(void 0!==t.fadeOnPauseAndPlay&&"boolean"!=typeof t.fadeOnPauseAndPlay)throw new Error("fadeOnPauseAndPlay invalid.");if(void 0!==t.fadeOnSeek&&"boolean"!=typeof t.fadeOnSeek)throw new Error("fadeOnSeek invalid.");if(void 0!==t.mediaSessionEnabled&&"boolean"!=typeof t.mediaSessionEnabled)throw new Error("mediaSessionEnabled invalid.");if(void 0!==t.pausedMaxBufferLength&&("number"!=typeof t.pausedMaxBufferLength||t.pausedMaxBufferLength<0))throw new Error("pausedMaxBufferLength invalid.");if(void 0!==t.playingMaxBufferLength&&("number"!=typeof t.playingMaxBufferLength||t.playingMaxBufferLength<0))throw new Error("playingMaxBufferLength invalid.");if(void 0!==t.logger&&"function"!=typeof t.logger&&"object"!=typeof t.logger)throw new Error("logger invalid.");if(void 0!==t.audioReporter&&"function"!=typeof t.audioReporter)throw new Error("audioReporter invalid.");if(void 0!==t.audioCheckpointInterval&&("number"!=typeof t.audioCheckpointInterval||t.audioCheckpointInterval<0))throw new Error("audioCheckpointInterval invalid.");if(void 0!==t.audioPerformanceReporter&&"function"!=typeof t.audioPerformanceReporter)throw new Error("audioPerformanceReporter invalid.");if(void 0!==t.errorReporter&&"function"!=typeof t.errorReporter)throw new Error("errorReporter invalid.");if(void 0!==t.urlProviderRetryDelayCalculator&&"function"!=typeof t.urlProviderRetryDelayCalculator)throw new Error("urlProviderRetryDelayCalculator invalid.");return{controllers:t.controllers,streamUrlRetriever:t.streamUrlRetriever,getURLOpts:n(t.getURLOpts,{}),preloadingEnabled:n(t.preloadingEnabled,!1),pausedMaxBufferLength:n(t.pausedMaxBufferLength,2e3),playingMaxBufferLength:n(t.playingMaxBufferLength,9e4),fadeOnPauseAndPlay:n(t.fadeOnPauseAndPlay,!1),fadeOnSeek:n(t.fadeOnSeek,!1),audioCheckpointInterval:n(t.audioCheckpointInterval,3e4),urlProviderRetryDelayCalculator:n(t.urlProviderRetryDelayCalculator,o.helpers.retry.buildExponentialDelayCalculator()),streamUrlsExpire:n(t.streamUrlsExpire,!0),fetchEnabled:n(t.fetchEnabled,!0),duration:t.duration,audioReporter:t.audioReporter,audioPerformanceReporter:t.audioPerformanceReporter,errorReporter:t.errorReporter}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),i=r(13);e.NoMoreAttemptsError=new Error("No more attempts to retrieve URL."),e.retrieveUrl=function(t){var r=t.streamUrlRetriever,o=t.getURLOpts,s=t.logger,a=t.urlProviderRetryDelayCalculator;return new n.helpers.abortableJob.AbortableJob(function(){var t=n.helpers.deferred.buildDeferred(),u=n.helpers.retry.retry(a,function(e){var a=e.scheduleRetry,u=r.getUrl(o);return s.debug("Retrieving a URL..."),u.onCompletion(function(e){e?e.rendition&&i.allRenditions.indexOf(e.rendition)<0?(s.warn("Unknown rendition. Skipping...",e.rendition),r.excludeRendition(e.rendition),a()):!e.success&&e.error.isTransient()?(s.warn("Transient error retrieving url.",e.error),a()):t.resolve(e):(s.debug("No URL provided."),t.resolve(null))}),u.onError(function(e){e!==n.helpers.abortableJob.abortedError&&s.error("Error retrieving URL.",e),t.reject(e)}),{onCancel:function(){return u.abort()}}},{onNoMoreRetries:function(){return t.reject(e.NoMoreAttemptsError)}}).cancel;return{result:t.promise,abort:function(){return u()}}}).run()}},function(t,e,r){"use strict";function n(t,e){var r=t.getMemoryCacheController();r&&r.setMaxCacheSize(e)}Object.defineProperty(e,"__esModule",{value:!0});var i=r(0),o=function(){function t(t,e){this._maxCacheSize=t,this._players=[],this._updateTimer=null,this._logger=i.logger.prefixLogger(e,"CacheManager"),this._logger.debug("Initialized with cache size "+t+" bytes.")}return t.prototype.setCacheSize=function(t){this._maxCacheSize!==t&&(this._logger.debug("Updating cache size to "+t+" bytes."),this._maxCacheSize=t,this._update())},t.prototype.addPlayer=function(t){var e=this;if(this._logger.debug("Adding player to cache manager."),t.isDead())this._logger.debug("Player was dead.");else{var r=this._players;t.onChange.subscribe(function(n){var i=n.playing,o=n.dead;!0===o?(e._logger.debug("Removing player that became dead."),r.splice(r.indexOf(t),1),e._update()):!0===i?(e._logger.debug("Updating because player started playing."),r.splice(r.indexOf(t),1),r.unshift(t),e._update()):!1===i&&(e._logger.debug("Updating because player became paused."),e._update())}),t.isPlaying()?r.unshift(t):r.push(t),this._update()}},t.prototype._update=function(){var t=this;if(this._updateTimer&&(window.clearTimeout(this._updateTimer),this._updateTimer=null),0!==this._players.length){var e=this._players.reduce(function(t,e){return e.isPlaying()?t.playingPlayers.push(e):t.pausedPlayers.push(e),t},{playingPlayers:[],pausedPlayers:[]}),r=e.playingPlayers,i=e.pausedPlayers,o=r.reduce(function(t,e){return t+(e.getMemoryCacheUsage()||0)},0),s=i.reduce(function(t,e){return t+(e.getMemoryCacheUsage()||0)},0);if(o>this._maxCacheSize){this._logger.debug("All playing players are using more than the max cache size. Cleaning...",o,this._maxCacheSize);var a=this._maxCacheSize/r.length;r.forEach(function(t){return n(t,a)}),i.forEach(function(t){return n(t,0)})}else this._logger.debug("Recalculating cache sizes...",o+s,this._maxCacheSize),r.concat(i).reduce(function(e,r){return n(r,Math.max(0,t._maxCacheSize-e)),e+(r.getMemoryCacheUsage()||0)},0);this._updateTimer=window.setTimeout(function(){return t._update()},2e4)}else this._logger.debug("There are no longer any players to manage.")},t}();e.CacheManager=o},function(t,e,r){"use strict";t.exports="undefined"!=typeof Map&&"[object Map]"===Object.prototype.toString.call(new Map)},function(t,e,r){"use strict";var n=Array.prototype.forEach,i=Object.create;t.exports=function(t){var e=i(null);return n.call(arguments,function(t){e[t]=!0}),e}},function(t,e,r){"use strict";t.exports=r(35)("key","value","key+value")},function(t,e,r){"use strict";var n,i=r(9),o=r(4),s=r(10),a=r(3).toStringTag,u=r(36),l=Object.defineProperties,c=s.prototype._unBind;n=t.exports=function(t,e){return this instanceof n?(s.call(this,t.__mapKeysData__,t),e&&u[e]||(e="key+value"),void l(this,{__kind__:o("",e),__values__:o("w",t.__mapValuesData__)})):new n(t,e)},i&&i(n,s),n.prototype=Object.create(s.prototype,{constructor:o(n),_resolve:o(function(t){return"value"===this.__kind__?this.__values__[t]:"key"===this.__kind__?this.__list__[t]:[this.__list__[t],this.__values__[t]]}),_unBind:o(function(){this.__values__=null,c.call(this)}),toString:o(function(){return"[object Map Iterator]"})}),Object.defineProperty(n.prototype,a,o("c","Map Iterator"))},function(t,e,r){"use strict";var n,i=r(9),o=r(4),s=r(3),a=r(10),u=Object.defineProperty;n=t.exports=function(t){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");t=String(t),a.call(this,t),u(this,"__length__",o("",t.length))},i&&i(n,a),delete n.prototype.constructor,n.prototype=Object.create(a.prototype,{_next:o(function(){if(this.__list__)return this.__nextIndex__<this.__length__?this.__nextIndex__++:void this._unBind()}),_resolve:o(function(t){var e,r=this.__list__[t];return this.__nextIndex__===this.__length__?r:(e=r.charCodeAt(0))>=55296&&e<=56319?r+this.__list__[this.__nextIndex__++]:r})}),u(n.prototype,s.toStringTag,o("c","String Iterator"))},function(t,e,r){"use strict";var n=r(2),i=r(1),o=Function.prototype.bind,s=Function.prototype.call,a=Object.keys,u=Object.prototype.propertyIsEnumerable;t.exports=function(t,e){return function(r,l){var c,p=arguments[2],h=arguments[3];return r=Object(i(r)),n(l),c=a(r),h&&c.sort("function"==typeof h?o.call(h,r):void 0),"function"!=typeof t&&(t=c[t]),s.call(t,c,function(t,n){return u.call(r,t)?s.call(l,p,r[t],t,r,n):e})}}},function(t,e,r){"use strict";t.exports=r(39)("forEach")},function(t,e,r){"use strict";var n=r(2),i=r(40),o=Function.prototype.call;t.exports=function(t,e){var r={},s=arguments[2];return n(e),i(t,function(t,n,i,a){r[n]=o.call(e,s,t,n,i,a)}),r}},function(t,e,r){"use strict";var n=Object.prototype.toString,i=n.call(r(22));t.exports=function(t){return"function"==typeof t&&n.call(t)===i}},function(t,e,r){"use strict";var n=r(3).iterator,i=r(8),o=r(42),s=r(21),a=r(2),u=r(1),l=r(5),c=r(7),p=Array.isArray,h=Function.prototype.call,d={configurable:!0,enumerable:!0,writable:!0,value:null},f=Object.defineProperty;t.exports=function(t){var e,r,g,y,_,v,m,b,w,E,P=arguments[1],S=arguments[2];if(t=Object(u(t)),l(P)&&a(P),this&&this!==Array&&o(this))e=this;else{if(!P){if(i(t))return 1!==(_=t.length)?Array.apply(null,t):((y=new Array(1))[0]=t[0],y);if(p(t)){for(y=new Array(_=t.length),r=0;r<_;++r)y[r]=t[r];return y}}y=[]}if(!p(t))if(void 0!==(w=t[n])){for(m=a(w).call(t),e&&(y=new e),b=m.next(),r=0;!b.done;)E=P?h.call(P,S,b.value,r):b.value,e?(d.value=E,f(y,r,d)):y[r]=E,b=m.next(),++r;_=r}else if(c(t)){for(_=t.length,e&&(y=new e),r=0,g=0;r<_;++r)E=t[r],r+1<_&&(v=E.charCodeAt(0))>=55296&&v<=56319&&(E+=t[++r]),E=P?h.call(P,S,E,g):E,e?(d.value=E,f(y,g,d)):y[g]=E,++g;_=g}if(void 0===_)for(_=s(t.length),e&&(y=new e(_)),r=0;r<_;++r)E=P?h.call(P,S,t[r],r):t[r],e?(d.value=E,f(y,r,d)):y[r]=E;return e&&(d.value=null,y.length=_),y}},function(t,e,r){"use strict";t.exports=function(){var t,e,r=Array.from;return"function"==typeof r&&(e=r(t=["raz","dwa"]),Boolean(e&&e!==t&&"dwa"===e[1]))}},function(t,e,r){"use strict";t.exports=r(44)()?Array.from:r(43)},function(t,e,r){"use strict";var n=r(45),i=r(11),o=r(1);t.exports=function(t){var e=Object(o(t)),r=arguments[1],s=Object(arguments[2]);if(e!==t&&!r)return e;var a={};return r?n(r,function(e){(s.ensure||e in t)&&(a[e]=t[e])}):i(a,t),a}},function(t,e,r){"use strict";var n,i=r(46),o=r(18),s=r(2),a=r(41),u=r(2),l=r(1),c=Function.prototype.bind,p=Object.defineProperty,h=Object.prototype.hasOwnProperty;n=function(t,e,r){var n,o=l(e)&&u(e.value);return delete(n=i(e)).writable,delete n.value,n.get=function(){return!r.overwriteDefinition&&h.call(this,t)?o:(e.value=c.call(o,r.resolveContext?r.resolveContext(this):this),p(this,t,e),this[t])},n},t.exports=function(t){var e=o(arguments[1]);return null!=e.resolveContext&&s(e.resolveContext),a(t,function(t,r){return n(r,t,e)})}},function(t,e,r){"use strict";var n,i=r(9),o=r(17),s=r(4),a=r(3),u=r(10),l=Object.defineProperty;n=t.exports=function(t,e){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");u.call(this,t),e=e?o.call(e,"key+value")?"key+value":o.call(e,"key")?"key":"value":"value",l(this,"__kind__",s("",e))},i&&i(n,u),delete n.prototype.constructor,n.prototype=Object.create(u.prototype,{_resolve:s(function(t){return"value"===this.__kind__?this.__list__[t]:"key+value"===this.__kind__?[t,this.__list__[t]]:t})}),l(n.prototype,a.toStringTag,s("c","Array Iterator"))},function(t,e,r){"use strict";var n=r(8),i=r(7),o=r(48),s=r(38),a=r(16),u=r(3).iterator;t.exports=function(t){return"function"==typeof a(t)[u]?t[u]():n(t)?new o(t):i(t)?new s(t):new o(t)}},function(t,e,r){"use strict";var n=r(8),i=r(2),o=r(7),s=r(49),a=Array.isArray,u=Function.prototype.call,l=Array.prototype.some;t.exports=function(t,e){var r,c,p,h,d,f,g,y,_=arguments[2];if(a(t)||n(t)?r="array":o(t)?r="string":t=s(t),i(e),p=function(){h=!0},"array"!==r)if("string"!==r)for(c=t.next();!c.done;){if(u.call(e,_,c.value,p),h)return;c=t.next()}else for(f=t.length,d=0;d<f&&(g=t[d],d+1<f&&(y=g.charCodeAt(0))>=55296&&y<=56319&&(g+=t[++d]),u.call(e,_,g,p),!h);++d);else l.call(t,function(t){return u.call(e,_,t,p),h})}},function(t,e,r){"use strict";var n=r(8),i=r(5),o=r(7),s=r(3).iterator,a=Array.isArray;t.exports=function(t){return!(!i(t)||!a(t)&&!o(t)&&!n(t)&&"function"!=typeof t[s])}},function(t,e,r){"use strict";t.exports=function(t){return!!t&&("symbol"==typeof t||!!t.constructor&&"Symbol"===t.constructor.name&&"Symbol"===t[t.constructor.toStringTag])}},function(t,e,r){"use strict";var n=r(52);t.exports=function(t){if(!n(t))throw new TypeError(t+" is not a symbol");return t}},function(t,e,r){"use strict";var n,i,o,s,a=r(4),u=r(53),l=Object.create,c=Object.defineProperties,p=Object.defineProperty,h=Object.prototype,d=l(null);if("function"==typeof Symbol){n=Symbol;try{String(n()),s=!0}catch(t){}}var f=function(){var t=l(null);return function(e){for(var r,n,i=0;t[e+(i||"")];)++i;return t[e+=i||""]=!0,p(h,r="@@"+e,a.gs(null,function(t){n||(n=!0,p(this,r,a(t)),n=!1)})),r}}();o=function(t){if(this instanceof o)throw new TypeError("Symbol is not a constructor");return i(t)},t.exports=i=function t(e){var r;if(this instanceof t)throw new TypeError("Symbol is not a constructor");return s?n(e):(r=l(o.prototype),e=void 0===e?"":String(e),c(r,{__description__:a("",e),__name__:a("",f(e))}))},c(i,{for:a(function(t){return d[t]?d[t]:d[t]=i(String(t))}),keyFor:a(function(t){var e;for(e in u(t),d)if(d[e]===t)return e}),hasInstance:a("",n&&n.hasInstance||i("hasInstance")),isConcatSpreadable:a("",n&&n.isConcatSpreadable||i("isConcatSpreadable")),iterator:a("",n&&n.iterator||i("iterator")),match:a("",n&&n.match||i("match")),replace:a("",n&&n.replace||i("replace")),search:a("",n&&n.search||i("search")),species:a("",n&&n.species||i("species")),split:a("",n&&n.split||i("split")),toPrimitive:a("",n&&n.toPrimitive||i("toPrimitive")),toStringTag:a("",n&&n.toStringTag||i("toStringTag")),unscopables:a("",n&&n.unscopables||i("unscopables"))}),c(o.prototype,{constructor:a(i),toString:a("",function(){return this.__name__})}),c(i.prototype,{toString:a(function(){return"Symbol ("+u(this).__description__+")"}),valueOf:a(function(){return u(this)})}),p(i.prototype,i.toPrimitive,a("",function(){var t=u(this);return"symbol"==typeof t?t:t.toString()})),p(i.prototype,i.toStringTag,a("c","Symbol")),p(o.prototype,i.toStringTag,a("c",i.prototype[i.toStringTag])),p(o.prototype,i.toPrimitive,a("c",i.prototype[i.toPrimitive]))},function(t,e,r){"use strict";var n={object:!0,symbol:!0};t.exports=function(){var t;if("function"!=typeof Symbol)return!1;t=Symbol("test symbol");try{String(t)}catch(t){return!1}return!!n[typeof Symbol.iterator]&&!!n[typeof Symbol.toPrimitive]&&!!n[typeof Symbol.toStringTag]}},function(t,e,r){"use strict";var n,i,o,s,a,u,l,c=r(4),p=r(2),h=Function.prototype.apply,d=Function.prototype.call,f=Object.create,g=Object.defineProperty,y=Object.defineProperties,_=Object.prototype.hasOwnProperty,v={configurable:!0,enumerable:!1,writable:!0};i=function(t,e){var r,i;return p(e),i=this,n.call(this,t,r=function(){o.call(i,t,r),h.call(e,this,arguments)}),r.__eeOnceListener__=e,this},o=function(t,e){var r,n,i,o;if(p(e),!_.call(this,"__ee__"))return this;if(!(r=this.__ee__)[t])return this;if("object"==typeof(n=r[t]))for(o=0;i=n[o];++o)i!==e&&i.__eeOnceListener__!==e||(2===n.length?r[t]=n[o?0:1]:n.splice(o,1));else n!==e&&n.__eeOnceListener__!==e||delete r[t];return this},s=function(t){var e,r,n,i,o;if(_.call(this,"__ee__")&&(i=this.__ee__[t]))if("object"==typeof i){for(r=arguments.length,o=new Array(r-1),e=1;e<r;++e)o[e-1]=arguments[e];for(i=i.slice(),e=0;n=i[e];++e)h.call(n,this,o)}else switch(arguments.length){case 1:d.call(i,this);break;case 2:d.call(i,this,arguments[1]);break;case 3:d.call(i,this,arguments[1],arguments[2]);break;default:for(r=arguments.length,o=new Array(r-1),e=1;e<r;++e)o[e-1]=arguments[e];h.call(i,this,o)}},a={on:n=function(t,e){var r;return p(e),_.call(this,"__ee__")?r=this.__ee__:(r=v.value=f(null),g(this,"__ee__",v),v.value=null),r[t]?"object"==typeof r[t]?r[t].push(e):r[t]=[r[t],e]:r[t]=e,this},once:i,off:o,emit:s},u={on:c(n),once:c(i),off:c(o),emit:c(s)},l=y({},u),t.exports=e=function(t){return null==t?f(l):y(Object(t),u)},e.methods=a},function(t,e,r){"use strict";var n=String.prototype.indexOf;t.exports=function(t){return n.call(this,t,arguments[1])>-1}},function(t,e,r){"use strict";var n="razdwatrzy";t.exports=function(){return"function"==typeof n.contains&&!0===n.contains("dwa")&&!1===n.contains("foo")}},function(t,e,r){"use strict";t.exports=function(t){return"function"==typeof t}},function(t,e,r){"use strict";var n=r(5),i=Object.keys;t.exports=function(t){return i(n(t)?Object(t):t)}},function(t,e,r){"use strict";t.exports=function(){try{return Object.keys("primitive"),!0}catch(t){return!1}}},function(t,e,r){"use strict";t.exports=r(61)()?Object.keys:r(60)},function(t,e,r){"use strict";var n=r(62),i=r(1),o=Math.max;t.exports=function(t,e){var r,s,a,u=o(arguments.length,2);for(t=Object(i(t)),a=function(n){try{t[n]=e[n]}catch(t){r||(r=t)}},s=1;s<u;++s)e=arguments[s],n(e).forEach(a);if(void 0!==r)throw r;return t}},function(t,e,r){"use strict";t.exports=function(){var t,e=Object.assign;return"function"==typeof e&&(e(t={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),t.foo+t.bar+t.trzy==="razdwatrzy")}},function(t,e,r){"use strict";var n,i=Object.create;r(20)()||(n=r(19)),t.exports=function(){var t,e,r;return n?1!==n.level?i:(t={},e={},r={configurable:!1,enumerable:!1,writable:!0,value:void 0},Object.getOwnPropertyNames(Object.prototype).forEach(function(t){return"__proto__"===t?void(e[t]={configurable:!0,enumerable:!1,writable:!0,value:void 0}):void(e[t]=r)}),Object.defineProperties(t,e),Object.defineProperty(n,"nullPolyfill",{configurable:!1,enumerable:!1,writable:!1,value:t}),function(e,r){return i(null===e?t:e,r)}):i}()},function(t,e,r){"use strict";var n=r(5),i={function:!0,object:!0};t.exports=function(t){return n(t)&&i[typeof t]||!1}},function(t,e,r){"use strict";t.exports=function(t){return t=Number(t),isNaN(t)||0===t?t:t>0?1:-1}},function(t,e,r){"use strict";t.exports=function(){var t=Math.sign;return"function"==typeof t&&1===t(10)&&-1===t(-20)}},function(t,e,r){"use strict";t.exports=r(68)()?Math.sign:r(67)},function(t,e,r){"use strict";var n=r(69),i=Math.abs,o=Math.floor;t.exports=function(t){return isNaN(t)?0:0!==(t=Number(t))&&isFinite(t)?n(t)*o(i(t)):t}},function(t,e,r){"use strict";t.exports=function(t){return t!=t}},function(t,e,r){"use strict";t.exports=function(){var t=Number.isNaN;return"function"==typeof t&&!t({})&&t(NaN)&&!t(34)}},function(t,e,r){"use strict";t.exports=r(72)()?Number.isNaN:r(71)},function(t,e,r){"use strict";var n=r(73),i=r(21),o=r(1),s=Array.prototype.indexOf,a=Object.prototype.hasOwnProperty,u=Math.abs,l=Math.floor;t.exports=function(t){var e,r,c,p;if(!n(t))return s.apply(this,arguments);for(r=i(o(this).length),c=arguments[1],c=isNaN(c)?0:c>=0?l(c):i(this.length)-l(u(c)),e=c;e<r;++e)if(a.call(this,e)&&(p=this[e],n(p)))return e;return-1}},function(t,e,r){"use strict";var n,i=r(23),o=r(74),s=r(9),a=r(2),u=r(1),l=r(4),c=r(56),p=r(3),h=r(16),d=r(50),f=r(37),g=r(34),y=Function.prototype.call,_=Object.defineProperties,v=Object.getPrototypeOf;t.exports=n=function(){var t,e,r,i=arguments[0];if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");return r=g&&s&&Map!==n?s(new Map,v(this)):this,null!=i&&h(i),_(r,{__mapKeysData__:l("c",t=[]),__mapValuesData__:l("c",e=[])}),i?(d(i,function(r){var n=u(r)[0];r=r[1],-1===o.call(t,n)&&(t.push(n),e.push(r))},r),r):r},g&&(s&&s(n,Map),n.prototype=Object.create(Map.prototype,{constructor:l(n)})),c(_(n.prototype,{clear:l(function(){this.__mapKeysData__.length&&(i.call(this.__mapKeysData__),i.call(this.__mapValuesData__),this.emit("_clear"))}),delete:l(function(t){var e=o.call(this.__mapKeysData__,t);return-1!==e&&(this.__mapKeysData__.splice(e,1),this.__mapValuesData__.splice(e,1),this.emit("_delete",e,t),!0)}),entries:l(function(){return new f(this,"key+value")}),forEach:l(function(t){var e,r,n=arguments[1];for(a(t),e=this.entries(),r=e._next();void 0!==r;)y.call(t,n,this.__mapValuesData__[r],this.__mapKeysData__[r],this),r=e._next()}),get:l(function(t){var e=o.call(this.__mapKeysData__,t);if(-1!==e)return this.__mapValuesData__[e]}),has:l(function(t){return-1!==o.call(this.__mapKeysData__,t)}),keys:l(function(){return new f(this,"key")}),set:l(function(t,e){var r,n=o.call(this.__mapKeysData__,t);return-1===n&&(n=this.__mapKeysData__.push(t)-1,r=!0),this.__mapValuesData__[n]=e,r&&this.emit("_add",n,t),this}),size:l.gs(function(){return this.__mapKeysData__.length}),values:l(function(){return new f(this,"value")}),toString:l(function(){return"[object Map]"})})),Object.defineProperty(n.prototype,p.iterator,l(function(){return this.entries()})),Object.defineProperty(n.prototype,p.toStringTag,l("c","Map"))},function(t,e,r){"use strict";t.exports=function(){var t,e,r;if("function"!=typeof Map)return!1;try{t=new Map([["raz","one"],["dwa","two"],["trzy","three"]])}catch(t){return!1}return"[object Map]"===String(t)&&3===t.size&&"function"==typeof t.clear&&"function"==typeof t.delete&&"function"==typeof t.entries&&"function"==typeof t.forEach&&"function"==typeof t.get&&"function"==typeof t.has&&"function"==typeof t.keys&&"function"==typeof t.set&&"function"==typeof t.values&&(e=t.entries(),!1===(r=e.next()).done&&!!r.value&&"raz"===r.value[0]&&"one"===r.value[1])}},function(t,e,r){"use strict";t.exports=r(76)()?Map:r(75)},function(t,e,r){"use strict";function n(t,e,r){return{name:e.name,preset:t.preset,bitrate:t.bitrate,protocol:t.rendition.scProtocol,host:function(t){var e=t.split("//",2);return 1===e.length?e[0].split("/",1)[0]:e[1]?e[1].split("/",1)[0]:""}(r),url:function(t){var e=a.exec(t);return e&&e[0]||""}(r),format:t.rendition.scFormat,quality:t.quality}}Object.defineProperty(e,"__esModule",{value:!0});var i=r(77),o=r(0),s=r(24),a=/^[^?#]*/,u=function(){function t(t){var e=t.logger,r=t.controllers,n=t.playerId,s=t.streamUrlsExpire,a=t.fetchEnabled,u=t.fadeOnPauseAndPlay,l=t.fadeOnSeek,c=t.cacheManager,p=t.providePlayer,h=t.removePlayer,d=t.streamUrlRetriever,f=t.getURLOpts,g=t.errorEventGenerator,y=t.audioPerformanceEventGenerator;this._quality=null,this._onQualityChanged=new o.eventDispatcher.EventDispatcher,this._controllerIndexByRendition=new i,this._controlledPlayerWithRendition=null,this.onQualityChanged=this._onQualityChanged.getHandle(),this._logger=o.logger.prefixLogger(e,"ControllerManager"),this._controllers=r,this._playerId=n,this._streamUrlsExpire=s,this._fetchEnabled=a,this._fadeOnPauseAndPlay=u,this._fadeOnSeek=l,this._cacheManager=c,this._providePlayer=p,this._removePlayer=h,this._streamUrlRetriever=d,this._getURLOpts=f,this._errorEventGenerator=g||null,this._audioPerformanceEventGenerator=y||null}return t.prototype.buildNextController=function(t,e){var r=this;if(this._controlledPlayerWithRendition)throw new Error("A player is already being controlled.");this._logger.debug("Building next controller.");var n=this._controllerIndexByRendition.get(t.rendition)||0;if(n>=this._controllers.length)this._logger.debug("No more controllers for this rendition."),e({excludeRendition:!0,immediateRetry:!0});else{var i=!1;this._manageController(t,this._controllers[n],function(o){if(i)throw new Error("performNextAction() already called");i=!0,"MOVE_ON"!==o&&"MOVE_ON_SAME_RENDITION"!==o||(r._logger.debug("Controller will not be used again."),r._controllerIndexByRendition.set(t.rendition,n+1)),"MOVE_ON_SAME_RENDITION"===o?r.buildNextController(t,e):e({excludeRendition:!1,immediateRetry:"MOVE_ON"===o})})}},t.prototype.releaseCurrentController=function(t){var e=t.retry;if(!this._controlledPlayerWithRendition)throw new Error("There is no player being controlled.");this._controlledPlayerWithRendition.releaseControl({retry:e})},t.prototype.getQuality=function(){return this._quality},t.prototype.getPlayerDetails=function(){if(!this._controlledPlayerWithRendition)throw new Error("There is no player being controlled.");var t=this._controlledPlayerWithRendition,e=t.initialUrlAndRendition,r=t.controller,i=t.controlledPlayer;return n(e,r,i.getUrl())},t.prototype._manageController=function(t,e,r){var i=this,a=function(){i._removePlayer(),i._controlledPlayerWithRendition=null,u&&u.kill()};if(this._logger.debug("Preparing controller.",e.name),!e.isRenditionSupported(t.rendition,{streamUrlExpires:this._streamUrlsExpire}))return this._logger.debug("Skipping controller because rendition not supported."),void r("MOVE_ON_SAME_RENDITION");var u,l=!1,c=function(t){var e=t.retry;l||(l=!0,i._logger.debug("Releasing control."),a(),r(e?"RETRY":"MOVE_ON"))};try{this._logger.debug("Building player.");var p=e.buildPlayer({logger:o.logger.prefixLogger(this._logger,e.name+"-Controller"),playerId:this._playerId,urlAndRendition:t,streamUrlExpires:this._streamUrlsExpire,fetchEnabled:this._fetchEnabled,releaseControl:c,fadeOnPauseAndPlay:this._fadeOnPauseAndPlay,fadeOnSeek:this._fadeOnSeek,getNewUrl:function(){return i._getNewUrlWithSameRendition(t.rendition)},reportError:function(r){i._errorEventGenerator&&i._errorEventGenerator.reportManualEvent(r,n(t,e,p?p.getUrl():t.url))},reportPerformance:function(t){!l&&i._audioPerformanceEventGenerator&&i._audioPerformanceEventGenerator.reportManualEvent(t)}});if(u=p.getPlayer(),l)this._logger.warn("Player released during constrution."),u.kill();else if(u.isDead()){var h=u.getFatalError();h instanceof o.errors.NotSupportedError?this._logger.debug("Player not supported (during construction)."):this._logger.error("Error during construction.",h),r("MOVE_ON_SAME_RENDITION")}else{this._logger.debug("Player built."),u.onChange.subscribe(function(t){var e=t.dead,r=t.fatalError;e&&(r&&i._logger.error("Fatal player error occurred.",r),c({retry:!1}))}),this._cacheManager.addPlayer(u),this._controlledPlayerWithRendition={controller:e,controlledPlayer:p,initialUrlAndRendition:t,releaseControl:c},this._providePlayer(p.getPlayer(),e.syncConfig,e.supportsVolumeAutomation),this._logger.debug("Player provided to proxy.");var d=t.quality||null;this._quality!==d&&(this._logger.debug("Quality changed.",d),this._quality=d,this._onQualityChanged.dispatch(d))}}catch(t){t===s.notSupportedError?this._logger.debug("Player not supported. Not constructed."):this._logger.error("Error during construction.",t),a(),r("MOVE_ON_SAME_RENDITION")}},t.prototype._getNewUrlWithSameRendition=function(t){var e=this,r=new o.helpers.abortableJob.AbortableJob(function(){var r=e._streamUrlRetriever.getUrl(e._getURLOpts),n=r.whenComplete().then(function(e){var r=null;return e&&e.success&&e.rendition===t&&(r=e.url),r});return{result:n,abort:function(){return r.abort()}}});return r.run()},t}();e.ControllerManager=u},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),i=r(12),o=1e3,s=function(){function t(t,e,r,i,s){this._checkpointTimer=null,this._logger=n.logger.prefixLogger(i,"AudioEventGenerator"),this._player=t,this._eventReporter=e,this._checkpointInterval=Math.max(o,r),this._getPlayerDetails=s,this._startReporting()}return t.prototype._startReporting=function(){var t=this,e=this._player;e.onChange.subscribe(function(r){var n=r.actuallyPlaying,i=r.ended;!0===n&&!e.isEnded()||!1===i&&e.isActuallyPlaying()?(t._checkpointTimer||(t._checkpointTimer=window.setInterval(function(){t._reportEvent("checkpoint")},t._checkpointInterval)),t._reportEvent("play")):(!1===n&&!e.isEnded()||!0===i&&e.isActuallyPlaying())&&(t._checkpointTimer&&(window.clearInterval(t._checkpointTimer),t._checkpointTimer=null),t._reportEvent("pause"))})},t.prototype._reportEvent=function(t){var e=this._getPlayerDetails();if(e){var r=this._player.getDuration();if(null===r)throw new Error("Duration should exist now.");var n={type:t,position:this._player.getPosition(),duration:r,preset:e.preset,quality:e.quality,playerType:e.name,appState:i.getAppState()};this._logger.debug("Generated audio event.",n),this._eventReporter(n)}else this._logger.warn("Cannot report event because there is no player.",t)},t}();e.AudioEventGenerator=s},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(){this._delayFactor=0,this._lastRequestTime=0}return t.prototype.getDelay=function(t){var e=void 0===t?{}:t,r=e.maxDelay,n=void 0===r?3e4:r,i=e.numInstantRuns,o=void 0===i?5:i,s=Date.now()-this._lastRequestTime;this._lastRequestTime=Date.now(),this._delayFactor=Math.max(0,this._delayFactor-s/n),this._delayFactor++;var a=this._delayFactor-o;return a>0?Math.pow(2,a):0},t}();e.DecayingExponentialDelayCalculator=n},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),i=r(12),o=function(){function t(t,e,r,i,o,s){this._logger=n.logger.prefixLogger(s,"ErrorGenerator"),this._player=t,this._logCollector=e,this._logId=r,this._trackId=i,this._eventReporter=o,this._listenForProxyFatalError()}return t.prototype.reportManualEvent=function(t,e){"NOT_SUPPORTED_ERROR"!==t&&"HLS_MSE_PLAYER.NO_TRANSMUXER_ERROR"!==t&&(this._logger.debug("Reporting manual error event.",t),this._reportEvent(t,e))},t.prototype._listenForProxyFatalError=function(){var t=this;this._player.onError.subscribe(function(e){e instanceof n.errors.PlayerFatalError&&t._reportEvent(e.getCode())})},t.prototype._reportEvent=function(t,e){var r={errorCode:t,log:this._logCollector.getLog(),logId:this._logId,trackId:this._trackId,protocol:e&&e.protocol,playerType:e&&e.name?e.name:"MaestroUnknown",host:e&&e.host,bitrate:e&&e.bitrate,format:e&&e.format,preset:e&&e.preset,quality:e&&e.quality,url:e&&e.url,appState:i.getAppState()};this._logger.debug("Generated audio error event.",r),this._eventReporter(r)},t}();e.ErrorEventGenerator=o},function(t,e,r){"use strict";function n(t,e){var r=t.getBufferedTimeRanges();return r?o(r,function(t){return t.containsTime(e)})||new i.TimeRange(e,0):null}Object.defineProperty(e,"__esModule",{value:!0});var i=r(0),o=i.helpers.find,s=function(){function t(t){var e=t.proxy,r=t.getPlayer;this._getPlayer=r;var i=this._position=e.getPosition(),o=this._initialActualPlayer=r();if(o){var s=n(o,i);this._initialBuffered=s?s.end-i:null}else this._initialBuffered=null}return t.prototype.getPreloaded=function(){var t=this._initialBuffered;return null!==t&&this._initialActualPlayer&&this._getPlayer()===this._initialActualPlayer?0===t?"no":t>=2e3?"yes":"partial":null},t}();e.PreloadingCalculator=s},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),i=n.helpers.time.now,o=function(){function t(){this._start=null,this._end=null}return t.prototype.start=function(){if(this.isComplete())throw new Error("Timer completed.");this._start=i()},t.prototype.isComplete=function(){return null!==this._end},t.prototype.stop=function(){if(null===this._start)throw new Error("Not started.");this._end=i()},t.prototype.getTime=function(){if(null===this._end)throw new Error("Not completed.");return this._end-this._start},t}();e.Timer=o},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),i=r(83),o=r(82),s=r(12),a=function(){function t(t,e,r,i,o){this._logger=n.logger.prefixLogger(i,"AudioPerformanceEventGenerator"),this._proxy=t,this._getPlayer=e,this._eventReporter=r,this._getPlayerDetails=o,this._measureGeneralEvents()}return t.prototype.reportManualEvent=function(t){this._logger.debug("Reporting manual audio performance event.",t),this._eventReporter(t)},t.prototype._measureGeneralEvents=function(){var t=this,e=this._proxy,r=null,n=null,s=null,a=null,u=null,l=null,c=null,p=!0;e.onChange.subscribe(function(h){var d=h.playing,f=h.actuallyPlaying,g=h.seek,y=h.seeking,_=h.stalled,v=h.ended,m=h.dead;if(!0!==m&&!1!==d||!a||(a.stop(),a.getTime()>=1e3&&t._reportEvent("rageSkip",a.getTime(),null),a=null),e.isDead())c&&window.clearTimeout(c);else{var b=e.getSeekState();e.isActuallyPlaying()||a||!(!0===d||e.isPlaying()&&!0===_)||(a=new i.Timer).start(),!0===d&&(r||((r=new i.Timer).start(),n=new o.PreloadingCalculator({proxy:e,getPlayer:t._getPlayer}),c=window.setTimeout(function(){t._reportEvent("longInitialBuffering",0,null)},3e4),0===e.getPosition()&&(p=!1))),!1===d&&(c&&window.clearTimeout(c),r&&!r.isComplete()&&(r=null)),!0===f&&(a=null,r&&!r.isComplete()&&(r.stop(),c&&window.clearTimeout(c),t._reportEvent("play",r.getTime(),n.getPreloaded()))),g&&"IN_PROGRESS"===g.state&&e.isReady()&&((s=new i.Timer).start(),u=new o.PreloadingCalculator({proxy:e,getPlayer:t._getPlayer}),!0===y&&t._reportEvent("seekStart",0,null)),(g&&"COMPLETED"===g.state&&!e.isStalled()||!1===_&&b&&"COMPLETED"===b.state)&&s&&(s.stop(),t._reportEvent("seek",s.getTime(),u.getPreloaded()),s=null),!0!==_||!e.isPlaying()||b&&"IN_PROGRESS"===b.state||r&&r.isComplete()&&((l=new i.Timer).start(),t._reportEvent("rebufferingStart",e.getPosition(),null)),!1===_&&(r&&r.isComplete()&&(a=null),l&&(l.stop(),t._reportEvent("rebufferingEnd",l.getTime(),null),l=null)),!0!==v||p||(t._reportEvent("uninterruptedPlay",0,null),p=!0);var w=b&&"IN_PROGRESS"===b.state;!w&&!0===_&&e.isActuallyPlaying()&&(p=!0)}})},t.prototype._reportEvent=function(t,e,r){var n=this._getPlayerDetails();if(n){var i={type:t,latency:e,protocol:n.protocol,playerType:n.name,host:n.host,bitrate:n.bitrate,format:n.format,preset:n.preset,quality:n.quality,preloaded:r||void 0,appState:s.getAppState()};this._logger.debug("Generated audio performance event.",i),this._eventReporter(i)}else this._logger.warn("Cannot report event because there is no player.",t,e)},t}();e.AudioPerformanceEventGenerator=a},function(t,e,r){"use strict";var n=this&&this.__assign||Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t};Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t){void 0===t&&(t=200),this._bufferSize=t,this._log=[]}return t.prototype.getLog=function(){return this._log.map(function(t){return n({},t,{data:function(t){return t.map(function(t){try{return JSON.stringify(t)}catch(t){return"<unavailable>"}})}(t.data)})})},t.prototype.debug=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];this._push({level:"debug",msg:t,data:e,time:Date.now()})},t.prototype.info=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];this._push({level:"info",msg:t,data:e,time:Date.now()})},t.prototype.warn=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];this._push({level:"warn",msg:t,data:e,time:Date.now()})},t.prototype.error=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];this._push({level:"error",msg:t,data:e,time:Date.now()})},t.prototype._push=function(t){this._log.push(t)>this._bufferSize&&this._log.shift()},t}();e.LogCollector=i},function(t,e,r){"use strict";function n(t,e,r){return Math.min(e,Math.max(t,r))}var i=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=r(0),s=r(26),a=r(85),u=r(84),l=r(81),c=r(80),p=r(79),h=r(78),d=r(33),f=r(32),g=r(6),y=r(15),_=r(31),v=r(30),m=r(29),b=r(14),w=r(13),E=o.eventDispatcher.EventDispatcher,P=o.helpers.Promise,S=o.helpers.deferred.buildDeferred,x=new d.CacheManager(15e7,o.logger.noOpLogger),k=-1,A=[],O=1,T=!1;e.setGlobalVolume=function(t){if("number"!=typeof t)throw new Error("level must be a number.");if(t<0||t>1)throw new Error("Invalid volume level.");O=t,A.forEach(function(e){return e.setVolume(t)})},e.getGlobalVolume=function(){return O},e.setGlobalMuted=function(t){if("boolean"!=typeof t)throw new Error("muteEnabled must be a boolean.");T=t,A.forEach(function(e){return e.setMuted(t)})},e.getGlobalMuted=function(){return T},e.setCacheSize=function(t){if("number"!=typeof t||t<0)throw new Error("Invalid size.");x.setCacheSize(t)};var R=function(t){function e(e){var r=t.call(this,e)||this;r._onPreloadingEnabled=new E,r._onPreloadingDisabled=new E,r._retryDelayCalculator=new c.DecayingExponentialDelayCalculator,r._errorEventGenerator=null,r._fadeOutVolumeAutomator=null,r._volumeAutomators=[],r._volumeScale=1,r._userVolume=1,r._volumeAutomationSupported=!1,r._timer=null,r._pauseFadeTimer=null,r._pauseFadeDeferred=null,r._pauseFade=null,r._executionState={state:"IDLE"},r._preloadingListeners=[],r._retrieveAndBuildTimer=null,r._hadAStreamUrl=!1;var n=r._config=_.validatePlayerDependencies(e);r._preloadingEnabled=n.preloadingEnabled,r._getURLOpts=n.getURLOpts,r._controllers=n.controllers;var i=r._connectionRequiredHelper=new m.ConnectionRequiredHelper(r);r.onPreloadingEnabled=r._onPreloadingEnabled.getHandle(),r.onPreloadingDisabled=r._onPreloadingDisabled.getHandle(),r.onConnectionRequired=i.onConnectionRequired,r.onConnectionRecovered=i.onConnectionRecovered,r.onChange.subscribe(function(t){r.isDead()||((!1===t.playing||t.positionJumped||t.stalled||t.ended)&&r._completePauseFade(),r._pauseFade&&(!1===t.actuallyPlaying||t.ended||!0===t.playing)&&(r._removeVolumeAutomator(r._pauseFade),r._pauseFade=null),(t.positionJumped||void 0!==t.actuallyPlaying||void 0!==t.stalled)&&r._updateVolume(),void 0!==t.playing&&r._updateMaxBufferLength())});var s="SCAudio-"+ ++k,d=n.streamUrlRetriever.getTrackId();null!==d&&(s+="-"+d);var f=new a.LogCollector,g=o.logger.cloneLogger(f,r._logger);r._logger=o.logger.prefixLogger(g,s);var y=v.generateLogId();r._logger.info("Building player...",{ua:navigator.userAgent,getURLOpts:r._getURLOpts,logId:y}),A.push(r),r.setVolume(O,T),r._updateFadeOut();var b=null,w=null;n.audioPerformanceReporter&&(b=new u.AudioPerformanceEventGenerator(r,function(){return r._getPlayer()},n.audioPerformanceReporter,r._logger,function(){return r._getActivePlayerDetails()})),n.audioReporter&&new p.AudioEventGenerator(r,n.audioReporter,n.audioCheckpointInterval,r._logger,function(){return r._getActivePlayerDetails()}),n.errorReporter&&(w=r._errorEventGenerator=new l.ErrorEventGenerator(r,f,y,d,n.errorReporter,r._logger)),r._excludeUnsupportedRenditions();var P=r._controllerManager=new h.ControllerManager({logger:r._logger,controllers:n.controllers,playerId:s,streamUrlsExpire:n.streamUrlsExpire,fetchEnabled:n.fetchEnabled,fadeOnPauseAndPlay:n.fadeOnPauseAndPlay,fadeOnSeek:n.fadeOnSeek,cacheManager:x,providePlayer:function(t,e,n){r._volumeAutomationSupported=n,r._providePlayer(t,e),r._updateMaxBufferLength()},removePlayer:function(){r._getPlayer()&&r._removePlayer()},streamUrlRetriever:r._config.streamUrlRetriever,getURLOpts:r._getURLOpts,errorEventGenerator:w||void 0,audioPerformanceEventGenerator:b||void 0});if(r.onQualityChanged=P.onQualityChanged,void 0!==n.duration&&(r._logger.debug("Setting initial duration.",n.duration),r._setInitialDuration(n.duration)),r._preloadingEnabled)r._logger.debug("Preloading is enabled, so performing retrieve immediately."),r._retrieveAndBuild();else{r._logger.debug("Preloading is disabled, so deferring retrieve until either a play intent or preloading is enabled.");var S=function(){r._removePreloadingListeners(),r._logger.debug("Preloading now enabled or received a play request. Peforming retrieve."),r._retrieveAndBuild()};r._preloadingListeners.push(r.onPreloadingEnabled.subscribe(S),r.onPlayIntent.subscribe(S))}return r}return i(e,t),e.prototype.reload=function(t){void 0===t&&(t={}),this._ensureNotDead(),this._reloadStreamUrls(t)},e.prototype.enablePreloading=function(){this.isDead()||this._preloadingEnabled||(this._preloadingEnabled=!0,this._updateMaxBufferLength(),this._onPreloadingEnabled.dispatch(void 0))},e.prototype.disablePreloading=function(){this.isDead()||this._preloadingEnabled&&(this._preloadingEnabled=!1,this._updateMaxBufferLength(),this._onPreloadingDisabled.dispatch(void 0))},e.prototype.isPreloadingEnabled=function(){return this._preloadingEnabled},e.prototype.pauseAfterFade=function(t){var e=this;if(this._ensureNotDead(),this._pauseFadeDeferred)return this._pauseFadeDeferred.promise;if(!this.isPlaying()||!this.isActuallyPlaying())return P.resolve(this.pause());var r=S();this._pauseFadeDeferred=r;var n=this.getPosition();if(this._pauseFade)throw new Error("Fade should not already be assigned.");return this._pauseFade=new s.Fade({startPos:n,endPos:n+t,startLevel:1,endLevel:0}),this._addVolumeAutomator(this._pauseFade),this._pauseFadeTimer=window.setTimeout(function(){e._pauseFadeDeferred=null,r.resolve(e.pause({fadeDuration:0}))},t+50),r.promise},e.prototype.isConnectionRequired=function(){return this._connectionRequiredHelper.isConnectionRequired()},e.prototype.getQuality=function(){return this._controllerManager.getQuality()},e.prototype.getVolume=function(){return this._volumeAutomationSupported?this._userVolume:t.prototype.getVolume.call(this)},e.prototype._handleFatalError=function(t){this._logger.warn("Fatal error from current player.",t)},e.prototype._handleVolumeChange=function(e,r){this._userVolume=e,t.prototype._notifyVolumeChange.call(this,e,r),this._calculateAndSetVolume()},e.prototype._notifyVolumeChange=function(){},e.prototype._kill=function(){t.prototype._kill.call(this),this._timer&&window.clearTimeout(this._timer),this._abortPauseFade(),this._removePreloadingListeners(),A.splice(A.indexOf(this),1),"RETRIEVING_URL"===this._executionState.state?this._executionState.retrieveJob.abort():"CONTROLLING_PLAYER"===this._executionState.state&&this._controllerManager.releaseCurrentController({retry:!1}),this._executionState={state:"DEAD"},this._retrieveAndBuildTimer&&window.clearTimeout(this._retrieveAndBuildTimer)},e.prototype._excludeUnsupportedRenditions=function(){var t=this,e={streamUrlExpires:this._config.streamUrlsExpire},r=w.allRenditions.filter(function(r){return!t._controllers.some(function(t){return t.isRenditionSupported(r,e)})});r.forEach(function(e){t._config.streamUrlRetriever.excludeRendition(e)})},e.prototype._addVolumeAutomator=function(t){var e=this._volumeAutomators.indexOf(t);e<0&&(this._volumeAutomators.push(t),this._updateVolume())},e.prototype._removeVolumeAutomator=function(t){var e=this._volumeAutomators.indexOf(t);e>=0&&(this._volumeAutomators.splice(e,1),this._updateVolume())},e.prototype._removePreloadingListeners=function(){this._preloadingListeners.forEach(function(t){return t.remove()})},e.prototype._getActivePlayerDetails=function(){return"CONTROLLING_PLAYER"!==this._executionState.state?null:this._controllerManager.getPlayerDetails()},e.prototype._updateFadeOut=function(){this._fadeOutVolumeAutomator&&this._removeVolumeAutomator(this._fadeOutVolumeAutomator),this._getURLOpts.snippet&&(this._fadeOutVolumeAutomator=s.buildFadeOut(3e3),this._addVolumeAutomator(this._fadeOutVolumeAutomator))},e.prototype._handleUnexpectedError=function(t){try{t()}catch(t){this._logger.error("Unexpected error.",t),this._triggerError(new o.errors.PlayerFatalError("An unexpected error occurred.",t))}},e.prototype._retrieveAndBuild=function(){var t=this;this._handleUnexpectedError(function(){if(-1===["IDLE","WAITING_TO_RETRIEVE"].indexOf(t._executionState.state))throw new Error("Invalid state for retrieveAndBuild().");t._logger.debug("Retrieving URL...");var e=f.retrieveUrl({streamUrlRetriever:t._config.streamUrlRetriever,urlProviderRetryDelayCalculator:t._config.urlProviderRetryDelayCalculator,getURLOpts:t._getURLOpts,logger:t._logger});t._executionState={state:"RETRIEVING_URL",retrieveJob:e},e.onCompletion(function(e){if(t._logger.debug("Retrieved URL.",!!e),e&&e.success){t._hadAStreamUrl=!0;var r=!1,n=function(n){var i=n.excludeRendition,o=n.immediateRetry;t._handleUnexpectedError(function(){if(r)throw new Error("startOver called multiple times.");if(r=!0,i&&t._config.streamUrlRetriever.excludeRendition(e.rendition),t._executionState={state:"WAITING_TO_RETRIEVE"},t.isDead())t._logger.debug("Stopping execution because player is dead.");else if(o)t._logger.debug("Moving on immediately."),t._retrieveAndBuild();else{var n=t._retryDelayCalculator.getDelay();t._logger.debug("Will move on in "+n+"ms."),n?t._retrieveAndBuildTimer=window.setTimeout(function(){return t._retrieveAndBuild()},n):t._retrieveAndBuild()}})};t._handleUnexpectedError(function(){t._executionState={state:"CONTROLLING_PLAYER"},t._logger.debug("Building controller..."),t._controllerManager.buildNextController(e,n),t._logger.debug("Built controller.")})}else if(e&&e.rendition){if(t._logger.warn("Error retrieving URL. Moving on.",e.error),t._errorEventGenerator){var i="SCAUDIO.URL_RETRIEVER_ERROR."+t._config.streamUrlRetriever.name+"."+e.error.getCode();t._errorEventGenerator.reportManualEvent(i,{preset:e.preset,quality:e.quality,bitrate:e.bitrate,format:e.rendition.scFormat,protocol:e.rendition.scProtocol})}t._config.streamUrlRetriever.excludeRendition(e.rendition),t._executionState={state:"WAITING_TO_RETRIEVE"},t._retrieveAndBuild()}else e&&e.rendition&&t._logger.warn("Error retrieving URL for any rendition.",e.error),t._logger.info("Ran out of streams.",t._hadAStreamUrl),t._triggerError(t._hadAStreamUrl?new g.NotSupportedError:new y.NoStreamsError)}),e.onError(function(e){e!==o.helpers.abortableJob.abortedError&&(e===f.NoMoreAttemptsError?t._logger.error("Ran out of retries to retrieve URL."):t._logger.error("Unexpected error when retrieving a URL.",e),t._triggerError(new b.FailedRetrievingUrlError))})})},e.prototype._reloadStreamUrls=function(t){this._getURLOpts=t,this._updateFadeOut(),this._logger.info("Reloading stream URL's...",this._getURLOpts),"RETRIEVING_URL"===this._executionState.state?(this._logger.debug("Aborting current URL retrieve."),this._executionState.retrieveJob.abort(),this._executionState={state:"WAITING_TO_RETRIEVE"},this._retrieveAndBuild()):"CONTROLLING_PLAYER"===this._executionState.state?(this._logger.debug("Releasing controller."),this._controllerManager.releaseCurrentController({retry:!0})):this._logger.debug("Nothing to do."),this._logger.info("Reloaded stream URL's.")},e.prototype._completePauseFade=function(){if(this._pauseFadeDeferred){this._pauseFadeTimer&&window.clearTimeout(this._pauseFadeTimer);var t=this._pauseFadeDeferred;this._pauseFadeDeferred=null,t.resolve(this.pause())}},e.prototype._abortPauseFade=function(){this._pauseFadeTimer&&(window.clearTimeout(this._pauseFadeTimer),this._pauseFadeTimer=null),this._pauseFadeDeferred&&(this._pauseFadeDeferred.reject(new Error("Player was killed.")),this._pauseFadeDeferred=null)},e.prototype._updateVolume=function(){var t=this;if(this._volumeAutomationSupported){this._ensureNotDead(),this._timer&&(window.clearTimeout(this._timer),this._timer=null);var e=this.getDuration();if(null!==e){var r=this._volumeAutomators,i=this.getPosition(),o=1/0,s=1;r.forEach(function(t){var r=t.calculate(i,e),a=r.nextCalculatePosition,u=r.level;s*=n(0,1,u),a<o&&(o=a)}),this._volumeScale!==s&&(this._volumeScale=s,this._calculateAndSetVolume()),o<1/0&&this.isActuallyPlaying()&&!this.isStalled()&&(this._timer=window.setTimeout(function(){t._timer=null,t._updateVolume()},n(100,5e3,o-this.getPosition())))}}},e.prototype._calculateAndSetVolume=function(){this._volumeAutomationSupported?t.prototype._handleVolumeChange.call(this,this._userVolume*this._volumeScale,this.getMuted()):t.prototype._handleVolumeChange.call(this,this._userVolume,this.getMuted())},e.prototype._updateMaxBufferLength=function(){var t=this._getPlayer(),e=t&&t.getBufferController();e&&(this.isPlaying()?e.setMaxBufferLength(this._config.playingMaxBufferLength):e.setMaxBufferLength(this._preloadingEnabled?this._config.pausedMaxBufferLength:0))},e}(o.ProxyPlayerBase);e.Player=R},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e,r){void 0===t&&(t="UNKNOWN"),void 0===e&&(e=!1),void 0===r&&(r=null),this._code=t,this._transient=e,this._cause=r}return t.prototype.isTransient=function(){return this._transient},t.prototype.getCode=function(){return this._code},t.prototype.getCause=function(){return this._cause},t}();e.UrlRetrieverError=n},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.httpAACHQ={scProtocol:"http",scFormat:"aac",maestroFormat:{mimeType:"audio/mp4",audioCodec:{id:"mp4a.40.2"}}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.encryptedHlsOpus={scProtocol:"encrypted-hls",scFormat:"opus",maestroFormat:{mimeType:"application/x-mpegURL"},maestroSegmentFormat:{mimeType:"audio/ogg",audioCodec:{id:"opus"}}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hlsOpus={scProtocol:"hls",scFormat:"opus",maestroFormat:{mimeType:"application/x-mpegURL"},maestroSegmentFormat:{mimeType:"audio/ogg",audioCodec:{id:"opus"}}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.maestroChromecast={scProtocol:"maestro.chromecast",maestroFormat:{}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.apiMobile={scProtocol:"sc.api-mobile",maestroFormat:{}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.encryptedHlsAACHQ={scProtocol:"encrypted-hls",scFormat:"aac",maestroFormat:{mimeType:"application/x-mpegURL"},maestroSegmentFormat:{mimeType:"audio/mp4",audioCodec:{id:"mp4a.40.2"}}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hlsAACHQ={scProtocol:"hls",scFormat:"aac",maestroFormat:{mimeType:"application/x-mpegURL"},maestroSegmentFormat:{mimeType:"audio/mp4",audioCodec:{id:"mp4a.40.2"}}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.encryptedHlsMp3={scProtocol:"encrypted-hls",scFormat:"mp3",maestroFormat:{mimeType:"application/x-mpegURL"},maestroSegmentFormat:{mimeType:"audio/mpeg"}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hlsMp3={scProtocol:"hls",scFormat:"mp3",maestroFormat:{mimeType:"application/x-mpegURL"},maestroSegmentFormat:{mimeType:"audio/mpeg"}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.httpMp3={scProtocol:"http",scFormat:"mp3",maestroFormat:{mimeType:"audio/mpeg"}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(26);!function(t){t.Fade=n.Fade,t.buildFadeIn=n.buildFadeIn,t.buildFadeOut=n.buildFadeOut}(e.volumeAutomation||(e.volumeAutomation={}))},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),e.version="23.1.0",e.buildNumber=845;var i=r(98);e.volumeAutomation=i.volumeAutomation;var o=r(25);e.BaseStreamUrlRetriever=o.BaseStreamUrlRetriever,n(r(24));var s=r(13);e.renditions=s.renditions,e.allRenditions=s.allRenditions;var a=r(87);e.UrlRetrieverError=a.UrlRetrieverError;var u=r(86);e.Player=u.Player,e.setGlobalVolume=u.setGlobalVolume,e.setGlobalMuted=u.setGlobalMuted,e.getGlobalVolume=u.getGlobalVolume,e.getGlobalMuted=u.getGlobalMuted,e.setCacheSize=u.setCacheSize;var l=r(28);e.Quality=l.Quality,e.resolveQuality=l.resolveQuality,n(r(27))}])}(r(2))},function(t,e,r){window,t.exports=function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var r={};return e.m=t,e.c=r,e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:n})},e.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=97)}([function(t,e,r){"use strict";var n=r(4);t.exports=function(t){if(!n(t))throw new TypeError("Cannot use null or undefined");return t}},function(t,e,r){"use strict";t.exports=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");return t}},function(t,e,r){"use strict";t.exports=r(62)()?Symbol:r(61)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.deferException=function(t){try{t()}catch(t){window.setTimeout(function(){throw t},0)}}},function(t,e,r){"use strict";var n=r(24)();t.exports=function(t){return t!==n&&null!==t}},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=r(11),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.getCode=function(){return"PLAYER_FATAL_ERROR"},e}(i.PlayerError);e.PlayerFatalError=o},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(19),i=function(){function t(){this._listeners=[],this.dispatch=this.dispatch.bind(this)}return t.prototype.subscribe=function(t){var e=this,r={fn:t,payloads:[]};return this._listeners.push(r),{remove:function(){var t=e._listeners.indexOf(r);return t>=0&&(e._listeners.splice(t,1),!0)},retrieve:function(){return e._dispatchListenerPayloads(r)}}},t.prototype.dispatch=function(t,e){var r=this,i="number"==typeof e?{time:e}:e||{},o=void 0!==i.time?i.time:n.now(),s=this._listeners;s.forEach(function(e){return e.payloads.push({time:o,payload:t})});var a=!1;do{a=!s.some(function(t){var e=t.fn,n=t.payloads,i=n.shift();return!!i&&(r._callHandler(e,i),!0)})}while(!a)},t.prototype.getHandle=function(){return{subscribe:this.subscribe.bind(this)}},t.prototype._dispatchListenerPayloads=function(t){for(var e=t.fn,r=t.payloads;;){var n=r.shift();if(!n)break;this._callHandler(e,n)}},t.prototype._callHandler=function(t,e){try{t(e.payload,e.time)}catch(t){window.setTimeout(function(){throw t},0)}},t}();e.EventDispatcher=i},function(t,e,r){"use strict";var n=r(14),i=r(23),o=r(66),s=r(22);(t.exports=function(t,e){var r,o,a,u,l;return arguments.length<2||"string"!=typeof t?(u=e,e=t,t=null):u=arguments[2],null==t?(r=a=!0,o=!1):(r=s.call(t,"c"),o=s.call(t,"e"),a=s.call(t,"w")),l={value:e,configurable:r,enumerable:o,writable:a},u?n(i(u),l):l}).gs=function(t,e,r){var a,u,l,c;return"string"!=typeof t?(l=r,r=e,e=t,t=null):l=arguments[3],null==e?e=void 0:o(e)?null==r?r=void 0:o(r)||(l=r,r=void 0):(l=e,e=r=void 0),null==t?(a=!0,u=!1):(a=s.call(t,"c"),u=s.call(t,"e")),c={get:e,set:r,configurable:a,enumerable:u},l?n(i(l),c):c}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(95);e.Promise=n.Promise},function(t,e,r){"use strict";var n=Object.prototype.toString,i=n.call("");t.exports=function(t){return"string"==typeof t||t&&"object"==typeof t&&(t instanceof String||n.call(t)===i)||!1}},function(t,e,r){"use strict";var n=Object.prototype.toString,i=n.call(function(){return arguments}());t.exports=function(t){return n.call(t)===i}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){this._msg=t,this._cause=e}return t.prototype.getCode=function(){return"PLAYER_ERROR"},t.prototype.getMsg=function(){return this._msg},t.prototype.getCause=function(){return this._cause},t}();e.PlayerError=n},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(36),i=n.isIE();e.noOpLogger={debug:function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r]},error:function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r]},info:function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r]},warn:function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r]}},e.consoleLogger={debug:function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n;i?console.log(t,e):(n=console.debug||console.log).call.apply(n,[console,t].concat(e))},error:function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n;i?console.log(t,e):(n=console.error||console.log).call.apply(n,[console,t].concat(e))},info:function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n;i?console.log(t,e):(n=console.info||console.log).call.apply(n,[console,t].concat(e))},warn:function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n;i?console.log(t,e):(n=console.warn||console.log).call.apply(n,[console,t].concat(e))}},e.prefixLogger=function(t,e){return{debug:function(r){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];return t.debug.apply(t,["["+e+"] "+r].concat(n))},error:function(r){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];return t.error.apply(t,["["+e+"] "+r].concat(n))},info:function(r){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];return t.info.apply(t,["["+e+"] "+r].concat(n))},warn:function(r){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];return t.warn.apply(t,["["+e+"] "+r].concat(n))}}},e.cloneLogger=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return{debug:function(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];return t.forEach(function(t){return t.debug.apply(t,[e].concat(r))})},error:function(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];return t.forEach(function(t){return t.error.apply(t,[e].concat(r))})},info:function(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];return t.forEach(function(t){return t.info.apply(t,[e].concat(r))})},warn:function(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];return t.forEach(function(t){return t.warn.apply(t,[e].concat(r))})}}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(8);e.buildDeferred=function(){var t,e,r=!1;return{promise:new n.Promise(function(r,n){t=r,e=n}),resolve:function(e){r||(r=!0,t(e))},reject:function(t){r||(r=!0,e(t))},isSettled:function(){return r}}}},function(t,e,r){"use strict";t.exports=r(71)()?Object.assign:r(70)},function(t,e,r){"use strict";t.exports=r(27)()?Object.setPrototypeOf:r(26)},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=r(28),o=function(t){function e(e,r,n){return void 0===n&&(n="The player that the proxy was controlling had a fatal error."),t.call(this,e,r,n)||this}return n(e,t),e.prototype.getCode=function(){return"PROXY_PLAYER_PROVIDED_PLAYER_FATAL_ERROR"},e}(i.ProxyProvidedPlayerError);e.ProxyProvidedPlayerFatalError=o},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.find=function(t,e){var r=void 0;return t.some(function(t){return!!e(t)&&(r=t,!0)}),r}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.always=function(t,e){return t.then(e,e)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=Date.now();e.now=function(){return"performance"in window&&window.performance.now?window.performance.now():Date.now()-n}},function(t,e,r){"use strict";var n,i=r(58),o=r(14),s=r(1),a=r(0),u=r(7),l=r(57),c=r(2),p=Object.defineProperty,h=Object.defineProperties;t.exports=n=function(t,e){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");h(this,{__list__:u("w",a(t)),__context__:u("w",e),__nextIndex__:u("w",0)}),e&&(s(e.on),e.on("_add",this._onAdd),e.on("_delete",this._onDelete),e.on("_clear",this._onClear))},delete n.prototype.constructor,h(n.prototype,o({_next:u(function(){var t;if(this.__list__)return this.__redo__&&void 0!==(t=this.__redo__.shift())?t:this.__nextIndex__<this.__list__.length?this.__nextIndex__++:void this._unBind()}),next:u(function(){return this._createResult(this._next())}),_createResult:u(function(t){return void 0===t?{done:!0,value:void 0}:{done:!1,value:this._resolve(t)}}),_resolve:u(function(t){return this.__list__[t]}),_unBind:u(function(){this.__list__=null,delete this.__redo__,this.__context__&&(this.__context__.off("_add",this._onAdd),this.__context__.off("_delete",this._onDelete),this.__context__.off("_clear",this._onClear),this.__context__=null)}),toString:u(function(){return"[object "+(this[c.toStringTag]||"Object")+"]"})},l({_onAdd:u(function(t){if(!(t>=this.__nextIndex__)){if(++this.__nextIndex__,!this.__redo__)return void p(this,"__redo__",u("c",[t]));this.__redo__.forEach(function(e,r){e>=t&&(this.__redo__[r]=++e)},this),this.__redo__.push(t)}}),_onDelete:u(function(t){var e;t>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(-1!==(e=this.__redo__.indexOf(t))&&this.__redo__.splice(e,1),this.__redo__.forEach(function(e,r){e>t&&(this.__redo__[r]=--e)},this)))}),_onClear:u(function(){this.__redo__&&i.call(this.__redo__),this.__nextIndex__=0})}))),p(n.prototype,c.iterator,u(function(){return this}))},function(t,e,r){"use strict";var n=r(10),i=r(9),o=r(63),s=r(43),a=r(42),u=r(2).iterator;t.exports=function(t){return"function"==typeof a(t)[u]?t[u]():n(t)?new o(t):i(t)?new s(t):new o(t)}},function(t,e,r){"use strict";t.exports=r(65)()?String.prototype.contains:r(64)},function(t,e,r){"use strict";var n=r(4),i=Array.prototype.forEach,o=Object.create;t.exports=function(t){var e=o(null);return i.call(arguments,function(t){n(t)&&function(t,e){var r;for(r in t)e[r]=t[r]}(Object(t),e)}),e}},function(t,e,r){"use strict";t.exports=function(){}},function(t,e,r){"use strict";var n=r(4),i={function:!0,object:!0};t.exports=function(t){return n(t)&&i[typeof t]||!1}},function(t,e,r){"use strict";var n,i=r(25),o=r(0),s=Object.prototype.isPrototypeOf,a=Object.defineProperty,u={configurable:!0,enumerable:!1,writable:!0,value:void 0};n=function(t,e){if(o(t),null===e||i(e))return t;throw new TypeError("Prototype must be null or an object")},t.exports=function(t){var e,r;return t?(2===t.level?t.set?(r=t.set,e=function(t,e){return r.call(n(t,e),e),t}):e=function(t,e){return n(t,e).__proto__=e,t}:e=function t(e,r){var i;return n(e,r),(i=s.call(t.nullPolyfill,e))&&delete t.nullPolyfill.__proto__,null===r&&(r=t.nullPolyfill),e.__proto__=r,i&&a(t.nullPolyfill,"__proto__",u),e},Object.defineProperty(e,"level",{configurable:!1,enumerable:!1,writable:!1,value:t.level})):null}(function(){var t,e=Object.create(null),r={},n=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__");if(n){try{(t=n.set).call(e,r)}catch(t){}if(Object.getPrototypeOf(e)===r)return{set:t,level:2}}return e.__proto__=r,Object.getPrototypeOf(e)===r?{level:2}:((e={}).__proto__=r,Object.getPrototypeOf(e)===r&&{level:1})}()),r(74)},function(t,e,r){"use strict";var n=Object.create,i=Object.getPrototypeOf,o={};t.exports=function(){var t=Object.setPrototypeOf,e=arguments[0]||n;return"function"==typeof t&&i(t(e(null),o))===o}},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=r(11),o=function(t){function e(e,r,n){void 0===n&&(n="The player that the proxy was controlling had an error.");var i=t.call(this,n)||this;return i._providedPlayerError=e,i._providedPlayer=r,i}return n(e,t),e.prototype.getCode=function(){return"PROXY_PLAYER_PROVIDED_PLAYER_ERROR"},e.prototype.getProvidedPlayerError=function(){return this._providedPlayerError},e.prototype.getProvidedPlayer=function(){return this._providedPlayer},e}(i.PlayerError);e.ProxyProvidedPlayerError=o},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=r(5),o=function(t){function e(e,r){return t.call(this,e,r)||this}return n(e,t),e.prototype.getCode=function(){return"IMPLEMENTATION_ERROR"},e}(i.PlayerFatalError);e.ImplementationError=o},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(3),i=function(){function t(t,e){this._inCallback=!1,this._onExit=t,this._onEnter=e||null}return t.prototype.enter=function(t){var e=this;if(this._inCallback)return t?t(this._onEnterResultRetriever):void 0;this._inCallback=!0;var r=[],i=!1;this._onEnter&&(this._onEnterResultRetriever={getResult:function(t){i?n.deferException(function(){return t(e._onEnterError,e._onEnterResult)}):r.push(t)}});try{var o=t?t(this._onEnterResultRetriever):void 0;if(this._onEnter){this._onEnterError=void 0,this._onEnterResult=void 0;try{this._onEnterResult=this._onEnter()}catch(t){this._onEnterError=t}i=!0,r.forEach(function(t){return n.deferException(function(){return t(e._onEnterError,e._onEnterResult)})})}return o}finally{this._inCallback=!1,n.deferException(function(){return e._onExit(e._onEnterError,e._onEnterResult)})}},t}();e.OnExit=i},function(t,e,r){"use strict";function n(t){var e=Object.create(null);return Object.keys(t).forEach(function(r){e[r]=t[r]}),e}Object.defineProperty(e,"__esModule",{value:!0});var i=r(30),o=r(3),s=function(){},a=function(){function t(t,e){void 0===e&&(e={});var r=this;this._subscribers=[],this._onExit=new i.OnExit(function(){return r._after()},function(){return r._onEnter()}),this._beforeUpdateError=void 0,this._inAfterUpdate=!1,this._dead=!1,this._officiallyDead=!1,this._errors=[],this._state=n(t),this._initialState=n(t),this._beforeUpdate=e.beforeUpdate||function(){},this._afterUpdate=e.afterUpdate||s,this._afterDispatches=e.afterDispatches||s}return t.prototype.subscribe=function(t,e){var r=this;if(void 0===e&&(e=!0),this._dead){var i=!1;return{retrieve:function(){},remove:function(){return!i&&(i=!0)}}}var o={callback:t,localState:e?n(this._state):this._initialState};return this._subscribers.push(o),e||this._updateSubscriber(o),{remove:function(){var e=r._subscribers.map(function(t){return t.callback}).indexOf(t);return e>=0&&(r._subscribers.splice(e,1),!0)},retrieve:function(){r._updateSubscriber(o)}}},t.prototype.subscribeIndividual=function(t,e,r){return this.subscribe(function(r){var n=r[t];void 0!==n&&e(n)},r)},t.prototype.getHandle=function(){return{subscribe:this.subscribe.bind(this)}},t.prototype.getIndividualHandle=function(t){var e=this;return{subscribe:function(r){return e.subscribeIndividual(t,r)}}},t.prototype.update=function(t){var e=this;this._officiallyDead||(this._inAfterUpdate?t&&t(this._state,this._beforeUpdateError):this._onExit.enter(function(r){r.getResult(function(){try{t&&t(e._state,e._beforeUpdateError)}catch(t){e._errors.push(t)}})}))},t.prototype.getState=function(){return this._state},t.prototype.kill=function(){var t=this;this._dead||(this._dead=!0,window.setTimeout(function(){t._subscribers.splice(0),t._officiallyDead=!0},0))},t.prototype.isDead=function(){return this._dead},t.prototype._onEnter=function(){this._beforeUpdateError=void 0;try{this._beforeUpdate(this._state)}catch(t){this._beforeUpdateError=t}},t.prototype._after=function(){var t=this,e=this._errors;this._errors=[],o.deferException(function(){t._inAfterUpdate=!0;try{t._afterUpdate(t._state,{beforeUpdate:t._beforeUpdateError,update:e})}catch(e){throw t._inAfterUpdate=!1,e}t._inAfterUpdate=!1,t._subscribers.slice().forEach(function(e){return t._updateSubscriber(e)}),t._afterDispatches(t._state)})},t.prototype._updateSubscriber=function(t){var e=this._calculateDiff(t.localState);Object.keys(e).length&&(t.localState=n(this._state),o.deferException(function(){return t.callback(e,t.localState)}))},t.prototype._calculateDiff=function(t){var e=this,r=Object.create(null);return Object.keys(this._state).forEach(function(n){var i=e._state[n];i!==t[n]&&(r[n]=i)}),r},t}();e.StateManager=a},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.LOADING=0]="LOADING",t[t.PLAYING=1]="PLAYING",t[t.PAUSED=2]="PAUSED",t[t.DEAD=3]="DEAD"}(e.State||(e.State={}))},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=r(5),o=function(t){function e(e){return t.call(this,e||"The player cannot play the provided descriptor.")||this}return n(e,t),e.prototype.getCode=function(){return"NOT_SUPPORTED_ERROR"},e}(i.PlayerFatalError);e.NotSupportedError=o},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(5),i=r(33),o=r(6),s=r(13),a=r(17),u=r(19),l=r(8),c=r(32),p=r(12),h=r(31),d=r(29),f=r(3),g="undefined"!=typeof navigator&&"mediaSession"in navigator,y=150,_=25,v=35,m=1e3,b=g?navigator.mediaSession:null,w=function(){function t(t){var e=this;this._stateManager=new h.StateManager({ended:!1,loading:!1,playing:!1,actuallyPlaying:!1,volume:1,muted:!1,isFading:!1,fadeRate:null,isFadingForSeek:!1,playDeferred:null,pauseDeferred:null,ready:!1,seeking:!1,seek:null,positionJumped:null,stalled:!0,duration:null,dead:!1,state:c.State.PAUSED,fatalError:null,errorOccurred:null,position:0},{afterUpdate:function(t,r){return e._afterUpdate(t,r)},afterDispatches:function(){return e._afterDispatches()},beforeUpdate:function(t){if(!t.dead&&(t.ready||!e._fatalErrorTriggered)){var r=e._getPosition(),n=t.duration;if(r<0)throw e._logger.error("Player provided invalid position.",r,n),e._triggerError(new d.ImplementationError("Player provided a position that was invalid.")),new Error("Player provided invalid position.");t.position=r,e._updateEndedInState(t)}}}),this._onError=new o.EventDispatcher,this._errors=[],this._fatalErrorTriggered=!1,this._loadingDelayTimer=null,this._stalled=!1,this._queuedDuration=null,this._readyDeferred=s.buildDeferred(),this._queuedSeekDeferreds=[],this._lastPlayError=null,this._lastPauseError=null,this._lastPlayedPosition=null,this._listenTimeBase=0,this._timePlaybackStarted=null,this._positionAfterLastUpdate=0,this._positionWhenStartedFadeOut=null,this._fadeStartAllowed=!1,this._seekFadeStartAllowed=!1,this._implementationIsFading=!1;var r=t.name;if(this._logger=p.prefixLogger(t.logger,"BasePlayer"+(r?"-"+r:"")),this._mediaSessionEnabled=!!t.mediaSessionEnabled,t.defaultFadeDuration&&t.defaultFadeDuration<0)throw new Error("defaultFadeDuration must be >= 0.");if(t.loadingDelay&&t.loadingDelay<0)throw new Error("loadingDelay must be >= 0.");this._defaultFadeDuration=void 0!==t.defaultFadeDuration?t.defaultFadeDuration:y,this._defaultSeekFadeOutDuration=void 0!==t.defaultSeekFadeOutDuration?t.defaultSeekFadeOutDuration:_,this._defaultSeekFadeInDuration=void 0!==t.defaultSeekFadeInDuration?t.defaultSeekFadeInDuration:v,this._loadingDelay=void 0!==t.loadingDelay?t.loadingDelay:m,this.onError=this._onError.getHandle(),this.whenReady=this._readyDeferred.promise,this._stateManager.subscribe(function(t,r){return e._onChange(t,r)}),this._stateManager.subscribe(function(t){var r=t.actuallyPlaying,n=t.seek;!0===r&&(e._fadeStartAllowed=!1),n&&"IN_PROGRESS"!==n.state&&(e._seekFadeStartAllowed=!1)}),this._stateManager.subscribe(function(t,r){var n=t.isFading,i=r.dead;!i&&!1===n&&e._implementationIsFading&&e._triggerError(new d.ImplementationError("Fade was still running when not allowed."))}),this._stateManager.subscribe(function(t,r){var n=t.playing,i=r.dead,o=r.fadeRate;if(!i&&void 0!==n)try{e._handlePlayPauseChange(n,{fadeRate:o||void 0}),n||(e._fadeStartAllowed=!1)}catch(t){e._triggerError(new d.ImplementationError("Exception occurred whilst handling play/pause change.",t))}}),this._stateManager.subscribe(function(t,r){var n=t.seek,i=r.dead;if(!i&&n&&"IN_PROGRESS"===n.state)try{e._seekFadeStartAllowed=!0,e._handleSeekChange(n.position,{fadeRate:{beforeSeek:n.fadeRate.beforeSeek||void 0,afterSeek:n.fadeRate.afterSeek||void 0}}),e._seekFadeStartAllowed=!1}catch(t){e._triggerError(new d.ImplementationError("Exception occurred whilst handling seek change.",t))}}),this.onChange=this._buildEventHandle(function(t,r){var n=r.ready;if(void 0!==n&&!0!==n)throw new Error("Ready state is invalid.");var i=r.duration;if(void 0!==i&&null===i)throw new Error("Duration state is invalid.");var o=r.dead;if(void 0!==o&&!0!==o)throw new Error("Dead state is invalid.");var s={ready:n,ended:r.ended,duration:i,volume:r.volume,muted:r.muted,playing:r.playing,actuallyPlaying:r.actuallyPlaying,stalled:r.stalled,loading:r.loading,fading:r.isFading,fadingForSeek:r.isFadingForSeek,playRejection:!1===r.playing&&e._lastPlayError||void 0,pauseRejection:!0===r.playing&&e._lastPauseError||void 0,seeking:r.seeking,seek:r.seek||void 0,positionJumped:void 0!==r.positionJumped||void 0,state:r.state,fatalError:r.fatalError||void 0,dead:o};Object.keys(s).some(function(t){return void 0!==s[t]})&&t(s)});var n=t.registerListeners;n&&f.deferException(function(){n({onChange:e.onChange,onError:e.onError})}),this._registerMediaSessionActionHandlers(),this._notifyMediaSessionPaused(),this.onDurationChange=this._buildEventHandle(function(t,e){var r=e.duration;void 0!==r&&null!==r&&t(r)}),this.onReady=this._buildEventHandle(function(t,e){var r=e.ready;!0===r&&t(void 0)}),this.onStateChange=this._buildEventHandle(function(t,e){var r=e.state;void 0!==r&&t(r)}),this.onVolumeChange=this._buildEventHandle(function(t,e,r){var n=e.volume,i=e.muted,o=r.volume,s=r.muted;void 0===n&&void 0===i||t({volume:o,muted:s})}),this.onPlay=this._buildEventHandle(function(t,e){var r=e.actuallyPlaying;!0===r&&t(void 0)}),this.onPlayIntent=this._buildEventHandle(function(t,e){var r=e.playing;!0===r&&t(void 0)}),this.onPlayRejection=this._buildEventHandle(function(t,r){var n=r.playing;!1===n&&e._lastPlayError&&t(e._lastPlayError)}),this.onPause=this._buildEventHandle(function(t,e){var r=e.actuallyPlaying;!1===r&&t(void 0)}),this.onPauseIntent=this._buildEventHandle(function(t,e){var r=e.playing;!1===r&&t(void 0)}),this.onPauseRejection=this._buildEventHandle(function(t,r){var n=r.playing;!0===n&&e._lastPauseError&&t(e._lastPauseError)}),this.onSeek=this._buildEventHandle(function(t,e){var r=e.seek;r&&"COMPLETED"===r.state&&t(void 0)}),this.onSeekIntent=this._buildEventHandle(function(t,e){var r=e.seeking;!0===r&&t(void 0)}),this.onSeekRejection=this._buildEventHandle(function(t,e){var r=e.seek;r&&"ERROR"===r.state&&t(r.error)}),this.onPositionJumped=this._buildEventHandle(function(t,e){var r=e.positionJumped;void 0!==r&&t(void 0)}),this.onEnded=this._buildEventHandle(function(t,e){var r=e.ended;!0===r&&t(void 0)}),this.onLeftEnded=this._buildEventHandle(function(t,e){var r=e.ended;!1===r&&t(void 0)}),this.onStallStart=this._buildEventHandle(function(t,e){var r=e.stalled;!0===r&&t(void 0)}),this.onStallEnd=this._buildEventHandle(function(t,e){var r=e.stalled;!1===r&&t(void 0)}),this.onLoadStart=this._buildEventHandle(function(t,e){var r=e.loading;!0===r&&t(void 0)}),this.onLoadEnd=this._buildEventHandle(function(t,e){var r=e.loading;!1===r&&t(void 0)}),this.onFadeStart=this._buildEventHandle(function(t,e){var r=e.isFading;!0===r&&t(void 0)}),this.onFadeEnd=this._buildEventHandle(function(t,e){var r=e.isFading;!1===r&&t(void 0)}),this.onFadeForSeekStart=this._buildEventHandle(function(t,e){var r=e.isFadingForSeek;!0===r&&t(void 0)}),this.onFadeForSeekEnd=this._buildEventHandle(function(t,e){var r=e.isFadingForSeek;!1===r&&t(void 0)})}return t.prototype.isReady=function(){return this._stateManager.getState().ready},t.prototype.getPosition=function(){return this._getPositionOrPositionSeekingTo()},t.prototype.getLastPlayedPosition=function(){var t=this._stateManager.getState(),e=t.actuallyPlaying,r=t.stalled;return e&&!r?this.getPosition():this._lastPlayedPosition},t.prototype.getListenTime=function(){var t=this._stateManager.getState(),e=t.actuallyPlaying,r=t.ended,n=this._listenTimeBase;return e&&!r&&(n+=u.now()-this._timePlaybackStarted),n},t.prototype.isStalled=function(){return this._stateManager.getState().stalled},t.prototype.isLoading=function(){return this._stateManager.getState().loading},t.prototype.isFading=function(){return this._stateManager.getState().isFading},t.prototype.isFadingForSeek=function(){return this._stateManager.getState().isFadingForSeek},t.prototype.isPlaying=function(){return this._stateManager.getState().playing},t.prototype.isActuallyPlaying=function(){return this._stateManager.getState().actuallyPlaying},t.prototype.isEnded=function(){return this._stateManager.getState().ended},t.prototype.getState=function(){return this._stateManager.getState().state},t.prototype.getBufferController=function(){return null},t.prototype.getMemoryCacheMaxSize=function(){return null},t.prototype.getMemoryCacheUsage=function(){return null},t.prototype.getMemoryCacheController=function(){return null},t.prototype.getFatalError=function(){return this._stateManager.getState().fatalError},t.prototype.isDead=function(){return this._stateManager.getState().dead},t.prototype.getVolume=function(){return this._stateManager.getState().volume},t.prototype.getMuted=function(){return this._stateManager.getState().muted},t.prototype.getDuration=function(){var t=this._stateManager.getState(),e=t.ready,r=t.duration;return e?r:null},t.prototype.setVolume=function(t,e){if(t<0||t>1)throw new Error("Volume must be >= 0 and <= 1.");if(!this._stateManager.getState().dead){var r=this._stateManager.getState().muted;void 0===e&&(e=r);try{this._handleVolumeChange(t,e)}catch(t){throw this._triggerError(new d.ImplementationError("Exception occurred updating volume.",t)),t}}},t.prototype.setMuted=function(t){this.setVolume(this._stateManager.getState().volume,t)},t.prototype.getCurrentBufferedTimeRange=function(){var t=this.getBufferedTimeRanges();if(!t)return null;var e=this.getPosition();return a.find(t,function(t){return t.containsTime(e)})||null},t.prototype.play=function(t){var e=this;this._ensureNotDead(),this._logger.debug("play() called.",t);var r=s.buildDeferred();try{return this._stateManager.update(function(n){if(n.playing)e._logger.debug("Intent is already to be playing.");else{e._logger.debug("Requesting play."),n.playing=!0;var i=e._extractFadeDuration(t);n.fadeRate=i?1/i:null,e._lastPlayError=null}n.playDeferred&&!n.playDeferred.isSettled()||(n.playDeferred=s.buildDeferred()),r.resolve(n.playDeferred.promise)}),r.promise}catch(t){return this._triggerError(new n.PlayerFatalError("Unexpected error when attempting to play.",t)),l.Promise.reject(t)}},t.prototype.pause=function(t){var e=this;this._ensureNotDead(),this._logger.debug("pause() called.",t);var r=s.buildDeferred();try{return this._stateManager.update(function(n){if(n.playing){e._logger.debug("Requesting pause."),e._positionWhenStartedFadeOut=e._getPositionOrPositionSeekingTo(),n.playing=!1;var i=e._extractFadeDuration(t);n.fadeRate=i?1/i*-1:null,e._fadeStartAllowed=!0,e._lastPauseError=null}else e._logger.debug("Intent is already to be paused.");n.pauseDeferred&&!n.pauseDeferred.isSettled()||(n.pauseDeferred=s.buildDeferred()),r.resolve(n.pauseDeferred.promise)}),r.promise}catch(t){return this._triggerError(new n.PlayerFatalError("Unexpected error when attempting to pause.",t)),l.Promise.reject(t)}},t.prototype.seek=function(t,e){var r=this;this._ensureNotDead(),this._logger.debug("seek() called.",t);var n=s.buildDeferred();return this._stateManager.update(function(i){if(t<0)r._logger.warn("Rejecting seek immediately as the position was negative."),n.reject(new Error("You were attempting to seek to a negative time."));else if(null!==i.duration&&t>i.duration)r._logger.warn("Rejecting seek immediately as the duration is now known, and the requested positon was past it."),n.reject(new Error("You were attempting to seek past the end of the media."));else{i.stalled||!i.actuallyPlaying||i.seek&&"IN_PROGRESS"===i.seek.state||(r._lastPlayedPosition=r._getPositionOrPositionSeekingTo());var o=s.buildDeferred();if(i.seek&&"IN_PROGRESS"===i.seek.state&&i.seek.position===t)r._logger.debug("Seek already requested to the same position.",t);else{r._logger.debug("Requesting seek.",t),i.seeking=!0,r._positionWhenStartedFadeOut=null;var a=r._extractSeekFadeDurations(e,t),u=a.fadeOutDuration?1/a.fadeOutDuration*-1:null,l=a.fadeInDuration?1/a.fadeInDuration:null;i.seek={state:"IN_PROGRESS",position:t,fadeRate:{beforeSeek:u,afterSeek:l}},i.positionJumped=Object.create(null)}r._queuedSeekDeferreds.push({position:t,deferred:o}),n.resolve(o.promise)}}),n.promise},t.prototype.getSeekState=function(){return this._stateManager.getState().seek},t.prototype.kill=function(){var t=this;this._stateManager.update(function(e){e.dead||(t._logger.debug("kill() called."),e.dead=!0)})},t.prototype._update=function(t){this._stateManager.update(function(){return t&&t()})},t.prototype._ensureNotDead=function(){if(this._stateManager.getState().dead)throw new Error("Player is dead.")},t.prototype._notifyStalled=function(t){this._ensureNotDead(),this._stalled!==t&&(this._logger.debug("notifyStalled() called.",t),this._stalled=t,this._stateManager.update())},t.prototype._getQueuedSeekPosition=function(){var t=this.getSeekState();return t&&"IN_PROGRESS"===t.state?t.position:null},t.prototype._provideDuration=function(t){var e=this;this._ensureNotDead(),this._stateManager.update(function(r){if(r.duration!==t){var n=e._getPositionOrPositionSeekingTo();if(t<0||r.ready&&n>t)throw e._triggerError(new d.ImplementationError("Attempt to update duration to an invalid value.")),new Error("Duration cannot be less than the current position.");e._logger.debug("provideDuration() called.",t),r.ready?r.duration=t:e._queuedDuration=t}})},t.prototype._notifyVolumeChange=function(t,e){if(t<0||t>1)throw this._triggerError(new d.ImplementationError("Volume was out of range.",t)),new Error("Volume was out of range.");this._stateManager.update(function(r){r.volume=t,r.muted=e})},t.prototype._notifyPlaying=function(t){var e=this;this._ensureNotDead(),this._stateManager.update(function(r){if(!r.ready)throw e._triggerError(new d.ImplementationError("Attempt to register playback as started before ready.")),new Error("Player must be ready first.");t!==r.actuallyPlaying&&(e._logger.debug("notifyPlaying() called.",t),t||r.seeking||r.stalled||(e._lastPlayedPosition=e._getPositionOrPositionSeekingTo()),r.actuallyPlaying=r.playing=t,t?(e._lastPlayError=null,e._fadeStartAllowed=!0):(r.isFading=!1,e._fadeStartAllowed=!1,e._lastPauseError=null))})},t.prototype._notifyPlayRejection=function(t){var e=this;this._ensureNotDead(),t=t||new Error("Unknown error."),this._stateManager.update(function(r){if(!r.ready)throw e._triggerError(new d.ImplementationError("Attempt to reject a play request before player ready.")),new Error("Player must be ready first.");if(r.actuallyPlaying||!r.playing)throw e._triggerError(new d.ImplementationError("Attempt to reject a play request when not valid.")),new Error("Playing state is incorrect.");e._logger.debug("notifyPlayRejection() called.",t),r.playing=!1,e._lastPlayError=t})},t.prototype._notifyPauseRejection=function(t){var e=this;this._ensureNotDead(),t=t||new Error("Unknown error."),this._stateManager.update(function(r){if(!r.ready)throw e._triggerError(new d.ImplementationError("Attempt to reject pause request before player ready.")),new Error("Player must be ready first.");if(!r.actuallyPlaying||r.playing)throw e._triggerError(new d.ImplementationError("Attempt to reject pause request when not valid.")),new Error("Playing state is incorrect.");e._logger.debug("notifyPauseRejection() called.",t),r.playing=!0,r.fadeRate&&(r.fadeRate*=-1),e._lastPauseError=t})},t.prototype._notifySeekRejection=function(t){var e=this;this._ensureNotDead(),t=t||new Error("Unknown error."),this._stateManager.update(function(r){if(!r.ready)throw e._triggerError(new d.ImplementationError("Attempt to reject seek request before player ready.")),new Error("Player must be ready first.");if(!r.seek||"IN_PROGRESS"!==r.seek.state)throw e._triggerError(new d.ImplementationError("Attempt to reject seek request when none requested.")),new Error("A seek hasn't been requested.");if(null!==r.duration&&r.position>r.duration)throw e._triggerError(new d.ImplementationError("Attempt to reject seek request after duration changed below current position.")),new Error("Attempt to reject seek request after duration changed below current position.");e._logger.debug("notifySeekRejection() called.",t),r.seeking=!1,r.seek={state:"ERROR",error:t},r.positionJumped=Object.create(null)})},t.prototype._notifyFading=function(t){var e=this;if(this._ensureNotDead(),t&&!this._fadeStartAllowed){var r="Attempt to register fade as starting when not allowed.";throw this._triggerError(new d.ImplementationError(r)),new Error(r)}this._implementationIsFading=t,this._stateManager.update(function(r){r.isFading!==t&&(e._logger.debug("notifyFading() called",t),t||r.playing||null===e._positionWhenStartedFadeOut||e.seek(e._positionWhenStartedFadeOut,{fadeInDuration:0,fadeOutDuration:0}).catch(function(t){e._logger.warn("Seek back to position where fade out started failed.",t)}),r.isFading=t)})},t.prototype._notifyFadingForSeek=function(t){var e=this;if(this._ensureNotDead(),t&&!this._seekFadeStartAllowed){var r="Attempt to register fade as starting for seek when not allowed.";throw this._triggerError(new d.ImplementationError(r)),new Error(r)}this._stateManager.update(function(r){r.isFadingForSeek!==t&&(e._logger.debug("notifyFadingForSeek() called",t),r.isFadingForSeek=t)})},t.prototype._signalReady=function(){var t=this;this._ensureNotDead(),this._stateManager.update(function(e){if(e.ready)throw t._triggerError(new d.ImplementationError("Attempt to signal ready twice.")),new Error("Ready already signalled.");if(null===t._queuedDuration)throw t._triggerError(new d.ImplementationError("Attempt to signal ready when duration unknown.")),new Error("Duration is still unknown.");t._logger.debug("signalReady() called."),e.ready=!0,e.duration=t._queuedDuration,e.seek&&"IN_PROGRESS"===e.seek.state&&e.seek.position>e.duration&&(e.seeking=!1,e.seek={state:"ERROR",error:new Error("You were attempting to seek past the end of the media.")})})},t.prototype._signalSeekComplete=function(){var t=this;this._ensureNotDead(),this._stateManager.update(function(e){if(!e.ready)throw t._triggerError(new d.ImplementationError("Attempt to signal seek as complete before player ready.")),new Error("Player must be ready first.");if(!e.seek||"IN_PROGRESS"!==e.seek.state)throw t._triggerError(new d.ImplementationError("Attempt to signal seek as complete when none requested.")),new Error("There shouldn't be a seek in progress.");var r=e.duration;if(e.seek&&"IN_PROGRESS"===e.seek.state&&e.seek.position>r)throw new Error("Seek cannot have completed given it was to a time greater than the duration.");t._logger.debug("signalSeekComplete() called."),t._seekFadeStartAllowed=!0,e.seek={state:"COMPLETED",position:e.seek.position,fadeRate:e.seek.fadeRate},e.seeking=!1,e.position=e.seek.position})},t.prototype._triggerError=function(t){var e=this;t instanceof n.PlayerFatalError&&(this._fatalErrorTriggered=!0),this._stateManager.update(function(r){var o=!1;if(r.ready&&t instanceof i.NotSupportedError&&(t=new d.ImplementationError("Invalid NotSupportedError."),o=!0),t instanceof n.PlayerFatalError?(t instanceof i.NotSupportedError?e._logger.info("NotSupportedError occurred.",t):e._logger.error("Fatal error occurred.",t),r.fatalError?e._logger.warn("A fatal error already occurred.",r.fatalError):r.fatalError=t,e._errors.push(t),r.errorOccurred=Object.create(null),r.dead=!0):(e._logger.warn("Non-fatal error occurred.",t),e._errors.push(t),r.errorOccurred=Object.create(null)),o)throw new Error("Not supported errors are only valid before the player is ready.")})},t.prototype._buildEventHandle=function(t){var e=this;return{subscribe:function(r){var n=function(t){return r(t,u.now())};return e._stateManager.subscribe(function(e,r){t(n,e,r)})}}},t.prototype._finalizeState=function(t){this._updateEndedInState(t);var e=this._getPositionOrPositionSeekingTo();if(t.dead)this._lastPlayError=new Error("Player was killed."),t.loading=!1,this._clearLoadingDelay(),!t.playing&&t.isFading&&null!==this._positionWhenStartedFadeOut&&(this._logger.debug("Fade out was in progress. Pretending it completed."),t.isFading=!1,t.position=this._positionWhenStartedFadeOut),t.stalled=!0,t.actuallyPlaying=!1,t.isFadingForSeek=!1,t.playing=!1,t.state=c.State.DEAD;else{var r=!t.ended&&(!t.ready||this._stalled||!(!t.seek||"IN_PROGRESS"!==t.seek.state));r&&!t.stalled&&!t.seeking&&t.actuallyPlaying&&(this._lastPlayedPosition=e),t.stalled=r;var n=!t.ended&&!t.isFading&&!t.isFadingForSeek&&(t.playing||t.actuallyPlaying)&&(t.stalled||t.playing!==t.actuallyPlaying);n?this._loadingDelay?this._scheduleLoadingDelay():t.loading=!0:(t.loading=!1,this._clearLoadingDelay()),this._positionAfterLastUpdate!==e&&(this._positionAfterLastUpdate=e,t.playing||t.actuallyPlaying||(t.positionJumped=Object.create(null))),t.state=this._calculateState(t)}},t.prototype._updateEndedInState=function(t){t.ended=t.ready&&this._getPositionOrPositionSeekingTo()===t.duration},t.prototype._scheduleLoadingDelay=function(){var t=this;this._loadingDelayTimer||(this._loadingDelayTimer=window.setTimeout(function(){t._stateManager.update(function(t){return t.loading=!0})},this._loadingDelay))},t.prototype._clearLoadingDelay=function(){this._loadingDelayTimer&&(window.clearTimeout(this._loadingDelayTimer),this._loadingDelayTimer=null)},t.prototype._getPositionOrPositionSeekingTo=function(){this._stateManager.update();var t=this._stateManager.getState();return t.seek&&"IN_PROGRESS"===t.seek.state?t.seek.position:t.isFading&&!t.playing&&null!==this._positionWhenStartedFadeOut?this._positionWhenStartedFadeOut:t.ready&&null!==t.duration?t.position:0},t.prototype._calculateState=function(t){var e=t.dead,r=t.loading,n=t.playing,i=t.ended;return e?c.State.DEAD:r?c.State.LOADING:n&&!i?c.State.PLAYING:c.State.PAUSED},t.prototype._registerMediaSessionActionHandlers=function(){var t=this;this._mediaSessionEnabled&&b&&(b.setActionHandler("play",function(){t.isDead()||t.play()}),b.setActionHandler("pause",function(){t.isDead()||t.pause()}),b.setActionHandler("seekbackward",function(){t.isDead()||t.seek(Math.max(0,t.getPosition()-5e3))}),b.setActionHandler("seekforward",function(){t.isDead()||t.seek(Math.min(t.getDuration()||0,t.getPosition()+5e3))}))},t.prototype._notifyMediaSessionPlaying=function(){this._mediaSessionEnabled&&b&&(b.playbackState="playing")},t.prototype._notifyMediaSessionPaused=function(){this._mediaSessionEnabled&&b&&(b.playbackState="paused")},t.prototype._extractFadeDuration=function(t){return void 0===t&&(t={}),void 0===t.fadeDuration?!this._stateManager.getState().playing||this._getPositionOrPositionSeekingTo()>0?this._defaultFadeDuration:0:t.fadeDuration>0?t.fadeDuration:0},t.prototype._extractSeekFadeDurations=function(t,e){var r,n;return void 0===t&&(t={}),r=void 0!==t.fadeOutDuration?t.fadeOutDuration>0?t.fadeOutDuration:0:this._defaultSeekFadeOutDuration,n=void 0!==t.fadeInDuration?t.fadeInDuration>0?t.fadeInDuration:0:e>0?this._defaultSeekFadeInDuration:0,{fadeOutDuration:r,fadeInDuration:n}},t.prototype._afterUpdate=function(t,e){if(e.beforeUpdate||e.update.length>0)this._logger.error("Errors occurred during state update. Killing player.",e),this._triggerError(new n.PlayerFatalError("Errors occurred during state update.",e));else if(!t.dead&&t.ready){var r=t.duration;null!==r&&!t.seeking&&t.position>r&&(this._logger.error("Player provided invalid position.",t.position,r),this._triggerError(new d.ImplementationError("Player provided a position that was invalid.")))}this._finalizeState(t)},t.prototype._afterDispatches=function(){var t=this,e=this._errors;this._errors=[],e.forEach(function(e){return t._onError.dispatch(e)})},t.prototype._onChange=function(t,e){var r=this,n=t.ready,i=t.dead,o=t.fatalError,s=t.playing,a=t.actuallyPlaying,l=t.ended;if(!0===n&&(this._logger.debug("Resolving ready deferred."),this._readyDeferred.resolve(void 0)),!0===a&&this._registerMediaSessionActionHandlers(),!0===s?this._notifyMediaSessionPlaying():!1===s&&this._notifyMediaSessionPaused(),e.pauseDeferred&&!e.pauseDeferred.isSettled()&&e.playing){var c=this._lastPauseError||new Error("Pause request aborted.");this._logger.debug("Rejecting pause deferred.",c),e.pauseDeferred.reject(c)}if(e.playDeferred&&!e.playDeferred.isSettled()&&!e.playing){var c=this._lastPlayError||new Error("Play request aborted.");this._logger.debug("Rejecting play deferred.",c),e.playDeferred.reject(c)}if(e.playDeferred&&!e.playDeferred.isSettled()&&e.actuallyPlaying&&(this._logger.debug("Resolving play deferred."),e.playDeferred.resolve(void 0)),!e.pauseDeferred||e.pauseDeferred.isSettled()||e.actuallyPlaying||(this._logger.debug("Resolving pause deferred."),e.pauseDeferred.resolve(void 0)),!0===a&&!e.ended||!1===l&&e.actuallyPlaying?this._timePlaybackStarted=u.now():(!1===a&&!e.ended||!0===l&&e.actuallyPlaying)&&(this._listenTimeBase+=u.now()-this._timePlaybackStarted,this._timePlaybackStarted=null),this._queuedSeekDeferreds=this._queuedSeekDeferreds.filter(function(t){var n=t.position,i=t.deferred;if(e.seek)if("IN_PROGRESS"!==e.seek.state){if(!e.stalled||"ERROR"===e.seek.state)return"ERROR"!==e.seek.state?(r._logger.debug("Resolving seek()."),i.resolve(void 0)):(r._logger.debug("Rejecting seek().",e.seek.error),i.reject(e.seek.error)),!1}else if("IN_PROGRESS"!==e.seek.state||e.seek.position!==n)return r._logger.debug("Rejecting seek() because another seek was requested.",n),i.reject(new Error("Seek request aborted because another seek was requested to a different position.")),!1;return!0}),!0===i){this._logger.debug("Calling _kill() on player.");try{this._kill(),this._logger.info("Player killed.")}catch(t){this._triggerError(new d.ImplementationError("Exception occurred in _kill().",t)),this._logger.error("Exception when implementation was being killed.",t)}if(!e.ready){var c=o||new Error("Player was killed.");this._logger.debug("Rejecting whenReady."),this._readyDeferred.reject(c)}this._queuedSeekDeferreds.forEach(function(t){var e=t.position,n=t.deferred,i=o||new Error("Seek aborted as player killed.");r._logger.debug("Rejecting seek().",e),n.reject(i)}),this._stateManager.kill(),this._logger.debug("Player dead.")}},t}();e.BasePlayer=w},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),i=this&&this.__assign||Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t};Object.defineProperty(e,"__esModule",{value:!0});var o=r(34),s=r(11),a=r(5),u=r(12),l=r(6),c=r(28),p=r(16),h=function(t){function e(e){var r=t.call(this,e)||this;return r._onProvidedPlayerError=new l.EventDispatcher,r._errorHandler=null,r._changeHandler=null,r._player=null,r._instanceLock=null,r._playConfig=void 0,r._pauseConfig=void 0,r._seekConfig=void 0,r._lastPlayerPosition=0,r._synced=!1,r._unsyncInProgress=!1,r._logger=u.prefixLogger(r._logger,"ProxyPlayerBase"),r.onProvidedPlayerError=r._onProvidedPlayerError.getHandle(),r}return n(e,t),e.prototype.play=function(e){return this._playConfig=e,t.prototype.play.call(this)},e.prototype.pause=function(e){return this._pauseConfig=e,t.prototype.pause.call(this)},e.prototype.seek=function(e,r){return this._seekConfig=r,t.prototype.seek.call(this,e)},e.prototype.getBufferedTimeRanges=function(){return this._player&&this._synced?this._player.getBufferedTimeRanges():null},e.prototype.getCurrentBufferedTimeRange=function(){return this._player&&this._synced?this._player.getCurrentBufferedTimeRange():null},e.prototype.getMaxBufferLength=function(){return this._player&&this._synced?this._player.getMaxBufferLength():null},e.prototype._providePlayer=function(t,e){if(void 0===e&&(e={}),e=i({syncPosition:!0,syncVolume:!0},e),this._ensureNotDead(),this._player)throw new Error("A player has already been provided.");this._logger.debug("providePlayer() called."),this._instanceLock=Object.create(null),this._player=t,this._sync(e)},e.prototype._removePlayer=function(){var t=this;if(this._ensureNotDead(),!this._player)throw new Error("There is no player to remove.");if(this._unsyncInProgress)throw new Error("Player is currently unsyncing.");this._logger.debug("removePlayer() called."),this._instanceLock=null,this._unsync(),this._player=null,this.isReady()&&!this.isDead()&&this._update(function(){var e=null!==t._getQueuedSeekPosition();t._notifyFading(!1),e||null===t._getQueuedSeekPosition()||t._signalSeekComplete(),t._notifyFadingForSeek(!1),t._notifyStalled(!0)})},e.prototype._setInitialDuration=function(t){var e=this;if(this._ensureNotDead(),t<0)throw new Error("Cannot set duration to a value < 0.");null===this.getDuration()&&this._update(function(){e._ensureBelowPosition(t),e._provideDuration(t),e.isReady()||(e._signalReady(),e._handleSkippedSeek())})},e.prototype._triggerError=function(e){t.prototype._triggerError.call(this,e)},e.prototype._getPlayer=function(){return this.isDead()?null:this._player},e.prototype._handleVolumeChange=function(t,e){this._synced&&this._player?this._player.setVolume(t,e):this._notifyVolumeChange(t,e)},e.prototype._handlePlayPauseChange=function(t){var e=this,r=this._player;r&&this._update(function(){t?e._playAndHandleAbort(r):(e._pauseAndHandleAbort(r),r.isFading()&&e._notifyFading(!0))})},e.prototype._handleSeekChange=function(t){var e=this._player;if(e&&this._synced){var r=this._seekConfig;this._seekConfig=void 0,e.seek(t,r),e.isFadingForSeek()&&this._notifyFadingForSeek(!0)}},e.prototype._getPosition=function(){if(this._player&&this._synced){if(!this._changeHandler)throw new Error("Handler should exist.");if(this._changeHandler.retrieve(),this._synced)return this._player.getPosition()}return this._lastPlayerPosition},e.prototype._kill=function(){this._player&&(this._unsync(),this._player.kill()),this._player=null},e.prototype._handleSkippedSeek=function(){if(this._player&&this._synced){var t=this.getSeekState(),e=this._player.getSeekState();!t||"IN_PROGRESS"!==t.state||e&&"IN_PROGRESS"===e.state||(this._logger.debug("Signalling seek as complete on proxy because provided player isn't seeking."),this._signalSeekComplete())}},e.prototype._ensureBelowPosition=function(t){this.getPosition()>t&&(this._logger.debug("Capping position.",t),this.seek(t),this.isReady()&&(this._lastPlayerPosition=t,this._signalSeekComplete()))},e.prototype._sync=function(t){var e=this,r=this._player;if(!r)throw new Error("Player should have become available by now.");if(this._logger.debug("Syncing...",this.isPlaying(),this.isActuallyPlaying()),r.isDead()){this._logger.debug("Provided player is dead.");var n=r.getFatalError();n&&this._handleFatalError(n,r)}else this._errorHandler=r.onError.subscribe(function(t){t instanceof a.PlayerFatalError?e._onProvidedPlayerError.dispatch(new p.ProxyProvidedPlayerFatalError(t,r)):(e._triggerError(t),e._onProvidedPlayerError.dispatch(new c.ProxyProvidedPlayerError(t,r)))}),this._changeHandler=r.onChange.subscribe(function(t){e._update(function(){if(e._logger.debug("Handling changes.",t),t.dead)return e._logger.debug("Player has gone to DEAD state."),e._unsync(),void(e.isDead()||t.fatalError&&e._handleFatalError(t.fatalError,r));if(void 0===t.volume&&void 0===t.muted||e._notifyVolumeChange(r.getVolume(),r.getMuted()),void 0!==t.duration&&(e._ensureBelowPosition(t.duration),e._provideDuration(t.duration),e.isReady()||(e._signalReady(),e._handleSkippedSeek(),e._notifyStalled(r.isStalled()))),t.seek){var n=e.getSeekState();n&&"IN_PROGRESS"===n.state||"IN_PROGRESS"!==t.seek.state?n&&"IN_PROGRESS"===n.state&&("COMPLETED"===t.seek.state&&n.position===t.seek.position?(e._signalSeekComplete(),r.isFadingForSeek()&&e._notifyFadingForSeek(!0)):"COMPLETED"===t.seek.state&&n.position!==t.seek.position?e._notifySeekRejection(new Error("Another seek occurred to a different position.")):"IN_PROGRESS"===t.seek.state&&n.position!==t.seek.position?e.seek(t.seek.position):"ERROR"===t.seek.state&&e._notifySeekRejection(t.seek.error)):e.seek(t.seek.position)}void 0!==t.stalled&&e._notifyStalled(t.stalled),!1===t.playing&&t.playRejection?e.isActuallyPlaying()?(e._triggerError(new s.PlayerError("Paused because a player was provided that refused to play.")),e._notifyPlaying(!1)):e._notifyPlayRejection(t.playRejection):!1===t.playing&&(r.isActuallyPlaying()?e.pause():void 0===t.actuallyPlaying&&e.isReady()&&e._notifyPlaying(!1)),!0===t.playing&&t.pauseRejection?e._notifyPauseRejection(t.pauseRejection):!0===t.playing&&e.play(),void 0!==t.actuallyPlaying&&t.actuallyPlaying!==e.isActuallyPlaying()&&(e._notifyPlaying(t.actuallyPlaying),t.actuallyPlaying&&r.isFading()&&e._notifyFading(!0)),!1===t.fading&&e._notifyFading(!1),!1===t.fadingForSeek&&e._notifyFadingForSeek(!1)})}),this._update(function(){var n=e._instanceLock;try{if(e._notifyStalled(r.isStalled()),r.isReady()){var i=r.getDuration();e._ensureBelowPosition(i),e._provideDuration(i),e.isReady()||(e._logger.debug("Provided player is already ready. Making proxy player ready."),e._signalReady())}if(t.syncVolume&&(r.setVolume(e.getVolume(),e.getMuted()),e._instanceLock!==n))return;var o=e.getSeekState();if(t.syncPosition){e._logger.debug("Seeking to match position.");var s=e.getPosition();r.getPosition()!==s?r.seek(s):(e._logger.debug("Skipping seek because already at same position."),e.isReady()&&o&&"IN_PROGRESS"===o.state&&e._signalSeekComplete())}else if(o&&"IN_PROGRESS"===o.state){e._logger.debug("Seeking to match position because a seek has been queued.");var u=e._seekConfig;e._seekConfig=void 0,r.seek(e.getPosition(),u)}else{var l=r.getSeekState();l&&"IN_PROGRESS"===l.state&&(e._logger.debug("Seeking on proxy to match seek that is in progress on provided player."),e.seek(l.position))}if(e._instanceLock!==n)return;if(r.isActuallyPlaying()?(e._logger.debug("Provided player is already playing."),e.isActuallyPlaying()||(e._notifyPlaying(!0),r.isFading()&&e._notifyFading(!0))):r.isPlaying()?(e._logger.debug("Provided player is preparing to play."),e.play()):e.isPlaying()?(e._logger.debug("Calling play() on provided player to match proxy."),e._playAndHandleAbort(r)):e.isReady()&&e.isActuallyPlaying()&&(e._logger.debug("Switching to paused state, as provided player and proxy intended state is paused."),e._notifyPlaying(!1)),e._instanceLock!==n)return;e._synced=!0,e._notifyVolumeChange(r.getVolume(),r.getMuted())}catch(t){e._triggerError(new a.PlayerFatalError("Unexpected error occurred whilst syncing.",t))}})},e.prototype._playAndHandleAbort=function(t){var e=this._instanceLock;this._logger.debug("Calling play() on provided player.");var r=this._playConfig;this._playConfig=this._pauseConfig=void 0,t.play(r),this._instanceLock===e&&!t.isPlaying()&&this.isPlaying()&&(this._logger.debug("Provided player was not playing after play() call completed."),this.isActuallyPlaying()?(this._triggerError(new s.PlayerError("Paused because a player was provided that refused to play.")),this._notifyPlaying(!1)):this.pause())},e.prototype._pauseAndHandleAbort=function(t){var e=this._instanceLock;this._logger.debug("Calling pause() on provided player.");var r=this._pauseConfig;this._playConfig=this._pauseConfig=void 0,t.pause(r),this._instanceLock===e&&t.isPlaying()&&!this.isPlaying()&&(this._logger.debug("Provided player was not paused after pause() call completed."),this.play())},e.prototype._unsync=function(){if(this._logger.debug("Unsyncing..."),this._changeHandler&&(this._changeHandler.remove(),this._changeHandler=null),this._errorHandler&&(this._errorHandler.remove(),this._errorHandler=null),this._synced){this._synced=!1,this._unsyncInProgress=!0;var t=this._player;if(t)try{this._lastPlayerPosition=t.getPosition()}catch(t){this._logger.error("Error whilst unsyncing.",t)}this._unsyncInProgress=!1,this._logger.debug("Unsynced.",this.isPlaying(),this.isActuallyPlaying())}else this._logger.debug("Unsynced. (Sync never completed)")},e}(o.BasePlayer);e.ProxyPlayerBase=h},function(t,e,r){"use strict";function n(t){var e=navigator.userAgent.match(t);if(e&&e.length>=3){var r=parseInt(e[1],10),n=parseInt(e[2],10);if(!isNaN(r)&&!isNaN(n))return{major:r,minor:n}}return null}Object.defineProperty(e,"__esModule",{value:!0});var i="undefined"!=typeof navigator?navigator.userAgent:"",o=!/chrome|opera/i.test(i)&&/safari/i.test(i),s=i.indexOf("MSIE ")>=0||i.indexOf("Trident/")>=0,a=i.indexOf("Edge/")>=0,u=/Chrom(?:e|ium)/.test(i),l=i.toLowerCase().indexOf("firefox")>=0,c=/version\/(\d+)\.(\d+)/i,p=/Chrom(?:e|ium)\/([0-9]+)\.([0-9]+)\.([0-9]+)/,h=/Firefox\/(\d+)\.(\d+)/;e.isSafari=function(){return o},e.isFirefox=function(){return l},e.isChrome=function(){return u},e.isIE=function(){return s},e.isEdge=function(){return a},e.getSafariVersion=function(){return n(c)},e.getChromeVersion=function(){return n(p)},e.getFirefoxVersion=function(){return n(h)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(8),i=r(13),o=r(18),s=r(3),a=r(6);e.abortedError=new Error("Job aborted."),e.map=function(t,e){var r=e.convertResult,n=e.convertProgressUpdate,o=e.abortableJobOpts,s=e.passThroughAbort,l=void 0===s||s;return new u(function(){var e=t(),o=new a.EventDispatcher,s=!0,u=i.buildDeferred();return n&&e.onProgressUpdate(function(t){o.dispatch(n(t,s)),s=!1},{skipPast:!0}),e.onCompletion(function(t){try{u.resolve(r(t))}catch(t){u.reject(t)}}),e.onError(u.reject),{result:u.promise,progressUpdates:n?{onProgressUpdate:o,getProgressSoFar:function(){var t=e.getProgressSoFar();if(t){var r=n(t,s);return s=!1,r}return null}}:void 0,abort:function(){return l&&e.abort()}}},o)};var u=function(){function t(t,e){void 0===e&&(e={}),this._job=t,this._opts=e,this._counter=0,this._jobControl=null,this._promise=null,this._jobCompleted=!1}return t.prototype.run=function(){var t,r=this;if(this._jobControl)t=this._jobControl;else{try{t=this._jobControl=this._job()}catch(e){t=this._jobControl={result:n.Promise.reject(e)}}this._promise=t.result,o.always(this._promise,function(){r._jobCompleted=!0,r._opts.storeResult||(r._jobCompleted=!1,r._promise=null,r._jobControl=null)})}var a=this._promise;this._counter++;var u=i.buildDeferred(),l=!1,c=!1,p=void 0,h=!1,d=[],f=[],g=[];return o.always(a,function(){h||(l=!0,r._counter--),d.forEach(function(t){return t.remove()})}),a.then(function(t){h||(p=t,f.forEach(function(e){return s.deferException(function(){return e(t)})}),f.splice(0),u.resolve(t))},function(t){h||(c=!0,p=t,g.forEach(function(e){return e(t)}),g.splice(0),u.reject(t))}),{whenComplete:function(){return u.promise},onProgressUpdate:function(e,r){if(void 0===r&&(r={}),t.progressUpdates){if(!h&&!l){var n=t.progressUpdates.onProgressUpdate.subscribe(function(t){return e(t)});d.push(n)}if(!r.skipPast){var i=t.progressUpdates.getProgressSoFar();i&&e(i)}}},getProgressSoFar:function(){return t.progressUpdates?t.progressUpdates.getProgressSoFar():null},onCompletion:function(t){l?!c&&s.deferException(function(){return t(p)}):f.push(t)},onError:function(t){h?s.deferException(function(){return t(e.abortedError)}):l?c&&s.deferException(function(){return t(p)}):g.push(t)},hasCompleted:function(){return l},hasErrored:function(){return c},isAborted:function(){return h},abort:function(){h||l||(h=!0,d.forEach(function(t){return t.remove()}),0==--r._counter&&!r._jobCompleted&&r._jobControl&&r._jobControl.abort&&(r._jobControl.abort(),r._promise=null,r._jobControl=null),g.forEach(function(t){return s.deferException(function(){return t(e.abortedError)})}),u.reject(e.abortedError))}}},t}();e.AbortableJob=u},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){if(this.start=t,this.duration=e,e<0)throw new RangeError("Duration must be >= 0.");this.end=t+e}return t.normalizeRawTimeRanges=function(t){return t.slice(0).sort(function(t,e){return t.start-e.start}).reduce(function(t,e,r){var n=t.length-1;return r>0&&t[n].end>=e.start?t[n].end=e.end:t.push(e),t},[])},t.normalize=function(e){return t.normalizeRawTimeRanges(e.map(function(t){return{start:t.start,end:t.end}})).map(function(e){return new t(e.start,e.end-e.start)})},t.getCoverage=function(e){if(0===e.length)return new t(0,0);var r=1/0,n=0;return e.forEach(function(t){t.start<r&&(r=t.start),t.end>n&&(n=t.end)}),new t(r,n-r)},t.rangesContainTime=function(t,e){return e.some(function(e){return e.containsTime(t)})},t.prototype.containsTime=function(t){return this.start<=t&&this.end>t},t}();e.TimeRange=n},function(t,e,r){"use strict";t.exports="function"==typeof WeakMap&&"[object WeakMap]"===Object.prototype.toString.call(new WeakMap)},function(t,e,r){"use strict";var n=r(10),i=r(1),o=r(9),s=r(21),a=Array.isArray,u=Function.prototype.call,l=Array.prototype.some;t.exports=function(t,e){var r,c,p,h,d,f,g,y,_=arguments[2];if(a(t)||n(t)?r="array":o(t)?r="string":t=s(t),i(e),p=function(){h=!0},"array"!==r)if("string"!==r)for(c=t.next();!c.done;){if(u.call(e,_,c.value,p),h)return;c=t.next()}else for(f=t.length,d=0;d<f&&(g=t[d],d+1<f&&(y=g.charCodeAt(0))>=55296&&y<=56319&&(g+=t[++d]),u.call(e,_,g,p),!h);++d);else l.call(t,function(t){return u.call(e,_,t,p),h})}},function(t,e,r){"use strict";var n=r(10),i=r(4),o=r(9),s=r(2).iterator,a=Array.isArray;t.exports=function(t){return!(!i(t)||!a(t)&&!o(t)&&!n(t)&&"function"!=typeof t[s])}},function(t,e,r){"use strict";var n=r(41);t.exports=function(t){if(!n(t))throw new TypeError(t+" is not iterable");return t}},function(t,e,r){"use strict";var n,i=r(15),o=r(7),s=r(2),a=r(20),u=Object.defineProperty;n=t.exports=function(t){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");t=String(t),a.call(this,t),u(this,"__length__",o("",t.length))},i&&i(n,a),delete n.prototype.constructor,n.prototype=Object.create(a.prototype,{_next:o(function(){if(this.__list__)return this.__nextIndex__<this.__length__?this.__nextIndex__++:void this._unBind()}),_resolve:o(function(t){var e,r=this.__list__[t];return this.__nextIndex__===this.__length__?r:(e=r.charCodeAt(0))>=55296&&e<=56319?r+this.__list__[this.__nextIndex__++]:r})}),u(n.prototype,s.toStringTag,o("c","String Iterator"))},function(t,e,r){"use strict";var n=r(1),i=r(0),o=Function.prototype.bind,s=Function.prototype.call,a=Object.keys,u=Object.prototype.propertyIsEnumerable;t.exports=function(t,e){return function(r,l){var c,p=arguments[2],h=arguments[3];return r=Object(i(r)),n(l),c=a(r),h&&c.sort("function"==typeof h?o.call(h,r):void 0),"function"!=typeof t&&(t=c[t]),s.call(t,c,function(t,n){return u.call(r,t)?s.call(l,p,r[t],t,r,n):e})}}},function(t,e,r){"use strict";t.exports=r(44)("forEach")},function(t,e,r){"use strict";var n=r(1),i=r(45),o=Function.prototype.call;t.exports=function(t,e){var r={},s=arguments[2];return n(e),i(t,function(t,n,i,a){r[n]=o.call(e,s,t,n,i,a)}),r}},function(t,e,r){"use strict";t.exports=function(t){return t=Number(t),isNaN(t)||0===t?t:t>0?1:-1}},function(t,e,r){"use strict";t.exports=function(){var t=Math.sign;return"function"==typeof t&&1===t(10)&&-1===t(-20)}},function(t,e,r){"use strict";t.exports=r(48)()?Math.sign:r(47)},function(t,e,r){"use strict";var n=r(49),i=Math.abs,o=Math.floor;t.exports=function(t){return isNaN(t)?0:0!==(t=Number(t))&&isFinite(t)?n(t)*o(i(t)):t}},function(t,e,r){"use strict";var n=r(50),i=Math.max;t.exports=function(t){return i(0,n(t))}},function(t,e,r){"use strict";var n=Object.prototype.toString,i=n.call(r(24));t.exports=function(t){return"function"==typeof t&&n.call(t)===i}},function(t,e,r){"use strict";var n=r(2).iterator,i=r(10),o=r(52),s=r(51),a=r(1),u=r(0),l=r(4),c=r(9),p=Array.isArray,h=Function.prototype.call,d={configurable:!0,enumerable:!0,writable:!0,value:null},f=Object.defineProperty;t.exports=function(t){var e,r,g,y,_,v,m,b,w,E,P=arguments[1],S=arguments[2];if(t=Object(u(t)),l(P)&&a(P),this&&this!==Array&&o(this))e=this;else{if(!P){if(i(t))return 1!==(_=t.length)?Array.apply(null,t):((y=new Array(1))[0]=t[0],y);if(p(t)){for(y=new Array(_=t.length),r=0;r<_;++r)y[r]=t[r];return y}}y=[]}if(!p(t))if(void 0!==(w=t[n])){for(m=a(w).call(t),e&&(y=new e),b=m.next(),r=0;!b.done;)E=P?h.call(P,S,b.value,r):b.value,e?(d.value=E,f(y,r,d)):y[r]=E,b=m.next(),++r;_=r}else if(c(t)){for(_=t.length,e&&(y=new e),r=0,g=0;r<_;++r)E=t[r],r+1<_&&(v=E.charCodeAt(0))>=55296&&v<=56319&&(E+=t[++r]),E=P?h.call(P,S,E,g):E,e?(d.value=E,f(y,g,d)):y[g]=E,++g;_=g}if(void 0===_)for(_=s(t.length),e&&(y=new e(_)),r=0;r<_;++r)E=P?h.call(P,S,t[r],r):t[r],e?(d.value=E,f(y,r,d)):y[r]=E;return e&&(d.value=null,y.length=_),y}},function(t,e,r){"use strict";t.exports=function(){var t,e,r=Array.from;return"function"==typeof r&&(e=r(t=["raz","dwa"]),Boolean(e&&e!==t&&"dwa"===e[1]))}},function(t,e,r){"use strict";t.exports=r(54)()?Array.from:r(53)},function(t,e,r){"use strict";var n=r(55),i=r(14),o=r(0);t.exports=function(t){var e=Object(o(t)),r=arguments[1],s=Object(arguments[2]);if(e!==t&&!r)return e;var a={};return r?n(r,function(e){(s.ensure||e in t)&&(a[e]=t[e])}):i(a,t),a}},function(t,e,r){"use strict";var n,i=r(56),o=r(23),s=r(1),a=r(46),u=r(1),l=r(0),c=Function.prototype.bind,p=Object.defineProperty,h=Object.prototype.hasOwnProperty;n=function(t,e,r){var n,o=l(e)&&u(e.value);return delete(n=i(e)).writable,delete n.value,n.get=function(){return!r.overwriteDefinition&&h.call(this,t)?o:(e.value=c.call(o,r.resolveContext?r.resolveContext(this):this),p(this,t,e),this[t])},n},t.exports=function(t){var e=o(arguments[1]);return null!=e.resolveContext&&s(e.resolveContext),a(t,function(t,r){return n(r,t,e)})}},function(t,e,r){"use strict";var n=r(0);t.exports=function(){return n(this).length=0,this}},function(t,e,r){"use strict";t.exports=function(t){return!!t&&("symbol"==typeof t||!!t.constructor&&"Symbol"===t.constructor.name&&"Symbol"===t[t.constructor.toStringTag])}},function(t,e,r){"use strict";var n=r(59);t.exports=function(t){if(!n(t))throw new TypeError(t+" is not a symbol");return t}},function(t,e,r){"use strict";var n,i,o,s,a=r(7),u=r(60),l=Object.create,c=Object.defineProperties,p=Object.defineProperty,h=Object.prototype,d=l(null);if("function"==typeof Symbol){n=Symbol;try{String(n()),s=!0}catch(t){}}var f=function(){var t=l(null);return function(e){for(var r,n,i=0;t[e+(i||"")];)++i;return t[e+=i||""]=!0,p(h,r="@@"+e,a.gs(null,function(t){n||(n=!0,p(this,r,a(t)),n=!1)})),r}}();o=function(t){if(this instanceof o)throw new TypeError("Symbol is not a constructor");return i(t)},t.exports=i=function t(e){var r;if(this instanceof t)throw new TypeError("Symbol is not a constructor");return s?n(e):(r=l(o.prototype),e=void 0===e?"":String(e),c(r,{__description__:a("",e),__name__:a("",f(e))}))},c(i,{for:a(function(t){return d[t]?d[t]:d[t]=i(String(t))}),keyFor:a(function(t){var e;for(e in u(t),d)if(d[e]===t)return e}),hasInstance:a("",n&&n.hasInstance||i("hasInstance")),isConcatSpreadable:a("",n&&n.isConcatSpreadable||i("isConcatSpreadable")),iterator:a("",n&&n.iterator||i("iterator")),match:a("",n&&n.match||i("match")),replace:a("",n&&n.replace||i("replace")),search:a("",n&&n.search||i("search")),species:a("",n&&n.species||i("species")),split:a("",n&&n.split||i("split")),toPrimitive:a("",n&&n.toPrimitive||i("toPrimitive")),toStringTag:a("",n&&n.toStringTag||i("toStringTag")),unscopables:a("",n&&n.unscopables||i("unscopables"))}),c(o.prototype,{constructor:a(i),toString:a("",function(){return this.__name__})}),c(i.prototype,{toString:a(function(){return"Symbol ("+u(this).__description__+")"}),valueOf:a(function(){return u(this)})}),p(i.prototype,i.toPrimitive,a("",function(){var t=u(this);return"symbol"==typeof t?t:t.toString()})),p(i.prototype,i.toStringTag,a("c","Symbol")),p(o.prototype,i.toStringTag,a("c",i.prototype[i.toStringTag])),p(o.prototype,i.toPrimitive,a("c",i.prototype[i.toPrimitive]))},function(t,e,r){"use strict";var n={object:!0,symbol:!0};t.exports=function(){var t;if("function"!=typeof Symbol)return!1;t=Symbol("test symbol");try{String(t)}catch(t){return!1}return!!n[typeof Symbol.iterator]&&!!n[typeof Symbol.toPrimitive]&&!!n[typeof Symbol.toStringTag]}},function(t,e,r){"use strict";var n,i=r(15),o=r(22),s=r(7),a=r(2),u=r(20),l=Object.defineProperty;n=t.exports=function(t,e){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");u.call(this,t),e=e?o.call(e,"key+value")?"key+value":o.call(e,"key")?"key":"value":"value",l(this,"__kind__",s("",e))},i&&i(n,u),delete n.prototype.constructor,n.prototype=Object.create(u.prototype,{_resolve:s(function(t){return"value"===this.__kind__?this.__list__[t]:"key+value"===this.__kind__?[t,this.__list__[t]]:t})}),l(n.prototype,a.toStringTag,s("c","Array Iterator"))},function(t,e,r){"use strict";var n=String.prototype.indexOf;t.exports=function(t){return n.call(this,t,arguments[1])>-1}},function(t,e,r){"use strict";var n="razdwatrzy";t.exports=function(){return"function"==typeof n.contains&&!0===n.contains("dwa")&&!1===n.contains("foo")}},function(t,e,r){"use strict";t.exports=function(t){return"function"==typeof t}},function(t,e,r){"use strict";var n=r(4),i=Object.keys;t.exports=function(t){return i(n(t)?Object(t):t)}},function(t,e,r){"use strict";t.exports=function(){try{return Object.keys("primitive"),!0}catch(t){return!1}}},function(t,e,r){"use strict";t.exports=r(68)()?Object.keys:r(67)},function(t,e,r){"use strict";var n=r(69),i=r(0),o=Math.max;t.exports=function(t,e){var r,s,a,u=o(arguments.length,2);for(t=Object(i(t)),a=function(n){try{t[n]=e[n]}catch(t){r||(r=t)}},s=1;s<u;++s)e=arguments[s],n(e).forEach(a);if(void 0!==r)throw r;return t}},function(t,e,r){"use strict";t.exports=function(){var t,e=Object.assign;return"function"==typeof e&&(e(t={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),t.foo+t.bar+t.trzy==="razdwatrzy")}},function(t,e,r){"use strict";var n=Object.create(null),i=Math.random;t.exports=function(){var t;do{t=i().toString(36).slice(2)}while(n[t]);return t}},function(t,e,r){"use strict";var n=r(25);t.exports=function(t){if(!n(t))throw new TypeError(t+" is not an Object");return t}},function(t,e,r){"use strict";var n,i=Object.create;r(27)()||(n=r(26)),t.exports=function(){var t,e,r;return n?1!==n.level?i:(t={},e={},r={configurable:!1,enumerable:!1,writable:!0,value:void 0},Object.getOwnPropertyNames(Object.prototype).forEach(function(t){return"__proto__"===t?void(e[t]={configurable:!0,enumerable:!1,writable:!0,value:void 0}):void(e[t]=r)}),Object.defineProperties(t,e),Object.defineProperty(n,"nullPolyfill",{configurable:!1,enumerable:!1,writable:!1,value:t}),function(e,r){return i(null===e?t:e,r)}):i}()},function(t,e,r){"use strict";var n,i=r(15),o=r(73),s=r(0),a=r(72),u=r(7),l=r(21),c=r(40),p=r(2).toStringTag,h=r(39),d=Array.isArray,f=Object.defineProperty,g=Object.prototype.hasOwnProperty,y=Object.getPrototypeOf;t.exports=n=function(){var t,e=arguments[0];if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");return t=h&&i&&WeakMap!==n?i(new WeakMap,y(this)):this,null!=e&&(d(e)||(e=l(e))),f(t,"__weakMapData__",u("c","$weakMap$"+a())),e?(c(e,function(e){s(e),t.set(e[0],e[1])}),t):t},h&&(i&&i(n,WeakMap),n.prototype=Object.create(WeakMap.prototype,{constructor:u(n)})),Object.defineProperties(n.prototype,{delete:u(function(t){return!!g.call(o(t),this.__weakMapData__)&&(delete t[this.__weakMapData__],!0)}),get:u(function(t){if(g.call(o(t),this.__weakMapData__))return t[this.__weakMapData__]}),has:u(function(t){return g.call(o(t),this.__weakMapData__)}),set:u(function(t,e){return f(o(t),this.__weakMapData__,u("c",e)),this}),toString:u(function(){return"[object WeakMap]"})}),f(n.prototype,p,u("c","WeakMap"))},function(t,e,r){"use strict";t.exports=function(){var t,e;if("function"!=typeof WeakMap)return!1;try{t=new WeakMap([[e={},"one"],[{},"two"],[{},"three"]])}catch(t){return!1}return"[object WeakMap]"===String(t)&&"function"==typeof t.set&&t.set({},1)===t&&"function"==typeof t.delete&&"function"==typeof t.has&&"one"===t.get(e)}},function(t,e,r){"use strict";t.exports=r(76)()?WeakMap:r(75)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(77),i=function(){function t(){this._map=new n}return t.prototype.get=function(t){return this._map.get(t)},t.prototype.set=function(t,e){this._map.set(t,e)},t.prototype.has=function(t){return this._map.has(t)},t.prototype.delete=function(t){return this._map.delete(t)},t}();e.SCWeakMap=i},function(t,e,r){!function(e){var r=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/\?#]*\/)*.*?)??(;.*?)?(\?.*?)?(#.*?)?$/,n=/^([^\/?#]*)(.*)$/,i=/(?:\/|^)\.(?=\/)/g,o=/(?:\/|^)\.\.\/(?!\.\.\/).*?(?=\/)/g,s={buildAbsoluteURL:function(t,e,r){if(r=r||{},t=t.trim(),!(e=e.trim())){if(!r.alwaysNormalize)return t;var i=s.parseURL(t);if(!i)throw new Error("Error trying to parse base URL.");return i.path=s.normalizePath(i.path),s.buildURLFromParts(i)}var o=s.parseURL(e);if(!o)throw new Error("Error trying to parse relative URL.");if(o.scheme)return r.alwaysNormalize?(o.path=s.normalizePath(o.path),s.buildURLFromParts(o)):e;var a=s.parseURL(t);if(!a)throw new Error("Error trying to parse base URL.");if(!a.netLoc&&a.path&&"/"!==a.path[0]){var u=n.exec(a.path);a.netLoc=u[1],a.path=u[2]}a.netLoc&&!a.path&&(a.path="/");var l={scheme:a.scheme,netLoc:o.netLoc,path:null,params:o.params,query:o.query,fragment:o.fragment};if(!o.netLoc&&(l.netLoc=a.netLoc,"/"!==o.path[0]))if(o.path){var c=a.path,p=c.substring(0,c.lastIndexOf("/")+1)+o.path;l.path=s.normalizePath(p)}else l.path=a.path,o.params||(l.params=a.params,o.query||(l.query=a.query));return null===l.path&&(l.path=r.alwaysNormalize?s.normalizePath(o.path):o.path),s.buildURLFromParts(l)},parseURL:function(t){var e=r.exec(t);return e?{scheme:e[1]||"",netLoc:e[2]||"",path:e[3]||"",params:e[4]||"",query:e[5]||"",fragment:e[6]||""}:null},normalizePath:function(t){for(t=t.split("").reverse().join("").replace(i,"");t.length!==(t=t.replace(o,"")).length;);return t.split("").reverse().join("")},buildURLFromParts:function(t){return t.scheme+t.netLoc+t.path+t.params+t.query+t.fragment}};t.exports=s}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(79),i=/^.*\.([^\.;\?#]*).*$/;e.getExtension=function(t){var e=i.exec(t);return e?e[1].toLowerCase():null},e.buildAbsoluteUrl=function(t,e){return n.buildAbsoluteURL(t,e,{alwaysNormalize:!0})}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.combine=function(t){var e=new Uint8Array(t.reduce(function(t,e){return t+e.byteLength},0)),r=0;return t.forEach(function(t){e.set(t,r),r+=t.byteLength}),e},e.fill=function(t,e){if(Uint8Array.prototype.fill)t.fill(e);else for(var r=0;r<t.length;r++)t[r]=e},e.forEach=function(t,e){if(Uint8Array.prototype.forEach)t.forEach(e);else for(var r=0;r<t.length;r++)e(t[r],r)},e.numberToUint8Array=function(t,e){if(void 0===e&&(e=!1),(t=Math.round(t))<0)throw new Error("Negative numbers not supported.");for(var r=Math.max(1,Math.ceil(Math.log(t+1)/Math.log(2)/8)),n=new Uint8Array(r),i=0;i<r;i++)n[e?i:r-1-i]=255&t,t>>>=8;return n},e.createVintBuffer=function(t){if(t<0||t>Math.pow(2,53))throw new Error("Unrepresentable value: "+t);var e;for(e=1;e<=8&&!(t<Math.pow(2,7*e)-1);e++);for(var r=new Uint8Array(e),n=1;n<=e;n++){var i=255&t;r[e-n]=i,t-=i,t/=Math.pow(2,8)}return r[0]|=1<<8-e,r}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.compact=function(t){return t.filter(function(t){return null!=t})}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(8),i=r(18);e.promiseWithTimeout=function(t,e,r){return void 0===r&&(r=new Error("Timed out.")),new n.Promise(function(n,o){var s=window.setTimeout(function(){o(r)},e);i.always(t,function(t){return window.clearTimeout(s),t}).then(n,o)})}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(17),i="undefined"!=typeof window&&"Map"in window;e.buildCache=function(){return i?new window.Map:new o};var o=function(){function t(){this._store=[]}return t.prototype.set=function(t,e){var r=n.find(this._store,function(e){return e.key===t});r?r.val=e:this._store.push({key:t,val:e})},t.prototype.get=function(t){var e=n.find(this._store,function(e){return e.key===t});if(e)return e.val},t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(3);e.retry=function(t,e,r){void 0===r&&(r={});var i=null,o=0,s=!1,a=null,u=function(){var l=!1;a=e({attemptNum:o,scheduleRetry:function(){if(l)throw new Error("scheduleRetry() already called.");if(l=!0,a=null,s)return!1;var e=t(++o);if(null===e){var c=r.onNoMoreRetries;return c&&n.deferException(function(){return c()}),!1}return i=window.setTimeout(u,e),!0}})||null};return u(),{cancel:function(){s||(s=!0,i&&(window.clearTimeout(i),i=null),a&&a.onCancel())}}},e.buildExponentialDelayCalculator=function(t){var e=void 0===t?{}:t,r=e.timeBase,n=void 0===r?500:r,i=e.threshold,o=void 0===i?3:i,s=e.delayCap,a=void 0===s?45e3:s,u=e.jitter,l=void 0===u?200:u,c=e.maxAttempts,p=void 0===c?null:c;if(n<=0)throw new Error("Time base must be > 0.");if(o<=0)throw new Error("Threshold must be > 0.");if(null!==a&&a<=0)throw new Error("Delay cap must be null or > 0.");if(null!==p&&p<1)throw new Error("Max attempts must be >= 1.");return function(t){if(null!==p&&t>=p)return null;var e=t>0?Math.pow(2,t/o-1):0;return Math.min(e*n,a||1/0)+Math.round(Math.random()*l)}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(13),i=r(37),o=r(85),s=r(30),a=r(17),u=r(84),l=r(19),c=r(8),p=r(83),h=r(18),d=r(82),f=r(81),g=r(3),y=r(36),_=r(80),v=r(78);!function(t){t.OnExit=s.OnExit,t.find=a.find,t.Promise=c.Promise,t.promiseWithTimeout=p.promiseWithTimeout,t.always=h.always,t.compact=d.compact,t.deferException=g.deferException,t.SCWeakMap=v.SCWeakMap,function(t){t.buildCache=u.buildCache}(t.cache||(t.cache={})),function(t){t.buildDeferred=n.buildDeferred}(t.deferred||(t.deferred={})),function(t){t.getExtension=_.getExtension,t.buildAbsoluteUrl=_.buildAbsoluteUrl}(t.url||(t.url={})),function(t){t.AbortableJob=i.AbortableJob,t.map=i.map,t.abortedError=i.abortedError}(t.abortableJob||(t.abortableJob={})),function(t){t.retry=o.retry,t.buildExponentialDelayCalculator=o.buildExponentialDelayCalculator}(t.retry||(t.retry={})),function(t){t.isSafari=y.isSafari,t.getSafariVersion=y.getSafariVersion,t.isIE=y.isIE,t.isEdge=y.isEdge,t.isFirefox=y.isFirefox,t.isChrome=y.isChrome,t.getChromeVersion=y.getChromeVersion,t.getFirefoxVersion=y.getFirefoxVersion}(t.browser||(t.browser={})),function(t){t.combine=f.combine,t.fill=f.fill,t.forEach=f.forEach,t.numberToUint8Array=f.numberToUint8Array,t.createVintBuffer=f.createVintBuffer}(t.arrayBuffer||(t.arrayBuffer={})),function(t){t.now=l.now}(t.time||(t.time={}))}(e.helpers||(e.helpers={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){this._msg=t,this._cause=e}return t.prototype.getMsg=function(){return this._msg},t.prototype.getCause=function(){return this._cause},t}();e.LoaderError=n},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(87);!function(t){t.LoaderError=n.LoaderError}(e.loaderErrors||(e.loaderErrors={}))},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=r(5),o=function(t){function e(e,r){return t.call(this,e||"The URL update failed for some reason.",r)||this}return n(e,t),e.prototype.getCode=function(){return"URL_UPDATE_ERROR"},e}(i.PlayerFatalError);e.URLUpdateError=o},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(33),i=r(89),o=r(29),s=r(16),a=r(11),u=r(5);!function(t){t.PlayerError=a.PlayerError,t.PlayerFatalError=u.PlayerFatalError,t.NotSupportedError=n.NotSupportedError,t.URLUpdateError=i.URLUpdateError,t.ImplementationError=o.ImplementationError,t.ProxyProvidedPlayerFatalError=s.ProxyProvidedPlayerFatalError}(e.errors||(e.errors={}))},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=r(6),o=r(12),s=r(35),a=r(16),u=function(t){function e(e){var r=t.call(this,e)||this;return r._onPlayerProvided=new i.EventDispatcher,r._onPlayerRemoved=new i.EventDispatcher,r._shouldPassThroughFatalErrors=!!e.shouldPassThroughFatalErrors,r.onPlayerProvided=r._onPlayerProvided.getHandle(),r.onPlayerRemoved=r._onPlayerRemoved.getHandle(),r._logger=o.prefixLogger(r._logger,"ProxyPlayer"),r}return n(e,t),e.prototype.providePlayer=function(t,e){void 0===e&&(e={}),this._providePlayer(t,e),this._onPlayerProvided.dispatch(t)},e.prototype.removePlayer=function(){var t=this._getPlayer();if(!t)throw new Error("There is no player to remove.");this._removePlayer(),this._onPlayerRemoved.dispatch(t)},e.prototype.setInitialDuration=function(t){this._setInitialDuration(t)},e.prototype.getPlayer=function(){return this._getPlayer()},e.prototype._handleFatalError=function(t,e){this._shouldPassThroughFatalErrors?this._triggerError(t):this._triggerError(new a.ProxyProvidedPlayerFatalError(t,e))},e}(s.ProxyPlayerBase);e.ProxyPlayer=u},function(t,e){},function(t,e){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e){function r(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}function i(t){if(l===setTimeout)return setTimeout(t,0);if((l===r||!l)&&setTimeout)return l=setTimeout,setTimeout(t,0);try{return l(t,0)}catch(e){try{return l.call(null,t,0)}catch(e){return l.call(this,t,0)}}}function o(){f&&h&&(f=!1,h.length?d=h.concat(d):g=-1,d.length&&s())}function s(){if(!f){var t=i(o);f=!0;for(var e=d.length;e;){for(h=d,d=[];++g<e;)h&&h[g].run();g=-1,e=d.length}h=null,f=!1,function(t){if(c===clearTimeout)return clearTimeout(t);if((c===n||!c)&&clearTimeout)return c=clearTimeout,clearTimeout(t);try{c(t)}catch(e){try{return c.call(null,t)}catch(e){return c.call(this,t)}}}(t)}}function a(t,e){this.fun=t,this.array=e}function u(){}var l,c,p=t.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:r}catch(t){l=r}try{c="function"==typeof clearTimeout?clearTimeout:n}catch(t){c=n}}();var h,d=[],f=!1,g=-1;p.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];d.push(new a(t,e)),1!==d.length||f||i(s)},a.prototype.run=function(){this.fun.apply(null,this.array)},p.title="browser",p.browser=!0,p.env={},p.argv=[],p.version="",p.versions={},p.on=u,p.addListener=u,p.once=u,p.off=u,p.removeListener=u,p.removeAllListeners=u,p.emit=u,p.prependListener=u,p.prependOnceListener=u,p.listeners=function(t){return[]},p.binding=function(t){throw new Error("process.binding is not supported")},p.cwd=function(){return"/"},p.chdir=function(t){throw new Error("process.chdir is not supported")},p.umask=function(){return 0}},function(t,e,r){(function(e,n){
|
|
33
|
+
var n=r(156),i=r(157),o=r(158);function s(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(s()<e)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=u.prototype:(null===t&&(t=new u(e)),t.length=e),t}function u(t,e,r){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return p(this,t)}return l(this,t,e,r)}function l(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n);u.TYPED_ARRAY_SUPPORT?(t=e).__proto__=u.prototype:t=h(t,e);return t}(t,e,r,n):"string"==typeof e?function(t,e,r){"string"==typeof r&&""!==r||(r="utf8");if(!u.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|f(e,r),i=(t=a(t,n)).write(e,r);i!==n&&(t=t.slice(0,i));return t}(t,e,r):function(t,e){if(u.isBuffer(e)){var r=0|d(e.length);return 0===(t=a(t,r)).length?t:(e.copy(t,0,0,r),t)}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||function(t){return t!=t}(e.length)?a(t,0):h(t,e);if("Buffer"===e.type&&o(e.data))return h(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function c(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function p(t,e){if(c(e),t=a(t,e<0?0:0|d(e)),!u.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function h(t,e){var r=e.length<0?0:0|d(e.length);t=a(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function d(t){if(t>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function f(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return B(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(t).length;default:if(n)return B(t).length;e=(""+e).toLowerCase(),n=!0}}function g(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function y(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:_(t,e,r,n,i);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):_(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function _(t,e,r,n,i){var o,s=1,a=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,r/=2}function l(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var c=-1;for(o=r;o<a;o++)if(l(t,o)===l(e,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===u)return c*s}else-1!==c&&(o-=o-c),c=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){for(var p=!0,h=0;h<u;h++)if(l(t,o+h)!==l(e,h)){p=!1;break}if(p)return o}return-1}function v(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s<n;++s){var a=parseInt(e.substr(2*s,2),16);if(isNaN(a))return s;t[r+s]=a}return s}function m(t,e,r,n){return q(B(e,t.length-r),t,r,n)}function b(t,e,r,n){return q(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function w(t,e,r,n){return b(t,e,r,n)}function E(t,e,r,n){return q(z(e),t,r,n)}function P(t,e,r,n){return q(function(t,e){for(var r,n,i,o=[],s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function S(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function x(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o,s,a,u,l=t[i],c=null,p=l>239?4:l>223?3:l>191?2:1;if(i+p<=r)switch(p){case 1:l<128&&(c=l);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&l)<<6|63&o)>127&&(c=u);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(u=(15&l)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&l)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(c=u)}null===c?(c=65533,p=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=p}return function(t){var e=t.length;if(e<=k)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=k));return r}(n)}e.Buffer=u,e.SlowBuffer=function(t){+t!=t&&(t=0);return u.alloc(+t)},e.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=s(),u.poolSize=8192,u._augment=function(t){return t.__proto__=u.prototype,t},u.from=function(t,e,r){return l(null,t,e,r)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(t,e,r){return function(t,e,r,n){return c(e),e<=0?a(t,e):void 0!==r?"string"==typeof n?a(t,e).fill(r,n):a(t,e).fill(r):a(t,e)}(null,t,e,r)},u.allocUnsafe=function(t){return p(null,t)},u.allocUnsafeSlow=function(t){return p(null,t)},u.isBuffer=function(t){return!(null==t||!t._isBuffer)},u.compare=function(t,e){if(!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(t,e){if(!o(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=u.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var s=t[r];if(!u.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,i),i+=s.length}return n},u.byteLength=f,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)g(this,e,e+1);return this},u.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},u.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},u.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?x(this,0,t):function(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return T(this,e,r);case"utf8":case"utf-8":return x(this,e,r);case"ascii":return A(this,e,r);case"latin1":case"binary":return O(this,e,r);case"base64":return S(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},u.prototype.compare=function(t,e,r,n,i){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;for(var o=i-n,s=r-e,a=Math.min(o,s),l=this.slice(n,i),c=t.slice(e,r),p=0;p<a;++p)if(l[p]!==c[p]){o=l[p],s=c[p];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},u.prototype.indexOf=function(t,e,r){return y(this,t,e,r,!0)},u.prototype.lastIndexOf=function(t,e,r){return y(this,t,e,r,!1)},u.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return v(this,t,e,r);case"utf8":case"utf-8":return m(this,t,e,r);case"ascii":return b(this,t,e,r);case"latin1":case"binary":return w(this,t,e,r);case"base64":return E(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var k=4096;function A(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function O(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function T(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=j(t[o]);return i}function R(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function C(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function I(t,e,r,n,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function M(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i<o;++i)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function D(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i<o;++i)t[r+i]=e>>>8*(n?i:3-i)&255}function L(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function U(t,e,r,n,o){return o||L(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function F(t,e,r,n,o){return o||L(t,0,r,8),i.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){var r,n=this.length;if(t=~~t,e=void 0===e?n:~~e,t<0?(t+=n)<0&&(t=0):t>n&&(t=n),e<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),u.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=u.prototype;else{var i=e-t;r=new u(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+t]}return r},u.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||C(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},u.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||C(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},u.prototype.readUInt8=function(t,e){return e||C(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||C(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||C(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||C(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||C(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||C(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||C(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return e||C(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||C(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){e||C(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return e||C(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||C(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||C(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||C(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||C(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||C(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||I(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},u.prototype.writeUIntBE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||I(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},u.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):M(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):M(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):D(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):D(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);I(this,t,e,r,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o<r&&(s*=256);)t<0&&0===a&&0!==this[e+o-1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);I(this,t,e,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):M(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):M(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):D(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):D(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,r){return U(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return U(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return F(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return F(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i,o=n-r;if(this===t&&r<e&&e<n)for(i=o-1;i>=0;--i)t[i+e]=this[i+r];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+o),e);return o},u.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var o;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var s=u.isBuffer(t)?t:B(new u(t,n).toString()),a=s.length;for(o=0;o<r-e;++o)this[o+e]=s[o%a]}return this};var N=/[^+\/0-9A-Za-z-_]/g;function j(t){return t<16?"0"+t.toString(16):t.toString(16)}function B(t,e){var r;e=e||1/0;for(var n=t.length,i=null,o=[],s=0;s<n;++s){if((r=t.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function z(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(N,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function q(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}}).call(e,r(12))},function(t,e,r){"use strict";e.byteLength=function(t){return 3*t.length/4-l(t)},e.toByteArray=function(t){var e,r,n,s,a,u=t.length;s=l(t),a=new o(3*u/4-s),r=s>0?u-4:u;var c=0;for(e=0;e<r;e+=4)n=i[t.charCodeAt(e)]<<18|i[t.charCodeAt(e+1)]<<12|i[t.charCodeAt(e+2)]<<6|i[t.charCodeAt(e+3)],a[c++]=n>>16&255,a[c++]=n>>8&255,a[c++]=255&n;2===s?(n=i[t.charCodeAt(e)]<<2|i[t.charCodeAt(e+1)]>>4,a[c++]=255&n):1===s&&(n=i[t.charCodeAt(e)]<<10|i[t.charCodeAt(e+1)]<<4|i[t.charCodeAt(e+2)]>>2,a[c++]=n>>8&255,a[c++]=255&n);return a},e.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o="",s=[],a=0,u=r-i;a<u;a+=16383)s.push(p(t,a,a+16383>u?u:a+16383));1===i?(e=t[r-1],o+=n[e>>2],o+=n[e<<4&63],o+="=="):2===i&&(e=(t[r-2]<<8)+t[r-1],o+=n[e>>10],o+=n[e>>4&63],o+=n[e<<2&63],o+="=");return s.push(o),s.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=s.length;a<u;++a)n[a]=s[a],i[s.charCodeAt(a)]=a;function l(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function c(t){return n[t>>18&63]+n[t>>12&63]+n[t>>6&63]+n[63&t]}function p(t,e,r){for(var n,i=[],o=e;o<r;o+=3)n=(t[o]<<16)+(t[o+1]<<8)+t[o+2],i.push(c(n));return i.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,l=u>>1,c=-7,p=r?i-1:0,h=r?-1:1,d=t[e+p];for(p+=h,o=d&(1<<-c)-1,d>>=-c,c+=a;c>0;o=256*o+t[e+p],p+=h,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=n;c>0;s=256*s+t[e+p],p+=h,c-=8);if(0===o)o=1-l;else{if(o===u)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=l}return(d?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,u,l=8*o-i-1,c=(1<<l)-1,p=c>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,f=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=c):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+p>=1?h/u:h*Math.pow(2,1-p))*u>=2&&(s++,u/=2),s+p>=c?(a=0,s=c):s+p>=1?(a=(e*u-1)*Math.pow(2,i),s+=p):(a=e*Math.pow(2,p-1)*Math.pow(2,i),s=0));i>=8;t[r+d]=255&a,d+=f,a/=256,i-=8);for(s=s<<i|a,l+=i;l>0;t[r+d]=255&s,d+=f,s/=256,l-=8);t[r+d-f]|=128*g}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){"use strict";(function(e){var n=r(160),i=r(161),o=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,s=/[\n\r\t]/g,a=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,u=/:\d+$/,l=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,c=/^[a-zA-Z]:/;function p(t){return(t||"").toString().replace(o,"")}var h=[["#","hash"],["?","query"],function(t,e){return g(e.protocol)?t.replace(/\\/g,"/"):t},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],d={hash:1,query:1};function f(t){var r,n=("undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{}).location||{},i={},o=typeof(t=t||n);if("blob:"===t.protocol)i=new _(unescape(t.pathname),{});else if("string"===o)for(r in i=new _(t,{}),d)delete i[r];else if("object"===o){for(r in t)r in d||(i[r]=t[r]);void 0===i.slashes&&(i.slashes=a.test(t.href))}return i}function g(t){return"file:"===t||"ftp:"===t||"http:"===t||"https:"===t||"ws:"===t||"wss:"===t}function y(t,e){t=(t=p(t)).replace(s,""),e=e||{};var r,n=l.exec(t),i=n[1]?n[1].toLowerCase():"",o=!!n[2],a=!!n[3],u=0;return o?a?(r=n[2]+n[3]+n[4],u=n[2].length+n[3].length):(r=n[2]+n[4],u=n[2].length):a?(r=n[3]+n[4],u=n[3].length):r=n[4],"file:"===i?u>=2&&(r=r.slice(2)):g(i)?r=n[4]:i?o&&(r=r.slice(2)):u>=2&&g(e.protocol)&&(r=n[4]),{protocol:i,slashes:o||g(i),slashesCount:u,rest:r}}function _(t,e,r){if(t=(t=p(t)).replace(s,""),!(this instanceof _))return new _(t,e,r);var o,a,u,l,d,v,m=h.slice(),b=typeof e,w=this,E=0;for("object"!==b&&"string"!==b&&(r=e,e=null),r&&"function"!=typeof r&&(r=i.parse),e=f(e),o=!(a=y(t||"",e)).protocol&&!a.slashes,w.slashes=a.slashes||o&&e.slashes,w.protocol=a.protocol||e.protocol||"",t=a.rest,("file:"===a.protocol&&(2!==a.slashesCount||c.test(t))||!a.slashes&&(a.protocol||a.slashesCount<2||!g(w.protocol)))&&(m[3]=[/(.*)/,"pathname"]);E<m.length;E++)"function"!=typeof(l=m[E])?(u=l[0],v=l[1],u!=u?w[v]=t:"string"==typeof u?~(d="@"===u?t.lastIndexOf(u):t.indexOf(u))&&("number"==typeof l[2]?(w[v]=t.slice(0,d),t=t.slice(d+l[2])):(w[v]=t.slice(d),t=t.slice(0,d))):(d=u.exec(t))&&(w[v]=d[1],t=t.slice(0,d.index)),w[v]=w[v]||o&&l[3]&&e[v]||"",l[4]&&(w[v]=w[v].toLowerCase())):t=l(t,w);r&&(w.query=r(w.query)),o&&e.slashes&&"/"!==w.pathname.charAt(0)&&(""!==w.pathname||""!==e.pathname)&&(w.pathname=function(t,e){if(""===t)return e;for(var r=(e||"/").split("/").slice(0,-1).concat(t.split("/")),n=r.length,i=r[n-1],o=!1,s=0;n--;)"."===r[n]?r.splice(n,1):".."===r[n]?(r.splice(n,1),s++):s&&(0===n&&(o=!0),r.splice(n,1),s--);return o&&r.unshift(""),"."!==i&&".."!==i||r.push(""),r.join("/")}(w.pathname,e.pathname)),"/"!==w.pathname.charAt(0)&&g(w.protocol)&&(w.pathname="/"+w.pathname),n(w.port,w.protocol)||(w.host=w.hostname,w.port=""),w.username=w.password="",w.auth&&(~(d=w.auth.indexOf(":"))?(w.username=w.auth.slice(0,d),w.username=encodeURIComponent(decodeURIComponent(w.username)),w.password=w.auth.slice(d+1),w.password=encodeURIComponent(decodeURIComponent(w.password))):w.username=encodeURIComponent(decodeURIComponent(w.auth)),w.auth=w.password?w.username+":"+w.password:w.username),w.origin="file:"!==w.protocol&&g(w.protocol)&&w.host?w.protocol+"//"+w.host:"null",w.href=w.toString()}_.prototype={set:function(t,e,r){var o=this;switch(t){case"query":"string"==typeof e&&e.length&&(e=(r||i.parse)(e)),o[t]=e;break;case"port":o[t]=e,n(e,o.protocol)?e&&(o.host=o.hostname+":"+e):(o.host=o.hostname,o[t]="");break;case"hostname":o[t]=e,o.port&&(e+=":"+o.port),o.host=e;break;case"host":o[t]=e,u.test(e)?(e=e.split(":"),o.port=e.pop(),o.hostname=e.join(":")):(o.hostname=e,o.port="");break;case"protocol":o.protocol=e.toLowerCase(),o.slashes=!r;break;case"pathname":case"hash":if(e){var s="pathname"===t?"/":"#";o[t]=e.charAt(0)!==s?s+e:e}else o[t]=e;break;case"username":case"password":o[t]=encodeURIComponent(e);break;case"auth":var a=e.indexOf(":");~a?(o.username=e.slice(0,a),o.username=encodeURIComponent(decodeURIComponent(o.username)),o.password=e.slice(a+1),o.password=encodeURIComponent(decodeURIComponent(o.password))):o.username=encodeURIComponent(decodeURIComponent(e))}for(var l=0;l<h.length;l++){var c=h[l];c[4]&&(o[c[1]]=o[c[1]].toLowerCase())}return o.auth=o.password?o.username+":"+o.password:o.username,o.origin="file:"!==o.protocol&&g(o.protocol)&&o.host?o.protocol+"//"+o.host:"null",o.href=o.toString(),o},toString:function(t){t&&"function"==typeof t||(t=i.stringify);var e,r=this,n=r.host,o=r.protocol;o&&":"!==o.charAt(o.length-1)&&(o+=":");var s=o+(r.protocol&&r.slashes||g(r.protocol)?"//":"");return r.username?(s+=r.username,r.password&&(s+=":"+r.password),s+="@"):r.password?(s+=":"+r.password,s+="@"):"file:"!==r.protocol&&g(r.protocol)&&!n&&"/"!==r.pathname&&(s+="@"),(":"===n[n.length-1]||u.test(r.hostname)&&!r.port)&&(n+=":"),s+=n+r.pathname,(e="object"==typeof r.query?t(r.query):r.query)&&(s+="?"!==e.charAt(0)?"?"+e:e),r.hash&&(s+=r.hash),s}},_.extractProtocol=y,_.location=f,_.trimLeft=p,_.qs=i,t.exports=_}).call(e,r(12))},function(t,e,r){"use strict";t.exports=function(t,e){if(e=e.split(":")[0],!(t=+t))return!1;switch(e){case"http":case"ws":return 80!==t;case"https":case"wss":return 443!==t;case"ftp":return 21!==t;case"gopher":return 70!==t;case"file":return!1}return 0!==t}},function(t,e,r){"use strict";var n,i=Object.prototype.hasOwnProperty;function o(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch(t){return null}}function s(t){try{return encodeURIComponent(t)}catch(t){return null}}e.stringify=function(t,e){e=e||"";var r,o,a=[];for(o in"string"!=typeof e&&(e="?"),t)if(i.call(t,o)){if((r=t[o])||null!==r&&r!==n&&!isNaN(r)||(r=""),o=s(o),r=s(r),null===o||null===r)continue;a.push(o+"="+r)}return a.length?e+a.join("&"):""},e.parse=function(t){for(var e,r=/([^=?#&]+)=?([^&]*)/g,n={};e=r.exec(t);){var i=o(e[1]),s=o(e[2]);null===i||null===s||i in n||(n[i]=s)}return n}},function(t,e,r){"use strict";e.a=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0,r="x"===t?e:3&e|8;return r.toString(16)})}},function(t,e,r){"use strict";function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,o(n.key),n)}}function o(t){var e=function(t,e){if("object"!=n(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==n(e)?e:String(e)}r.d(e,"a",function(){return s});var s=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return function(t,e,r){e&&i(t.prototype,e),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1})}(t,[{key:"listAllUploads",value:function(){return Promise.resolve([])}},{key:"findUploadsByFingerprint",value:function(t){return Promise.resolve([])}},{key:"removeUpload",value:function(t){return Promise.resolve()}},{key:"addUpload",value:function(t,e){return Promise.resolve(null)}}]),t}()},function(t,e,r){"use strict";function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,o(n.key),n)}}function o(t){var e=function(t,e){if("object"!=n(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==n(e)?e:String(e)}r.d(e,"b",function(){return l}),r.d(e,"a",function(){return c});var s=!1;try{s="localStorage"in window;var a="tusSupport",u=localStorage.getItem(a);localStorage.setItem(a,u),null===u&&localStorage.removeItem(a)}catch(t){if(t.code!==t.SECURITY_ERR&&t.code!==t.QUOTA_EXCEEDED_ERR)throw t;s=!1}var l=s,c=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return function(t,e,r){e&&i(t.prototype,e),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1})}(t,[{key:"findAllUploads",value:function(){var t=this._findEntries("tus::");return Promise.resolve(t)}},{key:"findUploadsByFingerprint",value:function(t){var e=this._findEntries("tus::".concat(t,"::"));return Promise.resolve(e)}},{key:"removeUpload",value:function(t){return localStorage.removeItem(t),Promise.resolve()}},{key:"addUpload",value:function(t,e){var r=Math.round(1e12*Math.random()),n="tus::".concat(t,"::").concat(r);return localStorage.setItem(n,JSON.stringify(e)),Promise.resolve(n)}},{key:"_findEntries",value:function(t){for(var e=[],r=0;r<localStorage.length;r++){var n=localStorage.key(r);if(0===n.indexOf(t))try{var i=JSON.parse(localStorage.getItem(n));i.urlStorageKey=n,e.push(i)}catch(t){}}return e}}]),t}()},function(t,e,r){"use strict";function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,a(n.key),n)}}function s(t,e,r){return e&&o(t.prototype,e),r&&o(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function a(t){var e=function(t,e){if("object"!=n(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==n(e)?e:String(e)}r.d(e,"a",function(){return u});var u=function(){function t(){i(this,t)}return s(t,[{key:"createRequest",value:function(t,e){return new l(t,e)}},{key:"getName",value:function(){return"XHRHttpStack"}}]),t}(),l=function(){function t(e,r){i(this,t),this._xhr=new XMLHttpRequest,this._xhr.open(e,r,!0),this._method=e,this._url=r,this._headers={}}return s(t,[{key:"getMethod",value:function(){return this._method}},{key:"getURL",value:function(){return this._url}},{key:"setHeader",value:function(t,e){this._xhr.setRequestHeader(t,e),this._headers[t]=e}},{key:"getHeader",value:function(t){return this._headers[t]}},{key:"setProgressHandler",value:function(t){"upload"in this._xhr&&(this._xhr.upload.onprogress=function(e){e.lengthComputable&&t(e.loaded)})}},{key:"send",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return new Promise(function(r,n){t._xhr.onload=function(){r(new c(t._xhr))},t._xhr.onerror=function(t){n(t)},t._xhr.send(e)})}},{key:"abort",value:function(){return this._xhr.abort(),Promise.resolve()}},{key:"getUnderlyingObject",value:function(){return this._xhr}}]),t}(),c=function(){function t(e){i(this,t),this._xhr=e}return s(t,[{key:"getStatus",value:function(){return this._xhr.status}},{key:"getHeader",value:function(t){return this._xhr.getResponseHeader(t)}},{key:"getBody",value:function(){return this._xhr.responseText}},{key:"getUnderlyingObject",value:function(){return this._xhr}}]),t}()},function(t,e,r){"use strict";r.d(e,"a",function(){return h});var n=r(117),i=r(167),o=r(168),s=r(171);function a(t){"@babel/helpers - typeof";return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function u(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */u=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",l=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function p(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{p({},"")}catch(t){p=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var o=e&&e.prototype instanceof m?e:m,s=Object.create(o.prototype),a=new I(n||[]);return i(s,"_invoke",{value:O(t,r,a)}),s}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var f="suspendedStart",g="suspendedYield",y="executing",_="completed",v={};function m(){}function b(){}function w(){}var E={};p(E,s,function(){return this});var P=Object.getPrototypeOf,S=P&&P(P(M([])));S&&S!==r&&n.call(S,s)&&(E=S);var x=w.prototype=m.prototype=Object.create(E);function k(t){["next","throw","return"].forEach(function(e){p(t,e,function(t){return this._invoke(e,t)})})}function A(t,e){function r(i,o,s,u){var l=d(t[i],t,o);if("throw"!==l.type){var c=l.arg,p=c.value;return p&&"object"==a(p)&&n.call(p,"__await")?e.resolve(p.__await).then(function(t){r("next",t,s,u)},function(t){r("throw",t,s,u)}):e.resolve(p).then(function(t){c.value=t,s(c)},function(t){return r("throw",t,s,u)})}u(l.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e(function(e,i){r(t,n,e,i)})}return o=o?o.then(i,i):i()}})}function O(e,r,n){var i=f;return function(o,s){if(i===y)throw new Error("Generator is already running");if(i===_){if("throw"===o)throw s;return{value:t,done:!0}}for(n.method=o,n.arg=s;;){var a=n.delegate;if(a){var u=T(a,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===f)throw i=_,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=y;var l=d(e,r,n);if("normal"===l.type){if(i=n.done?_:g,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=_,n.method="throw",n.arg=l.arg)}}}function T(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,T(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var o=d(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var s=o.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function R(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(R,this),this.reset(!0)}function M(e){if(e||""===e){var r=e[s];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}throw new TypeError(a(e)+" is not iterable")}return b.prototype=w,i(x,"constructor",{value:w,configurable:!0}),i(w,"constructor",{value:b,configurable:!0}),b.displayName=p(w,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,p(t,c,"GeneratorFunction")),t.prototype=Object.create(x),t},e.awrap=function(t){return{__await:t}},k(A.prototype),p(A.prototype,l,function(){return this}),e.AsyncIterator=A,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var s=new A(h(t,r,n,i),o);return e.isGeneratorFunction(r)?s:s.next().then(function(t){return t.done?t.value:s.next()})},k(x),p(x,c,"Generator"),p(x,s,function(){return this}),p(x,"toString",function(){return"[object Generator]"}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=M,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return a.type="throw",a.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return i("end");if(s.tryLoc<=this.prev){var u=n.call(s,"catchLoc"),l=n.call(s,"finallyLoc");if(u&&l){if(this.prev<s.catchLoc)return i(s.catchLoc,!0);if(this.prev<s.finallyLoc)return i(s.finallyLoc)}else if(u){if(this.prev<s.catchLoc)return i(s.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return i(s.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=t,s.arg=e,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;C(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function l(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,i)}function c(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,p(n.key),n)}}function p(t){var e=function(t,e){if("object"!=a(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==a(e)?e:String(e)}var h=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return function(t,e,r){e&&c(t.prototype,e),r&&c(t,r),Object.defineProperty(t,"prototype",{writable:!1})}(t,[{key:"openFile",value:function(){var t=function(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(t){l(o,n,i,s,a,"next",t)}function a(t){l(o,n,i,s,a,"throw",t)}s(void 0)})}}(u().mark(function t(e,r){var a;return u().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!n.a()||!e||void 0===e.uri){t.next=11;break}return t.prev=1,t.next=4,i.a(e.uri);case 4:return a=t.sent,t.abrupt("return",new o.a(a));case 8:throw t.prev=8,t.t0=t.catch(1),new Error("tus: cannot fetch `file.uri` as Blob, make sure the uri is correct and accessible. ".concat(t.t0));case 11:if("function"!=typeof e.slice||void 0===e.size){t.next=13;break}return t.abrupt("return",Promise.resolve(new o.a(e)));case 13:if("function"!=typeof e.read){t.next=18;break}if(r=Number(r),Number.isFinite(r)){t.next=17;break}return t.abrupt("return",Promise.reject(new Error("cannot create source for stream without a finite value for the `chunkSize` option")));case 17:return t.abrupt("return",Promise.resolve(new s.a(e,r)));case 18:return t.abrupt("return",Promise.reject(new Error("source object may only be an instance of File, Blob, or Reader in this environment")));case 19:case"end":return t.stop()}},t,null,[[1,8]])}));return function(e,r){return t.apply(this,arguments)}}()}]),t}()},function(t,e,r){"use strict";e.a=function(t){return new Promise(function(e,r){var n=new XMLHttpRequest;n.responseType="blob",n.onload=function(){var t=n.response;e(t)},n.onerror=function(t){r(t)},n.open("GET",t),n.send()})}},function(t,e,r){"use strict";r.d(e,"a",function(){return u});var n=r(169),i=r(170);function o(t){"@babel/helpers - typeof";return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,a(n.key),n)}}function a(t){var e=function(t,e){if("object"!=o(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==o(e)?e:String(e)}var u=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._file=e,this.size=e.size}return function(t,e,r){e&&s(t.prototype,e),r&&s(t,r),Object.defineProperty(t,"prototype",{writable:!1})}(t,[{key:"slice",value:function(t,e){if(n.a())return i.a(this._file.slice(t,e));var r=this._file.slice(t,e),o=e>=this.size;return Promise.resolve({value:r,done:o})}},{key:"close",value:function(){}}]),t}()},function(t,e,r){"use strict";e.a=function(){return"undefined"!=typeof window&&(void 0!==window.PhoneGap||void 0!==window.Cordova||void 0!==window.cordova)}},function(t,e,r){"use strict";e.a=function(t){return new Promise(function(e,r){var n=new FileReader;n.onload=function(){var t=new Uint8Array(n.result);e({value:t})},n.onerror=function(t){r(t)},n.readAsArrayBuffer(t)})}},function(t,e,r){"use strict";function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,o(n.key),n)}}function o(t){var e=function(t,e){if("object"!=n(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==n(e)?e:String(e)}function s(t){return void 0===t?0:void 0!==t.size?t.size:t.length}r.d(e,"a",function(){return a});var a=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._buffer=void 0,this._bufferOffset=0,this._reader=e,this._done=!1}return function(t,e,r){e&&i(t.prototype,e),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1})}(t,[{key:"slice",value:function(t,e){return t<this._bufferOffset?Promise.reject(new Error("Requested data is before the reader's current offset")):this._readUntilEnoughDataOrDone(t,e)}},{key:"_readUntilEnoughDataOrDone",value:function(t,e){var r=this,n=e<=this._bufferOffset+s(this._buffer);if(this._done||n){var i=this._getDataFromBuffer(t,e),o=null==i&&this._done;return Promise.resolve({value:i,done:o})}return this._reader.read().then(function(n){var i=n.value;return n.done?r._done=!0:void 0===r._buffer?r._buffer=i:r._buffer=function(t,e){if(t.concat)return t.concat(e);if(t instanceof Blob)return new Blob([t,e],{type:t.type});if(t.set){var r=new t.constructor(t.length+e.length);return r.set(t),r.set(e,t.length),r}throw new Error("Unknown data type")}(r._buffer,i),r._readUntilEnoughDataOrDone(t,e)})}},{key:"_getDataFromBuffer",value:function(t,e){t>this._bufferOffset&&(this._buffer=this._buffer.slice(t-this._bufferOffset),this._bufferOffset=t);var r=0===s(this._buffer);return this._done&&r?null:this._buffer.slice(0,e-t)}},{key:"close",value:function(){this._reader.cancel&&this._reader.cancel()}}]),t}()},function(t,e,r){"use strict";e.a=function(t,e){if(n.a())return Promise.resolve(function(t,e){var r=t.exif?function(t){var e=0;if(0===t.length)return e;for(var r=0;r<t.length;r++){var n=t.charCodeAt(r);e=(e<<5)-e+n,e&=e}return e}(JSON.stringify(t.exif)):"noexif";return["tus-rn",t.name||"noname",t.size||"nosize",r,e.endpoint].join("/")}(t,e));return Promise.resolve(["tus-br",t.name,t.type,t.size,t.lastModified,e.endpoint].join("-"))};var n=r(117)},function(t,e,r){"use strict";var n=r(16),i={oncreate:function(){$(this.refs.nano).nanoScroller({preventPageScrolling:!0,disableResize:!0,contentClass:"scroll-content",paneClass:"scroll-pane"})},ondestroy:function(){$(this.refs.nano).nanoScroller({destroy:!0})},methods:{update:function(){$(this.refs.nano).nanoScroller()},scrollTop:function(){$(this.refs.nano).find(".scroll-content").animate({scrollTop:0},500)},scrollBottom:function(){$(this.refs.nano).nanoScroller({scroll:"bottom"})}}};function o(t){t=t||{},this.refs={},this._state=t.data||{},this._observers={pre:Object.create(null),post:Object.create(null)},this._handlers=Object.create(null),this._root=t._root||this,this._yield=t._yield,this._torndown=!1,this._fragment=function(t,e){var r,i;return{create:function(){r=n.e("div"),i=n.e("div"),this.hydrate()},hydrate:function(t){r.className="nano scrolling-container",i.className="scroll-content"},mount:function(t,o){n.l(r,t,o),e.refs.nano=r,n.b(i,r),e._yield&&e._yield.mount(i,null)},unmount:function(){n.i(r),e.refs.nano===r&&(e.refs.nano=null),e._yield&&e._yield.unmount()},destroy:n.m}}(this._state,this),t.target&&(this._fragment.create(),this._fragment.mount(t.target,null)),t._root?t._root._renderHooks.push(i.oncreate.bind(this)):i.oncreate.call(this)}n.c(o.prototype,i.methods,n.n),o.prototype._set=function(t){var e=this._state;this._state=n.c({},e,t),n.k(this,this._observers.pre,t,e),n.k(this,this._observers.post,t,e)},o.prototype.teardown=o.prototype.destroy=function(t){this.fire("destroy"),i.ondestroy.call(this),!1!==t&&this._fragment.unmount(),this._fragment.destroy(),this._fragment=null,this._state={},this._torndown=!0},e.a=o},function(t,e,r){"use strict";var n=r(57),i=r(16),o={data:function(){return{file:void 0,selected:!1,state:"paused",selectedIcon:"check"}},methods:{togglePlay:function(){var t=this.get("file");if("audio"!==t.type)return this.fire("select",t);if(!t.url)throw new Error("File is missing the URL");this.refs.Sounds.instance().load(t.id,t.url),this.refs.Sounds.instance().togglePlay(t.id)},_onSoundsStateChange:function(t){this.set({state:this.refs.Sounds.instance().getState(t)})}}};function s(t,e){var r,n;return{create:function(){r=i.f("svg"),n=i.f("use"),this.hydrate()},hydrate:function(t){i.p(r,"class","icon icon-error"),i.q(n,"xlink:href","#icon-error")},mount:function(t,e){i.l(r,t,e),i.b(n,r)},unmount:function(){i.i(r)},destroy:i.m}}function a(t,e){var r,n;return{create:function(){r=i.e("div"),this.hydrate()},hydrate:function(e){r.className="browser-image-prew_img",r.style.cssText=n="background-image: url('"+t.file.thumbnail+"')",i.p(r,"width","112"),i.p(r,"height","71")},mount:function(t,e){i.l(r,t,e)},update:function(t,e){n!==(n="background-image: url('"+e.file.thumbnail+"')")&&(r.style.cssText=n)},unmount:function(){i.i(r)},destroy:i.m}}function u(t,e){var r,n;return{create:function(){r=i.e("div"),n=i.g("Processing..."),this.hydrate()},hydrate:function(t){r.style.cssText="width: 100%"},mount:function(t,e){i.l(r,t,e),i.b(n,r)},update:i.m,unmount:function(){i.i(r)},destroy:i.m}}function l(t,e){var r,n;return{create:function(){r=i.e("div"),this.hydrate()},hydrate:function(e){r.className="progress-bar_fill",r.style.cssText=n="width: "+t.file.progress+"%"},mount:function(t,e){i.l(r,t,e)},update:function(t,e){n!==(n="width: "+e.file.progress+"%")&&(r.style.cssText=n)},unmount:function(){i.i(r)},destroy:i.m}}function c(t){t=t||{},this.refs={},this._state=i.c(o.data(),t.data),this._observers={pre:Object.create(null),post:Object.create(null)},this._handlers=Object.create(null),this._root=t._root||this,this._yield=t._yield,this._torndown=!1,document.getElementById("svelte-1106586334-style")||function(){var t=i.e("style");t.id="svelte-1106586334-style",t.textContent="\n [svelte-1106586334].browser-entry-icon, [svelte-1106586334] .browser-entry-icon {\n display: none;\n }\n\n [svelte-1106586334].upload--is-complete .browser-entry-icon, [svelte-1106586334] .upload--is-complete .browser-entry-icon {\n display: block;\n }\n\n [svelte-1106586334].browser-entry-info:before, [svelte-1106586334] .browser-entry-info:before {\n display: none;\n }\n\n [svelte-1106586334].browser-audio.upload--is-complete .browser-entry-info:before, [svelte-1106586334] .browser-audio.upload--is-complete .browser-entry-info:before {\n display: inline-block;\n }\n\n [svelte-1106586334].icon-error, [svelte-1106586334] .icon-error {\n position: absolute;\n top: 0;\n left: 45px;\n width: 20px;\n height: 100%;\n z-index: 1;\n }\n\n [svelte-1106586334].browser-image-prew_img, [svelte-1106586334] .browser-image-prew_img {\n opacity: 1;\n }\n\n [svelte-1106586334].upload-error .browser-entry-prew:after, [svelte-1106586334] .upload-error .browser-entry-prew:after {\n display: none;\n }\n\n [svelte-1106586334].upload--is-sending .browser-image-prew_img, [svelte-1106586334] .upload--is-sending .browser-image-prew_img,\n [svelte-1106586334].upload-error .browser-image-prew_img, [svelte-1106586334] .upload-error .browser-image-prew_img {\n opacity: .2;\n }\n\n [svelte-1106586334].progress-bar, [svelte-1106586334] .progress-bar {\n background: #cccacf;\n position: absolute;\n top: 32px;\n width: 80px;\n left: 15px;\n height: 7px;\n border-radius: 3px;\n font-family: 'ProximaNova-Regular';\n font-size: 12px;\n }\n [svelte-1106586334].progress-bar_fill, [svelte-1106586334] .progress-bar_fill {\n background: #adadb3;\n height: 100%;\n border-radius: inherit;\n transition: width 100ms linear;\n }\n\n [svelte-1106586334].upload--is-sending .progress-bar, [svelte-1106586334] .upload--is-sending .progress-bar {\n background: transparent;\n }\n\n [svelte-1106586334].upload--is-complete .progress-bar, [svelte-1106586334] .upload--is-complete .progress-bar {\n display: none;\n }\n",i.b(t,document.head)}(),this._renderHooks=[],this._fragment=function(t,e){var r,o,c,p,h,d,f,g,y,_,v,m,b,w,E=new n.a({_root:e._root,data:{service:"Sounds"}});function P(t){var r=e.get();e.fire("select",r.file)}E.on("state",function(t){var r=this._context.state;e._onSoundsStateChange(r.file.id)}),e.refs.Sounds=E,E._context={state:t};var S=t.file.error&&s(),x=t.file.thumbnail&&a(t);function k(t){return 100===t.file.progress&&"sending"===t.file.state?u:l}var A=k(t),O=A(t,e);function T(t){e.togglePlay()}return{create:function(){E._fragment.create(),r=i.g("\n\n"),o=i.e("div"),p=i.e("div"),d=i.e("span"),f=i.g("\n "),S&&S.create(),g=i.g("\n "),x&&x.create(),y=i.g("\n\n "),_=i.e("div"),O.create(),v=i.g("\n "),m=i.e("div"),w=i.g(b=t.file.name),this.hydrate()},hydrate:function(e){i.p(o,"svelte-1106586334",""),o.className=c="browser-"+t.file.type+" "+t.state+" browser-entry activateable upload--is-"+t.file.state+" "+(t.selected?"active":"")+" "+(t.file.error?"upload-error":""),p.className=h="browser-entry-prew browser-entry-prew--"+t.selectedIcon,i.a(p,"click",P),d.className="browser-entry-icon",_.className="progress-bar",m.className="browser-entry-info",i.a(m,"click",T)},mount:function(t,e){E._fragment.mount(t,e),i.l(r,t,e),i.l(o,t,e),i.b(p,o),i.b(d,p),i.b(f,p),S&&S.mount(p,null),i.b(g,p),x&&x.mount(p,null),i.b(y,p),i.b(_,p),O.mount(_,null),i.b(v,o),i.b(m,o),i.b(w,m)},update:function(t,r){E._context.state=r,c!==(c="browser-"+r.file.type+" "+r.state+" browser-entry activateable upload--is-"+r.file.state+" "+(r.selected?"active":"")+" "+(r.file.error?"upload-error":""))&&(o.className=c),h!==(h="browser-entry-prew browser-entry-prew--"+r.selectedIcon)&&(p.className=h),r.file.error?S||((S=s()).create(),S.mount(p,g)):S&&(S.unmount(),S.destroy(),S=null),r.file.thumbnail?x?x.update(t,r):((x=a(r)).create(),x.mount(p,y)):x&&(x.unmount(),x.destroy(),x=null),A===(A=k(r))&&O?O.update(t,r):(O.unmount(),O.destroy(),(O=A(r,e)).create(),O.mount(_,null)),b!==(b=r.file.name)&&(w.data=b)},unmount:function(){E._fragment.unmount(),i.i(r),i.i(o),S&&S.unmount(),x&&x.unmount(),O.unmount()},destroy:function(){e.refs.Sounds===E&&(e.refs.Sounds=null),E.destroy(!1),i.o(p,"click",P),S&&S.destroy(),x&&x.destroy(),O.destroy(),i.o(m,"click",T)}}}(this._state,this),t.target&&(this._fragment.create(),this._fragment.mount(t.target,null)),this._flush()}i.c(c.prototype,o.methods,i.n),c.prototype._set=function(t){var e=this._state;this._state=i.c({},e,t),i.k(this,this._observers.pre,t,e),this._fragment.update(t,this._state),i.k(this,this._observers.post,t,e),this._flush()},c.prototype.teardown=c.prototype.destroy=function(t){this.fire("destroy"),!1!==t&&this._fragment.unmount(),this._fragment.destroy(),this._fragment=null,this._state={},this._torndown=!0},e.a=c},function(t,e,r){var n,i,o,s,a,u,l,c=function(t,e){return function(){return t.apply(e,arguments)}},p={}.hasOwnProperty;i=window.require("spine/controller/activator"),n=window.require("spine/controller/activateable"),l=r(5),u=r(176),s=window.require("core/models/content"),o=r(177),a=function(t){function e(){this.onScroll=c(this.onScroll,this),this.activate=c(this.activate,this),this._onActivate=c(this._onActivate,this),this.addItem=c(this.addItem,this),this._release=c(this._release,this),this._relocate=c(this._relocate,this),this.scrollBottom=c(this.scrollBottom,this),this.scrollTop=c(this.scrollTop,this),this.onDrop=c(this.onDrop,this),this.onDrag=c(this.onDrag,this),this.onDragStart=c(this.onDragStart,this),this.initialize=c(this.initialize,this),e.__super__.constructor.apply(this,arguments),this.scroll(),this.container.sortable({itemSelector:".item-details",handle:".item-details-order",onDragStart:this.onDragStart,onDrop:this.onDrop,onDrag:this.onDrag}),this.bulkEditor=new o,this.bulkEditor.toggle(),this.bulkEditor.bind("toggle",function(t){return function(e){return setTimeout(function(){return t.scroll().update()},500)}}(this)),this.items=[]}return function(t,e){for(var r in e)p.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.prototype.className="editor-content",e.prototype.autoDeactivate=!1,e.prototype.title="Details",e.prototype.nextTitle="Edit Details",e.prototype.interval=0,e.prototype.vh=0,e.prototype.eof=0,e.include(n),e.include(l),e.prototype.for=function(t){return this.composition=t,this.initialize(),this.el.prepend(this.bulkEditor.el),this.bulkEditor.for(this.composition),this},e.prototype.initialize=function(t){return this.composition?(this.children(function(t){return t.release()}),this.stopListening(),this.listenTo(s,"create",this.addItem),this.composition.getContent().forEach(this.addItem),this.trigger("initialized")):console.warn("No composition set")},e.prototype.onDragStart=function(t,e,r){return t.controller().deactivate(),r(t,e),t.controller().deactivate(),this.scroll().update(),this.$item=$(t),this.vh=this.container.parent().height(),this.oh=this.container[0].scrollHeight,this.eof=this.el.offset()},e.prototype.onDrag=function(t,e,r){var n,i,o;if(r(t,e),i=this.$item.offset(),this.position=e,this.offset=i,this.dragged=this.$item,o=i.top-this.eof.top<30,n=i.top-this.eof.top>this.vh-10,!o&&!n)return clearInterval(this.interval),this.interval=0;if(o){if(0===this.interval)return this.interval=setInterval(this.scrollTop,10)}else if(n&&0===this.interval)return this.interval=setInterval(this.scrollBottom,10)},e.prototype.onDrop=function(t,e,r){return r(t,e),t.controller().onDrop(),this.$item=null,this._relocate(),clearInterval(this.interval),this.interval=0},e.prototype.scrollTop=function(){var t;if((t=this.container.scrollTop())>0)return this.scroll().scrollTo(t-4),this.dragged.css({top:parseInt(this.dragged.css("top"))-4})},e.prototype.scrollBottom=function(){var t,e;if(e=this.container.scrollTop(),(t=parseInt(this.dragged.css("top")))<this.oh-4)return this.scroll().scrollTo(e+4),this.dragged.css({top:4+t})},e.prototype._relocate=function(){return this.children(function(t){return t.item.order!==t.el.index()+1}).forEach(function(t){return t.item.updateAttribute("order",t.el.index()+1,{attribute:"order"})}),this.scroll().update()},e.prototype._release=function(){return e.__super__._release.apply(this,arguments),setTimeout(this._relocate,100),this.delay(function(t){return function(){if(t.isActive()&&0===t.children().length)return t.$trigger("DetailsEditor:empty")}}(this))},e.prototype.addItem=function(t){var e;if(t.composition_id===this.composition.id)return this.append(e=new u({item:t,meta:t.meta()})),t.updateAttribute("order",e.el.index()+1,{attribute:"order"}),this.scroll().update(),this.items.push(e)},e.prototype._onActivate=function(){var t;if(!this.children(function(t){return t.isActive()}).length)return null!=(t=this.children(function(t){return!t.isInvalid})[0])&&t.activate({animate:!0}),this.scroll().update()},e.prototype.activate=function(){return n.activate.apply(this,arguments),this.$trigger("viewChange","details"),this.delay(this._onActivate),this},e.prototype.onScroll=function(){return this.children(function(t){var e;return"function"==typeof(e=t.attributes).deactivate?e.deactivate():void 0})},e}(),t.exports=a},function(t,e,r){var n,i,o,s,a,u=function(t,e){return function(){return t.apply(e,arguments)}},l={}.hasOwnProperty;s=window.require("spine/controller"),o=window.require("spine/controller/container"),n=window.require("spine/controller/activateable"),i=r(118),a=function(t){function e(){var t,r,n,o;this._onItemValidation=u(this._onItemValidation,this),this.destroy=u(this.destroy,this),this.toggle=u(this.toggle,this),this._change=u(this._change,this),e.__super__.constructor.apply(this,arguments),this.item.bind("destroy",this.release),this.item.bind("change",this._change),r="<div class='item-details-order'></div>",o="<div class='item-details-toggle'></div>",t="<div class='item-details-delete' data-icon='⏍'></div>",n=$("<div class='item-details-right'></div>"),this.attributes=new i({options:this.meta.attributes,item:this.item}),n.append(o,t),this.append(r,this.attributes,n)}return function(t,e){for(var r in e)l.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,s),e.prototype.className="item-details",e.prototype.tag="li",e.include(o),e.include(n),e.prototype.elements={".item-details-order":"place",".item-details-toggle":"toggleButton"},e.prototype.events={"click .item-details-toggle":"toggle","click .item-details-delete":"destroy",invalid:"_onItemValidation",valid:"_onItemValidation"},e.prototype._change=function(t,e,r){if("order"===r.attribute)return this.place.html(t.order)},e.prototype.activate=function(t){if(null==t&&(t={}),!(this.attributes.length<2||this.isInvalid))return n.activate.apply(this,[t]),t.animate&&this.animateFirstAttribute(),this.attributes.update()},e.prototype.deactivate=function(){return n.deactivate.apply(this,arguments),this.attributes.deactivate()},e.prototype.toggle=function(){return this.isActive()?this.deactivate():this.activate(),this.parent().scroll().update()},e.prototype.destroy=function(){return this.item.destroy()},e.prototype._onItemValidation=function(t){if(this.isInvalid="invalid"===t.type&&this.attributes.el.children().first().is(t.target),this.el.toggleClass("item-invalid",this.isInvalid),this.isInvalid)return this.deactivate()},e.prototype.animateFirstAttribute=function(){var t;return t=this.el.height(),this.el.height(this.el.css("minHeight")),this.el.addClass("transitions").on("transitionend webkitTransitionEnd",function(t){return function(e){if($(e.target).is(t.el))return t.el.removeAttr("style").removeClass("transitions"),t.parent().scroll().update(),t.el.off("transitionend webkitTransitionEnd")}}(this)).height(t)},e.prototype.onDrop=function(){return this.attributes.onDrop()},e}(),t.exports=a},function(t,e,r){var n,i,o,s,a=function(t,e){return function(){return t.apply(e,arguments)}},u={}.hasOwnProperty;s=window.require("spine/controller"),o=window.require("core/models/content"),n=r(178),i=function(t){function e(){return this.onItemChange=a(this.onItemChange,this),this.updateItemAttributes=a(this.updateItemAttributes,this),this.onItemAdded=a(this.onItemAdded,this),this._change=a(this._change,this),this.initialize=a(this.initialize,this),this.for=a(this.for,this),this.toggle=a(this.toggle,this),e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var r in e)u.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,s),e.prototype.className="details_bulk-editor activateable",e.prototype.elements={".item-details":"attributesEl"},e.prototype.events={"click .item-toggle":"toggle"},e.prototype._isActive=!1,e.prototype.template=function(){return'<div class="bulk-editor-header">\n\t<div class="bulk-editor-title">'+this.options.title+"</div>\n\t<div class='item-details-right'>\n\t\t"+(this.options.help_text?'<div class="control-help" data-tooltip-text="'+this.options.help_text+'"></div>':"")+'\n\t\t<div class="item-toggle multi-tabs-toggle" data-icon="❯">\n\t\t\t<span data-icon="❯"></span>\n\t\t</div>\n\t</div>\n</div>\n<div class="item-details"></div>'},e.prototype.toggle=function(){return this._isActive=!this._isActive,this.trigger("toggle",this._isActive),this.el.toggleClass("active",this._isActive),this.attributesEl.css({"margin-bottom":this._isActive?0:-this.attributesElHeight})},e.prototype.for=function(t){return this.composition=t,null==this.composition.contentMeta().bulkEditor?this.el.addClass("empty"):(this.item=this.composition.bulkContent(),this.item.bind("change",this._change),this.listenTo(o,"create",this.onItemAdded),this.listenTo(o,"change",this.onItemChange),this.initialize(this.composition.contentMeta()))},e.prototype.initialize=function(t){var e,r,i,o;for(this.options=t.bulkEditor,this.render(),this.numAttributes=this.options.attributes.length,this.el.toggleClass("single-attribute",1===this.numAttributes),r=0,i=(o=this.options.attributes).length;r<i;r++)e=o[r],(this.attributes||(this.attributes={}))[e]=t.attributes[e];return this.attrPanel=new n({options:this.attributes,item:this.item,el:this.attributesEl}),this.attributesElHeight=this.attributesEl.outerHeight()},e.prototype._change=function(t,e,r){var n;if("metadata"!==(n=r.attribute))return this.composition.getContent().forEach(function(t){return function(e){if(e.id!==t.item.id&&!e.editedMeta(n))return e.attrMeta(n,!1),e.updateAttribute(n,t.item[n],{attribute:n,from:t})}}(this))},e.prototype.onItemAdded=function(t){if(t.composition_id===this.composition.id)return this.updateItemAttributes(o.find(t.id))},e.prototype.updateItemAttributes=function(t){var e,r,n;if(t.composition_id===this.composition.id){for(e in n=[],r=this.attributes)r[e],t.editedMeta(e)||t[e]===this.item[e]||(t.attrMeta(e,!1,{silent:!0}),n.push(t.updateAttribute(e,this.item[e],{attribute:e,from:this})));return n}},e.prototype.onItemChange=function(t,e,r){var n,i,o,s,a;if("metadata"===r.attribute&&!r.silent){for(a=[],i=0,o=(s=this.composition.getContent()).length;i<o;i++)(n=s[i]).id===t.id&&a.push(this.updateItemAttributes(n));return a}},e}(),t.exports=i},function(t,e,r){var n,i,o,s={}.hasOwnProperty;o=window.require("spine/controller"),n=r(118),i=function(t){function e(){e.__super__.constructor.apply(this,arguments),this.attributes=new n({options:this.options,item:this.item,isEditable:function(){return!0}}),this.el.append(this.attributes.el)}return function(t,e){for(var r in e)s.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,o),e}(),t.exports=i},function(t,e){var r,n,i,o,s=function(t,e){return function(){return t.apply(e,arguments)}},a={}.hasOwnProperty;n=window.require("spine/controller"),r=window.require("spine/controller/activateable"),window.require("core/models/composition"),o=window.require("core/models/widget"),window.require("core/models/user"),i=function(t){function e(){this.onPopupClose=s(this.onPopupClose,this),this.notifyShareIntent=s(this.notifyShareIntent,this),this.publishComposition=s(this.publishComposition,this),this.ready=s(this.ready,this),this._activate=s(this._activate,this),e.__super__.constructor.apply(this,arguments),this.render()}return function(t,e){for(var r in e)a.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,n),e.prototype.className="embedder",e.prototype.template="editor/views/embed",e.prototype.nextTitle="Publish",e.prototype.title="Done",e.include(r),e.prototype.elements={".view-comp-btn":"compBtn",".ready-icon":"readyIcon"},e.prototype.events={"click .share-btn":"notifyShareIntent"},e.prototype.for=function(t){if(this.composition=t,this.composition.isPersisted())return this.widget||(this.widget=o.find(this.composition.widget_id))},e.prototype.activate=function(){if(!this.isActive())return this.$trigger("viewChange","save"),this.publishComposition().then(this.for.bind(this,this.composition)).then(this._activate).then(this.ready)},e.prototype._activate=function(){return r.activate.apply(this,arguments)},e.prototype.ready=function(){return this.delay($.fn.show.bind(this.readyIcon))},e.prototype.publishComposition=function(){return this.composition.persist().then(function(t){return function(e){return t.$trigger("composition:save",e)}}(this)).fail(function(t){return function(e){return console.warn("Persisting the composition failed. Saved as temporary."),t.$trigger("composition:temporary:save",t.composition)}}(this))},e.prototype.notifyShareIntent=function(t){return t.preventDefault(),this.$trigger("sharew-intent",$(t.target).data("target"))},e.prototype.onPopupClose=function(){if(this.pop)return this.$trigger("Save:close",this.pop=!1)},e}(),t.exports=i},function(t,e,r){var n,i,o={}.hasOwnProperty;i=r(14),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var r in e)o.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.prototype.className="popup login-popup",e.prototype.confirmBtnClass="dim-button button--uc login-button",e.prototype.cancelBtnClass="green-button button--uc button--icon-right button--go register-button",e.prototype.title="Login or sign up.",e.prototype.content="",e.prototype.note="",e.prototype.separator=!1,e.prototype.confirmBtn="Log in",e.prototype.cancelBtn="Sign up free",e.prototype.setTitle=function(t){return null==t&&(t="Login or sign up."),this.title=t,this.render(this),this},e.prototype.place=function(t){return this.pop=this.pop.bind(this,t)},e.prototype.onConfirm=function(){return this.$trigger("login-intent")},e.prototype.onCancel=function(){return this.$trigger("signup-intent")},e}(),t.exports=new n},function(t,e){var r,n,i,o=function(t,e){return function(){return t.apply(e,arguments)}},s={}.hasOwnProperty;i=window.require("spine/controller"),r=window.require("spine/controller/activateable"),n=function(t){function e(){return this.render=o(this.render,this),e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var r in e)s.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.include(r),e.prototype.tag="a",e.prototype.events={click:"click"},e.prototype.render=function(){return this.$addClass(this.panel.title.toLowerCase()).html(this.panel.title),this},e.prototype.click=function(){return this.$trigger("Breadcrumb:step",this.panel.title.toLowerCase())},e}(),t.exports=n},function(t,e){var r,n,i,o,s=function(t,e){return function(){return t.apply(e,arguments)}},a={}.hasOwnProperty;window.require("core/models/skin"),r=window.require("core/models/content"),n=window.require("spine/core/events"),i=window.require("spine/core/module"),o=function(t){function e(t){this.remote=t,this.release=s(this.release,this),this.removeDemoContent=s(this.removeDemoContent,this),this.addContent=s(this.addContent,this),this.resize=s(this.resize,this),this.load=s(this.load,this),this.style=$('<style type="text/css">'),e.__super__.constructor.apply(this,arguments),this.currentWidget=this.remote.getPreview().widget(),this._loadDependencies()}return function(t,e){for(var r in e)a.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.include(n),e.prototype.load=function(t){return this.composition=t,this.stopListening(r,"create",this.removeDemoContent),this.stopListening(r,"create",this.addContent),this.composition.getContent().length||this.listenTo(r,"create",this.removeDemoContent),this.listenTo(r,"create",this.addContent),this.listenTo(this.composition,"update",this.resize),this.lastSkin&&this.setSkin(this.lastSkin),this.trigger("initialized"),this},e.prototype.resize=function(t){return this.currentWidget.resize()},e.prototype.addContent=function(t){if(t.composition_id===this.composition.id)return this.currentWidget.addContent(t)},e.prototype.removeDemoContent=function(t){if(t.composition_id===this.composition.id)return r.all().filter(function(t){return t._isDemoContent}).forEach(function(t){return t.destroy()}),this.currentWidget.clearContent(),this.stopListening(r,"create",this.removeDemoContent)},e.prototype.setSkin=function(t){return this.lastSkin=t,this.currentWidget.setSkin(this.lastSkin)},e.prototype._loadDependencies=function(){var t;if(null!=this.remote.window.SoundManager&&(t=new this.remote.window.SoundManager),null!=this.remote.window.soundManager&&(t=this.remote.window.soundManager),t&&(window.soundManager=t,t.setup(this.remote.window.soundManager.setup())),!window.videojs)return window.videojs=this.remote.window.videojs},e.prototype.release=function(){return this.trigger("release",this),this.unbind(),this.stopListening()},e}(),t.exports=o},function(t,e,r){var n={"./audio.coffee":20,"./browser.coffee":184,"./color.coffee":91,"./date-time/calendar/index.coffee":21,"./date-time/calendar/months.coffee":22,"./date-time/calendar/years.coffee":23,"./date-time/clock.coffee":24,"./date-time/helper.coffee":25,"./date-time/index.coffee":92,"./date-time/popup.coffee":26,"./details/audio.coffee":93,"./details/image.coffee":94,"./details/video.coffee":95,"./dropdown.coffee":7,"./font/font-item.coffee":30,"./font/font-list.coffee":31,"./font/fonts-popup.coffee":32,"./font/index.coffee":96,"./image.coffee":28,"./index.coffee":2,"./orderPicker.coffee":97,"./position/grid-panel.coffee":33,"./position/index.coffee":98,"./position/panel.coffee":6,"./position/pixel-panel.coffee":35,"./position/popup.coffee":34,"./position/reference-panel.coffee":36,"./range.coffee":99,"./rss.coffee":100,"./scale.coffee":101,"./slider.coffee":102,"./stepper.coffee":3,"./text.coffee":11,"./textarea.coffee":103,"./toggle.coffee":104,"./url.coffee":4,"./video.coffee":29};function i(t){return r(o(t))}function o(t){var e=n[t];if(!(e+1))throw new Error("Cannot find module '"+t+"'.");return e}i.keys=function(){return Object.keys(n)},i.resolve=o,t.exports=i,i.id=183},function(t,e,r){var n,i,o,s,a,u,l,c,p,h,d,f=function(t,e){return function(){return t.apply(e,arguments)}},g=function(t,e){for(var r in e)y.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},y={}.hasOwnProperty;u=r(2),l=window.require("spine/controller"),n=window.require("spine/controller/activateable"),a=window.require("spine/controller/container"),h=window.require("spine/controller/tabs"),p=r(106),i=r(50),d=r(112),c=function(t){function e(t){var r;this.onChange=f(this.onChange,this),this.clear=f(this.clear,this),e.__super__.constructor.apply(this,arguments),$.extend(t.options,{readonly:!1}),r=window.require(t.control),this.control=new r({attribute:this.attribute,options:t.options}),this.append(this.control,"<span class='field-delete' data-icon='⏍'></span>"),this.control.bind("change:"+this.control.type,this.onChange),this.recount=function(){},this.addEntry=function(t){return function(e){var r;return null==e&&(e={}),t.control.update(e.url),t.tab.count((r=Boolean(e.url||!1))>>0),t.el.toggleClass("old",r)}}(this),this.removeEntry=function(t){return function(e){return null==e&&(e={}),t.control.update(""),t.tab.count(0),t.el.toggleClass("old",!1)}}(this)}return g(e,l),e.prototype.title="directinput",e.prototype.serviceTitle="link",e.prototype.className="directinput directinputpopup",e.include(n),e.include(a),e.prototype.attributes={authenticated:!0},e.prototype.containerClass="directinput-field",e.prototype.events={"click .field-delete":"clear"},e.prototype.clear=function(){return this.control.update(""),this.onChange()},e.prototype.onChange=function(t){var e;return null==t&&(t={}),this.tab.count((e=Boolean(t.value||!1))>>0),this.el.toggleClass("old",e),this.trigger("beforeChange"),e?this.trigger("urlChange",{url:t.value,service:null}):this.trigger("urlRemove")},e.prototype.release=function(){return this.control.release(),e.__super__.release.apply(this,arguments)},e}(),s=function(t){function e(t,r,n){this.anchor=n,this.activate=f(this.activate,this),this.deactivate=f(this.deactivate,this),this.set=f(this.set,this),this.clearServices=f(this.clearServices,this),this.contentRemove=f(this.contentRemove,this),this.contentCanAdd=f(this.contentCanAdd,this),this.contentAdd=f(this.contentAdd,this),this.addBrowser=f(this.addBrowser,this),e.__super__.constructor.apply(this,arguments),this.input=new c(r),this.browsers=[],this.input.bind("beforeChange",this.clearServices),this.input.bind("urlChange",this.contentAdd),this.input.bind("urlRemove",this.contentRemove),delete this.sources.websearch,delete this.sources.blogvio,delete this.sources.dropbox,delete this.sources.flickr,delete this.sources["google-drive"],this.$bind("click",function(t){return t.stopPropagation()}),this.listenTo($("body"),"click",function(t){return function(){if(t.isActive())return t.deactivate()}}(this))}return g(e,h),e.prototype.className="content-browser browser-popup",e.prototype.tabContainerClass="content-browser-tabs",e.prototype.containerClass="content-browser-container",e.prototype.tabRenderer=p,e.include(n),e.prototype.interval=0,e.prototype.events={"click .message .close":"closeMessage","click .browser-logout":"deactivate"},e.prototype.elements={".message":"message",".message .text":"text"},e.prototype.children=function(t){var e,r,n,i;for(e in null==t&&(t=function(){return!0}),i=[],n=this.browsers)t(r=n[e])&&i.push(r);return i},e.prototype._initBrowsers=function(t){var e,r,n,o,s;for(n in t.append(this.el),this.addBrowser(d,{allowDelete:!1,allowClear:!1}),o=this.sources)s=o[n],e=window.require(s.module),r=null!=s.browser?window.require(s.browser):i,this.browsers[n]=r=new r({content:[],title:n,Service:e,options:$.extend({},this.options,s.options||{})}),this.listenTo(r,"add",this.contentAdd),this.listenTo(r,"remove",this.contentRemove),this.listenTo(r,"canAdd",this.contentCanAdd),this.append(r);return this.browsers.inpt=this.input,this.append(this.input)},e.prototype.addBrowser=function(t,e){var r,n;if(t.isCompatible(this.options.types))return(r=new t(Object.assign({filetypes:this.options.types},e))).on("toggle",function(e){return function(r){var n,i,o;return n=r.file,r.options,e.clear(),n.id!==(null!=(o=e.item)?o.id:void 0)?(i={id:n.id,url:n.url,service:t.name},e.item=i,e.trigger("select",i)):(e.item=null,e.trigger("select"))}}(this)),r.observe("selected",function(t){return r.tab.count(t.length)}),r.observe("loading",function(t){return function(e){var r;return r=$("style[id^=svelte]"),$(t.popup.head).append(r.clone())}}(this),{defer:!0}),n=function(e){return function(){var n;return(null!=(n=e.item)?n.service:void 0)===t.name?r.set({selected:[e.item.id]}):r.set({selected:[]})}}(this),this.on("select",n),n(),this.append(this.browsers[t.name]=r)},e.prototype.contentAdd=function(t){return t&&(this.item=t),this.trigger("select",t)},e.prototype.contentCanAdd=function(t){return this.clear(),null!=t?t.call(this):void 0},e.prototype.contentRemove=function(t){if(null!=this.item)return this.item=null,this.trigger("select")},e.prototype.clearServices=function(){var t;if(this.item)return null!=(t=this.browsers[this.item.service])&&"function"==typeof t.removeEntry?t.removeEntry(this.item):void 0},e.prototype.clear=function(){var t;if(this.item)return"function"==typeof(t=this.browsers[this.item.service||"inpt"]).removeEntry?t.removeEntry(this.item):void 0},e.prototype.set=function(t){return this.clear(),this.item=t},e.prototype.deactivate=function(){var t;return null!=(t=this.popup)&&t.hide(),n.deactivate.apply(this,arguments)},e.prototype.activate=function(){return this._createPopup().then(function(t){return function(){var e;return t.popup.show(),t.item?((e=t.browsers[t.item.service||"inpt"]).active(),t.set(t.item),e.recount()):t.children(function(t){return t.isActive()}).length<1&&t.children()[0].active(),n.activate.apply(t,arguments)}}(this))},e.prototype.release=function(){var t,r,n;for(t in this.input.release(),r=this.browsers)r[t].release();return null!=(n=this.popup)&&n.release(),e.__super__.release.apply(this,arguments)},e.prototype._createPopup=function(){return this.popupPromise?this.popupPromise:this.popupPromise=Blogvio.UI.popup.new({anchor:this.anchor,topOffset:6,leftOffset:-9,css:["https://widgetic.com/bundles/blogvioapp/css/editor/editor.css"]}).then(function(t){return function(e){return t.popup=e,t._initBrowsers(t.popup),t.popup.append(t.el)}}(this)).fail(function(t){return console.error(t.stack)})},e}(),o=function(t){function e(){var t,r;this.deactivate=f(this.deactivate,this),this.browse=f(this.browse,this),this.select=f(this.select,this),this.setItem=f(this.setItem,this),this.update=f(this.update,this),e.__super__.constructor.apply(this,arguments),(r=$.extend({},this.options.input))&&(r.options.readonly=!0,t=window.require(r.control),this.control=new t({item:this.item,attribute:this.attribute,options:r.options,isDetailInput:this.isDetailInput}),this.input.prepend(this.control.el)),this.options.browser&&(this.browserPopup=new s(this.options.browser,this.options.input,this.browseButton),this.browserPopup.bind("select",this.select))}return g(e,u),e.prototype.template="core/views/browser",e.prototype.className="control control-browser",e.prototype.elements={".input-browser":"input",".input-browser-browse":"browseButton"},e.prototype.events={"click .input-browser-browse, input:text, .url-thumb":"browse"},e.prototype.update=function(t,e,r){var n;if(null==r&&(r={}),t[this.attribute]&&r.from!==this&&this.browserPopup)return this.browserPopup.set(("function"==typeof t.attrMeta?t.attrMeta(this.attribute):void 0)||(null!=(n=t.metas)?n[this.attribute]:void 0)||{url:t[this.attribute]})},e.prototype.setItem=function(t){return e.__super__.setItem.apply(this,arguments),this.control.setItem(t)},e.prototype.select=function(t){var e,r;return this.change(r=t?t.url:""),"function"==typeof(e=this.item).attrMeta&&e.attrMeta(this.attribute,(null!=t?t.service:void 0)?t:null),this.control.$addClass("valid"),this.trigger("change:"+(this.type||"control"),{attribute:this.attribute,val:r,value:r})},e.prototype.browse=function(t){return t.stopPropagation(),this.browserPopup.isActive()?this.browserPopup.deactivate():this.browserPopup.activate()},e.prototype.release=function(){var t,r;return null!=(t=this.control)&&t.release(),null!=(r=this.browserPopup)&&r.release(),e.__super__.release.apply(this,arguments)},e.prototype.deactivate=function(){return this.browserPopup.deactivate()},e}(),t.exports=o},function(t,e,r){var n={"./base/photoitem.coffee":186,"./cache.coffee":120,"./default.coffee":187,"./dropbox.coffee":188,"./facebook.coffee":189,"./flickr.coffee":190,"./google-drive-sdk.coffee":121,"./google-drive.coffee":191,"./instagram-social.coffee":192,"./instagram.coffee":193,"./share-popup.coffee":122,"./soundcloud.coffee":194};function i(t){return r(o(t))}function o(t){var e=n[t];if(!(e+1))throw new Error("Cannot find module '"+t+"'.");return e}i.keys=function(){return Object.keys(n)},i.resolve=o,t.exports=i,i.id=185},function(t,e){var r,n,i,o,s=function(t,e){return function(){return t.apply(e,arguments)}},a={}.hasOwnProperty;i=window.require("spine/controller"),r=window.require("spine/controller/activateable"),n=window.require("core/models/content"),o=function(t){function e(){this._create=s(this._create,this),this._destroy=s(this._destroy,this),this.error=s(this.error,this),this.done=s(this.done,this),this.toggle=s(this.toggle,this),e.__super__.constructor.apply(this,arguments),this.$bind("click",this.toggle),this.item=new n,this.listenTo(n,"destroy",this._destroy),this.listenTo(n,"create",this._create)}return function(t,e){for(var r in e)a.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,i),e.prototype.className="service-photo-item loading",e.prototype.elements={img:"img"},e.include(r),e.prototype.photoOptions=null,e.prototype.photoData=null,e.prototype.toggle=function(t){var e;if(!this.el.is(".loading"))return this.isActive()?this.item.destroy():((e={})[""+this.attribute]=this.photoData,e.options=this.photoOptions,this.item.updateAttributes(e,{attribute:this.attribute,from:this}))},e.prototype.done=function(){return this.$trigger("itemReady").$removeClass("loading")},e.prototype.error=function(){return this.$trigger("itemReady").release()},e.prototype._destroy=function(t){if(this.item&&t&&t.eql(this.item))return this.deactivate(),this.item=new n},e.prototype._create=function(t){if(this.item&&t&&t.eql(this.item))return this.activate()},e}(),t.exports=o},function(t,e,r){var n,i,o,s=function(t,e){return function(){return t.apply(e,arguments)}},a={}.hasOwnProperty;o=r(8),i=r(9),n=function(t){function e(){this.triggerAuthRequire=s(this.triggerAuthRequire,this),this.newEntry=s(this.newEntry,this),this.addContentEntry=s(this.addContentEntry,this),this.addItems=s(this.addItems,this),e.__super__.constructor.apply(this,arguments),this.title=""+this.title[0].toUpperCase()+this.title.slice(1),this.authenticated=!1,this.authPromise=(this.authDef=new $.Deferred).promise(),window.editor.el.bind("content:"+this.title.toLowerCase()+":add",this.addItems)}return function(t,e){for(var r in e)a.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,o),e.prototype.hideDisconnectBtn=!0,e.prototype._auth=function(t){if(this.triggerAuthRequire(t),this.trigger("auth",this.authenticated),this.authenticated)return setTimeout(function(t){return function(){return t.authDef.resolve()}}(this))},e.prototype.addItems=function(t,e){return null==e&&(e={items:[]}),this.authenticated||this.auth(!(this.authenticated=!0)),this.authPromise.then(function(t){return function(){return t.hasAddContentEntry||t.trigger("refresh",[t.addContentEntry()]),t.trigger("refresh",(e.items||[]).map(t.newEntry))}}(this))},e.prototype.refresh=function(t){return t},e.prototype.addContentEntry=function(){var t;return this.hasAddContentEntry=!0,(t=this.newEntry({name:"Add content",url:"/",type:"button"})).className="add-content-entity",t.bind("select",this.triggerAuthRequire.bind(this,!0)),t},e.prototype.newEntry=function(t){var e,r,n;for(r in e=new i({service:this,name:t.name||t.title||t.url,path:t.url,type:t.type,url:t.url}),t)n=t[r],e[r]=n;return e},e.prototype.getURL=function(t,e){return e(t.url)},e.prototype.preview=function(t){return t.url},e.prototype.deauth=function(){},e.prototype.triggerAuthRequire=function(t){return this.trigger("auth-req",{interactive:t,source:this.title,"content-type":this.options.types})},e}(),t.exports=n},function(t,e,r){var n,i,o,s,a,u,l,c=function(t,e){for(var r in e)p.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},p={}.hasOwnProperty,h=function(t,e){return function(){return t.apply(e,arguments)}};a=r(8),o=r(9),u='<a class="add-content-instr-link" target="_blank" href="http://blog.widgetic.com/post/101481120261/how-to-load-your-content-from-dropbox">How to load your content?</a>',n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return c(e,t),e.prototype.openWindow=function(t){return this.popup.location.href=t},e.prototype.openPopup=function(){return this.popup=window.open("/connect/dropbox.html","_dropboxOauthSigninWindow",this.popupWindowSpec(980,700))},e}(Dropbox.Drivers.Popup),l={client:{key:"ekn9VjZx0VA=|nnWESTkqe31UYqt/Qllbpa2sjX1YmmcmNEPH/vwn0w==",sandbox:!0,fileRoot:"auto"},driver:{receiverUrl:"https://widgetic.com/connect/dropbox",rememberUser:!0}},s={image:["image/png","image/jpeg","image/jpg","image/gif","image/bmp"],audio:["audio/mp3","audio/mpeg"],video:["video/mp4"],folder:["inode/directory"]},Dropbox.Stat.prototype.entry=function(t,e){var r,n;for(r in n={name:this.name,path:this.path,id:this.path},s)s[r].indexOf(this.mimeType)>-1&&(n.type=r);return new o(n)},i=function(t){function e(){var t;this.onAuth=h(this.onAuth,this),e.__super__.constructor.apply(this,arguments),this.authenticated=!1,(this.client=new Dropbox.Client(l.client)).authDriver(new n(l.driver)),this.allMime=[].concat.apply([],function(){var e,r,n,i;for(i=[],e=0,r=(n=this.options.types).length;e<r;e++)t=n[e],null!=s[t]&&i.push(s[t]);return i}.call(this)).concat(s.folder),this.root.navTitle="Dropbox/Apps/Blogvio"}return c(e,a),e.prototype.responses={},e.prototype.faqLink=$(u),e.prototype._auth=function(t){return null==t&&(t=!0),t&&n.prototype.openPopup(),this.client.authenticate({interactive:t},this.onAuth)},e.prototype.onAuth=function(t,e){if(this.trigger("auth",!t&&e.isAuthenticated()),t)return this.client.reset()},e.prototype.refresh=function(t){return this.client.stat(t.path,{readDir:!0,cacheHash:t.hash},function(e){return function(r,n,i){return t.hash=(null!=n?n.versionTag:void 0)||t.hash,r&&(r.status=304)?i=e.responses[t.hash]||[]:(i=i.filter(function(t){return e.allMime.indexOf(t.mimeType)>-1}).map(function(t){return t.entry()}),e.responses[t.hash]=i),e.trigger("refresh",i)}}(this))},e.prototype.getURL=function(t,e){return t.url?e(t.url):this.client.makeUrl(t.path,{downloadHack:!0,long:!0},function(t,r){return e(r.url)})},e.prototype.preview=function(t){return this.client.thumbnailUrl(t.path,{size:"m"})},e.prototype.deauth=function(){return this.client.signOut(function(t){return function(){return t.trigger("auth",!1)}}(this))},e}(),t.exports=i},function(t,e,r){var n,i,o,s=function(t,e){return function(){return t.apply(e,arguments)}},a={}.hasOwnProperty,u=[].indexOf||function(t){for(var e=0,r=this.length;e<r;e++)if(e in this&&this[e]===t)return e;return-1};o=r(8),n=r(9),i=function(t){function e(){this.getPermissions=s(this.getPermissions,this),this._onFBRespond=s(this._onFBRespond,this),this._requestFBPages=s(this._requestFBPages,this),this._requestFBPhotoSet=s(this._requestFBPhotoSet,this),this.getEntryFetchPath=s(this.getEntryFetchPath,this),e.__super__.constructor.apply(this,arguments),this.permissions={},this.authenticated=!1,this.root.id="me",this.root.album=!0,this.apiReady=e.initFB()}return function(t,e){for(var r in e)a.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,o),e.initFB=function(){return new Promise(function(t,e){return window.fbAsyncInit=function(){return FB.init({status:!0,cookie:!0,xfbml:!1,appId:"126231267555748"}),t()},function(t,e,r){var n,i;if(n=t.getElementsByTagName(e)[0],!t.getElementById(r))return(i=t.createElement(e)).id=r,i.src="//connect.facebook.net/en_US/all.js",n.parentNode.insertBefore(i,n)}(document,"script","facebook-jssdk")})},e.prototype.refresh=function(t){return this.entry=t,this.entry.children=[],this.pages=!1,this._requestFBPhotoSet(this.getEntryFetchPath(this.entry),this._onFBRespond)},e.prototype.getEntryFetchPath=function(t){var e,r;return r={},!!~this.options.types.indexOf("image")?(e="photos",r={fields:"id,images,name"}):(e="videos/uploaded",r={fields:"id,source,picture,description,format"}),t.album&&(e="albums",r={fields:"id, name, count"}),{path:t.id+"/"+e,options:r}},e.prototype._requestFBPhotoSet=function(t,e){var r,n;return r={},t.constructor===Object&&(t=(n=t).path,r=n.options),FB.api(t,"GET",r,e)},e.prototype._requestFBPages=function(){return FB.api("me/accounts",this._onFBRespond)},e.prototype._onFBRespond=function(t){var e,r,i,o,s,a,u,l;return e=t.data||[],(this.entry.root||this.entry.album)&&(e=e.filter(function(t){return t.count>0||t.perms&&t.category&&null==t.count})),e=this.mapEntries(e),!this.entry.root&&!this.entry.album||(null!=(s=this.entry.children)?s.filter(function(t){return t.my_album}).length:void 0)||(e||(e=[]),r=(a=!!~this.options.types.indexOf("image")?["Photos",this.entry.path+"/photos"]:["Videos",this.entry.path+"/videos"])[0],o=a[1],"me"===this.entry.id&&(r="My "+r),e.push(new n({service:this,name:r,path:o,id:this.entry.id,type:"folder",my_album:!0}))),!this.entry.root||null==this.permissions.manage_pages||this.permissions.manage_pages||(null!=(u=this.entry.children)?u.filter(function(t){return t.pages}).length:void 0)||(e.push(i=new n({service:this,name:"Pages",path:"accept_pages",type:"button",pages:!0})),i.bind("select",this._auth.bind(this,!0))),this.trigger("refresh",e),null!=(o=null!=(l=t.paging)?l.next:void 0)?this._requestFBPhotoSet(o,this._onFBRespond):this.entry.root&&!this.pages?(this.pages=!0,this._requestFBPages()):void 0},e.prototype.mapEntries=function(t){return t.map(function(t){return function(e){var r;return(r={images:e.images,id:e.id,name:e.name}).type=null!=e.images?"image":e.format?"video":"folder","folder"===r.type&&(r.album=!(!e.perms||!e.category)),r.path=t.entry.path+"/"+e.id,r.preview="image"===r.type?e.images[Math.max(0,e.images.length-4)].source:t.entry.picture,"video"===r.type&&(r.source=e.source),new n(r)}}(this))},e.prototype.preview=function(t){return t.preview},e.prototype.getURL=function(t,e){return e("image"===t.type?t.images[0].source:t.source)},e.prototype._auth=function(t){var e;return null==t&&(t=!0),e=function(t){return function(e){return"connected"===e.status?t.getPermissions():t.trigger("auth",t.authenticated=!1)}}(this),t?FB.login(e,{scope:"user_photos,user_videos,manage_pages"}):FB.getLoginStatus(e)},e.prototype.deauth=function(){return FB.logout(function(t){return function(){return t.trigger("auth",!1)}}(this))},e.prototype.getPermissions=function(){return FB.api("/me/permissions",function(t){return function(e){var r,n;return t.permissions={},e.data.forEach(function(e){return t.permissions[e.permission]="granted"===e.status}),r=u.call(t.options.types,"image")>=0||u.call(t.options.types,"photo")>=0,n=u.call(t.options.types,"video")>=0,(r&&t.permissions.user_photos||n&&t.permissions.user_videos)&&null!=t.permissions.manage_pages?t.trigger("auth",t.authenticated=!0):t.trigger("auth",t.authenticated=!1)}}(this))},e}(),t.exports=i},function(t,e,r){var n,i,o,s,a,u,l,c=function(t,e){return function(){return t.apply(e,arguments)}},p={}.hasOwnProperty,h=[].indexOf||function(t){for(var e=0,r=this.length;e<r;e++)if(e in this&&this[e]===t)return e;return-1};o=r(8),n=r(9),a="e80667fd637788dde877f5684d496d85",localStorage.getItem("flickrTokenFor")!==a&&localStorage.removeItem("flickrAuthToken"),localStorage.setItem("flickrTokenFor",a),s={key:a,secret:"5a90030ecac5b4fc",sig:"05eb1494ce939ce3098bbcdc7300b5e3",token:null!=(u=localStorage.getItem("flickrAuthToken"))?u.split("::")[0]:void 0,nsid:null!=(l=localStorage.getItem("flickrAuthToken"))?l.split("::")[1]:void 0,perms:"read",rest:"https://api.flickr.com/services/rest/"},i=function(t){function e(){this.call=c(this.call,this),this._onRespond=c(this._onRespond,this),this.listEntries=c(this.listEntries,this),this.doAuth=c(this.doAuth,this),this.refresh=c(this.refresh,this),e.__super__.constructor.apply(this,arguments),this.authenticated=null!=s.token&&null!=s.nsid,h.call(this.options.types,"image")>=0&&this.options.types.push("photo")}return function(t,e){for(var r in e)p.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,o),e.prototype.auth_url="https://flickr.com/services/auth/?api_key="+s.key+"&perms="+s.perms+"&api_sig="+s.sig,e.prototype.refresh=function(t){return this.entry=t,this.getMediaList().done(this._onRespond)},e.prototype._auth=function(t){return null==t&&(t=!0),this.trigger("auth",this.authenticated),!this.authenticated&&t&&this.doAuth()},e.prototype.doAuth=function(){if(window.flickrReady=function(t){return function(e){return t.call({api_key:s.key,frob:e,method:"flickr.auth.getToken"}).done(function(e){return e=$(e),s.nsid=e.find("user").attr("nsid"),s.token=e.find("token").text(),localStorage.setItem("flickrAuthToken",s.token+"::"+s.nsid),t.trigger("auth",t.authenticated=!0)})}}(this),null==s.token)return window.open(this.auth_url,"Flickr connect","width=990,height=825")},e.prototype.deauth=function(){return this.trigger("auth",this.authenticated=!1),localStorage.removeItem("flickrAuthToken")},e.prototype.getMediaList=function(){return this.call({api_key:s.key,auth_token:s.token,extras:"media",format:"json",method:"flickr.people.getPhotos",nojsoncallback:1,user_id:s.nsid})},e.prototype.listEntries=function(t){var e,r,i,o,s;for(s=[],e=0,r=t.length;e<r;e++)o=(i=t[e]).media,h.call(this.options.types,o)>=0&&(i.type=this.options.types[0],i.path="/"+i.id,s.push(new n(i)));return s},e.prototype._onRespond=function(t){return t.photos.total?this.trigger("refresh",this.entry.children=this.listEntries(t.photos.photo)):this.trigger("refresh",this.entry.children=[])},e.prototype.call=function(t,e){var r,n;return null==t&&(t={}),t.api_sig=s.secret+function(){var e;for(r in e=[],t)n=t[r],e.push(""+r+n);return e}().join(""),t.api_sig=Crypto.MD5(t.api_sig),$.ajax(s.rest,{data:t})},e.prototype.preview=function(t){return"https://farm"+t.farm+".staticflickr.com/"+t.server+"/"+t.id+"_"+t.secret+"_q.jpg"},e.prototype.getURL=function(t,e){return"image"===t.type?e("https://farm"+t.farm+".staticflickr.com/"+t.server+"/"+t.id+"_"+t.secret+".jpg"):this.getVideoSizes(t).done(function(t){return function(r){return t.videoUrl(r.sizes.size,e)}}(this))},e.prototype.getVideoSizes=function(t){return this.call({api_key:s.key,auth_token:s.token,format:"json",method:"flickr.photos.getSizes",nojsoncallback:1,photo_id:t.id,user_id:s.nsid})},e.prototype.videoUrl=function(t,e){var r,n,i;for(r=0,n=t.length;r<n;r++)if("Site MP4"===(i=t[r]).label)return e(i.source)},e}(),t.exports=i},function(t,e,r){var n,i,o,s,a,u,l=function(t,e){return function(){return t.apply(e,arguments)}},c={}.hasOwnProperty,p=[].slice;o=r(8),n=r(9),s=r(122),u=r(121),a=r(120),i=function(t){function e(){this.createQuery=l(this.createQuery,this),this.requestDriverFiles=l(this.requestDriverFiles,this),this.getDriverFiles=l(this.getDriverFiles,this),this.getDriverFolders=l(this.getDriverFolders,this),this.checkEmpty=l(this.checkEmpty,this),this.gotResponse=l(this.gotResponse,this),this.getDriverData=l(this.getDriverData,this),this.refresh=l(this.refresh,this),this.onGoglAuth=l(this.onGoglAuth,this),this._auth=l(this._auth,this),e.__super__.constructor.apply(this,arguments),this.title="Google Drive",~this.options.types.indexOf("image")&&(this.type="image"),~this.options.types.indexOf("video")&&(this.type="video"),~this.options.types.indexOf("audio")&&(this.type="audio"),this.root.id="root",u.then(function(t){return function(){return gapi.auth2.getAuthInstance().isSignedIn.listen(t.onGoglAuth)}}(this))}return function(t,e){for(var r in e)c.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,o),e.prototype.scope="https://www.googleapis.com/auth/drive.readonly",e.prototype._auth=function(t){return u.then(function(t){return function(){return gapi.auth2.getAuthInstance().isSignedIn.get()?t.trigger("auth",!0):gapi.auth2.getAuthInstance().signIn()}}(this))},e.prototype.onGoglAuth=function(t){return t?this.trigger("auth",!0):this.trigger("auth",!1)},e.prototype.refresh=function(t){var e;return this.entry=t,e=function(e){return function(){return e.gotResponse.apply(e,[t.id].concat(p.call(arguments)))}}(this),this.getDriverData(t,e)},e.prototype.getDriverData=function(t,e){return this.getDriverFolders(t.id,e).then(function(r){return function(){return r.getDriverFiles(t.id,r.type,e).then(e.bind(r,[],!0))}}(this))},e.prototype.gotResponse=function(t,e,r){var i,o;if(this.entry.id===t)return o=this,(i=(e.files||[]).map(function(t){return function(e){var r,u,l;if(e)return r=!e.permissions.filter(function(t){return"anyone"===t.id||"anyoneWithLink"===t.id}).length,l=e.mimeType.match(/image|video|folder|audio/)[0],new n({id:e.id,type:l,path:t.entry.path+"/"+e.name,name:e.name,preview:null!=(u=e.thumbnailLink)?u.replace(/s\d+$/,"s250"):void 0,url:e.webContentLink,parent:e.parents[0].id,isPrivate:r,order:.5*("folder"===l)+parseFloat("0."+new Date(e.createdDate).getTime()),webLink:e.webViewLink,onActivate:function(){return!this.isPrivate||(s.pop($("body")),s.off("confirmed"),s.bind("confirmed",function(t){return function(){return gapi.client.drive.permissions.create({resource:{type:"anyone",role:"reader"},fileId:e.id,fields:"id"}).execute(function(r){return r.error?(console.error(r.error),alert("An error has occurred. The permissions have not been modified.")):(a.clear(e.parents[0]),t.isPrivate=!1,o.trigger("refresh",i,{hard:!0}))})}}(this)),!this.isPrivate)}})}}(this)).filter(function(t){return!(!t||!t.id)}).sort(function(t,e){return-(t.order-e.order)})).length&&this.trigger("refresh",i),r&&!this.entry.children.length?this.trigger("refresh",[]):void 0},e.prototype.checkEmpty=function(){return this.trigger("refresh",[])},e.prototype.getURL=function(t,e){return e(t.url)},e.prototype.preview=function(t){return t.preview},e.prototype.deauth=function(){return this.trigger("auth",this.authenticated=!1)},e.prototype.getDriverFolders=function(t,e){return this.getDriverFiles(t,"folder",e)},e.prototype.getDriverFiles=function(t,e,r){var n,i;return n=new $.Deferred,(i=function(o){return function(s){return o.requestDriverFiles(t,e,s).then(function(e){var s;if(r(e),!e.nextPageToken)return n.resolve();o.entry.id===t&&(s=o.entry.children.slice(-1)[0])&&(s.onShow=function(){return i(e.nextPageToken),this.onShow=function(){}}.bind(s))})}}(this))(null),n.promise()},e.prototype.requestDriverFiles=function(t,e,r){var n,i;return i=new $.Deferred,(n=a.get(t,r||e))&&i.resolve(n),a.check(t,r||e)||gapi.client.drive.files.list({q:this.createQuery(t,e),fields:"nextPageToken, files(id, name, mimeType, thumbnailLink, createdTime, permissions, parents, webContentLink, webViewLink)",pageToken:r}).execute(function(n){return null!=n.result&&delete n.result,a.set(t,r||e,n),i.resolve(n)}),i.promise()},e.prototype.createQuery=function(t,e,r){var n,i;return n="mimeType contains '"+e+"/'","folder"===e&&(n="mimeType='application/vnd.google-apps.folder'"),i="trashed=false and ("+n+") and '"+t+"' in parents",r&&(i+=" and modifiedDate > '"+r+"'"),i},e}(),t.exports=i},function(t,e,r){var n,i,o,s,a,u,l=function(t,e){return function(){return t.apply(e,arguments)}},c={}.hasOwnProperty;o=r(8),n={client_id:"542808610040105",client_secret:"0a88504381f577dbbef400d4232a4258",redirect_uri:(u="https://widgetic.com/services/instagram")+"/auth_token",scope:"user_profile,user_media",response_type:"code",api_url:u,demo:"IGQVJVNUw5cHB5cUFiZATFxVmgyeWtSVFJjTDYyRmNnWDZAJZA3llVXREa1BsS1EtVGJ2UEdlbHJNbDV1UUQ2YkVSZA3YwS1dPWXJzYXFGQzdZAMlhBLTBWWWNkTVNHTGNDLW10dkdhNW0wMDVqMkhZAWEhqbgZDZD",token_storage:"redis",encodeToken:!1,redis_db:0,redis_prefix:"nstgrm:",port:8082},s=window.INSTAGRAM_SERVICE_CONFIG||n;try{s.token=localStorage.getItem("instagramAuthToken")}catch(t){}console.log("Editor Instagram Service current user's token:",s.token),a="https://api.instagram.com/oauth/authorize/?client_id="+s.client_id+"&redirect_uri="+s.redirect_uri+"&response_type="+s.response_type+"&scope="+s.scope,i=function(t){function e(){this.refresh=l(this.refresh,this),e.__super__.constructor.apply(this,arguments),this.user={},this.authenticated=!1}return function(t,e){for(var r in e)c.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,o),e.browser="browser/controller/instagram",e.prototype.getToken=function(){return s.token},e.prototype.getUser=function(t){var e;return e=s.api_url+"/me",$.ajax({url:e,type:"GET",dataType:"json",headers:{"X-Token":t}})},e.prototype._auth=function(t){return null==t&&(t=!0),console.log("Editor Instagram Service _auth method:",t,s.token),null!=s.token&&this.getUser(s.token).then(function(t){return function(e){return console.log("Editor Instagram Service getUser result:",e),t.user=e,t.trigger("auth",t.authenticated=!0)}}(this)).catch(function(t){return function(){return console.log("Editor Instagram Service getUser error:",error),t.deauth()}}(this)),!this.authenticated&&t&&this.showAuthPopup()},e.prototype.showAuthPopup=function(){return window.instagramReady=function(t){return function(e,r){s.token=e;try{localStorage.setItem("instagramAuthToken",s.token=e)}catch(t){}return t.user=r,t.trigger("auth",t.authenticated=!0)}}(this),window.open(a,"Instagram connect","width=450,height=600")},e.prototype.refresh=function(t){return this.entry=t,this.trigger("refresh",[])},e.prototype.deauth=function(){this.authenticated=!1,s.token=null,this.trigger("auth",this.authenticated);try{return localStorage.removeItem("instagramAuthToken")}catch(t){}},e}(),t.exports=i},function(t,e,r){var n,i,o,s,a,u,l,c,p,h=function(t,e){return function(){return t.apply(e,arguments)}},d={}.hasOwnProperty,f=[].indexOf||function(t){for(var e=0,r=this.length;e<r;e++)if(e in this&&this[e]===t)return e;return-1};s=r(8),n=r(9),i={client_id:"542808610040105",client_secret:"0a88504381f577dbbef400d4232a4258",redirect_uri:(c="https://widgetic.com/services/instagram/")+"auth_token",scope:"user_profile,user_media",response_type:"code",api_url:c,demo:"IGQVJVNUw5cHB5cUFiZATFxVmgyeWtSVFJjTDYyRmNnWDZAJZA3llVXREa1BsS1EtVGJ2UEdlbHJNbDV1UUQ2YkVSZA3YwS1dPWXJzYXFGQzdZAMlhBLTBWWWNkTVNHTGNDLW10dkdhNW0wMDVqMkhZAWEhqbgZDZD",token_storage:"redis",encodeToken:!1,redis_db:0,redis_prefix:"nstgrm:",port:8082},a=window.INSTAGRAM_SERVICE_CONFIG||i;try{a.token=localStorage.getItem("instagramAuthToken")}catch(t){}u="https://api.instagram.com/oauth/authorize/?client_id="+a.client_id+"&redirect_uri="+a.redirect_uri+"&response_type="+a.response_type+"&scope="+a.scope,p=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],l={_cache:{},def:function(){return new $.Deferred},has:function(t){return null!=l._cache[t]},get:function(t){return l.def().resolve(l._cache[t]).promise()},set:function(t,e){return l._cache[t]=e,l}},o=function(t){function e(){this.listEntries=h(this.listEntries,this),this.makeFolders=h(this.makeFolders,this),this._onRespond=h(this._onRespond,this),this.fetchFotos=h(this.fetchFotos,this),this.refresh=h(this.refresh,this),e.__super__.constructor.apply(this,arguments),this.user={},this.authenticated=!1,this.ajaxReqs=[]}return function(t,e){for(var r in e)d.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,s),e.prototype.getUser=function(t){var e;return e=a.api_url+"me",$.ajax({url:e,type:"GET",dataType:"json",headers:{"X-Token":t}})},e.prototype._auth=function(t){return null==t&&(t=!0),null!=a.token&&this.getUser(a.token).then(function(t){return function(e){return t.user=e,t.trigger("auth",t.authenticated=!0)}}(this)).catch(function(t){return function(e){return t.deauth()}}(this)),!this.authenticated&&t&&this.showAuthPopup()},e.prototype.showAuthPopup=function(){return window.instagramReady=function(t){return function(e,r){a.token=e;try{localStorage.setItem("instagramAuthToken",a.token=e)}catch(t){}return t.user=r,t.trigger("auth",t.authenticated=!0)}}(this),window.open(u,"Instagram connect","width=450,height=600")},e.prototype.deauth=function(){this.authenticated=!1,a.token=null,this.trigger("auth",this.authenticated);try{return localStorage.removeItem("instagramAuthToken")}catch(t){}},e.prototype.refresh=function(t){return this.entry=t,this.entry.children=[],this.children={},this.fetchFotos().done(this._onRespond)},e.prototype.fetchFotos=function(t){var e;return null==t&&(t=""),e=a.api_url+"?num=999&q="+this.user.id+"&max_id="+t,this.ajaxReqs[t]=$.ajax({url:e,type:"GET",dataType:"json",headers:{"X-Token":a.token},success:function(e){return l.set(t,e)},fail:function(t){return console.log("Fetch photos failed:",t)}}),l.has(t)?l.get(t):this.ajaxReqs[t]},e.prototype._onRespond=function(t){var e,r,n;if(e=t.media.filter(function(t){return function(e){var r;return r=e.type=e.media_type.toLowerCase(),f.call(t.options.types,r)>=0}}(this)),e=this.listEntries(e),this.entry.children=this.entry.children.concat(e),this.trigger("refresh",e),r=null!=(n=t.pagination)?n.next_max_id:void 0)return this.fetchFotos(r).done(this._onRespond)},e.prototype.makeFolders=function(t){var e,r,i,o,s,a,u,l,c,h;for(s={},u=0,l=t.length;u<l;u++)a=t[u],e=new Date(a.timestamp),o=p[e.getMonth()]+" "+e.getFullYear(),function(){var t,e,n,i;for(i=[],t=0,e=(n=this.entry.children).length;t<e;t++)(r=n[t]).name===o&&i.push(r);return i}.call(this).length||(s[o]=new n({service:this,name:o,path:"/"+o,type:"folder",year:e.getFullYear(),month:e.getMonth()}));for(c in h=[],s)i=s[c],h.push(i);return h},e.prototype.listEntries=function(t){var e,r,i,o,s;for(e=[],i=0,o=t.length;i<o;i++)s={id:(r=t[i]).id,type:r.type,media_url:r.media_url,thumbnail_url:r.thumbnail_url,caption:r.caption,images:{image:r.media_url,thumbnail:r.thumbnail_url}},null!=r.videos&&(s.videos=r.videos),s.path=this.entry.path+"/"+r.id,this.children[r.id]=new n(s),e.push(this.children[r.id]);return e},e.prototype.preview=function(t){return t.images.image||t.images.thumbnail},e.prototype.getURL=function(t,e){return e(t[t.type+"s"].image)},e}(),t.exports=o},function(t,e,r){var n,i,o,s,a,u=function(t,e){return function(){return t.apply(e,arguments)}},l={}.hasOwnProperty;o=r(8),n=r(9),a={api_url:"https://api.soundcloud.com",client_id:"aed0aa63baf747a83ad0b6b246acddca",redirect_uri:"https://widgetic.com/connect/soundcloud",tracks_url:"https://widgetic.com/wservices/soundcloud/tracks/",grant_type:"refresh_token"},(i=r(195)).initialize(a),i.client_id=a.client_id,i.api_url=a.api_url,i.tracks_url=a.tracks_url;try{i.auth_token=localStorage.getItem("soundcloudAuthToken")}catch(t){}try{i.userId=localStorage.getItem("soundcloudUserId")}catch(t){}s=function(t){function e(){this.newEntry=u(this.newEntry,this),this.fetchTracks=u(this.fetchTracks,this),this.fetchPlaylists=u(this.fetchPlaylists,this),this.checkAuth=u(this.checkAuth,this),this.auth=u(this.auth,this),e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var r in e)l.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,o),e.prototype.SCGet=function(t){var e;return e=""+i.api_url+t,$.ajax({url:e,type:"GET",dataType:"json",headers:{Authorization:"OAuth "+i.auth_token}})},e.prototype.auth=function(t){return!i.userId&&t?this.showAuthPopup():this.checkAuth()},e.prototype.showAuthPopup=function(){return i.connect().then(function(t){return function(e){i.auth_token=e.oauth_token;try{localStorage.setItem("soundcloudAuthToken",i.auth_token)}catch(t){}return t.SCGet("/me").then(function(e){i.userId=e.id;try{localStorage.setItem("soundcloudUserId",i.userId)}catch(t){}return t.checkAuth()}).catch(function(e){return console.log("Editor getUser error:",e),t.deauth()})}}(this)).catch(function(t){return function(e){return console.log("SC Connect Error: "+e.message),t.deauth()}}(this))},e.prototype.checkAuth=function(){return this.trigger("auth",null!==i.userId)},e.prototype.deauth=function(){i.auth_token=null;try{localStorage.removeItem("soundcloudAuthToken")}catch(t){}i.userId=null;try{localStorage.removeItem("soundcloudUserId")}catch(t){}return this.checkAuth()},e.prototype.refresh=function(t){return this.currentFolder=t,this.currentFolder.root?this.fetchPlaylists():this.fetchTracks(this.currentFolder.id)},e.prototype.fetchPlaylists=function(){return this.SCGet("/users/"+i.userId+"/playlists").then(function(t){return function(e){return t.trigger("refresh",e.map(t.newEntry.bind(t,"folder")),{root:!0}),t.fetchTracks(t.currentFolder.id)}}(this)).catch(function(t){return console.log("Fetch Playlist error: "+t.message)})},e.prototype.fetchTracks=function(t){var e;return e=t?"/playlists/"+t:"/users/"+i.userId+"/tracks",e+="?access=playable",this.SCGet(e).then(function(e){return function(r){var n;return n=r,r.tracks&&(n=r.tracks),e.trigger("refresh",n.map(function(t){return e.newEntry("audio",t)}),{root:!t})}}(this)).catch(function(t){return console.log("Fetch Tracks error: "+t.message)})},e.prototype.newEntry=function(t,e,r){var i,o,s,a,u,l,c;return r?u=r+"/":(u=this.currentFolder.path,this.currentFolder.root||(u+="/")),u+=e.id,"folder"===t&&(o=e.tracks),i=e.artwork_url,a=e.id,s=e.duration,c=e.title,l=e.stream_url,new n($.extend({},{service:this,type:t,path:u,artwork_url:i,id:a,children:o,duration:s/1e3,title:c,stream_url:l,name:e.title}))},e.prototype.getURL=function(t,e){return e(i.tracks_url+"?id="+t.id+"&atoken="+i.auth_token)},e}(),t.exports=s},function(t,e,r){!function(e,r){t.exports=r()}(0,function(){return function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return t[n].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){(function(e){"use strict";var n=r(4),i=r(8),o=r(3),s=r(9),a=r(2).Promise,u=r(16),l=r(17);t.exports=e.SC={initialize:function(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];o.set("oauth_token",t.oauth_token),o.set("client_id",t.client_id),o.set("redirect_uri",t.redirect_uri),o.set("baseURL",t.baseURL),o.set("connectURL",t.connectURL)},get:function(t,e){return n.request("GET",t,e)},post:function(t,e){return n.request("POST",t,e)},put:function(t,e){return n.request("PUT",t,e)},delete:function(t){return n.request("DELETE",t)},upload:function(t){return n.upload(t)},connect:function(t){return s(t)},isConnected:function(){return void 0!==o.get("oauth_token")},oEmbed:function(t,e){return n.oEmbed(t,e)},resolve:function(t){return n.resolve(t)},Recorder:u,Promise:a,stream:function(t,e){return l(t,e)},connectCallback:function(){i.notifyDialog(this.location)}}}).call(e,function(){return this}())},function(t,e){t.exports=function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return t[n].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){t.exports={SCAudio:r(1),SCAudioControllerHTML5Player:r(3),SCAudioControllerHLSMSEPlayer:r(5),SCAudioPublicApiStreamURLRetriever:r(12),MaestroCore:r(2),MaestroLoaders:r(11)}},function(t,e,r){window,t.exports=function(t){return function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var r={};return e.m=t,e.c=r,e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:n})},e.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=99)}([function(e,r){e.exports=t},function(t,e,r){"use strict";var n=r(5);t.exports=function(t){if(!n(t))throw new TypeError("Cannot use null or undefined");return t}},function(t,e,r){"use strict";t.exports=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");return t}},function(t,e,r){"use strict";t.exports=r(55)()?Symbol:r(54)},function(t,e,r){"use strict";var n=r(11),i=r(18),o=r(59),s=r(17);(t.exports=function(t,e){var r,o,a,u,l;return arguments.length<2||"string"!=typeof t?(u=e,e=t,t=null):u=arguments[2],null==t?(r=a=!0,o=!1):(r=s.call(t,"c"),o=s.call(t,"e"),a=s.call(t,"w")),l={value:e,configurable:r,enumerable:o,writable:a},u?n(i(u),l):l}).gs=function(t,e,r){var a,u,l,c;return"string"!=typeof t?(l=r,r=e,e=t,t=null):l=arguments[3],null==e?e=void 0:o(e)?null==r?r=void 0:o(r)||(l=r,r=void 0):(l=e,e=r=void 0),null==t?(a=!0,u=!1):(a=s.call(t,"c"),u=s.call(t,"e")),c={get:e,set:r,configurable:a,enumerable:u},l?n(i(l),c):c}},function(t,e,r){"use strict";var n=r(22)();t.exports=function(t){return t!==n&&null!==t}},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=r(0),o=function(t){function e(e){return t.call(this,e||"There was no format available that a player was able to play.")||this}return n(e,t),e.prototype.getCode=function(){return"SCAUDIO.NOT_SUPPORTED_ERROR"},e}(i.errors.PlayerFatalError);e.NotSupportedError=o},function(t,e,r){"use strict";var n=Object.prototype.toString,i=n.call("");t.exports=function(t){return"string"==typeof t||t&&"object"==typeof t&&(t instanceof String||n.call(t)===i)||!1}},function(t,e,r){"use strict";var n=Object.prototype.toString,i=n.call(function(){return arguments}());t.exports=function(t){return n.call(t)===i}},function(t,e,r){"use strict";t.exports=r(20)()?Object.setPrototypeOf:r(19)},function(t,e,r){"use strict";var n,i=r(23),o=r(11),s=r(2),a=r(1),u=r(4),l=r(47),c=r(3),p=Object.defineProperty,h=Object.defineProperties;t.exports=n=function(t,e){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");h(this,{__list__:u("w",a(t)),__context__:u("w",e),__nextIndex__:u("w",0)}),e&&(s(e.on),e.on("_add",this._onAdd),e.on("_delete",this._onDelete),e.on("_clear",this._onClear))},delete n.prototype.constructor,h(n.prototype,o({_next:u(function(){var t;if(this.__list__)return this.__redo__&&void 0!==(t=this.__redo__.shift())?t:this.__nextIndex__<this.__list__.length?this.__nextIndex__++:void this._unBind()}),next:u(function(){return this._createResult(this._next())}),_createResult:u(function(t){return void 0===t?{done:!0,value:void 0}:{done:!1,value:this._resolve(t)}}),_resolve:u(function(t){return this.__list__[t]}),_unBind:u(function(){this.__list__=null,delete this.__redo__,this.__context__&&(this.__context__.off("_add",this._onAdd),this.__context__.off("_delete",this._onDelete),this.__context__.off("_clear",this._onClear),this.__context__=null)}),toString:u(function(){return"[object "+(this[c.toStringTag]||"Object")+"]"})},l({_onAdd:u(function(t){if(!(t>=this.__nextIndex__)){if(++this.__nextIndex__,!this.__redo__)return void p(this,"__redo__",u("c",[t]));this.__redo__.forEach(function(e,r){e>=t&&(this.__redo__[r]=++e)},this),this.__redo__.push(t)}}),_onDelete:u(function(t){var e;t>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(-1!==(e=this.__redo__.indexOf(t))&&this.__redo__.splice(e,1),this.__redo__.forEach(function(e,r){e>t&&(this.__redo__[r]=--e)},this)))}),_onClear:u(function(){this.__redo__&&i.call(this.__redo__),this.__nextIndex__=0})}))),p(n.prototype,c.iterator,u(function(){return this}))},function(t,e,r){"use strict";t.exports=r(64)()?Object.assign:r(63)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getAppState=function(){switch(window.document.hidden){case!0:return"background";case!1:return"foreground";default:return}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(97),i=r(96),o=r(95),s=r(94),a=r(93),u=r(92),l=r(91),c=r(90),p=r(89),h=r(88);e.renditions={httpMp3:n.httpMp3,httpAACHQ:h.httpAACHQ,hlsMp3:i.hlsMp3,encryptedHlsMp3:o.encryptedHlsMp3,hlsOpus:c.hlsOpus,encryptedHlsOpus:p.encryptedHlsOpus,hlsAACHQ:s.hlsAACHQ,encryptedHlsAACHQ:a.encryptedHlsAACHQ,apiMobile:u.apiMobile,maestroChromecast:l.maestroChromecast},e.allRenditions=Object.keys(e.renditions).map(function(t){return e.renditions[t]})},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=r(6),o=function(t){function e(){return t.call(this,"Failed to retrieve stream url.")||this}return n(e,t),e.prototype.getCode=function(){return"SCAUDIO.FAILED_RETRIEVING_URL"},e}(i.NotSupportedError);e.FailedRetrievingUrlError=o},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=r(6),o=function(t){function e(){return t.call(this,"There were no stream URLs.")||this}return n(e,t),e.prototype.getCode=function(){return"SCAUDIO.NO_STREAMS"},e}(i.NotSupportedError);e.NoStreamsError=o},function(t,e,r){"use strict";var n=r(51);t.exports=function(t){if(!n(t))throw new TypeError(t+" is not iterable");return t}},function(t,e,r){"use strict";t.exports=r(58)()?String.prototype.contains:r(57)},function(t,e,r){"use strict";var n=r(5),i=Array.prototype.forEach,o=Object.create;t.exports=function(t){var e=o(null);return i.call(arguments,function(t){n(t)&&function(t,e){var r;for(r in t)e[r]=t[r]}(Object(t),e)}),e}},function(t,e,r){"use strict";var n,i=r(66),o=r(1),s=Object.prototype.isPrototypeOf,a=Object.defineProperty,u={configurable:!0,enumerable:!1,writable:!0,value:void 0};n=function(t,e){if(o(t),null===e||i(e))return t;throw new TypeError("Prototype must be null or an object")},t.exports=function(t){var e,r;return t?(2===t.level?t.set?(r=t.set,e=function(t,e){return r.call(n(t,e),e),t}):e=function(t,e){return n(t,e).__proto__=e,t}:e=function t(e,r){var i;return n(e,r),(i=s.call(t.nullPolyfill,e))&&delete t.nullPolyfill.__proto__,null===r&&(r=t.nullPolyfill),e.__proto__=r,i&&a(t.nullPolyfill,"__proto__",u),e},Object.defineProperty(e,"level",{configurable:!1,enumerable:!1,writable:!1,value:t.level})):null}(function(){var t,e=Object.create(null),r={},n=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__");if(n){try{(t=n.set).call(e,r)}catch(t){}if(Object.getPrototypeOf(e)===r)return{set:t,level:2}}return e.__proto__=r,Object.getPrototypeOf(e)===r?{level:2}:((e={}).__proto__=r,Object.getPrototypeOf(e)===r&&{level:1})}()),r(65)},function(t,e,r){"use strict";var n=Object.create,i=Object.getPrototypeOf,o={};t.exports=function(){var t=Object.setPrototypeOf,e=arguments[0]||n;return"function"==typeof t&&i(t(e(null),o))===o}},function(t,e,r){"use strict";var n=r(70),i=Math.max;t.exports=function(t){return i(0,n(t))}},function(t,e,r){"use strict";t.exports=function(){}},function(t,e,r){"use strict";var n=r(1);t.exports=function(){return n(this).length=0,this}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.notSupportedError=new Error("Not supported.");var n=function(){this.supportsVolumeAutomation=!0,this.syncConfig={}};e.BaseController=n},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){};e.BaseStreamUrlRetriever=n},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.buildFadeIn=function(t){return new n({startPos:0,endPos:t,startLevel:0,endLevel:1,fromEnd:!1})},e.buildFadeOut=function(t){return new n({startPos:t,endPos:0,startLevel:1,endLevel:0,fromEnd:!0})};var n=function(){function t(t){var e=t.startPos,r=t.endPos,n=t.startLevel,i=t.endLevel,o=t.fromEnd,s=void 0!==o&&o;if(e<0)throw new Error("startPos invalid.");if(r<0||!s&&r<e||s&&e<r)throw new Error("endPos invalid.");if(n<0||n>1)throw new Error("startLevel invalid.");if(i<0||i>1)throw new Error("endLevel invalid.");this._startPos=e,this._endPos=r,this._startLevel=n,this._endLevel=i,this._fromEnd=s}return t.prototype.calculate=function(t,e){var r=this._fromEnd?e-500-this._startPos:this._startPos,n=this._fromEnd?e-500-this._endPos:this._endPos;if(t<r)return{level:this._startLevel,nextCalculatePosition:r-t};if(t<=n){var i=(t-r)/(n-r),o=Math.cos(i*Math.PI)/-2+.5,s=this._startLevel+(this._endLevel-this._startLevel)*o;return{level:s,nextCalculatePosition:t}}return{level:this._endLevel,nextCalculatePosition:1/0}},t}();e.Fade=n},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(6),i=r(15),o=r(14);!function(t){t.NotSupportedError=n.NotSupportedError,t.NoStreamsError=i.NoStreamsError,t.FailedRetrievingUrlError=o.FailedRetrievingUrlError}(e.errors||(e.errors={}))},function(t,e,r){"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.SQ="sq",t.HQ="hq"}(n=e.Quality||(e.Quality={})),e.resolveQuality=function(t){switch(t){case n.SQ:return n.SQ;case n.HQ:return n.HQ}return null}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),i=function(){function t(t){var e=this;this._player=t,this._onConnectionRequired=new n.eventDispatcher.EventDispatcher,this._onConnectionRecovered=new n.eventDispatcher.EventDispatcher,this._connectionRequired=!1,this._connectionLossTimer=null,this.onConnectionRequired=this._onConnectionRequired.getHandle(),this.onConnectionRecovered=this._onConnectionRecovered.getHandle();var r=function(){return e._calculateIfConnectionRequired()};window.addEventListener("online",r),window.addEventListener("offline",r),this._calculateIfConnectionRequired(),t.onChange.subscribe(function(n){var i=n.loading,o=n.dead;o&&null!==e._connectionLossTimer&&(window.clearTimeout(e._connectionLossTimer),window.removeEventListener("online",r),window.removeEventListener("offline",r)),t.isDead()||void 0===i||e._calculateIfConnectionRequired()})}return t.prototype.isConnectionRequired=function(){return this._connectionRequired},t.prototype._calculateIfConnectionRequired=function(){var t=this,e=this._player.isLoading()&&"navigator"in window&&!window.navigator.onLine;e?null===this._connectionLossTimer&&(this._connectionLossTimer=window.setTimeout(function(){t._connectionLossTimer=null,t._connectionRequired=!0,t._onConnectionRequired.dispatch(void 0)},1500)):this._connectionRequired?(this._connectionRequired=!1,this._onConnectionRecovered.dispatch(void 0)):null!==this._connectionLossTimer&&(window.clearTimeout(this._connectionLossTimer),this._connectionLossTimer=null)},t}();e.ConnectionRequiredHelper=i},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.generateLogId=function(){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e="",r=0;r<20;r++)e+=t.charAt(Math.floor(Math.random()*t.length));return e}},function(t,e,r){"use strict";function n(t,e){return void 0!==t?t:e}Object.defineProperty(e,"__esModule",{value:!0});var i=r(25),o=r(0);e.validatePlayerDependencies=function(t){if(!(t.streamUrlRetriever instanceof i.BaseStreamUrlRetriever))throw new Error("StreamUrlRetriever invalid.");if(void 0!==t.duration&&("number"!=typeof t.duration||t.duration<0))throw new Error("duration invalid.");if(void 0!==t.getURLOpts&&"object"!=typeof t.getURLOpts)throw new Error("getURLOpts invalid.");if(void 0!==t.preloadingEnabled&&"boolean"!=typeof t.preloadingEnabled)throw new Error("preloadingEnabled invalid.");if(void 0!==t.fadeOnPauseAndPlay&&"boolean"!=typeof t.fadeOnPauseAndPlay)throw new Error("fadeOnPauseAndPlay invalid.");if(void 0!==t.fadeOnSeek&&"boolean"!=typeof t.fadeOnSeek)throw new Error("fadeOnSeek invalid.");if(void 0!==t.mediaSessionEnabled&&"boolean"!=typeof t.mediaSessionEnabled)throw new Error("mediaSessionEnabled invalid.");if(void 0!==t.pausedMaxBufferLength&&("number"!=typeof t.pausedMaxBufferLength||t.pausedMaxBufferLength<0))throw new Error("pausedMaxBufferLength invalid.");if(void 0!==t.playingMaxBufferLength&&("number"!=typeof t.playingMaxBufferLength||t.playingMaxBufferLength<0))throw new Error("playingMaxBufferLength invalid.");if(void 0!==t.logger&&"function"!=typeof t.logger&&"object"!=typeof t.logger)throw new Error("logger invalid.");if(void 0!==t.audioReporter&&"function"!=typeof t.audioReporter)throw new Error("audioReporter invalid.");if(void 0!==t.audioCheckpointInterval&&("number"!=typeof t.audioCheckpointInterval||t.audioCheckpointInterval<0))throw new Error("audioCheckpointInterval invalid.");if(void 0!==t.audioPerformanceReporter&&"function"!=typeof t.audioPerformanceReporter)throw new Error("audioPerformanceReporter invalid.");if(void 0!==t.errorReporter&&"function"!=typeof t.errorReporter)throw new Error("errorReporter invalid.");if(void 0!==t.urlProviderRetryDelayCalculator&&"function"!=typeof t.urlProviderRetryDelayCalculator)throw new Error("urlProviderRetryDelayCalculator invalid.");return{controllers:t.controllers,streamUrlRetriever:t.streamUrlRetriever,getURLOpts:n(t.getURLOpts,{}),preloadingEnabled:n(t.preloadingEnabled,!1),pausedMaxBufferLength:n(t.pausedMaxBufferLength,2e3),playingMaxBufferLength:n(t.playingMaxBufferLength,9e4),fadeOnPauseAndPlay:n(t.fadeOnPauseAndPlay,!1),fadeOnSeek:n(t.fadeOnSeek,!1),audioCheckpointInterval:n(t.audioCheckpointInterval,3e4),urlProviderRetryDelayCalculator:n(t.urlProviderRetryDelayCalculator,o.helpers.retry.buildExponentialDelayCalculator()),streamUrlsExpire:n(t.streamUrlsExpire,!0),fetchEnabled:n(t.fetchEnabled,!0),duration:t.duration,audioReporter:t.audioReporter,audioPerformanceReporter:t.audioPerformanceReporter,errorReporter:t.errorReporter}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),i=r(13);e.NoMoreAttemptsError=new Error("No more attempts to retrieve URL."),e.retrieveUrl=function(t){var r=t.streamUrlRetriever,o=t.getURLOpts,s=t.logger,a=t.urlProviderRetryDelayCalculator;return new n.helpers.abortableJob.AbortableJob(function(){var t=n.helpers.deferred.buildDeferred(),u=n.helpers.retry.retry(a,function(e){var a=e.scheduleRetry,u=r.getUrl(o);return s.debug("Retrieving a URL..."),u.onCompletion(function(e){e?e.rendition&&i.allRenditions.indexOf(e.rendition)<0?(s.warn("Unknown rendition. Skipping...",e.rendition),r.excludeRendition(e.rendition),a()):!e.success&&e.error.isTransient()?(s.warn("Transient error retrieving url.",e.error),a()):t.resolve(e):(s.debug("No URL provided."),t.resolve(null))}),u.onError(function(e){e!==n.helpers.abortableJob.abortedError&&s.error("Error retrieving URL.",e),t.reject(e)}),{onCancel:function(){return u.abort()}}},{onNoMoreRetries:function(){return t.reject(e.NoMoreAttemptsError)}}).cancel;return{result:t.promise,abort:function(){return u()}}}).run()}},function(t,e,r){"use strict";function n(t,e){var r=t.getMemoryCacheController();r&&r.setMaxCacheSize(e)}Object.defineProperty(e,"__esModule",{value:!0});var i=r(0),o=function(){function t(t,e){this._maxCacheSize=t,this._players=[],this._updateTimer=null,this._logger=i.logger.prefixLogger(e,"CacheManager"),this._logger.debug("Initialized with cache size "+t+" bytes.")}return t.prototype.setCacheSize=function(t){this._maxCacheSize!==t&&(this._logger.debug("Updating cache size to "+t+" bytes."),this._maxCacheSize=t,this._update())},t.prototype.addPlayer=function(t){var e=this;if(this._logger.debug("Adding player to cache manager."),t.isDead())this._logger.debug("Player was dead.");else{var r=this._players;t.onChange.subscribe(function(n){var i=n.playing,o=n.dead;!0===o?(e._logger.debug("Removing player that became dead."),r.splice(r.indexOf(t),1),e._update()):!0===i?(e._logger.debug("Updating because player started playing."),r.splice(r.indexOf(t),1),r.unshift(t),e._update()):!1===i&&(e._logger.debug("Updating because player became paused."),e._update())}),t.isPlaying()?r.unshift(t):r.push(t),this._update()}},t.prototype._update=function(){var t=this;if(this._updateTimer&&(window.clearTimeout(this._updateTimer),this._updateTimer=null),0!==this._players.length){var e=this._players.reduce(function(t,e){return e.isPlaying()?t.playingPlayers.push(e):t.pausedPlayers.push(e),t},{playingPlayers:[],pausedPlayers:[]}),r=e.playingPlayers,i=e.pausedPlayers,o=r.reduce(function(t,e){return t+(e.getMemoryCacheUsage()||0)},0),s=i.reduce(function(t,e){return t+(e.getMemoryCacheUsage()||0)},0);if(o>this._maxCacheSize){this._logger.debug("All playing players are using more than the max cache size. Cleaning...",o,this._maxCacheSize);var a=this._maxCacheSize/r.length;r.forEach(function(t){return n(t,a)}),i.forEach(function(t){return n(t,0)})}else this._logger.debug("Recalculating cache sizes...",o+s,this._maxCacheSize),r.concat(i).reduce(function(e,r){return n(r,Math.max(0,t._maxCacheSize-e)),e+(r.getMemoryCacheUsage()||0)},0);this._updateTimer=window.setTimeout(function(){return t._update()},2e4)}else this._logger.debug("There are no longer any players to manage.")},t}();e.CacheManager=o},function(t,e,r){"use strict";t.exports="undefined"!=typeof Map&&"[object Map]"===Object.prototype.toString.call(new Map)},function(t,e,r){"use strict";var n=Array.prototype.forEach,i=Object.create;t.exports=function(t){var e=i(null);return n.call(arguments,function(t){e[t]=!0}),e}},function(t,e,r){"use strict";t.exports=r(35)("key","value","key+value")},function(t,e,r){"use strict";var n,i=r(9),o=r(4),s=r(10),a=r(3).toStringTag,u=r(36),l=Object.defineProperties,c=s.prototype._unBind;n=t.exports=function(t,e){return this instanceof n?(s.call(this,t.__mapKeysData__,t),e&&u[e]||(e="key+value"),void l(this,{__kind__:o("",e),__values__:o("w",t.__mapValuesData__)})):new n(t,e)},i&&i(n,s),n.prototype=Object.create(s.prototype,{constructor:o(n),_resolve:o(function(t){return"value"===this.__kind__?this.__values__[t]:"key"===this.__kind__?this.__list__[t]:[this.__list__[t],this.__values__[t]]}),_unBind:o(function(){this.__values__=null,c.call(this)}),toString:o(function(){return"[object Map Iterator]"})}),Object.defineProperty(n.prototype,a,o("c","Map Iterator"))},function(t,e,r){"use strict";var n,i=r(9),o=r(4),s=r(3),a=r(10),u=Object.defineProperty;n=t.exports=function(t){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");t=String(t),a.call(this,t),u(this,"__length__",o("",t.length))},i&&i(n,a),delete n.prototype.constructor,n.prototype=Object.create(a.prototype,{_next:o(function(){if(this.__list__)return this.__nextIndex__<this.__length__?this.__nextIndex__++:void this._unBind()}),_resolve:o(function(t){var e,r=this.__list__[t];return this.__nextIndex__===this.__length__?r:(e=r.charCodeAt(0))>=55296&&e<=56319?r+this.__list__[this.__nextIndex__++]:r})}),u(n.prototype,s.toStringTag,o("c","String Iterator"))},function(t,e,r){"use strict";var n=r(2),i=r(1),o=Function.prototype.bind,s=Function.prototype.call,a=Object.keys,u=Object.prototype.propertyIsEnumerable;t.exports=function(t,e){return function(r,l){var c,p=arguments[2],h=arguments[3];return r=Object(i(r)),n(l),c=a(r),h&&c.sort("function"==typeof h?o.call(h,r):void 0),"function"!=typeof t&&(t=c[t]),s.call(t,c,function(t,n){return u.call(r,t)?s.call(l,p,r[t],t,r,n):e})}}},function(t,e,r){"use strict";t.exports=r(39)("forEach")},function(t,e,r){"use strict";var n=r(2),i=r(40),o=Function.prototype.call;t.exports=function(t,e){var r={},s=arguments[2];return n(e),i(t,function(t,n,i,a){r[n]=o.call(e,s,t,n,i,a)}),r}},function(t,e,r){"use strict";var n=Object.prototype.toString,i=n.call(r(22));t.exports=function(t){return"function"==typeof t&&n.call(t)===i}},function(t,e,r){"use strict";var n=r(3).iterator,i=r(8),o=r(42),s=r(21),a=r(2),u=r(1),l=r(5),c=r(7),p=Array.isArray,h=Function.prototype.call,d={configurable:!0,enumerable:!0,writable:!0,value:null},f=Object.defineProperty;t.exports=function(t){var e,r,g,y,_,v,m,b,w,E,P=arguments[1],S=arguments[2];if(t=Object(u(t)),l(P)&&a(P),this&&this!==Array&&o(this))e=this;else{if(!P){if(i(t))return 1!==(_=t.length)?Array.apply(null,t):((y=new Array(1))[0]=t[0],y);if(p(t)){for(y=new Array(_=t.length),r=0;r<_;++r)y[r]=t[r];return y}}y=[]}if(!p(t))if(void 0!==(w=t[n])){for(m=a(w).call(t),e&&(y=new e),b=m.next(),r=0;!b.done;)E=P?h.call(P,S,b.value,r):b.value,e?(d.value=E,f(y,r,d)):y[r]=E,b=m.next(),++r;_=r}else if(c(t)){for(_=t.length,e&&(y=new e),r=0,g=0;r<_;++r)E=t[r],r+1<_&&(v=E.charCodeAt(0))>=55296&&v<=56319&&(E+=t[++r]),E=P?h.call(P,S,E,g):E,e?(d.value=E,f(y,g,d)):y[g]=E,++g;_=g}if(void 0===_)for(_=s(t.length),e&&(y=new e(_)),r=0;r<_;++r)E=P?h.call(P,S,t[r],r):t[r],e?(d.value=E,f(y,r,d)):y[r]=E;return e&&(d.value=null,y.length=_),y}},function(t,e,r){"use strict";t.exports=function(){var t,e,r=Array.from;return"function"==typeof r&&(e=r(t=["raz","dwa"]),Boolean(e&&e!==t&&"dwa"===e[1]))}},function(t,e,r){"use strict";t.exports=r(44)()?Array.from:r(43)},function(t,e,r){"use strict";var n=r(45),i=r(11),o=r(1);t.exports=function(t){var e=Object(o(t)),r=arguments[1],s=Object(arguments[2]);if(e!==t&&!r)return e;var a={};return r?n(r,function(e){(s.ensure||e in t)&&(a[e]=t[e])}):i(a,t),a}},function(t,e,r){"use strict";var n,i=r(46),o=r(18),s=r(2),a=r(41),u=r(2),l=r(1),c=Function.prototype.bind,p=Object.defineProperty,h=Object.prototype.hasOwnProperty;n=function(t,e,r){var n,o=l(e)&&u(e.value);return delete(n=i(e)).writable,delete n.value,n.get=function(){return!r.overwriteDefinition&&h.call(this,t)?o:(e.value=c.call(o,r.resolveContext?r.resolveContext(this):this),p(this,t,e),this[t])},n},t.exports=function(t){var e=o(arguments[1]);return null!=e.resolveContext&&s(e.resolveContext),a(t,function(t,r){return n(r,t,e)})}},function(t,e,r){"use strict";var n,i=r(9),o=r(17),s=r(4),a=r(3),u=r(10),l=Object.defineProperty;n=t.exports=function(t,e){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");u.call(this,t),e=e?o.call(e,"key+value")?"key+value":o.call(e,"key")?"key":"value":"value",l(this,"__kind__",s("",e))},i&&i(n,u),delete n.prototype.constructor,n.prototype=Object.create(u.prototype,{_resolve:s(function(t){return"value"===this.__kind__?this.__list__[t]:"key+value"===this.__kind__?[t,this.__list__[t]]:t})}),l(n.prototype,a.toStringTag,s("c","Array Iterator"))},function(t,e,r){"use strict";var n=r(8),i=r(7),o=r(48),s=r(38),a=r(16),u=r(3).iterator;t.exports=function(t){return"function"==typeof a(t)[u]?t[u]():n(t)?new o(t):i(t)?new s(t):new o(t)}},function(t,e,r){"use strict";var n=r(8),i=r(2),o=r(7),s=r(49),a=Array.isArray,u=Function.prototype.call,l=Array.prototype.some;t.exports=function(t,e){var r,c,p,h,d,f,g,y,_=arguments[2];if(a(t)||n(t)?r="array":o(t)?r="string":t=s(t),i(e),p=function(){h=!0},"array"!==r)if("string"!==r)for(c=t.next();!c.done;){if(u.call(e,_,c.value,p),h)return;c=t.next()}else for(f=t.length,d=0;d<f&&(g=t[d],d+1<f&&(y=g.charCodeAt(0))>=55296&&y<=56319&&(g+=t[++d]),u.call(e,_,g,p),!h);++d);else l.call(t,function(t){return u.call(e,_,t,p),h})}},function(t,e,r){"use strict";var n=r(8),i=r(5),o=r(7),s=r(3).iterator,a=Array.isArray;t.exports=function(t){return!(!i(t)||!a(t)&&!o(t)&&!n(t)&&"function"!=typeof t[s])}},function(t,e,r){"use strict";t.exports=function(t){return!!t&&("symbol"==typeof t||!!t.constructor&&"Symbol"===t.constructor.name&&"Symbol"===t[t.constructor.toStringTag])}},function(t,e,r){"use strict";var n=r(52);t.exports=function(t){if(!n(t))throw new TypeError(t+" is not a symbol");return t}},function(t,e,r){"use strict";var n,i,o,s,a=r(4),u=r(53),l=Object.create,c=Object.defineProperties,p=Object.defineProperty,h=Object.prototype,d=l(null);if("function"==typeof Symbol){n=Symbol;try{String(n()),s=!0}catch(t){}}var f=function(){var t=l(null);return function(e){for(var r,n,i=0;t[e+(i||"")];)++i;return t[e+=i||""]=!0,p(h,r="@@"+e,a.gs(null,function(t){n||(n=!0,p(this,r,a(t)),n=!1)})),r}}();o=function(t){if(this instanceof o)throw new TypeError("Symbol is not a constructor");return i(t)},t.exports=i=function t(e){var r;if(this instanceof t)throw new TypeError("Symbol is not a constructor");return s?n(e):(r=l(o.prototype),e=void 0===e?"":String(e),c(r,{__description__:a("",e),__name__:a("",f(e))}))},c(i,{for:a(function(t){return d[t]?d[t]:d[t]=i(String(t))}),keyFor:a(function(t){var e;for(e in u(t),d)if(d[e]===t)return e}),hasInstance:a("",n&&n.hasInstance||i("hasInstance")),isConcatSpreadable:a("",n&&n.isConcatSpreadable||i("isConcatSpreadable")),iterator:a("",n&&n.iterator||i("iterator")),match:a("",n&&n.match||i("match")),replace:a("",n&&n.replace||i("replace")),search:a("",n&&n.search||i("search")),species:a("",n&&n.species||i("species")),split:a("",n&&n.split||i("split")),toPrimitive:a("",n&&n.toPrimitive||i("toPrimitive")),toStringTag:a("",n&&n.toStringTag||i("toStringTag")),unscopables:a("",n&&n.unscopables||i("unscopables"))}),c(o.prototype,{constructor:a(i),toString:a("",function(){return this.__name__})}),c(i.prototype,{toString:a(function(){return"Symbol ("+u(this).__description__+")"}),valueOf:a(function(){return u(this)})}),p(i.prototype,i.toPrimitive,a("",function(){var t=u(this);return"symbol"==typeof t?t:t.toString()})),p(i.prototype,i.toStringTag,a("c","Symbol")),p(o.prototype,i.toStringTag,a("c",i.prototype[i.toStringTag])),p(o.prototype,i.toPrimitive,a("c",i.prototype[i.toPrimitive]))},function(t,e,r){"use strict";var n={object:!0,symbol:!0};t.exports=function(){var t;if("function"!=typeof Symbol)return!1;t=Symbol("test symbol");try{String(t)}catch(t){return!1}return!!n[typeof Symbol.iterator]&&!!n[typeof Symbol.toPrimitive]&&!!n[typeof Symbol.toStringTag]}},function(t,e,r){"use strict";var n,i,o,s,a,u,l,c=r(4),p=r(2),h=Function.prototype.apply,d=Function.prototype.call,f=Object.create,g=Object.defineProperty,y=Object.defineProperties,_=Object.prototype.hasOwnProperty,v={configurable:!0,enumerable:!1,writable:!0};i=function(t,e){var r,i;return p(e),i=this,n.call(this,t,r=function(){o.call(i,t,r),h.call(e,this,arguments)}),r.__eeOnceListener__=e,this},o=function(t,e){var r,n,i,o;if(p(e),!_.call(this,"__ee__"))return this;if(!(r=this.__ee__)[t])return this;if("object"==typeof(n=r[t]))for(o=0;i=n[o];++o)i!==e&&i.__eeOnceListener__!==e||(2===n.length?r[t]=n[o?0:1]:n.splice(o,1));else n!==e&&n.__eeOnceListener__!==e||delete r[t];return this},s=function(t){var e,r,n,i,o;if(_.call(this,"__ee__")&&(i=this.__ee__[t]))if("object"==typeof i){for(r=arguments.length,o=new Array(r-1),e=1;e<r;++e)o[e-1]=arguments[e];for(i=i.slice(),e=0;n=i[e];++e)h.call(n,this,o)}else switch(arguments.length){case 1:d.call(i,this);break;case 2:d.call(i,this,arguments[1]);break;case 3:d.call(i,this,arguments[1],arguments[2]);break;default:for(r=arguments.length,o=new Array(r-1),e=1;e<r;++e)o[e-1]=arguments[e];h.call(i,this,o)}},a={on:n=function(t,e){var r;return p(e),_.call(this,"__ee__")?r=this.__ee__:(r=v.value=f(null),g(this,"__ee__",v),v.value=null),r[t]?"object"==typeof r[t]?r[t].push(e):r[t]=[r[t],e]:r[t]=e,this},once:i,off:o,emit:s},u={on:c(n),once:c(i),off:c(o),emit:c(s)},l=y({},u),t.exports=e=function(t){return null==t?f(l):y(Object(t),u)},e.methods=a},function(t,e,r){"use strict";var n=String.prototype.indexOf;t.exports=function(t){return n.call(this,t,arguments[1])>-1}},function(t,e,r){"use strict";var n="razdwatrzy";t.exports=function(){return"function"==typeof n.contains&&!0===n.contains("dwa")&&!1===n.contains("foo")}},function(t,e,r){"use strict";t.exports=function(t){return"function"==typeof t}},function(t,e,r){"use strict";var n=r(5),i=Object.keys;t.exports=function(t){return i(n(t)?Object(t):t)}},function(t,e,r){"use strict";t.exports=function(){try{return Object.keys("primitive"),!0}catch(t){return!1}}},function(t,e,r){"use strict";t.exports=r(61)()?Object.keys:r(60)},function(t,e,r){"use strict";var n=r(62),i=r(1),o=Math.max;t.exports=function(t,e){var r,s,a,u=o(arguments.length,2);for(t=Object(i(t)),a=function(n){try{t[n]=e[n]}catch(t){r||(r=t)}},s=1;s<u;++s)e=arguments[s],n(e).forEach(a);if(void 0!==r)throw r;return t}},function(t,e,r){"use strict";t.exports=function(){var t,e=Object.assign;return"function"==typeof e&&(e(t={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),t.foo+t.bar+t.trzy==="razdwatrzy")}},function(t,e,r){"use strict";var n,i=Object.create;r(20)()||(n=r(19)),t.exports=function(){var t,e,r;return n?1!==n.level?i:(t={},e={},r={configurable:!1,enumerable:!1,writable:!0,value:void 0},Object.getOwnPropertyNames(Object.prototype).forEach(function(t){return"__proto__"===t?void(e[t]={configurable:!0,enumerable:!1,writable:!0,value:void 0}):void(e[t]=r)}),Object.defineProperties(t,e),Object.defineProperty(n,"nullPolyfill",{configurable:!1,enumerable:!1,writable:!1,value:t}),function(e,r){return i(null===e?t:e,r)}):i}()},function(t,e,r){"use strict";var n=r(5),i={function:!0,object:!0};t.exports=function(t){return n(t)&&i[typeof t]||!1}},function(t,e,r){"use strict";t.exports=function(t){return t=Number(t),isNaN(t)||0===t?t:t>0?1:-1}},function(t,e,r){"use strict";t.exports=function(){var t=Math.sign;return"function"==typeof t&&1===t(10)&&-1===t(-20)}},function(t,e,r){"use strict";t.exports=r(68)()?Math.sign:r(67)},function(t,e,r){"use strict";var n=r(69),i=Math.abs,o=Math.floor;t.exports=function(t){return isNaN(t)?0:0!==(t=Number(t))&&isFinite(t)?n(t)*o(i(t)):t}},function(t,e,r){"use strict";t.exports=function(t){return t!=t}},function(t,e,r){"use strict";t.exports=function(){var t=Number.isNaN;return"function"==typeof t&&!t({})&&t(NaN)&&!t(34)}},function(t,e,r){"use strict";t.exports=r(72)()?Number.isNaN:r(71)},function(t,e,r){"use strict";var n=r(73),i=r(21),o=r(1),s=Array.prototype.indexOf,a=Object.prototype.hasOwnProperty,u=Math.abs,l=Math.floor;t.exports=function(t){var e,r,c,p;if(!n(t))return s.apply(this,arguments);for(r=i(o(this).length),c=arguments[1],c=isNaN(c)?0:c>=0?l(c):i(this.length)-l(u(c)),e=c;e<r;++e)if(a.call(this,e)&&(p=this[e],n(p)))return e;return-1}},function(t,e,r){"use strict";var n,i=r(23),o=r(74),s=r(9),a=r(2),u=r(1),l=r(4),c=r(56),p=r(3),h=r(16),d=r(50),f=r(37),g=r(34),y=Function.prototype.call,_=Object.defineProperties,v=Object.getPrototypeOf;t.exports=n=function(){var t,e,r,i=arguments[0];if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");return r=g&&s&&Map!==n?s(new Map,v(this)):this,null!=i&&h(i),_(r,{__mapKeysData__:l("c",t=[]),__mapValuesData__:l("c",e=[])}),i?(d(i,function(r){var n=u(r)[0];r=r[1],-1===o.call(t,n)&&(t.push(n),e.push(r))},r),r):r},g&&(s&&s(n,Map),n.prototype=Object.create(Map.prototype,{constructor:l(n)})),c(_(n.prototype,{clear:l(function(){this.__mapKeysData__.length&&(i.call(this.__mapKeysData__),i.call(this.__mapValuesData__),this.emit("_clear"))}),delete:l(function(t){var e=o.call(this.__mapKeysData__,t);return-1!==e&&(this.__mapKeysData__.splice(e,1),this.__mapValuesData__.splice(e,1),this.emit("_delete",e,t),!0)}),entries:l(function(){return new f(this,"key+value")}),forEach:l(function(t){var e,r,n=arguments[1];for(a(t),e=this.entries(),r=e._next();void 0!==r;)y.call(t,n,this.__mapValuesData__[r],this.__mapKeysData__[r],this),r=e._next()}),get:l(function(t){var e=o.call(this.__mapKeysData__,t);if(-1!==e)return this.__mapValuesData__[e]}),has:l(function(t){return-1!==o.call(this.__mapKeysData__,t)}),keys:l(function(){return new f(this,"key")}),set:l(function(t,e){var r,n=o.call(this.__mapKeysData__,t);return-1===n&&(n=this.__mapKeysData__.push(t)-1,r=!0),this.__mapValuesData__[n]=e,r&&this.emit("_add",n,t),this}),size:l.gs(function(){return this.__mapKeysData__.length}),values:l(function(){return new f(this,"value")}),toString:l(function(){return"[object Map]"})})),Object.defineProperty(n.prototype,p.iterator,l(function(){return this.entries()})),Object.defineProperty(n.prototype,p.toStringTag,l("c","Map"))},function(t,e,r){"use strict";t.exports=function(){var t,e,r;if("function"!=typeof Map)return!1;try{t=new Map([["raz","one"],["dwa","two"],["trzy","three"]])}catch(t){return!1}return"[object Map]"===String(t)&&3===t.size&&"function"==typeof t.clear&&"function"==typeof t.delete&&"function"==typeof t.entries&&"function"==typeof t.forEach&&"function"==typeof t.get&&"function"==typeof t.has&&"function"==typeof t.keys&&"function"==typeof t.set&&"function"==typeof t.values&&(e=t.entries(),!1===(r=e.next()).done&&!!r.value&&"raz"===r.value[0]&&"one"===r.value[1])}},function(t,e,r){"use strict";t.exports=r(76)()?Map:r(75)},function(t,e,r){"use strict";function n(t,e,r){return{name:e.name,preset:t.preset,bitrate:t.bitrate,protocol:t.rendition.scProtocol,host:function(t){var e=t.split("//",2);return 1===e.length?e[0].split("/",1)[0]:e[1]?e[1].split("/",1)[0]:""}(r),url:function(t){var e=a.exec(t);return e&&e[0]||""}(r),format:t.rendition.scFormat,quality:t.quality}}Object.defineProperty(e,"__esModule",{value:!0});var i=r(77),o=r(0),s=r(24),a=/^[^?#]*/,u=function(){function t(t){var e=t.logger,r=t.controllers,n=t.playerId,s=t.streamUrlsExpire,a=t.fetchEnabled,u=t.fadeOnPauseAndPlay,l=t.fadeOnSeek,c=t.cacheManager,p=t.providePlayer,h=t.removePlayer,d=t.streamUrlRetriever,f=t.getURLOpts,g=t.errorEventGenerator,y=t.audioPerformanceEventGenerator;this._quality=null,this._onQualityChanged=new o.eventDispatcher.EventDispatcher,this._controllerIndexByRendition=new i,this._controlledPlayerWithRendition=null,this.onQualityChanged=this._onQualityChanged.getHandle(),this._logger=o.logger.prefixLogger(e,"ControllerManager"),this._controllers=r,this._playerId=n,this._streamUrlsExpire=s,this._fetchEnabled=a,this._fadeOnPauseAndPlay=u,this._fadeOnSeek=l,this._cacheManager=c,this._providePlayer=p,this._removePlayer=h,this._streamUrlRetriever=d,this._getURLOpts=f,this._errorEventGenerator=g||null,this._audioPerformanceEventGenerator=y||null}return t.prototype.buildNextController=function(t,e){var r=this;if(this._controlledPlayerWithRendition)throw new Error("A player is already being controlled.");this._logger.debug("Building next controller.");var n=this._controllerIndexByRendition.get(t.rendition)||0;if(n>=this._controllers.length)this._logger.debug("No more controllers for this rendition."),e({excludeRendition:!0,immediateRetry:!0});else{var i=!1;this._manageController(t,this._controllers[n],function(o){if(i)throw new Error("performNextAction() already called");i=!0,"MOVE_ON"!==o&&"MOVE_ON_SAME_RENDITION"!==o||(r._logger.debug("Controller will not be used again."),r._controllerIndexByRendition.set(t.rendition,n+1)),"MOVE_ON_SAME_RENDITION"===o?r.buildNextController(t,e):e({excludeRendition:!1,immediateRetry:"MOVE_ON"===o})})}},t.prototype.releaseCurrentController=function(t){var e=t.retry;if(!this._controlledPlayerWithRendition)throw new Error("There is no player being controlled.");this._controlledPlayerWithRendition.releaseControl({retry:e})},t.prototype.getQuality=function(){return this._quality},t.prototype.getPlayerDetails=function(){if(!this._controlledPlayerWithRendition)throw new Error("There is no player being controlled.");var t=this._controlledPlayerWithRendition,e=t.initialUrlAndRendition,r=t.controller,i=t.controlledPlayer;return n(e,r,i.getUrl())},t.prototype._manageController=function(t,e,r){var i=this,a=function(){i._removePlayer(),i._controlledPlayerWithRendition=null,u&&u.kill()};if(this._logger.debug("Preparing controller.",e.name),!e.isRenditionSupported(t.rendition,{streamUrlExpires:this._streamUrlsExpire}))return this._logger.debug("Skipping controller because rendition not supported."),void r("MOVE_ON_SAME_RENDITION");var u,l=!1,c=function(t){var e=t.retry;l||(l=!0,i._logger.debug("Releasing control."),a(),r(e?"RETRY":"MOVE_ON"))};try{this._logger.debug("Building player.");var p=e.buildPlayer({logger:o.logger.prefixLogger(this._logger,e.name+"-Controller"),playerId:this._playerId,urlAndRendition:t,streamUrlExpires:this._streamUrlsExpire,fetchEnabled:this._fetchEnabled,releaseControl:c,fadeOnPauseAndPlay:this._fadeOnPauseAndPlay,fadeOnSeek:this._fadeOnSeek,getNewUrl:function(){return i._getNewUrlWithSameRendition(t.rendition)},reportError:function(r){i._errorEventGenerator&&i._errorEventGenerator.reportManualEvent(r,n(t,e,p?p.getUrl():t.url))},reportPerformance:function(t){!l&&i._audioPerformanceEventGenerator&&i._audioPerformanceEventGenerator.reportManualEvent(t)}});if(u=p.getPlayer(),l)this._logger.warn("Player released during constrution."),u.kill();else if(u.isDead()){var h=u.getFatalError();h instanceof o.errors.NotSupportedError?this._logger.debug("Player not supported (during construction)."):this._logger.error("Error during construction.",h),r("MOVE_ON_SAME_RENDITION")}else{this._logger.debug("Player built."),u.onChange.subscribe(function(t){var e=t.dead,r=t.fatalError;e&&(r&&i._logger.error("Fatal player error occurred.",r),c({retry:!1}))}),this._cacheManager.addPlayer(u),this._controlledPlayerWithRendition={controller:e,controlledPlayer:p,initialUrlAndRendition:t,releaseControl:c},this._providePlayer(p.getPlayer(),e.syncConfig,e.supportsVolumeAutomation),this._logger.debug("Player provided to proxy.");var d=t.quality||null;this._quality!==d&&(this._logger.debug("Quality changed.",d),this._quality=d,this._onQualityChanged.dispatch(d))}}catch(t){t===s.notSupportedError?this._logger.debug("Player not supported. Not constructed."):this._logger.error("Error during construction.",t),a(),r("MOVE_ON_SAME_RENDITION")}},t.prototype._getNewUrlWithSameRendition=function(t){var e=this,r=new o.helpers.abortableJob.AbortableJob(function(){var r=e._streamUrlRetriever.getUrl(e._getURLOpts),n=r.whenComplete().then(function(e){var r=null;return e&&e.success&&e.rendition===t&&(r=e.url),r});return{result:n,abort:function(){return r.abort()}}});return r.run()},t}();e.ControllerManager=u},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),i=r(12),o=1e3,s=function(){function t(t,e,r,i,s){this._checkpointTimer=null,this._logger=n.logger.prefixLogger(i,"AudioEventGenerator"),this._player=t,this._eventReporter=e,this._checkpointInterval=Math.max(o,r),this._getPlayerDetails=s,this._startReporting()}return t.prototype._startReporting=function(){var t=this,e=this._player;e.onChange.subscribe(function(r){var n=r.actuallyPlaying,i=r.ended;!0===n&&!e.isEnded()||!1===i&&e.isActuallyPlaying()?(t._checkpointTimer||(t._checkpointTimer=window.setInterval(function(){t._reportEvent("checkpoint")},t._checkpointInterval)),t._reportEvent("play")):(!1===n&&!e.isEnded()||!0===i&&e.isActuallyPlaying())&&(t._checkpointTimer&&(window.clearInterval(t._checkpointTimer),t._checkpointTimer=null),t._reportEvent("pause"))})},t.prototype._reportEvent=function(t){var e=this._getPlayerDetails();if(e){var r=this._player.getDuration();if(null===r)throw new Error("Duration should exist now.");var n={type:t,position:this._player.getPosition(),duration:r,preset:e.preset,quality:e.quality,playerType:e.name,appState:i.getAppState()};this._logger.debug("Generated audio event.",n),this._eventReporter(n)}else this._logger.warn("Cannot report event because there is no player.",t)},t}();e.AudioEventGenerator=s},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(){this._delayFactor=0,this._lastRequestTime=0}return t.prototype.getDelay=function(t){var e=void 0===t?{}:t,r=e.maxDelay,n=void 0===r?3e4:r,i=e.numInstantRuns,o=void 0===i?5:i,s=Date.now()-this._lastRequestTime;this._lastRequestTime=Date.now(),this._delayFactor=Math.max(0,this._delayFactor-s/n),this._delayFactor++;var a=this._delayFactor-o;return a>0?Math.pow(2,a):0},t}();e.DecayingExponentialDelayCalculator=n},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),i=r(12),o=function(){function t(t,e,r,i,o,s){this._logger=n.logger.prefixLogger(s,"ErrorGenerator"),this._player=t,this._logCollector=e,this._logId=r,this._trackId=i,this._eventReporter=o,this._listenForProxyFatalError()}return t.prototype.reportManualEvent=function(t,e){"NOT_SUPPORTED_ERROR"!==t&&"HLS_MSE_PLAYER.NO_TRANSMUXER_ERROR"!==t&&(this._logger.debug("Reporting manual error event.",t),this._reportEvent(t,e))},t.prototype._listenForProxyFatalError=function(){var t=this;this._player.onError.subscribe(function(e){e instanceof n.errors.PlayerFatalError&&t._reportEvent(e.getCode())})},t.prototype._reportEvent=function(t,e){var r={errorCode:t,log:this._logCollector.getLog(),logId:this._logId,trackId:this._trackId,protocol:e&&e.protocol,playerType:e&&e.name?e.name:"MaestroUnknown",host:e&&e.host,bitrate:e&&e.bitrate,format:e&&e.format,preset:e&&e.preset,quality:e&&e.quality,url:e&&e.url,appState:i.getAppState()};this._logger.debug("Generated audio error event.",r),this._eventReporter(r)},t}();e.ErrorEventGenerator=o},function(t,e,r){"use strict";function n(t,e){var r=t.getBufferedTimeRanges();return r?o(r,function(t){return t.containsTime(e)})||new i.TimeRange(e,0):null}Object.defineProperty(e,"__esModule",{value:!0});var i=r(0),o=i.helpers.find,s=function(){function t(t){var e=t.proxy,r=t.getPlayer;this._getPlayer=r;var i=this._position=e.getPosition(),o=this._initialActualPlayer=r();if(o){var s=n(o,i);this._initialBuffered=s?s.end-i:null}else this._initialBuffered=null}return t.prototype.getPreloaded=function(){var t=this._initialBuffered;return null!==t&&this._initialActualPlayer&&this._getPlayer()===this._initialActualPlayer?0===t?"no":t>=2e3?"yes":"partial":null},t}();e.PreloadingCalculator=s},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),i=n.helpers.time.now,o=function(){function t(){this._start=null,this._end=null}return t.prototype.start=function(){if(this.isComplete())throw new Error("Timer completed.");this._start=i()},t.prototype.isComplete=function(){return null!==this._end},t.prototype.stop=function(){if(null===this._start)throw new Error("Not started.");this._end=i()},t.prototype.getTime=function(){if(null===this._end)throw new Error("Not completed.");return this._end-this._start},t}();e.Timer=o},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),i=r(83),o=r(82),s=r(12),a=function(){function t(t,e,r,i,o){this._logger=n.logger.prefixLogger(i,"AudioPerformanceEventGenerator"),this._proxy=t,this._getPlayer=e,this._eventReporter=r,this._getPlayerDetails=o,this._measureGeneralEvents()}return t.prototype.reportManualEvent=function(t){this._logger.debug("Reporting manual audio performance event.",t),this._eventReporter(t)},t.prototype._measureGeneralEvents=function(){var t=this,e=this._proxy,r=null,n=null,s=null,a=null,u=null,l=null,c=null,p=!0;e.onChange.subscribe(function(h){var d=h.playing,f=h.actuallyPlaying,g=h.seek,y=h.seeking,_=h.stalled,v=h.ended,m=h.dead;if(!0!==m&&!1!==d||!a||(a.stop(),a.getTime()>=1e3&&t._reportEvent("rageSkip",a.getTime(),null),a=null),e.isDead())c&&window.clearTimeout(c);else{var b=e.getSeekState();e.isActuallyPlaying()||a||!(!0===d||e.isPlaying()&&!0===_)||(a=new i.Timer).start(),!0===d&&(r||((r=new i.Timer).start(),n=new o.PreloadingCalculator({proxy:e,getPlayer:t._getPlayer}),c=window.setTimeout(function(){t._reportEvent("longInitialBuffering",0,null)},3e4),0===e.getPosition()&&(p=!1))),!1===d&&(c&&window.clearTimeout(c),r&&!r.isComplete()&&(r=null)),!0===f&&(a=null,r&&!r.isComplete()&&(r.stop(),c&&window.clearTimeout(c),t._reportEvent("play",r.getTime(),n.getPreloaded()))),g&&"IN_PROGRESS"===g.state&&e.isReady()&&((s=new i.Timer).start(),u=new o.PreloadingCalculator({proxy:e,getPlayer:t._getPlayer}),!0===y&&t._reportEvent("seekStart",0,null)),(g&&"COMPLETED"===g.state&&!e.isStalled()||!1===_&&b&&"COMPLETED"===b.state)&&s&&(s.stop(),t._reportEvent("seek",s.getTime(),u.getPreloaded()),s=null),!0!==_||!e.isPlaying()||b&&"IN_PROGRESS"===b.state||r&&r.isComplete()&&((l=new i.Timer).start(),t._reportEvent("rebufferingStart",e.getPosition(),null)),!1===_&&(r&&r.isComplete()&&(a=null),l&&(l.stop(),t._reportEvent("rebufferingEnd",l.getTime(),null),l=null)),!0!==v||p||(t._reportEvent("uninterruptedPlay",0,null),p=!0);var w=b&&"IN_PROGRESS"===b.state;!w&&!0===_&&e.isActuallyPlaying()&&(p=!0)}})},t.prototype._reportEvent=function(t,e,r){var n=this._getPlayerDetails();if(n){var i={type:t,latency:e,protocol:n.protocol,playerType:n.name,host:n.host,bitrate:n.bitrate,format:n.format,preset:n.preset,quality:n.quality,preloaded:r||void 0,appState:s.getAppState()};this._logger.debug("Generated audio performance event.",i),this._eventReporter(i)}else this._logger.warn("Cannot report event because there is no player.",t,e)},t}();e.AudioPerformanceEventGenerator=a},function(t,e,r){"use strict";var n=this&&this.__assign||Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t};Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t){void 0===t&&(t=200),this._bufferSize=t,this._log=[]}return t.prototype.getLog=function(){return this._log.map(function(t){return n({},t,{data:function(t){return t.map(function(t){try{return JSON.stringify(t)}catch(t){return"<unavailable>"}})}(t.data)})})},t.prototype.debug=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];this._push({level:"debug",msg:t,data:e,time:Date.now()})},t.prototype.info=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];this._push({level:"info",msg:t,data:e,time:Date.now()})},t.prototype.warn=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];this._push({level:"warn",msg:t,data:e,time:Date.now()})},t.prototype.error=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];this._push({level:"error",msg:t,data:e,time:Date.now()})},t.prototype._push=function(t){this._log.push(t)>this._bufferSize&&this._log.shift()},t}();e.LogCollector=i},function(t,e,r){"use strict";function n(t,e,r){return Math.min(e,Math.max(t,r))}var i=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=r(0),s=r(26),a=r(85),u=r(84),l=r(81),c=r(80),p=r(79),h=r(78),d=r(33),f=r(32),g=r(6),y=r(15),_=r(31),v=r(30),m=r(29),b=r(14),w=r(13),E=o.eventDispatcher.EventDispatcher,P=o.helpers.Promise,S=o.helpers.deferred.buildDeferred,x=new d.CacheManager(15e7,o.logger.noOpLogger),k=-1,A=[],O=1,T=!1;e.setGlobalVolume=function(t){if("number"!=typeof t)throw new Error("level must be a number.");if(t<0||t>1)throw new Error("Invalid volume level.");O=t,A.forEach(function(e){return e.setVolume(t)})},e.getGlobalVolume=function(){return O},e.setGlobalMuted=function(t){if("boolean"!=typeof t)throw new Error("muteEnabled must be a boolean.");T=t,A.forEach(function(e){return e.setMuted(t)})},e.getGlobalMuted=function(){return T},e.setCacheSize=function(t){if("number"!=typeof t||t<0)throw new Error("Invalid size.");x.setCacheSize(t)};var R=function(t){function e(e){var r=t.call(this,e)||this;r._onPreloadingEnabled=new E,r._onPreloadingDisabled=new E,r._retryDelayCalculator=new c.DecayingExponentialDelayCalculator,r._errorEventGenerator=null,r._fadeOutVolumeAutomator=null,r._volumeAutomators=[],r._volumeScale=1,r._userVolume=1,r._volumeAutomationSupported=!1,r._timer=null,r._pauseFadeTimer=null,r._pauseFadeDeferred=null,r._pauseFade=null,r._executionState={state:"IDLE"},r._preloadingListeners=[],r._retrieveAndBuildTimer=null,r._hadAStreamUrl=!1;var n=r._config=_.validatePlayerDependencies(e);r._preloadingEnabled=n.preloadingEnabled,r._getURLOpts=n.getURLOpts,r._controllers=n.controllers;var i=r._connectionRequiredHelper=new m.ConnectionRequiredHelper(r);r.onPreloadingEnabled=r._onPreloadingEnabled.getHandle(),r.onPreloadingDisabled=r._onPreloadingDisabled.getHandle(),r.onConnectionRequired=i.onConnectionRequired,r.onConnectionRecovered=i.onConnectionRecovered,r.onChange.subscribe(function(t){r.isDead()||((!1===t.playing||t.positionJumped||t.stalled||t.ended)&&r._completePauseFade(),r._pauseFade&&(!1===t.actuallyPlaying||t.ended||!0===t.playing)&&(r._removeVolumeAutomator(r._pauseFade),r._pauseFade=null),(t.positionJumped||void 0!==t.actuallyPlaying||void 0!==t.stalled)&&r._updateVolume(),void 0!==t.playing&&r._updateMaxBufferLength())});var s="SCAudio-"+ ++k,d=n.streamUrlRetriever.getTrackId();null!==d&&(s+="-"+d);var f=new a.LogCollector,g=o.logger.cloneLogger(f,r._logger);r._logger=o.logger.prefixLogger(g,s);var y=v.generateLogId();r._logger.info("Building player...",{ua:navigator.userAgent,getURLOpts:r._getURLOpts,logId:y}),A.push(r),r.setVolume(O,T),r._updateFadeOut();var b=null,w=null;n.audioPerformanceReporter&&(b=new u.AudioPerformanceEventGenerator(r,function(){return r._getPlayer()},n.audioPerformanceReporter,r._logger,function(){return r._getActivePlayerDetails()})),n.audioReporter&&new p.AudioEventGenerator(r,n.audioReporter,n.audioCheckpointInterval,r._logger,function(){return r._getActivePlayerDetails()}),n.errorReporter&&(w=r._errorEventGenerator=new l.ErrorEventGenerator(r,f,y,d,n.errorReporter,r._logger)),r._excludeUnsupportedRenditions();var P=r._controllerManager=new h.ControllerManager({logger:r._logger,controllers:n.controllers,playerId:s,streamUrlsExpire:n.streamUrlsExpire,fetchEnabled:n.fetchEnabled,fadeOnPauseAndPlay:n.fadeOnPauseAndPlay,fadeOnSeek:n.fadeOnSeek,cacheManager:x,providePlayer:function(t,e,n){r._volumeAutomationSupported=n,r._providePlayer(t,e),r._updateMaxBufferLength()},removePlayer:function(){r._getPlayer()&&r._removePlayer()},streamUrlRetriever:r._config.streamUrlRetriever,getURLOpts:r._getURLOpts,errorEventGenerator:w||void 0,audioPerformanceEventGenerator:b||void 0});if(r.onQualityChanged=P.onQualityChanged,void 0!==n.duration&&(r._logger.debug("Setting initial duration.",n.duration),r._setInitialDuration(n.duration)),r._preloadingEnabled)r._logger.debug("Preloading is enabled, so performing retrieve immediately."),r._retrieveAndBuild();else{r._logger.debug("Preloading is disabled, so deferring retrieve until either a play intent or preloading is enabled.");var S=function(){r._removePreloadingListeners(),r._logger.debug("Preloading now enabled or received a play request. Peforming retrieve."),r._retrieveAndBuild()};r._preloadingListeners.push(r.onPreloadingEnabled.subscribe(S),r.onPlayIntent.subscribe(S))}return r}return i(e,t),e.prototype.reload=function(t){void 0===t&&(t={}),this._ensureNotDead(),this._reloadStreamUrls(t)},e.prototype.enablePreloading=function(){this.isDead()||this._preloadingEnabled||(this._preloadingEnabled=!0,this._updateMaxBufferLength(),this._onPreloadingEnabled.dispatch(void 0))},e.prototype.disablePreloading=function(){this.isDead()||this._preloadingEnabled&&(this._preloadingEnabled=!1,this._updateMaxBufferLength(),this._onPreloadingDisabled.dispatch(void 0))},e.prototype.isPreloadingEnabled=function(){return this._preloadingEnabled},e.prototype.pauseAfterFade=function(t){var e=this;if(this._ensureNotDead(),this._pauseFadeDeferred)return this._pauseFadeDeferred.promise;if(!this.isPlaying()||!this.isActuallyPlaying())return P.resolve(this.pause());var r=S();this._pauseFadeDeferred=r;var n=this.getPosition();if(this._pauseFade)throw new Error("Fade should not already be assigned.");return this._pauseFade=new s.Fade({startPos:n,endPos:n+t,startLevel:1,endLevel:0}),this._addVolumeAutomator(this._pauseFade),this._pauseFadeTimer=window.setTimeout(function(){e._pauseFadeDeferred=null,r.resolve(e.pause({fadeDuration:0}))},t+50),r.promise},e.prototype.isConnectionRequired=function(){return this._connectionRequiredHelper.isConnectionRequired()},e.prototype.getQuality=function(){return this._controllerManager.getQuality()},e.prototype.getVolume=function(){return this._volumeAutomationSupported?this._userVolume:t.prototype.getVolume.call(this)},e.prototype._handleFatalError=function(t){this._logger.warn("Fatal error from current player.",t)},e.prototype._handleVolumeChange=function(e,r){this._userVolume=e,t.prototype._notifyVolumeChange.call(this,e,r),this._calculateAndSetVolume()},e.prototype._notifyVolumeChange=function(){},e.prototype._kill=function(){t.prototype._kill.call(this),this._timer&&window.clearTimeout(this._timer),this._abortPauseFade(),this._removePreloadingListeners(),A.splice(A.indexOf(this),1),"RETRIEVING_URL"===this._executionState.state?this._executionState.retrieveJob.abort():"CONTROLLING_PLAYER"===this._executionState.state&&this._controllerManager.releaseCurrentController({retry:!1}),this._executionState={state:"DEAD"},this._retrieveAndBuildTimer&&window.clearTimeout(this._retrieveAndBuildTimer)},e.prototype._excludeUnsupportedRenditions=function(){var t=this,e={streamUrlExpires:this._config.streamUrlsExpire},r=w.allRenditions.filter(function(r){return!t._controllers.some(function(t){return t.isRenditionSupported(r,e)})});r.forEach(function(e){t._config.streamUrlRetriever.excludeRendition(e)})},e.prototype._addVolumeAutomator=function(t){var e=this._volumeAutomators.indexOf(t);e<0&&(this._volumeAutomators.push(t),this._updateVolume())},e.prototype._removeVolumeAutomator=function(t){var e=this._volumeAutomators.indexOf(t);e>=0&&(this._volumeAutomators.splice(e,1),this._updateVolume())},e.prototype._removePreloadingListeners=function(){this._preloadingListeners.forEach(function(t){return t.remove()})},e.prototype._getActivePlayerDetails=function(){return"CONTROLLING_PLAYER"!==this._executionState.state?null:this._controllerManager.getPlayerDetails()},e.prototype._updateFadeOut=function(){this._fadeOutVolumeAutomator&&this._removeVolumeAutomator(this._fadeOutVolumeAutomator),this._getURLOpts.snippet&&(this._fadeOutVolumeAutomator=s.buildFadeOut(3e3),this._addVolumeAutomator(this._fadeOutVolumeAutomator))},e.prototype._handleUnexpectedError=function(t){try{t()}catch(t){this._logger.error("Unexpected error.",t),this._triggerError(new o.errors.PlayerFatalError("An unexpected error occurred.",t))}},e.prototype._retrieveAndBuild=function(){var t=this;this._handleUnexpectedError(function(){if(-1===["IDLE","WAITING_TO_RETRIEVE"].indexOf(t._executionState.state))throw new Error("Invalid state for retrieveAndBuild().");t._logger.debug("Retrieving URL...");var e=f.retrieveUrl({streamUrlRetriever:t._config.streamUrlRetriever,urlProviderRetryDelayCalculator:t._config.urlProviderRetryDelayCalculator,getURLOpts:t._getURLOpts,logger:t._logger});t._executionState={state:"RETRIEVING_URL",retrieveJob:e},e.onCompletion(function(e){if(t._logger.debug("Retrieved URL.",!!e),e&&e.success){t._hadAStreamUrl=!0;var r=!1,n=function(n){var i=n.excludeRendition,o=n.immediateRetry;t._handleUnexpectedError(function(){if(r)throw new Error("startOver called multiple times.");if(r=!0,i&&t._config.streamUrlRetriever.excludeRendition(e.rendition),t._executionState={state:"WAITING_TO_RETRIEVE"},t.isDead())t._logger.debug("Stopping execution because player is dead.");else if(o)t._logger.debug("Moving on immediately."),t._retrieveAndBuild();else{var n=t._retryDelayCalculator.getDelay();t._logger.debug("Will move on in "+n+"ms."),n?t._retrieveAndBuildTimer=window.setTimeout(function(){return t._retrieveAndBuild()},n):t._retrieveAndBuild()}})};t._handleUnexpectedError(function(){t._executionState={state:"CONTROLLING_PLAYER"},t._logger.debug("Building controller..."),t._controllerManager.buildNextController(e,n),t._logger.debug("Built controller.")})}else if(e&&e.rendition){if(t._logger.warn("Error retrieving URL. Moving on.",e.error),t._errorEventGenerator){var i="SCAUDIO.URL_RETRIEVER_ERROR."+t._config.streamUrlRetriever.name+"."+e.error.getCode();t._errorEventGenerator.reportManualEvent(i,{preset:e.preset,quality:e.quality,bitrate:e.bitrate,format:e.rendition.scFormat,protocol:e.rendition.scProtocol})}t._config.streamUrlRetriever.excludeRendition(e.rendition),t._executionState={state:"WAITING_TO_RETRIEVE"},t._retrieveAndBuild()}else e&&e.rendition&&t._logger.warn("Error retrieving URL for any rendition.",e.error),t._logger.info("Ran out of streams.",t._hadAStreamUrl),t._triggerError(t._hadAStreamUrl?new g.NotSupportedError:new y.NoStreamsError)}),e.onError(function(e){e!==o.helpers.abortableJob.abortedError&&(e===f.NoMoreAttemptsError?t._logger.error("Ran out of retries to retrieve URL."):t._logger.error("Unexpected error when retrieving a URL.",e),t._triggerError(new b.FailedRetrievingUrlError))})})},e.prototype._reloadStreamUrls=function(t){this._getURLOpts=t,this._updateFadeOut(),this._logger.info("Reloading stream URL's...",this._getURLOpts),"RETRIEVING_URL"===this._executionState.state?(this._logger.debug("Aborting current URL retrieve."),this._executionState.retrieveJob.abort(),this._executionState={state:"WAITING_TO_RETRIEVE"},this._retrieveAndBuild()):"CONTROLLING_PLAYER"===this._executionState.state?(this._logger.debug("Releasing controller."),this._controllerManager.releaseCurrentController({retry:!0})):this._logger.debug("Nothing to do."),this._logger.info("Reloaded stream URL's.")},e.prototype._completePauseFade=function(){if(this._pauseFadeDeferred){this._pauseFadeTimer&&window.clearTimeout(this._pauseFadeTimer);var t=this._pauseFadeDeferred;this._pauseFadeDeferred=null,t.resolve(this.pause())}},e.prototype._abortPauseFade=function(){this._pauseFadeTimer&&(window.clearTimeout(this._pauseFadeTimer),this._pauseFadeTimer=null),this._pauseFadeDeferred&&(this._pauseFadeDeferred.reject(new Error("Player was killed.")),this._pauseFadeDeferred=null)},e.prototype._updateVolume=function(){var t=this;if(this._volumeAutomationSupported){this._ensureNotDead(),this._timer&&(window.clearTimeout(this._timer),this._timer=null);var e=this.getDuration();if(null!==e){var r=this._volumeAutomators,i=this.getPosition(),o=1/0,s=1;r.forEach(function(t){var r=t.calculate(i,e),a=r.nextCalculatePosition,u=r.level;s*=n(0,1,u),a<o&&(o=a)}),this._volumeScale!==s&&(this._volumeScale=s,this._calculateAndSetVolume()),o<1/0&&this.isActuallyPlaying()&&!this.isStalled()&&(this._timer=window.setTimeout(function(){t._timer=null,t._updateVolume()},n(100,5e3,o-this.getPosition())))}}},e.prototype._calculateAndSetVolume=function(){this._volumeAutomationSupported?t.prototype._handleVolumeChange.call(this,this._userVolume*this._volumeScale,this.getMuted()):t.prototype._handleVolumeChange.call(this,this._userVolume,this.getMuted())},e.prototype._updateMaxBufferLength=function(){var t=this._getPlayer(),e=t&&t.getBufferController();e&&(this.isPlaying()?e.setMaxBufferLength(this._config.playingMaxBufferLength):e.setMaxBufferLength(this._preloadingEnabled?this._config.pausedMaxBufferLength:0))},e}(o.ProxyPlayerBase);e.Player=R},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e,r){void 0===t&&(t="UNKNOWN"),void 0===e&&(e=!1),void 0===r&&(r=null),this._code=t,this._transient=e,this._cause=r}return t.prototype.isTransient=function(){return this._transient},t.prototype.getCode=function(){return this._code},t.prototype.getCause=function(){return this._cause},t}();e.UrlRetrieverError=n},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.httpAACHQ={scProtocol:"http",scFormat:"aac",maestroFormat:{mimeType:"audio/mp4",audioCodec:{id:"mp4a.40.2"}}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.encryptedHlsOpus={scProtocol:"encrypted-hls",scFormat:"opus",maestroFormat:{mimeType:"application/x-mpegURL"},maestroSegmentFormat:{mimeType:"audio/ogg",audioCodec:{id:"opus"}}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hlsOpus={scProtocol:"hls",scFormat:"opus",maestroFormat:{mimeType:"application/x-mpegURL"},maestroSegmentFormat:{mimeType:"audio/ogg",audioCodec:{id:"opus"}}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.maestroChromecast={scProtocol:"maestro.chromecast",maestroFormat:{}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.apiMobile={scProtocol:"sc.api-mobile",maestroFormat:{}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.encryptedHlsAACHQ={scProtocol:"encrypted-hls",scFormat:"aac",maestroFormat:{mimeType:"application/x-mpegURL"},maestroSegmentFormat:{mimeType:"audio/mp4",audioCodec:{id:"mp4a.40.2"}}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hlsAACHQ={scProtocol:"hls",scFormat:"aac",maestroFormat:{mimeType:"application/x-mpegURL"},maestroSegmentFormat:{mimeType:"audio/mp4",audioCodec:{id:"mp4a.40.2"}}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.encryptedHlsMp3={scProtocol:"encrypted-hls",scFormat:"mp3",maestroFormat:{mimeType:"application/x-mpegURL"},maestroSegmentFormat:{mimeType:"audio/mpeg"}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hlsMp3={scProtocol:"hls",scFormat:"mp3",maestroFormat:{mimeType:"application/x-mpegURL"},maestroSegmentFormat:{mimeType:"audio/mpeg"}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.httpMp3={scProtocol:"http",scFormat:"mp3",maestroFormat:{mimeType:"audio/mpeg"}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(26);!function(t){t.Fade=n.Fade,t.buildFadeIn=n.buildFadeIn,t.buildFadeOut=n.buildFadeOut}(e.volumeAutomation||(e.volumeAutomation={}))},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),e.version="23.1.0",e.buildNumber=845;var i=r(98);e.volumeAutomation=i.volumeAutomation;var o=r(25);e.BaseStreamUrlRetriever=o.BaseStreamUrlRetriever,n(r(24));var s=r(13);e.renditions=s.renditions,e.allRenditions=s.allRenditions;var a=r(87);e.UrlRetrieverError=a.UrlRetrieverError;var u=r(86);e.Player=u.Player,e.setGlobalVolume=u.setGlobalVolume,e.setGlobalMuted=u.setGlobalMuted,e.getGlobalVolume=u.getGlobalVolume,e.getGlobalMuted=u.getGlobalMuted,e.setCacheSize=u.setCacheSize;var l=r(28);e.Quality=l.Quality,e.resolveQuality=l.resolveQuality,n(r(27))}])}(r(2))},function(t,e,r){window,t.exports=function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var r={};return e.m=t,e.c=r,e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:n})},e.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=97)}([function(t,e,r){"use strict";var n=r(4);t.exports=function(t){if(!n(t))throw new TypeError("Cannot use null or undefined");return t}},function(t,e,r){"use strict";t.exports=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");return t}},function(t,e,r){"use strict";t.exports=r(62)()?Symbol:r(61)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.deferException=function(t){try{t()}catch(t){window.setTimeout(function(){throw t},0)}}},function(t,e,r){"use strict";var n=r(24)();t.exports=function(t){return t!==n&&null!==t}},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=r(11),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.getCode=function(){return"PLAYER_FATAL_ERROR"},e}(i.PlayerError);e.PlayerFatalError=o},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(19),i=function(){function t(){this._listeners=[],this.dispatch=this.dispatch.bind(this)}return t.prototype.subscribe=function(t){var e=this,r={fn:t,payloads:[]};return this._listeners.push(r),{remove:function(){var t=e._listeners.indexOf(r);return t>=0&&(e._listeners.splice(t,1),!0)},retrieve:function(){return e._dispatchListenerPayloads(r)}}},t.prototype.dispatch=function(t,e){var r=this,i="number"==typeof e?{time:e}:e||{},o=void 0!==i.time?i.time:n.now(),s=this._listeners;s.forEach(function(e){return e.payloads.push({time:o,payload:t})});var a=!1;do{a=!s.some(function(t){var e=t.fn,n=t.payloads,i=n.shift();return!!i&&(r._callHandler(e,i),!0)})}while(!a)},t.prototype.getHandle=function(){return{subscribe:this.subscribe.bind(this)}},t.prototype._dispatchListenerPayloads=function(t){for(var e=t.fn,r=t.payloads;;){var n=r.shift();if(!n)break;this._callHandler(e,n)}},t.prototype._callHandler=function(t,e){try{t(e.payload,e.time)}catch(t){window.setTimeout(function(){throw t},0)}},t}();e.EventDispatcher=i},function(t,e,r){"use strict";var n=r(14),i=r(23),o=r(66),s=r(22);(t.exports=function(t,e){var r,o,a,u,l;return arguments.length<2||"string"!=typeof t?(u=e,e=t,t=null):u=arguments[2],null==t?(r=a=!0,o=!1):(r=s.call(t,"c"),o=s.call(t,"e"),a=s.call(t,"w")),l={value:e,configurable:r,enumerable:o,writable:a},u?n(i(u),l):l}).gs=function(t,e,r){var a,u,l,c;return"string"!=typeof t?(l=r,r=e,e=t,t=null):l=arguments[3],null==e?e=void 0:o(e)?null==r?r=void 0:o(r)||(l=r,r=void 0):(l=e,e=r=void 0),null==t?(a=!0,u=!1):(a=s.call(t,"c"),u=s.call(t,"e")),c={get:e,set:r,configurable:a,enumerable:u},l?n(i(l),c):c}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(95);e.Promise=n.Promise},function(t,e,r){"use strict";var n=Object.prototype.toString,i=n.call("");t.exports=function(t){return"string"==typeof t||t&&"object"==typeof t&&(t instanceof String||n.call(t)===i)||!1}},function(t,e,r){"use strict";var n=Object.prototype.toString,i=n.call(function(){return arguments}());t.exports=function(t){return n.call(t)===i}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){this._msg=t,this._cause=e}return t.prototype.getCode=function(){return"PLAYER_ERROR"},t.prototype.getMsg=function(){return this._msg},t.prototype.getCause=function(){return this._cause},t}();e.PlayerError=n},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(36),i=n.isIE();e.noOpLogger={debug:function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r]},error:function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r]},info:function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r]},warn:function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r]}},e.consoleLogger={debug:function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n;i?console.log(t,e):(n=console.debug||console.log).call.apply(n,[console,t].concat(e))},error:function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n;i?console.log(t,e):(n=console.error||console.log).call.apply(n,[console,t].concat(e))},info:function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n;i?console.log(t,e):(n=console.info||console.log).call.apply(n,[console,t].concat(e))},warn:function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n;i?console.log(t,e):(n=console.warn||console.log).call.apply(n,[console,t].concat(e))}},e.prefixLogger=function(t,e){return{debug:function(r){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];return t.debug.apply(t,["["+e+"] "+r].concat(n))},error:function(r){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];return t.error.apply(t,["["+e+"] "+r].concat(n))},info:function(r){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];return t.info.apply(t,["["+e+"] "+r].concat(n))},warn:function(r){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];return t.warn.apply(t,["["+e+"] "+r].concat(n))}}},e.cloneLogger=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return{debug:function(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];return t.forEach(function(t){return t.debug.apply(t,[e].concat(r))})},error:function(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];return t.forEach(function(t){return t.error.apply(t,[e].concat(r))})},info:function(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];return t.forEach(function(t){return t.info.apply(t,[e].concat(r))})},warn:function(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];return t.forEach(function(t){return t.warn.apply(t,[e].concat(r))})}}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(8);e.buildDeferred=function(){var t,e,r=!1;return{promise:new n.Promise(function(r,n){t=r,e=n}),resolve:function(e){r||(r=!0,t(e))},reject:function(t){r||(r=!0,e(t))},isSettled:function(){return r}}}},function(t,e,r){"use strict";t.exports=r(71)()?Object.assign:r(70)},function(t,e,r){"use strict";t.exports=r(27)()?Object.setPrototypeOf:r(26)},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=r(28),o=function(t){function e(e,r,n){return void 0===n&&(n="The player that the proxy was controlling had a fatal error."),t.call(this,e,r,n)||this}return n(e,t),e.prototype.getCode=function(){return"PROXY_PLAYER_PROVIDED_PLAYER_FATAL_ERROR"},e}(i.ProxyProvidedPlayerError);e.ProxyProvidedPlayerFatalError=o},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.find=function(t,e){var r=void 0;return t.some(function(t){return!!e(t)&&(r=t,!0)}),r}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.always=function(t,e){return t.then(e,e)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=Date.now();e.now=function(){return"performance"in window&&window.performance.now?window.performance.now():Date.now()-n}},function(t,e,r){"use strict";var n,i=r(58),o=r(14),s=r(1),a=r(0),u=r(7),l=r(57),c=r(2),p=Object.defineProperty,h=Object.defineProperties;t.exports=n=function(t,e){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");h(this,{__list__:u("w",a(t)),__context__:u("w",e),__nextIndex__:u("w",0)}),e&&(s(e.on),e.on("_add",this._onAdd),e.on("_delete",this._onDelete),e.on("_clear",this._onClear))},delete n.prototype.constructor,h(n.prototype,o({_next:u(function(){var t;if(this.__list__)return this.__redo__&&void 0!==(t=this.__redo__.shift())?t:this.__nextIndex__<this.__list__.length?this.__nextIndex__++:void this._unBind()}),next:u(function(){return this._createResult(this._next())}),_createResult:u(function(t){return void 0===t?{done:!0,value:void 0}:{done:!1,value:this._resolve(t)}}),_resolve:u(function(t){return this.__list__[t]}),_unBind:u(function(){this.__list__=null,delete this.__redo__,this.__context__&&(this.__context__.off("_add",this._onAdd),this.__context__.off("_delete",this._onDelete),this.__context__.off("_clear",this._onClear),this.__context__=null)}),toString:u(function(){return"[object "+(this[c.toStringTag]||"Object")+"]"})},l({_onAdd:u(function(t){if(!(t>=this.__nextIndex__)){if(++this.__nextIndex__,!this.__redo__)return void p(this,"__redo__",u("c",[t]));this.__redo__.forEach(function(e,r){e>=t&&(this.__redo__[r]=++e)},this),this.__redo__.push(t)}}),_onDelete:u(function(t){var e;t>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(-1!==(e=this.__redo__.indexOf(t))&&this.__redo__.splice(e,1),this.__redo__.forEach(function(e,r){e>t&&(this.__redo__[r]=--e)},this)))}),_onClear:u(function(){this.__redo__&&i.call(this.__redo__),this.__nextIndex__=0})}))),p(n.prototype,c.iterator,u(function(){return this}))},function(t,e,r){"use strict";var n=r(10),i=r(9),o=r(63),s=r(43),a=r(42),u=r(2).iterator;t.exports=function(t){return"function"==typeof a(t)[u]?t[u]():n(t)?new o(t):i(t)?new s(t):new o(t)}},function(t,e,r){"use strict";t.exports=r(65)()?String.prototype.contains:r(64)},function(t,e,r){"use strict";var n=r(4),i=Array.prototype.forEach,o=Object.create;t.exports=function(t){var e=o(null);return i.call(arguments,function(t){n(t)&&function(t,e){var r;for(r in t)e[r]=t[r]}(Object(t),e)}),e}},function(t,e,r){"use strict";t.exports=function(){}},function(t,e,r){"use strict";var n=r(4),i={function:!0,object:!0};t.exports=function(t){return n(t)&&i[typeof t]||!1}},function(t,e,r){"use strict";var n,i=r(25),o=r(0),s=Object.prototype.isPrototypeOf,a=Object.defineProperty,u={configurable:!0,enumerable:!1,writable:!0,value:void 0};n=function(t,e){if(o(t),null===e||i(e))return t;throw new TypeError("Prototype must be null or an object")},t.exports=function(t){var e,r;return t?(2===t.level?t.set?(r=t.set,e=function(t,e){return r.call(n(t,e),e),t}):e=function(t,e){return n(t,e).__proto__=e,t}:e=function t(e,r){var i;return n(e,r),(i=s.call(t.nullPolyfill,e))&&delete t.nullPolyfill.__proto__,null===r&&(r=t.nullPolyfill),e.__proto__=r,i&&a(t.nullPolyfill,"__proto__",u),e},Object.defineProperty(e,"level",{configurable:!1,enumerable:!1,writable:!1,value:t.level})):null}(function(){var t,e=Object.create(null),r={},n=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__");if(n){try{(t=n.set).call(e,r)}catch(t){}if(Object.getPrototypeOf(e)===r)return{set:t,level:2}}return e.__proto__=r,Object.getPrototypeOf(e)===r?{level:2}:((e={}).__proto__=r,Object.getPrototypeOf(e)===r&&{level:1})}()),r(74)},function(t,e,r){"use strict";var n=Object.create,i=Object.getPrototypeOf,o={};t.exports=function(){var t=Object.setPrototypeOf,e=arguments[0]||n;return"function"==typeof t&&i(t(e(null),o))===o}},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=r(11),o=function(t){function e(e,r,n){void 0===n&&(n="The player that the proxy was controlling had an error.");var i=t.call(this,n)||this;return i._providedPlayerError=e,i._providedPlayer=r,i}return n(e,t),e.prototype.getCode=function(){return"PROXY_PLAYER_PROVIDED_PLAYER_ERROR"},e.prototype.getProvidedPlayerError=function(){return this._providedPlayerError},e.prototype.getProvidedPlayer=function(){return this._providedPlayer},e}(i.PlayerError);e.ProxyProvidedPlayerError=o},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=r(5),o=function(t){function e(e,r){return t.call(this,e,r)||this}return n(e,t),e.prototype.getCode=function(){return"IMPLEMENTATION_ERROR"},e}(i.PlayerFatalError);e.ImplementationError=o},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(3),i=function(){function t(t,e){this._inCallback=!1,this._onExit=t,this._onEnter=e||null}return t.prototype.enter=function(t){var e=this;if(this._inCallback)return t?t(this._onEnterResultRetriever):void 0;this._inCallback=!0;var r=[],i=!1;this._onEnter&&(this._onEnterResultRetriever={getResult:function(t){i?n.deferException(function(){return t(e._onEnterError,e._onEnterResult)}):r.push(t)}});try{var o=t?t(this._onEnterResultRetriever):void 0;if(this._onEnter){this._onEnterError=void 0,this._onEnterResult=void 0;try{this._onEnterResult=this._onEnter()}catch(t){this._onEnterError=t}i=!0,r.forEach(function(t){return n.deferException(function(){return t(e._onEnterError,e._onEnterResult)})})}return o}finally{this._inCallback=!1,n.deferException(function(){return e._onExit(e._onEnterError,e._onEnterResult)})}},t}();e.OnExit=i},function(t,e,r){"use strict";function n(t){var e=Object.create(null);return Object.keys(t).forEach(function(r){e[r]=t[r]}),e}Object.defineProperty(e,"__esModule",{value:!0});var i=r(30),o=r(3),s=function(){},a=function(){function t(t,e){void 0===e&&(e={});var r=this;this._subscribers=[],this._onExit=new i.OnExit(function(){return r._after()},function(){return r._onEnter()}),this._beforeUpdateError=void 0,this._inAfterUpdate=!1,this._dead=!1,this._officiallyDead=!1,this._errors=[],this._state=n(t),this._initialState=n(t),this._beforeUpdate=e.beforeUpdate||function(){},this._afterUpdate=e.afterUpdate||s,this._afterDispatches=e.afterDispatches||s}return t.prototype.subscribe=function(t,e){var r=this;if(void 0===e&&(e=!0),this._dead){var i=!1;return{retrieve:function(){},remove:function(){return!i&&(i=!0)}}}var o={callback:t,localState:e?n(this._state):this._initialState};return this._subscribers.push(o),e||this._updateSubscriber(o),{remove:function(){var e=r._subscribers.map(function(t){return t.callback}).indexOf(t);return e>=0&&(r._subscribers.splice(e,1),!0)},retrieve:function(){r._updateSubscriber(o)}}},t.prototype.subscribeIndividual=function(t,e,r){return this.subscribe(function(r){var n=r[t];void 0!==n&&e(n)},r)},t.prototype.getHandle=function(){return{subscribe:this.subscribe.bind(this)}},t.prototype.getIndividualHandle=function(t){var e=this;return{subscribe:function(r){return e.subscribeIndividual(t,r)}}},t.prototype.update=function(t){var e=this;this._officiallyDead||(this._inAfterUpdate?t&&t(this._state,this._beforeUpdateError):this._onExit.enter(function(r){r.getResult(function(){try{t&&t(e._state,e._beforeUpdateError)}catch(t){e._errors.push(t)}})}))},t.prototype.getState=function(){return this._state},t.prototype.kill=function(){var t=this;this._dead||(this._dead=!0,window.setTimeout(function(){t._subscribers.splice(0),t._officiallyDead=!0},0))},t.prototype.isDead=function(){return this._dead},t.prototype._onEnter=function(){this._beforeUpdateError=void 0;try{this._beforeUpdate(this._state)}catch(t){this._beforeUpdateError=t}},t.prototype._after=function(){var t=this,e=this._errors;this._errors=[],o.deferException(function(){t._inAfterUpdate=!0;try{t._afterUpdate(t._state,{beforeUpdate:t._beforeUpdateError,update:e})}catch(e){throw t._inAfterUpdate=!1,e}t._inAfterUpdate=!1,t._subscribers.slice().forEach(function(e){return t._updateSubscriber(e)}),t._afterDispatches(t._state)})},t.prototype._updateSubscriber=function(t){var e=this._calculateDiff(t.localState);Object.keys(e).length&&(t.localState=n(this._state),o.deferException(function(){return t.callback(e,t.localState)}))},t.prototype._calculateDiff=function(t){var e=this,r=Object.create(null);return Object.keys(this._state).forEach(function(n){var i=e._state[n];i!==t[n]&&(r[n]=i)}),r},t}();e.StateManager=a},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.LOADING=0]="LOADING",t[t.PLAYING=1]="PLAYING",t[t.PAUSED=2]="PAUSED",t[t.DEAD=3]="DEAD"}(e.State||(e.State={}))},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=r(5),o=function(t){function e(e){return t.call(this,e||"The player cannot play the provided descriptor.")||this}return n(e,t),e.prototype.getCode=function(){return"NOT_SUPPORTED_ERROR"},e}(i.PlayerFatalError);e.NotSupportedError=o},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(5),i=r(33),o=r(6),s=r(13),a=r(17),u=r(19),l=r(8),c=r(32),p=r(12),h=r(31),d=r(29),f=r(3),g="undefined"!=typeof navigator&&"mediaSession"in navigator,y=150,_=25,v=35,m=1e3,b=g?navigator.mediaSession:null,w=function(){function t(t){var e=this;this._stateManager=new h.StateManager({ended:!1,loading:!1,playing:!1,actuallyPlaying:!1,volume:1,muted:!1,isFading:!1,fadeRate:null,isFadingForSeek:!1,playDeferred:null,pauseDeferred:null,ready:!1,seeking:!1,seek:null,positionJumped:null,stalled:!0,duration:null,dead:!1,state:c.State.PAUSED,fatalError:null,errorOccurred:null,position:0},{afterUpdate:function(t,r){return e._afterUpdate(t,r)},afterDispatches:function(){return e._afterDispatches()},beforeUpdate:function(t){if(!t.dead&&(t.ready||!e._fatalErrorTriggered)){var r=e._getPosition(),n=t.duration;if(r<0)throw e._logger.error("Player provided invalid position.",r,n),e._triggerError(new d.ImplementationError("Player provided a position that was invalid.")),new Error("Player provided invalid position.");t.position=r,e._updateEndedInState(t)}}}),this._onError=new o.EventDispatcher,this._errors=[],this._fatalErrorTriggered=!1,this._loadingDelayTimer=null,this._stalled=!1,this._queuedDuration=null,this._readyDeferred=s.buildDeferred(),this._queuedSeekDeferreds=[],this._lastPlayError=null,this._lastPauseError=null,this._lastPlayedPosition=null,this._listenTimeBase=0,this._timePlaybackStarted=null,this._positionAfterLastUpdate=0,this._positionWhenStartedFadeOut=null,this._fadeStartAllowed=!1,this._seekFadeStartAllowed=!1,this._implementationIsFading=!1;var r=t.name;if(this._logger=p.prefixLogger(t.logger,"BasePlayer"+(r?"-"+r:"")),this._mediaSessionEnabled=!!t.mediaSessionEnabled,t.defaultFadeDuration&&t.defaultFadeDuration<0)throw new Error("defaultFadeDuration must be >= 0.");if(t.loadingDelay&&t.loadingDelay<0)throw new Error("loadingDelay must be >= 0.");this._defaultFadeDuration=void 0!==t.defaultFadeDuration?t.defaultFadeDuration:y,this._defaultSeekFadeOutDuration=void 0!==t.defaultSeekFadeOutDuration?t.defaultSeekFadeOutDuration:_,this._defaultSeekFadeInDuration=void 0!==t.defaultSeekFadeInDuration?t.defaultSeekFadeInDuration:v,this._loadingDelay=void 0!==t.loadingDelay?t.loadingDelay:m,this.onError=this._onError.getHandle(),this.whenReady=this._readyDeferred.promise,this._stateManager.subscribe(function(t,r){return e._onChange(t,r)}),this._stateManager.subscribe(function(t){var r=t.actuallyPlaying,n=t.seek;!0===r&&(e._fadeStartAllowed=!1),n&&"IN_PROGRESS"!==n.state&&(e._seekFadeStartAllowed=!1)}),this._stateManager.subscribe(function(t,r){var n=t.isFading,i=r.dead;!i&&!1===n&&e._implementationIsFading&&e._triggerError(new d.ImplementationError("Fade was still running when not allowed."))}),this._stateManager.subscribe(function(t,r){var n=t.playing,i=r.dead,o=r.fadeRate;if(!i&&void 0!==n)try{e._handlePlayPauseChange(n,{fadeRate:o||void 0}),n||(e._fadeStartAllowed=!1)}catch(t){e._triggerError(new d.ImplementationError("Exception occurred whilst handling play/pause change.",t))}}),this._stateManager.subscribe(function(t,r){var n=t.seek,i=r.dead;if(!i&&n&&"IN_PROGRESS"===n.state)try{e._seekFadeStartAllowed=!0,e._handleSeekChange(n.position,{fadeRate:{beforeSeek:n.fadeRate.beforeSeek||void 0,afterSeek:n.fadeRate.afterSeek||void 0}}),e._seekFadeStartAllowed=!1}catch(t){e._triggerError(new d.ImplementationError("Exception occurred whilst handling seek change.",t))}}),this.onChange=this._buildEventHandle(function(t,r){var n=r.ready;if(void 0!==n&&!0!==n)throw new Error("Ready state is invalid.");var i=r.duration;if(void 0!==i&&null===i)throw new Error("Duration state is invalid.");var o=r.dead;if(void 0!==o&&!0!==o)throw new Error("Dead state is invalid.");var s={ready:n,ended:r.ended,duration:i,volume:r.volume,muted:r.muted,playing:r.playing,actuallyPlaying:r.actuallyPlaying,stalled:r.stalled,loading:r.loading,fading:r.isFading,fadingForSeek:r.isFadingForSeek,playRejection:!1===r.playing&&e._lastPlayError||void 0,pauseRejection:!0===r.playing&&e._lastPauseError||void 0,seeking:r.seeking,seek:r.seek||void 0,positionJumped:void 0!==r.positionJumped||void 0,state:r.state,fatalError:r.fatalError||void 0,dead:o};Object.keys(s).some(function(t){return void 0!==s[t]})&&t(s)});var n=t.registerListeners;n&&f.deferException(function(){n({onChange:e.onChange,onError:e.onError})}),this._registerMediaSessionActionHandlers(),this._notifyMediaSessionPaused(),this.onDurationChange=this._buildEventHandle(function(t,e){var r=e.duration;void 0!==r&&null!==r&&t(r)}),this.onReady=this._buildEventHandle(function(t,e){var r=e.ready;!0===r&&t(void 0)}),this.onStateChange=this._buildEventHandle(function(t,e){var r=e.state;void 0!==r&&t(r)}),this.onVolumeChange=this._buildEventHandle(function(t,e,r){var n=e.volume,i=e.muted,o=r.volume,s=r.muted;void 0===n&&void 0===i||t({volume:o,muted:s})}),this.onPlay=this._buildEventHandle(function(t,e){var r=e.actuallyPlaying;!0===r&&t(void 0)}),this.onPlayIntent=this._buildEventHandle(function(t,e){var r=e.playing;!0===r&&t(void 0)}),this.onPlayRejection=this._buildEventHandle(function(t,r){var n=r.playing;!1===n&&e._lastPlayError&&t(e._lastPlayError)}),this.onPause=this._buildEventHandle(function(t,e){var r=e.actuallyPlaying;!1===r&&t(void 0)}),this.onPauseIntent=this._buildEventHandle(function(t,e){var r=e.playing;!1===r&&t(void 0)}),this.onPauseRejection=this._buildEventHandle(function(t,r){var n=r.playing;!0===n&&e._lastPauseError&&t(e._lastPauseError)}),this.onSeek=this._buildEventHandle(function(t,e){var r=e.seek;r&&"COMPLETED"===r.state&&t(void 0)}),this.onSeekIntent=this._buildEventHandle(function(t,e){var r=e.seeking;!0===r&&t(void 0)}),this.onSeekRejection=this._buildEventHandle(function(t,e){var r=e.seek;r&&"ERROR"===r.state&&t(r.error)}),this.onPositionJumped=this._buildEventHandle(function(t,e){var r=e.positionJumped;void 0!==r&&t(void 0)}),this.onEnded=this._buildEventHandle(function(t,e){var r=e.ended;!0===r&&t(void 0)}),this.onLeftEnded=this._buildEventHandle(function(t,e){var r=e.ended;!1===r&&t(void 0)}),this.onStallStart=this._buildEventHandle(function(t,e){var r=e.stalled;!0===r&&t(void 0)}),this.onStallEnd=this._buildEventHandle(function(t,e){var r=e.stalled;!1===r&&t(void 0)}),this.onLoadStart=this._buildEventHandle(function(t,e){var r=e.loading;!0===r&&t(void 0)}),this.onLoadEnd=this._buildEventHandle(function(t,e){var r=e.loading;!1===r&&t(void 0)}),this.onFadeStart=this._buildEventHandle(function(t,e){var r=e.isFading;!0===r&&t(void 0)}),this.onFadeEnd=this._buildEventHandle(function(t,e){var r=e.isFading;!1===r&&t(void 0)}),this.onFadeForSeekStart=this._buildEventHandle(function(t,e){var r=e.isFadingForSeek;!0===r&&t(void 0)}),this.onFadeForSeekEnd=this._buildEventHandle(function(t,e){var r=e.isFadingForSeek;!1===r&&t(void 0)})}return t.prototype.isReady=function(){return this._stateManager.getState().ready},t.prototype.getPosition=function(){return this._getPositionOrPositionSeekingTo()},t.prototype.getLastPlayedPosition=function(){var t=this._stateManager.getState(),e=t.actuallyPlaying,r=t.stalled;return e&&!r?this.getPosition():this._lastPlayedPosition},t.prototype.getListenTime=function(){var t=this._stateManager.getState(),e=t.actuallyPlaying,r=t.ended,n=this._listenTimeBase;return e&&!r&&(n+=u.now()-this._timePlaybackStarted),n},t.prototype.isStalled=function(){return this._stateManager.getState().stalled},t.prototype.isLoading=function(){return this._stateManager.getState().loading},t.prototype.isFading=function(){return this._stateManager.getState().isFading},t.prototype.isFadingForSeek=function(){return this._stateManager.getState().isFadingForSeek},t.prototype.isPlaying=function(){return this._stateManager.getState().playing},t.prototype.isActuallyPlaying=function(){return this._stateManager.getState().actuallyPlaying},t.prototype.isEnded=function(){return this._stateManager.getState().ended},t.prototype.getState=function(){return this._stateManager.getState().state},t.prototype.getBufferController=function(){return null},t.prototype.getMemoryCacheMaxSize=function(){return null},t.prototype.getMemoryCacheUsage=function(){return null},t.prototype.getMemoryCacheController=function(){return null},t.prototype.getFatalError=function(){return this._stateManager.getState().fatalError},t.prototype.isDead=function(){return this._stateManager.getState().dead},t.prototype.getVolume=function(){return this._stateManager.getState().volume},t.prototype.getMuted=function(){return this._stateManager.getState().muted},t.prototype.getDuration=function(){var t=this._stateManager.getState(),e=t.ready,r=t.duration;return e?r:null},t.prototype.setVolume=function(t,e){if(t<0||t>1)throw new Error("Volume must be >= 0 and <= 1.");if(!this._stateManager.getState().dead){var r=this._stateManager.getState().muted;void 0===e&&(e=r);try{this._handleVolumeChange(t,e)}catch(t){throw this._triggerError(new d.ImplementationError("Exception occurred updating volume.",t)),t}}},t.prototype.setMuted=function(t){this.setVolume(this._stateManager.getState().volume,t)},t.prototype.getCurrentBufferedTimeRange=function(){var t=this.getBufferedTimeRanges();if(!t)return null;var e=this.getPosition();return a.find(t,function(t){return t.containsTime(e)})||null},t.prototype.play=function(t){var e=this;this._ensureNotDead(),this._logger.debug("play() called.",t);var r=s.buildDeferred();try{return this._stateManager.update(function(n){if(n.playing)e._logger.debug("Intent is already to be playing.");else{e._logger.debug("Requesting play."),n.playing=!0;var i=e._extractFadeDuration(t);n.fadeRate=i?1/i:null,e._lastPlayError=null}n.playDeferred&&!n.playDeferred.isSettled()||(n.playDeferred=s.buildDeferred()),r.resolve(n.playDeferred.promise)}),r.promise}catch(t){return this._triggerError(new n.PlayerFatalError("Unexpected error when attempting to play.",t)),l.Promise.reject(t)}},t.prototype.pause=function(t){var e=this;this._ensureNotDead(),this._logger.debug("pause() called.",t);var r=s.buildDeferred();try{return this._stateManager.update(function(n){if(n.playing){e._logger.debug("Requesting pause."),e._positionWhenStartedFadeOut=e._getPositionOrPositionSeekingTo(),n.playing=!1;var i=e._extractFadeDuration(t);n.fadeRate=i?1/i*-1:null,e._fadeStartAllowed=!0,e._lastPauseError=null}else e._logger.debug("Intent is already to be paused.");n.pauseDeferred&&!n.pauseDeferred.isSettled()||(n.pauseDeferred=s.buildDeferred()),r.resolve(n.pauseDeferred.promise)}),r.promise}catch(t){return this._triggerError(new n.PlayerFatalError("Unexpected error when attempting to pause.",t)),l.Promise.reject(t)}},t.prototype.seek=function(t,e){var r=this;this._ensureNotDead(),this._logger.debug("seek() called.",t);var n=s.buildDeferred();return this._stateManager.update(function(i){if(t<0)r._logger.warn("Rejecting seek immediately as the position was negative."),n.reject(new Error("You were attempting to seek to a negative time."));else if(null!==i.duration&&t>i.duration)r._logger.warn("Rejecting seek immediately as the duration is now known, and the requested positon was past it."),n.reject(new Error("You were attempting to seek past the end of the media."));else{i.stalled||!i.actuallyPlaying||i.seek&&"IN_PROGRESS"===i.seek.state||(r._lastPlayedPosition=r._getPositionOrPositionSeekingTo());var o=s.buildDeferred();if(i.seek&&"IN_PROGRESS"===i.seek.state&&i.seek.position===t)r._logger.debug("Seek already requested to the same position.",t);else{r._logger.debug("Requesting seek.",t),i.seeking=!0,r._positionWhenStartedFadeOut=null;var a=r._extractSeekFadeDurations(e,t),u=a.fadeOutDuration?1/a.fadeOutDuration*-1:null,l=a.fadeInDuration?1/a.fadeInDuration:null;i.seek={state:"IN_PROGRESS",position:t,fadeRate:{beforeSeek:u,afterSeek:l}},i.positionJumped=Object.create(null)}r._queuedSeekDeferreds.push({position:t,deferred:o}),n.resolve(o.promise)}}),n.promise},t.prototype.getSeekState=function(){return this._stateManager.getState().seek},t.prototype.kill=function(){var t=this;this._stateManager.update(function(e){e.dead||(t._logger.debug("kill() called."),e.dead=!0)})},t.prototype._update=function(t){this._stateManager.update(function(){return t&&t()})},t.prototype._ensureNotDead=function(){if(this._stateManager.getState().dead)throw new Error("Player is dead.")},t.prototype._notifyStalled=function(t){this._ensureNotDead(),this._stalled!==t&&(this._logger.debug("notifyStalled() called.",t),this._stalled=t,this._stateManager.update())},t.prototype._getQueuedSeekPosition=function(){var t=this.getSeekState();return t&&"IN_PROGRESS"===t.state?t.position:null},t.prototype._provideDuration=function(t){var e=this;this._ensureNotDead(),this._stateManager.update(function(r){if(r.duration!==t){var n=e._getPositionOrPositionSeekingTo();if(t<0||r.ready&&n>t)throw e._triggerError(new d.ImplementationError("Attempt to update duration to an invalid value.")),new Error("Duration cannot be less than the current position.");e._logger.debug("provideDuration() called.",t),r.ready?r.duration=t:e._queuedDuration=t}})},t.prototype._notifyVolumeChange=function(t,e){if(t<0||t>1)throw this._triggerError(new d.ImplementationError("Volume was out of range.",t)),new Error("Volume was out of range.");this._stateManager.update(function(r){r.volume=t,r.muted=e})},t.prototype._notifyPlaying=function(t){var e=this;this._ensureNotDead(),this._stateManager.update(function(r){if(!r.ready)throw e._triggerError(new d.ImplementationError("Attempt to register playback as started before ready.")),new Error("Player must be ready first.");t!==r.actuallyPlaying&&(e._logger.debug("notifyPlaying() called.",t),t||r.seeking||r.stalled||(e._lastPlayedPosition=e._getPositionOrPositionSeekingTo()),r.actuallyPlaying=r.playing=t,t?(e._lastPlayError=null,e._fadeStartAllowed=!0):(r.isFading=!1,e._fadeStartAllowed=!1,e._lastPauseError=null))})},t.prototype._notifyPlayRejection=function(t){var e=this;this._ensureNotDead(),t=t||new Error("Unknown error."),this._stateManager.update(function(r){if(!r.ready)throw e._triggerError(new d.ImplementationError("Attempt to reject a play request before player ready.")),new Error("Player must be ready first.");if(r.actuallyPlaying||!r.playing)throw e._triggerError(new d.ImplementationError("Attempt to reject a play request when not valid.")),new Error("Playing state is incorrect.");e._logger.debug("notifyPlayRejection() called.",t),r.playing=!1,e._lastPlayError=t})},t.prototype._notifyPauseRejection=function(t){var e=this;this._ensureNotDead(),t=t||new Error("Unknown error."),this._stateManager.update(function(r){if(!r.ready)throw e._triggerError(new d.ImplementationError("Attempt to reject pause request before player ready.")),new Error("Player must be ready first.");if(!r.actuallyPlaying||r.playing)throw e._triggerError(new d.ImplementationError("Attempt to reject pause request when not valid.")),new Error("Playing state is incorrect.");e._logger.debug("notifyPauseRejection() called.",t),r.playing=!0,r.fadeRate&&(r.fadeRate*=-1),e._lastPauseError=t})},t.prototype._notifySeekRejection=function(t){var e=this;this._ensureNotDead(),t=t||new Error("Unknown error."),this._stateManager.update(function(r){if(!r.ready)throw e._triggerError(new d.ImplementationError("Attempt to reject seek request before player ready.")),new Error("Player must be ready first.");if(!r.seek||"IN_PROGRESS"!==r.seek.state)throw e._triggerError(new d.ImplementationError("Attempt to reject seek request when none requested.")),new Error("A seek hasn't been requested.");if(null!==r.duration&&r.position>r.duration)throw e._triggerError(new d.ImplementationError("Attempt to reject seek request after duration changed below current position.")),new Error("Attempt to reject seek request after duration changed below current position.");e._logger.debug("notifySeekRejection() called.",t),r.seeking=!1,r.seek={state:"ERROR",error:t},r.positionJumped=Object.create(null)})},t.prototype._notifyFading=function(t){var e=this;if(this._ensureNotDead(),t&&!this._fadeStartAllowed){var r="Attempt to register fade as starting when not allowed.";throw this._triggerError(new d.ImplementationError(r)),new Error(r)}this._implementationIsFading=t,this._stateManager.update(function(r){r.isFading!==t&&(e._logger.debug("notifyFading() called",t),t||r.playing||null===e._positionWhenStartedFadeOut||e.seek(e._positionWhenStartedFadeOut,{fadeInDuration:0,fadeOutDuration:0}).catch(function(t){e._logger.warn("Seek back to position where fade out started failed.",t)}),r.isFading=t)})},t.prototype._notifyFadingForSeek=function(t){var e=this;if(this._ensureNotDead(),t&&!this._seekFadeStartAllowed){var r="Attempt to register fade as starting for seek when not allowed.";throw this._triggerError(new d.ImplementationError(r)),new Error(r)}this._stateManager.update(function(r){r.isFadingForSeek!==t&&(e._logger.debug("notifyFadingForSeek() called",t),r.isFadingForSeek=t)})},t.prototype._signalReady=function(){var t=this;this._ensureNotDead(),this._stateManager.update(function(e){if(e.ready)throw t._triggerError(new d.ImplementationError("Attempt to signal ready twice.")),new Error("Ready already signalled.");if(null===t._queuedDuration)throw t._triggerError(new d.ImplementationError("Attempt to signal ready when duration unknown.")),new Error("Duration is still unknown.");t._logger.debug("signalReady() called."),e.ready=!0,e.duration=t._queuedDuration,e.seek&&"IN_PROGRESS"===e.seek.state&&e.seek.position>e.duration&&(e.seeking=!1,e.seek={state:"ERROR",error:new Error("You were attempting to seek past the end of the media.")})})},t.prototype._signalSeekComplete=function(){var t=this;this._ensureNotDead(),this._stateManager.update(function(e){if(!e.ready)throw t._triggerError(new d.ImplementationError("Attempt to signal seek as complete before player ready.")),new Error("Player must be ready first.");if(!e.seek||"IN_PROGRESS"!==e.seek.state)throw t._triggerError(new d.ImplementationError("Attempt to signal seek as complete when none requested.")),new Error("There shouldn't be a seek in progress.");var r=e.duration;if(e.seek&&"IN_PROGRESS"===e.seek.state&&e.seek.position>r)throw new Error("Seek cannot have completed given it was to a time greater than the duration.");t._logger.debug("signalSeekComplete() called."),t._seekFadeStartAllowed=!0,e.seek={state:"COMPLETED",position:e.seek.position,fadeRate:e.seek.fadeRate},e.seeking=!1,e.position=e.seek.position})},t.prototype._triggerError=function(t){var e=this;t instanceof n.PlayerFatalError&&(this._fatalErrorTriggered=!0),this._stateManager.update(function(r){var o=!1;if(r.ready&&t instanceof i.NotSupportedError&&(t=new d.ImplementationError("Invalid NotSupportedError."),o=!0),t instanceof n.PlayerFatalError?(t instanceof i.NotSupportedError?e._logger.info("NotSupportedError occurred.",t):e._logger.error("Fatal error occurred.",t),r.fatalError?e._logger.warn("A fatal error already occurred.",r.fatalError):r.fatalError=t,e._errors.push(t),r.errorOccurred=Object.create(null),r.dead=!0):(e._logger.warn("Non-fatal error occurred.",t),e._errors.push(t),r.errorOccurred=Object.create(null)),o)throw new Error("Not supported errors are only valid before the player is ready.")})},t.prototype._buildEventHandle=function(t){var e=this;return{subscribe:function(r){var n=function(t){return r(t,u.now())};return e._stateManager.subscribe(function(e,r){t(n,e,r)})}}},t.prototype._finalizeState=function(t){this._updateEndedInState(t);var e=this._getPositionOrPositionSeekingTo();if(t.dead)this._lastPlayError=new Error("Player was killed."),t.loading=!1,this._clearLoadingDelay(),!t.playing&&t.isFading&&null!==this._positionWhenStartedFadeOut&&(this._logger.debug("Fade out was in progress. Pretending it completed."),t.isFading=!1,t.position=this._positionWhenStartedFadeOut),t.stalled=!0,t.actuallyPlaying=!1,t.isFadingForSeek=!1,t.playing=!1,t.state=c.State.DEAD;else{var r=!t.ended&&(!t.ready||this._stalled||!(!t.seek||"IN_PROGRESS"!==t.seek.state));r&&!t.stalled&&!t.seeking&&t.actuallyPlaying&&(this._lastPlayedPosition=e),t.stalled=r;var n=!t.ended&&!t.isFading&&!t.isFadingForSeek&&(t.playing||t.actuallyPlaying)&&(t.stalled||t.playing!==t.actuallyPlaying);n?this._loadingDelay?this._scheduleLoadingDelay():t.loading=!0:(t.loading=!1,this._clearLoadingDelay()),this._positionAfterLastUpdate!==e&&(this._positionAfterLastUpdate=e,t.playing||t.actuallyPlaying||(t.positionJumped=Object.create(null))),t.state=this._calculateState(t)}},t.prototype._updateEndedInState=function(t){t.ended=t.ready&&this._getPositionOrPositionSeekingTo()===t.duration},t.prototype._scheduleLoadingDelay=function(){var t=this;this._loadingDelayTimer||(this._loadingDelayTimer=window.setTimeout(function(){t._stateManager.update(function(t){return t.loading=!0})},this._loadingDelay))},t.prototype._clearLoadingDelay=function(){this._loadingDelayTimer&&(window.clearTimeout(this._loadingDelayTimer),this._loadingDelayTimer=null)},t.prototype._getPositionOrPositionSeekingTo=function(){this._stateManager.update();var t=this._stateManager.getState();return t.seek&&"IN_PROGRESS"===t.seek.state?t.seek.position:t.isFading&&!t.playing&&null!==this._positionWhenStartedFadeOut?this._positionWhenStartedFadeOut:t.ready&&null!==t.duration?t.position:0},t.prototype._calculateState=function(t){var e=t.dead,r=t.loading,n=t.playing,i=t.ended;return e?c.State.DEAD:r?c.State.LOADING:n&&!i?c.State.PLAYING:c.State.PAUSED},t.prototype._registerMediaSessionActionHandlers=function(){var t=this;this._mediaSessionEnabled&&b&&(b.setActionHandler("play",function(){t.isDead()||t.play()}),b.setActionHandler("pause",function(){t.isDead()||t.pause()}),b.setActionHandler("seekbackward",function(){t.isDead()||t.seek(Math.max(0,t.getPosition()-5e3))}),b.setActionHandler("seekforward",function(){t.isDead()||t.seek(Math.min(t.getDuration()||0,t.getPosition()+5e3))}))},t.prototype._notifyMediaSessionPlaying=function(){this._mediaSessionEnabled&&b&&(b.playbackState="playing")},t.prototype._notifyMediaSessionPaused=function(){this._mediaSessionEnabled&&b&&(b.playbackState="paused")},t.prototype._extractFadeDuration=function(t){return void 0===t&&(t={}),void 0===t.fadeDuration?!this._stateManager.getState().playing||this._getPositionOrPositionSeekingTo()>0?this._defaultFadeDuration:0:t.fadeDuration>0?t.fadeDuration:0},t.prototype._extractSeekFadeDurations=function(t,e){var r,n;return void 0===t&&(t={}),r=void 0!==t.fadeOutDuration?t.fadeOutDuration>0?t.fadeOutDuration:0:this._defaultSeekFadeOutDuration,n=void 0!==t.fadeInDuration?t.fadeInDuration>0?t.fadeInDuration:0:e>0?this._defaultSeekFadeInDuration:0,{fadeOutDuration:r,fadeInDuration:n}},t.prototype._afterUpdate=function(t,e){if(e.beforeUpdate||e.update.length>0)this._logger.error("Errors occurred during state update. Killing player.",e),this._triggerError(new n.PlayerFatalError("Errors occurred during state update.",e));else if(!t.dead&&t.ready){var r=t.duration;null!==r&&!t.seeking&&t.position>r&&(this._logger.error("Player provided invalid position.",t.position,r),this._triggerError(new d.ImplementationError("Player provided a position that was invalid.")))}this._finalizeState(t)},t.prototype._afterDispatches=function(){var t=this,e=this._errors;this._errors=[],e.forEach(function(e){return t._onError.dispatch(e)})},t.prototype._onChange=function(t,e){var r=this,n=t.ready,i=t.dead,o=t.fatalError,s=t.playing,a=t.actuallyPlaying,l=t.ended;if(!0===n&&(this._logger.debug("Resolving ready deferred."),this._readyDeferred.resolve(void 0)),!0===a&&this._registerMediaSessionActionHandlers(),!0===s?this._notifyMediaSessionPlaying():!1===s&&this._notifyMediaSessionPaused(),e.pauseDeferred&&!e.pauseDeferred.isSettled()&&e.playing){var c=this._lastPauseError||new Error("Pause request aborted.");this._logger.debug("Rejecting pause deferred.",c),e.pauseDeferred.reject(c)}if(e.playDeferred&&!e.playDeferred.isSettled()&&!e.playing){var c=this._lastPlayError||new Error("Play request aborted.");this._logger.debug("Rejecting play deferred.",c),e.playDeferred.reject(c)}if(e.playDeferred&&!e.playDeferred.isSettled()&&e.actuallyPlaying&&(this._logger.debug("Resolving play deferred."),e.playDeferred.resolve(void 0)),!e.pauseDeferred||e.pauseDeferred.isSettled()||e.actuallyPlaying||(this._logger.debug("Resolving pause deferred."),e.pauseDeferred.resolve(void 0)),!0===a&&!e.ended||!1===l&&e.actuallyPlaying?this._timePlaybackStarted=u.now():(!1===a&&!e.ended||!0===l&&e.actuallyPlaying)&&(this._listenTimeBase+=u.now()-this._timePlaybackStarted,this._timePlaybackStarted=null),this._queuedSeekDeferreds=this._queuedSeekDeferreds.filter(function(t){var n=t.position,i=t.deferred;if(e.seek)if("IN_PROGRESS"!==e.seek.state){if(!e.stalled||"ERROR"===e.seek.state)return"ERROR"!==e.seek.state?(r._logger.debug("Resolving seek()."),i.resolve(void 0)):(r._logger.debug("Rejecting seek().",e.seek.error),i.reject(e.seek.error)),!1}else if("IN_PROGRESS"!==e.seek.state||e.seek.position!==n)return r._logger.debug("Rejecting seek() because another seek was requested.",n),i.reject(new Error("Seek request aborted because another seek was requested to a different position.")),!1;return!0}),!0===i){this._logger.debug("Calling _kill() on player.");try{this._kill(),this._logger.info("Player killed.")}catch(t){this._triggerError(new d.ImplementationError("Exception occurred in _kill().",t)),this._logger.error("Exception when implementation was being killed.",t)}if(!e.ready){var c=o||new Error("Player was killed.");this._logger.debug("Rejecting whenReady."),this._readyDeferred.reject(c)}this._queuedSeekDeferreds.forEach(function(t){var e=t.position,n=t.deferred,i=o||new Error("Seek aborted as player killed.");r._logger.debug("Rejecting seek().",e),n.reject(i)}),this._stateManager.kill(),this._logger.debug("Player dead.")}},t}();e.BasePlayer=w},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),i=this&&this.__assign||Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t};Object.defineProperty(e,"__esModule",{value:!0});var o=r(34),s=r(11),a=r(5),u=r(12),l=r(6),c=r(28),p=r(16),h=function(t){function e(e){var r=t.call(this,e)||this;return r._onProvidedPlayerError=new l.EventDispatcher,r._errorHandler=null,r._changeHandler=null,r._player=null,r._instanceLock=null,r._playConfig=void 0,r._pauseConfig=void 0,r._seekConfig=void 0,r._lastPlayerPosition=0,r._synced=!1,r._unsyncInProgress=!1,r._logger=u.prefixLogger(r._logger,"ProxyPlayerBase"),r.onProvidedPlayerError=r._onProvidedPlayerError.getHandle(),r}return n(e,t),e.prototype.play=function(e){return this._playConfig=e,t.prototype.play.call(this)},e.prototype.pause=function(e){return this._pauseConfig=e,t.prototype.pause.call(this)},e.prototype.seek=function(e,r){return this._seekConfig=r,t.prototype.seek.call(this,e)},e.prototype.getBufferedTimeRanges=function(){return this._player&&this._synced?this._player.getBufferedTimeRanges():null},e.prototype.getCurrentBufferedTimeRange=function(){return this._player&&this._synced?this._player.getCurrentBufferedTimeRange():null},e.prototype.getMaxBufferLength=function(){return this._player&&this._synced?this._player.getMaxBufferLength():null},e.prototype._providePlayer=function(t,e){if(void 0===e&&(e={}),e=i({syncPosition:!0,syncVolume:!0},e),this._ensureNotDead(),this._player)throw new Error("A player has already been provided.");this._logger.debug("providePlayer() called."),this._instanceLock=Object.create(null),this._player=t,this._sync(e)},e.prototype._removePlayer=function(){var t=this;if(this._ensureNotDead(),!this._player)throw new Error("There is no player to remove.");if(this._unsyncInProgress)throw new Error("Player is currently unsyncing.");this._logger.debug("removePlayer() called."),this._instanceLock=null,this._unsync(),this._player=null,this.isReady()&&!this.isDead()&&this._update(function(){var e=null!==t._getQueuedSeekPosition();t._notifyFading(!1),e||null===t._getQueuedSeekPosition()||t._signalSeekComplete(),t._notifyFadingForSeek(!1),t._notifyStalled(!0)})},e.prototype._setInitialDuration=function(t){var e=this;if(this._ensureNotDead(),t<0)throw new Error("Cannot set duration to a value < 0.");null===this.getDuration()&&this._update(function(){e._ensureBelowPosition(t),e._provideDuration(t),e.isReady()||(e._signalReady(),e._handleSkippedSeek())})},e.prototype._triggerError=function(e){t.prototype._triggerError.call(this,e)},e.prototype._getPlayer=function(){return this.isDead()?null:this._player},e.prototype._handleVolumeChange=function(t,e){this._synced&&this._player?this._player.setVolume(t,e):this._notifyVolumeChange(t,e)},e.prototype._handlePlayPauseChange=function(t){var e=this,r=this._player;r&&this._update(function(){t?e._playAndHandleAbort(r):(e._pauseAndHandleAbort(r),r.isFading()&&e._notifyFading(!0))})},e.prototype._handleSeekChange=function(t){var e=this._player;if(e&&this._synced){var r=this._seekConfig;this._seekConfig=void 0,e.seek(t,r),e.isFadingForSeek()&&this._notifyFadingForSeek(!0)}},e.prototype._getPosition=function(){if(this._player&&this._synced){if(!this._changeHandler)throw new Error("Handler should exist.");if(this._changeHandler.retrieve(),this._synced)return this._player.getPosition()}return this._lastPlayerPosition},e.prototype._kill=function(){this._player&&(this._unsync(),this._player.kill()),this._player=null},e.prototype._handleSkippedSeek=function(){if(this._player&&this._synced){var t=this.getSeekState(),e=this._player.getSeekState();!t||"IN_PROGRESS"!==t.state||e&&"IN_PROGRESS"===e.state||(this._logger.debug("Signalling seek as complete on proxy because provided player isn't seeking."),this._signalSeekComplete())}},e.prototype._ensureBelowPosition=function(t){this.getPosition()>t&&(this._logger.debug("Capping position.",t),this.seek(t),this.isReady()&&(this._lastPlayerPosition=t,this._signalSeekComplete()))},e.prototype._sync=function(t){var e=this,r=this._player;if(!r)throw new Error("Player should have become available by now.");if(this._logger.debug("Syncing...",this.isPlaying(),this.isActuallyPlaying()),r.isDead()){this._logger.debug("Provided player is dead.");var n=r.getFatalError();n&&this._handleFatalError(n,r)}else this._errorHandler=r.onError.subscribe(function(t){t instanceof a.PlayerFatalError?e._onProvidedPlayerError.dispatch(new p.ProxyProvidedPlayerFatalError(t,r)):(e._triggerError(t),e._onProvidedPlayerError.dispatch(new c.ProxyProvidedPlayerError(t,r)))}),this._changeHandler=r.onChange.subscribe(function(t){e._update(function(){if(e._logger.debug("Handling changes.",t),t.dead)return e._logger.debug("Player has gone to DEAD state."),e._unsync(),void(e.isDead()||t.fatalError&&e._handleFatalError(t.fatalError,r));if(void 0===t.volume&&void 0===t.muted||e._notifyVolumeChange(r.getVolume(),r.getMuted()),void 0!==t.duration&&(e._ensureBelowPosition(t.duration),e._provideDuration(t.duration),e.isReady()||(e._signalReady(),e._handleSkippedSeek(),e._notifyStalled(r.isStalled()))),t.seek){var n=e.getSeekState();n&&"IN_PROGRESS"===n.state||"IN_PROGRESS"!==t.seek.state?n&&"IN_PROGRESS"===n.state&&("COMPLETED"===t.seek.state&&n.position===t.seek.position?(e._signalSeekComplete(),r.isFadingForSeek()&&e._notifyFadingForSeek(!0)):"COMPLETED"===t.seek.state&&n.position!==t.seek.position?e._notifySeekRejection(new Error("Another seek occurred to a different position.")):"IN_PROGRESS"===t.seek.state&&n.position!==t.seek.position?e.seek(t.seek.position):"ERROR"===t.seek.state&&e._notifySeekRejection(t.seek.error)):e.seek(t.seek.position)}void 0!==t.stalled&&e._notifyStalled(t.stalled),!1===t.playing&&t.playRejection?e.isActuallyPlaying()?(e._triggerError(new s.PlayerError("Paused because a player was provided that refused to play.")),e._notifyPlaying(!1)):e._notifyPlayRejection(t.playRejection):!1===t.playing&&(r.isActuallyPlaying()?e.pause():void 0===t.actuallyPlaying&&e.isReady()&&e._notifyPlaying(!1)),!0===t.playing&&t.pauseRejection?e._notifyPauseRejection(t.pauseRejection):!0===t.playing&&e.play(),void 0!==t.actuallyPlaying&&t.actuallyPlaying!==e.isActuallyPlaying()&&(e._notifyPlaying(t.actuallyPlaying),t.actuallyPlaying&&r.isFading()&&e._notifyFading(!0)),!1===t.fading&&e._notifyFading(!1),!1===t.fadingForSeek&&e._notifyFadingForSeek(!1)})}),this._update(function(){var n=e._instanceLock;try{if(e._notifyStalled(r.isStalled()),r.isReady()){var i=r.getDuration();e._ensureBelowPosition(i),e._provideDuration(i),e.isReady()||(e._logger.debug("Provided player is already ready. Making proxy player ready."),e._signalReady())}if(t.syncVolume&&(r.setVolume(e.getVolume(),e.getMuted()),e._instanceLock!==n))return;var o=e.getSeekState();if(t.syncPosition){e._logger.debug("Seeking to match position.");var s=e.getPosition();r.getPosition()!==s?r.seek(s):(e._logger.debug("Skipping seek because already at same position."),e.isReady()&&o&&"IN_PROGRESS"===o.state&&e._signalSeekComplete())}else if(o&&"IN_PROGRESS"===o.state){e._logger.debug("Seeking to match position because a seek has been queued.");var u=e._seekConfig;e._seekConfig=void 0,r.seek(e.getPosition(),u)}else{var l=r.getSeekState();l&&"IN_PROGRESS"===l.state&&(e._logger.debug("Seeking on proxy to match seek that is in progress on provided player."),e.seek(l.position))}if(e._instanceLock!==n)return;if(r.isActuallyPlaying()?(e._logger.debug("Provided player is already playing."),e.isActuallyPlaying()||(e._notifyPlaying(!0),r.isFading()&&e._notifyFading(!0))):r.isPlaying()?(e._logger.debug("Provided player is preparing to play."),e.play()):e.isPlaying()?(e._logger.debug("Calling play() on provided player to match proxy."),e._playAndHandleAbort(r)):e.isReady()&&e.isActuallyPlaying()&&(e._logger.debug("Switching to paused state, as provided player and proxy intended state is paused."),e._notifyPlaying(!1)),e._instanceLock!==n)return;e._synced=!0,e._notifyVolumeChange(r.getVolume(),r.getMuted())}catch(t){e._triggerError(new a.PlayerFatalError("Unexpected error occurred whilst syncing.",t))}})},e.prototype._playAndHandleAbort=function(t){var e=this._instanceLock;this._logger.debug("Calling play() on provided player.");var r=this._playConfig;this._playConfig=this._pauseConfig=void 0,t.play(r),this._instanceLock===e&&!t.isPlaying()&&this.isPlaying()&&(this._logger.debug("Provided player was not playing after play() call completed."),this.isActuallyPlaying()?(this._triggerError(new s.PlayerError("Paused because a player was provided that refused to play.")),this._notifyPlaying(!1)):this.pause())},e.prototype._pauseAndHandleAbort=function(t){var e=this._instanceLock;this._logger.debug("Calling pause() on provided player.");var r=this._pauseConfig;this._playConfig=this._pauseConfig=void 0,t.pause(r),this._instanceLock===e&&t.isPlaying()&&!this.isPlaying()&&(this._logger.debug("Provided player was not paused after pause() call completed."),this.play())},e.prototype._unsync=function(){if(this._logger.debug("Unsyncing..."),this._changeHandler&&(this._changeHandler.remove(),this._changeHandler=null),this._errorHandler&&(this._errorHandler.remove(),this._errorHandler=null),this._synced){this._synced=!1,this._unsyncInProgress=!0;var t=this._player;if(t)try{this._lastPlayerPosition=t.getPosition()}catch(t){this._logger.error("Error whilst unsyncing.",t)}this._unsyncInProgress=!1,this._logger.debug("Unsynced.",this.isPlaying(),this.isActuallyPlaying())}else this._logger.debug("Unsynced. (Sync never completed)")},e}(o.BasePlayer);e.ProxyPlayerBase=h},function(t,e,r){"use strict";function n(t){var e=navigator.userAgent.match(t);if(e&&e.length>=3){var r=parseInt(e[1],10),n=parseInt(e[2],10);if(!isNaN(r)&&!isNaN(n))return{major:r,minor:n}}return null}Object.defineProperty(e,"__esModule",{value:!0});var i="undefined"!=typeof navigator?navigator.userAgent:"",o=!/chrome|opera/i.test(i)&&/safari/i.test(i),s=i.indexOf("MSIE ")>=0||i.indexOf("Trident/")>=0,a=i.indexOf("Edge/")>=0,u=/Chrom(?:e|ium)/.test(i),l=i.toLowerCase().indexOf("firefox")>=0,c=/version\/(\d+)\.(\d+)/i,p=/Chrom(?:e|ium)\/([0-9]+)\.([0-9]+)\.([0-9]+)/,h=/Firefox\/(\d+)\.(\d+)/;e.isSafari=function(){return o},e.isFirefox=function(){return l},e.isChrome=function(){return u},e.isIE=function(){return s},e.isEdge=function(){return a},e.getSafariVersion=function(){return n(c)},e.getChromeVersion=function(){return n(p)},e.getFirefoxVersion=function(){return n(h)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(8),i=r(13),o=r(18),s=r(3),a=r(6);e.abortedError=new Error("Job aborted."),e.map=function(t,e){var r=e.convertResult,n=e.convertProgressUpdate,o=e.abortableJobOpts,s=e.passThroughAbort,l=void 0===s||s;return new u(function(){var e=t(),o=new a.EventDispatcher,s=!0,u=i.buildDeferred();return n&&e.onProgressUpdate(function(t){o.dispatch(n(t,s)),s=!1},{skipPast:!0}),e.onCompletion(function(t){try{u.resolve(r(t))}catch(t){u.reject(t)}}),e.onError(u.reject),{result:u.promise,progressUpdates:n?{onProgressUpdate:o,getProgressSoFar:function(){var t=e.getProgressSoFar();if(t){var r=n(t,s);return s=!1,r}return null}}:void 0,abort:function(){return l&&e.abort()}}},o)};var u=function(){function t(t,e){void 0===e&&(e={}),this._job=t,this._opts=e,this._counter=0,this._jobControl=null,this._promise=null,this._jobCompleted=!1}return t.prototype.run=function(){var t,r=this;if(this._jobControl)t=this._jobControl;else{try{t=this._jobControl=this._job()}catch(e){t=this._jobControl={result:n.Promise.reject(e)}}this._promise=t.result,o.always(this._promise,function(){r._jobCompleted=!0,r._opts.storeResult||(r._jobCompleted=!1,r._promise=null,r._jobControl=null)})}var a=this._promise;this._counter++;var u=i.buildDeferred(),l=!1,c=!1,p=void 0,h=!1,d=[],f=[],g=[];return o.always(a,function(){h||(l=!0,r._counter--),d.forEach(function(t){return t.remove()})}),a.then(function(t){h||(p=t,f.forEach(function(e){return s.deferException(function(){return e(t)})}),f.splice(0),u.resolve(t))},function(t){h||(c=!0,p=t,g.forEach(function(e){return e(t)}),g.splice(0),u.reject(t))}),{whenComplete:function(){return u.promise},onProgressUpdate:function(e,r){if(void 0===r&&(r={}),t.progressUpdates){if(!h&&!l){var n=t.progressUpdates.onProgressUpdate.subscribe(function(t){return e(t)});d.push(n)}if(!r.skipPast){var i=t.progressUpdates.getProgressSoFar();i&&e(i)}}},getProgressSoFar:function(){return t.progressUpdates?t.progressUpdates.getProgressSoFar():null},onCompletion:function(t){l?!c&&s.deferException(function(){return t(p)}):f.push(t)},onError:function(t){h?s.deferException(function(){return t(e.abortedError)}):l?c&&s.deferException(function(){return t(p)}):g.push(t)},hasCompleted:function(){return l},hasErrored:function(){return c},isAborted:function(){return h},abort:function(){h||l||(h=!0,d.forEach(function(t){return t.remove()}),0==--r._counter&&!r._jobCompleted&&r._jobControl&&r._jobControl.abort&&(r._jobControl.abort(),r._promise=null,r._jobControl=null),g.forEach(function(t){return s.deferException(function(){return t(e.abortedError)})}),u.reject(e.abortedError))}}},t}();e.AbortableJob=u},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){if(this.start=t,this.duration=e,e<0)throw new RangeError("Duration must be >= 0.");this.end=t+e}return t.normalizeRawTimeRanges=function(t){return t.slice(0).sort(function(t,e){return t.start-e.start}).reduce(function(t,e,r){var n=t.length-1;return r>0&&t[n].end>=e.start?t[n].end=e.end:t.push(e),t},[])},t.normalize=function(e){return t.normalizeRawTimeRanges(e.map(function(t){return{start:t.start,end:t.end}})).map(function(e){return new t(e.start,e.end-e.start)})},t.getCoverage=function(e){if(0===e.length)return new t(0,0);var r=1/0,n=0;return e.forEach(function(t){t.start<r&&(r=t.start),t.end>n&&(n=t.end)}),new t(r,n-r)},t.rangesContainTime=function(t,e){return e.some(function(e){return e.containsTime(t)})},t.prototype.containsTime=function(t){return this.start<=t&&this.end>t},t}();e.TimeRange=n},function(t,e,r){"use strict";t.exports="function"==typeof WeakMap&&"[object WeakMap]"===Object.prototype.toString.call(new WeakMap)},function(t,e,r){"use strict";var n=r(10),i=r(1),o=r(9),s=r(21),a=Array.isArray,u=Function.prototype.call,l=Array.prototype.some;t.exports=function(t,e){var r,c,p,h,d,f,g,y,_=arguments[2];if(a(t)||n(t)?r="array":o(t)?r="string":t=s(t),i(e),p=function(){h=!0},"array"!==r)if("string"!==r)for(c=t.next();!c.done;){if(u.call(e,_,c.value,p),h)return;c=t.next()}else for(f=t.length,d=0;d<f&&(g=t[d],d+1<f&&(y=g.charCodeAt(0))>=55296&&y<=56319&&(g+=t[++d]),u.call(e,_,g,p),!h);++d);else l.call(t,function(t){return u.call(e,_,t,p),h})}},function(t,e,r){"use strict";var n=r(10),i=r(4),o=r(9),s=r(2).iterator,a=Array.isArray;t.exports=function(t){return!(!i(t)||!a(t)&&!o(t)&&!n(t)&&"function"!=typeof t[s])}},function(t,e,r){"use strict";var n=r(41);t.exports=function(t){if(!n(t))throw new TypeError(t+" is not iterable");return t}},function(t,e,r){"use strict";var n,i=r(15),o=r(7),s=r(2),a=r(20),u=Object.defineProperty;n=t.exports=function(t){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");t=String(t),a.call(this,t),u(this,"__length__",o("",t.length))},i&&i(n,a),delete n.prototype.constructor,n.prototype=Object.create(a.prototype,{_next:o(function(){if(this.__list__)return this.__nextIndex__<this.__length__?this.__nextIndex__++:void this._unBind()}),_resolve:o(function(t){var e,r=this.__list__[t];return this.__nextIndex__===this.__length__?r:(e=r.charCodeAt(0))>=55296&&e<=56319?r+this.__list__[this.__nextIndex__++]:r})}),u(n.prototype,s.toStringTag,o("c","String Iterator"))},function(t,e,r){"use strict";var n=r(1),i=r(0),o=Function.prototype.bind,s=Function.prototype.call,a=Object.keys,u=Object.prototype.propertyIsEnumerable;t.exports=function(t,e){return function(r,l){var c,p=arguments[2],h=arguments[3];return r=Object(i(r)),n(l),c=a(r),h&&c.sort("function"==typeof h?o.call(h,r):void 0),"function"!=typeof t&&(t=c[t]),s.call(t,c,function(t,n){return u.call(r,t)?s.call(l,p,r[t],t,r,n):e})}}},function(t,e,r){"use strict";t.exports=r(44)("forEach")},function(t,e,r){"use strict";var n=r(1),i=r(45),o=Function.prototype.call;t.exports=function(t,e){var r={},s=arguments[2];return n(e),i(t,function(t,n,i,a){r[n]=o.call(e,s,t,n,i,a)}),r}},function(t,e,r){"use strict";t.exports=function(t){return t=Number(t),isNaN(t)||0===t?t:t>0?1:-1}},function(t,e,r){"use strict";t.exports=function(){var t=Math.sign;return"function"==typeof t&&1===t(10)&&-1===t(-20)}},function(t,e,r){"use strict";t.exports=r(48)()?Math.sign:r(47)},function(t,e,r){"use strict";var n=r(49),i=Math.abs,o=Math.floor;t.exports=function(t){return isNaN(t)?0:0!==(t=Number(t))&&isFinite(t)?n(t)*o(i(t)):t}},function(t,e,r){"use strict";var n=r(50),i=Math.max;t.exports=function(t){return i(0,n(t))}},function(t,e,r){"use strict";var n=Object.prototype.toString,i=n.call(r(24));t.exports=function(t){return"function"==typeof t&&n.call(t)===i}},function(t,e,r){"use strict";var n=r(2).iterator,i=r(10),o=r(52),s=r(51),a=r(1),u=r(0),l=r(4),c=r(9),p=Array.isArray,h=Function.prototype.call,d={configurable:!0,enumerable:!0,writable:!0,value:null},f=Object.defineProperty;t.exports=function(t){var e,r,g,y,_,v,m,b,w,E,P=arguments[1],S=arguments[2];if(t=Object(u(t)),l(P)&&a(P),this&&this!==Array&&o(this))e=this;else{if(!P){if(i(t))return 1!==(_=t.length)?Array.apply(null,t):((y=new Array(1))[0]=t[0],y);if(p(t)){for(y=new Array(_=t.length),r=0;r<_;++r)y[r]=t[r];return y}}y=[]}if(!p(t))if(void 0!==(w=t[n])){for(m=a(w).call(t),e&&(y=new e),b=m.next(),r=0;!b.done;)E=P?h.call(P,S,b.value,r):b.value,e?(d.value=E,f(y,r,d)):y[r]=E,b=m.next(),++r;_=r}else if(c(t)){for(_=t.length,e&&(y=new e),r=0,g=0;r<_;++r)E=t[r],r+1<_&&(v=E.charCodeAt(0))>=55296&&v<=56319&&(E+=t[++r]),E=P?h.call(P,S,E,g):E,e?(d.value=E,f(y,g,d)):y[g]=E,++g;_=g}if(void 0===_)for(_=s(t.length),e&&(y=new e(_)),r=0;r<_;++r)E=P?h.call(P,S,t[r],r):t[r],e?(d.value=E,f(y,r,d)):y[r]=E;return e&&(d.value=null,y.length=_),y}},function(t,e,r){"use strict";t.exports=function(){var t,e,r=Array.from;return"function"==typeof r&&(e=r(t=["raz","dwa"]),Boolean(e&&e!==t&&"dwa"===e[1]))}},function(t,e,r){"use strict";t.exports=r(54)()?Array.from:r(53)},function(t,e,r){"use strict";var n=r(55),i=r(14),o=r(0);t.exports=function(t){var e=Object(o(t)),r=arguments[1],s=Object(arguments[2]);if(e!==t&&!r)return e;var a={};return r?n(r,function(e){(s.ensure||e in t)&&(a[e]=t[e])}):i(a,t),a}},function(t,e,r){"use strict";var n,i=r(56),o=r(23),s=r(1),a=r(46),u=r(1),l=r(0),c=Function.prototype.bind,p=Object.defineProperty,h=Object.prototype.hasOwnProperty;n=function(t,e,r){var n,o=l(e)&&u(e.value);return delete(n=i(e)).writable,delete n.value,n.get=function(){return!r.overwriteDefinition&&h.call(this,t)?o:(e.value=c.call(o,r.resolveContext?r.resolveContext(this):this),p(this,t,e),this[t])},n},t.exports=function(t){var e=o(arguments[1]);return null!=e.resolveContext&&s(e.resolveContext),a(t,function(t,r){return n(r,t,e)})}},function(t,e,r){"use strict";var n=r(0);t.exports=function(){return n(this).length=0,this}},function(t,e,r){"use strict";t.exports=function(t){return!!t&&("symbol"==typeof t||!!t.constructor&&"Symbol"===t.constructor.name&&"Symbol"===t[t.constructor.toStringTag])}},function(t,e,r){"use strict";var n=r(59);t.exports=function(t){if(!n(t))throw new TypeError(t+" is not a symbol");return t}},function(t,e,r){"use strict";var n,i,o,s,a=r(7),u=r(60),l=Object.create,c=Object.defineProperties,p=Object.defineProperty,h=Object.prototype,d=l(null);if("function"==typeof Symbol){n=Symbol;try{String(n()),s=!0}catch(t){}}var f=function(){var t=l(null);return function(e){for(var r,n,i=0;t[e+(i||"")];)++i;return t[e+=i||""]=!0,p(h,r="@@"+e,a.gs(null,function(t){n||(n=!0,p(this,r,a(t)),n=!1)})),r}}();o=function(t){if(this instanceof o)throw new TypeError("Symbol is not a constructor");return i(t)},t.exports=i=function t(e){var r;if(this instanceof t)throw new TypeError("Symbol is not a constructor");return s?n(e):(r=l(o.prototype),e=void 0===e?"":String(e),c(r,{__description__:a("",e),__name__:a("",f(e))}))},c(i,{for:a(function(t){return d[t]?d[t]:d[t]=i(String(t))}),keyFor:a(function(t){var e;for(e in u(t),d)if(d[e]===t)return e}),hasInstance:a("",n&&n.hasInstance||i("hasInstance")),isConcatSpreadable:a("",n&&n.isConcatSpreadable||i("isConcatSpreadable")),iterator:a("",n&&n.iterator||i("iterator")),match:a("",n&&n.match||i("match")),replace:a("",n&&n.replace||i("replace")),search:a("",n&&n.search||i("search")),species:a("",n&&n.species||i("species")),split:a("",n&&n.split||i("split")),toPrimitive:a("",n&&n.toPrimitive||i("toPrimitive")),toStringTag:a("",n&&n.toStringTag||i("toStringTag")),unscopables:a("",n&&n.unscopables||i("unscopables"))}),c(o.prototype,{constructor:a(i),toString:a("",function(){return this.__name__})}),c(i.prototype,{toString:a(function(){return"Symbol ("+u(this).__description__+")"}),valueOf:a(function(){return u(this)})}),p(i.prototype,i.toPrimitive,a("",function(){var t=u(this);return"symbol"==typeof t?t:t.toString()})),p(i.prototype,i.toStringTag,a("c","Symbol")),p(o.prototype,i.toStringTag,a("c",i.prototype[i.toStringTag])),p(o.prototype,i.toPrimitive,a("c",i.prototype[i.toPrimitive]))},function(t,e,r){"use strict";var n={object:!0,symbol:!0};t.exports=function(){var t;if("function"!=typeof Symbol)return!1;t=Symbol("test symbol");try{String(t)}catch(t){return!1}return!!n[typeof Symbol.iterator]&&!!n[typeof Symbol.toPrimitive]&&!!n[typeof Symbol.toStringTag]}},function(t,e,r){"use strict";var n,i=r(15),o=r(22),s=r(7),a=r(2),u=r(20),l=Object.defineProperty;n=t.exports=function(t,e){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");u.call(this,t),e=e?o.call(e,"key+value")?"key+value":o.call(e,"key")?"key":"value":"value",l(this,"__kind__",s("",e))},i&&i(n,u),delete n.prototype.constructor,n.prototype=Object.create(u.prototype,{_resolve:s(function(t){return"value"===this.__kind__?this.__list__[t]:"key+value"===this.__kind__?[t,this.__list__[t]]:t})}),l(n.prototype,a.toStringTag,s("c","Array Iterator"))},function(t,e,r){"use strict";var n=String.prototype.indexOf;t.exports=function(t){return n.call(this,t,arguments[1])>-1}},function(t,e,r){"use strict";var n="razdwatrzy";t.exports=function(){return"function"==typeof n.contains&&!0===n.contains("dwa")&&!1===n.contains("foo")}},function(t,e,r){"use strict";t.exports=function(t){return"function"==typeof t}},function(t,e,r){"use strict";var n=r(4),i=Object.keys;t.exports=function(t){return i(n(t)?Object(t):t)}},function(t,e,r){"use strict";t.exports=function(){try{return Object.keys("primitive"),!0}catch(t){return!1}}},function(t,e,r){"use strict";t.exports=r(68)()?Object.keys:r(67)},function(t,e,r){"use strict";var n=r(69),i=r(0),o=Math.max;t.exports=function(t,e){var r,s,a,u=o(arguments.length,2);for(t=Object(i(t)),a=function(n){try{t[n]=e[n]}catch(t){r||(r=t)}},s=1;s<u;++s)e=arguments[s],n(e).forEach(a);if(void 0!==r)throw r;return t}},function(t,e,r){"use strict";t.exports=function(){var t,e=Object.assign;return"function"==typeof e&&(e(t={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),t.foo+t.bar+t.trzy==="razdwatrzy")}},function(t,e,r){"use strict";var n=Object.create(null),i=Math.random;t.exports=function(){var t;do{t=i().toString(36).slice(2)}while(n[t]);return t}},function(t,e,r){"use strict";var n=r(25);t.exports=function(t){if(!n(t))throw new TypeError(t+" is not an Object");return t}},function(t,e,r){"use strict";var n,i=Object.create;r(27)()||(n=r(26)),t.exports=function(){var t,e,r;return n?1!==n.level?i:(t={},e={},r={configurable:!1,enumerable:!1,writable:!0,value:void 0},Object.getOwnPropertyNames(Object.prototype).forEach(function(t){return"__proto__"===t?void(e[t]={configurable:!0,enumerable:!1,writable:!0,value:void 0}):void(e[t]=r)}),Object.defineProperties(t,e),Object.defineProperty(n,"nullPolyfill",{configurable:!1,enumerable:!1,writable:!1,value:t}),function(e,r){return i(null===e?t:e,r)}):i}()},function(t,e,r){"use strict";var n,i=r(15),o=r(73),s=r(0),a=r(72),u=r(7),l=r(21),c=r(40),p=r(2).toStringTag,h=r(39),d=Array.isArray,f=Object.defineProperty,g=Object.prototype.hasOwnProperty,y=Object.getPrototypeOf;t.exports=n=function(){var t,e=arguments[0];if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");return t=h&&i&&WeakMap!==n?i(new WeakMap,y(this)):this,null!=e&&(d(e)||(e=l(e))),f(t,"__weakMapData__",u("c","$weakMap$"+a())),e?(c(e,function(e){s(e),t.set(e[0],e[1])}),t):t},h&&(i&&i(n,WeakMap),n.prototype=Object.create(WeakMap.prototype,{constructor:u(n)})),Object.defineProperties(n.prototype,{delete:u(function(t){return!!g.call(o(t),this.__weakMapData__)&&(delete t[this.__weakMapData__],!0)}),get:u(function(t){if(g.call(o(t),this.__weakMapData__))return t[this.__weakMapData__]}),has:u(function(t){return g.call(o(t),this.__weakMapData__)}),set:u(function(t,e){return f(o(t),this.__weakMapData__,u("c",e)),this}),toString:u(function(){return"[object WeakMap]"})}),f(n.prototype,p,u("c","WeakMap"))},function(t,e,r){"use strict";t.exports=function(){var t,e;if("function"!=typeof WeakMap)return!1;try{t=new WeakMap([[e={},"one"],[{},"two"],[{},"three"]])}catch(t){return!1}return"[object WeakMap]"===String(t)&&"function"==typeof t.set&&t.set({},1)===t&&"function"==typeof t.delete&&"function"==typeof t.has&&"one"===t.get(e)}},function(t,e,r){"use strict";t.exports=r(76)()?WeakMap:r(75)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(77),i=function(){function t(){this._map=new n}return t.prototype.get=function(t){return this._map.get(t)},t.prototype.set=function(t,e){this._map.set(t,e)},t.prototype.has=function(t){return this._map.has(t)},t.prototype.delete=function(t){return this._map.delete(t)},t}();e.SCWeakMap=i},function(t,e,r){!function(e){var r=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/\?#]*\/)*.*?)??(;.*?)?(\?.*?)?(#.*?)?$/,n=/^([^\/?#]*)(.*)$/,i=/(?:\/|^)\.(?=\/)/g,o=/(?:\/|^)\.\.\/(?!\.\.\/).*?(?=\/)/g,s={buildAbsoluteURL:function(t,e,r){if(r=r||{},t=t.trim(),!(e=e.trim())){if(!r.alwaysNormalize)return t;var i=s.parseURL(t);if(!i)throw new Error("Error trying to parse base URL.");return i.path=s.normalizePath(i.path),s.buildURLFromParts(i)}var o=s.parseURL(e);if(!o)throw new Error("Error trying to parse relative URL.");if(o.scheme)return r.alwaysNormalize?(o.path=s.normalizePath(o.path),s.buildURLFromParts(o)):e;var a=s.parseURL(t);if(!a)throw new Error("Error trying to parse base URL.");if(!a.netLoc&&a.path&&"/"!==a.path[0]){var u=n.exec(a.path);a.netLoc=u[1],a.path=u[2]}a.netLoc&&!a.path&&(a.path="/");var l={scheme:a.scheme,netLoc:o.netLoc,path:null,params:o.params,query:o.query,fragment:o.fragment};if(!o.netLoc&&(l.netLoc=a.netLoc,"/"!==o.path[0]))if(o.path){var c=a.path,p=c.substring(0,c.lastIndexOf("/")+1)+o.path;l.path=s.normalizePath(p)}else l.path=a.path,o.params||(l.params=a.params,o.query||(l.query=a.query));return null===l.path&&(l.path=r.alwaysNormalize?s.normalizePath(o.path):o.path),s.buildURLFromParts(l)},parseURL:function(t){var e=r.exec(t);return e?{scheme:e[1]||"",netLoc:e[2]||"",path:e[3]||"",params:e[4]||"",query:e[5]||"",fragment:e[6]||""}:null},normalizePath:function(t){for(t=t.split("").reverse().join("").replace(i,"");t.length!==(t=t.replace(o,"")).length;);return t.split("").reverse().join("")},buildURLFromParts:function(t){return t.scheme+t.netLoc+t.path+t.params+t.query+t.fragment}};t.exports=s}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(79),i=/^.*\.([^\.;\?#]*).*$/;e.getExtension=function(t){var e=i.exec(t);return e?e[1].toLowerCase():null},e.buildAbsoluteUrl=function(t,e){return n.buildAbsoluteURL(t,e,{alwaysNormalize:!0})}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.combine=function(t){var e=new Uint8Array(t.reduce(function(t,e){return t+e.byteLength},0)),r=0;return t.forEach(function(t){e.set(t,r),r+=t.byteLength}),e},e.fill=function(t,e){if(Uint8Array.prototype.fill)t.fill(e);else for(var r=0;r<t.length;r++)t[r]=e},e.forEach=function(t,e){if(Uint8Array.prototype.forEach)t.forEach(e);else for(var r=0;r<t.length;r++)e(t[r],r)},e.numberToUint8Array=function(t,e){if(void 0===e&&(e=!1),(t=Math.round(t))<0)throw new Error("Negative numbers not supported.");for(var r=Math.max(1,Math.ceil(Math.log(t+1)/Math.log(2)/8)),n=new Uint8Array(r),i=0;i<r;i++)n[e?i:r-1-i]=255&t,t>>>=8;return n},e.createVintBuffer=function(t){if(t<0||t>Math.pow(2,53))throw new Error("Unrepresentable value: "+t);var e;for(e=1;e<=8&&!(t<Math.pow(2,7*e)-1);e++);for(var r=new Uint8Array(e),n=1;n<=e;n++){var i=255&t;r[e-n]=i,t-=i,t/=Math.pow(2,8)}return r[0]|=1<<8-e,r}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.compact=function(t){return t.filter(function(t){return null!=t})}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(8),i=r(18);e.promiseWithTimeout=function(t,e,r){return void 0===r&&(r=new Error("Timed out.")),new n.Promise(function(n,o){var s=window.setTimeout(function(){o(r)},e);i.always(t,function(t){return window.clearTimeout(s),t}).then(n,o)})}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(17),i="undefined"!=typeof window&&"Map"in window;e.buildCache=function(){return i?new window.Map:new o};var o=function(){function t(){this._store=[]}return t.prototype.set=function(t,e){var r=n.find(this._store,function(e){return e.key===t});r?r.val=e:this._store.push({key:t,val:e})},t.prototype.get=function(t){var e=n.find(this._store,function(e){return e.key===t});if(e)return e.val},t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(3);e.retry=function(t,e,r){void 0===r&&(r={});var i=null,o=0,s=!1,a=null,u=function(){var l=!1;a=e({attemptNum:o,scheduleRetry:function(){if(l)throw new Error("scheduleRetry() already called.");if(l=!0,a=null,s)return!1;var e=t(++o);if(null===e){var c=r.onNoMoreRetries;return c&&n.deferException(function(){return c()}),!1}return i=window.setTimeout(u,e),!0}})||null};return u(),{cancel:function(){s||(s=!0,i&&(window.clearTimeout(i),i=null),a&&a.onCancel())}}},e.buildExponentialDelayCalculator=function(t){var e=void 0===t?{}:t,r=e.timeBase,n=void 0===r?500:r,i=e.threshold,o=void 0===i?3:i,s=e.delayCap,a=void 0===s?45e3:s,u=e.jitter,l=void 0===u?200:u,c=e.maxAttempts,p=void 0===c?null:c;if(n<=0)throw new Error("Time base must be > 0.");if(o<=0)throw new Error("Threshold must be > 0.");if(null!==a&&a<=0)throw new Error("Delay cap must be null or > 0.");if(null!==p&&p<1)throw new Error("Max attempts must be >= 1.");return function(t){if(null!==p&&t>=p)return null;var e=t>0?Math.pow(2,t/o-1):0;return Math.min(e*n,a||1/0)+Math.round(Math.random()*l)}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(13),i=r(37),o=r(85),s=r(30),a=r(17),u=r(84),l=r(19),c=r(8),p=r(83),h=r(18),d=r(82),f=r(81),g=r(3),y=r(36),_=r(80),v=r(78);!function(t){t.OnExit=s.OnExit,t.find=a.find,t.Promise=c.Promise,t.promiseWithTimeout=p.promiseWithTimeout,t.always=h.always,t.compact=d.compact,t.deferException=g.deferException,t.SCWeakMap=v.SCWeakMap,function(t){t.buildCache=u.buildCache}(t.cache||(t.cache={})),function(t){t.buildDeferred=n.buildDeferred}(t.deferred||(t.deferred={})),function(t){t.getExtension=_.getExtension,t.buildAbsoluteUrl=_.buildAbsoluteUrl}(t.url||(t.url={})),function(t){t.AbortableJob=i.AbortableJob,t.map=i.map,t.abortedError=i.abortedError}(t.abortableJob||(t.abortableJob={})),function(t){t.retry=o.retry,t.buildExponentialDelayCalculator=o.buildExponentialDelayCalculator}(t.retry||(t.retry={})),function(t){t.isSafari=y.isSafari,t.getSafariVersion=y.getSafariVersion,t.isIE=y.isIE,t.isEdge=y.isEdge,t.isFirefox=y.isFirefox,t.isChrome=y.isChrome,t.getChromeVersion=y.getChromeVersion,t.getFirefoxVersion=y.getFirefoxVersion}(t.browser||(t.browser={})),function(t){t.combine=f.combine,t.fill=f.fill,t.forEach=f.forEach,t.numberToUint8Array=f.numberToUint8Array,t.createVintBuffer=f.createVintBuffer}(t.arrayBuffer||(t.arrayBuffer={})),function(t){t.now=l.now}(t.time||(t.time={}))}(e.helpers||(e.helpers={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){this._msg=t,this._cause=e}return t.prototype.getMsg=function(){return this._msg},t.prototype.getCause=function(){return this._cause},t}();e.LoaderError=n},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(87);!function(t){t.LoaderError=n.LoaderError}(e.loaderErrors||(e.loaderErrors={}))},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=r(5),o=function(t){function e(e,r){return t.call(this,e||"The URL update failed for some reason.",r)||this}return n(e,t),e.prototype.getCode=function(){return"URL_UPDATE_ERROR"},e}(i.PlayerFatalError);e.URLUpdateError=o},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(33),i=r(89),o=r(29),s=r(16),a=r(11),u=r(5);!function(t){t.PlayerError=a.PlayerError,t.PlayerFatalError=u.PlayerFatalError,t.NotSupportedError=n.NotSupportedError,t.URLUpdateError=i.URLUpdateError,t.ImplementationError=o.ImplementationError,t.ProxyProvidedPlayerFatalError=s.ProxyProvidedPlayerFatalError}(e.errors||(e.errors={}))},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=r(6),o=r(12),s=r(35),a=r(16),u=function(t){function e(e){var r=t.call(this,e)||this;return r._onPlayerProvided=new i.EventDispatcher,r._onPlayerRemoved=new i.EventDispatcher,r._shouldPassThroughFatalErrors=!!e.shouldPassThroughFatalErrors,r.onPlayerProvided=r._onPlayerProvided.getHandle(),r.onPlayerRemoved=r._onPlayerRemoved.getHandle(),r._logger=o.prefixLogger(r._logger,"ProxyPlayer"),r}return n(e,t),e.prototype.providePlayer=function(t,e){void 0===e&&(e={}),this._providePlayer(t,e),this._onPlayerProvided.dispatch(t)},e.prototype.removePlayer=function(){var t=this._getPlayer();if(!t)throw new Error("There is no player to remove.");this._removePlayer(),this._onPlayerRemoved.dispatch(t)},e.prototype.setInitialDuration=function(t){this._setInitialDuration(t)},e.prototype.getPlayer=function(){return this._getPlayer()},e.prototype._handleFatalError=function(t,e){this._shouldPassThroughFatalErrors?this._triggerError(t):this._triggerError(new a.ProxyProvidedPlayerFatalError(t,e))},e}(s.ProxyPlayerBase);e.ProxyPlayer=u},function(t,e){},function(t,e){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e){function r(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}function i(t){if(l===setTimeout)return setTimeout(t,0);if((l===r||!l)&&setTimeout)return l=setTimeout,setTimeout(t,0);try{return l(t,0)}catch(e){try{return l.call(null,t,0)}catch(e){return l.call(this,t,0)}}}function o(){f&&h&&(f=!1,h.length?d=h.concat(d):g=-1,d.length&&s())}function s(){if(!f){var t=i(o);f=!0;for(var e=d.length;e;){for(h=d,d=[];++g<e;)h&&h[g].run();g=-1,e=d.length}h=null,f=!1,function(t){if(c===clearTimeout)return clearTimeout(t);if((c===n||!c)&&clearTimeout)return c=clearTimeout,clearTimeout(t);try{c(t)}catch(e){try{return c.call(null,t)}catch(e){return c.call(this,t)}}}(t)}}function a(t,e){this.fun=t,this.array=e}function u(){}var l,c,p=t.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:r}catch(t){l=r}try{c="function"==typeof clearTimeout?clearTimeout:n}catch(t){c=n}}();var h,d=[],f=!1,g=-1;p.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];d.push(new a(t,e)),1!==d.length||f||i(s)},a.prototype.run=function(){this.fun.apply(null,this.array)},p.title="browser",p.browser=!0,p.env={},p.argv=[],p.version="",p.versions={},p.on=u,p.addListener=u,p.once=u,p.off=u,p.removeListener=u,p.removeAllListeners=u,p.emit=u,p.prependListener=u,p.prependOnceListener=u,p.listeners=function(t){return[]},p.binding=function(t){throw new Error("process.binding is not supported")},p.cwd=function(){return"/"},p.chdir=function(t){throw new Error("process.chdir is not supported")},p.umask=function(){return 0}},function(t,e,r){(function(e,n){
|
|
34
34
|
/*!
|
|
35
35
|
* @overview es6-promise - a tiny implementation of Promises/A+.
|
|
36
36
|
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
|