';$m=aui_modal($title,$body,$footer,$dismissible,$class,$dialog_class,$body_class);jQuery($m).on('shown.bs.modal',function(e){iFrame=jQuery('#embedModal-iframe');jQuery('.ac-preview-loading').addClass('d-flex');iFrame.attr({src:$url});iFrame.load(function(){jQuery('.ac-preview-loading').removeClass('d-flex')})});return $m}function aui_modal($title,$body,$footer,$dismissible,$class,$dialog_class,$body_class){if(!$class){$class=''}if(!$dialog_class){$dialog_class=''}if(!$body){$body='

'}jQuery('.aui-modal').modal('hide').modal('dispose').remove();jQuery('.modal-backdrop').remove();var $modal='';$modal+='';jQuery('body').append($modal);return jQuery('.aui-modal').modal('hide').modal({})}function aui_conditional_fields(form){jQuery(form).find(".aui-conditional-field").each(function(){var $element_require=jQuery(this).data('element-require');if($element_require){$element_require=$element_require.replace("'","'");$element_require=$element_require.replace(""",'"');if(aui_check_form_condition($element_require,form)){jQuery(this).removeClass('d-none')}else{jQuery(this).addClass('d-none')}}})}function aui_check_form_condition(condition,form){if(form){condition=condition.replace(/\(form\)/g,"('"+form+"')")}return new Function("return "+condition+";")()}jQuery.fn.aui_isOnScreen=function(){var win=jQuery(window);var viewport={top:win.scrollTop(),left:win.scrollLeft()};viewport.right=viewport.left+win.width();viewport.bottom=viewport.top+win.height();var bounds=this.offset();bounds.right=bounds.left+this.outerWidth();bounds.bottom=bounds.top+this.outerHeight();return(!(viewport.rightbounds.right||viewport.bottombounds.bottom))};function aui_carousel_maybe_show_multiple_items($carousel){var $items={};var $item_count=0;if(!jQuery($carousel).find('.carousel-inner-original').length){jQuery($carousel).append('')}jQuery($carousel).find('.carousel-inner-original .carousel-item').each(function(){$items[$item_count]=jQuery(this).html();$item_count++});if(!$item_count){return}if(jQuery(window).width()<=576){if(jQuery($carousel).find('.carousel-inner').hasClass('aui-multiple-items')&&jQuery($carousel).find('.carousel-inner-original').length){jQuery($carousel).find('.carousel-inner').removeClass('aui-multiple-items').html(jQuery($carousel).find('.carousel-inner-original').html());jQuery($carousel).find(".carousel-indicators li").removeClass("d-none")}}else{var $md_count=jQuery($carousel).data('limit_show');var $new_items='';var $new_items_count=0;var $new_item_count=0;var $closed=true;Object.keys($items).forEach(function(key,index){if(index!=0&&Number.isInteger(index/$md_count)){$new_items+='
';$closed=true}if(index==0||Number.isInteger(index/$md_count)){$active=index==0?'active':'';$new_items+=''}jQuery($carousel).find('.carousel-inner').addClass('aui-multiple-items').html($new_items);jQuery($carousel).find('.carousel-item.active img').each(function(){if(real_srcset=jQuery(this).attr("data-srcset")){if(!jQuery(this).attr("srcset"))jQuery(this).attr("srcset",real_srcset)}if(real_src=jQuery(this).attr("data-src")){if(!jQuery(this).attr("srcset"))jQuery(this).attr("src",real_src)}});$hide_count=$new_items_count-1;jQuery($carousel).find(".carousel-indicators li:gt("+$hide_count+")").addClass("d-none")}jQuery(window).trigger("aui_carousel_multiple")}function aui_init_carousel_multiple_items(){jQuery(window).on("resize",function(){jQuery('.carousel-multiple-items').each(function(){aui_carousel_maybe_show_multiple_items(this)})});jQuery('.carousel-multiple-items').each(function(){aui_carousel_maybe_show_multiple_items(this)})}function init_nav_sub_menus(){jQuery('.navbar-multi-sub-menus').each(function(i,obj){if(jQuery(this).hasClass("has-sub-sub-menus")){return true}jQuery(this).addClass('has-sub-sub-menus');jQuery(this).find('.dropdown-menu a.dropdown-toggle').on('click',function(e){var $el=jQuery(this);$el.toggleClass('active-dropdown');var $parent=jQuery(this).offsetParent(".dropdown-menu");if(!jQuery(this).next().hasClass('show')){jQuery(this).parents('.dropdown-menu').first().find('.show').removeClass("show")}var $subMenu=jQuery(this).next(".dropdown-menu");$subMenu.toggleClass('show');jQuery(this).parent("li").toggleClass('show');jQuery(this).parents('li.nav-item.dropdown.show').on('hidden.bs.dropdown',function(e){jQuery('.dropdown-menu .show').removeClass("show");$el.removeClass('active-dropdown')});if(!$parent.parent().hasClass('navbar-nav')){$el.next().addClass('position-relative border-top border-bottom')}return false})})}function aui_lightbox_embed($link,ele){ele.preventDefault();jQuery('.aui-carousel-modal').remove();var $modal='';jQuery('body').append($modal);jQuery('.aui-carousel-modal').modal({});jQuery('.aui-carousel-modal').on('hidden.bs.modal',function(e){jQuery("iframe").attr('src','')});$container=jQuery($link).closest('.aui-gallery');$clicked_href=jQuery($link).attr('href');$images=[];$container.find('.aui-lightbox-image').each(function(){var a=this;var href=jQuery(a).attr('href');if(href){$images.push(href)}});if($images.length){var $carousel='';var $close='';jQuery('.aui-carousel-modal .modal-content').html($carousel).prepend($close)}}function aui_init_lightbox_embed(){jQuery('.aui-lightbox-image, .aui-lightbox-iframe').off('click').on("click",function(ele){aui_lightbox_embed(this,ele)})}$aui_doing_toast=false;function aui_toast($id,$type,$title,$title_small,$body,$time,$can_close){if($aui_doing_toast){setTimeout(function(){aui_toast($id,$type,$title,$title_small,$body,$time,$can_close)},500);return}$aui_doing_toast=true;if($can_close==null){$can_close=false}if($time==''||$time==null){$time=3000}if(document.getElementById($id)){jQuery('#'+$id).toast('show');setTimeout(function(){$aui_doing_toast=false},500);return}var uniqid=Date.now();if($id){uniqid=$id}$op="";$tClass='';$thClass='';$icon="";if($type=='success'){$op="opacity:.92;";$tClass='alert alert-success';$thClass='bg-transparent border-0 alert-success';$icon="
"}else if($type=='error'||$type=='danger'){$op="opacity:.92;";$tClass='alert alert-danger';$thClass='bg-transparent border-0 alert-danger';$icon="
"}else if($type=='info'){$op="opacity:.92;";$tClass='alert alert-info';$thClass='bg-transparent border-0 alert-info';$icon="
"}else if($type=='warning'){$op="opacity:.92;";$tClass='alert alert-warning';$thClass='bg-transparent border-0 alert-warning';$icon="
"}if(!document.getElementById("aui-toasts")){jQuery('body').append('
')}$toast='';jQuery('.aui-toast-bottom-right').prepend($toast);jQuery('#'+uniqid).toast('show');setTimeout(function(){$aui_doing_toast=false},500)}function aui_init(){init_nav_sub_menus();aui_init_tooltips();aui_init_select2();aui_init_flatpickr();aui_init_iconpicker();aui_init_greedy_nav();aui_time_ago('timeago');aui_init_carousel_multiple_items();aui_init_lightbox_embed()}jQuery(window).on("load",function(){aui_init()});jQuery(function($){var ua=navigator.userAgent.toLowerCase();var isiOS=ua.match(/(iphone|ipod|ipad)/);if(isiOS){var pS=0;pM=parseFloat($('body').css('marginTop'));$(document).on('show.bs.modal',function(){pS=window.scrollY;$('body').css({marginTop:-pS,overflow:'hidden',position:'fixed',})}).on('hidden.bs.modal',function(){$('body').css({marginTop:pM,overflow:'visible',position:'inherit',});window.scrollTo(0,pS)})}});var aui_confirm=function(message,okButtonText,cancelButtonText,isDelete,large){okButtonText=okButtonText||'Yes';cancelButtonText=cancelButtonText||'Cancel';message=message||'Are you sure?';sizeClass=large?'':'modal-sm';btnClass=isDelete?'btn-danger':'btn-primary';deferred=jQuery.Deferred();var $body="";$body+="

"+message+"

";$body+="
";$body+="";$body+="";$body+="
";$modal=aui_modal('',$body,'',false,'',sizeClass);return deferred.promise()}