(function(){"use strict";RB.OAuthClientSecretView=Backbone.View.extend({events:{"click .copyable-text-input-link":"_onCopyClicked","click .regenerate-secret-button":"_onRegenerateClicked"},initialize(e){this._apiURL=e.apiURL},render(){return this._$input=this.$("input"),this._$regen=this.$(".regenerate-secret-button"),this},_onCopyClicked(e){e.preventDefault(),e.stopPropagation(),this._$input.focus().select(),document.execCommand("copy")},_onRegenerateClicked(e){e.preventDefault(),e.stopPropagation(),this._$regen.prop("disabled",!0),RB.apiCall({url:this._apiURL,method:"PUT",data:{regenerate_client_secret:1},success:e=>{this._$input.val(e.oauth_app.client_secret),this._$regen.prop("disabled",!1)},error:()=>{this._$regen.prop("disabled",!1)}})}})}).call(this);
