(()=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(e,n,o){return(n=function(e){var n=function(e,n){if("object"!=t(e)||!e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var r=o.call(e,n||"default");if("object"!=t(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==t(n)?n:n+""}(n))in e?Object.defineProperty(e,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[n]=o,e}var n,o;n=jQuery,o=window.elementor,n(document).ready(function(){rtsbTemplateBuilderEditorScript.isEditorForBuilder&&r.reloadPreview(o),o.hooks.addAction("panel/open_editor/widget",function(){r.proClickActions(n,".image-selector-inner.rtsb-pro, .rtsb-pro-field",".image-selector-inner, .rtsb-pro-field","is-pro")}),i(n)}),n(document).on("rt_select2_event",function(t,e){r.rtSelect2Init(t,e,n)});var r={reloadPreview:function(t){t.once("document:loaded",function(){setTimeout(function(){t.reloadPreview()},10)})},proClickActions:function(t,e,n,o){t("body").on("click",e,function(e){return t(e.target).parents().find(n).removeClass(o),t(e.target).addClass(o),setTimeout(function(){t(e.target).removeClass(o)},1800),!1})},rtSelect2Init:function(t,n,o){var r="#elementor-control-default-"+n.data._cid;setTimeout(function(){var t,i=o(r).select2({minimumInputLength:n.data.minimum_input_length,maximumSelectionLength:null!==(t=n.data.maximum_selection_length)&&void 0!==t?t:-1,allowClear:!0,ajax:{url:rtsbSelect2Obj.ajaxurl,dataType:"json",delay:250,method:"POST",data:function(t){return e({action:"rtsb_select2_object_search",post_type:n.data.source_type,source_name:n.data.source_name,search:t.term,page:t.page||1},rtsbSelect2Obj.nonceId,rtsbSelect2Obj.__rtsb_wpnonce)}},initSelection:function(t,r){n.multiple?r({id:9999,text:"search"}):r({id:"",text:rtsbSelect2Obj.search_text});var i=[];if(Array.isArray(n.currentID)||""==n.currentID?Array.isArray(n.currentID)&&(i=n.currentID.filter(function(t){return null!=t})):i=[n.currentID],i.length>0){var a=o("label[for='elementor-control-default-"+n.data._cid+"']");a.after('<span class="elementor-control-spinner">&nbsp;<i class="eicon-spinner eicon-animation-spin"></i>&nbsp;</span>'),o.ajax({method:"POST",url:rtsbSelect2Obj.ajaxurl+"?action=rtsb_select2_get_title",data:e({post_type:n.data.source_type,source_name:n.data.source_name,id:i},rtsbSelect2Obj.nonceId,rtsbSelect2Obj.__rtsb_wpnonce)}).done(function(e){if(e.success&&void 0!==e.data.results){var n="";i.forEach(function(t,o){if(void 0!==e.data.results[t]){var r=t,i=e.data.results[t];n+='<option selected="selected" value="'.concat(r,'">').concat(i,"</option>")}}),t.append(n)}a.siblings(".elementor-control-spinner").remove()})}}});setTimeout(function(){i.next().children().children().children().sortable({containment:"parent",stop:function(t,e){e.item.parent().children("[title]").each(function(){var t=o(this).attr("title"),e=o("option:contains("+t+")",i).first();e.detach(),i.append(e)}),i.change()}})},200)},200)}},i=function(t){t(parent.document).on("mousedown",function(e){var n=t(parent.document).find(".elementor-element--promotion");n.length>0&&n.each(function(){if(t.contains(this,e.target)){var n=t(parent.document).find("#elementor-element--promotion__dialog");if(t(this).find(".icon > i").hasClass("rtsb-promotional-element"))if(n.find(".elementor-button.go-pro").remove(),n.find(".rtsb-dialog-buttons-action").length)n.find(".rtsb-dialog-buttons-action").css("display","");else{var o=t("<a>",{href:"https://shopbuilderwp.com/",target:"_blank",class:"dialog-button dialog-action dialog-buttons-action elementor-button elementor-button-success rtsb-dialog-buttons-action"}).text("GET PRO");n.find(".dialog-buttons-wrapper").append(o)}return!1}})})}})();