"use strict";(self["webpackChunk_zoom_client_email_desktop"]=self["webpackChunk_zoom_client_email_desktop"]||[]).push([[696],{23696:function(t,i,l){l.r(i),l.d(i,{default:function(){return p}});var e=function(){var t=this,i=t._self._c;return i("zm-dialog",{attrs:{title:t.$t("editor.editLink"),visible:t.visible,"show-close":!1,width:"600px","append-to-body":"","close-on-press-escape":!0,"aria-label":t.$t("editor.editLink")},on:{close:t.close}},[i("div",{staticClass:"link-input"},[i("zm-form",{attrs:{"label-width":"140px","label-position":"left"}},[i("zm-form-item",{attrs:{label:t.$t("editor.textToDisplay")}},[i("zm-input",{ref:"linkDisplayText",attrs:{"zm-ta":"editor-link-dialog-text-input",disabled:t.isInputTextDisabled,max:"maxlength",maxlength:"2048",label:t.$t("editor.textToDisplay")},on:{change:t.unsetSync},model:{value:t.linkDisplayText,callback:function(i){t.linkDisplayText=i},expression:"linkDisplayText"}})],1),i("zm-form-item",{attrs:{label:t.$t("editor.linkTo")}},[i("zm-input",{ref:"linkUrl",attrs:{maxlength:"2048",label:t.$t("editor.linkTo"),"zm-ta":"editor-link-dialog-url-input"},model:{value:t.linkUrl,callback:function(i){t.linkUrl=i},expression:"linkUrl"}})],1)],1)],1),i("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("zm-button",{attrs:{"zm-ta":"editor-link-dialog-cancel"},on:{click:t.onCancel}},[t._v(t._s(t.$t("operation.cancel")))]),i("zm-button",{attrs:{"zm-ta":"editor-link-dialog-confirm",type:"primary",disabled:!t.isLinkUrlValid},on:{click:t.onConfirm}},[t._v(" "+t._s(t.$t("operation.confirm"))+" ")])],1)])},n=[],s=(l(45794),l(77950),l(445)),o=s.Utils.ALLOWED_URI_REGEXP,a={name:"AddEditorLinkDialog",props:{text:{type:String,default:""},link:{type:String,default:""}},data:function(){return{linkDisplayText:"",linkUrl:"",visible:!1,isDisplayTextSyncToUrl:!1}},computed:{isInputTextDisabled:function(){return!this.text.trim().length},trimmedLowCaseLinkUrl:function(t){var i=t.linkUrl;return i.trim().toLowerCase()},isLinkUrlValid:function(t){var i=t.trimmedLowCaseLinkUrl;return!!i.length&&o.test(i)}},watch:{linkUrl:function(t){this.isDisplayTextSyncToUrl&&(this.linkDisplayText=t)}},methods:{open:function(){var t=this;this.visible=!0,this.$store.commit("setPreventBack",!0),this.$nextTick((function(){var i;(t.linkDisplayText=t.text.trim(),t.linkUrl=t.link,t.isDisplayTextSyncToUrl=!t.linkDisplayText,t.isInputTextDisabled)&&(null===(i=t.$refs.linkUrl)||void 0===i||i.focus())}))},close:function(){this.linkDisplayText="",this.linkUrl="",this.visible=!1,this.$store.commit("setPreventBack",!1)},unsetSync:function(){this.isDisplayTextSyncToUrl=!1},onCancel:function(){this.close(),this.$emit("cancel")},onConfirm:function(){if(!this.linkUrl.includes(":")){var t=this.linkUrl.split("://");this.linkUrl="http://".concat(t[2===t.length?1:0])}this.$emit("confirm",this.linkDisplayText!==this.text?this.linkDisplayText:"",this.linkUrl),this.close()}}},r=a,c=l(93483),k=(0,c.Z)(r,e,n,!1,null,null,null),p=k.exports}}]);