AlkantarClanX12

Your IP : 3.147.53.90


Current Path : /home/thanudqk/www/wp-content/plugins/LayerSlider/assets/static/admin/js/
Upload File :
Current File : /home/thanudqk/www/wp-content/plugins/LayerSlider/assets/static/admin/js/ls-dashboard-min.js

var $lastOpenedGroup,LS_contextMenuSliderItem,importModalWindowTimeline=null,importModalWindowTransition=null,importModalThumbnailsTransition=null,draggedSliderItem=null,targetSliderItem=null,sliderDragGroupingTimeout=null,sliderGroupRenameTimeout=null,activeShuffleContainerIndex=0;projectRenameTimeout=0,jQuery((function($){var e,t;kmUI.dropdown.init(),$("#ls-list-main-menu ls-button[data-scroll]").on("click",(function(){v($(this).data("scroll"))})),$("#ls-slider-filters").on("change","select",(function(){$(this).closest("#ls-slider-filters").submit()})),$('#ls-plugin-settings-tabs input[name="ls_gdpr_goole_fonts"]').on("change",(function(){var e=$(this);$(".ls-show-if-google-fonts-enabled")[e.prop("checked")?"removeClass":"addClass"]("ls-hidden")})).change(),$("#ls-plugin-settings-tabs .ls-empty-google-fonts").on("click",(function(e){e.preventDefault(),lsCommon.smartAlert.confirm(LS_l10n.GFEmptyConfirmation,(()=>{document.location.href=$(this).attr("href")}))})),$("#ls-global-google-fonts").on("click",".ls-remove-font",(function(){lsCommon.smartAlert.confirm(LS_l10n.GFRemoveConfirmation,(()=>{var e=$(this).closest(".ls-font-item");e.css({opacity:0,transform:"scale(0)"}),setTimeout((function(){e.remove(),w()}),250)}))})),$(document).on("click",".ls-open-plugin-settings-button",(function(){kmw.modal.open({content:$("#tmpl-plugin-settings-content"),clip:!0,minWidth:400,maxHeight:"90%",maxWidth:1280,sidebar:{left:{width:300,customHeaderHeight:!0,content:$("#tmpl-plugin-settings-sidebar")}}})})),$(document).on("click",".ls-open-fonts-library",(function(){LS_fontLibrary.open((function(e){LS_fontLibrary.close(),setTimeout((function(){var t=$($("#ls-font-item-template").html());t.find(".ls-font-name").text(e).css("font-family",'"'+e+'"'),$("#ls-global-google-fonts").prepend(t),w()}),800)}))})),$(document).on("click","#ls-plugin-settings-content input",(function(e){const t=$(this),l=t.prop("checked");l&&t.data("warning-enable")&&(e.preventDefault(),e.stopPropagation(),lsCommon.smartAlert.confirm(t.data("warning-enable"),(()=>{t.prop("checked",!0).trigger("change")}))),!l&&t.data("warning-disable")&&(e.preventDefault(),e.stopPropagation(),lsCommon.smartAlert.confirm($(this).data("warning-disable"),(()=>{t.prop("checked",!1).trigger("change")})))})),$(document).on("change input","#ls-plugin-settings-content input, #ls-plugin-settings-content select",(function(){clearTimeout(e),e=setTimeout((function(){const e=$("#ls-plugin-settings-content").serialize();$.post(ajaxurl,e,(e=>{}))}),500)})),$(document).on("click",".ls-show-canceled-activation-modal",(function(){kmw.modal.open({content:"#tmpl-canceled-activation-modal",modalClasses:"tmpl-canceled-activation-modal",minWidth:400,maxWidth:960})})),window.lsTwitterFeedInterval=setInterval((function(){let e=$("#ls--box-twitter-feed iframe").contents();e.find(".timeline-Header").length&&(e.find("head").append('<link rel="stylesheet" href="'+LS_pageMeta.assetsPath+'/static/admin/css/twitter.css" type="text/css" />'),clearInterval(window.lsTwitterFeedInterval))}),200),setTimeout((function(){clearInterval(window.lsTwitterFeedInterval)}),5e3),$("#ls-notification-clear-button").click((function(){$(".ls-notifications-button").removeClass("ls-active"),$("#ls-notification-panel .ls-notification-unread").removeClass("ls-notification-unread"),$(".ls-fancy-notice-wrapper .ls-notification-dismissible").slideUp(400,(function(){$(this).remove(),$(".ls-fancy-notice-wrapper").children().length||$("#ls-list-main-menu").removeClass("ls-has-inline-notifications")})),$.getJSON(ajaxurl,{action:"ls_clear_notifications"})})),jQuery(".ls-slider-list-items").on("click",":checkbox",(function(){$(this).closest(".slider-item").toggleClass("ls-selected"),p()})),$(".ls-slider-list-items").on("contextmenu",".slider-item",(function(e){if($(e.target).is("input"))return!0;var t=$(this);t.hasClass("group-item")?e.preventDefault():(LS_contextMenuSliderItem=t,LS_ContextMenu.open(e,{width:230,selector:".ls-sliders-list-context-menu",template:"#tmpl-ls-sliders-list-context-menu",onBeforeOpen:function(l){e.manualOpen&&t.addClass("ls-context-menu-open"),t.addClass("ls-highlight-row"),l.removeClass("ls-hidden-slider"),t.data("hidden")&&l.addClass("ls-hidden-slider")},onClose:function(){$(".slider-item").removeClass("ls-context-menu-open ls-highlight-row")}}))})).on("click",".slider-item .ls-preview",(function(e){(e.ctrlKey||e.metaKey)&&(e.preventDefault(),$(this).closest(".slider-item").find(".slider-checkbox").click())})).on("mouseenter",".slider-actions-button, .slider-item-wrapper input",(function(){$(this).closest(".slider-item").addClass("ls-block-active-state")})).on("mouseleave",".slider-actions-button, .slider-item-wrapper input",(function(){$(this).closest(".slider-item").removeClass("ls-block-active-state")})).on("input",".slider-item-wrapper .ls--project-name-input",(function(){var e=$(this);clearTimeout(projectRenameTimeout),projectRenameTimeout=setTimeout((function(){var t=e.closest(".slider-item").data(),l=$('.ls-slider-list-form input[name="_wpnonce"]').val();$.post(ajaxurl,{action:"ls_rename_project",id:t.id,name:e.val(),_wpnonce:l})}),500)})).on("click",".slider-actions-button",(function(){var e=jQuery(this),t=e.offset(),l=e.width(),i=e.height();jQuery(".ls-slider-list-items").triggerHandler(jQuery.Event("contextmenu",{target:e[0],pageX:t.left-3,pageY:t.top+i+7,manualOpen:!0,alignRight:{pageX:t.left+l}}))})).on("click",".slider-item.group-item",(function(e){e.preventDefault();var t=$(this),l=$.trim(t.find(".ls-name ls-span").html()).replace(/"/g,"&quot;");$lastOpenedGroup=t,kmw.modal.open({into:".ls-sliders-grid",title:'<input value="'+l+'"><a href="#" class="ls--button ls--bg-blue ls--small ls-remove-group-button" data-help="'+LS_l10n.SLRemoveGroupTooltip+'" data-help-delay="100">'+LS_l10n.SLRemoveGroupButton+"</a>",content:t.next().children(),maxWidth:1380,minWidth:600,spacing:60,modalClasses:"ls-slider-group-modal-window ls--form-control",animationIn:"scale",overlaySettings:{animationIn:"fade",customStyle:{backgroundColor:"rgba( 225, 225, 225, 0.95 )"}},onBeforeOpen:function(){jQuery("#ls-slider-selection-bar-placeholder").show(),jQuery("#ls-slider-selection-bar").addClass("ls-overlay-selection-bar")},onClose:function(){jQuery("#ls-slider-selection-bar-placeholder").hide(),jQuery("#ls-slider-selection-bar").removeClass("ls-overlay-selection-bar")}}),setTimeout((function(){d()}),200)})),$(document).on("input",".ls-slider-group-modal-window .kmw-modal-title input",(function(){$this=$(this),clearTimeout(sliderGroupRenameTimeout),sliderGroupRenameTimeout=setTimeout((function(){$.get(ajaxurl,{action:"ls_rename_slider_group",groupId:$lastOpenedGroup.data("id"),name:$this.val()})}),300),$lastOpenedGroup.find(".ls-name ls-span").text($this.val())})),$(document).on("click",".ls-slider-group-modal-window .ls-remove-group-button",(function(e){e.preventDefault(),kmUI.popover.close(),lsCommon.smartAlert.confirm(LS_l10n.SLRemoveGroupConfirm,(()=>{$.get(ajaxurl,{action:"ls_delete_slider_group",groupId:$lastOpenedGroup.data("id")});var e=$(".ls-slider-group-modal-window .slider-item");e.hasClass("ui-draggable")&&e.draggable("destroy"),e.hasClass("ui-droppable")&&e.droppable("destroy"),e.prependTo(".ls-sliders-grid"),setTimeout((function(){a(),r(),c()}),300),$lastOpenedGroup.next().remove(),$lastOpenedGroup.remove(),kmw.modal.close()}))})),jQuery("#ls-add-slider-button").click((function(e){e.preventDefault(),kmw.modal.open({content:"#tmpl-add-new-slider",maxWidth:415,minWidth:415,onOpen:function(){$("#add-new-slider-modal input").focus()}})})),jQuery("#ls-addons-button").click((function(e){e.preventDefault(),kmw.modal.open({id:"ls-premium-benefits-modal",content:'<iframe src="https://layerslider.com/premium-embed/" frameborder="0" allowtransparency="true" allowfullscreen="true"></iframe>',maxWidth:1280,maxHeight:"100%",padding:0,spacing:20,closeButton:!0})})),$("#ls-list-buttons").on("click","#ls-import-button",(function(e){e.preventDefault(),kmw.modal.open({content:$("#tmpl-upload-sliders").text(),minWidth:400,maxWidth:700})})),$(".pagination-links a.disabled").click((function(e){e.preventDefault()})),$(document).on("dragenter.ls",".ls-item.import-sliders",(function(e){e.preventDefault(),t=e.target,$(this).addClass("ls-dragover")})).on("dragleave.ls drop.ls",".ls-item.import-sliders",(function(e){e.preventDefault(),e.target==t&&$(this).removeClass("ls-dragover")})).on("dragover.ls",".ls-item.import-sliders",(function(e){e.preventDefault()})).on("drop.ls",".ls-item.import-sliders",(function(e){e.originalEvent;var t=e.originalEvent.dataTransfer.files,l=$(this),i=$("#tmpl-quick-import-form");return!(0===t.length||t.length>1)&&(-1!==t[0].name.toLowerCase().indexOf(".zip")&&(i.length||(i=$($("#tmpl-quick-import").text()).prependTo("body")),l.addClass("importing"),i.find('input[type="file"]')[0].files=t,void i.submit()))})),$(document).on("change","#ls-upload-modal-window .ls-form-file input",(function(){var e=this.files[0],t=$(this),l=t.parent(),i=t.prev();t.data("original-text")||t.data("original-text",i.text()),e?(i.text(e.name),l.addClass("file-chosen")):(i.text(t.data("original-text")),l.removeClass("file-chosen"))})),$("#ls-browse-templates-button").on("click",(function(e){var t;e.preventDefault(),jQuery("#ls-import-modal-overlay").length||jQuery('<div id="ls-import-modal-overlay">').appendTo("#wpwrap"),jQuery("#ls-import-modal-window").length?t=jQuery("#ls-import-modal-window"):((t=jQuery(jQuery("#tmpl-import-sliders").text()).hide().prependTo("body")).hasClass("has-updates")&&jQuery.get(window.ajaxurl,{action:"ls_store_opened"}),importModalWindowTimeline=new TimelineMax({onStart:function(){jQuery("#ls-import-modal-overlay").show(),jQuery("html, body").addClass("ls-no-overflow"),jQuery(document).on("keyup.LS",(function(e){27===e.keyCode&&jQuery("#ls-browse-templates-button").data("lsModalTimeline").reverse().timeScale(1.5)}))},onComplete:function(){importModalWindowTimeline&&importModalWindowTimeline.remove(importModalThumbnailsTransition),o.start()},onReverseComplete:function(){o.stop(),jQuery("html, body").removeClass("ls-no-overflow"),jQuery(document).off("keyup.LS"),jQuery("#ls-import-modal-overlay").hide(),TweenMax.set(jQuery("#ls-import-modal-window")[0],{css:{y:-1e5}})},paused:!0}),$(this).data("lsModalTimeline",importModalWindowTimeline),importModalWindowTimeline.fromTo($("#ls-import-modal-overlay")[0],.75,{autoCSS:!1,css:{opacity:0}},{autoCSS:!1,css:{opacity:.75},ease:Quart.easeInOut},0),importModalThumbnailsTransition=TweenMax.fromTo($("#ls-import-modal-window ls-templates-container.ls--active")[0],.5,{autoCSS:!1,css:{opacity:0}},{autoCSS:!1,css:{opacity:1},ease:Quart.easeInOut}),importModalWindowTimeline.add(importModalThumbnailsTransition,.75)),importModalWindowTimeline.remove(importModalWindowTransition),importModalWindowTransition=TweenMax.fromTo(t[0],.75,{autoCSS:!1,css:{position:"fixed",display:"block",y:0,x:jQuery(window).width()}},{autoCSS:!1,css:{x:0},ease:Quart.easeInOut},0),importModalWindowTimeline.add(importModalWindowTransition,0),importModalWindowTimeline.play()})),$(document).on("click","#ls-import-modal-window .ls--close-templates",(function(){$("#ls-browse-templates-button").data("lsModalTimeline").reverse()})).on("submit","#ls-upload-modal-window form",(function(e){jQuery(".button",this).text(LS_l10n.SLUploadProject).addClass("saving")})).on("click",".ls-open-add-new-slider",(function(e){e.preventDefault(),kmw.modal.close(),$("#ls-add-slider-button").click()})).on("click",".ls-open-template-store",(function(e){e.preventDefault(),kmw.modal.close(),setTimeout((function(){$("#ls-browse-templates-button").click()}),$(this).data("delay")||0)})),$("#ls--release-channel select").change((function(){var e=$(this).closest("form");$.getJSON(ajaxurl,e.serialize(),(function(e){kmUI.notify.show({icon:"success",text:LS_l10n.releaseChannelUpdated,timeout:2e3})}))})),$(document).on("click","#ls-import-modal-window [data-show-category]",(function(){var e=$(this);l($(this).attr("data-show-category")),e.attr("data-show-tag")&&$('#ls-import-modal-window ls-templates-container.ls--active ls-tag[data-handle="'+e.attr("data-show-tag")+'"]').click()}));var l=function(e){$("#ls-import-modal-window ls-templates-nav [data-show-category]").removeClass("ls--active"),$('#ls-import-modal-window ls-templates-nav [data-show-category="'+e+'"]').addClass("ls--active"),$("#ls-import-modal-window ls-templates-container").removeClass("ls--active"),$('#ls-import-modal-window ls-templates-container[data-category="'+e+'"]').addClass("ls--active"),$("ls-templates-containers").scrollTop(0)};$(document).on("click",'#ls-import-modal-window [data-show-category="collections"]',(function(e){e.preventDefault(),$("#ls--collection-templates").children().length||$("ls-templates-holder.ls--collections-list ls-template.ls--active").click()})).on("click","#ls-import-modal-window [data-show-collection]",(function(e){e.preventDefault(),l("collections"),$('ls-templates-holder.ls--collections-list ls-template[data-handle="'+$(this).attr("data-show-collection")+'"]').click()})).on("click","#ls-import-modal-window ls-templates-holder.ls--collections-list ls-template",(function(){var e=$(this);e.addClass("ls--active").siblings().removeClass("ls--active"),i(e.attr("data-handle"),e.attr("data-name"))})),$(document).on("click","#ls-import-modal-window ls-tag",(function(){var e=$(this),t=e.attr("data-handle"),l=e.closest("ls-templates-container").find("ls-templates-holder"),i=l.find("ls-template"),o=(l.find('ls-template[data-groups*="'+t+'"]'),l.find('ls-template:not([data-groups*="'+t+'"])'));e.addClass("ls--active").siblings().removeClass("ls--active"),i.show(),""!==t&&"all"!==t&&o.hide()}));var i=function(e,t){$(".ls-template-collections-target ls-template[data-collections*="+e+"]").clone().show().sort(((e,t)=>parseInt(t.dataset.order)-parseInt(e.dataset.order))).appendTo("#ls--collection-templates"),$("#ls--collection-title ls-ib span").text(t)};$(document).on("click","#ls-import-modal-window ls-featured-bullet",(function(e){var t=$(this).index("#ls-import-modal-window ls-templates-featured ls-featured-bullet");o.change(t,e)}));var o={timer:60,interval:0,start:function(){this.itemsNum=$("#ls-import-modal-window ls-templates-featured ls-featured-bullet").length,this.itemsNum>1&&(this.currentIndex=0,this.timer=parseInt($("#ls-import-modal-window ls-templates-featured").attr("data-slideshow-interval"))||this.timer,this.startInterval())},startInterval:function(){clearInterval(this.interval),this.interval=setInterval((()=>{this.change()}),1e3*this.timer)},stop:function(){clearInterval(this.interval)},change:function(e,t){void 0!==e?this.currentIndex=e:this.currentIndex+1>=this.itemsNum?this.currentIndex=0:this.currentIndex++,$("#ls-import-modal-window ls-templates-featured ls-featured-bullet").eq(this.currentIndex).addClass("ls--active").siblings("ls-featured-bullet").removeClass("ls--active"),$("#ls-import-modal-window ls-templates-featured ls-featured-item").eq(this.currentIndex).addClass("ls--active").siblings("ls-featured-item").removeClass("ls--active"),void 0!==t&&o.startInterval()}};$("#ls--box-license form").submit((function(e){e.preventDefault();var t=$(this),l=t.find('input[name="purchase_code"]'),i=t.find(".button-save:visible");if(l.val().length<10)return lsCommon.smartAlert.open(LS_l10n.SLEnterCode),!1;i.data("text",i.text()).text(LS_l10n.working),$.ajax({type:"POST",url:ajaxurl,data:$(this).serialize(),error:function(e,t,l){lsCommon.smartAlert.open({width:700,theme:"red",title:LS_l10n.SLActivationErrorTitle,text:LS_l10n.SLActivationError.replace("%s",l)}),i.removeClass("saving").text(i.data("text"))},success:function(e){(e=$.parseJSON(e))&&!e.errCode?(LS_slidersMeta.isActivatedSite&&kmUI.notify.show({icon:"success",text:LS_l10n.licenseKeyUpdated,timeout:2e3}),LS_slidersMeta.isActivatedSite=!0,$("#ls--license-slider").layerSlider(2),b(!0)):void 0!==e.messageHTML?kmw.modal.open({title:e.titleHTML?e.titleHTML:LS_l10n.activationErrorTitle,content:'<div id="tmpl-activation-error-modal-window">'+e.messageHTML+"</div>",maxWidth:660,minWidth:400}):void 0!==e.message&&lsCommon.smartAlert.open(e.message),i.removeClass("saving").text(i.data("text"))}})})),$("#ls--box-license a.ls-deauthorize").click((function(e){e.preventDefault();var t=$(this).closest("form");$.get(ajaxurl,$.param({action:"ls_deauthorize_site"}),(function(e){(e=$.parseJSON(e))&&!e.errCode&&(t.find(".ls--key input").val(""),LS_slidersMeta.isActivatedSite=!1,$("#ls--license-slider").layerSlider(1),b(!1),kmw.modal.open({content:"#tmpl-deregister-license",maxWidth:560,minWidth:560})),void 0!==e.message&&lsCommon.smartAlert.open(e.message)}))}));var s=function(e){document.location.hash="",kmw.modal.close();var t=$("#ls--box-license");if(!t.length||t.is(":hidden"))return kmw.modal.open({content:"#tmpl-activation-unavailable",maxWidth:600}),!1;v($("#ls--box-license"))};$(document).on("click",".ls-show-activation-box",(function(e){e.preventDefault(),s()})).on("click",".ls-premium-lock-templates",(function(e){e.preventDefault(),lsDisplayActivationWindow({title:LS_l10n.notifyPremiumTemplateMT})})),$(document).on("click","#lse-activation-modal-window .lse-button-activation",(function(e){e.preventDefault(),$(this).closest("#ls-import-modal-window").length?(jQuery(document).trigger(jQuery.Event("keyup",{keyCode:27})),setTimeout((function(){s()}),800)):kmw.modal.close(!1,{onClose:function(){s()}})})),-1!==document.location.href.indexOf("#activationBox")&&setTimeout((function(){s()}),500),$("input.ls-shortcode").click((function(){this.focus(),this.select()})),$(document).on("click","#ls-import-modal-window .ls--import-template-button",(function(e){e.preventDefault();var t=jQuery(this),l=t.data("name"),i=t.data("handle"),o=t.data("category"),s=!!t.data("bundled")?"ls_import_bundled":"ls_import_online";!t.data("premium")||LS_slidersMeta.isActivatedSite?t.data("version-warning")?kmw.modal.open({into:"#ls-import-modal-window",content:"#tmpl-version-warning",id:"ls-version-warning",minWidth:500,maxWidth:500}):(kmw.modal.open({content:"#tmpl-importing",into:"#ls-import-modal-window",minWidth:300,maxWidth:300,closeButton:!1,closeOnEscape:!1,animationIn:"scale",overlaySettings:{closeOnClick:!1,animationIn:"fade"}}),jQuery.ajax({url:ajaxurl,data:{action:s,slider:i,name:l,category:o,security:window.lsImportNonce},beforeSend:function(e,t){setTimeout((function(){var e=jQuery("#ls-loading-modal-window").closest(".kmw-modal");TweenLite.to(e[0],.5,{minWidth:580,maxWidth:580,height:446,maxHeight:480,onComplete:function(){$('<div class="ls-import-notice">'+LS_l10n.SLImportNotice+"</div>").hide().appendTo(e.find(".kmw-modal-content")).fadeIn(250)}})}),6e4)},success:function(e,t,l){if((e=e?JSON.parse(e):{}).success)document.location.href=e.url;else{if(kmw.modal.close(),e.reload)return void window.location.reload(!0);if(e.errCode&&"ERR_WW_POPUPS_PURCHASE_NOT_FOUND"==e.errCode)return void lsDisplayActivationWindow({into:"#ls-import-modal-window",title:LS_l10n.purchaseWWPopups,content:"#tmpl-purchase-webshopworks-popups",minHeight:680,maxHeight:680});setTimeout((function(){lsCommon.smartAlert.open({theme:"red",width:700,title:e.title||LS_l10n.SLImportErrorTitle,text:e.message||LS_l10n.SLImportError})}),600)}},error:function(e,t,l){kmw.modal.close(),setTimeout((function(){lsCommon.smartAlert.open({width:700,theme:"red",title:LS_l10n.SLImportErrorTitle,text:LS_l10n.SLImportHTTPError.replace("%s",l)})}),600)},complete:function(){}})):lsDisplayActivationWindow({into:"#ls-import-modal-window",title:LS_l10n.activationTemplate})})),"#open-template-store"===document.location.hash?setTimeout((function(){$("#ls-browse-templates-button").click()}),500):"#open-addons"===document.location.hash&&setTimeout((function(){$("#ls-addons-button").click()}),500);var n,a=function(){$(".ls-sliders-grid > .slider-item").draggable({scope:"add-to-group",cancel:".group-item, .ls-hero",handle:".ls-preview",distance:5,helper:"clone",revert:"invalid",revertDuration:300,start:function(e,t){draggedSliderItem=e.target,$(draggedSliderItem).addClass("dragging-original")},stop:function(e,t){$(e.target).removeClass("dragging-original")}})},r=function(){$(".ls-sliders-grid .group-item").droppable({scope:"add-to-group",accept:".slider-item",tolerance:"pointer",hoverClass:"slider-dropping",over:function(e,t){t.helper.find(".ls-preview").addClass("slider-dropping")},out:function(e,t){t.helper.find(".ls-preview").removeClass("slider-dropping")},drop:function(e,t){m(e.target,draggedSliderItem)}})},d=function(){$(".ls-sliders-grid .kmw-modal-inner .slider-item").draggable({scope:"remove-from-group",handle:".ls-preview",appendTo:".ls-sliders-grid",distance:5,helper:"clone",zIndex:9999999,revert:"invalid",revertDuration:300,start:function(e,t){draggedSliderItem=e.target,$(draggedSliderItem).addClass("dragging-original"),$("#ls-group-remove-area").addClass("active")},stop:function(e,t){$(draggedSliderItem).removeClass("dragging-original"),$("#ls-group-remove-area").removeClass("active")}})},c=function(){$(".ls-sliders-grid .slider-item:not(.ls-hero,.group-item)").droppable({scope:"add-to-group",accept:".slider-item",tolerance:"pointer",hoverClass:"slider-dropping",over:function(e,t){var l=function(){targetSliderItem=e.target,$(e.target).addClass("create-group"),t.helper.find(".ls-preview").addClass("slider-dropping"),n="over"};"over"==n?setTimeout((function(){l()}),0):l()},out:function(e,t){var l=function(){targetSliderItem=null,$(".slider-item").removeClass("create-group"),t.helper.find(".ls-preview").removeClass("slider-dropping"),n="out"};"out"==n?setTimeout((function(){l()}),0):l()},deactivate:function(e,t){clearTimeout(sliderDragGroupingTimeout),$(".slider-item").removeClass("create-group"),t.helper.find(".ls-preview").removeClass("slider-dropping")},drop:function(e,t){if(targetSliderItem){var l=$($("#tmpl-slider-group-item").text()).insertAfter(targetSliderItem).filter(".group-item");m(l,targetSliderItem,!0),m(l,draggedSliderItem,!0),$(targetSliderItem).hide(),$(draggedSliderItem).hide(),r(),$.getJSON(ajaxurl,{action:"ls_create_slider_group",items:[$(targetSliderItem).data("id"),$(draggedSliderItem).data("id")]},(function(e){l.data("id",e.groupId)}))}}})},m=function(e,t,l){var i=$(e),o=i.find(".ls-items"),s=$(t),n=s.find(".ls-preview"),a=$($("#tmpl-slider-group-placeholder").text());l||$.get(ajaxurl,{action:"ls_add_slider_to_group",sliderId:s.data("id"),groupId:i.data("id")}),n.find(".no-preview").length||(a.find(".ls-preview").css("background-image",n.css("background-image")),a.find(".ls-preview").empty()),s.hasClass("ui-draggable")&&s.draggable("destroy"),s.hasClass("ui-droppable")&&s.droppable("destroy"),s.clone(!0,!0).removeClass("dragging-original").removeClass("create-group").appendTo(i.next().children()),a.appendTo(o),setTimeout((function(){a.removeClass("ls-scale0")}),100),s.remove()},u=function(e,t,l){var i=$(e),o=i.find(".ls-items"),s=$(t),n=(s.find(".ls-preview"),s.siblings());l||$.get(ajaxurl,{action:"ls_remove_slider_from_group",sliderId:s.data("id"),groupId:i.data("id")}),o.children().eq(s.index()).remove(),s.hasClass("ui-draggable")&&s.draggable("destroy"),s.hasClass("ui-droppable")&&s.droppable("destroy"),s.prependTo(".ls-sliders-grid"),setTimeout((function(){a(),r(),c()}),300),n.length<1&&(i.next().remove(),i.remove(),kmw.modal.close())};$("#ls-slider-selection-bar").on("click","ls-button",(function(e){e.preventDefault(),g($(this).data("action"))})),$(document).on("click",".ls-sliders-list-context-menu li",(function(e){e.preventDefault(),g($(this).data("action"),{sliderItem:LS_contextMenuSliderItem,selectSliderItem:!0})}));var p=function(){$selected=$(".ls-slider-list-items :checkbox:checked"),$selected.length?($(".ls-sliders-grid").addClass("ls-has-selection"),$("body").addClass("ls-has-slider-selection"),$selected.length>1?$("body").addClass("ls-has-multiple-slider-selection"):$("body").removeClass("ls-has-multiple-slider-selection"),$selected.closest(".slider-item.ls-dimmed").length?$("body").addClass("ls-has-hidden-slider-selection"):$("body").removeClass("ls-has-hidden-slider-selection"),$selected.closest(".slider-item:not(.ls-dimmed)").length?$("body").addClass("ls-has-published-slider-selection"):$("body").removeClass("ls-has-published-slider-selection")):($(".ls-sliders-grid").removeClass("ls-has-selection"),$("body").removeClass("ls-has-slider-selection ls-has-multiple-slider-selection ls-has-hidden-slider-selection ls-has-published-slider-selection"))};p();var g=function(e,t){t=t||{};var l,i=$(".ls-slider-list-form"),o=$('.ls-bulk-actions select[name="action"]'),s=$(".slider-item.ls-selected");switch(t.sliderItem&&(s=$(t.sliderItem)),t.selectSliderItem&&s.find(".slider-checkbox").prop("checked",!0),l=s.find("input.ls--project-name-input").val(),e){case"cancel":$(".slider-item :checkbox").prop("checked",!1),$(".slider-item.ls-selected").removeClass("ls-selected"),p();break;case"embed":f(s.data("id"),s.data("slug"));break;case"export":o.val("export"),i.submit();break;case"export-html":h()&&(o.val("export-html"),i.submit());break;case"duplicate":o.val("duplicate"),i.submit();break;case"revisions":document.location.href=s.data("revisions");break;case"hide":lsCommon.smartAlert.open({type:"confirm",width:650,title:s.length>1?LS_l10n.SLHideProjectsTitle:LS_l10n.SLHideProjectTitle.replace("%s",l),text:s.length>1?LS_l10n.SLHideProjectsText:LS_l10n.SLHideProjectText,buttons:{ok:{label:s.length>1?LS_l10n.SLHideProjectsButton:LS_l10n.SLHideProjectButton}},onConfirm:()=>{t.selectSliderItem&&s.find(".slider-checkbox").prop("checked",!0),o.val("hide"),i.submit(),t.selectSliderItem&&s.find(".slider-checkbox").prop("checked",!1)}});break;case"unhide":o.val("restore"),i.submit();break;case"group":o.val("group"),i.submit();break;case"merge":o.val("merge"),i.submit();break;case"delete":lsCommon.smartAlert.open({type:"confirm",width:650,theme:"red",title:s.length>1?LS_l10n.SLDeleteProjectsTitle:LS_l10n.SLDeleteProjectTitle.replace("%s",l),text:s.length>1?LS_l10n.SLDeleteProjectsText:LS_l10n.SLDeleteProjectText,textAlign:"center",buttons:{ok:{label:s.length>1?LS_l10n.SLDeleteProjectsButton:LS_l10n.SLDeleteProjectButton}},onConfirm:()=>{t.selectSliderItem&&s.find(".slider-checkbox").prop("checked",!0),o.val("delete"),i.submit(),t.selectSliderItem&&s.find(".slider-checkbox").prop("checked",!1)}})}t.selectSliderItem&&s.find(".slider-checkbox").prop("checked",!1)},f=function(e,t){kmw.modal.open({content:jQuery("#tmpl-embed-project"),minWidth:400,maxWidth:980,sidebar:{left:{width:300,content:jQuery("#tmpl-embed-project-sidebar")}}}).find("input.lse-shortcode").val('[layerslider id="'+(t||e)+'"]')},h=function(){if(!LS_slidersMeta.isActivatedSite)return lsDisplayActivationWindow(),!1;if(window.localStorage){localStorage.lsExportHTMLWarning||(localStorage.lsExportHTMLWarning=0);var e=parseInt(localStorage.lsExportHTMLWarning)||0;if(e<3&&(localStorage.lsExportHTMLWarning=++e,!confirm(LS_l10n.SLExportProjectHTML)))return!1}return!0},v=function(e,t){if(e){var l=$(e);l.length&&$("html,body").stop(!0,!0).animate({scrollTop:l.offset().top-50},500,(function(){t&&t()}))}},w=function(){var e={action:"ls_save_google_fonts",_wpnonce:$("#ls-global-google-fonts-nonce").text(),fonts:[]};$("#ls-global-google-fonts .ls-font-name").each((function(){e.fonts.push($(this).text())})),$.post(ajaxurl,e)};a(),r(),c(),d(),$("#ls-group-remove-area .ls-drop-area").droppable({scope:"remove-from-group",accept:".slider-item",tolerance:"pointer",over:function(e,t){t.draggable.addClass("over-drag-area"),t.helper.find(".ls-preview").addClass("cursor-default"),$(e.target).addClass("over")},out:function(e,t){t.draggable.removeClass("over-drag-area"),t.helper.find(".ls-preview").removeClass("cursor-default"),$(e.target).removeClass("over")},drop:function(e,t){$(e.target).removeClass("over"),t.draggable.removeClass("over-drag-area"),u($lastOpenedGroup,t.draggable)}});var b=function(e){e?$("#ls--admin-boxes, #ls--projects-list").removeClass("ls--not-registered").addClass("ls--registered"):$("#ls--admin-boxes, #ls--projects-list").removeClass("ls--registered").addClass("ls--not-registered")};$("#ls--license-slider").layerSlider({createdWith:"6.11.5",sliderVersion:"6.11.5",allowFullscreen:!1,firstSlide:LS_slidersMeta.isActivatedSite?2:1,autoStart:!1,startInViewport:!0,keybNav:!1,touchNav:!1,skin:"noskin",navPrevNext:!1,hoverPrevNext:!1,navStartStop:!1,navButtons:!1,showCircleTimer:!1,useSrcset:!1,skinsPath:LS_pageMeta.skinsPath})}));