<?xml version='1.0' encoding='UTF-8'?><uidget><metadata><name>Menu</name><description>Display links to your website pages</description><help><![CDATA[
			The Menu Block adds links enabling your visitors to navigate through your website.&lt;br&gt; Each menu is configurable to 1) &lt;b&gt;list a subset of your pages&lt;/b&gt; and 2) &lt;b&gt;be displayed on a subset of your pages&lt;/b&gt;.&lt;br&gt; This allows you to use this block to create main menus and sub-menus.&lt;br&gt; The menu also allows you to &lt;b&gt;sort pages&lt;/b&gt;, update their &lt;b&gt;hierarchy&lt;/b&gt; and change their &lt;b&gt;names&lt;/b&gt;.&lt;br&gt; Each time you add a page, you can choose which menus will list it and which menus will be displayed on this page.&lt;br&gt; The presentation of the menu depends on the design you use for the site, on the orientation of the menu (&lt;b&gt;horizontal or vertical&lt;/b&gt;) and on the configured style (Main menu or Sub-menu).
		]]></help><api_version>1.0</api_version><size height='100' width='600' /><blog en='42' /></metadata><view><content></content><properties><trigger context_menu='Manage Pages' default_action='true' help='Configure the pages on the menu to make main menus or sub-menus.' icon='dupplicate' text='Manage Pages' trigger='manage' /><hidden default='[]' name='links' /><inputText default='""' help='Choose a name for this menu.&lt;br&gt;This will enable you to select it as a drop down menu of an image block for example.' name='name' placeholder='Type the name of the menu' title='Menu name' /><hidden default='&apos;all&apos;' name='show_mode' values='all|subpages|custom' /><hidden default='[]' name='pages_to_show_on' /></properties><design_properties><radio class='uim_style_prop' default='&apos;custom&apos;' display='Main|Sub-menu|Drop down|Custom style' help='Select the style for the menu.&lt;br&gt; &lt;b&gt;Main&lt;/b&gt; for a fully styled menu&lt;br&gt; &lt;b&gt;Submenu&lt;/b&gt; for a simple link list&lt;br&gt; &lt;b&gt;Drop down&lt;/b&gt; for a drop down menu&lt;br&gt; &lt;b&gt;Custom&lt;/b&gt; for a full custom menu' name='style' title='Style' values='main|submenu|drop-down|custom' /><radio default='&apos;horizontal&apos;' display='Vertical|Horizontal' help='Choose the orientation of the menu' name='position' title='Position' values='vertical|horizontal' /><align class='uim_prop_align' default='&apos;center&apos;' name='uim_align' title='Text align' with_justify='false' /><checkbox default='true' help='If checked, the menu will resize itself when new pages are added.' name='auto_size' value='AutoSize' /><checkbox class='uim_prop_custom uim_prop_label_nav' default='false' name='label_nav' value='No link for main pages with sub-menu' /><checkbox default='false' name='ignore_level' value='Ignore page level' /><trigger_view class='uim_prop_custom uim_prop_style' help='Several styles are available. Pick the one that best fits your website.' icon='palette' method='init_examples' text='Choose a style' trigger='manage_style' url='/cpt/menu_styles' /><slider class='uim_prop_custom uim_prop_border_weight' default='3' help='If the selected style has borders, this slider helps you customize their width.' maximum='10' minimum='0' name='border_weight' title='Border width' /><slider class='uim_prop_custom uim_prop_font_size' default='16' help='Customize the text size of this menu.' maximum='60' minimum='0' name='font_size' title='Font size' /><colors background='split|split|' class='uim_prop_custom uim_prop_custom_normal_colors' colspan='2|0|1' default='[&apos;load_defaults&apos;]' display='Text and background||Borders' elts='3' help='Depending on the selected style, your menu can use 1, 2 or 3 colors. These color-pickers help you customize standard page links (neither selected nor hovered).' name='normal_colors' title='Normal colors' /><colors background='split|split|' class='uim_prop_custom uim_prop_custom_hover_colors' colspan='2|0|1' default='[&apos;load_defaults&apos;]' display='Text and background||Borders' elts='3' help='Depending on the selected style, your menu can use 1, 2 or 3 colors. These color-pickers help you customize the page links when the mouse moves over them.' name='hover_colors' title='Hover colors' /><colors background='split|split|' class='uim_prop_custom uim_prop_custom_selected_colors' colspan='2|0|1' default='[&apos;load_defaults&apos;]' display='Text and background||Borders' elts='3' help='Depending on the selected style, your menu can use 1, 2 or 3 colors. These color-pickers help you customize the current selected page.' name='selected_colors' title='Selection colors' /><link class='uim_prop_custom uim_prop_custom_reset' default_action='true' display='Reset values' help='Cancel your customizations and reload the default style and colors from your original template.' icon='rotate-ccw3' name='reset' trigger='_reset_values' /></design_properties></view><script>UI_Menu={init:function(){sigCtl.connect(&quot;Theme.changed&quot;,function(){UI_Menu.cpts.each(function(a){a.ui._showProp()
})
})
},dropDownMenus:{},cpts:[],setAsDropDownMenu:function(a){dropDownMenus=this.dropDownMenus;
console.log(&quot;waitting menu name : &quot;,a);
sigCtl.getVariable(&quot;Menu.displayed-&quot;+a,function(b,d){console.log(&quot;Signal connect : &quot;,a);
if(dropDownMenus[a]){return
}dropDownMenus[a]=d;
if(dropDownMenus[a]){dropDownMenus[a]=dropDownMenus[a];
dropDownMenus[a].w=dropDownMenus[a].W();
dropDownMenus[a].h=dropDownMenus[a].H();
dropDownMenus[a].ui.showDropDownMenu(false);
dropDownMenus[a].node.hover(function(){},function(){if(!(window.blockSelector&amp;&amp;dropDownMenus[a]==blockSelector.selectedCpt())){dropDownMenus[a].ui.showDropDownMenu(false)
}})
}else{statusController.message(sprintf(&quot;The drop down menu &apos;%1$s&apos; does not exist.&quot;,a),&quot;error&quot;,20000,5)
}})
},hideAllDropDownMenu:function(){for(var a in this.dropDownMenus){this.dropDownMenus[a].ui.showDropDownMenu(false)
}},showDropDownMenu:function(a){this.hideAllDropDownMenu();
if(this.dropDownMenus[a]){this.dropDownMenus[a].ui.showDropDownMenu(true)
}}};
sigCtl.connect(&quot;Version.selectPageFg&quot;,function(){UI_Menu.hideAllDropDownMenu()
});
sigCtl.connect(&quot;Version.selectPageBg&quot;,function(){UI_Menu.hideAllDropDownMenu()
});
UI_List.UI_Menu={initialize:function(b){var a=this;
this.component=b;
UI_Menu.cpts.push(b);
this.sigCtl=new Signal(this);
b.setOptions([&quot;locked&quot;,&quot;fixed&quot;,&quot;footer&quot;,&quot;sticky&quot;]);
this.component.node.addClass(this.component.uniqId());
$.extend(this,menuDataManagement)
},getName:function(){return this.component.data.name||this.component.getName(true)
},loadDefault:function(){this.component.data.links=v.pages_fg.collect(function(a){return{pageid:a.pageid}
})
},create_page_list:function(){this.page_list=v.order_links(this.component.data.links)
},buildMenuULLI:function(n,g){var o=this;
var j=this.component.page.version;
if($(&quot;.accept_bg&quot;).length==0&amp;&amp;this.component.data.style==&quot;custom&quot;){this.component.data.style=&quot;main&quot;;
this.onPropertyChanged([&quot;style&quot;]);
if(j.mode==&quot;editor&quot;){return
}}if(n){var d=null;
var l=$(&quot;a&quot;,o.component.node);
this.component.node.find(&quot;li.selected&quot;).removeClass(&quot;selected&quot;);
if(g.anchorid){sigCtl.emit(&quot;Menu.selectAnchor&quot;,g)
}else{sigCtl.emit(&quot;Menu.selectPage&quot;,g)
}$(&quot;li&quot;,this.menu).each(function(){$(this).off(&quot;mouseenter mouseleave&quot;)
});
$(&quot;ul&quot;,this.menu).removeAttr(&quot;style&quot;).removeClass(&quot;ul_0 ul_1&quot;);
return
}var k=$(&quot;&lt;div class=&apos;uim_m1&apos;&gt;&lt;div class=&apos;uim_m2&apos;&gt;&lt;div class=&apos;uim_mc&apos;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&quot;).appendTo(this.menu.empty()).find(&quot;.uim_mc&quot;);
var a=k;
var e=-1;
this.create_page_list();
var m=this.page_list.length;
var c=0;
if(this.component.data.style==&quot;drop-down&quot;||this.component.data.style==&quot;custom&quot;){c=this.page_list.collect(function(p){return p.page.level+(p.anchorid?1:0)
}).min()
}if(this.page_list&amp;&amp;this.page_list.length&gt;0){this.level_is_ignored=this.component.data.ignore_level;
var b=this.page_list[0],h=(b.page)?b.page:j.page_bg;
var f=Math.max(h.level+(b.anchorid?1:0)-c,0);
if(f&gt;0){ignore_level=true
}}this.page_list.each(function(t){var w=(t.page)?t.page:j.page_bg;
var q=o.level_is_ignored?0:Math.max(w.level+(t.anchorid?1:0)-c,0);
if(t.pageid==&quot;page_bg&quot;){q=0
}if(e&lt;q){k=a;
for(var x=e;
x&lt;q;
x++){k=$(&quot;&lt;ul&gt;&lt;/ul&gt;&quot;).appendTo(k);
if(o.component.data.style==&quot;drop-down&quot;){k.addClass(&quot;ul_&quot;+((x+1)%2))
}}}else{for(var x=e;
x&gt;q;
x--){k=k.parent();
if(!k.is(&quot;ul&quot;)){k=k.parent()
}}}e=q;
var s=(!t.anchorid&amp;&amp;(w==j.selectedPageFg||(j.selectedPageFg&amp;&amp;w==j.selectedPageFg.parentPage())))?&quot;selected&quot;:&quot;&quot;;
s+=(k.parents(&quot;ul&quot;).length==0)?&quot; uim_dhv_li_first&quot;:&quot;&quot;;
a=$(&quot;&lt;li class=&apos;&quot;+s+&quot;&apos; style=&apos;z-index:&quot;+(m)+&quot;&apos;&gt;&lt;/li&gt;&quot;).appendTo(k);
$(a).data(&quot;pageid&quot;,w.pageid);
if(t.anchorid){$(a).data(&quot;anchorid&quot;,t.anchorid)
}var u=&quot;&lt;a href=&apos;&quot;+(j.mode==&quot;editor&quot;?&quot;javascript:void(0)&quot;:(w.pageid)?w.getUrl(true):j.selectedPageFg.getUrl(true))+&quot;&apos;&gt;&lt;/a&gt;&quot;;
if(o.component.data.style==&quot;custom&quot;){u=&quot;&lt;span class=uim_m&gt;&quot;+u+&quot;&lt;/span&gt;&quot;
}else{u=&quot;&lt;div class=uim_m&gt;&lt;div class=&apos;mtl&apos;&gt;&lt;/div&gt;&lt;div class=&apos;mt&apos;&gt;&lt;/div&gt;&lt;div class=&apos;mtr&apos;&gt;&lt;/div&gt;&lt;div class=&apos;ml&apos;&gt;&lt;/div&gt;&lt;div class=&apos;mr&apos;&gt;&lt;/div&gt;&lt;div class=&apos;mbl&apos;&gt;&lt;/div&gt;&lt;div class=&apos;mb&apos;&gt;&lt;/div&gt;&lt;div class=&apos;mbr&apos;&gt;&lt;/div&gt;&quot;+u+&quot;&lt;/div&gt;&quot;
}var r=function(y){return y.closest(&quot;li&quot;).hasClass(&quot;uim_dhv_li_first&quot;)&amp;&amp;y.closest(&quot;li&quot;).find(&quot;ul&quot;).length
};
var p=$(u).appendTo(a).find(&quot;a&quot;).text(t.anchorid?t.anchorid.replace(/&amp;#39;/g,&quot;&apos;&quot;):w.name).on(&quot;click&quot;,function(y){if(!o.component.data.label_nav||!r($(this))){if(y.which!=1||(y.ctrlKey||y.metaKey)){return true
}if(t.anchorid){o.onPageChange(true,t);
p.parents(&quot;li&quot;).addClass(&quot;selected&quot;);
j.selectAnchor((w.pageid)?w.pageid:&quot;page_bg&quot;,t.anchorid)
}else{if(j.selectedPageFg!=w){j.selectPageFg(w)
}j.scroll_to_top()
}}return false
}).on(&quot;mouseenter&quot;,function(){$(this).css(&quot;cursor&quot;,o.component.data.label_nav&amp;&amp;r($(this))?&quot;default&quot;:&quot;pointer&quot;)
});
$(&quot;li.uim_dhv_li_first&quot;,o.menu).off(&quot;mouseover mouseenter mouseout mouseleave&quot;).hover(function(z){var y=$(z.target);
setTimeout(function(){var A=$(y.find(&quot;ul&quot;).get(0));
if(A.length){var B=A.offset().top+A.height();
if(B&gt;$(&quot;#pages&quot;).height()){j.getSelectedPage().setHeight(B)
}}},20)
},function(){});
m-=1
});
if(this.component.data.style==&quot;drop-down&quot;){$(&quot;li&quot;,this.menu).stop().hover(function(){var p=$(this);
clearTimeout(p.data(&quot;timeout&quot;));
setTimeout(function(){p.find(&quot;ul:first&quot;).show()
},200)
},function(){var p=$(this);
p.data(&quot;timeout&quot;,setTimeout(function(){p.find(&quot;ul:first&quot;).hide()
},200))
});
if(this.component.data.position==&quot;horizontal&quot;){this.menu.find(&quot;.ul_0&quot;).css(&quot;white-space&quot;,&quot;nowrap&quot;)
}this.menu.find(&quot;.ul_0:first&quot;).show()
}else{if(this.component.data.style==&quot;custom&quot;&amp;&amp;j.mode==&quot;editor&quot;){this._parseCSS()
}}if(this.component.data.style==&quot;custom&quot;){this.autoSize()
}if(this.menu.find(&quot;.selected&quot;).length&gt;1){this.menu.find(&quot;.selected:first&quot;).removeClass(&quot;selected&quot;)
}setTimeout(function(){o.autoSize()
},0);
var i=$(&quot;.uim_dh, .uim_dv&quot;).find(&quot;.selected&quot;);
i.each(function(){var p=$(this).parents(&quot;.uim_dhv_li_first&quot;);
if(p.length!=0){p.find(&quot;.uim_m a:first&quot;).addClass(&quot;uim_a_selected&quot;)
}})
},onDisplay:function(b){var a=this;
this.menu=b;
this.drop_down_menu_shown=true;
this._load_default_values(!a.component.data.normal_colors||a.component.data.normal_colors[0]==&quot;load_defaults&quot;);
this.onPropertyChanged([&quot;links&quot;]);
if(this.component.data.name){sigCtl.emitVariable(&quot;Menu.displayed-&quot;+this.component.data.name,this.component)
}this.menuName=sprintf(&quot;Menu %1$d&quot;,this.component.component_type.getCounter()+1);
this.sigCtl.connect(&quot;Theme.changed&quot;,function(){a.refreshMenu()
});
this.sigCtl.connect(&quot;Version.setLevel&quot;,function(){a.refreshMenu()
});
this.order_to=null;
this.sigCtl.connect(&quot;Version.setOrder&quot;,function(){clearTimeout(a.order_to);
a.order_to=setTimeout(function(){a.page_list.sort(function(d,c){return d.page.order-c.page.order
});
a.refreshMenu()
},50)
});
this.sigCtl.connect(&quot;Version.selectPageFg&quot;,function(){a.onPageChange(a.component.data.style==&quot;custom&quot;,v.selectedPageFg?{pageid:v.selectedPageFg.pageid}:null)
});
this.sigCtl.connect(&quot;Version.selectPageBg&quot;,function(){a.onPageChange()
});
this.sigCtl.connect(&quot;Page.nameChanged&quot;,function(){a.refreshMenu()
});
this.sigCtl.connect(&quot;Version.rmPage&quot;,function(e,d){if(d){var c=a.component.data.links.indexOf(a.component.data.links.find(function(g){return g.pageid==d.pageid
}));
if(c&gt;-1){var f=Misc.deepCloneObj(a.component.data.links);
f.removeAt(c);
a.component.setData(&quot;links&quot;,f);
a.refreshMenu()
}}a.cleanupLinks()
});
this.sigCtl.connect(&quot;Page.rmAnchor&quot;,function(d,c){if(!c.anchorid){return
}a.removeLink(c)
});
this.sigCtl.connect(&quot;Menu.rnAnchor&quot;,function(f,d,e,c){a.renameLink(d,e,c)
});
this.sigCtl.connect(&quot;Menu.selectAnchor&quot;,function(e,d){var c=[];
$(a.menu).find(&quot;li&quot;).each(function(h,f){var g=!a.level_is_ignored&amp;&amp;$(f).closest(&quot;li&quot;).length&amp;&amp;$(f).data(&quot;pageid&quot;)!=&quot;&quot;;
if($(f).data(&quot;pageid&quot;)==d.pageid&amp;&amp;(g&amp;&amp;!$(f).data(&quot;anchorid&quot;)||$(f).data(&quot;anchorid&quot;)==d.anchorid)){c.push(f)
}});
$(a.menu).find(&quot;li.selected&quot;).removeClass(&quot;selected&quot;);
c.each(function(f){$(f).addClass(&quot;selected&quot;);
if(!a.level_is_ignored){$(f).parents(&quot;.uim_dhv_li_first&quot;).addClass(&quot;selected&quot;)
}})
});
this.sigCtl.connect(&quot;Menu.selectPage&quot;,function(f,e,d){var c=false;
$(a.menu).find(&quot;li&quot;).each(function(h,g){if($(g).data(&quot;pageid&quot;)==e.pageid&amp;&amp;!$(g).data(&quot;anchorid&quot;)){c=true;
$(g).addClass(&quot;selected&quot;);
if(!a.level_is_ignored){$(g).parents(&quot;.uim_dhv_li_first&quot;).addClass(&quot;selected&quot;)
}}else{if(!d){$(g).removeClass(&quot;selected&quot;)
}}})
})
},onShow:function(){this.onPageChange()
},onSelect:function(){if(v.mode==&quot;editor&quot;){this.onBeforeSaveData();
this._showProp()
}},onDeselect:function(){},onResizeStop:function(){this.component.w=this.component.W();
this.component.h=this.component.H();
if(this.component.data.style==&quot;custom&quot;){this.autoSize()
}},parent_page:function(d){d=d||this.component.data;
var a=d.links[0].pageid;
var b=null;
var c=0;
while(!b&amp;&amp;c&lt;v.pages_fg.length){if(v.pages_fg[c].pageid==a){b=c
}c++
}if(b&gt;0&amp;&amp;v.pages_fg[b-1].level&lt;v.pages_fg[b].level){return v.pages_fg[b-1]
}else{return null
}},onPageChange:function(a,b){if(this.shouldDisplayOnPage(v.getSelectedPage())){this.menu.parent().toggle(this.component.prop().v);
this.refreshMenu(a,b)
}else{this.menu.parent().hide()
}},onPropertyChanged:function(a){if(a.include(&quot;manage&quot;)){this.cleanupLinks();
pagePanel.menuManage(this);
this.refreshMenu()
}this.menu.removeClass(&quot;uim_mv uim_sv uim_mh uim_sh uim_dh uim_dv uim_cv uim_ch&quot;);
this.menu.removeClassMatch(/uim_p_\d/);
this.menu.addClass(&quot;uim_&quot;+this.component.data.style.substr(0,1)+this.component.data.position.substr(0,1));
if(this.component.data.style==&quot;custom&quot;&amp;&amp;this.component.data.custom_style!=undefined){this.menu.addClass(&quot;uim_p_&quot;+this.component.data.custom_style)
}if(a.include(&quot;style&quot;)&amp;&amp;this.component.data.style==&quot;custom&quot;&amp;&amp;v.mode==&quot;editor&quot;){this._load_default_values(!this.component.data.normal_colors||this.component.data.normal_colors[0]==&quot;load_defaults&quot;);
this._showProp()
}if(a.include(&quot;name&quot;)){sigCtl.emitVariable(&quot;Menu.displayed-&quot;+this.component.data.name,this.component)
}if(a.include(&quot;links&quot;)||a.include(&quot;style&quot;)||a.include(&quot;ignore_level&quot;)){this.buildMenuULLI()
}if(this.component.data.style==&quot;drop-down&quot;||this.component.data.style==&quot;custom&quot;){this.menu.css({overflow:&quot;visible&quot;,width:this.component.data.auto_size?&quot;auto&quot;:&quot;100%&quot;})
}else{this.menu.css({overflow:&quot;hidden&quot;,width:&quot;100%&quot;})
}if(a.include(&quot;border_weight&quot;)||a.include(&quot;font_size&quot;)||a.include(&quot;custom_style&quot;)||a.include(&quot;position&quot;)){this.autoSize()
}if(a.include(&quot;position&quot;)){$(&quot;.uim_prop_align&quot;).toggle(this.component.data.style==&quot;custom&quot;)
}if(!this.initializing_custom&amp;&amp;(a.include(&quot;font_size&quot;)||a.include(&quot;border_weight&quot;)||a.include(&quot;normal_colors&quot;)||a.include(&quot;hover_colors&quot;)||a.include(&quot;selected_colors&quot;)||a.include(&quot;uim_align&quot;))&amp;&amp;this.component.data.style==&quot;custom&quot;){this._parseCSS()
}},refreshMenu:function(a,b){this.buildMenuULLI(a,b)
},menuFullName:function(h){var g=[];
var c=this;
var d,b=false,f=false,a=[];
var e=this.component.page.version.pages_fg.each(function(i){if(c.shouldListPage(i)){g.push(i.name)
}});
if(this.component.data.show_mode==&quot;all&quot;){b=true,d=&quot;all the pages&quot;
}else{if(this.component.data.show_mode==&quot;subpages&quot;){b=true,d=&quot;listed and parent pages&quot;
}else{a=this.component.data.pages_to_show_on.collect(function(i){var j=v.getPageFromId(i);
return j?j.name:&quot;&quot;
})
}}var e=g.join(&quot;, &quot;);
if(!d){d=a.join(&quot;, &quot;)
}if(h&amp;&amp;e.length+d.length&gt;h){e=sprintf(&quot;%1$d links&quot;,g.length);
if(!b){d=sprintf(&quot;%1$d pages&quot;,a.length)
}}if(this.component.data.name&amp;&amp;this.component.data.name!=&quot;&quot;){return this.menuName+&quot; (&quot;+$(&quot;&lt;div&gt;&quot;).text(this.component.data.name).html()+&quot;)&quot;
}else{return sprintf(&quot;%s:&quot;,this.menuName)+sprintf(&quot; displays &lt;i&gt;%1$s&lt;/i&gt; on &lt;i&gt;%2$s&lt;/i&gt;.&quot;,$(&quot;&lt;div&gt;&quot;).text(e).html(),$(&quot;&lt;div&gt;&quot;).text(d).html())
}},menuType:&quot;menu&quot;,onRemove:function(){this.sigCtl.disconnect(&quot;Theme.changed&quot;);
this.sigCtl.disconnect(&quot;Version.setLevel&quot;);
this.sigCtl.disconnect(&quot;Version.setOrder&quot;);
this.sigCtl.disconnect(&quot;Version.selectPageFg&quot;);
this.sigCtl.disconnect(&quot;Version.selectPageBg&quot;);
this.sigCtl.disconnect(&quot;Page.nameChanged&quot;);
this.sigCtl.disconnect(&quot;Version.rmPage&quot;)
},onBeforeSaveData:function(){if(this.component.w&amp;&amp;this.component.h){this.component.setXYZWH({w:this.component.w,h:this.component.h},{send_events:false})
}if(!this.component.id){this.delete_style=this.component.uniqId()
}},onAfterSaveData:function(){if(this.size_before_save){this.component.setXYZWH({w:this.size_before_save.w,h:this.size_before_save.h},{send_events:false})
}},onSave:function(){this.component.node.addClass(this.component.uniqId());
if(this.delete_style){this._parseCSS();
this.component.node.removeClass(this.delete_style);
$(&quot;#style_uim_&quot;+this.delete_style).remove();
this.delete_style=null
}},showDropDownMenu:function(a){this.drop_down_menu_shown=a;
var b=this.component.node.add(this.component.node.children());
if(a){this.component.setXYZWH({w:this.component.w,h:this.component.h},{send_events:false});
b.css(&quot;visibility&quot;,&quot;visible&quot;)
}else{this.component.setXYZWH({w:1,h:1},{send_events:false});
b.css(&quot;visibility&quot;,&quot;hidden&quot;)
}},setSize:function(a){this.component.w=a.w;
this.component.h=a.h;
if(this.drop_down_menu_shown){this.component.setSize(a);
this.component.node.css(&quot;visibility&quot;,&quot;visible&quot;)
}else{this.component.setXYZWH({w:1,h:1},{send_events:false});
this.component.node.css(&quot;visibility&quot;,&quot;hidden&quot;)
}},onFontFamilyUpdate:function(){this.autoSize()
},autoSize:function(){if(!this.component.data.auto_size||this.component.data.style==&quot;drop-down&quot;||(this.component.data.position==&quot;vertical&quot;&amp;&amp;this.component.data.style==&quot;custom&quot;)){return
}var a=this;
Misc.try_forever(function(){var e=$(&quot;a:visible:last&quot;,a.menu);
if(!a.shouldDisplayOnPage(v.getSelectedPage())||e.length==0||e.height()&lt;2){return&quot;retry&quot;
}if(a.component.data.style==&quot;custom&quot;){var h=a.component,g=h.node.find(&quot;ul:first&quot;);
if(h.data.position==&quot;horizontal&quot;){if(h.node.width()&lt;deviceController.device_size().width){h.node.width(deviceController.device_size().width)
}}else{if(h.node.height()&lt;10000){h.node.height(10000)
}if(h.node.width()&lt;10000){h.node.width(10000)
}}var m={w:g.width()+5,h:g.height()+5};
h.node.width(h.prop().w);
h.node.height(h.prop().h);
h.setSize(m)
}else{a.onBeforeSaveData();
var i=a.component.W();
var d=a.component.H();
var b=(a.component.data.position!=&quot;horizontal&quot;?0:deviceController.device_size().width);
var l=deviceController.device==&quot;mobile_auto&quot;?deviceController.device_size().width:10000;
a.component.setSize({h:Math.max(d,1000),w:Math.min(l,Math.max(i,b))});
var k={h:e.offset().top-a.menu.offset().top+e.outerHeight(true)+5};
if(a.component.data.position==&quot;horizontal&quot;){var j=$(&quot;ul&quot;,a.menu).css(&quot;float&quot;)==&quot;right&quot;;
if(j){$(&quot;ul&quot;,a.menu).css(&quot;float&quot;,&quot;left&quot;)
}var f=$(&quot;a&quot;,a.menu).collect(function(c){return $(c).offset().left-a.menu.offset().left+$(c).outerWidth(true)+10
});
f.push(i);
k.w=Math.min(l,f.max());
if(j){k.x=a.component.X()-k.w+i;
$(&quot;ul&quot;,a.menu).css(&quot;float&quot;,&quot;right&quot;)
}}else{k.w=i
}a.onAfterSaveData();
if(k.w&gt;2000){a.setSize({h:d,w:i});
return&quot;retry&quot;
}a.setSize(k)
}})
},init_examples:function(){var a=this;
$(&quot;#list_styles&quot;).removeClass().addClass(a.component.uniqId()+&quot; body&quot;);
$(&quot;#list_styles section&quot;).each(function(){$(this).find(&quot;ul:first&quot;).unbind().on(&quot;click&quot;,&quot;li&quot;,function(){$(this).siblings(&quot;li&quot;).removeClass(&quot;selected&quot;);
$(this).addClass(&quot;selected&quot;)
})
});
$(&quot;#list_styles&quot;).on(&quot;click&quot;,&quot;section&quot;,function(b){if(b.target&amp;&amp;b.target.tagName.toLowerCase()==&quot;section&quot;){$(this).find(&quot;input[type=radio]&quot;).click()
}});
$(&quot;input[name=selected_menu_style]&quot;).unbind().on(&quot;change&quot;,function(){a.component.setData({custom_style:parseInt($(this).val().match(/\d+/)[0])})
});
$(&quot;input[name=selected_menu_style][value=uim_p_&quot;+a.component.data.custom_style+&quot;]&quot;).attr(&quot;checked&quot;,&quot;checked&quot;).click()
},_showProp:function(){if(blockSelector.selected_blocks.length&gt;1){return
}var a=$(this.component.propertyNode).add(this.component.propertyDesignNode);
$(&quot;#block_design_properties .lock_menu_style&quot;).remove();
if($(&quot;.accept_bg&quot;).length==0){$(&quot;.uim_style_prop&quot;,a).show();
$(&quot;#block_design_properties input[type=radio][value=custom]&quot;).attr(&quot;disabled&quot;,&quot;disabled&quot;).parent().css(&quot;position&quot;,&quot;relative&quot;).append($(&quot;&lt;div class=&apos;lock_menu_style&apos;&gt;&quot;).css({position:&quot;absolute&quot;,left:0,right:0,bottom:0,top:0}).on(&quot;click&quot;,function(){if($(&quot;.accept_bg&quot;).length==0){statusController.message(&quot;This functionality is not available for your template. Please change your template to either Cristal or Elegance, thanks to the button below.&quot;,&quot;warning&quot;,5000)
}else{$(&quot;#block_design_properties input[type=radio][value=custom]&quot;).removeAttr(&quot;disabled&quot;)
}}));
$(&quot;.uim_prop_custom&quot;,a).hide();
$(&quot;#design_blocks_wrapper&quot;).desactivate();
this.buildMenuULLI()
}else{if(this.component.data.style==&quot;custom&quot;){$(&quot;.uim_style_prop&quot;,a).hide();
this.init_examples();
this.component.init_colorPickers();
this.component.init_sliders();
$(&quot;#block_design_properties ul li.uim_prop_custom&quot;).css(&quot;display&quot;,&quot;table&quot;);
$(&quot;.uim_prop_align&quot;,a).show()
}else{$(&quot;.uim_style_prop&quot;,a).show();
$(&quot;.uim_prop_align&quot;,a).hide();
$(&quot;.uim_prop_custom&quot;,a).hide();
$(&quot;#design_blocks_wrapper&quot;).desactivate()
}}},_load_default_values:function(c){if(this.component.data.style==&quot;custom&quot;&amp;&amp;c){var a=this,b={};
$.each([&quot;normal_colors&quot;,&quot;hover_colors&quot;,&quot;selected_colors&quot;,&quot;font_size&quot;,&quot;border_weight&quot;,&quot;uim_align&quot;,&quot;custom_style&quot;],function(e,d){b[d]=ThemeConfig.UI_Menu[d]
});
this.component.setData(b,false,true)
}},_parseCSS:function(){if($(&quot;.accept_bg&quot;).length==0||this.component.data.style!=&quot;custom&quot;||v.mode!=&quot;editor&quot;){return
}var a=this;
UI_Menu.css_style=UI_Menu.css_style||$.ajax({url:stylesheet_path(&quot;menu_all&quot;),dataType:&quot;text&quot;,name:&quot;Loading menu styles&quot;});
UI_Menu.css_style.done(function(c){var b=&quot;style_uim_&quot;+a.component.uniqId();
$(&quot;#&quot;+b).remove();
$(&quot;#s_list_styles&quot;).remove();
$(loadStyle(css_parser(&quot;menu&quot;,c,$.extend({},a.component.data,{uniq_id:a.component.uniqId()})),$(&quot;#block_custom_styles_css&quot;)[0])).attr(&quot;id&quot;,b)
});
if(UI_Menu.css_style.state()==&quot;pending&quot;){UI_Menu.css_style.done(function(){a.autoSize()
})
}},_reset_values:function(){this._load_default_values(true);
this._parseCSS();
this.component.recreatePropertyDesignNode();
this.autoSize()
}};</script><style>.UI_Menu{overflow:visible}
.UI_Menu li,.uim_m{position:relative}
.uim_m{display:inline}
.UI_Menu .mtl,.UI_Menu .mt,.UI_Menu .mtr,.UI_Menu .ml,.UI_Menu .mr,.UI_Menu .mbl,.UI_Menu .mb,.UI_Menu .mbr{position:absolute}
.uim_mh li a,.uim_sh li a{white-space:nowrap}
.uim_mh ul{display:inline;list-style:none outside none}
.uim_mh li,.uim_mh li .uim_m,.uim_sh li,.uim_sh li .uim_m{float:left}
.uim_sh ul,.uim_sv ul,.uim_dv ul,.uim_dh ul{display:inline;list-style:none outside none;padding-left:0}
.uim_sh li{margin-left:12px}
.uim_sh li a,.uim_sv li a{color:#000}
.uim_sh li a:hover,.uim_sv li a:hover{text-decoration:none}
.uim_sv ul li.selected&gt; .uim_m a,.uim_sh ul li.selected&gt; .uim_m a{font-weight:700;text-decoration:none;cursor:default}
.uim_dv .uim_mc&gt;.ul_0,.uim_dh .uim_mc&gt;.ul_0{left:0;padding-left:0;position:absolute}
.uim_dv ul ul{display:none;position:absolute;top:0;left:100%}
.uim_dv ul li{float:none}
.uim_dh .ul_0{display:none;left:100%;position:absolute;top:0}
.uim_dh li{display:inline-block}
.uim_dh .ul_1{display:none;left:0;top:100%;position:absolute;white-space:normal}
.uim_dh .ul_0{white-space:nowrap}
.uim_dv li,.uim_dh li{padding:0 5px}
.uim_dh a,.uim_dv a{white-space:nowrap;font-size:13px;text-decoration:none}
.uim_dh a:hover,.uim_dv a:hover{text-decoration:underline}
.uim_dh ul li.selected&gt;.uim_m a,.uim_dh ul li.selected&gt;.uim_m a:hover,.uim_dv ul li.selected&gt;.uim_m a,.uim_dv ul li.selected&gt;.uim_m a:hover{cursor:default}
.uim_dv li .uim_m,.uim_dh li .uim_m{padding-top:5px}
ul.ul_1&gt;li{float:none;display:block}
.UI_Menu.uim_ch ul,.UI_Menu.uim_cv ul{list-style:outside none none;padding:0;text-align:center}
.UI_Menu.uim_ch li.uim_dhv_li_first{display:inline-block}
.UI_Menu.uim_ch li.uim_dhv_li_first .uim_m{display:inline-block}
.UI_Menu.uim_ch li.uim_dhv_li_first a{display:inline-block;text-decoration:none}
.UI_Menu.uim_ch li.uim_dhv_li_first::after{position:absolute;content:&quot;&quot;;top:100%;left:0;right:0;height:10px;z-index:4}
.UI_Menu.uim_cv li.uim_dhv_li_first{display:block;margin:.5em}
.UI_Menu.uim_cv li.uim_dhv_li_first .uim_m{display:block}
.UI_Menu.uim_cv li.uim_dhv_li_first a{display:block;text-decoration:none}
.UI_Menu.uim_ch .uim_mc&gt;ul li&gt;ul,.UI_Menu.uim_cv .uim_mc&gt;ul li&gt;ul{display:none}
.UI_Menu.uim_ch .uim_mc&gt;ul li:hover&gt;ul,.UI_Menu.uim_cv .uim_mc&gt;ul li:hover&gt;ul{display:block}
.UI_Menu.uim_ch .uim_mc&gt;ul li&gt;ul li,.UI_Menu.uim_cv .uim_mc&gt;ul li&gt;ul li{display:block;text-align:left;padding-left:10px}
.UI_Menu.uim_ch .uim_mc&gt;ul li&gt;ul li .uim_m,.UI_Menu.uim_cv .uim_mc&gt;ul li&gt;ul li .uim_m{margin-left:0}
.UI_Menu.uim_ch .uim_mc&gt;ul li&gt;ul li .uim_m,.UI_Menu.uim_ch .uim_mc&gt;ul li&gt;ul li .uim_m a,.UI_Menu.uim_cv .uim_mc&gt;ul li&gt;ul li .uim_m,.UI_Menu.uim_cv .uim_mc&gt;ul li&gt;ul li .uim_m a{display:block}
.UI_Menu.uim_cv .uim_mc&gt;ul li&gt;ul li span,.UI_Menu.uim_ch .uim_mc&gt;ul li&gt;ul li span{margin:0}
.UI_Menu.uim_cv .uim_mc&gt;ul li&gt;ul li a,.UI_Menu.uim_ch .uim_mc&gt;ul li&gt;ul li a{white-space:nowrap;font-size:.8em;padding:.3em;color:#454545}
.UI_Menu.uim_ch .uim_mc&gt;ul li&gt;ul li ul,.UI_Menu.uim_cv .uim_mc&gt;ul li&gt;ul li ul{position:relative}
.UI_Menu.uim_ch .uim_mc&gt;ul li&gt;ul li ul::after,.UI_Menu.uim_cv .uim_mc&gt;ul li&gt;ul li ul::after{display:none}
.UI_Menu.uim_ch .uim_mc&gt;ul li&gt;ul::after,.UI_Menu.uim_cv .uim_mc&gt;ul li&gt;ul::after,.UI_Menu.uim_ch .uim_mc&gt;ul li&gt;ul::before,.UI_Menu.uim_cv .uim_mc&gt;ul li&gt;ul::before{content:&quot;&quot;;position:absolute}
.UI_Menu.uim_cv .uim_mc ul li:hover ul,.UI_Menu.uim_ch .uim_mc ul li:hover ul{display:block}
.UI_Menu.uim_ch .uim_mc&gt;ul&gt;li&gt;ul{left:50%;min-width:100%;top:calc(100% + 10px);transform:translateX(-50%);position:absolute;background-color:#fff;border:1px solid #aaa;box-shadow:0 5px 10px rgba(0,0,0,.2);border-radius:3px}
.UI_Menu.uim_ch .uim_mc&gt;ul&gt;li&gt;ul::after{border-bottom:10px solid #fff;border-left:10px outset rgba(0,0,0,0);border-right:10px outset rgba(0,0,0,0);bottom:100%;left:50%;transform:translateX(-50%)}
.UI_Menu.uim_ch .uim_mc&gt;ul&gt;li&gt;ul::before{border-bottom:10px solid #777;border-left:10px outset rgba(0,0,0,0);border-right:10px outset rgba(0,0,0,0);bottom:calc(100% + 1px);left:50%;transform:translateX(-50%)}
.UI_Menu.uim_cv .uim_mc&gt;ul&gt;li&gt;ul{background-color:#fff;border:1px solid #aaa;border-radius:3px;box-shadow:0 5px 10px rgba(0,0,0,.2);left:100%;min-height:31px;position:absolute;top:0}
.UI_Menu.uim_cv .uim_mc&gt;ul&gt;li&gt;ul::before{border-bottom:10px outset rgba(0,0,0,0);border-right:10px solid #777;border-top:10px outset rgba(0,0,0,0);right:calc(100% + 1px);top:4px}
.UI_Menu.uim_cv .uim_mc&gt;ul&gt;li&gt;ul::after{border-right:10px solid #fff;border-top:10px outset rgba(0,0,0,0);border-bottom:10px outset rgba(0,0,0,0);right:100%;top:4px}
.UI_Menu.uim_cv .uim_mc&gt;ul ul ul{position:static}
.not_lab .uim_dhv_li_first&gt;span&gt;a{cursor:default}</style></uidget>