NEW_CKEDITOR.plugins.add("div",{requires:"dialog",lang:"af,ar,az,bg,bn,bs,ca,cs,cy,da,de,de-ch,el,en,en-au,en-ca,en-gb,eo,es,es-mx,et,eu,fa,fi,fo,fr,fr-ca,gl,gu,he,hi,hr,hu,id,is,it,ja,ka,km,ko,ku,lt,lv,mk,mn,ms,nb,nl,no,oc,pl,pt,pt-br,ro,ru,si,sk,sl,sq,sr,sr-latn,sv,th,tr,tt,ug,uk,vi,zh,zh-cn",icons:"creatediv",hidpi:!0,init:function(e){if(!e.blockless){var d=e.lang.div,i="div(*)";NEW_CKEDITOR.dialog.isTabEnabled(e,"editdiv","advanced")&&(i+=";div[dir,id,lang,title]{*}"),e.addCommand("creatediv",new NEW_CKEDITOR.dialogCommand("creatediv",{allowedContent:i,requiredContent:"div",contextSensitive:!0,contentTransformations:[["div: alignmentToStyle"]],refresh:function(e,d){this.setState("div"in(e.config.div_wrapTable?d.root:d.blockLimit).getDtd()?NEW_CKEDITOR.TRISTATE_OFF:NEW_CKEDITOR.TRISTATE_DISABLED)}})),e.addCommand("editdiv",new NEW_CKEDITOR.dialogCommand("editdiv",{requiredContent:"div"})),e.addCommand("removediv",{requiredContent:"div",exec:function(e){function d(d){(d=NEW_CKEDITOR.plugins.div.getSurroundDiv(e,d))&&!d.data("edi-div-added")&&(o.push(d),d.data("edi-div-added"))}for(var i,t=e.getSelection(),n=t&&t.getRanges(),a=t.createBookmarks(),o=[],r=0;r<n.length;r++)(i=n[r]).collapsed?d(t.getStartElement()):((i=new NEW_CKEDITOR.dom.walker(i)).evaluator=d,i.lastForward());for(r=0;r<o.length;r++)o[r].remove(!0);t.selectBookmarks(a)}}),e.ui.addButton&&e.ui.addButton("CreateDiv",{label:d.toolbar,command:"creatediv",toolbar:"blocks,50"}),e.addMenuItems&&(e.addMenuItems({editdiv:{label:d.edit,command:"editdiv",group:"div",order:1},removediv:{label:d.remove,command:"removediv",group:"div",order:5}}),e.contextMenu&&e.contextMenu.addListener((function(d){return!d||d.isReadOnly()?null:NEW_CKEDITOR.plugins.div.getSurroundDiv(e)?{editdiv:NEW_CKEDITOR.TRISTATE_OFF,removediv:NEW_CKEDITOR.TRISTATE_OFF}:null}))),NEW_CKEDITOR.dialog.add("creatediv",this.path+"dialogs/div.js"),NEW_CKEDITOR.dialog.add("editdiv",this.path+"dialogs/div.js")}}}),NEW_CKEDITOR.plugins.div={getSurroundDiv:function(e,d){var i=e.elementPath(d);return e.elementPath(i.blockLimit).contains((function(e){return e.is("div")&&!e.isReadOnly()}),1)}};