"use strict";function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_createClass=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}();!function(e){var t=function(){function t(){var n=this;_classCallCheck(this,t),this.initPageLayout(),this.initFooterLayout(),e(".otf-customize-slider .otf-slider").each(function(e,t){n.initSlider(t)})}return _createClass(t,[{key:"initPageLayout",value:function(){var t=e("[otf-page-layout]");t.find("li").on("click",function(){t.find("li").removeClass("active");var n=e(this).addClass("active").find("img").attr("alt");t.prev().val(n)})}},{key:"initFooterLayout",value:function(){var t=e(".opal-control-footer");t.find(".footer-select").on("change",function(){var e=t.find("option:selected").val();t.find(".image-select-tpl").removeClass("active"),t.find(".image-select [data-value="+e+"]").addClass("active"),t.prev().val(e)})}},{key:"formatPrice",value:function(){e('[format-price="true"]',"#opaltab-customfield").each(function(t,n){e(n).val(OREAdminFunctionJs.formatPrice(Number(e(n).val().trim().replace(/[^\d]*/g,"")))),e(n).on("keyup",function(t){e(t.currentTarget).val(OREAdminFunctionJs.formatPrice(Number(t.target.value.trim().replace(/[^\d]*/g,""))))})})}},{key:"initSlider",value:function(t){var n=e(t),a=n.data("id"),i=n.data("unit")?n.data("unit"):"";n.slider({range:"min",min:n.data("min"),max:n.data("max"),step:n.data("step"),value:n.data("value"),create:function(e,t){n.children(".ui-slider-handle").html("<span>"+n.slider("value")+i+"</span>")},slide:function(t,o){n.children(".ui-slider-handle").html("<span>"+o.value+i+"</span>"),e("#"+a).val(o.value)},change:function(t,n){e(n.handle).closest(".cmb2-slider-element").find('[opal-hidden="true"]').val(n.value)}}),n.next().on("click",function(){n.slider("value",n.data("default-value"))})}}]),t}(),n=function(){function t(e){_classCallCheck(this,t),this.classmap=null,this.classmap=e,this.init()}return _createClass(t,[{key:"init",value:function(){var t=this;e(".opal-onoffswitch-wrapper").each(function(n,a){var i=e("input.onoffswitch-input",a),o=e(".onoffswitch-checkbox",a),l=t.getSelectorString(o);t.actionShowHide(l,o.prop("checked"),0),o.on("change",function(){t.actionShowHide(l,o.prop("checked")),o.prop("checked")?i.val("1"):i.val("0")})})}},{key:"actionShowHide",value:function(t,n){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:400;n?e(t).stop().slideDown(a):e(t).stop().slideUp(a)}},{key:"getSelectorString",value:function(e){return"object"===_typeof(e.data("show-fields"))&&e.data("show-fields").map(function(e){return".cmb2-id-"+e.replace(/_/g,"-")}).join(",")}}]),t}();e(document).ready(function(){new t,new n})}(jQuery);
//# sourceMappingURL=admin-page.js.map
