").appendTo(o.$element),a=f('').val(s).appendTo(r);return new N2Classes.FormElementOnoff("modal-field-"+e,n),a},modalSelect:function(t,e,i,s,n,o){o=f.extend({isMultiple:!1},o);var r=d.modalFieldWrapper(t,e,i),a=f('').appendTo(r.$element),l=f('');for(var h in o.isMultiple&&l.attr("multiple","multiple").attr("size","8"),s)l.append('");return f('').append(l).appendTo(r.$element),new N2Classes.FormElementList("modal-field-"+e).insideChange(n),a},modalNumber:function(t,e,i,s,n){var o=100;switch((n=f.extend({unit:!1,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,wide:4,sublabel:""},n)).wide){case 2:o=20;break;case 3:o=26;break;case 4:o=32;break;case 5:o=44;break;case 6:o=60}var r=d.modalFieldWrapper(t,e,i),a=f('').appendTo(r.$element);""!==n.sublabel&&f('').text(n.sublabel).appendTo(a);var l=f('').css("width",o+"px").appendTo(a);return n.unit&&f('').text(n.unit).appendTo(a),new N2Classes.FormElementNumber("modal-field-"+e,n.min,n.max),l},modalTextarea:function(t,e,i){var s=d.modalFieldWrapper(t,e,i),n=f('').appendTo(s.$element);return f('').appendTo(n)},modalTable:function(t,e,i,s){var n=d.modalFieldWrapper(t,e,i);n.$field.addClass("n2_field_table");for(var o=f('').css("grid-template-columns","repeat("+s[0].length+", auto)").appendTo(n.$element),r=0;r'+s[r][a]+"").appendTo(o);return o},modalSelectList:function(t,e,i,s,n){n=f.extend({mode:"select"},n);var o=d.modalFieldWrapper(t,e,i),r=f('').appendTo(o.$element);return{getField:function(){return o.$field},addOption:function(t,e,i){f('').on("click",function(t,e){"select"===n.mode&&(o.$field.find(".n2_field_select_list__option--selected").removeClass("n2_field_select_list__option--selected"),f(e.currentTarget).addClass("n2_field_select_list__option--selected")),s(t)}.bind(this,i)).append(f('').text(t)).append(f('').text(e)).appendTo(r)},removeOptions:function(){r.html("")}}},modalGeneratorVariableList:function(t,e,i,s,n,o){t.addContent(this.modalHeading(n2_(i)));var r=N2Classes.UI.modalFormRow(!0);t.addContent(r);var a,l=N2Classes.UI.modalFieldWrapper(r,s,n),h=f('').appendTo(l.$element),d=[];if(Number.isInteger(e))for(var c=1;c<=e;c++)d[c]=c;else d=e;for(var p in d){var u=f('');u.text(p).on("click",function(t){a.removeClass("n2_generator_variables__variable--selected"),this.addClass("n2_generator_variables__variable--selected"),o(t)}.bind(u,p)).appendTo(h)}(a=h.find(".n2_generator_variables__variable")).eq(0).addClass("n2_generator_variables__variable--selected")},modalTabs:function(t,e,i,s){var n=f('').appendTo(t),o=f('').appendTo(n),r=f('').appendTo(n),a=!1,l={};function h(t){a&&a!==t&&(l[a].$button.removeClass("n2_modal_tab__tabs_button--active"),l[a].$content.removeClass("n2_modal_tab__tabs_content--active")),l[a=t].$button.addClass("n2_modal_tab__tabs_button--active"),l[a].$content.addClass("n2_modal_tab__tabs_content--active"),s(a)}for(var d in i)l[d]={$button:f('
'+i[d]+"
").on("click",h.bind(this,d)).appendTo(o),$content:f('').appendTo(r)};return{tabs:l,setActiveTab:h}},modalFieldSelectIcon:function(t,e,i,s,n,o){var r=d.modalFieldWrapper(t,e,i),a=f('').appendTo(r.$element);for(var l in s)f('').attr("data-value",l).toggleClass("n2_field_select_icon__option--selected",l===n).append('
").prependTo(this.$container);var i=o('').appendTo(this.$preset),s=o('').appendTo(i);o('').on("click",function(t){t.preventDefault(),this.exitPresetList(this.defs,t)}.bind(this)).appendTo(s),o('').on("click",function(t){t.preventDefault(),this.saveAsNew()}.bind(this)).appendTo(s),this.$presets=o('').insertAfter(this.$preset),o('').on("click",function(t){t.preventDefault(),this.showList()}.bind(this)).appendTo(i),o('').on("click",function(t){t.preventDefault(),this.exitPresetList(!1,t)}.bind(this)).appendTo(i),nextend.basicCSS=this}return t.prototype.showList=function(){this.inPresetList=!0,this.lastState=this.serialize(),this.$presets.on("mouseleave",function(){this.throttledUnSerialize(this.lastState)}.bind(this)),o.when(this.loadType()).done(function(t){0===this.storage[this.type].data("presets")?(N2Classes.Notification.notice(n2_("You have not created any presets for this layer yet.")),this.deActivate()):(this.$presets.append(this.storage[this.type]),o(".n2_ss_layer_window").addClass("n2_ss_layer_window--show-presets"),o(".n2_ss_layer_window__tab_container").scrollTop(0))}.bind(this))},t.prototype.activate=function(t,e,i){this.inPresetList&&this.exitPresetList(!1),this.type&&this.type!==t&&this.storage[this.type]!==r&&this.storage[this.type].detach();var s=!1;for(var n in this.defs={font:[],style:[]},this.type=t,this.assets){for(var o=0;o').data("presets",0);for(var e=0;e'+i.name+"").on({mouseenter:function(t,e){this.throttledUnSerialize(t.data)}.bind(this,i),click:function(t,e){e.preventDefault(),this.exitPresetList(t,e)}.bind(this,i.data)}).appendTo(this.storage[this.type]);if(this.storage[this.type].data("presets",this.storage[this.type].data("presets")+1),1e4').appendTo(s);o('
').on("click",this.checkOrUnCheck.bind(this)).prependTo(t),t},i.prototype.setValue=function(t,e){this.name=t.name,this.value=t.data,this.row&&this.row.find(".n2_fullscreen_editor__visual_label").text(this.name),e&&this.render()},i.prototype.activate=function(t,e){t&&t.preventDefault(),this.visualManager.changeActiveVisual(this),this.visualManager.controller.setAnimationProperties(this.value)},i.prototype.checkOrUnCheck=function(t){t.preventDefault(),t.stopPropagation(),this.checked?this.unCheck():this.check()},i.prototype.check=function(){this.checked=!0,this.row.addClass("n2_fullscreen_editor__visual--selected"),this.activate()},i.prototype.unCheck=function(){this.checked=!1,this.row.removeClass("n2_fullscreen_editor__visual--selected"),this.activate()},i}),N2D("NextendVisualSetsManager",function(e,t){return function(t){this.visualManager=t,this.$=e(this)}}),N2D("NextendVisualSet",function(i,s){function t(t,e){this.set=t,this.visualManager=e,this.visualList=i(''),this.visualManager.sets[t.id]=this,""!==t.referencekey&&(this.visualManager.setsByReference[t.referencekey]=t),this.visualManager.setsSelector&&(this.option=i('').text(t.value).appendTo(this.visualManager.setsSelector))}return t.prototype.active=function(){i.when(this._loadVisuals()).done(function(){this.visualList.appendTo(this.visualManager.visualListContainer)}.bind(this))},t.prototype.notActive=function(){this.visualList.detach()},t.prototype.loadVisuals=function(t){if(this.visuals===s){this.visuals={};for(var e=0;e').appendTo(this.lightbox.find(".n2_fullscreen_editor__content_sidebar")),this.parameters=t,this.visuals={},this.controller=this.initController(),this.controller&&(this.renderer=this.controller.renderer),this.firstLoadVisuals(t.visuals),this.lightbox.find(".n2_fullscreen_editor__save_as_new").on("click",this.saveAsNew.bind(this)),this.cancelButton=this.lightbox.find(".n2_fullscreen_editor__cancel").on("click",this.hide.bind(this)),this.saveButton=this.lightbox.find(".n2_fullscreen_editor__save"),this.setVisual!==n&&this.saveButton.on("click",this.setVisual.bind(this))}return t.prototype.loadDefaults=function(){this.mode="linked",this.labels={visual:"visual",visuals:"visuals"},this.visualLoadDeferreds={},this.showParameters=!1},t.prototype.firstLoadVisuals=function(t){for(var e in t)this.sets[e].loadVisuals(t[e])},t.prototype.initController=function(){},t.prototype.getVisual=function(t){if(0
').prependTo(i),i}function e(t,e){this.url=t,this.uploadAllowed=parseInt(e),this.currentPath=localStorage.getItem("browsePath")||"";var i=null;this.node=n('').on("dragover",function(t){null!==i?(clearTimeout(i),i=null):n(t.currentTarget).addClass("n2-drag-over"),i=setTimeout(function(){n(t.currentTarget).removeClass("n2-drag-over"),i=null},400)}),nextend.browse=this}return e.prototype.clear=function(){this.uiFileUpload&&this.uiFileUpload.destroy(),this.node.empty()},e.prototype.getNode=function(t,e){return this.clear(),this.node.attr("data-mode",t),"multiple"===(this.mode=t)&&(this.selected=[]),this.callback=e,this._loadPath(this.getCurrentFolder(),this._renderBoxes.bind(this)),this.node},e.prototype._renderBoxes=function(t){for(var e in this.clear(),localStorage.setItem("browsePath",this.getCurrentFolder()),n('
").appendTo(this.node).on("click",function(t){this._loadPath(t,this._renderBoxes.bind(this))}.bind(this,t.directories[e]));for(var i in t.files)if(t.files.hasOwnProperty(i)){var s=o(i,t.files[i]).appendTo(this.node).on("click",this.clickImage.bind(this,t.files[i]));"multiple"===this.mode&&-1!==this.selected.indexOf(t.files[i])&&s.addClass("n2_modal_filesystem_box--active")}},e.prototype._loadPath=function(e,i){s[e]===t&&(s[e]=N2Classes.AjaxHelper.ajax({type:"POST",url:N2Classes.AjaxHelper.makeAjaxUrl(this.url),data:{path:e},dataType:"json"})),n.when(s[e]).done(function(t){this.currentPath=t.data.path,s[t.data.path]=t,s[e]=t,i(t.data)}.bind(this))},e.prototype.initUpload=function(){n('').append('
").on("click",function(t){t.preventDefault(),this.activate()}.bind(this)).appendTo(this.manager.$list)}return t.prototype.load=function(){this.data.isLoaded===e&&(i("head").append(""),this.data.isLoaded=!0)},t.prototype.render=function(){if(this.table===e){for(var t in this.table=N2Classes.UI.modalFormTable(this.data.label),this.data.data)i('
').on({mouseenter:function(){this.sliderPreview.setTempLabel(this.getLabel())}.bind(this),mouseleave:function(){this.sliderPreview.resetLabel()}.bind(this),click:function(){this.sliderPreview.setDimensions(this.width,this.height),this.sliderPreview.setCurrentDevice(this)}.bind(this)}).prependTo(t.$ruler),this.refreshScale()}function a(t,e){this.sliderPreview=t,this.id=e,this.top=0,this.$tip=o('').appendTo(this.sliderPreview.$infoState)}return t.prototype.init=function(){this.$fieldWidth=o(".n2_preview_toolbar__width").on("click",function(){"true"!==this.$fieldWidth[0].contentEditable&&new N2Classes.InlineTextEditor(this.$fieldWidth[0],{filter:s,onSave:function(t){(t=parseInt(t))?this.setWidth(t):this.onResize()}.bind(this),onCancel:function(){this.onResize()}.bind(this)})}.bind(this)),this.$fieldHeight=o(".n2_preview_toolbar__height").on("click",function(){"true"!==this.$fieldHeight[0].contentEditable&&new N2Classes.InlineTextEditor(this.$fieldHeight[0],{filter:s,onSave:function(t){(t=parseInt(t))?this.setHeight(t):this.onResize()}.bind(this),onCancel:function(){this.onResize()}.bind(this)})}.bind(this)),this.$fieldScale=o(".n2_preview_toolbar__scale").on("change",function(){this.setScale(this.$fieldScale.val()/100)}.bind(this)),this.devices=[],this.$ruler=o(".n2_preview__ruler"),new r(this,n2_("Mobile")+" S",375,667),new r(this,n2_("Mobile")+" L",425,756),new r(this,n2_("Tablet"),768,1024),new r(this,n2_("Laptop"),1024,768),new r(this,n2_("Laptop")+" L",1440,900),new r(this,"Full HD",1920,1080),new r(this,"4K",2560,1440),this.$label=o(".n2_preview__ruler_label"),this.$infoState=o(".n2_preview__device_info_state"),this.$infoTip=o(".n2_preview__device_info .ssi_16"),this.$screen=o(".n2_preview__device_screen"),this.$notification=o('').appendTo(this.$screen),this.$screenInner=o(".n2_preview__device_screen_inner"),o(".n2_preview__resize_width").on("mousedown",function(t){t.preventDefault(),n.dragShow(),o("body").addClass("n2_body--resize-horizontal");var i=t.clientX,s=Math.floor(this.$screenInner.width()/this.scale);n.dragUpdate(t,n2_("Width")+": "+Math.max(320,Math.ceil(s))+"px"),o(document).on({"mousemove.resize":function(t){var e=Math.floor(s-2*(i-t.clientX)/this.scale);this.setWidth(e),this.removeCurrentDevice(),n.dragUpdate(t,n2_("Width")+": "+Math.max(320,Math.ceil(e))+"px")}.bind(this),"mouseup.resize":function(){n.dragHide(),o(document).off(".resize"),o("body").removeClass("n2_body--resize-horizontal")},"mouseleave.resize":function(){n.dragHide(),o(document).off(".resize"),o("body").removeClass("n2_body--resize-horizontal")}})}.bind(this)),o(".n2_preview__resize_height").on("mousedown",function(t){t.preventDefault(),n.dragShow(),o("body").addClass("n2_body--resize-vertical");var i=t.clientY,s=Math.floor(this.$screenInner.height()/this.scale);n.dragUpdate(t,n2_("Height")+": "+Math.max(320,s)+"px"),o(document).on({"mousemove.resize":function(t){var e=Math.floor(s-(i-t.clientY)/this.scale);this.setHeight(e),this.removeCurrentDevice(),n.dragUpdate(t,n2_("Height")+": "+Math.max(320,e)+"px")}.bind(this),"mouseup.resize":function(){n.dragHide(),o(document).off(".resize"),o("body").removeClass("n2_body--resize-vertical")}})}.bind(this)),o(".n2_button_preview_orientation").on("click",function(t){t.preventDefault(),this.removeCurrentDevice(),this.setDimensions(this.$screenInner.height()/this.scale,this.$screenInner.width()/this.scale)}.bind(this)),o(".n2_button_preview_reload").on("click",function(t){t.preventDefault(),this.reload()}.bind(this)),o(window).on("resize",this.onResize.bind(this)),this.onResize()},t.prototype.reload=function(){o(".n2_preview form").trigger("submit")},t.prototype.onResize=function(){this.$fieldWidth.text(Math.floor(this.$screenInner.width()/this.scale)),this.$fieldHeight.text(Math.floor(this.$screenInner.height()/this.scale))},t.prototype.displayNotification=function(t){this.notificationTimeout&&clearTimeout(this.notificationTimeout),this.$notification.text(t).addClass("n2_preview__notification_scale--visible"),this.notificationTimeout=setTimeout(function(){this.$notification.removeClass("n2_preview__notification_scale--visible"),delete this.notificationTimeout}.bind(this),600)},t.prototype.setScale=function(t){this.displayNotification(100*t+"%");var e=this.scale;this.scale=t,o("body").addClass("n2_body--scale-preview"),setTimeout(function(){o("body").removeClass("n2_body--scale-preview")},1500),this.$screen=o(".n2_preview__device_screen");var i=this.$screenInner.width(),s=this.$screenInner.height();this.$frame.css({transform:"scale("+this.scale+")",width:1/this.scale*100+"%",height:1/this.scale*100+"%",marginLeft:(100-1/this.scale*100)/2+"%",marginRight:(100-1/this.scale*100)/2+"%"});for(var n=0;n"+n2_("Orientation")+": "+(e?n2_("Landscape"):n2_("Portrait"))),i<=0?n.push(""+n2_("Size")+": "+n2_sprintf(n2_("Below %s pixels."),s)):1e5<=s?n.push(""+n2_("Size")+": "+n2_sprintf(n2_("Above %s pixels."),i)):n.push(""+n2_("Size")+": "+n2_sprintf(n2_("Between %s and %s pixels."),i,s)),this.$infoTip.data("formTip")?this.$infoTip.data("formTip").setDescription(n.join(" ")):this.$infoTip.data("tip-description",n.join(" "))},t.prototype.updateFrameScrollTop=function(t){this.frameScrollTop=t.scrollTop,this.updateActive()},t.prototype.updateDeviceInfo=function(t){this.sliderInfos[t.id]===e&&(this.sliderInfos[t.id]=new a(this,t.id)),this.sliderInfos[t.id].update(t),this.updateActive()},t.prototype.updateActive=function(){var t=!1,e=Number.POSITIVE_INFINITY;for(var i in this.sliderInfos)this.sliderInfos[i].top').appendTo(e),this.$label=i('').appendTo(this.$notice),this.$description=i('').appendTo(this.$notice),setTimeout(function(){this.slider.sliderElement.on("SliderResize",NextendDeBounce(this.update.bind(this),300)),this.update()}.bind(this),1e3)},l.prototype.update=function(){var t,e,i,s,n=this.responsive.minimumSlideHeight,o=Number.POSITIVE_INFINITY,r=[];for(s=0;s'+r[s].group.$element.data("title")+"");this.$description.html(n2_sprintf(n2_("The height of this slide increased because the following slides are much higher: %s."),a.join(", "))),this.$notice.addClass("n2_slide_editor_tall_slide_detector--visible"),this.$noticeMarker.addClass("n2_device_changer__button--marked")}else this.$notice.removeClass("n2_slide_editor_tall_slide_detector--visible"),this.$noticeMarker.removeClass("n2_device_changer__button--marked")},l}),N2D("SliderChangeType",function(e,t){function i(t){(nextend.changeSliderType=this).options=e.extend({types:{},currentType:"simple",ajaxUrl:""},t),N2R("documentReady",this.onReady.bind(this))}return i.prototype.onReady=function(){e(".n2_slider_action__change_slider_type").on("click",this.showModal.bind(this))},i.prototype.showModal=function(t){t&&t.preventDefault();var e=new N2Classes.ModalSimple("activate",{destroyOnHide:!0,width:630});e.addContent(N2Classes.UI.modalIcon("ssi_48 ssi_48--convert","blue")),e.addContent(N2Classes.UI.modalHeading(n2_("Change slider type")));var i=N2Classes.UI.modalFormRow(!0);e.addContent(i),N2Classes.UI.modalNotice(i,n2_("Changing your slider type is irreversible. After changing your slider type, you will lose all slider type related settings."),"notice");var s=N2Classes.UI.modalFormRow(!0);e.addContent(s);var n=N2Classes.UI.modalFieldSelectIcon(s,"slider-type",n2_("Slider type"),this.options.types,this.options.currentType),o=N2Classes.UI.modalButton(n2_("Convert"),"blue");e.addButton(o),o.on("click",function(t){t.preventDefault(),this.convertSliderType(n.val()),e.hide()}.bind(this)),e.show()},i.prototype.convertSliderType=function(t){this.options.currentType!==t&&N2Classes.AjaxHelper.ajax({type:"POST",url:this.options.ajaxUrl,data:{targetSliderType:t},dataType:"json"}).done(function(){window.location.reload()})},i}),N2D("CreateSlider",function(f,t){function e(t,e,i,s,n,o){this.groupID=t,this.ajaxUrl=e,this.userEmail=s,this.shouldSkipLicenseModal=i,this.skipNewsletter=n,this.importUrl=o,f(".n2_slider_manager__new_slider").on("click",this.createProject.bind(this)),"createslider"===window.location.hash.substring(1)&&this.createProject()}return e.prototype.createProject=function(){var e=new N2Classes.ModalSimple("new-project",{destroyOnHide:!0,width:1e3}),t=f('');e.addContent(t),f('').text(n2_("What do you want to create today?")).appendTo(t),f('').text(n2_("Use our powerful visual editor, or simply import one of our existing template.")).appendTo(t);var i=f('').appendTo(t),s=f('').on("click",function(t){this.createSlider(),e.hide(t)}.bind(this)).appendTo(i);f('').appendTo(s),f('').text(n2_("Create a New Project")).appendTo(s),f('').text(n2_("Start a new project from scratch and build exactly what you’ve imagined. You can easily customize every pixels and create anything with layers.")).appendTo(s);var n=f('').on("click",function(t){this.showExampleSlidersWindow(),e.hide(t)}.bind(this)).appendTo(i);f('').appendTo(n),f('').text(n2_("Start with a Template")).appendTo(n),f('').text(n2_("Start with a template and make it your own with the innovative drag and drop interface. You can choose from hundreds of premade templates.")).appendTo(n),f('').text(n2_("or import your own files")).appendTo(t),e.show()},e.prototype.createSlider=function(){var t=new N2Classes.ModalSimple("create-new-project",{destroyOnHide:!0,width:900}),e=f('');t.addContent(e),f('').text(n2_("Create new project")).appendTo(e);function i(){var t=n.val();o.toggleClass("n2_form_element--hidden","block"===t)}var s=N2Classes.UI.modalFormRowLarge().appendTo(e),n=N2Classes.UI.modalFieldSelectIcon(s,"project-type",n2_("Project type"),{slider:{icon:"ssi_64 ssi_64--fullwidthslider",label:n2_("Slider")},block:{icon:"ssi_64 ssi_64--block",label:n2_("Block")}},"slider");n.on("nextendChange",i);var o=N2Classes.UI.modalFormContainer(e,"slider-settings-container"),r=N2Classes.UI.modalFormRowLarge().appendTo(o);N2Classes.UI.modalFieldSelectIcon(r,"slider-type",n2_("Slider type"),{simple:{icon:"ssi_64 ssi_64--slider",label:n2_("Simple")},carousel:{icon:"ssi_64 ssi_64--carousel",label:n2_("Carousel")},showcase:{icon:"ssi_64 ssi_64--showcase",label:n2_("Showcase")}},"simple").on("nextendChange",i),r.find('.n2_field_select_icon__option:not([data-value="simple"])').css({"pointer-events":"none",opacity:"0.5"}).find(".n2_field_select_icon__option_label").append(document.createTextNode(" ("+n2_("Pro")+")")),N2Classes.UI.modalSubHeading(n2_("Settings")).appendTo(e);var a=N2Classes.UI.modalFormRow().appendTo(e),l=N2Classes.UI.modalFieldText(a,"project-name",n2_("Name"),n2_("My project")).css("width","200px"),h=N2Classes.UI.modalNumber(a,"slider-width",n2_("Width"),1200,{min:200,unit:"px"}),d=N2Classes.UI.modalNumber(a,"slider-height",n2_("Height"),600,{min:100,unit:"px"}),c={boxed:n2_("Boxed"),fullwidth:n2_("Full width"),fullpage:n2_("Full page")},p=N2Classes.UI.modalSelect(a,"slider-responsive-mode",n2_("Layout"),c,"fullwidth");a.find('option[value="fullpage"]').attr("disabled","disabled").text(n2_("Full page")+" ("+n2_("Pro")+")");var u=N2Classes.UI.modalButton(n2_("Create"),"green").on("click",function(t){t.preventDefault();var e={groupID:this.groupID,projectName:l.val(),projectType:n.val(),sliderWidth:parseInt(h.val()),sliderHeight:parseInt(d.val()),responsiveMode:p.val()};N2Classes.AjaxHelper.ajax({type:"POST",url:N2Classes.AjaxHelper.makeAjaxUrl(this.ajaxUrl,{nextendaction:"create"}),data:e,dataType:"json"}).done(function(t){N2Classes.LoadingScreen.startLoading()}.bind(this))}.bind(this));t.addButton(u),i(),t.show()},e.prototype.showExampleSlidersWindow=function(){var i=this;f("body").css("overflow","hidden");function s(){f("body").css("overflow",""),t.remove(),window.removeEventListener("message",e,!1)}function n(t){N2Classes.AjaxHelper.ajax({type:"POST",url:N2Classes.AjaxHelper.makeAjaxUrl(i.ajaxUrl,{nextendaction:"importDemo"}),data:{groupID:i.groupID,key:N2Classes.Base64.encode(t.replace(/^(http(s)?:)?\/\//,"//"))},dataType:"json"}).fail(function(){})}var t=f('').css({position:"fixed",zIndex:"100000",left:"0",top:"0",width:"100%",height:"100%"}).appendTo("body"),e=function(t){if("http://smartslider3.com"===t.origin||"https://smartslider3.com"===t.origin){var e=t.data;switch(e.key){case"importSlider":return void(i.skipNewsletter?n(e.data.href):i.joinCommunity(function(){n(e.data.href)}));case"closeWindow":s()}}};N2Classes.Esc.add(function(){return s(),!0}.bind(this)),window.addEventListener("message",e,!1)},e.prototype.joinCommunity=function(e){function i(t,e){N2Classes.AjaxHelper.ajax({type:"POST",url:N2Classes.AjaxHelper.makeAjaxUrl(N2Classes.AjaxHelper.getAdminUrl("ss3-admin"),{nextendcontroller:"settings",nextendaction:e||"dismissNewsletterSampleSliders"}),dataType:"json"})}this.modal=new N2Classes.ModalSimple("url-modal"),this.modal.addContent(N2Classes.UI.modalIcon("ssi_48 ssi_48--newsletter","purple")),this.modal.addContent(N2Classes.UI.modalHeading(n2_("Join The Smart Slider 3 Community"))),this.modal.addContent(N2Classes.UI.modalParagraph(n2_("Join more than 120,000 subscribers and get access to the latest slider templates, tips, tutorials and other exclusive contents directly to your inbox.")).css("margin-bottom","12px")),this.modal.$modalBody.css("text-align","center");var s=f("");s.append(N2Classes.UI.modalInput("EMAIL","email","","example@google.com")),s.append(N2Classes.UI.modalInput(N2PLATFORM.toUpperCase(),"hidden","Yes")),s.append(N2Classes.UI.modalInput("SOURCE","hidden","Smart Slider 3")),this.modal.addContent(s);var t=N2Classes.UI.modalButton(n2_("Subscribe"),"purple");this.modal.addButton(t),t.on("click",function(t){N2Classes.AjaxHelper.ajax({type:"POST",url:"https://secure.nextendweb.com/mailchimp/subscribe.php",data:s.serialize(),dataType:"json"}).done(function(){e()}),i(0,"subscribed")}.bind(this)),this.modal.$modalBodyOuter.find(".n2_modal__close").on("click",function(t){i(),e()}),this.modal.show()},e}),N2D("SliderEdit",function(n,o){function t(t){this.options=n.extend({previewInNewWindow:!1,saveAjaxUrl:"",previewUrl:"",ajaxUrl:"",formData:{}},t),this.url=this.options.ajaxUrl,this.values=this.options.formData,N2Classes.Form.prototype.constructor.call(this),N2R("documentReady",this.onReady.bind(this))}return((t.prototype=Object.create(N2Classes.Form.prototype)).constructor=t).prototype.onReady=function(){this.setID("#n2-ss-edit-slider-form"),N2Classes.Form.prototype.onReady.call(this),this.$form.on("submit",this.onSaveSubmit.bind(this)),this.initPreview()},t.prototype.onKeyDown=function(t){var e=!1;return(t.ctrlKey||t.metaKey)&&49===t.keyCode&&(this.showPreview(),e=!0),e?t.preventDefault():e=N2Classes.Form.prototype.onKeyDown.call(this,t),e},t.prototype.initButtons=function(){this.$saveButton=n(".n2_slider_settings_save").on("click",this.actionSave.bind(this)),n(".n2_slider_settings_back").on("click",this.actionCancel.bind(this))},t.prototype.actionSave=function(t){t&&t.preventDefault(),this.skipChangeConfirm=!0,this.$form.trigger("submit")},t.prototype.actionCancel=function(t){t&&t.preventDefault(),window.location=t.currentTarget.href},t.prototype.onSaveSubmit=function(t){this.$form.attr("target")===o&&(t.preventDefault(),N2Classes.AjaxHelper.ajax({type:"POST",url:this.options.saveAjaxUrl,data:this.$form.serialize(),dataType:"json",success:this.onAfterSave.bind(this)}))},t.prototype.onAfterSave=function(t){if(n(".n2_header__heading_primary").text(n("#slidertitle").val()),t&&t.data&&t.data.changedFields){for(var e in t.data.changedFields)t.data.changedFields.hasOwnProperty(e)&&n("#"+e).val(t.data.changedFields[e]);if(t.data.changedFields.slideralias!==o){var i=t.data.changedFields[e],s=n('.n2_ss_slider_publish__option_code[data-mode="alias"]');s.length||(s=n('').insertAfter(n('.n2_ss_slider_publish__option_code[data-mode="id"]'))),i?s.text('[smartslider3 alias="'+i+'"]'):s.remove()}}this.afterSave()},t.prototype.initPreview=function(){this.options.previewInNewWindow||(this.modal=new N2Classes.ModalIframe("preview-slider")),n(".n2_top_bar_main__preview").on("click",function(t){t.preventDefault(),this.showPreview()}.bind(this))},t.prototype.showPreview=function(){"main"===N2Classes.WindowManager.getCurrentWindow()&&(this.options.previewInNewWindow?N2Classes.PreviewPopup("","preview-slider"):this.modal.show(),this.$form.attr({action:N2Classes.AjaxHelper.makeAjaxUrl(this.options.previewUrl,{nextendaction:this.options.previewInNewWindow?"index":"slider"}),target:"preview-slider"}).trigger("submit").attr({action:this.formAction,target:null}))},t}),N2D("SliderImport",function(t,e){function i(t){N2Classes.Form.prototype.constructor.call(this),N2R("documentReady",this.onReady.bind(this))}return((i.prototype=Object.create(N2Classes.Form.prototype)).constructor=i).prototype.onReady=function(){this.setID("#n2-ss-form-slider-import"),N2Classes.Form.prototype.onReady.call(this),this.$localImportSwitch=t("#sliderupload_or_local"),this.$localImport=t("#sliderlocal-import-file"),this.$uploadImport=t("#sliderimport-file"),this.$form.on("submit",this.onSubmit.bind(this))},i.prototype.onChange=function(){this.hasChange=!1,parseInt(this.$localImportSwitch.val())?""!==this.$localImport.val()&&(this.hasChange=!0):""!==this.$uploadImport.val()&&(this.hasChange=!0),this.$saveButton.toggleClass("n2_button--inactive",!this.hasChange)},i.prototype.initButtons=function(){this.$saveButton=t(".n2_slider_import").on("click",this.actionSave.bind(this)),t(".n2_slider_import_back").on("click",this.actionCancel.bind(this))},i.prototype.actionSave=function(t){t&&t.preventDefault(),this.skipChangeConfirm=!0,this.$form.trigger("submit"),this.afterSave()},i.prototype.actionCancel=function(t){t&&t.preventDefault(),window.location=t.currentTarget.href},i.prototype.onSubmit=function(t){t.preventDefault();var e=new FormData(this.$form[0]);N2Classes.AjaxHelper.ajax({type:"POST",contentType:!1,url:this.$form.attr("action"),processData:!1,data:e,dataType:"json"})},i}),N2D("ManageSliders",function(l,t){function e(t,e,i){this.groupID=t,this.exportAllUrl=e.exportAllUrl,this.ajaxUrl=e.ajaxUrl,this.previewUrl=e.previewUrl,this.importUrl=e.importUrl,this.sliders=[],this.sliderPanel=l(".n2_slider_manager"),this.orderBy="ordering"===this.sliderPanel.data("orderby"),this.slidersContainer=this.sliderPanel.find(".n2_slider_manager__content");for(var s=this.slidersContainer.find(".n2_slider_box"),n=0;n .n2_slider_box",stop:this.saveOrder.bind(this),placeholder:"n2_slider_manager__sortable_placeholder",distance:10};this.uiSortable=new N2Classes.UISortable(this.slidersContainer,t)}},e.prototype.saveOrder=function(t,e){var i,s=this.slidersContainer.find(".n2_slider_box"),n=[],o=[],r=[];for(i=0;i'),this.modal.addContent(this.$content)}return n.prototype.setSkipGroup=function(t){this.skipGroup=t},n.prototype.setTitle=function(t){this.modal.setTitle(t)},n.prototype.displayList=function(t){t===e&&(t=0),this.cache[t]===e?N2Classes.AjaxHelper.ajax({url:this.ajaxUrl,type:"POST",data:{parentID:t}}).done(function(t,e){this.cache[t]=e.data,this.renderResponse(t,e.data)}.bind(this,t)):this.renderResponse(t,this.cache[t])},n.prototype.renderResponse=function(e,t){this.$content.html(""),this.selectedSlider=[0],this.modal.insertButton.addClass("n2_button--inactive"),0').append(d('').append(d('').append(d('
').appendTo(e)}return e.prototype.enableActiveForced=function(){this.forceEnabledCounter++,this._enable()},e.prototype.disableActiveForced=function(){this.forceEnabledCounter=Math.max(0,this.forceEnabledCounter-1),this._disable()},e.prototype.disable=function(){this.disabledCounter++,this._disable()},e.prototype._disable=function(){0===this.forceEnabledCounter&&1===this.disabledCounter&&this.blurComponent()},e.prototype.enable=function(){this.disabledCounter=Math.max(0,this.disabledCounter-1),this._enable()},e.prototype._enable=function(){(0"),e=this.mainContainer.container.getAllLayers(),i=0;i"),s=p("").appendTo(i);for(var n in t)i.data(n,t[n]);return e!==u&&i.appendTo(e),this.dataToLayers(t.layers,s),i},t.prototype.buildRowNode=function(t,e){var i=p(""),s=p("").appendTo(i);for(var n in this._buildNodePrepareID(i,t),t)i.data(n,t[n]);return e!==u&&i.appendTo(e),this.dataToLayers(t.cols,s),i},t.prototype.buildColNode=function(t,e){var i=p(""),s=p("").appendTo(i);for(var n in t)i.data(n,t[n]);return e!==u&&i.appendTo(e),this.dataToLayers(t.layers,s),i},t.prototype.buildLayerNode=function(t,e){var i=p("").attr("style",t.style);for(var s in this._buildNodePrepareID(i,t),t.items!==u&&(t.item=t.items[0],delete t.items),p('').data("item",t.item.type).data("itemvalues",t.item.values).appendTo(i),delete t.style,delete t.item,t)i.data(s,t[s]);return e!==u&&i.appendTo(e),i},t.prototype.getSelf=function(){return this},t}),N2D("AddLayer",function(d,e){function t(t){this.fragmentEditor=t,this.sectionLibraryFree=t.editor.options.sectionLibraryFree,this.sectionLibraryUrl=t.editor.options.sectionLibraryUrl,this.sectionLibraryGoProUrl=t.editor.options.sectionLibraryGoProUrl;try{localStorage.removeItem("SectionFreeThemeorion_dark"),localStorage.removeItem("SectionFreeThemeorion_darkMetaDate"),localStorage.removeItem("SectionFreeThemeorion_light"),localStorage.removeItem("SectionFreeThemeorion_lightMetaDate"),localStorage.removeItem("SectionFreeThemes"),localStorage.removeItem("SectionFreeThemesMetaDate"),localStorage.removeItem("SectionProThemeorion_dark"),localStorage.removeItem("SectionProThemeorion_darkMetaDate"),localStorage.removeItem("SectionProThemeorion_light"),localStorage.removeItem("SectionProThemeorion_lightMetaDate"),localStorage.removeItem("SectionProThemes"),localStorage.removeItem("SectionProThemesMetaDate")}catch(t){}this.visible=!1,this.$editor=d(".n2_admin_editor"),this.$editorOverlay=d(".n2_admin_editor_overlay"),this.$addLayer=d(".n2_add_layer"),d(".n2_add_layer__bar_button_add").on("click",function(t){t.preventDefault(),this.toggleActive()}.bind(this)),this.$addLayer.find(".n2_add_layer_box"),this.hideInteractionCallback=this.hideInteraction.bind(this),this.onKeyDownCallback=this.onKeyDown.bind(this),this.initTabs(),this.initPositionChanger()}return t.prototype.hide=function(){this.visible=!0,this.toggleActive()},t.prototype.hideInteraction=function(t){d.contains(this.$addLayer[0],t.target)||this.$addLayer.is(t.target)||this.hide()},t.prototype.onKeyDown=function(t){27===t.keyCode&&(t.stopImmediatePropagation(),t.preventDefault(),this.hide())},t.prototype.toggleActive=function(){this.visible=!this.visible,d("body").toggleClass("n2_body--show-add-more",this.visible),this.$editorOverlay.toggleClass("n2_admin_editor_overlay--show-add-more",this.visible),this.visible?(this.$editor[0].addEventListener("click",this.hideInteractionCallback,{capture:!0}),document.addEventListener("keydown",this.onKeyDownCallback,{capture:!0})):(this.$editor[0].removeEventListener("click",this.hideInteractionCallback,{capture:!0}),document.removeEventListener("keydown",this.onKeyDownCallback,{capture:!0}),this.setPosition("default"))},t.prototype.initTabs=function(){this.$buttons=d(".n2_add_layer__more_tab_button").on("click"),this.$tabs=d(".n2_add_layer__more_tab"),this.valuesDict={};for(var t=0;t').appendTo(this.valuesDict.library.$tab),d('').text(n2_("Theme")).appendTo(this.$themesTitle),this.displayThemes()},t.prototype.displayThemes=function(){N2Classes.AjaxHelper.ajax({type:"GET",url:this.sectionLibraryUrl+"/themes/",dataType:"json"}).done(function(t){this.onThemesLoaded(t.themes)}.bind(this))},t.prototype.onThemesLoaded=function(t){for(var e=d('').appendTo(this.$themesTitle),i=d('').appendTo(e),s=0;s'+t[s].label+"");this.displayTheme(t[0].id),i.on("change",function(){this.displayTheme(i.val())}.bind(this))},t.prototype.displayTheme=function(t){this.activeThemeID!==t&&(this.activeThemeID&&this.themes[this.activeThemeID].removeClass("n2_add_layer_library__theme--active"),this.activeThemeID=t,this.themes[t]===e?N2Classes.AjaxHelper.ajax({type:"GET",url:this.sectionLibraryUrl+"/theme/"+t,dataType:"json"}).done(function(t,e){this.onThemeLoaded(e.theme)}.bind(this,t)):this.themes[t].addClass("n2_add_layer_library__theme--active"))},t.prototype.onThemeLoaded=function(t){if(function(t,e){t=t.split("."),e=e.split(".");for(var i=Math.min(t.length,e.length),s=0;se[s])return!0;if(t[s]=e.length}(N2SS3VERSION,t.version)){var e=d('').appendTo(this.valuesDict.library.$tab);this.themes[t.id]=e;for(var i=0;i').appendTo(e),o=d('').on("click",function(t){t.toggleClass("n2_add_layer_library_tag--active")}.bind(this,n)).appendTo(n);d('').text(s.label).appendTo(o),d('
').prependTo(this.$rowLabel)},o.prototype.update=function(){this.readyDeferred.done(this.placement.updatePositionThrottled.bind(this.placement))},o.prototype.updateThrottled=function(){this.placement.updatePositionThrottled()},o.prototype.getHTML=function(t){var e=this._createLayer();for(var i in e.attr("data-pm",this.placement.getType()),this.property)"width"!=i&&"height"!=i&&"left"!=i&&"top"!=i&&e.attr("data-"+i.toLowerCase(),this.property[i]);for(var i in this.deviceProperty)for(var s in this.deviceProperty[i])e.attr("data-"+i.toLowerCase()+s,this.deviceProperty[i][s]);for(var i in this.deviceProperty.desktop)e.css(i,this.deviceProperty.desktop[i]+"px");if(this.container!==l){var n=e;this.innerContainer!==l&&(n=e.find(this.innerContainer)),n.append(this.container.getHTML(t))}var o=this.getProperty("id");return""!==o&&e.attr("id",o),this.status>N2Classes.ComponentAbstract.STATUS.NORMAL&&e.attr("data-status",this.status),e},o.prototype.duplicate=function(t){var e=this.getHTML(!1);if("absolute"===this.placement.getType()){var i=e.attr("id");i&&(i=a.fn.uid(),e.attr("id",i),e.attr("data-id",i)),e.attr("data-parentid")?(e.data("desktopportraittop",0),e.data("desktopportraitleft",0)):(e.data("desktopportraittop",e.data("desktopportraittop")+40),e.data("desktopportraitleft",e.data("desktopportraitleft")+40)),e.attr("data-parentid","")}var s=this.fragmentEditor.insertComponentWithNode(this.group,e,this.getIndex()+1,!1,!0);return this.layerRow.trigger("mouseleave"),t&&s.activate(),N2Classes.History.get().addSimple(this,this.historyDeleteDuplicated,this.historyDuplicate,[s,!!s.container&&s.container.getAllLayers()]),s},o.prototype.historyDeleteDuplicated=function(t){t.getSelf().delete()},o.prototype.historyDuplicate=function(t,e){var i=this.duplicate(!1);if(t.setSelf(i),e)for(var s=i.container.getAllLayers(),n=0;nN2Classes.ComponentAbstract.STATUS.NORMAL&&(e.status=this.status);var i=a.extend({},this.property);for(var s in this.deviceProperty)for(var n in this.deviceProperty[s]){delete i[n];var o=this.deviceProperty[s][n];if(o!==l){switch(n){case"width":case"height":this.isDimensionPropertyAccepted(o)||(o=parseFloat(o));break;case"fontsize":case"left":case"top":case"gutter":case"wrap":o=parseFloat(o)}e[s.toLowerCase()+n]=o}}for(var r in i)e[r.toLowerCase()]=i[r];return e},o.prototype.onChildCountChange=function(){},o.prototype.getDataWithChildren=function(t,e){return-1===e.indexOf(this)&&(e.push(this),t.push(this.getData({layersIncluded:!0,itemsIncluded:!0})),this.layer.triggerHandler("LayerGetDataWithChildren",[t,e])),t},o.prototype.markOver=function(){this.layer.addClass("n2-ss-mouse-over"),this.group&&this.group.markEnter()},o.prototype.markOut=function(){this.layer.removeClass("n2-ss-mouse-over"),this.group&&this.group.markLeave()},o.prototype.markEnter=function(t){this.layer.addClass("n2-ss-mouse-hover"),this.group.markEnter()},o.prototype.markLeave=function(t){this.layer.removeClass("n2-ss-mouse-hover"),this.group.markLeave()},o.prototype.sync=function(){if(this._syncid(),this.container)for(var t=this.container.getSortedLayers(),e=0;e"+e.replace(/@rule/g,window.nextend.pre+"."+r)+"").appendTo("head"))}},o.prototype.addLocalStyle=function(t,e,i){for(var s=0;s').appendTo(t),i=h('
").appendTo(this.$item),this.$item.find("p").addClass(t.fontclass+" "+t.styleclass)};var p=new RegExp("(<((?=!--|!\\[CDATA\\[)((?=!-)!(?:-(?!->)[^\\-]*)*(?:--\x3e)?|!\\[CDATA\\[[^\\]]*(?:](?!]>)[^\\]]*)*?(?:]]>)?)|[^>]*>?))");return t}),N2D("ItemVimeo",["Item"],function(n,s){"use strict";function t(){this.type="vimeo",N2Classes.Item.prototype.constructor.apply(this,arguments)}return((t.prototype=Object.create(N2Classes.Item.prototype)).constructor=t).needWidth=!0,t.prototype.getLabel=function(){return"Vimeo"},t.prototype.hasTextScale=function(){return!1},t.prototype.added=function(){this.needFill=["vimeourl"],this.generator.registerField("#item_vimeovimeourl")},t.prototype.parseAll=function(e){var t=this.values.vimeourl!=e.vimeourl;if(N2Classes.Item.prototype.parseAll.apply(this,arguments),""==e.image&&(e.image="$ss3-frontend$/images/placeholder/video.png"),e.image=nextend.imageHelper.fixed(e.image),t&&""!=e.vimeourl){var i=e.vimeourl.match(/https?:\/\/(?:www\.|player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|video\/|)(\d+)(?:$|\/|\?)/),s=!1;i?s=i[3]:e.vimeourl.match(/^[0-9]+$/)&&(s=e.vimeourl),s?N2Classes.AjaxHelper.getJSON("https://vimeo.com/api/v2/video/"+encodeURI(s)+".json").done(function(t){n("#item_vimeoimage").val(t[0].thumbnail_large).trigger("change")}.bind(this)).fail(function(t){0==e.privateurl&&N2Classes.Notification.error("Video not found or private.")}):N2Classes.Notification.error("The provided URL does not match any known Vimeo url or code.")}},t.prototype._render=function(t){var e="";"custom"===t["aspect-ratio"]&&(e="padding-top:"+t["aspect-ratio-height"]/t["aspect-ratio-width"]*100+"%");var i=n('