!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("stimulus")):"function"==typeof define&&define.amd?define(["exports","stimulus"],t):t((e||self).bulletTrain={},e.stimulus)}(this,function(e,t){function r(e){var t=(e.match(/^(?:\.\/)?(.+)(?:[_-]controller\..+?)$/)||[])[1];if(t)return t.replace(/_/g,"-").replace(/\//g,"--")}function n(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,i(e,t)}function i(e,t){return i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},i(e,t)}var o=function(e){function t(){return e.apply(this,arguments)||this}return n(t,e),t.prototype.copy=function(){this.inputTarget.value=this.sourceTarget.innerText,this.inputTarget.select(),document.execCommand("copy"),this.buttonTarget.innerHTML='<i id="copied" class="fas fa-check w-4 h-4 block text-green-600"></i>',setTimeout(function(){document.getElementById("copied").innerHTML='<i class="far fa-copy w-4 h-4 block text-gray-600"></i>'},1500)},t}(t.Controller);o.targets=["source","input","button"];var s=function(e){function t(){for(var t,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return(t=e.call.apply(e,[this].concat(n))||this).removeTrailingNewlines=function(e){e.element.innerHTML.match(/<br><\/div>$/)&&(e.element.innerHTML=e.element.innerHTML.slice(0,-10)+"</div>",t.removeTrailingNewlines(e))},t.removeTrailingWhitespace=function(e){e.element.innerHTML.match(/ <\/div>$/)?(e.element.innerHTML=e.element.innerHTML.slice(0,-12)+"</div>",t.removeTrailingWhitespace(e)):e.element.innerHTML.match(/ <\/div>$/)&&(e.element.innerHTML=e.element.innerHTML.slice(0,-13)+"</div>",t.removeTrailingWhitespace(e))},t}n(t,e);var r=t.prototype;return r.resetOnSuccess=function(e){e.detail.success&&e.target.reset()},r.stripTrix=function(){var e=this;this.trixFieldTargets.forEach(function(t){e.removeTrailingNewlines(t.editor),e.removeTrailingWhitespace(t.editor),t.parentElement.querySelector("input").value=t.innerHTML})},r.submitOnReturn=function(e){if((e.metaKey||e.ctrlKey)&&13==e.keyCode){e.preventDefault();var t=e.target.closest("form");this.submitForm(t)}},r.submitForm=function(e){e.requestSubmit?e.requestSubmit():e.querySelector("[type=submit]").click()},t}(t.Controller);s.targets=["trixField","scroll"];var a=function(e){function t(){return e.apply(this,arguments)||this}n(t,e);var r,i,o=t.prototype;return o.toggle=function(){var e=this.isWrapperHidden?this.showEventNameValue:this.hideEventNameValue;this.isWrapperHidden&&this.showWrapper(),this.wrapperTarget.dispatchEvent(new CustomEvent(e))},o.showWrapper=function(){this.wrapperTarget.classList.remove(this.hiddenClass)},o.hideWrapper=function(){this.wrapperTarget.classList.add(this.hiddenClass)},r=t,(i=[{key:"isWrapperHidden",get:function(){return this.wrapperTarget.classList.contains(this.hiddenClass)}}])&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(r.prototype,i),Object.defineProperty(r,"prototype",{writable:!1}),t}(t.Controller);a.targets=["wrapper"],a.classes=["hidden"],a.values={showEventName:String,hideEventName:String};var l=[[o,"clipboard_controller.js"],[s,"form_controller.js"],[a,"mobile_menu_controller.js"]].map(function(e){var t=e[0];return{identifier:r(e[1]),controllerConstructor:t}});document.addEventListener("turbo:load",function(){navigator.userAgent.toLocaleLowerCase().includes("electron")&&document.body.classList.add("electron")}),e.controllerDefinitions=l}); //# sourceMappingURL=bullet-train.umd.js.map