text: (function(){var t=this;(function(){(function(){this.Rails={linkClickSelector:"a[data-confirm], a[data-method], a[data-remote]:not([disabled]), a[data-disable-with], a[data-disable]",buttonClickSelector:{selector:"button[data-remote]:not([form]), button[data-confirm]:not([form])",exclude:"form button"},inputChangeSelector:"select[data-remote], input[data-remote], textarea[data-remote]",formSubmitSelector:"form",formInputClickSelector:"form input[type=submit], form input[type=image], form button[type=submit], form button:not([type]), input[type=submit][form], input[type=image][form], button[type=submit][form], button[form]:not([type])",formDisableSelector:"input[data-disable-with]:enabled, button[data-disable-with]:enabled, textarea[data-disable-with]:enabled, input[data-disable]:enabled, button[data-disable]:enabled, textarea[data-disable]:enabled",formEnableSelector:"input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled, input[data-disable]:disabled, button[data-disable]:disabled, textarea[data-disable]:disabled",fileInputSelector:"input[name][type=file]:not([disabled])",linkDisableSelector:"a[data-disable-with], a[data-disable]",buttonDisableSelector:"button[data-remote][data-disable-with], button[data-remote][data-disable]"}}).call(this)}).call(t);var e=t.Rails;(function(){(function(){var t,n;n=Element.prototype.matches||Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector,e.matches=function(t,e){return null!=e.exclude?n.call(t,e.selector)&&!n.call(t,e.exclude):n.call(t,e)},t="_ujsData",e.getData=function(e,n){var o;return null!=(o=e[t])?o[n]:void 0},e.setData=function(e,n,o){return null==e[t]&&(e[t]={}),e[t][n]=o},e.$=function(t){return Array.prototype.slice.call(document.querySelectorAll(t))}}).call(this),function(){var t,n,o;t=e.$,o=e.csrfToken=function(){var t;return(t=document.querySelector("meta[name=csrf-token]"))&&t.content},n=e.csrfParam=function(){var t;return(t=document.querySelector("meta[name=csrf-param]"))&&t.content},e.CSRFProtection=function(t){var e;if(null!=(e=o()))return t.setRequestHeader("X-CSRF-Token",e)},e.refreshCSRFTokens=function(){var e,r;if(r=o(),e=n(),null!=r&&null!=e)return t('form input[name="'+e+'"]').forEach(function(t){return t.value=r})}}.call(this),function(){var t,n,o;o=e.matches,"function"!=typeof(t=window.CustomEvent)&&((t=function(t,e){var n;return(n=document.createEvent("CustomEvent")).initCustomEvent(t,e.bubbles,e.cancelable,e.detail),n}).prototype=window.Event.prototype),n=e.fire=function(e,n,o){var r;return r=new t(n,{bubbles:!0,cancelable:!0,detail:o}),e.dispatchEvent(r),!r.defaultPrevented},e.stopEverything=function(t){return n(t.target,"ujs:everythingStopped"),t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation()},e.delegate=function(t,e,n,r){return t.addEventListener(n,function(t){var n;for(n=t.target;n instanceof Element&&!o(n,e);)n=n.parentNode;if(n instanceof Element&&!1===r.call(n,t))return t.preventDefault(),t.stopPropagation()})}}.call(this),function(){var t,n,o,r,i;n=e.CSRFProtection,e.fire,t={"*":"*/*",text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript",script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},e.ajax=function(t){var e;return t=r(t),e=o(t,function(){var n;return n=i(e.response,e.getResponseHeader("Content-Type")),2===Math.floor(e.status/100)?"function"==typeof t.success&&t.success(n,e.statusText,e):"function"==typeof t.error&&t.error(n,e.statusText,e),"function"==typeof t.complete?t.complete(e,e.statusText):void 0}),!("function"!=typeof t.beforeSend||!t.beforeSend(e,t))&&(e.readyState===XMLHttpRequest.OPENED?e.send(t.data):void 0)},r=function(e){return e.url=e.url||location.href,e.type=e.type.toUpperCase(),"GET"===e.type&&e.data&&(e.url.indexOf("?")<0?e.url+="?"+e.data:e.url+="&"+e.data),null==t[e.dataType]&&(e.dataType="*"),e.accept=t[e.dataType],"*"!==e.dataType&&(e.accept+=", */*; q=0.01"),e},o=function(t,e){var o;return(o=new XMLHttpRequest).open(t.type,t.url,!0),o.setRequestHeader("Accept",t.accept),"string"==typeof t.data&&o.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),t.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),n(o),o.withCredentials=!!t.withCredentials,o.onreadystatechange=function(){if(o.readyState===XMLHttpRequest.DONE)return e(o)},o},i=function(t,e){var n,o;if("string"==typeof t&&"string"==typeof e)if(e.match(/\bjson\b/))try{t=JSON.parse(t)}catch(r){}else if(e.match(/\b(?:java|ecma)script\b/))(o=document.createElement("script")).text=t,document.head.appendChild(o).parentNode.removeChild(o);else if(e.match(/\b(xml|html|svg)\b/)){n=new DOMParser,e=e.replace(/;.+/,"");try{t=n.parseFromString(t,e)}catch(r){}}return t},e.href=function(t){return t.href},e.isCrossDomain=function(t){var e,n;(e=document.createElement("a")).href=location.href,n=document.createElement("a");try{return n.href=t,!((!n.protocol||":"===n.protocol)&&!n.host||e.protocol+"//"+e.host==n.protocol+"//"+n.host)}catch(o){return o,!0}}}.call(this),function(){var t,n;t=e.matches,n=function(t){return Array.prototype.slice.call(t)},e.serializeElement=function(e,o){var r,i;return r=[e],t(e,"form")&&(r=n(e.elements)),i=[],r.forEach(function(e){if(e.name&&!e.disabled)return t(e,"select")?n(e.options).forEach(function(t){if(t.selected)return i.push({name:e.name,value:t.value})}):e.checked||-1===["radio","checkbox","submit"].indexOf(e.type)?i.push({name:e.name,value:e.value}):void 0}),o&&i.push(o),i.map(function(t){return null!=t.name?encodeURIComponent(t.name)+"="+encodeURIComponent(t.value):t}).join("&")},e.formElements=function(e,o){return t(e,"form")?n(e.elements).filter(function(e){return t(e,o)}):n(e.querySelectorAll(o))}}.call(this),function(){var t,n,o;n=e.fire,o=e.stopEverything,e.handleConfirm=function(e){if(!t(this))return o(e)},t=function(t){var e,o,r;if(!(r=t.getAttribute("data-confirm")))return!0;if(e=!1,n(t,"confirm")){try{e=confirm(r)}catch(i){}o=n(t,"confirm:complete",[e])}return e&&o}}.call(this),function(){var t,n,o,r,i,s,a,l,u,c,h;u=e.matches,l=e.getData,c=e.setData,h=e.stopEverything,a=e.formElements,e.handleDisabledElement=function(t){if(this.disabled)return h(t)},e.enableElement=function(t){var n;return n=t instanceof Event?t.target:t,u(n,e.linkDisableSelector)?s(n):u(n,e.buttonDisableSelector)||u(n,e.formEnableSelector)?r(n):u(n,e.formSubmitSelector)?i(n):void 0},e.disableElement=function(r){var i;return i=r instanceof Event?r.target:r,u(i,e.linkDisableSelector)?o(i):u(i,e.buttonDisableSelector)||u(i,e.formDisableSelector)?t(i):u(i,e.formSubmitSelector)?n(i):void 0},o=function(t){var e;return null!=(e=t.getAttribute("data-disable-with"))&&(c(t,"ujs:enable-with",t.innerHTML),t.innerHTML=e),t.addEventListener("click",h),c(t,"ujs:disabled",!0)},s=function(t){var e;return null!=(e=l(t,"ujs:enable-with"))&&(t.innerHTML=e,c(t,"ujs:enable-with",null)),t.removeEventListener("click",h),c(t,"ujs:disabled",null)},n=function(n){return a(n,e.formDisableSelector).forEach(t)},t=function(t){var e;return null!=(e=t.getAttribute("data-disable-with"))&&(u(t,"button")?(c(t,"ujs:enable-with",t.innerHTML),t.innerHTML=e):(c(t,"ujs:enable-with",t.value),t.value=e)),t.disabled=!0,c(t,"ujs:disabled",!0)},i=function(t){return a(t,e.formEnableSelector).forEach(r)},r=function(t){var e;return null!=(e=l(t,"ujs:enable-with"))&&(u(t,"button")?t.innerHTML=e:t.value=e,c(t,"ujs:enable-with",null)),t.disabled=!1,c(t,"ujs:disabled",null)}}.call(this),function(){var t;t=e.stopEverything,e.handleMethod=function(n){var o,r,i,s,a,l,u;if(u=(l=this).getAttribute("data-method"))return a=e.href(l),r=e.csrfToken(),o=e.csrfParam(),i=document.createElement("form"),s="<input name='_method' value='"+u+"' type='hidden' />",null==o||null==r||e.isCrossDomain(a)||(s+="<input name='"+o+"' value='"+r+"' type='hidden' />"),s+='<input type="submit" />',i.method="post",i.action=a,i.target=l.target,i.innerHTML=s,i.style.display="none",document.body.appendChild(i),i.querySelector('[type="submit"]').click(),t(n)}}.call(this),function(){var t,n,o,r,i,s,a,l,u,c=[].slice;s=e.matches,o=e.getData,l=e.setData,n=e.fire,u=e.stopEverything,t=e.ajax,r=e.isCrossDomain,a=e.serializeElement,i=function(t){var e;return null!=(e=t.getAttribute("data-remote"))&&"false"!==e},e.handleRemote=function(h){var p,d,f,m,y,b,v;return!i(m=this)||(n(m,"ajax:before")?(v=m.getAttribute("data-with-credentials"),f=m.getAttribute("data-type")||"script",s(m,e.formSubmitSelector)?(p=o(m,"ujs:submit-button"),y=o(m,"ujs:submit-button-formmethod")||m.method,b=o(m,"ujs:submit-button-formaction")||m.getAttribute("action")||location.href,"GET"===y.toUpperCase()&&(b=b.replace(/\?.*$/,"")),"multipart/form-data"===m.enctype?(d=new FormData(m),null!=p&&d.append(p.name,p.value)):d=a(m,p),l(m,"ujs:submit-button",null),l(m,"ujs:submit-button-formmethod",null),l(m,"ujs:submit-button-formaction",null)):s(m,e.buttonClickSelector)||s(m,e.inputChangeSelector)?(y=m.getAttribute("data-method"),b=m.getAttribute("data-url"),d=a(m,m.getAttribute("data-params"))):(y=m.getAttribute("data-method"),b=e.href(m),d=m.getAttribute("data-params")),t({type:y||"GET",url:b,data:d,dataType:f,beforeSend:function(t,e){return n(m,"ajax:beforeSend",[t,e])?n(m,"ajax:send",[t]):(n(m,"ajax:stopped"),!1)},success:function(){var t;return t=1<=arguments.length?c.call(arguments,0):[],n(m,"ajax:success",t)},error:function(){var t;return t=1<=arguments.length?c.call(arguments,0):[],n(m,"ajax:error",t)},complete:function(){var t;return t=1<=arguments.length?c.call(arguments,0):[],n(m,"ajax:complete",t)},crossDomain:r(b),withCredentials:null!=v&&"false"!==v}),u(h)):(n(m,"ajax:stopped"),!1))},e.formSubmitButtonClick=function(){var t,e;if(e=(t=this).form)return t.name&&l(e,"ujs:submit-button",{name:t.name,value:t.value}),l(e,"ujs:formnovalidate-button",t.formNoValidate),l(e,"ujs:submit-button-formaction",t.getAttribute("formaction")),l(e,"ujs:submit-button-formmethod",t.getAttribute("formmethod"))},e.handleMetaClick=function(t){var e,n,o;if(o=((n=this).getAttribute("data-method")||"GET").toUpperCase(),e=n.getAttribute("data-params"),(t.metaKey||t.ctrlKey)&&"GET"===o&&!e)return t.stopImmediatePropagation()}}.call(this),function(){var t,n,o,r,i,s,a,l,u,c,h,p,d,f;s=e.fire,o=e.delegate,l=e.getData,t=e.$,f=e.refreshCSRFTokens,n=e.CSRFProtection,i=e.enableElement,r=e.disableElement,c=e.handleDisabledElement,u=e.handleConfirm,d=e.handleRemote,a=e.formSubmitButtonClick,h=e.handleMetaClick,p=e.handleMethod,"undefined"==typeof jQuery||null===jQuery||null==jQuery.ajax||jQuery.rails||(jQuery.rails=e,jQuery.ajaxPrefilter(function(t,e,o){if(!t.crossDomain)return n(o)})),e.start=function(){if(window._rails_loaded)throw new Error("rails-ujs has already been loaded!");return window.addEventListener("pageshow",function(){return t(e.formEnableSelector).forEach(function(t){if(l(t,"ujs:disabled"))return i(t)}),t(e.linkDisableSelector).forEach(function(t){if(l(t,"ujs:disabled"))return i(t)})}),o(document,e.linkDisableSelector,"ajax:complete",i),o(document,e.linkDisableSelector,"ajax:stopped",i),o(document,e.buttonDisableSelector,"ajax:complete",i),o(document,e.buttonDisableSelector,"ajax:stopped",i),o(document,e.linkClickSelector,"click",c),o(document,e.linkClickSelector,"click",u),o(document,e.linkClickSelector,"click",h),o(document,e.linkClickSelector,"click",r),o(document,e.linkClickSelector,"click",d),o(document,e.linkClickSelector,"click",p),o(document,e.buttonClickSelector,"click",c),o(document,e.buttonClickSelector,"click",u),o(document,e.buttonClickSelector,"click",r),o(document,e.buttonClickSelector,"click",d),o(document,e.inputChangeSelector,"change",c),o(document,e.inputChangeSelector,"change",u),o(document,e.inputChangeSelector,"change",d),o(document,e.formSubmitSelector,"submit",c),o(document,e.formSubmitSelector,"submit",u),o(document,e.formSubmitSelector,"submit",d),o(document,e.formSubmitSelector,"submit",function(t){return setTimeout(function(){return r(t)},13)}),o(document,e.formSubmitSelector,"ajax:send",r),o(document,e.formSubmitSelector,"ajax:complete",i),o(document,e.formInputClickSelector,"click",c),o(document,e.formInputClickSelector,"click",u),o(document,e.formInputClickSelector,"click",a),document.addEventListener("DOMContentLoaded",f),window._rails_loaded=!0},window.Rails===e&&s(document,"rails:attachBindings")&&e.start()}.call(this)}).call(this),"object"==typeof module&&module.exports?module.exports=e:"function"==typeof define&&define.amd&&define(e)}).call(this),function(){this.Turbolinks={supported:null!=window.history.pushState&&null!=window.requestAnimationFrame&&null!=window.addEventListener,visit:function(t,e){return Turbolinks.controller.visit(t,e)},clearCache:function(){return Turbolinks.controller.clearCache()},setProgressBarDelay:function(t){return Turbolinks.controller.setProgressBarDelay(t)}}}.call(this),function(){var t,e,n,o,r,i,s,a,l,u=[].slice;Turbolinks.copyObject=function(t){var e,n,o;for(e in n={},t)o=t[e],n[e]=o;return n},Turbolinks.closest=function(e,n){return t.call(e,n)},t=null!=(l=document.documentElement.closest)?l:function(t){var n;for(n=this;n;){if(n.nodeType===Node.ELEMENT_NODE&&e.call(n,t))return n;n=n.parentNode}},Turbolinks.defer=function(t){return setTimeout(t,1)},Turbolinks.throttle=function(t){var e;return e=null,function(){var n,o;return n=1<=arguments.length?u.call(arguments,0):[],null!=e?e:e=requestAnimationFrame((o=this,function(){return e=null,t.apply(o,n)}))}},Turbolinks.dispatch=function(t,e){var o,r,i,s,a,l;return l=(a=null!=e?e:{}).target,o=a.cancelable,r=a.data,(i=document.createEvent("Events")).initEvent(t,!0,!0===o),i.data=null!=r?r:{},i.cancelable&&!n&&(s=i.preventDefault,i.preventDefault=function(){return this.defaultPrevented||Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}}),s.call(this)}),(null!=l?l:document).dispatchEvent(i),i},(a=document.createEvent("Events")).initEvent("test",!0,!0),a.preventDefault(),n=a.defaultPrevented,Turbolinks.match=function(t,n){return e.call(t,n)},e=null!=(r=null!=(i=null!=(s=(o=document.documentElement).matchesSelector)?s:o.webkitMatchesSelector)?i:o.msMatchesSelector)?r:o.mozMatchesSelector,Turbolinks.uuid=function(){var t,e,n;for(n="",t=e=1;36>=e;t=++e)n+=9===t||14===t||19===t||24===t?"-":15===t?"4":20===t?(Math.floor(4*Math.random())+8).toString(16):Math.floor(15*Math.random()).toString(16);return n}}.call(this),function(){Turbolinks.Location=function(){function t(t){var e,n;null==t&&(t=""),(n=document.createElement("a")).href=t.toString(),this.absoluteURL=n.href,2>(e=n.hash.length)?this.requestURL=this.absoluteURL:(this.requestURL=this.absoluteURL.slice(0,-e),this.anchor=n.hash.slice(1))}var e,n,o,r;return t.wrap=function(t){return t instanceof this?t:new this(t)},t.prototype.getOrigin=function(){return this.absoluteURL.split("/",3).join("/")},t.prototype.getPath=function(){var t,e;return null!=(t=null!=(e=this.requestURL.match(/\/\/[^\/]*(\/[^?;]*)/))?e[1]:void 0)?t:"/"},t.prototype.getPathComponents=function(){return this.getPath().split("/").slice(1)},t.prototype.getLastPathComponent=function(){return this.getPathComponents().slice(-1)[0]},t.prototype.getExtension=function(){var t,e;return null!=(t=null!=(e=this.getLastPathComponent().match(/\.[^.]*$/))?e[0]:void 0)?t:""},t.prototype.isHTML=function(){return this.getExtension().match(/^(?:|\.(?:htm|html|xhtml))$/)},t.prototype.isPrefixedBy=function(t){var e;return e=n(t),this.isEqualTo(t)||r(this.absoluteURL,e)},t.prototype.isEqualTo=function(t){return this.absoluteURL===(null!=t?t.absoluteURL:void 0)},t.prototype.toCacheKey=function(){return this.requestURL},t.prototype.toJSON=function(){return this.absoluteURL},t.prototype.toString=function(){return this.absoluteURL},t.prototype.valueOf=function(){return this.absoluteURL},n=function(t){return e(t.getOrigin()+t.getPath())},e=function(t){return o(t,"/")?t:t+"/"},r=function(t,e){return t.slice(0,e.length)===e},o=function(t,e){return t.slice(-e.length)===e},t}()}.call(this),function(){var t=function(t,e){return function(){return t.apply(e,arguments)}};Turbolinks.HttpRequest=function(){function e(e,n,o){this.delegate=e,this.requestCanceled=t(this.requestCanceled,this),this.requestTimedOut=t(this.requestTimedOut,this),this.requestFailed=t(this.requestFailed,this),this.requestLoaded=t(this.requestLoaded,this),this.requestProgressed=t(this.requestProgressed,this),this.url=Turbolinks.Location.wrap(n).requestURL,this.referrer=Turbolinks.Location.wrap(o).absoluteURL,this.createXHR()}return e.NETWORK_FAILURE=0,e.TIMEOUT_FAILURE=-1,e.timeout=60,e.prototype.send=function(){var t;return this.xhr&&!this.sent?(this.notifyApplicationBeforeRequestStart(),this.setProgress(0),this.xhr.send(),this.sent=!0,"function"==typeof(t=this.delegate).requestStarted?t.requestStarted():void 0):void 0},e.prototype.cancel=function(){return this.xhr&&this.sent?this.xhr.abort():void 0},e.prototype.requestProgressed=function(t){return t.lengthComputable?this.setProgress(t.loaded/t.total):void 0},e.prototype.requestLoaded=function(){return this.endRequest((t=this,function(){var e;return 200<=(e=t.xhr.status)&&300>e?t.delegate.requestCompletedWithResponse(t.xhr.responseText,t.xhr.getResponseHeader("Turbolinks-Location")):(t.failed=!0,t.delegate.requestFailedWithStatusCode(t.xhr.status,t.xhr.responseText))}));var t},e.prototype.requestFailed=function(){return this.endRequest((t=this,function(){return t.failed=!0,t.delegate.requestFailedWithStatusCode(t.constructor.NETWORK_FAILURE)}));var t},e.prototype.requestTimedOut=function(){return this.endRequest((t=this,function(){return t.failed=!0,t.delegate.requestFailedWithStatusCode(t.constructor.TIMEOUT_FAILURE)}));var t},e.prototype.requestCanceled=function(){return this.endRequest()},e.prototype.notifyApplicationBeforeRequestStart=function(){return Turbolinks.dispatch("turbolinks:request-start",{data:{url:this.url,xhr:this.xhr}})},e.prototype.notifyApplicationAfterRequestEnd=function(){return Turbolinks.dispatch("turbolinks:request-end",{data:{url:this.url,xhr:this.xhr}})},e.prototype.createXHR=function(){return this.xhr=new XMLHttpRequest,this.xhr.open("GET",this.url,!0),this.xhr.timeout=1e3*this.constructor.timeout,this.xhr.setRequestHeader("Accept","text/html, application/xhtml+xml"),this.xhr.setRequestHeader("Turbolinks-Referrer",this.referrer),this.xhr.onprogress=this.requestProgressed,this.xhr.onload=this.requestLoaded,this.xhr.onerror=this.requestFailed,this.xhr.ontimeout=this.requestTimedOut,this.xhr.onabort=this.requestCanceled},e.prototype.endRequest=function(t){return this.xhr?(this.notifyApplicationAfterRequestEnd(),null!=t&&t.call(this),this.destroy()):void 0},e.prototype.setProgress=function(t){var e;return this.progress=t,"function"==typeof(e=this.delegate).requestProgressed?e.requestProgressed(this.progress):void 0},e.prototype.destroy=function(){var t;return this.setProgress(1),"function"==typeof(t=this.delegate).requestFinished&&t.requestFinished(),this.delegate=null,this.xhr=null},e}()}.call(this),function(){var t=function(t,e){return function(){return t.apply(e,arguments)}};Turbolinks.ProgressBar=function(){function e(){this.trickle=t(this.trickle,this),this.stylesheetElement=this.createStylesheetElement(),this.progressElement=this.createProgressElement()}var n;return n=300,e.defaultCSS=".turbolinks-progress-bar {\n  position: fixed;\n  display: block;\n  top: 0;\n  left: 0;\n  height: 3px;\n  background: #0076ff;\n  z-index: 9999;\n  transition: width "+n+"ms ease-out, opacity "+n/2+"ms "+n/2+"ms ease-in;\n  transform: translate3d(0, 0, 0);\n}",e.prototype.show=function(){return this.visible?void 0:(this.visible=!0,this.installStylesheetElement(),this.installProgressElement(),this.startTrickling())},e.prototype.hide=function(){return this.visible&&!this.hiding?(this.hiding=!0,this.fadeProgressElement((t=this,function(){return t.uninstallProgressElement(),t.stopTrickling(),t.visible=!1,t.hiding=!1}))):void 0;var t},e.prototype.setValue=function(t){return this.value=t,this.refresh()},e.prototype.installStylesheetElement=function(){return document.head.insertBefore(this.stylesheetElement,document.head.firstChild)},e.prototype.installProgressElement=function(){return this.progressElement.style.width=0,this.progressElement.style.opacity=1,document.documentElement.insertBefore(this.progressElement,document.body),this.refresh()},e.prototype.fadeProgressElement=function(t){return this.progressElement.style.opacity=0,setTimeout(t,1.5*n)},e.prototype.uninstallProgressElement=function(){return this.progressElement.parentNode?document.documentElement.removeChild(this.progressElement):void 0},e.prototype.startTrickling=function(){return null!=this.trickleInterval?this.trickleInterval:this.trickleInterval=setInterval(this.trickle,n)},e.prototype.stopTrickling=function(){return clearInterval(this.trickleInterval),this.trickleInterval=null},e.prototype.trickle=function(){return this.setValue(this.value+Math.random()/100)},e.prototype.refresh=function(){return requestAnimationFrame((t=this,function(){return t.progressElement.style.width=10+90*t.value+"%"}));var t},e.prototype.createStylesheetElement=function(){var t;return(t=document.createElement("style")).type="text/css",t.textContent=this.constructor.defaultCSS,t},e.prototype.createProgressElement=function(){var t;return(t=document.createElement("div")).className="turbolinks-progress-bar",t},e}()}.call(this),function(){var t=function(t,e){return function(){return t.apply(e,arguments)}};Turbolinks.BrowserAdapter=function(){function e(e){this.controller=e,this.showProgressBar=t(this.showProgressBar,this),this.progressBar=new Turbolinks.ProgressBar}var n,o,r;return r=Turbolinks.HttpRequest,n=r.NETWORK_FAILURE,o=r.TIMEOUT_FAILURE,e.prototype.visitProposedToLocationWithAction=function(t,e){return this.controller.startVisitToLocationWithAction(t,e)},e.prototype.visitStarted=function(t){return t.issueRequest(),t.changeHistory(),t.loadCachedSnapshot()},e.prototype.visitRequestStarted=function(t){return this.progressBar.setValue(0),t.hasCachedSnapshot()||"restore"!==t.action?this.showProgressBarAfterDelay():this.showProgressBar()},e.prototype.visitRequestProgressed=function(t){return this.progressBar.setValue(t.progress)},e.prototype.visitRequestCompleted=function(t){return t.loadResponse()},e.prototype.visitRequestFailedWithStatusCode=function(t,e){switch(e){case n:case o:return this.reload();default:return t.loadResponse()}},e.prototype.visitRequestFinished=function(){return this.hideProgressBar()},e.prototype.visitCompleted=function(t){return t.followRedirect()},e.prototype.pageInvalidated=function(){return this.reload()},e.prototype.showProgressBarAfterDelay=function(){return this.progressBarTimeout=setTimeout(this.showProgressBar,this.controller.progressBarDelay)},e.prototype.showProgressBar=function(){return this.progressBar.show()},e.prototype.hideProgressBar=function(){return this.progressBar.hide(),clearTimeout(this.progressBarTimeout)},e.prototype.reload=function(){return window.location.reload()},e}()}.call(this),function(){var t=function(t,e){return function(){return t.apply(e,arguments)}};Turbolinks.History=function(){function e(e){this.delegate=e,this.onPageLoad=t(this.onPageLoad,this),this.onPopState=t(this.onPopState,this)}return e.prototype.start=function(){return this.started?void 0:(addEventListener("popstate",this.onPopState,!1),addEventListener("load",this.onPageLoad,!1),this.started=!0)},e.prototype.stop=function(){return this.started?(removeEventListener("popstate",this.onPopState,!1),removeEventListener("load",this.onPageLoad,!1),this.started=!1):void 0},e.prototype.push=function(t,e){return t=Turbolinks.Location.wrap(t),this.update("push",t,e)},e.prototype.replace=function(t,e){return t=Turbolinks.Location.wrap(t),this.update("replace",t,e)},e.prototype.onPopState=function(t){var e,n,o,r;return this.shouldHandlePopState()&&(r=null!=(n=t.state)?n.turbolinks:void 0)?(e=Turbolinks.Location.wrap(window.location),o=r.restorationIdentifier,this.delegate.historyPoppedToLocationWithRestorationIdentifier(e,o)):void 0},e.prototype.onPageLoad=function(){return Turbolinks.defer((t=this,function(){return t.pageLoaded=!0}));var t},e.prototype.shouldHandlePopState=function(){return this.pageIsLoaded()},e.prototype.pageIsLoaded=function(){return this.pageLoaded||"complete"===document.readyState},e.prototype.update=function(t,e,n){var o;return o={turbolinks:{restorationIdentifier:n}},history[t+"State"](o,null,e)},e}()}.call(this),function(){Turbolinks.Snapshot=function(){function t(t){var e,n;n=t.head,e=t.body,this.head=null!=n?n:document.createElement("head"),this.body=null!=e?e:document.createElement("body")}return t.wrap=function(t){return t instanceof this?t:this.fromHTML(t)},t.fromHTML=function(t){var e;return(e=document.createElement("html")).innerHTML=t,this.fromElement(e)},t.fromElement=function(t){return new this({head:t.querySelector("head"),body:t.querySelector("body")})},t.prototype.clone=function(){return new t({head:this.head.cloneNode(!0),body:this.body.cloneNode(!0)})},t.prototype.getRootLocation=function(){var t,e;return e=null!=(t=this.getSetting("root"))?t:"/",new Turbolinks.Location(e)},t.prototype.getCacheControlValue=function(){return this.getSetting("cache-control")},t.prototype.getElementForAnchor=function(t){try{return this.body.querySelector("[id='"+t+"'], a[name='"+t+"']")}catch(e){}},t.prototype.hasAnchor=function(t){return null!=this.getElementForAnchor(t)},t.prototype.isPreviewable=function(){return"no-preview"!==this.getCacheControlValue()},t.prototype.isCacheable=function(){return"no-cache"!==this.getCacheControlValue()},t.prototype.isVisitable=function(){return"reload"!==this.getSetting("visit-control")},t.prototype.getSetting=function(t){var e,n;return null!=(e=(n=this.head.querySelectorAll("meta[name='turbolinks-"+t+"']"))[n.length-1])?e.getAttribute("content"):void 0},t}()}.call(this),function(){var t=[].slice;Turbolinks.Renderer=function(){function e(){}var n;return e.render=function(){var e,n,o;return n=arguments[0],e=arguments[1],(o=function(t,e,n){n.prototype=t.prototype;var o=new n,r=t.apply(o,e);return Object(r)===r?r:o}(this,3<=arguments.length?t.call(arguments,2):[],function(){})).delegate=n,o.render(e),o},e.prototype.renderView=function(t){return this.delegate.viewWillRender(this.newBody),t(),this.delegate.viewRendered(this.newBody)},e.prototype.invalidateView=function(){return this.delegate.viewInvalidated()},e.prototype.createScriptElement=function(t){var e;return"false"===t.getAttribute("data-turbolinks-eval")?t:((e=document.createElement("script")).textContent=t.textContent,e.async=!1,n(e,t),e)},n=function(t,e){var n,o,r,i,s,a,l;for(a=[],n=0,o=(i=e.attributes).length;o>n;n++)r=(s=i[n]).name,l=s.value,a.push(t.setAttribute(r,l));return a},e}()}.call(this),function(){Turbolinks.HeadDetails=function(){function t(t){var e,n,i,s,a,l;for(this.element=t,this.elements={},i=0,a=(l=this.element.childNodes).length;a>i;i++)(n=l[i]).nodeType===Node.ELEMENT_NODE&&(s=n.outerHTML,(null!=(e=this.elements)[s]?e[s]:e[s]={type:r(n),tracked:o(n),elements:[]}).elements.push(n))}var e,n,o,r;return t.prototype.hasElementWithKey=function(t){return t in this.elements},t.prototype.getTrackedElementSignature=function(){var t;return function(){var e,n;for(t in n=[],e=this.elements)e[t].tracked&&n.push(t);return n}.call(this).join("")},t.prototype.getScriptElementsNotInDetails=function(t){return this.getElementsMatchingTypeNotInDetails("script",t)},t.prototype.getStylesheetElementsNotInDetails=function(t){return this.getElementsMatchingTypeNotInDetails("stylesheet",t)},t.prototype.getElementsMatchingTypeNotInDetails=function(t,e){var n,o,r,i,s,a;for(o in s=[],r=this.elements)a=(i=r[o]).type,n=i.elements,a!==t||e.hasElementWithKey(o)||s.push(n[0]);return s},t.prototype.getProvisionalElements=function(){var t,e,n,o,r,i,s;for(e in n=[],o=this.elements)s=(r=o[e]).type,i=r.tracked,t=r.elements,null!=s||i?t.length>1&&n.push.apply(n,t.slice(1)):n.push.apply(n,t);return n},r=function(t){return e(t)?"script":n(t)?"stylesheet":void 0},o=function(t){return"reload"===t.getAttribute("data-turbolinks-track")},e=function(t){return"script"===t.tagName.toLowerCase()},n=function(t){var e;return"style"===(e=t.tagName.toLowerCase())||"link"===e&&"stylesheet"===t.getAttribute("rel")},t}()}.call(this),function(){var t=function(t,n){function o(){this.constructor=t}for(var r in n)e.call(n,r)&&(t[r]=n[r]);return o.prototype=n.prototype,t.prototype=new o,t.__super__=n.prototype,t},e={}.hasOwnProperty;Turbolinks.SnapshotRenderer=function(e){function n(t,e,n){this.currentSnapshot=t,this.newSnapshot=e,this.isPreview=n,this.currentHeadDetails=new Turbolinks.HeadDetails(this.currentSnapshot.head),this.newHeadDetails=new Turbolinks.HeadDetails(this.newSnapshot.head),this.newBody=this.newSnapshot.body}return t(n,e),n.prototype.render=function(t){return this.shouldRender()?(this.mergeHead(),this.renderView((e=this,function(){return e.replaceBody(),e.isPreview||e.focusFirstAutofocusableElement(),t()}))):this.invalidateView();var e},n.prototype.mergeHead=function(){return this.copyNewHeadStylesheetElements(),this.copyNewHeadScriptElements(),this.removeCurrentHeadProvisionalElements(),this.copyNewHeadProvisionalElements()},n.prototype.replaceBody=function(){return this.activateBodyScriptElements(),this.importBodyPermanentElements(),this.assignNewBody()},n.prototype.shouldRender=function(){return this.newSnapshot.isVisitable()&&this.trackedElementsAreIdentical()},n.prototype.trackedElementsAreIdentical=function(){return this.currentHeadDetails.getTrackedElementSignature()===this.newHeadDetails.getTrackedElementSignature()},n.prototype.copyNewHeadStylesheetElements=function(){var t,e,n,o,r;for(r=[],e=0,n=(o=this.getNewHeadStylesheetElements()).length;n>e;e++)t=o[e],r.push(document.head.appendChild(t));return r},n.prototype.copyNewHeadScriptElements=function(){var t,e,n,o,r;for(r=[],e=0,n=(o=this.getNewHeadScriptElements()).length;n>e;e++)t=o[e],r.push(document.head.appendChild(this.createScriptElement(t)));return r},n.prototype.removeCurrentHeadProvisionalElements=function(){var t,e,n,o,r;for(r=[],e=0,n=(o=this.getCurrentHeadProvisionalElements()).length;n>e;e++)t=o[e],r.push(document.head.removeChild(t));return r},n.prototype.copyNewHeadProvisionalElements=function(){var t,e,n,o,r;for(r=[],e=0,n=(o=this.getNewHeadProvisionalElements()).length;n>e;e++)t=o[e],r.push(document.head.appendChild(t));return r},n.prototype.importBodyPermanentElements=function(){var t,e,n,o,r,i;for(i=[],e=0,n=(o=this.getNewBodyPermanentElements()).length;n>e;e++)r=o[e],(t=this.findCurrentBodyPermanentElement(r))?i.push(r.parentNode.replaceChild(t,r)):i.push(void 0);return i},n.prototype.activateBodyScriptElements=function(){var t,e,n,o,r,i;for(i=[],e=0,n=(o=this.getNewBodyScriptElements()).length;n>e;e++)r=o[e],t=this.createScriptElement(r),i.push(r.parentNode.replaceChild(t,r));return i},n.prototype.assignNewBody=function(){return document.body=this.newBody},n.prototype.focusFirstAutofocusableElement=function(){var t;return null!=(t=this.findFirstAutofocusableElement())?t.focus():void 0},n.prototype.getNewHeadStylesheetElements=function(){return this.newHeadDetails.getStylesheetElementsNotInDetails(this.currentHeadDetails)},n.prototype.getNewHeadScriptElements=function(){return this.newHeadDetails.getScriptElementsNotInDetails(this.currentHeadDetails)},n.prototype.getCurrentHeadProvisionalElements=function(){return this.currentHeadDetails.getProvisionalElements()},n.prototype.getNewHeadProvisionalElements=function(){return this.newHeadDetails.getProvisionalElements()},n.prototype.getNewBodyPermanentElements=function(){return this.newBody.querySelectorAll("[id][data-turbolinks-permanent]")},n.prototype.findCurrentBodyPermanentElement=function(t){return document.body.querySelector("#"+t.id+"[data-turbolinks-permanent]")},n.prototype.getNewBodyScriptElements=function(){return this.newBody.querySelectorAll("script")},n.prototype.findFirstAutofocusableElement=function(){return document.body.querySelector("[autofocus]")},n}(Turbolinks.Renderer)}.call(this),function(){var t=function(t,n){function o(){this.constructor=t}for(var r in n)e.call(n,r)&&(t[r]=n[r]);return o.prototype=n.prototype,t.prototype=new o,t.__super__=n.prototype,t},e={}.hasOwnProperty;Turbolinks.ErrorRenderer=function(e){function n(t){this.html=t}return t(n,e),n.prototype.render=function(t){return this.renderView((e=this,function(){return e.replaceDocumentHTML(),e.activateBodyScriptElements(),t()}));var e},n.prototype.replaceDocumentHTML=function(){
  return document.documentElement.innerHTML=this.html},n.prototype.activateBodyScriptElements=function(){var t,e,n,o,r,i;for(i=[],e=0,n=(o=this.getScriptElements()).length;n>e;e++)r=o[e],t=this.createScriptElement(r),i.push(r.parentNode.replaceChild(t,r));return i},n.prototype.getScriptElements=function(){return document.documentElement.querySelectorAll("script")},n}(Turbolinks.Renderer)}.call(this),function(){Turbolinks.View=function(){function t(t){this.delegate=t,this.element=document.documentElement}return t.prototype.getRootLocation=function(){return this.getSnapshot().getRootLocation()},t.prototype.getElementForAnchor=function(t){return this.getSnapshot().getElementForAnchor(t)},t.prototype.getSnapshot=function(){return Turbolinks.Snapshot.fromElement(this.element)},t.prototype.render=function(t,e){var n,o,r;return r=t.snapshot,n=t.error,o=t.isPreview,this.markAsPreview(o),null!=r?this.renderSnapshot(r,o,e):this.renderError(n,e)},t.prototype.markAsPreview=function(t){return t?this.element.setAttribute("data-turbolinks-preview",""):this.element.removeAttribute("data-turbolinks-preview")},t.prototype.renderSnapshot=function(t,e,n){return Turbolinks.SnapshotRenderer.render(this.delegate,n,this.getSnapshot(),Turbolinks.Snapshot.wrap(t),e)},t.prototype.renderError=function(t,e){return Turbolinks.ErrorRenderer.render(this.delegate,e,t)},t}()}.call(this),function(){var t=function(t,e){return function(){return t.apply(e,arguments)}};Turbolinks.ScrollManager=function(){function e(e){this.delegate=e,this.onScroll=t(this.onScroll,this),this.onScroll=Turbolinks.throttle(this.onScroll)}return e.prototype.start=function(){return this.started?void 0:(addEventListener("scroll",this.onScroll,!1),this.onScroll(),this.started=!0)},e.prototype.stop=function(){return this.started?(removeEventListener("scroll",this.onScroll,!1),this.started=!1):void 0},e.prototype.scrollToElement=function(t){return t.scrollIntoView()},e.prototype.scrollToPosition=function(t){var e,n;return e=t.x,n=t.y,window.scrollTo(e,n)},e.prototype.onScroll=function(){return this.updatePosition({x:window.pageXOffset,y:window.pageYOffset})},e.prototype.updatePosition=function(t){var e;return this.position=t,null!=(e=this.delegate)?e.scrollPositionChanged(this.position):void 0},e}()}.call(this),function(){Turbolinks.SnapshotCache=function(){function t(t){this.size=t,this.keys=[],this.snapshots={}}var e;return t.prototype.has=function(t){return e(t)in this.snapshots},t.prototype.get=function(t){var e;if(this.has(t))return e=this.read(t),this.touch(t),e},t.prototype.put=function(t,e){return this.write(t,e),this.touch(t),e},t.prototype.read=function(t){var n;return n=e(t),this.snapshots[n]},t.prototype.write=function(t,n){var o;return o=e(t),this.snapshots[o]=n},t.prototype.touch=function(t){var n,o;return o=e(t),(n=this.keys.indexOf(o))>-1&&this.keys.splice(n,1),this.keys.unshift(o),this.trim()},t.prototype.trim=function(){var t,e,n,o,r;for(r=[],t=0,n=(o=this.keys.splice(this.size)).length;n>t;t++)e=o[t],r.push(delete this.snapshots[e]);return r},e=function(t){return Turbolinks.Location.wrap(t).toCacheKey()},t}()}.call(this),function(){var t=function(t,e){return function(){return t.apply(e,arguments)}};Turbolinks.Visit=function(){function e(e,n,o){this.controller=e,this.action=o,this.performScroll=t(this.performScroll,this),this.identifier=Turbolinks.uuid(),this.location=Turbolinks.Location.wrap(n),this.adapter=this.controller.adapter,this.state="initialized",this.timingMetrics={}}var n;return e.prototype.start=function(){return"initialized"===this.state?(this.recordTimingMetric("visitStart"),this.state="started",this.adapter.visitStarted(this)):void 0},e.prototype.cancel=function(){var t;return"started"===this.state?(null!=(t=this.request)&&t.cancel(),this.cancelRender(),this.state="canceled"):void 0},e.prototype.complete=function(){var t;return"started"===this.state?(this.recordTimingMetric("visitEnd"),this.state="completed","function"==typeof(t=this.adapter).visitCompleted&&t.visitCompleted(this),this.controller.visitCompleted(this)):void 0},e.prototype.fail=function(){var t;return"started"===this.state?(this.state="failed","function"==typeof(t=this.adapter).visitFailed?t.visitFailed(this):void 0):void 0},e.prototype.changeHistory=function(){var t,e;return this.historyChanged?void 0:(t=this.location.isEqualTo(this.referrer)?"replace":this.action,e=n(t),this.controller[e](this.location,this.restorationIdentifier),this.historyChanged=!0)},e.prototype.issueRequest=function(){return this.shouldIssueRequest()&&null==this.request?(this.progress=0,this.request=new Turbolinks.HttpRequest(this,this.location,this.referrer),this.request.send()):void 0},e.prototype.getCachedSnapshot=function(){var t;return!(t=this.controller.getCachedSnapshotForLocation(this.location))||null!=this.location.anchor&&!t.hasAnchor(this.location.anchor)||"restore"!==this.action&&!t.isPreviewable()?void 0:t},e.prototype.hasCachedSnapshot=function(){return null!=this.getCachedSnapshot()},e.prototype.loadCachedSnapshot=function(){var t,e;return(e=this.getCachedSnapshot())?(t=this.shouldIssueRequest(),this.render(function(){var n;return this.cacheSnapshot(),this.controller.render({snapshot:e,isPreview:t},this.performScroll),"function"==typeof(n=this.adapter).visitRendered&&n.visitRendered(this),t?void 0:this.complete()})):void 0},e.prototype.loadResponse=function(){return null!=this.response?this.render(function(){var t,e;return this.cacheSnapshot(),this.request.failed?(this.controller.render({error:this.response},this.performScroll),"function"==typeof(t=this.adapter).visitRendered&&t.visitRendered(this),this.fail()):(this.controller.render({snapshot:this.response},this.performScroll),"function"==typeof(e=this.adapter).visitRendered&&e.visitRendered(this),this.complete())}):void 0},e.prototype.followRedirect=function(){return this.redirectedToLocation&&!this.followedRedirect?(this.location=this.redirectedToLocation,this.controller.replaceHistoryWithLocationAndRestorationIdentifier(this.redirectedToLocation,this.restorationIdentifier),this.followedRedirect=!0):void 0},e.prototype.requestStarted=function(){var t;return this.recordTimingMetric("requestStart"),"function"==typeof(t=this.adapter).visitRequestStarted?t.visitRequestStarted(this):void 0},e.prototype.requestProgressed=function(t){var e;return this.progress=t,"function"==typeof(e=this.adapter).visitRequestProgressed?e.visitRequestProgressed(this):void 0},e.prototype.requestCompletedWithResponse=function(t,e){return this.response=t,null!=e&&(this.redirectedToLocation=Turbolinks.Location.wrap(e)),this.adapter.visitRequestCompleted(this)},e.prototype.requestFailedWithStatusCode=function(t,e){return this.response=e,this.adapter.visitRequestFailedWithStatusCode(this,t)},e.prototype.requestFinished=function(){var t;return this.recordTimingMetric("requestEnd"),"function"==typeof(t=this.adapter).visitRequestFinished?t.visitRequestFinished(this):void 0},e.prototype.performScroll=function(){return this.scrolled?void 0:("restore"===this.action?this.scrollToRestoredPosition()||this.scrollToTop():this.scrollToAnchor()||this.scrollToTop(),this.scrolled=!0)},e.prototype.scrollToRestoredPosition=function(){var t,e;return null!=(t=null!=(e=this.restorationData)?e.scrollPosition:void 0)?(this.controller.scrollToPosition(t),!0):void 0},e.prototype.scrollToAnchor=function(){return null!=this.location.anchor?(this.controller.scrollToAnchor(this.location.anchor),!0):void 0},e.prototype.scrollToTop=function(){return this.controller.scrollToPosition({x:0,y:0})},e.prototype.recordTimingMetric=function(t){var e;return null!=(e=this.timingMetrics)[t]?e[t]:e[t]=(new Date).getTime()},e.prototype.getTimingMetrics=function(){return Turbolinks.copyObject(this.timingMetrics)},n=function(t){switch(t){case"replace":return"replaceHistoryWithLocationAndRestorationIdentifier";case"advance":case"restore":return"pushHistoryWithLocationAndRestorationIdentifier"}},e.prototype.shouldIssueRequest=function(){return"restore"!==this.action||!this.hasCachedSnapshot()},e.prototype.cacheSnapshot=function(){return this.snapshotCached?void 0:(this.controller.cacheSnapshot(),this.snapshotCached=!0)},e.prototype.render=function(t){return this.cancelRender(),this.frame=requestAnimationFrame((e=this,function(){return e.frame=null,t.call(e)}));var e},e.prototype.cancelRender=function(){return this.frame?cancelAnimationFrame(this.frame):void 0},e}()}.call(this),function(){var t=function(t,e){return function(){return t.apply(e,arguments)}};Turbolinks.Controller=function(){function e(){this.clickBubbled=t(this.clickBubbled,this),this.clickCaptured=t(this.clickCaptured,this),this.pageLoaded=t(this.pageLoaded,this),this.history=new Turbolinks.History(this),this.view=new Turbolinks.View(this),this.scrollManager=new Turbolinks.ScrollManager(this),this.restorationData={},this.clearCache(),this.setProgressBarDelay(500)}return e.prototype.start=function(){return Turbolinks.supported&&!this.started?(addEventListener("click",this.clickCaptured,!0),addEventListener("DOMContentLoaded",this.pageLoaded,!1),this.scrollManager.start(),this.startHistory(),this.started=!0,this.enabled=!0):void 0},e.prototype.disable=function(){return this.enabled=!1},e.prototype.stop=function(){return this.started?(removeEventListener("click",this.clickCaptured,!0),removeEventListener("DOMContentLoaded",this.pageLoaded,!1),this.scrollManager.stop(),this.stopHistory(),this.started=!1):void 0},e.prototype.clearCache=function(){return this.cache=new Turbolinks.SnapshotCache(10)},e.prototype.visit=function(t,e){var n,o;return null==e&&(e={}),t=Turbolinks.Location.wrap(t),this.applicationAllowsVisitingLocation(t)?this.locationIsVisitable(t)?(n=null!=(o=e.action)?o:"advance",this.adapter.visitProposedToLocationWithAction(t,n)):window.location=t:void 0},e.prototype.startVisitToLocationWithAction=function(t,e,n){var o;return Turbolinks.supported?(o=this.getRestorationDataForIdentifier(n),this.startVisit(t,e,{restorationData:o})):window.location=t},e.prototype.setProgressBarDelay=function(t){return this.progressBarDelay=t},e.prototype.startHistory=function(){return this.location=Turbolinks.Location.wrap(window.location),this.restorationIdentifier=Turbolinks.uuid(),this.history.start(),this.history.replace(this.location,this.restorationIdentifier)},e.prototype.stopHistory=function(){return this.history.stop()},e.prototype.pushHistoryWithLocationAndRestorationIdentifier=function(t,e){return this.restorationIdentifier=e,this.location=Turbolinks.Location.wrap(t),this.history.push(this.location,this.restorationIdentifier)},e.prototype.replaceHistoryWithLocationAndRestorationIdentifier=function(t,e){return this.restorationIdentifier=e,this.location=Turbolinks.Location.wrap(t),this.history.replace(this.location,this.restorationIdentifier)},e.prototype.historyPoppedToLocationWithRestorationIdentifier=function(t,e){var n;return this.restorationIdentifier=e,this.enabled?(n=this.getRestorationDataForIdentifier(this.restorationIdentifier),this.startVisit(t,"restore",{restorationIdentifier:this.restorationIdentifier,restorationData:n,historyChanged:!0}),this.location=Turbolinks.Location.wrap(t)):this.adapter.pageInvalidated()},e.prototype.getCachedSnapshotForLocation=function(t){var e;return(e=this.cache.get(t))?e.clone():void 0},e.prototype.shouldCacheSnapshot=function(){return this.view.getSnapshot().isCacheable()},e.prototype.cacheSnapshot=function(){var t;return this.shouldCacheSnapshot()?(this.notifyApplicationBeforeCachingSnapshot(),t=this.view.getSnapshot(),this.cache.put(this.lastRenderedLocation,t.clone())):void 0},e.prototype.scrollToAnchor=function(t){var e;return(e=this.view.getElementForAnchor(t))?this.scrollToElement(e):this.scrollToPosition({x:0,y:0})},e.prototype.scrollToElement=function(t){return this.scrollManager.scrollToElement(t)},e.prototype.scrollToPosition=function(t){return this.scrollManager.scrollToPosition(t)},e.prototype.scrollPositionChanged=function(t){return this.getCurrentRestorationData().scrollPosition=t},e.prototype.render=function(t,e){return this.view.render(t,e)},e.prototype.viewInvalidated=function(){return this.adapter.pageInvalidated()},e.prototype.viewWillRender=function(t){return this.notifyApplicationBeforeRender(t)},e.prototype.viewRendered=function(){return this.lastRenderedLocation=this.currentVisit.location,this.notifyApplicationAfterRender()},e.prototype.pageLoaded=function(){return this.lastRenderedLocation=this.location,this.notifyApplicationAfterPageLoad()},e.prototype.clickCaptured=function(){return removeEventListener("click",this.clickBubbled,!1),addEventListener("click",this.clickBubbled,!1)},e.prototype.clickBubbled=function(t){var e,n,o;return this.enabled&&this.clickEventIsSignificant(t)&&(n=this.getVisitableLinkForNode(t.target))&&(o=this.getVisitableLocationForLink(n))&&this.applicationAllowsFollowingLinkToLocation(n,o)?(t.preventDefault(),e=this.getActionForLink(n),this.visit(o,{action:e})):void 0},e.prototype.applicationAllowsFollowingLinkToLocation=function(t,e){return!this.notifyApplicationAfterClickingLinkToLocation(t,e).defaultPrevented},e.prototype.applicationAllowsVisitingLocation=function(t){return!this.notifyApplicationBeforeVisitingLocation(t).defaultPrevented},e.prototype.notifyApplicationAfterClickingLinkToLocation=function(t,e){return Turbolinks.dispatch("turbolinks:click",{target:t,data:{url:e.absoluteURL},cancelable:!0})},e.prototype.notifyApplicationBeforeVisitingLocation=function(t){return Turbolinks.dispatch("turbolinks:before-visit",{data:{url:t.absoluteURL},cancelable:!0})},e.prototype.notifyApplicationAfterVisitingLocation=function(t){return Turbolinks.dispatch("turbolinks:visit",{data:{url:t.absoluteURL}})},e.prototype.notifyApplicationBeforeCachingSnapshot=function(){return Turbolinks.dispatch("turbolinks:before-cache")},e.prototype.notifyApplicationBeforeRender=function(t){return Turbolinks.dispatch("turbolinks:before-render",{data:{newBody:t}})},e.prototype.notifyApplicationAfterRender=function(){return Turbolinks.dispatch("turbolinks:render")},e.prototype.notifyApplicationAfterPageLoad=function(t){return null==t&&(t={}),Turbolinks.dispatch("turbolinks:load",{data:{url:this.location.absoluteURL,timing:t}})},e.prototype.startVisit=function(t,e,n){var o;return null!=(o=this.currentVisit)&&o.cancel(),this.currentVisit=this.createVisit(t,e,n),this.currentVisit.start(),this.notifyApplicationAfterVisitingLocation(t)},e.prototype.createVisit=function(t,e,n){var o,r,i,s,a;return s=(r=null!=n?n:{}).restorationIdentifier,i=r.restorationData,o=r.historyChanged,(a=new Turbolinks.Visit(this,t,e)).restorationIdentifier=null!=s?s:Turbolinks.uuid(),a.restorationData=Turbolinks.copyObject(i),a.historyChanged=o,a.referrer=this.location,a},e.prototype.visitCompleted=function(t){return this.notifyApplicationAfterPageLoad(t.getTimingMetrics())},e.prototype.clickEventIsSignificant=function(t){return!(t.defaultPrevented||t.target.isContentEditable||t.which>1||t.altKey||t.ctrlKey||t.metaKey||t.shiftKey)},e.prototype.getVisitableLinkForNode=function(t){return this.nodeIsVisitable(t)?Turbolinks.closest(t,"a[href]:not([target]):not([download])"):void 0},e.prototype.getVisitableLocationForLink=function(t){var e;return e=new Turbolinks.Location(t.getAttribute("href")),this.locationIsVisitable(e)?e:void 0},e.prototype.getActionForLink=function(t){var e;return null!=(e=t.getAttribute("data-turbolinks-action"))?e:"advance"},e.prototype.nodeIsVisitable=function(t){var e;return!(e=Turbolinks.closest(t,"[data-turbolinks]"))||"false"!==e.getAttribute("data-turbolinks")},e.prototype.locationIsVisitable=function(t){return t.isPrefixedBy(this.view.getRootLocation())&&t.isHTML()},e.prototype.getCurrentRestorationData=function(){return this.getRestorationDataForIdentifier(this.restorationIdentifier)},e.prototype.getRestorationDataForIdentifier=function(t){var e;return null!=(e=this.restorationData)[t]?e[t]:e[t]={}},e}()}.call(this),function(){!function(){var t,e;if((t=e=document.currentScript)&&!e.hasAttribute("data-turbolinks-suppress-warning"))for(;t=t.parentNode;)if(t===document.body)return console.warn("You are loading Turbolinks from a <script> element inside the <body> element. This is probably not what you meant to do!\n\nLoad your application\u2019s JavaScript bundle inside the <head> element instead. <script> elements in <body> are evaluated with each page change.\n\nFor more information, see: https://github.com/turbolinks/turbolinks#working-with-script-elements\n\n\u2014\u2014\nSuppress this warning by adding a `data-turbolinks-suppress-warning` attribute to: %s",e.outerHTML)}()}.call(this),function(){var t,e,n;Turbolinks.start=function(){return e()?(null==Turbolinks.controller&&(Turbolinks.controller=t()),Turbolinks.controller.start()):void 0},e=function(){return null==window.Turbolinks&&(window.Turbolinks=Turbolinks),n()},t=function(){var t;return(t=new Turbolinks.Controller).adapter=new Turbolinks.BrowserAdapter(t),t},(n=function(){return window.Turbolinks===Turbolinks})()&&Turbolinks.start()}.call(this),function(){var t=this;(function(){(function(){var t=[].slice;this.ActionCable={INTERNAL:{message_types:{welcome:"welcome",ping:"ping",confirmation:"confirm_subscription",rejection:"reject_subscription"},default_mount_path:"/cable",protocols:["actioncable-v1-json","actioncable-unsupported"]},WebSocket:window.WebSocket,logger:window.console,createConsumer:function(t){var n;return null==t&&(t=null!=(n=this.getConfig("url"))?n:this.INTERNAL.default_mount_path),new e.Consumer(this.createWebSocketURL(t))},getConfig:function(t){var e;return null!=(e=document.head.querySelector("meta[name='action-cable-"+t+"']"))?e.getAttribute("content"):void 0},createWebSocketURL:function(t){var e;return t&&!/^wss?:/i.test(t)?((e=document.createElement("a")).href=t,e.href=e.href,e.protocol=e.protocol.replace("http","ws"),e.href):t},startDebugging:function(){return this.debugging=!0},stopDebugging:function(){return this.debugging=null},log:function(){var e,n;if(e=1<=arguments.length?t.call(arguments,0):[],this.debugging)return e.push(Date.now()),(n=this.logger).log.apply(n,["[ActionCable]"].concat(t.call(e)))}}}).call(this)}).call(t);var e=t.ActionCable;(function(){(function(){var t=function(t,e){return function(){return t.apply(e,arguments)}};e.ConnectionMonitor=function(){function n(e){this.connection=e,this.visibilityDidChange=t(this.visibilityDidChange,this),this.reconnectAttempts=0}var o,r,i;return n.pollInterval={min:3,max:30},n.staleThreshold=6,n.prototype.start=function(){if(!this.isRunning())return this.startedAt=r(),delete this.stoppedAt,this.startPolling(),document.addEventListener("visibilitychange",this.visibilityDidChange),e.log("ConnectionMonitor started. pollInterval = "+this.getPollInterval()+" ms")},n.prototype.stop=function(){if(this.isRunning())return this.stoppedAt=r(),this.stopPolling(),document.removeEventListener("visibilitychange",this.visibilityDidChange),e.log("ConnectionMonitor stopped")},n.prototype.isRunning=function(){return null!=this.startedAt&&null==this.stoppedAt},n.prototype.recordPing=function(){return this.pingedAt=r()},n.prototype.recordConnect=function(){return this.reconnectAttempts=0,this.recordPing(),delete this.disconnectedAt,e.log("ConnectionMonitor recorded connect")},n.prototype.recordDisconnect=function(){return this.disconnectedAt=r(),e.log("ConnectionMonitor recorded disconnect")},n.prototype.startPolling=function(){return this.stopPolling(),this.poll()},n.prototype.stopPolling=function(){return clearTimeout(this.pollTimeout)},n.prototype.poll=function(){return this.pollTimeout=setTimeout((t=this,function(){return t.reconnectIfStale(),t.poll()}),this.getPollInterval());var t},n.prototype.getPollInterval=function(){var t,e,n,r;return n=(r=this.constructor.pollInterval).min,e=r.max,t=5*Math.log(this.reconnectAttempts+1),Math.round(1e3*o(t,n,e))},n.prototype.reconnectIfStale=function(){if(this.connectionIsStale())return e.log("ConnectionMonitor detected stale connection. reconnectAttempts = "+this.reconnectAttempts+", pollInterval = "+this.getPollInterval()+" ms, time disconnected = "+i(this.disconnectedAt)+" s, stale threshold = "+this.constructor.staleThreshold+" s"),this.reconnectAttempts++,this.disconnectedRecently()?e.log("ConnectionMonitor skipping reopening recent disconnect"):(e.log("ConnectionMonitor reopening"),this.connection.reopen())},n.prototype.connectionIsStale=function(){var t;return i(null!=(t=this.pingedAt)?t:this.startedAt)>this.constructor.staleThreshold},n.prototype.disconnectedRecently=function(){return this.disconnectedAt&&i(this.disconnectedAt)<this.constructor.staleThreshold},n.prototype.visibilityDidChange=function(){if("visible"===document.visibilityState)return setTimeout((t=this,function(){if(t.connectionIsStale()||!t.connection.isOpen())return e.log("ConnectionMonitor reopening stale connection on visibilitychange. visbilityState = "+document.visibilityState),t.connection.reopen()}),200);var t},r=function(){return(new Date).getTime()},i=function(t){return(r()-t)/1e3},o=function(t,e,n){return Math.max(e,Math.min(n,t))},n}()}).call(this),function(){var t,n,o,r,i,s=[].slice,a=function(t,e){return function(){return t.apply(e,arguments)}},l=[].indexOf||function(t){for(var e=0,n=this.length;e<n;e++)if(e in this&&this[e]===t)return e;return-1};r=e.INTERNAL,n=r.message_types,o=r.protocols,i=2<=o.length?s.call(o,0,t=o.length-1):(t=0,[]),o[t++],e.Connection=function(){function t(t){this.consumer=t,this.open=a(this.open,this),this.subscriptions=this.consumer.subscriptions,this.monitor=new e.ConnectionMonitor(this),this.disconnected=!0}return t.reopenDelay=500,t.prototype.send=function(t){return!!this.isOpen()&&(this.webSocket.send(JSON.stringify(t)),!0)},t.prototype.open=function(){return this.isActive()?(e.log("Attempted to open WebSocket, but existing socket is "+this.getState()),!1):(e.log("Opening WebSocket, current state is "+this.getState()+", subprotocols: "+o),null!=this.webSocket&&this.uninstallEventHandlers(),this.webSocket=new e.WebSocket(this.consumer.url,o),this.installEventHandlers(),this.monitor.start(),!0)},t.prototype.close=function(t){var e;if((null!=t?t:{allowReconnect:!0}).allowReconnect||this.monitor.stop(),this.isActive())return null!=(e=this.webSocket)?e.close():void 0},t.prototype.reopen=function(){var t;if(e.log("Reopening WebSocket, current state is "+this.getState()),!this.isActive())return this.open();try{return this.close()}catch(n){return t=n,e.log("Failed to reopen WebSocket",t)}finally{e.log("Reopening WebSocket in "+this.constructor.reopenDelay+"ms"),setTimeout(this.open,this.constructor.reopenDelay)}},t.prototype.getProtocol=function(){var t;return null!=(t=this.webSocket)?t.protocol:void 0},t.prototype.isOpen=function(){return this.isState("open")},t.prototype.isActive=function(){return this.isState("open","connecting")},t.prototype.isProtocolSupported=function(){var t;return t=this.getProtocol(),l.call(i,t)>=0},t.prototype.isState=function(){var t,e;return e=1<=arguments.length?s.call(arguments,0):[],t=this.getState(),l.call(e,t)>=0},t.prototype.getState=function(){var t,e;for(e in WebSocket)if(WebSocket[e]===(null!=(t=this.webSocket)?t.readyState:void 0))return e.toLowerCase();return null},t.prototype.installEventHandlers=function(){var t,e;for(t in this.events)e=this.events[t].bind(this),this.webSocket["on"+t]=e},t.prototype.uninstallEventHandlers=function(){var t;for(t in this.events)this.webSocket["on"+t]=function(){}},t.prototype.events={message:function(t){var e,o,r;if(this.isProtocolSupported())switch(e=(r=JSON.parse(t.data)).identifier,o=r.message,r.type){case n.welcome:return this.monitor.recordConnect(),this.subscriptions.reload();case n.ping:return this.monitor.recordPing();case n.confirmation:return this.subscriptions.notify(e,"connected");case n.rejection:return this.subscriptions.reject(e);default:return this.subscriptions.notify(e,"received",o)}},open:function(){if(e.log("WebSocket onopen event, using '"+this.getProtocol()+"' subprotocol"),this.disconnected=!1,!this.isProtocolSupported())return e.log("Protocol is unsupported. Stopping monitor and disconnecting."),this.close({allowReconnect:!1})},close:function(){if(e.log("WebSocket onclose event"),!this.disconnected)return this.disconnected=!0,this.monitor.recordDisconnect(),this.subscriptions.notifyAll("disconnected",{willAttemptReconnect:this.monitor.isRunning()})},error:function(){return e.log("WebSocket onerror event")}},t}()}.call(this),function(){var t=[].slice;e.Subscriptions=function(){function n(t){this.consumer=t,this.subscriptions=[]}return n.prototype.create=function(t,n){var o,r,i;return r="object"==typeof(o=t)?o:{channel:o},i=new e.Subscription(this.consumer,r,n),this.add(i)},n.prototype.add=function(t){return this.subscriptions.push(t),this.consumer.ensureActiveConnection(),this.notify(t,"initialized"),this.sendCommand(t,"subscribe"),t},n.prototype.remove=function(t){return this.forget(t),this.findAll(t.identifier).length||this.sendCommand(t,"unsubscribe"),t},n.prototype.reject=function(t){var e,n,o,r,i;for(r=[],e=0,n=(o=this.findAll(t)).length;e<n;e++)i=o[e],this.forget(i),this.notify(i,"rejected"),r.push(i);return r},n.prototype.forget=function(t){var e;return this.subscriptions=function(){var n,o,r,i;for(i=[],n=0,o=(r=this.subscriptions).length;n<o;n++)(e=r[n])!==t&&i.push(e);return i}.call(this),t},n.prototype.findAll=function(t){var e,n,o,r,i;for(r=[],e=0,n=(o=this.subscriptions).length;e<n;e++)(i=o[e]).identifier===t&&r.push(i);return r},n.prototype.reload=function(){var t,e,n,o,r;for(o=[],t=0,e=(n=this.subscriptions).length;t<e;t++)r=n[t],o.push(this.sendCommand(r,"subscribe"));return o},n.prototype.notifyAll=function(){var e,n,o,r,i,s,a;for(n=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],s=[],o=0,r=(i=this.subscriptions).length;o<r;o++)a=i[o],s.push(this.notify.apply(this,[a,n].concat(t.call(e))));return s},n.prototype.notify=function(){var e,n,o,r,i,s,a;for(s=arguments[0],n=arguments[1],e=3<=arguments.length?t.call(arguments,2):[],i=[],o=0,r=(a="string"==typeof s?this.findAll(s):[s]).length;o<r;o++)s=a[o],i.push("function"==typeof s[n]?s[n].apply(s,e):void 0);return i},n.prototype.sendCommand=function(t,e){var n;return n=t.identifier,this.consumer.send({command:e,identifier:n})},n}()}.call(this),function(){e.Subscription=function(){function t(t,n,o){this.consumer=t,null==n&&(n={}),this.identifier=JSON.stringify(n),e(this,o)}var e;return t.prototype.perform=function(t,e){return null==e&&(e={}),e.action=t,this.send(e)},t.prototype.send=function(t){return this.consumer.send({command:"message",identifier:this.identifier,data:JSON.stringify(t)})},t.prototype.unsubscribe=function(){return this.consumer.subscriptions.remove(this)},e=function(t,e){var n,o;if(null!=e)for(n in e)o=e[n],t[n]=o;return t},t}()}.call(this),function(){e.Consumer=function(){function t(t){this.url=t,this.subscriptions=new e.Subscriptions(this),this.connection=new e.Connection(this)}return t.prototype.send=function(t){return this.connection.send(t)},t.prototype.connect=function(){return this.connection.open()},t.prototype.disconnect=function(){return this.connection.close({allowReconnect:!1})},t.prototype.ensureActiveConnection=function(){if(!this.connection.isActive())return this.connection.open()},t}()}.call(this)}).call(this),"object"==typeof module&&module.exports?module.exports=e:"function"==typeof define&&define.amd&&define(e)}.call(this),function(){this.App||(this.App={}),App.cable=ActionCable.createConsumer()}.call(this);