@widgetic/editor 3.11.3 → 3.11.4

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/dev/editor.js CHANGED
@@ -13426,7 +13426,7 @@ WidgetEditor = (function(superClass) {
13426
13426
  this.el.append(this.tabs.el);
13427
13427
  LoginPopup.place(this.el);
13428
13428
  Blogvio.pubsub.subscribe('api/token/update', this._updateLoggedInStatus);
13429
- this.el.attr('editorVersion', "3.11.3");
13429
+ this.el.attr('editorVersion', "3.11.4");
13430
13430
  }
13431
13431
 
13432
13432
 
@@ -16755,7 +16755,7 @@ var parseType = function parseType(type) {
16755
16755
  };
16756
16756
 
16757
16757
  // const root = 'http://127.0.0.1:8091'; // for localhost development
16758
- var root = 'https://widgetic.com/'; // for running on widgetic.com domain
16758
+ var root = 'https://widgetic.com'; // for running on widgetic.com domain
16759
16759
 
16760
16760
  var UploadService = function (_EventsMixin) {
16761
16761
  _inherits(UploadService, _EventsMixin);
package/lib/editor.js CHANGED
@@ -23,7 +23,7 @@
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(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){
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.4")}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
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widgetic/editor",
3
- "version": "3.11.3",
3
+ "version": "3.11.4",
4
4
  "scripts": {
5
5
  "start": "webpack --config webpack.config.js --watch --progress",
6
6
  "build": "webpack --config webpack.config.js",
@@ -27,7 +27,7 @@ File.guid = 0;
27
27
  const parseType = type => type.indexOf('/') > 0 ? type.slice(0, type.indexOf('/')) : type;
28
28
 
29
29
  // const root = 'http://127.0.0.1:8091'; // for localhost development
30
- const root = 'https://widgetic.com/'; // for running on widgetic.com domain
30
+ const root = 'https://widgetic.com'; // for running on widgetic.com domain
31
31
 
32
32
  export default class UploadService extends EventsMixin(Service) {
33
33
  constructor(user, token) {