/* Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ !function(){function e(){var e=this.getDialog(),t=e._.editor,i=t.config.linkPhoneRegExp,l=t.config.linkPhoneMsg,t=CKEDITOR.dialog.validate.notEmpty(t.lang.link.noTel).apply(this);return e.getContentElement("info","linkType")&&"tel"==e.getValueOf("info","linkType")?!0!==t?t:i?CKEDITOR.dialog.validate.regex(i,l).call(this):void 0:!0}CKEDITOR.dialog.add("link",function(t){function i(e,t){var i=e.createRange();return i.setStartBefore(t),i.setEndAfter(t),i}var l,n,a=CKEDITOR.plugins.link,o=function(){var e=this.getDialog(),i=e.getContentElement("target","popupFeatures"),e=e.getContentElement("target","linkTargetName"),l=this.getValue();if(i&&e)switch(i=i.getElement(),i.hide(),e.setValue(""),l){case"frame":e.setLabel(t.lang.link.targetFrameName),e.getElement().show();break;case"popup":i.show(),e.setLabel(t.lang.link.targetPopupName),e.getElement().show();break;default:e.setValue(l),e.getElement().hide()}},s=function(e){e.target&&this.setValue(e.target[this.id]||"")},d=function(e){e.advanced&&this.setValue(e.advanced[this.id]||"")},r=function(e){e.target||(e.target={}),e.target[this.id]=this.getValue()||""},h=function(e){e.advanced||(e.advanced={}),e.advanced[this.id]=this.getValue()||""},u=t.lang.common,p=t.lang.link;return{title:p.title,minWidth:"moono-lisa"==(CKEDITOR.skinName||t.config.skin)?450:350,minHeight:240,getModel:function(e){return a.getSelectedLink(e,!0)[0]||null},contents:[{id:"info",label:p.info,title:p.info,elements:[{type:"text",id:"linkDisplayText",label:p.displayText,setup:function(){this.enable(),this.setValue(t.getSelection().getSelectedText()),l=this.getValue()},commit:function(e){e.linkText=this.isEnabled()?this.getValue():""}},{id:"linkType",type:"select",label:p.type,"default":"url",items:[[p.toUrl,"url"],[p.toAnchor,"anchor"],[p.toEmail,"email"],[p.toPhone,"tel"]],onChange:function(){var e=this.getDialog(),i=["urlOptions","anchorOptions","emailOptions","telOptions"],l=this.getValue(),n=e.definition.getContents("upload"),n=n&&n.hidden;for("url"==l?(t.config.linkShowTargetTab&&e.showPage("target"),n||e.showPage("upload")):(e.hidePage("target"),n||e.hidePage("upload")),n=0;n'+CKEDITOR.tools.htmlEncode(p.noAnchors)+"",focus:!0,setup:function(){this.getElement()[n&&n.length?"hide":"show"]()}}],setup:function(){this.getDialog().getContentElement("info","linkType")||this.getElement().hide()}},{type:"vbox",id:"emailOptions",padding:1,children:[{type:"text",id:"emailAddress",label:p.emailAddress,required:!0,validate:function(){var e=this.getDialog();return e.getContentElement("info","linkType")&&"email"==e.getValueOf("info","linkType")?CKEDITOR.dialog.validate.notEmpty(p.noEmail).apply(this):!0},setup:function(e){e.email&&this.setValue(e.email.address),(e=this.getDialog().getContentElement("info","linkType"))&&"email"==e.getValue()&&this.select()},commit:function(e){e.email||(e.email={}),e.email.address=this.getValue()}},{type:"text",id:"emailSubject",label:p.emailSubject,setup:function(e){e.email&&this.setValue(e.email.subject)},commit:function(e){e.email||(e.email={}),e.email.subject=this.getValue()}},{type:"textarea",id:"emailBody",label:p.emailBody,rows:3,"default":"",setup:function(e){e.email&&this.setValue(e.email.body)},commit:function(e){e.email||(e.email={}),e.email.body=this.getValue()}}],setup:function(){this.getDialog().getContentElement("info","linkType")||this.getElement().hide()}},{type:"vbox",id:"telOptions",padding:1,children:[{type:"tel",id:"telNumber",label:p.phoneNumber,required:!0,validate:e,setup:function(e){e.tel&&this.setValue(e.tel),(e=this.getDialog().getContentElement("info","linkType"))&&"tel"==e.getValue()&&this.select()},commit:function(e){e.tel=this.getValue()}}],setup:function(){this.getDialog().getContentElement("info","linkType")||this.getElement().hide()}}]},{id:"target",requiredContent:"a[target]",label:p.target,title:p.target,elements:[{type:"hbox",widths:["50%","50%"],children:[{type:"select",id:"linkTargetType",label:u.target,"default":"notSet",style:"width : 100%;",items:[[u.notSet,"notSet"],[p.targetFrame,"frame"],[p.targetPopup,"popup"],[u.targetNew,"_blank"],[u.targetTop,"_top"],[u.targetSelf,"_self"],[u.targetParent,"_parent"]],onChange:o,setup:function(e){e.target&&this.setValue(e.target.type||"notSet"),o.call(this)},commit:function(e){e.target||(e.target={}),e.target.type=this.getValue()}},{type:"text",id:"linkTargetName",label:p.targetFrameName,"default":"",setup:function(e){e.target&&this.setValue(e.target.name)},commit:function(e){e.target||(e.target={}),e.target.name=this.getValue().replace(/([^\x00-\x7F]|\s)/gi,"")}}]},{type:"vbox",width:"100%",align:"center",padding:2,id:"popupFeatures",children:[{type:"fieldset",label:p.popupFeatures,children:[{type:"hbox",children:[{type:"checkbox",id:"resizable",label:p.popupResizable,setup:s,commit:r},{type:"checkbox",id:"status",label:p.popupStatusBar,setup:s,commit:r}]},{type:"hbox",children:[{type:"checkbox",id:"location",label:p.popupLocationBar,setup:s,commit:r},{type:"checkbox",id:"toolbar",label:p.popupToolbar,setup:s,commit:r}]},{type:"hbox",children:[{type:"checkbox",id:"menubar",label:p.popupMenuBar,setup:s,commit:r},{type:"checkbox",id:"fullscreen",label:p.popupFullScreen,setup:s,commit:r}]},{type:"hbox",children:[{type:"checkbox",id:"scrollbars",label:p.popupScrollBars,setup:s,commit:r},{type:"checkbox",id:"dependent",label:p.popupDependent,setup:s,commit:r}]},{type:"hbox",children:[{type:"text",widths:["50%","50%"],labelLayout:"horizontal",label:u.width,id:"width",setup:s,commit:r},{type:"text",labelLayout:"horizontal",widths:["50%","50%"],label:p.popupLeft,id:"left",setup:s,commit:r}]},{type:"hbox",children:[{type:"text",labelLayout:"horizontal",widths:["50%","50%"],label:u.height,id:"height",setup:s,commit:r},{type:"text",labelLayout:"horizontal",label:p.popupTop,widths:["50%","50%"],id:"top",setup:s,commit:r}]}]}]}]},{id:"upload",label:p.upload,title:p.upload,hidden:!0,filebrowser:"uploadButton",elements:[{type:"file",id:"upload",label:u.upload,style:"height:40px",size:29},{type:"fileButton",id:"uploadButton",label:u.uploadSubmit,filebrowser:"info:url","for":["upload","upload"]}]},{id:"advanced",label:p.advanced,title:p.advanced,elements:[{type:"vbox",padding:1,children:[{type:"hbox",widths:["45%","35%","20%"],children:[{type:"text",id:"advId",requiredContent:"a[id]",label:p.id,setup:d,commit:h},{type:"select",id:"advLangDir",requiredContent:"a[dir]",label:p.langDir,"default":"",style:"width:110px",items:[[u.notSet,""],[p.langDirLTR,"ltr"],[p.langDirRTL,"rtl"]],setup:d,commit:h},{type:"text",id:"advAccessKey",requiredContent:"a[accesskey]",width:"80px",label:p.acccessKey,maxLength:1,setup:d,commit:h}]},{type:"hbox",widths:["45%","35%","20%"],children:[{type:"text",label:p.name,id:"advName",requiredContent:"a[name]",setup:d,commit:h},{type:"text",label:p.langCode,id:"advLangCode",requiredContent:"a[lang]",width:"110px","default":"",setup:d,commit:h},{type:"text",label:p.tabIndex,id:"advTabIndex",requiredContent:"a[tabindex]",width:"80px",maxLength:5,setup:d,commit:h}]}]},{type:"vbox",padding:1,children:[{type:"hbox",widths:["45%","55%"],children:[{type:"text",label:p.advisoryTitle,requiredContent:"a[title]","default":"",id:"advTitle",setup:d,commit:h},{type:"text",label:p.advisoryContentType,requiredContent:"a[type]","default":"",id:"advContentType",setup:d,commit:h}]},{type:"hbox",widths:["45%","55%"],children:[{type:"text",label:p.cssClasses,requiredContent:"a(cke-xyz)","default":"",id:"advCSSClasses",setup:d,commit:h},{type:"text",label:p.charset,requiredContent:"a[charset]","default":"",id:"advCharset",setup:d,commit:h}]},{type:"hbox",widths:["45%","55%"],children:[{type:"text",label:p.rel,requiredContent:"a[rel]","default":"",id:"advRel",setup:d,commit:h},{type:"text",label:p.styles,requiredContent:"a{cke-xyz}","default":"",id:"advStyles",validate:CKEDITOR.dialog.validate.inlineStyle(t.lang.common.invalidInlineStyle),setup:d,commit:h}]},{type:"hbox",widths:["45%","55%"],children:[{type:"checkbox",id:"download",requiredContent:"a[download]",label:p.download,setup:function(e){void 0!==e.download&&this.setValue("checked","checked")},commit:function(e){this.getValue()&&(e.download=this.getValue())}}]}]}]}],onShow:function(){var e=this.getParentEditor(),t=e.getSelection(),i=this.getContentElement("info","linkDisplayText").getElement().getParent().getParent(),l=a.getSelectedLink(e,!0),n=l[0]||null;n&&n.hasAttribute("href")&&(t.getSelectedElement()||t.isInTable()||t.selectElement(n)),t=a.parseLinkAttributes(e,n),1>=l.length&&a.showDisplayTextForElement(n,e)?i.show():i.hide(),this._.selectedElements=l,this.setupContent(t)},onOk:function(){var e={};if(this.commitContent(e),this._.selectedElements.length){var n,o,s,d,r,h,u=this._.selectedElements,p=a.getLinkAttributes(t,e),c=[];for(h=0;h