Turbo.StreamActions.redirect=function(){setTimeout((()=>{Turbo.visit(this.target)}),500)},Turbo.StreamActions.close=function(){document.getElementById(this.target).close()},Turbo.StreamActions.closeAdminDialog=function(){window.parent.dialog.close()},Turbo.StreamActions.replaceInParentWindow=function(){parent.window.document.getElementById(this.target).replaceWith(this.templateContent)},Turbo.StreamActions.removeInParentWindow=function(){parent.window.document.getElementById(this.target).remove()},Turbo.StreamActions.beforeInParentWindow=function(){const t=parent.window.document.getElementById(this.target);t.parentElement.insertBefore(this.templateContent,t)},Turbo.StreamActions.appendInParentWindow=function(){parent.window.document.getElementById(this.target).append(this.templateContent)},Turbo.StreamActions.updateBadge=function(){document.getElementById(this.getAttribute("id")).setAttribute("value",this.getAttribute("value"))},Turbo.setConfirmMethod(((t,e)=>{let n=window.Stimulus.getControllerForElementAndIdentifier(document.getElementById("confirmation-dialog"),"confirmation");n.updateMessage(t);const o=e.getAttribute("data-turbo-confirm-title")||I18n.t("words.sure?"),r=e.getAttribute("data-turbo-confirm-ok-button")||I18n.t("words.ok"),i=e.getAttribute("data-turbo-confirm-value");return i?n.showConfirmInput():n.hideConfirmInput(),n.updateTitle(o),n.updateOkButton(r),n.ok=()=>{n.checkConfirmValue(i)?(n.element.returnValue="confirm",n.close()):n.element.returnValue=""},n.show(),new Promise((t=>{n.element.addEventListener("close",(()=>{t("confirm"===n.element.returnValue)}),{once:!0})}))}));