1 line
95 KiB
JavaScript
1 line
95 KiB
JavaScript
!function(e,i){var a=[];acf.Field=acf.Model.extend({type:"",eventScope:".acf-field",wait:"ready",setup:function(t){this.$el=t,this.inherit(t),this.inherit(this.$control())},val:function(t){return t!==i?this.setValue(t):this.prop("disabled")?null:this.getValue()},getValue:function(){return this.$input().val()},setValue:function(t){return acf.val(this.$input(),t)},__:function(t){return acf._e(this.type,t)},$control:function(){return!1},$input:function(){return this.$("[name]:first")},$inputWrap:function(){return this.$(".acf-input:first")},$labelWrap:function(){return this.$(".acf-label:first")},getInputName:function(){return this.$input().attr("name")||""},parent:function(){var t=this.parents();return!!t.length&&t[0]},parents:function(){var t=this.$el.parents(".acf-field");return acf.getFields(t)},show:function(t,e){t=acf.show(this.$el,t);return t&&(this.prop("hidden",!1),acf.doAction("show_field",this,e)),t},hide:function(t,e){t=acf.hide(this.$el,t);return t&&(this.prop("hidden",!0),acf.doAction("hide_field",this,e)),t},enable:function(t,e){t=acf.enable(this.$el,t);return t&&(this.prop("disabled",!1),acf.doAction("enable_field",this,e)),t},disable:function(t,e){t=acf.disable(this.$el,t);return t&&(this.prop("disabled",!0),acf.doAction("disable_field",this,e)),t},showEnable:function(t,e){return this.enable.apply(this,arguments),this.show.apply(this,arguments)},hideDisable:function(t,e){return this.disable.apply(this,arguments),this.hide.apply(this,arguments)},showNotice:function(t){"object"!=typeof t&&(t={text:t}),this.notice&&this.notice.remove(),t.target=this.$inputWrap(),this.notice=acf.newNotice(t)},removeNotice:function(t){this.notice&&(this.notice.away(t||0),this.notice=!1)},showError:function(t){this.$el.addClass("acf-error"),t!==i&&this.showNotice({text:t,type:"error",dismiss:!1}),acf.doAction("invalid_field",this),this.$el.one("focus change","input, select, textarea",e.proxy(this.removeError,this))},removeError:function(){this.$el.removeClass("acf-error"),this.removeNotice(250),acf.doAction("valid_field",this)},trigger:function(t,e,i){return"invalidField"==t&&(i=!0),acf.Model.prototype.trigger.apply(this,[t,e,i])}}),acf.newField=function(t){var e=t.data("type"),e=n(e),t=new(acf.models[e]||acf.Field)(t);return acf.doAction("new_field",t),t};var n=function(t){return acf.strPascalCase(t||"")+"Field"};acf.registerFieldType=function(t){var e=t.prototype.type,i=n(e);acf.models[i]=t,a.push(e)},acf.getFieldType=function(t){t=n(t);return acf.models[t]||!1},acf.getFieldTypes=function(i){i=acf.parseArgs(i,{category:""});var n=[];return a.map(function(t){var e=acf.getFieldType(t),t=e.prototype;i.category&&t.category!==i.category||n.push(e)}),n}}(jQuery),function(n){acf.findFields=function(t){var e=".acf-field",i=!1;return(t=!(t=acf.parseArgs(t,{key:"",name:"",type:"",is:"",parent:!1,sibling:!1,limit:!1,visible:!1,suppressFilters:!1})).suppressFilters?acf.applyFilters("find_fields_args",t):t).key&&(e+='[data-key="'+t.key+'"]'),t.type&&(e+='[data-type="'+t.type+'"]'),t.name&&(e+='[data-name="'+t.name+'"]'),t.is&&(e+=t.is),t.visible&&(e+=":visible"),i=t.parent?t.parent.find(e):t.sibling?t.sibling.siblings(e):n(e),t.suppressFilters||(i=i.not(".acf-clone .acf-field"),i=acf.applyFilters("find_fields",i)),i=t.limit?i.slice(0,t.limit):i},acf.findField=function(t,e){return acf.findFields({key:t,limit:1,parent:e,suppressFilters:!0})},acf.getField=function(t){return(t=!(t instanceof jQuery)?acf.findField(t):t).data("acf")||acf.newField(t)},acf.getFields=function(t){t instanceof jQuery||(t=acf.findFields(t));var e=[];return t.each(function(){var t=acf.getField(n(this));e.push(t)}),e},acf.findClosestField=function(t){return t.closest(".acf-field")},acf.getClosestField=function(t){t=acf.findClosestField(t);return this.getField(t)};var e=function(t){var a=t+"_field",s=t+"Field";acf.addAction(a,function(e){var i=acf.arrayArgs(arguments),n=i.slice(1);["type","name","key"].map(function(t){t="/"+t+"="+e.get(t);i=[a+t,e].concat(n),acf.doAction.apply(null,i)}),-1<o.indexOf(t)&&e.trigger(s,n)})},o=["remove","unmount","remount","sortstart","sortstop","show","hide","unload","valid","invalid","enable","disable","duplicate"];["prepare","ready","load","append","remove","unmount","remount","sortstart","sortstop","show","hide","unload"].map(function(t){var n=t+"_fields",a=t+"_field";acf.addAction(t,function(t){var e=acf.arrayArgs(arguments).slice(1),i=acf.getFields({parent:t});i.length&&(e=[n,i].concat(e),acf.doAction.apply(null,e))}),acf.addAction(n,function(t){var i=acf.arrayArgs(arguments).slice(1);t.map(function(t,e){t=[a,t].concat(i);acf.doAction.apply(null,t)})}),e(t)}),["valid","invalid","enable","disable","new","duplicate"].map(e);new acf.Model({id:"fieldsEventManager",events:{'click .acf-field a[href="#"]':"onClick","change .acf-field":"onChange"},onClick:function(t){t.preventDefault()},onChange:function(){n("#_acf_changed").val(1)}}),new acf.Model({id:"duplicateFieldsManager",actions:{duplicate:"onDuplicate",duplicate_fields:"onDuplicateFields"},onDuplicate:function(t,e){t=acf.getFields({parent:t});t.length&&(e=acf.findFields({parent:e}),acf.doAction("duplicate_fields",t,e))},onDuplicateFields:function(t,i){t.map(function(t,e){acf.doAction("duplicate_field",t,n(i[e]))})}})}(jQuery),function(c){var l=0,t=acf.Field.extend({type:"accordion",wait:"",$control:function(){return this.$(".acf-fields:first")},initialize:function(){if(!this.$el.hasClass("acf-accordion")&&!this.$el.is("td")){if(this.get("endpoint"))return this.remove();var t,e,i=this.$el,n=this.$labelWrap(),a=this.$inputWrap(),s=this.$control(),o=a.children(".description");o.length&&n.append(o),this.$el.is("tr")&&(r=this.$el.closest("table"),t=c('<div class="acf-accordion-title"/>'),e=c('<div class="acf-accordion-content"/>'),o=c('<table class="'+r.attr("class")+'"/>'),r=c("<tbody/>"),t.append(n.html()),o.append(r),e.append(o),a.append(t),a.append(e),n.remove(),s.remove(),a.attr("colspan",2),n=t,a=e,s=r),i.addClass("acf-accordion"),n.addClass("acf-accordion-title"),a.addClass("acf-accordion-content"),l++,this.get("multi_expand")&&i.attr("multi-expand",1);var r=acf.getPreference("this.accordions")||[];void 0!==r[l-1]&&this.set("open",r[l-1]),this.get("open")&&(i.addClass("-open"),a.css("display","block")),n.prepend(d.iconHtml({open:this.get("open")}));n=i.parent();s.addClass(n.hasClass("-left")?"-left":""),s.addClass(n.hasClass("-clear")?"-clear":""),s.append(i.nextUntil(".acf-field-accordion",".acf-field")),s.removeAttr("data-open data-multi_expand data-endpoint")}}});acf.registerFieldType(t);var d=new acf.Model({actions:{unload:"onUnload"},events:{"click .acf-accordion-title":"onClick","invalidField .acf-accordion":"onInvalidField"},isOpen:function(t){return t.hasClass("-open")},toggle:function(t){this.isOpen(t)?this.close(t):this.open(t)},iconHtml:function(t){return acf.isGutenberg()?t.open?'<svg class="acf-accordion-icon" width="24px" height="24px" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" role="img" aria-hidden="true" focusable="false"><g><path fill="none" d="M0,0h24v24H0V0z"></path></g><g><path d="M12,8l-6,6l1.41,1.41L12,10.83l4.59,4.58L18,14L12,8z"></path></g></svg>':'<svg class="acf-accordion-icon" width="24px" height="24px" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" role="img" aria-hidden="true" focusable="false"><g><path fill="none" d="M0,0h24v24H0V0z"></path></g><g><path d="M7.41,8.59L12,13.17l4.59-4.58L18,10l-6,6l-6-6L7.41,8.59z"></path></g></svg>':t.open?'<i class="acf-accordion-icon dashicons dashicons-arrow-down"></i>':'<i class="acf-accordion-icon dashicons dashicons-arrow-right"></i>'},open:function(t){var e=acf.isGutenberg()?0:300;t.find(".acf-accordion-content:first").slideDown(e).css("display","block"),t.find(".acf-accordion-icon:first").replaceWith(this.iconHtml({open:!0})),t.addClass("-open"),acf.doAction("show",t),t.attr("multi-expand")||t.siblings(".acf-accordion.-open").each(function(){d.close(c(this))})},close:function(t){var e=acf.isGutenberg()?0:300;t.find(".acf-accordion-content:first").slideUp(e),t.find(".acf-accordion-icon:first").replaceWith(this.iconHtml({open:!1})),t.removeClass("-open"),acf.doAction("hide",t)},onClick:function(t,e){t.preventDefault(),this.toggle(e.parent())},onInvalidField:function(t,e){this.busy||(this.busy=!0,this.setTimeout(function(){this.busy=!1},1e3),this.open(e))},onUnload:function(t){var e=[];c(".acf-accordion").each(function(){var t=c(this).hasClass("-open")?1:0;e.push(t)}),e.length&&acf.setPreference("this.accordions",e)}})}(jQuery),function(){var t=acf.Field.extend({type:"button_group",events:{'click input[type="radio"]':"onClick"},$control:function(){return this.$(".acf-button-group")},$input:function(){return this.$("input:checked")},setValue:function(t){this.$('input[value="'+t+'"]').prop("checked",!0).trigger("change")},onClick:function(t,e){var i=e.parent("label"),n=i.hasClass("selected");this.$(".selected").removeClass("selected"),i.addClass("selected"),this.get("allow_null")&&n&&(i.removeClass("selected"),e.prop("checked",!1).trigger("change"))}});acf.registerFieldType(t)}(jQuery),function(e){var t=acf.Field.extend({type:"checkbox",events:{"change input":"onChange","click .acf-add-checkbox":"onClickAdd","click .acf-checkbox-toggle":"onClickToggle","click .acf-checkbox-custom":"onClickCustom"},$control:function(){return this.$(".acf-checkbox-list")},$toggle:function(){return this.$(".acf-checkbox-toggle")},$input:function(){return this.$('input[type="hidden"]')},$inputs:function(){return this.$('input[type="checkbox"]').not(".acf-checkbox-toggle")},getValue:function(){var t=[];return this.$(":checked").each(function(){t.push(e(this).val())}),!!t.length&&t},onChange:function(t,e){var i=e.prop("checked"),n=e.parent("label"),e=this.$toggle();i?n.addClass("selected"):n.removeClass("selected"),e.length&&(0==this.$inputs().not(":checked").length?e.prop("checked",!0):e.prop("checked",!1))},onClickAdd:function(t,e){var i='<li><input class="acf-checkbox-custom" type="checkbox" checked="checked" /><input type="text" name="'+this.getInputName()+'[]" /></li>';e.parent("li").before(i)},onClickToggle:function(t,e){var i=e.prop("checked"),n=this.$('input[type="checkbox"]'),e=this.$("label");n.prop("checked",i),i?e.addClass("selected"):e.removeClass("selected")},onClickCustom:function(t,e){var i=e.prop("checked"),n=e.next('input[type="text"]');i?n.prop("disabled",!1):(n.prop("disabled",!0),""==n.val()&&e.parent("li").remove())}});acf.registerFieldType(t)}(jQuery),function(){var t=acf.Field.extend({type:"color_picker",wait:"load",events:{duplicateField:"onDuplicate"},$control:function(){return this.$(".acf-color-picker")},$input:function(){return this.$('input[type="hidden"]')},$inputText:function(){return this.$('input[type="text"]')},setValue:function(t){acf.val(this.$input(),t),this.$inputText().iris("color",t)},initialize:function(){var e=this.$input(),i=this.$inputText(),t=function(t){setTimeout(function(){acf.val(e,i.val())},1)},t={defaultColor:!1,palettes:!0,hide:!0,change:t,clear:t},t=acf.applyFilters("color_picker_args",t,this);i.wpColorPicker(t)},onDuplicate:function(t,e,i){$colorPicker=i.find(".wp-picker-container"),$inputText=i.find('input[type="text"]'),$colorPicker.replaceWith($inputText)}});acf.registerFieldType(t)}(jQuery),function(n){var t=acf.Field.extend({type:"date_picker",events:{'blur input[type="text"]':"onBlur",duplicateField:"onDuplicate"},$control:function(){return this.$(".acf-date-picker")},$input:function(){return this.$('input[type="hidden"]')},$inputText:function(){return this.$('input[type="text"]')},initialize:function(){if(this.has("save_format"))return this.initializeCompatibility();var t=this.$input(),e=this.$inputText(),t={dateFormat:this.get("date_format"),altField:t,altFormat:"yymmdd",changeYear:!0,yearRange:"-100:+100",changeMonth:!0,showButtonPanel:!0,firstDay:this.get("first_day")},t=acf.applyFilters("date_picker_args",t,this);acf.newDatePicker(e,t),acf.doAction("date_picker_init",e,t,this)},initializeCompatibility:function(){var t=this.$input(),e=this.$inputText();e.val(t.val());var i={dateFormat:this.get("date_format"),altField:t,altFormat:this.get("save_format"),changeYear:!0,yearRange:"-100:+100",changeMonth:!0,showButtonPanel:!0,firstDay:this.get("first_day")},t=(i=acf.applyFilters("date_picker_args",i,this)).dateFormat;i.dateFormat=this.get("save_format"),acf.newDatePicker(e,i),e.datepicker("option","dateFormat",t),acf.doAction("date_picker_init",e,i,this)},onBlur:function(){this.$inputText().val()||acf.val(this.$input(),"")},onDuplicate:function(t,e,i){i.find('input[type="text"]').removeClass("hasDatepicker").removeAttr("id")}});acf.registerFieldType(t);new acf.Model({priority:5,wait:"ready",initialize:function(){var t=acf.get("locale"),e=acf.get("rtl"),i=acf.get("datePickerL10n");return!!i&&(void 0!==n.datepicker&&(i.isRTL=e,n.datepicker.regional[t]=i,void n.datepicker.setDefaults(i)))}});acf.newDatePicker=function(t,e){if(void 0===n.datepicker)return!1;t.datepicker(e=e||{}),n("body > #ui-datepicker-div").exists()&&n("body > #ui-datepicker-div").wrap('<div class="acf-ui-datepicker" />')}}(jQuery),function(n){var t=acf.models.DatePickerField.extend({type:"date_time_picker",$control:function(){return this.$(".acf-date-time-picker")},initialize:function(){var t=this.$input(),e=this.$inputText(),t={dateFormat:this.get("date_format"),timeFormat:this.get("time_format"),altField:t,altFieldTimeOnly:!1,altFormat:"yy-mm-dd",altTimeFormat:"HH:mm:ss",changeYear:!0,yearRange:"-100:+100",changeMonth:!0,showButtonPanel:!0,firstDay:this.get("first_day"),controlType:"select",oneLine:!0},t=acf.applyFilters("date_time_picker_args",t,this);acf.newDateTimePicker(e,t),acf.doAction("date_time_picker_init",e,t,this)}});acf.registerFieldType(t);new acf.Model({priority:5,wait:"ready",initialize:function(){var t=acf.get("locale"),e=acf.get("rtl"),i=acf.get("dateTimePickerL10n");return!!i&&(void 0!==n.timepicker&&(i.isRTL=e,n.timepicker.regional[t]=i,void n.timepicker.setDefaults(i)))}});acf.newDateTimePicker=function(t,e){if(void 0===n.timepicker)return!1;t.datetimepicker(e=e||{}),n("body > #ui-datepicker-div").exists()&&n("body > #ui-datepicker-div").wrap('<div class="acf-ui-datepicker" />')}}(jQuery),function(e){var t=acf.Field.extend({type:"google_map",map:!1,wait:"load",events:{'click a[data-name="clear"]':"onClickClear",'click a[data-name="locate"]':"onClickLocate",'click a[data-name="search"]':"onClickSearch","keydown .search":"onKeydownSearch","keyup .search":"onKeyupSearch","focus .search":"onFocusSearch","blur .search":"onBlurSearch",showField:"onShow"},$control:function(){return this.$(".acf-google-map")},$search:function(){return this.$(".search")},$canvas:function(){return this.$(".canvas")},setState:function(t){this.$control().removeClass("-value -loading -searching"),(t="default"===t?this.val()?"value":"":t)&&this.$control().addClass("-"+t)},getValue:function(){var t=this.$input().val();return!!t&&JSON.parse(t)},setValue:function(t,e){var i="";t&&(i=JSON.stringify(t)),acf.val(this.$input(),i),e||(this.renderVal(t),acf.doAction("google_map_change",t,this.map,this))},renderVal:function(t){t?(this.setState("value"),this.$search().val(t.address),this.setPosition(t.lat,t.lng)):(this.setState(""),this.$search().val(""),this.map.marker.setVisible(!1))},newLatLng:function(t,e){return new google.maps.LatLng(parseFloat(t),parseFloat(e))},setPosition:function(t,e){this.map.marker.setPosition({lat:parseFloat(t),lng:parseFloat(e)}),this.map.marker.setVisible(!0),this.center()},center:function(){var t,e=this.map.marker.getPosition();e=e?(t=e.lat(),e.lng()):(t=this.get("lat"),this.get("lng")),this.map.setCenter({lat:parseFloat(t),lng:parseFloat(e)})},initialize:function(){!function(t){if(a)return t();if(acf.isset(window,"google","maps","Geocoder"))return a=new google.maps.Geocoder,t();acf.addAction("google_map_api_loaded",t),i||(t=acf.get("google_map_api"))&&(i=!0,e.ajax({url:t,dataType:"script",cache:!0,success:function(){a=new google.maps.Geocoder,acf.doAction("google_map_api_loaded")}}))}(this.initializeMap.bind(this))},initializeMap:function(){var t=this.getValue(),e=acf.parseArgs(t,{zoom:this.get("zoom"),lat:this.get("lat"),lng:this.get("lng")}),i={scrollwheel:!1,zoom:parseInt(e.zoom),center:{lat:parseFloat(e.lat),lng:parseFloat(e.lng)},mapTypeId:google.maps.MapTypeId.ROADMAP,marker:{draggable:!0,raiseOnDrag:!0},autocomplete:{}},i=acf.applyFilters("google_map_args",i,this),n=new google.maps.Map(this.$canvas()[0],i),a=acf.parseArgs(i.marker,{draggable:!0,raiseOnDrag:!0,map:n}),a=acf.applyFilters("google_map_marker_args",a,this),e=new google.maps.Marker(a),a=!1;acf.isset(google,"maps","places","Autocomplete")&&(i=i.autocomplete||{},i=acf.applyFilters("google_map_autocomplete_args",i,this),(a=new google.maps.places.Autocomplete(this.$search()[0],i)).bindTo("bounds",n)),this.addMapEvents(this,n,e,a),n.acf=this,n.marker=e,n.autocomplete=a,this.map=n,t&&this.setPosition(t.lat,t.lng),acf.doAction("google_map_init",n,e,this)},addMapEvents:function(i,e,t,n){google.maps.event.addListener(e,"click",function(t){var e=t.latLng.lat(),t=t.latLng.lng();i.searchPosition(e,t)}),google.maps.event.addListener(t,"dragend",function(){var t=this.getPosition().lat(),e=this.getPosition().lng();i.searchPosition(t,e)}),n&&google.maps.event.addListener(n,"place_changed",function(){var t=this.getPlace();i.searchPlace(t)}),google.maps.event.addListener(e,"zoom_changed",function(){var t=i.val();t&&(t.zoom=e.getZoom(),i.setValue(t,!0))})},searchPosition:function(i,n){this.setState("loading"),a.geocode({location:{lat:i,lng:n}},function(t,e){this.setState(""),"OK"!==e?this.showNotice({text:acf.__("Location not found: %s").replace("%s",e),type:"warning"}):((t=this.parseResult(t[0])).lat=i,t.lng=n,this.val(t))}.bind(this))},searchPlace:function(t){var e;t&&(t.geometry?(t.formatted_address=this.$search().val(),e=this.parseResult(t),this.val(e)):t.name&&this.searchAddress(t.name))},searchAddress:function(i){if(i){var t=i.split(",");if(2==t.length){var e=parseFloat(t[0]),t=parseFloat(t[1]);if(e&&t)return this.searchPosition(e,t)}this.setState("loading"),a.geocode({address:i},function(t,e){this.setState(""),"OK"!==e?this.showNotice({text:acf.__("Location not found: %s").replace("%s",e),type:"warning"}):((t=this.parseResult(t[0])).address=i,this.val(t))}.bind(this))}},searchLocation:function(){if(!navigator.geolocation)return alert(acf.__("Sorry, this browser does not support geolocation"));this.setState("loading"),navigator.geolocation.getCurrentPosition(function(t){this.setState("");var e=t.coords.latitude,t=t.coords.longitude;this.searchPosition(e,t)}.bind(this),function(t){this.setState("")}.bind(this))},parseResult:function(t){var e={address:t.formatted_address,lat:t.geometry.location.lat(),lng:t.geometry.location.lng()};e.zoom=this.map.getZoom(),t.place_id&&(e.place_id=t.place_id),t.name&&(e.name=t.name);var i,n={street_number:["street_number"],street_name:["street_address","route"],city:["locality"],state:["administrative_area_level_1","administrative_area_level_2","administrative_area_level_3","administrative_area_level_4","administrative_area_level_5"],post_code:["postal_code"],country:["country"]};for(i in n)for(var a=n[i],s=0;s<t.address_components.length;s++){var o=t.address_components[s],r=o.types[0];-1!==a.indexOf(r)&&(e[i]=o.long_name,o.long_name!==o.short_name&&(e[i+"_short"]=o.short_name))}return acf.applyFilters("google_map_result",e,t,this.map,this)},onClickClear:function(){this.val(!1)},onClickLocate:function(){this.searchLocation()},onClickSearch:function(){this.searchAddress(this.$search().val())},onFocusSearch:function(t,e){this.setState("searching")},onBlurSearch:function(t,e){var i=this.val(),i=i?i.address:"";e.val()===i&&this.setState("default")},onKeyupSearch:function(t,e){e.val()||this.val(!1)},onKeydownSearch:function(t,e){13==t.which&&(t.preventDefault(),e.blur())},onShow:function(){this.map&&this.setTimeout(this.center)}});acf.registerFieldType(t);var i=!1,a=!1}(jQuery),function(n){var t=acf.Field.extend({type:"image",$control:function(){return this.$(".acf-image-uploader")},$input:function(){return this.$('input[type="hidden"]')},events:{'click a[data-name="add"]':"onClickAdd",'click a[data-name="edit"]':"onClickEdit",'click a[data-name="remove"]':"onClickRemove",'change input[type="file"]':"onChange"},initialize:function(){"basic"===this.get("uploader")&&this.$el.closest("form").attr("enctype","multipart/form-data")},validateAttachment:function(t){t&&t.attributes&&(t=t.attributes),t=acf.parseArgs(t,{id:0,url:"",alt:"",title:"",caption:"",description:"",width:0,height:0});var e=acf.isget(t,"sizes",this.get("preview_size"));return e&&(t.url=e.url,t.width=e.width,t.height=e.height),t},render:function(t){t=this.validateAttachment(t),this.$("img").attr({src:t.url,alt:t.alt}),t.id?(this.val(t.id),this.$control().addClass("has-value")):(this.val(""),this.$control().removeClass("has-value"))},append:function(t,e){function i(t,e){for(var i=acf.getFields({key:t.get("key"),parent:e.$el}),n=0;n<i.length;n++)if(!i[n].val())return i[n];return!1}var n=i(this,e);n||(e.$(".acf-button:last").trigger("click"),n=i(this,e)),n&&n.render(t)},selectAttachment:function(){var i=this.parent(),t=i&&"repeater"===i.get("type");acf.newMediaPopup({mode:"select",type:"image",title:acf.__("Select Image"),field:this.get("key"),multiple:t,library:this.get("library"),allowedTypes:this.get("mime_types"),select:n.proxy(function(t,e){0<e?this.append(t,i):this.render(t)},this)})},editAttachment:function(){var t=this.val();t&&acf.newMediaPopup({mode:"edit",title:acf.__("Edit Image"),button:acf.__("Update Image"),attachment:t,field:this.get("key"),select:n.proxy(function(t,e){this.render(t)},this)})},removeAttachment:function(){this.render(!1)},onClickAdd:function(t,e){this.selectAttachment()},onClickEdit:function(t,e){this.editAttachment()},onClickRemove:function(t,e){this.removeAttachment()},onChange:function(t,e){var i=this.$input();acf.getFileInputData(e,function(t){i.val(n.param(t))})}});acf.registerFieldType(t)}(jQuery),function(e){var t=acf.models.ImageField.extend({type:"file",$control:function(){return this.$(".acf-file-uploader")},$input:function(){return this.$('input[type="hidden"]')},validateAttachment:function(t){return void 0!==(t=t||{}).id&&(t=t.attributes),t=acf.parseArgs(t,{url:"",alt:"",title:"",filename:"",filesizeHumanReadable:"",icon:"/wp-includes/images/media/default.png"})},render:function(t){t=this.validateAttachment(t),this.$("img").attr({src:t.icon,alt:t.alt,title:t.title}),this.$('[data-name="title"]').text(t.title),this.$('[data-name="filename"]').text(t.filename).attr("href",t.url),this.$('[data-name="filesize"]').text(t.filesizeHumanReadable);t=t.id||"";acf.val(this.$input(),t),t?this.$control().addClass("has-value"):this.$control().removeClass("has-value")},selectAttachment:function(){var i=this.parent(),t=i&&"repeater"===i.get("type");acf.newMediaPopup({mode:"select",title:acf.__("Select File"),field:this.get("key"),multiple:t,library:this.get("library"),allowedTypes:this.get("mime_types"),select:e.proxy(function(t,e){0<e?this.append(t,i):this.render(t)},this)})},editAttachment:function(){var t=this.val();if(!t)return!1;acf.newMediaPopup({mode:"edit",title:acf.__("Edit File"),button:acf.__("Update File"),attachment:t,field:this.get("key"),select:e.proxy(function(t,e){this.render(t)},this)})}});acf.registerFieldType(t)}(jQuery),function(e){var t=acf.Field.extend({type:"link",events:{'click a[data-name="add"]':"onClickEdit",'click a[data-name="edit"]':"onClickEdit",'click a[data-name="remove"]':"onClickRemove","change .link-node":"onChange"},$control:function(){return this.$(".acf-link")},$node:function(){return this.$(".link-node")},getValue:function(){var t=this.$node();return!!t.attr("href")&&{title:t.html(),url:t.attr("href"),target:t.attr("target")}},setValue:function(t){t=acf.parseArgs(t,{title:"",url:"",target:""});var e=this.$control(),i=this.$node();e.removeClass("-value -external"),t.url&&e.addClass("-value"),"_blank"===t.target&&e.addClass("-external"),this.$(".link-title").html(t.title),this.$(".link-url").attr("href",t.url).html(t.url),i.html(t.title),i.attr("href",t.url),i.attr("target",t.target),this.$(".input-title").val(t.title),this.$(".input-target").val(t.target),this.$(".input-url").val(t.url).trigger("change")},onClickEdit:function(t,e){acf.wpLink.open(this.$node())},onClickRemove:function(t,e){this.setValue(!1)},onChange:function(t,e){var i=this.getValue();this.setValue(i)}});acf.registerFieldType(t),acf.wpLink=new acf.Model({getNodeValue:function(){var t=this.get("node");return{title:acf.decode(t.html()),url:t.attr("href"),target:t.attr("target")}},setNodeValue:function(t){var e=this.get("node");e.text(t.title),e.attr("href",t.url),e.attr("target",t.target),e.trigger("change")},getInputValue:function(){return{title:e("#wp-link-text").val(),url:e("#wp-link-url").val(),target:e("#wp-link-target").prop("checked")?"_blank":""}},setInputValue:function(t){e("#wp-link-text").val(t.title),e("#wp-link-url").val(t.url),e("#wp-link-target").prop("checked","_blank"===t.target)},open:function(t){this.on("wplink-open","onOpen"),this.on("wplink-close","onClose"),this.set("node",t);t=e('<textarea id="acf-link-textarea" style="display:none;"></textarea>');e("body").append(t);t=this.getNodeValue();wpLink.open("acf-link-textarea",t.url,t.title,null)},onOpen:function(){e("#wp-link-wrap").addClass("has-text-field");var t=this.getNodeValue();this.setInputValue(t),t.url&&wpLinkL10n&&e("#wp-link-submit").val(wpLinkL10n.update)},close:function(){wpLink.close()},onClose:function(){if(!this.has("node"))return!1;var t=e("#wp-link-submit");(t.is(":hover")||t.is(":focus"))&&(t=this.getInputValue(),this.setNodeValue(t)),this.off("wplink-open"),this.off("wplink-close"),e("#acf-link-textarea").remove(),this.set("node",null)}})}(jQuery),function(i){var t=acf.Field.extend({type:"oembed",events:{'click [data-name="clear-button"]':"onClickClear","keypress .input-search":"onKeypressSearch","keyup .input-search":"onKeyupSearch","change .input-search":"onChangeSearch"},$control:function(){return this.$(".acf-oembed")},$input:function(){return this.$(".input-value")},$search:function(){return this.$(".input-search")},getValue:function(){return this.$input().val()},getSearchVal:function(){return this.$search().val()},setValue:function(t){t?this.$control().addClass("has-value"):this.$control().removeClass("has-value"),acf.val(this.$input(),t)},showLoading:function(t){acf.showLoading(this.$(".canvas"))},hideLoading:function(){acf.hideLoading(this.$(".canvas"))},maybeSearch:function(){var t=this.val(),e=this.getSearchVal();if(!e)return this.clear();(e="http"!=e.substr(0,4)?"http://"+e:e)!==t&&((t=this.get("timeout"))&&clearTimeout(t),e=i.proxy(this.search,this,e),this.set("timeout",setTimeout(e,300)))},search:function(t){var e={action:"acf/fields/oembed/search",s:t,field_key:this.get("key")};(t=this.get("xhr"))&&t.abort(),this.showLoading();t=i.ajax({url:acf.get("ajaxurl"),data:acf.prepareForAjax(e),type:"post",dataType:"json",context:this,success:function(t){t&&t.html||(t={url:!1,html:""}),this.val(t.url),this.$(".canvas-media").html(t.html)},complete:function(){this.hideLoading()}});this.set("xhr",t)},clear:function(){this.val(""),this.$search().val(""),this.$(".canvas-media").html("")},onClickClear:function(t,e){this.clear()},onKeypressSearch:function(t,e){13==t.which&&(t.preventDefault(),this.maybeSearch())},onKeyupSearch:function(t,e){e.val()&&this.maybeSearch()},onChangeSearch:function(t,e){this.maybeSearch()}});acf.registerFieldType(t)}(jQuery),function(){var t=acf.Field.extend({type:"radio",events:{'click input[type="radio"]':"onClick"},$control:function(){return this.$(".acf-radio-list")},$input:function(){return this.$("input:checked")},$inputText:function(){return this.$('input[type="text"]')},getValue:function(){var t=this.$input().val();return t="other"===t&&this.get("other_choice")?this.$inputText().val():t},onClick:function(t,e){var i=e.parent("label"),n=i.hasClass("selected"),a=e.val();this.$(".selected").removeClass("selected"),i.addClass("selected"),this.get("allow_null")&&n&&(i.removeClass("selected"),e.prop("checked",!1).trigger("change"),a=!1),this.get("other_choice")&&("other"===a?this.$inputText().prop("disabled",!1):this.$inputText().prop("disabled",!0))}});acf.registerFieldType(t)}(jQuery),function(){var t=acf.Field.extend({type:"range",events:{'input input[type="range"]':"onChange","change input":"onChange"},$input:function(){return this.$('input[type="range"]')},$inputAlt:function(){return this.$('input[type="number"]')},setValue:function(t){this.busy=!0,acf.val(this.$input(),t),acf.val(this.$inputAlt(),this.$input().val(),!0),this.busy=!1},onChange:function(t,e){this.busy||this.setValue(e.val())}});acf.registerFieldType(t)}(jQuery),function(s){var t=acf.Field.extend({type:"relationship",events:{"keypress [data-filter]":"onKeypressFilter","change [data-filter]":"onChangeFilter","keyup [data-filter]":"onChangeFilter","click .choices-list .acf-rel-item":"onClickAdd",'click [data-name="remove_item"]':"onClickRemove"},$control:function(){return this.$(".acf-relationship")},$list:function(t){return this.$("."+t+"-list")},$listItems:function(t){return this.$list(t).find(".acf-rel-item")},$listItem:function(t,e){return this.$list(t).find('.acf-rel-item[data-id="'+e+'"]')},getValue:function(){var t=[];return this.$listItems("values").each(function(){t.push(s(this).data("id"))}),!!t.length&&t},newChoice:function(t){return["<li>",'<span data-id="'+t.id+'" class="acf-rel-item">'+t.text+"</span>","</li>"].join("")},newValue:function(t){return["<li>",'<input type="hidden" name="'+this.getInputName()+'[]" value="'+t.id+'" />','<span data-id="'+t.id+'" class="acf-rel-item">'+t.text,'<a href="#" class="acf-icon -minus small dark" data-name="remove_item"></a>',"</span>","</li>"].join("")},initialize:function(){var t=this.proxy(acf.once(function(){this.$list("values").sortable({items:"li",forceHelperSize:!0,forcePlaceholderSize:!0,scroll:!0,update:this.proxy(function(){this.$input().trigger("change")})}),this.$list("choices").scrollTop(0).on("scroll",this.proxy(this.onScrollChoices)),this.fetch()}));this.$el.one("mouseover",t),this.$el.one("focus","input",t),acf.onceInView(this.$el,t)},onScrollChoices:function(t){var e,i,n,a;!this.get("loading")&&this.get("more")&&(a=this.$list("choices"),e=Math.ceil(a.scrollTop()),i=Math.ceil(a[0].scrollHeight),n=Math.ceil(a.innerHeight()),a=this.get("paged")||1,i<=e+n&&(this.set("paged",a+1),this.fetch()))},onKeypressFilter:function(t,e){13==t.which&&t.preventDefault()},onChangeFilter:function(t,e){var i=e.val(),n=e.data("filter");this.get(n)!==i&&(this.set(n,i),this.set("paged",1),e.is("select")?this.fetch():this.maybeFetch())},onClickAdd:function(t,e){var i=this.val(),n=parseInt(this.get("max"));if(e.hasClass("disabled"))return!1;if(0<n&&i&&i.length>=n)return this.showNotice({text:acf.__("Maximum values reached ( {max} values )").replace("{max}",n),type:"warning"}),!1;e.addClass("disabled");e=this.newValue({id:e.data("id"),text:e.html()});this.$list("values").append(e),this.$input().trigger("change")},onClickRemove:function(t,e){t.preventDefault();t=e.parent(),e=t.parent(),t=t.data("id");e.remove(),this.$listItem("choices",t).removeClass("disabled"),this.$input().trigger("change")},maybeFetch:function(){var t=this.get("timeout");t&&clearTimeout(t),t=this.setTimeout(this.fetch,300),this.set("timeout",t)},getAjaxData:function(){var t,e=this.$control().data();for(t in e)e[t]=this.get(t);return e.action="acf/fields/relationship/query",e.field_key=this.get("key"),e=acf.applyFilters("relationship_ajax_data",e,this)},fetch:function(){(i=this.get("xhr"))&&i.abort();var t=this.getAjaxData(),a=this.$list("choices");1==t.paged&&a.html("");var e=s('<li><i class="acf-loading"></i> '+acf.__("Loading")+"</li>");a.append(e),this.set("loading",!0);var i=s.ajax({url:acf.get("ajaxurl"),dataType:"json",type:"post",data:acf.prepareForAjax(t),context:this,success:function(t){if(!t||!t.results||!t.results.length)return this.set("more",!1),void(1==this.get("paged")&&this.$list("choices").append("<li>"+acf.__("No matches found")+"</li>"));this.set("more",t.more);var t=this.walkChoices(t.results),e=s(t),t=this.val();t&&t.length&&t.map(function(t){e.find('.acf-rel-item[data-id="'+t+'"]').addClass("disabled")}),a.append(e);var i=!1,n=!1;a.find(".acf-rel-label").each(function(){var t=s(this),e=t.siblings("ul");if(i&&i.text()==t.text())return n.append(e.children()),void s(this).parent().remove();i=t,n=e})},complete:function(){this.set("loading",!1),e.remove()}});this.set("xhr",i)},walkChoices:function(t){var i=function(t){var e="";return s.isArray(t)?t.map(function(t){e+=i(t)}):s.isPlainObject(t)&&(void 0!==t.children?(e+='<li><span class="acf-rel-label">'+acf.escHtml(t.text)+'</span><ul class="acf-bl">',e+=i(t.children),e+="</ul></li>"):e+='<li><span class="acf-rel-item" data-id="'+acf.escAttr(t.id)+'">'+acf.escHtml(t.text)+"</span></li>"),e};return i(t)}});acf.registerFieldType(t)}(jQuery),function(){var t=acf.Field.extend({type:"select",select2:!1,wait:"load",events:{removeField:"onRemove",duplicateField:"onDuplicate"},$input:function(){return this.$("select")},initialize:function(){var t,e=this.$input();this.inherit(e),this.get("ui")&&(t=(t=this.get("ajax_action"))||"acf/fields/"+this.get("type")+"/query",this.select2=acf.newSelect2(e,{field:this,ajax:this.get("ajax"),multiple:this.get("multiple"),placeholder:this.get("placeholder"),allowNull:this.get("allow_null"),ajaxAction:t}))},onRemove:function(){this.select2&&this.select2.destroy()},onDuplicate:function(t,e,i){this.select2&&(i.find(".select2-container").remove(),i.find("select").removeClass("select2-hidden-accessible"))}});acf.registerFieldType(t)}(jQuery),function(n){var e="tab",t=acf.Field.extend({type:"tab",wait:"",tabs:!1,tab:!1,events:{duplicateField:"onDuplicate"},findFields:function(){return this.$el.nextUntil(".acf-field-tab",".acf-field")},getFields:function(){return acf.getFields(this.findFields())},findTabs:function(){return this.$el.prevAll(".acf-tab-wrap:first")},findTab:function(){return this.$(".acf-tab-button")},initialize:function(){if(this.$el.is("td"))return!(this.events={});var t=this.findTabs(),e=this.findTab(),i=acf.parseArgs(e.data(),{endpoint:!1,placement:"",before:this.$el});!t.length||i.endpoint?this.tabs=new s(i):this.tabs=t.data("acf"),this.tab=this.tabs.addTab(e,this)},isActive:function(){return this.tab.isActive()},showFields:function(){this.getFields().map(function(t){t.show(this.cid,e),t.hiddenByTab=!1},this)},hideFields:function(){this.getFields().map(function(t){t.hide(this.cid,e),t.hiddenByTab=this.tab},this)},show:function(t){var e=acf.Field.prototype.show.apply(this,arguments);return e&&(this.tab.show(),this.tabs.refresh()),e},hide:function(t){var e=acf.Field.prototype.hide.apply(this,arguments);return e&&(this.tab.hide(),this.isActive()&&this.tabs.reset()),e},enable:function(t){this.getFields().map(function(t){t.enable(e)})},disable:function(t){this.getFields().map(function(t){t.disable(e)})},onDuplicate:function(t,e,i){this.isActive()&&i.prevAll(".acf-tab-wrap:first").remove()}});acf.registerFieldType(t);var a=0,s=acf.Model.extend({tabs:[],active:!1,actions:{refresh:"onRefresh"},data:{before:!1,placement:"top",index:0,initialized:!1},setup:function(t){n.extend(this.data,t),this.tabs=[],this.active=!1;var e=this.get("placement"),i=this.get("before"),t=i.parent();"left"==e&&t.hasClass("acf-fields")&&t.addClass("-sidebar"),i.is("tr")?this.$el=n('<tr class="acf-tab-wrap"><td colspan="2"><ul class="acf-hl acf-tab-group"></ul></td></tr>'):this.$el=n('<div class="acf-tab-wrap -'+e+'"><ul class="acf-hl acf-tab-group"></ul></div>'),i.before(this.$el),this.set("index",a,!0),a++},initializeTabs:function(){var t=this.getVisible().shift(),e=(acf.getPreference("this.tabs")||[])[this.get("index")];(t=this.tabs[e]&&this.tabs[e].isVisible()?this.tabs[e]:t)?this.selectTab(t):this.closeTabs(),this.set("initialized",!0)},getVisible:function(){return this.tabs.filter(function(t){return t.isVisible()})},getActive:function(){return this.active},setActive:function(t){return this.active=t},hasActive:function(){return!1!==this.active},isActive:function(t){var e=this.getActive();return e&&e.cid===t.cid},closeActive:function(){this.hasActive()&&this.closeTab(this.getActive())},openTab:function(t){this.closeActive(),t.open(),this.setActive(t)},closeTab:function(t){t.close(),this.setActive(!1)},closeTabs:function(){this.tabs.map(this.closeTab,this)},selectTab:function(e){this.tabs.map(function(t){e.cid!==t.cid&&this.closeTab(t)},this),this.openTab(e)},addTab:function(t,e){t=n("<li>"+t.outerHTML()+"</li>");this.$("ul").append(t);e=new i({$el:t,field:e,group:this});return this.tabs.push(e),e},reset:function(){return this.closeActive(),this.refresh()},refresh:function(){if(this.hasActive())return!1;var t=this.getVisible().shift();return t&&this.openTab(t),t},onRefresh:function(){var t,e,i;"left"===this.get("placement")&&(t=this.$el.parent(),i=this.$el.children("ul"),e=t.is("td")?"height":"min-height",i=i.position().top+i.outerHeight(!0)-1,t.css(e,i))}}),i=acf.Model.extend({group:!1,field:!1,events:{"click a":"onClick"},index:function(){return this.$el.index()},isVisible:function(){return acf.isVisible(this.$el)},isActive:function(){return this.$el.hasClass("active")},open:function(){this.$el.addClass("active"),this.field.showFields()},close:function(){this.$el.removeClass("active"),this.field.hideFields()},onClick:function(t,e){t.preventDefault(),this.toggle()},toggle:function(){this.isActive()||this.group.openTab(this)}});new acf.Model({priority:50,actions:{prepare:"render",append:"render",unload:"onUnload",invalid_field:"onInvalidField"},findTabs:function(){return n(".acf-tab-wrap")},getTabs:function(){return acf.getInstances(this.findTabs())},render:function(t){this.getTabs().map(function(t){t.get("initialized")||t.initializeTabs()})},onInvalidField:function(t){this.busy||t.hiddenByTab&&(t.hiddenByTab.toggle(),this.busy=!0,this.setTimeout(function(){this.busy=!1},100))},onUnload:function(){var e=[];this.getTabs().map(function(t){t=t.hasActive()?t.getActive().index():0;e.push(t)}),e.length&&acf.setPreference("this.tabs",e)}})}(jQuery),function(){var t=acf.models.SelectField.extend({type:"post_object"});acf.registerFieldType(t)}(jQuery),function(){var t=acf.models.SelectField.extend({type:"page_link"});acf.registerFieldType(t)}(jQuery),function(){var t=acf.models.SelectField.extend({type:"user"});acf.registerFieldType(t)}(jQuery),function(p){var t=acf.Field.extend({type:"taxonomy",data:{ftype:"select"},select2:!1,wait:"load",events:{'click a[data-name="add"]':"onClickAdd",'click input[type="radio"]':"onClickRadio",removeField:"onRemove"},$control:function(){return this.$(".acf-taxonomy-field")},$input:function(){return this.getRelatedPrototype().$input.apply(this,arguments)},getRelatedType:function(){var t=this.get("ftype");return t="multi_select"==t?"select":t},getRelatedPrototype:function(){return acf.getFieldType(this.getRelatedType()).prototype},getValue:function(){return this.getRelatedPrototype().getValue.apply(this,arguments)},setValue:function(){return this.getRelatedPrototype().setValue.apply(this,arguments)},initialize:function(){this.getRelatedPrototype().initialize.apply(this,arguments)},onRemove:function(){var t=this.getRelatedPrototype();t.onRemove&&t.onRemove.apply(this,arguments)},onClickAdd:function(t,e){var i=this,n=!1,a=!1,s=!1,o=!1,r=!1,c=!1,l=function(t){n.loading(!1),n.content(t),a=n.$("form"),s=n.$('input[name="term_name"]'),o=n.$('select[name="term_parent"]'),r=n.$(".acf-submit-button"),s.trigger("focus"),n.on("submit","form",d)},d=function(t,e){if(t.preventDefault(),t.stopImmediatePropagation(),""===s.val())return s.trigger("focus"),!1;acf.startButtonLoading(r);t={action:"acf/fields/taxonomy/add_term",field_key:i.get("key"),term_name:s.val(),term_parent:o.length?o.val():0};p.ajax({url:acf.get("ajaxurl"),data:acf.prepareForAjax(t),type:"post",dataType:"json",success:u})},u=function(t){acf.stopButtonLoading(r),c&&c.remove(),c=acf.isAjaxSuccess(t)?(s.val(""),f(t.data),acf.newNotice({type:"success",text:acf.getAjaxMessage(t),target:a,timeout:2e3,dismiss:!1})):acf.newNotice({type:"error",text:acf.getAjaxError(t),target:a,timeout:2e3,dismiss:!1}),s.trigger("focus")},f=function(e){var t=p('<option value="'+e.term_id+'">'+e.term_label+"</option>");e.term_parent?o.children('option[value="'+e.term_parent+'"]').after(t):o.append(t),acf.getFields({type:"taxonomy"}).map(function(t){t.get("taxonomy")==i.get("taxonomy")&&t.appendTerm(e)}),i.selectTerm(e.term_id)};!function(){n=acf.newPopup({title:e.attr("title"),loading:!0,width:"300px"});var t={action:"acf/fields/taxonomy/add_term",field_key:i.get("key")};p.ajax({url:acf.get("ajaxurl"),data:acf.prepareForAjax(t),type:"post",dataType:"html",success:l})}()},appendTerm:function(t){"select"==this.getRelatedType()?this.appendTermSelect(t):this.appendTermCheckbox(t)},appendTermSelect:function(t){this.select2.addOption({id:t.term_id,text:t.term_label})},appendTermCheckbox:function(t){var e=this.$("[name]:first").attr("name"),i=this.$("ul:first");"checkbox"==this.getRelatedType()&&(e+="[]");e=p(['<li data-id="'+t.term_id+'">',"<label>",'<input type="'+this.get("ftype")+'" value="'+t.term_id+'" name="'+e+'" /> ',"<span>"+t.term_name+"</span>","</label>","</li>"].join(""));t.term_parent&&((i=(t=i.find('li[data-id="'+t.term_parent+'"]')).children("ul")).exists()||(i=p('<ul class="children acf-bl"></ul>'),t.append(i))),i.append(e)},selectTerm:function(t){"select"==this.getRelatedType()?this.select2.selectOption(t):this.$('input[value="'+t+'"]').prop("checked",!0).trigger("change")},onClickRadio:function(t,e){var i=e.parent("label"),n=i.hasClass("selected");this.$(".selected").removeClass("selected"),i.addClass("selected"),this.get("allow_null")&&n&&(i.removeClass("selected"),e.prop("checked",!1).trigger("change"))}});acf.registerFieldType(t)}(jQuery),function(i){var t=acf.models.DatePickerField.extend({type:"time_picker",$control:function(){return this.$(".acf-time-picker")},initialize:function(){var t=this.$input(),e=this.$inputText(),t={timeFormat:this.get("time_format"),altField:t,altFieldTimeOnly:!1,altTimeFormat:"HH:mm:ss",showButtonPanel:!0,controlType:"select",oneLine:!0,closeText:acf.get("dateTimePickerL10n").selectText,timeOnly:!0,onClose:function(t,e,i){e=e.dpDiv.find(".ui-datepicker-close");!t&&e.is(":hover")&&i._updateDateTime()}},t=acf.applyFilters("time_picker_args",t,this);acf.newTimePicker(e,t),acf.doAction("time_picker_init",e,t,this)}});acf.registerFieldType(t),acf.newTimePicker=function(t,e){if(void 0===i.timepicker)return!1;t.timepicker(e=e||{}),i("body > #ui-datepicker-div").exists()&&i("body > #ui-datepicker-div").wrap('<div class="acf-ui-datepicker" />')}}(jQuery),function(){var t=acf.Field.extend({type:"true_false",events:{"change .acf-switch-input":"onChange","focus .acf-switch-input":"onFocus","blur .acf-switch-input":"onBlur","keypress .acf-switch-input":"onKeypress"},$input:function(){return this.$('input[type="checkbox"]')},$switch:function(){return this.$(".acf-switch")},getValue:function(){return this.$input().prop("checked")?1:0},initialize:function(){this.render()},render:function(){var t,e,i=this.$switch();i.length&&(t=i.children(".acf-switch-on"),e=i.children(".acf-switch-off"),(i=Math.max(t.width(),e.width()))&&(t.css("min-width",i),e.css("min-width",i)))},switchOn:function(){this.$input().prop("checked",!0),this.$switch().addClass("-on")},switchOff:function(){this.$input().prop("checked",!1),this.$switch().removeClass("-on")},onChange:function(t,e){e.prop("checked")?this.switchOn():this.switchOff()},onFocus:function(t,e){this.$switch().addClass("-focus")},onBlur:function(t,e){this.$switch().removeClass("-focus")},onKeypress:function(t,e){return 37===t.keyCode?this.switchOff():39===t.keyCode?this.switchOn():void 0}});acf.registerFieldType(t)}(jQuery),function(){var t=acf.Field.extend({type:"url",events:{'keyup input[type="url"]':"onkeyup"},$control:function(){return this.$(".acf-input-wrap")},$input:function(){return this.$('input[type="url"]')},initialize:function(){this.render()},isValid:function(){var t=this.val();return!!t&&(-1!==t.indexOf("://")||0===t.indexOf("//"))},render:function(){this.isValid()?this.$control().addClass("-valid"):this.$control().removeClass("-valid")},onkeyup:function(t,e){this.render()}});acf.registerFieldType(t)}(jQuery),function(){var t=acf.Field.extend({type:"wysiwyg",wait:"load",events:{"mousedown .acf-editor-wrap.delay":"onMousedown",unmountField:"disableEditor",remountField:"enableEditor",removeField:"disableEditor"},$control:function(){return this.$(".acf-editor-wrap")},$input:function(){return this.$("textarea")},getMode:function(){return this.$control().hasClass("tmce-active")?"visual":"text"},initialize:function(){this.$control().hasClass("delay")||this.initializeEditor()},initializeEditor:function(){var t=this.$control(),e=this.$input(),i={tinymce:!0,quicktags:!0,toolbar:this.get("toolbar"),mode:this.getMode(),field:this},n=e.attr("id"),a=acf.uniqueId("acf-editor-"),s=e.data(),e=e.val();acf.rename({target:t,search:n,replace:a,destructive:!0}),this.set("id",a,!0),this.$input().data(s).val(e),acf.tinymce.initialize(a,i)},onMousedown:function(t){t.preventDefault();t=this.$control();t.removeClass("delay"),t.find(".acf-editor-toolbar").remove(),this.initializeEditor()},enableEditor:function(){"visual"==this.getMode()&&acf.tinymce.enable(this.get("id"))},disableEditor:function(){acf.tinymce.destroy(this.get("id"))}});acf.registerFieldType(t)}(jQuery),function(e){var s=[];acf.Condition=acf.Model.extend({type:"",operator:"==",label:"",choiceType:"input",fieldTypes:[],data:{conditions:!1,field:!1,rule:{}},events:{change:"change",keyup:"change",enableField:"change",disableField:"change"},setup:function(t){e.extend(this.data,t)},getEventTarget:function(t,e){return t||this.get("field").$el},change:function(t,e){this.get("conditions").change(t)},match:function(t,e){return!1},calculate:function(){return this.match(this.get("rule"),this.get("field"))},choices:function(t){return'<input type="text" />'}}),acf.newCondition=function(t,e){var i=e.get("field"),n=i.getField(t.field);if(!i||!n)return!1;e={rule:t,target:i,conditions:e,field:n},n=n.get("type"),t=t.operator;return new(acf.getConditionTypes({fieldType:n,operator:t})[0]||acf.Condition)(e)};function n(t){return acf.strPascalCase(t||"")+"Condition"}acf.registerConditionType=function(t){var e=t.prototype.type,i=n(e);acf.models[i]=t,s.push(e)},acf.getConditionType=function(t){t=n(t);return acf.models[t]||!1},acf.registerConditionForFieldType=function(t,e){t=acf.getConditionType(t);t&&t.prototype.fieldTypes.push(e)},acf.getConditionTypes=function(n){n=acf.parseArgs(n,{fieldType:"",operator:""});var a=[];return s.map(function(t){var e=acf.getConditionType(t),i=e.prototype.fieldTypes,t=e.prototype.operator;n.fieldType&&-1===i.indexOf(n.fieldType)||n.operator&&t!==n.operator||a.push(e)}),a}}(jQuery),function(){function a(t,e){var i=acf.getFields({key:e,sibling:t.$el,suppressFilters:!0});return!!(i=!i.length?acf.getFields({key:e,parent:t.$el.parent(),suppressFilters:!0}):i).length&&i[0]}var t="conditional_logic";new acf.Model({id:"conditionsManager",priority:20,actions:{new_field:"onNewField"},onNewField:function(t){t.has("conditions")&&t.getConditions().render()}});acf.Field.prototype.getField=function(t){var e=a(this,t);if(e)return e;for(var i=this.parents(),n=0;n<i.length;n++)if(e=a(i[n],t))return e;return!1};acf.Field.prototype.getConditions=function(){return this.conditions||(this.conditions=new e(this)),this.conditions};var e=acf.Model.extend({id:"Conditions",data:{field:!1,timeStamp:!1,groups:[]},setup:function(t){t=(this.data.field=t).get("conditions");t instanceof Array?t[0]instanceof Array?t.map(function(t,e){this.addRules(t,e)},this):this.addRules(t):this.addRule(t)},change:function(t){if(this.get("timeStamp")===t.timeStamp)return!1;this.set("timeStamp",t.timeStamp,!0);this.render()},render:function(){return this.calculate()?this.show():this.hide()},show:function(){return this.get("field").showEnable(this.cid,t)},hide:function(){return this.get("field").hideDisable(this.cid,t)},calculate:function(){var e=!1;return this.getGroups().map(function(t){e||t.filter(function(t){return t.calculate()}).length==t.length&&(e=!0)}),e},hasGroups:function(){return null!=this.data.groups},getGroups:function(){return this.data.groups},addGroup:function(){var t=[];return this.data.groups.push(t),t},hasGroup:function(t){return null!=this.data.groups[t]},getGroup:function(t){return this.data.groups[t]},removeGroup:function(t){return this.data.groups[t].delete,this},addRules:function(t,e){t.map(function(t){this.addRule(t,e)},this)},addRule:function(t,e){e=this.hasGroup(e=e||0)?this.getGroup(e):this.addGroup(),t=acf.newCondition(t,this);if(!t)return!1;e.push(t)},hasRule:function(){},getRule:function(t,e){return this.data.groups[e=e||0][t=t||0]},removeRule:function(){}})}(jQuery),function(){function n(t){return t?""+t:""}function a(t,e){return n(t).toLowerCase()===n(e).toLowerCase()}var s=acf.__,i=acf.Condition.extend({type:"hasValue",operator:"!=empty",label:s("Has any value"),fieldTypes:["text","textarea","number","range","email","url","password","image","file","wysiwyg","oembed","select","checkbox","radio","button_group","link","post_object","page_link","relationship","taxonomy","user","google_map","date_picker","date_time_picker","time_picker","color_picker"],match:function(t,e){return!!e.val()},choices:function(t){return'<input type="text" disabled="" />'}});acf.registerConditionType(i);var t=i.extend({type:"hasNoValue",operator:"==empty",label:s("Has no value"),match:function(t,e){return!i.prototype.match.apply(this,arguments)}});acf.registerConditionType(t);var o=acf.Condition.extend({type:"equalTo",operator:"==",label:s("Value is equal to"),fieldTypes:["text","textarea","number","range","email","url","password"],match:function(t,e){return acf.isNumeric(t.value)?(i=t.value,n=e.val(),parseFloat(i)===parseFloat(n)):a(t.value,e.val());var i,n},choices:function(t){return'<input type="text" />'}});acf.registerConditionType(o);var e=o.extend({type:"notEqualTo",operator:"!=",label:s("Value is not equal to"),match:function(t,e){return!o.prototype.match.apply(this,arguments)}});acf.registerConditionType(e);t=acf.Condition.extend({type:"patternMatch",operator:"==pattern",label:s("Value matches pattern"),fieldTypes:["text","textarea","email","url","password","wysiwyg"],match:function(t,e){return function(t,e){e=new RegExp(n(e),"gi");return n(t).match(e)}(e.val(),t.value)},choices:function(t){return'<input type="text" placeholder="[a-z0-9]" />'}});acf.registerConditionType(t);t=acf.Condition.extend({type:"contains",operator:"==contains",label:s("Value contains"),fieldTypes:["text","textarea","number","email","url","password","wysiwyg","oembed","select"],match:function(t,e){return e=e.val(),t=t.value,-1<n(e).indexOf(n(t))},choices:function(t){return'<input type="text" />'}});acf.registerConditionType(t);t=o.extend({type:"trueFalseEqualTo",choiceType:"select",fieldTypes:["true_false"],choices:function(t){return[{id:1,text:s("Checked")}]}});acf.registerConditionType(t);t=e.extend({type:"trueFalseNotEqualTo",choiceType:"select",fieldTypes:["true_false"],choices:function(t){return[{id:1,text:s("Checked")}]}});acf.registerConditionType(t);var r=acf.Condition.extend({type:"selectEqualTo",operator:"==",label:s("Value is equal to"),fieldTypes:["select","checkbox","radio","button_group"],match:function(t,e){var i=e.val();return i instanceof Array?(e=t.value,-1<i.map(n).indexOf(e)):a(t.value,i)},choices:function(t){var e=[],i=t.$setting("choices textarea").val().split("\n");return t.$input("allow_null").prop("checked")&&e.push({id:"",text:s("Null")}),i.map(function(t){(t=t.split(":"))[1]=t[1]||t[0],e.push({id:t[0].trim(),text:t[1].trim()})}),e}});acf.registerConditionType(r);e=r.extend({type:"selectNotEqualTo",operator:"!=",label:s("Value is not equal to"),match:function(t,e){return!r.prototype.match.apply(this,arguments)}});acf.registerConditionType(e);t=acf.Condition.extend({type:"greaterThan",operator:">",label:s("Value is greater than"),fieldTypes:["number","range"],match:function(t,e){e=e.val();return e instanceof Array&&(e=e.length),e=e,t=t.value,parseFloat(e)>parseFloat(t)},choices:function(t){return'<input type="number" />'}});acf.registerConditionType(t);e=t.extend({type:"lessThan",operator:"<",label:s("Value is less than"),match:function(t,e){e=e.val();return e instanceof Array&&(e=e.length),e=e,t=t.value,parseFloat(e)<parseFloat(t)},choices:function(t){return'<input type="number" />'}});acf.registerConditionType(e);t=t.extend({type:"selectionGreaterThan",label:s("Selection is greater than"),fieldTypes:["checkbox","select","post_object","page_link","relationship","taxonomy","user"]});acf.registerConditionType(t);e=e.extend({type:"selectionLessThan",label:s("Selection is less than"),fieldTypes:["checkbox","select","post_object","page_link","relationship","taxonomy","user"]});acf.registerConditionType(e)}(jQuery),function(t){acf.unload=new acf.Model({wait:"load",active:!0,changed:!1,actions:{validation_failure:"startListening",validation_success:"stopListening"},events:{"change form .acf-field":"startListening","submit form":"stopListening"},enable:function(){this.active=!0},disable:function(){this.active=!1},reset:function(){this.stopListening()},startListening:function(){!this.changed&&this.active&&(this.changed=!0,t(window).on("beforeunload",this.onUnload))},stopListening:function(){this.changed=!1,t(window).off("beforeunload",this.onUnload)},onUnload:function(){return acf.__("The changes you made will be lost if you navigate away from this page")}})}(jQuery),function(e){new acf.Model({wait:"prepare",priority:1,initialize:function(){(acf.get("postboxes")||[]).map(acf.newPostbox)}});acf.getPostbox=function(t){return"string"==typeof arguments[0]&&(t=e("#"+arguments[0])),acf.getInstance(t)},acf.getPostboxes=function(){return acf.getInstances(e(".acf-postbox"))},acf.newPostbox=function(t){return new acf.models.Postbox(t)},acf.models.Postbox=acf.Model.extend({data:{id:"",key:"",style:"default",label:"top",edit:""},setup:function(t){t.editLink&&(t.edit=t.editLink),e.extend(this.data,t),this.$el=this.$postbox()},$postbox:function(){return e("#"+this.get("id"))},$hide:function(){return e("#"+this.get("id")+"-hide")},$hideLabel:function(){return this.$hide().parent()},$hndle:function(){return this.$("> .hndle")},$handleActions:function(){return this.$("> .postbox-header .handle-actions")},$inside:function(){return this.$("> .inside")},isVisible:function(){return this.$el.hasClass("acf-hidden")},initialize:function(){this.$el.addClass("acf-postbox"),this.$el.removeClass("hide-if-js"),"block"===acf.get("editor")||"default"!==(t=this.get("style"))&&this.$el.addClass(t),this.$inside().addClass("acf-fields").addClass("-"+this.get("label"));var t,e=this.get("edit");e&&(t='<a href="'+e+'" class="dashicons dashicons-admin-generic acf-hndle-cog acf-js-tooltip" title="'+acf.__("Edit field group")+'"></a>',(e=this.$handleActions()).length?e.prepend(t):this.$hndle().append(t)),this.show()},show:function(){this.$hideLabel().show(),this.$hide().prop("checked",!0),this.$el.show().removeClass("acf-hidden"),acf.doAction("show_postbox",this)},enable:function(){acf.enable(this.$el,"postbox")},showEnable:function(){this.enable(),this.show()},hide:function(){this.$hideLabel().hide(),this.$el.hide().addClass("acf-hidden"),acf.doAction("hide_postbox",this)},disable:function(){acf.disable(this.$el,"postbox")},hideDisable:function(){this.disable(),this.hide()},html:function(t){this.$inside().html(t),acf.doAction("append",this.$el)}})}(jQuery),function(a){acf.newMediaPopup=function(t){var e=null,e=new("edit"==(t=acf.parseArgs(t,{mode:"select",title:"",button:"",type:"",field:!1,allowedTypes:"",library:"all",multiple:!1,attachment:0,autoOpen:!0,open:function(){},select:function(){},close:function(){}})).mode?acf.models.EditMediaPopup:acf.models.SelectMediaPopup)(t);return t.autoOpen&&setTimeout(function(){e.open()},1),acf.doAction("new_media_popup",e),e};function e(){var t=acf.get("post_id");return acf.isNumeric(t)?t:0}acf.getMimeTypes=function(){return this.get("mimeTypes")},acf.getMimeType=function(t){var e,i=acf.getMimeTypes();if(void 0!==i[t])return i[t];for(e in i)if(-1!==e.indexOf(t))return i[e];return!1};var n=acf.Model.extend({id:"MediaPopup",data:{},defaults:{},frame:!1,setup:function(t){a.extend(this.data,t)},initialize:function(){var t=this.getFrameOptions();this.addFrameStates(t);var e=wp.media(t);(e.acf=this).addFrameEvents(e,t),this.frame=e},open:function(){this.frame.open()},close:function(){this.frame.close()},remove:function(){this.frame.detach(),this.frame.remove()},getFrameOptions:function(){var t={title:this.get("title"),multiple:this.get("multiple"),library:{},states:[]};return this.get("type")&&(t.library.type=this.get("type")),"uploadedTo"===this.get("library")&&(t.library.uploadedTo=e()),this.get("attachment")&&(t.library.post__in=[this.get("attachment")]),this.get("button")&&(t.button={text:this.get("button")}),t},addFrameStates:function(t){var e=wp.media.query(t.library);this.get("field")&&acf.isset(e,"mirroring","args")&&(e.mirroring.args._acfuploader=this.get("field")),t.states.push(new wp.media.controller.Library({library:e,multiple:this.get("multiple"),title:this.get("title"),priority:20,filterable:"all",editable:!0,allowLocalEdits:!0})),acf.isset(wp,"media","controller","EditImage")&&t.states.push(new wp.media.controller.EditImage)},addFrameEvents:function(i,t){i.on("open",function(){this.$el.closest(".media-modal").addClass("acf-media-modal -"+this.acf.get("mode"))},i),i.on("content:render:edit-image",function(){var t=this.state().get("image"),t=new wp.media.view.EditImage({model:t,controller:this}).render();this.content.set(t),t.loadEditor()},i),i.on("select",function(){var t=i.state().get("selection");t&&t.each(function(t,e){i.acf.get("select").apply(i.acf,[t,e])})}),i.on("close",function(){setTimeout(function(){i.acf.get("close").apply(i.acf),i.acf.remove()},1)})}});acf.models.SelectMediaPopup=n.extend({id:"SelectMediaPopup",setup:function(t){t.button||(t.button=acf._x("Select","verb")),n.prototype.setup.apply(this,arguments)},addFrameEvents:function(e,t){acf.isset(_wpPluploadSettings,"defaults","multipart_params")&&(_wpPluploadSettings.defaults.multipart_params._acfuploader=this.get("field"),e.on("open",function(){delete _wpPluploadSettings.defaults.multipart_params._acfuploader})),e.on("content:activate:browse",function(){var t=!1;try{t=e.content.get().toolbar}catch(t){return void console.log(t)}e.acf.customizeFilters.apply(e.acf,[t])}),n.prototype.addFrameEvents.apply(this,arguments)},customizeFilters:function(t){var i,e=t.get("filters");"image"==this.get("type")&&(e.filters.all.text=acf.__("All images"),delete e.filters.audio,delete e.filters.video,delete e.filters.image,a.each(e.filters,function(t,e){e.props.type=e.props.type||"image"})),this.get("allowedTypes")&&this.get("allowedTypes").split(" ").join("").split(".").join("").split(",").map(function(t){t=acf.getMimeType(t);t&&(e.filters[t]={text:t,props:{status:null,type:t,uploadedTo:null,orderby:"date",order:"DESC"},priority:20})}),"uploadedTo"===this.get("library")&&(i=this.frame.options.library.uploadedTo,delete e.filters.unattached,delete e.filters.uploaded,a.each(e.filters,function(t,e){e.text+=" ("+acf.__("Uploaded to this post")+")",e.props.uploadedTo=i}));var n=this.get("field");a.each(e.filters,function(t,e){e.props._acfuploader=n}),t.get("search").model.attributes._acfuploader=n,e.renderFilters&&e.renderFilters()}}),acf.models.EditMediaPopup=n.extend({id:"SelectMediaPopup",setup:function(t){t.button||(t.button=acf._x("Update","verb")),n.prototype.setup.apply(this,arguments)},addFrameEvents:function(i,t){i.on("open",function(){this.$el.closest(".media-modal").addClass("acf-expanded"),"browse"!=this.content.mode()&&this.content.mode("browse");var t=this.state().get("selection"),e=wp.media.attachment(i.acf.get("attachment"));t.add(e)},i),n.prototype.addFrameEvents.apply(this,arguments)}});new acf.Model({id:"customizePrototypes",wait:"ready",initialize:function(){var t;acf.isset(window,"wp","media","view")&&((t=e())&&acf.isset(wp,"media","view","settings","post")&&(wp.media.view.settings.post.id=t),this.customizeAttachmentsButton(),this.customizeAttachmentsRouter(),this.customizeAttachmentFilters(),this.customizeAttachmentCompat(),this.customizeAttachmentLibrary())},customizeAttachmentsButton:function(){var t;acf.isset(wp,"media","view","Button")&&(t=wp.media.view.Button,wp.media.view.Button=t.extend({initialize:function(){var t=_.defaults(this.options,this.defaults);this.model=new Backbone.Model(t),this.listenTo(this.model,"change",this.render)}}))},customizeAttachmentsRouter:function(){var t;acf.isset(wp,"media","view","Router")&&(t=wp.media.view.Router,wp.media.view.Router=t.extend({addExpand:function(){var t=a(['<a href="#" class="acf-expand-details">','<span class="is-closed"><i class="acf-icon -left -small"></i>'+acf.__("Expand Details")+"</span>",'<span class="is-open"><i class="acf-icon -right -small"></i>'+acf.__("Collapse Details")+"</span>","</a>"].join(""));t.on("click",function(t){t.preventDefault();t=a(this).closest(".media-modal");t.hasClass("acf-expanded")?t.removeClass("acf-expanded"):t.addClass("acf-expanded")}),this.$el.append(t)},initialize:function(){return t.prototype.initialize.apply(this,arguments),this.addExpand(),this}}))},customizeAttachmentFilters:function(){acf.isset(wp,"media","view","AttachmentFilters","All")&&(wp.media.view.AttachmentFilters.All.prototype.renderFilters=function(){this.$el.html(_.chain(this.filters).map(function(t,e){return{el:a("<option></option>").val(e).html(t.text)[0],priority:t.priority||50}},this).sortBy("priority").pluck("el").value())})},customizeAttachmentCompat:function(){var t,e;acf.isset(wp,"media","view","AttachmentCompat")&&(t=wp.media.view.AttachmentCompat,e=!1,wp.media.view.AttachmentCompat=t.extend({render:function(){return this.rendered?this:(t.prototype.render.apply(this,arguments),this.$("#acf-form-data").length&&(clearTimeout(e),e=setTimeout(a.proxy(function(){this.rendered=!0,acf.doAction("append",this.$el)},this),50)),this)},save:function(t){var e;t&&t.preventDefault(),e=acf.serializeForAjax(this.$el),this.controller.trigger("attachment:compat:waiting",["waiting"]),this.model.saveCompat(e).always(_.bind(this.postSave,this))}}))},customizeAttachmentLibrary:function(){var o;acf.isset(wp,"media","view","Attachment","Library")&&(o=wp.media.view.Attachment.Library,wp.media.view.Attachment.Library=o.extend({render:function(){var t=acf.isget(this,"controller","acf"),e=acf.isget(this,"model","attributes");return t&&e&&(e.acf_errors&&this.$el.addClass("acf-disabled"),(t=t.get("selected"))&&-1<t.indexOf(e.id)&&this.$el.addClass("acf-selected")),o.prototype.render.apply(this,arguments)},toggleSelection:function(t){this.collection;var e=this.options.selection,i=this.model,n=(e.single(),this.controller),a=acf.isget(this,"model","attributes","acf_errors"),s=n.$el.find(".media-frame-content .media-sidebar");if(s.children(".acf-selection-error").remove(),s.children().removeClass("acf-hidden"),n&&a){n=acf.isget(this,"model","attributes","filename");return s.children().addClass("acf-hidden"),s.prepend(['<div class="acf-selection-error">','<span class="selection-error-label">'+acf.__("Restricted")+"</span>",'<span class="selection-error-filename">'+n+"</span>",'<span class="selection-error-message">'+a+"</span>","</div>"].join("")),e.reset(),void e.single(i)}return o.prototype.toggleSelection.apply(this,arguments)}}))}})}(jQuery),function(u){acf.screen=new acf.Model({active:!0,xhr:!1,timeout:!1,wait:"load",events:{"change #page_template":"onChange","change #parent_id":"onChange","change #post-formats-select":"onChange","change .categorychecklist":"onChange","change .tagsdiv":"onChange",'change .acf-taxonomy-field[data-save="1"]':"onChange","change #product-type":"onChange"},isPost:function(){return"post"===acf.get("screen")},isUser:function(){return"user"===acf.get("screen")},isTaxonomy:function(){return"taxonomy"===acf.get("screen")},isAttachment:function(){return"attachment"===acf.get("screen")},isNavMenu:function(){return"nav_menu"===acf.get("screen")},isWidget:function(){return"widget"===acf.get("screen")},isComment:function(){return"comment"===acf.get("screen")},getPageTemplate:function(){var t=u("#page_template");return t.length?t.val():null},getPageParent:function(t,e){return(e=u("#parent_id")).length?e.val():null},getPageType:function(t,e){return this.getPageParent()?"child":"parent"},getPostType:function(){return u("#post_type").val()},getPostFormat:function(t,e){if((e=u("#post-formats-select input:checked")).length){e=e.val();return"0"==e?"standard":e}return null},getPostCoreTerms:function(){var t,e={},i=acf.serialize(u(".categorydiv, .tagsdiv"));for(t in i.tax_input&&(e=i.tax_input),i.post_category&&(e.category=i.post_category),e)acf.isArray(e[t])||(e[t]=e[t].split(/,[\s]?/));return e},getPostTerms:function(){var t,i=this.getPostCoreTerms();for(t in acf.getFields({type:"taxonomy"}).map(function(t){var e;t.get("save")&&(e=t.val(),t=t.get("taxonomy"),e&&(i[t]=i[t]||[],e=acf.isArray(e)?e:[e],i[t]=i[t].concat(e)))}),null!==(productType=this.getProductType())&&(i.product_type=[productType]),i)i[t]=acf.uniqueArray(i[t]);return i},getProductType:function(){var t=u("#product-type");return t.length?t.val():null},check:function(){var e;"post"===acf.get("screen")&&(this.xhr&&this.xhr.abort(),e=acf.parseArgs(this.data,{action:"acf/ajax/check_screen",screen:acf.get("screen"),exists:[]}),this.isPost()&&(e.post_id=acf.get("post_id")),null!==(postType=this.getPostType())&&(e.post_type=postType),null!==(pageTemplate=this.getPageTemplate())&&(e.page_template=pageTemplate),null!==(pageParent=this.getPageParent())&&(e.page_parent=pageParent),null!==(pageType=this.getPageType())&&(e.page_type=pageType),null!==(postFormat=this.getPostFormat())&&(e.post_format=postFormat),null!==(postTerms=this.getPostTerms())&&(e.post_terms=postTerms),acf.getPostboxes().map(function(t){e.exists.push(t.get("key"))}),e=acf.applyFilters("check_screen_args",e),this.xhr=u.ajax({url:acf.get("ajaxurl"),data:acf.prepareForAjax(e),type:"post",dataType:"json",context:this,success:function(t){"post"==acf.get("screen")?this.renderPostScreen(t):"user"==acf.get("screen")&&this.renderUserScreen(t),acf.doAction("check_screen_complete",t,e)}}))},onChange:function(t,e){this.setTimeout(this.check,1)},renderPostScreen:function(c){function l(t,e){var i,n=u._data(t[0]).events;for(i in n)for(var a=0;a<n[i].length;a++)e.on(i,n[i][a].handler)}function d(t,e){var i=e.indexOf(t);if(-1!=i){for(var n=i-1;0<=n;n--)if(u("#"+e[n]).length)return u("#"+e[n]).after(u("#"+t));for(n=i+1;n<e.length;n++)if(u("#"+e[n]).length)return u("#"+e[n]).before(u("#"+t))}}c.visible=[],c.hidden=[],c.results=c.results.map(function(e,t){var i=acf.getPostbox(e.id);if(acf.isGutenberg()&&"acf_after_title"==e.position&&(e.position="normal"),!i){a=(5.5<=parseFloat(acf.get("wp_version"))?['<div class="postbox-header">','<h2 class="hndle ui-sortable-handle">',"<span>"+acf.escHtml(e.title)+"</span>","</h2>",'<div class="handle-actions hide-if-no-js">','<button type="button" class="handlediv" aria-expanded="true">','<span class="screen-reader-text">Toggle panel: '+acf.escHtml(e.title)+"</span>",'<span class="toggle-indicator" aria-hidden="true"></span>',"</button>","</div>","</div>"]:['<button type="button" class="handlediv" aria-expanded="true">','<span class="screen-reader-text">Toggle panel: '+acf.escHtml(e.title)+"</span>",'<span class="toggle-indicator" aria-hidden="true"></span>',"</button>",'<h2 class="hndle ui-sortable-handle">',"<span>"+acf.escHtml(e.title)+"</span>","</h2>"]).join("");var n,a,s=u(['<div id="'+e.id+'" class="postbox">',a,'<div class="inside">',e.html,"</div>","</div>"].join(""));u("#adv-settings").length&&(n=u("#adv-settings .metabox-prefs"),a=u(['<label for="'+e.id+'-hide">','<input class="hide-postbox-tog" name="'+e.id+'-hide" type="checkbox" id="'+e.id+'-hide" value="'+e.id+'" checked="checked">'," "+e.title,"</label>"].join("")),l(n.find("input").first(),a.find("input")),n.append(a)),u(".postbox").length&&(l(u(".postbox .handlediv").first(),s.children(".handlediv")),l(u(".postbox .hndle").first(),s.children(".hndle"))),"side"===e.position?u("#"+e.position+"-sortables").append(s):u("#"+e.position+"-sortables").prepend(s);var o=[];if(c.results.map(function(t){e.position===t.position&&u("#"+e.position+"-sortables #"+t.id).length&&o.push(t.id)}),d(e.id,o),c.sorted)for(var r in c.sorted){o=c.sorted[r].split(",");if(d(e.id,o))break}i=acf.newPostbox(e),acf.doAction("append",s),acf.doAction("append_postbox",i)}return i.showEnable(),c.visible.push(e.id),e}),acf.getPostboxes().map(function(t){-1===c.visible.indexOf(t.get("id"))&&(t.hideDisable(),c.hidden.push(t.get("id")))}),u("#acf-style").html(c.style),acf.doAction("refresh_post_screen",c)},renderUserScreen:function(t){}});new acf.Model({postEdits:{},wait:"prepare",initialize:function(){acf.isGutenberg()&&(wp.data.subscribe(acf.debounce(this.onChange).bind(this)),acf.screen.getPageTemplate=this.getPageTemplate,acf.screen.getPageParent=this.getPageParent,acf.screen.getPostType=this.getPostType,acf.screen.getPostFormat=this.getPostFormat,acf.screen.getPostCoreTerms=this.getPostCoreTerms,acf.unload.disable(),5.3<=parseFloat(acf.get("wp_version"))&&this.addAction("refresh_post_screen",this.onRefreshPostScreen),wp.domReady(acf.refresh))},onChange:function(){var e=["template","parent","format"];(wp.data.select("core").getTaxonomies()||[]).map(function(t){e.push(t.rest_base)});var i=wp.data.select("core/editor").getPostEdits(),n={};e.map(function(t){void 0!==i[t]&&(n[t]=i[t])}),JSON.stringify(n)!==JSON.stringify(this.postEdits)&&(this.postEdits=n,acf.screen.check())},getPageTemplate:function(){return wp.data.select("core/editor").getEditedPostAttribute("template")},getPageParent:function(t,e){return wp.data.select("core/editor").getEditedPostAttribute("parent")},getPostType:function(){return wp.data.select("core/editor").getEditedPostAttribute("type")},getPostFormat:function(t,e){return wp.data.select("core/editor").getEditedPostAttribute("format")},getPostCoreTerms:function(){var i={};return(wp.data.select("core").getTaxonomies()||[]).map(function(t){var e=wp.data.select("core/editor").getEditedPostAttribute(t.rest_base);e&&(i[t.slug]=e)}),i},onRefreshPostScreen:function(e){var i=wp.data.select("core/edit-post"),t=wp.data.dispatch("core/edit-post"),n={};i.getActiveMetaBoxLocations().map(function(t){n[t]=i.getMetaBoxesPerLocation(t)});var a,s=[];for(a in n)n[a].map(function(t){s.push(t.id)});for(a in e.results.filter(function(t){return-1===s.indexOf(t.id)}).map(function(t,e){var i=t.position;n[i]=n[i]||[],n[i].push({id:t.id,title:t.title})}),n)n[a]=n[a].filter(function(t){return-1===e.hidden.indexOf(t.id)});t.setAvailableMetaBoxesPerLocation(n)}})}(jQuery),function(l){function n(){return acf.isset(window,"jQuery","fn","select2","amd")?4:!!acf.isset(window,"Select2")&&3}acf.newSelect2=function(t,e){return e=acf.parseArgs(e,{allowNull:!1,placeholder:"",multiple:!1,field:!1,ajax:!1,ajaxAction:"",ajaxData:function(t){return t},ajaxResults:function(t){return t}}),e=new(4==n()?a:s)(t,e),acf.doAction("new_select2",e),e};var i=acf.Model.extend({setup:function(t,e){l.extend(this.data,e),this.$el=t},initialize:function(){},selectOption:function(t){t=this.getOption(t);t.prop("selected")||t.prop("selected",!0).trigger("change")},unselectOption:function(t){t=this.getOption(t);t.prop("selected")&&t.prop("selected",!1).trigger("change")},getOption:function(t){return this.$('option[value="'+t+'"]')},addOption:function(t){t=acf.parseArgs(t,{id:"",text:"",selected:!1});var e=this.getOption(t.id);return e.length||((e=l("<option></option>")).html(t.text),e.attr("value",t.id),e.prop("selected",t.selected),this.$el.append(e)),e},getValue:function(){var e=[],t=this.$el.find("option:selected");return t.exists()&&(t=t.sort(function(t,e){return+t.getAttribute("data-i")-+e.getAttribute("data-i")})).each(function(){var t=l(this);e.push({$el:t,id:t.attr("value"),text:t.text()})}),e},mergeOptions:function(){},getChoices:function(){var i=function(t){var e=[];return t.children().each(function(){var t=l(this);t.is("optgroup")?e.push({text:t.attr("label"),children:i(t)}):e.push({id:t.attr("value"),text:t.text()})}),e};return i(this.$el)},getAjaxData:function(t){var e={action:this.get("ajaxAction"),s:t.term||"",paged:t.page||1},i=this.get("field");i&&(e.field_key=i.get("key"));var n=this.get("ajaxData");return n&&(e=n.apply(this,[e,t])),e=acf.applyFilters("select2_ajax_data",e,this.data,this.$el,i||!1,this),acf.prepareForAjax(e)},getAjaxResults:function(t,e){t=acf.parseArgs(t,{results:!1,more:!1});var i=this.get("ajaxResults");return i&&(t=i.apply(this,[t,e])),t=acf.applyFilters("select2_ajax_results",t,e,this)},processAjaxResults:function(t,e){return(t=this.getAjaxResults(t,e)).more&&(t.pagination={more:!0}),setTimeout(l.proxy(this.mergeOptions,this),1),t},destroy:function(){this.$el.data("select2")&&this.$el.select2("destroy"),this.$el.siblings(".select2-container").remove()}}),a=i.extend({initialize:function(){var e=this.$el,t={width:"100%",allowClear:this.get("allowNull"),placeholder:this.get("placeholder"),multiple:this.get("multiple"),data:[],escapeMarkup:function(t){return"string"!=typeof t?t:acf.escHtml(t)}};acf.isset(window,"jQuery","fn","selectWoo")||(t.templateSelection=function(t){var e=l('<span class="acf-selection"></span>');return e.html(acf.escHtml(t.text)),e.data("element",t.element),e}),t.multiple&&this.getValue().map(function(t){t.$el.detach().appendTo(e)});var i=e.attr("data-ajax");void 0!==i&&(e.removeData("ajax"),e.removeAttr("data-ajax")),this.get("ajax")&&(t.ajax={url:acf.get("ajaxurl"),delay:250,dataType:"json",type:"post",cache:!1,data:l.proxy(this.getAjaxData,this),processResults:l.proxy(this.processAjaxResults,this)});var n=this.get("field"),t=acf.applyFilters("select2_args",t,e,this.data,n||!1,this);e.select2(t);var a,s=e.next(".select2-container");t.multiple&&((a=s.find("ul")).sortable({stop:function(t){a.find(".select2-selection__choice").each(function(){(l(this).data("data")?l(l(this).data("data").element):l(l(this).children("span.acf-selection").data("element"))).detach().appendTo(e)}),e.trigger("change")}}),e.on("select2:select",this.proxy(function(t){this.getOption(t.params.data.id).detach().appendTo(this.$el)}))),s.addClass("-acf"),void 0!==i&&e.attr("data-ajax",i),acf.doAction("select2_init",e,t,this.data,n||!1,this)},mergeOptions:function(){var i=!1,n=!1;l('.select2-results__option[role="group"]').each(function(){var t=l(this).children("ul"),e=l(this).children("strong");if(n&&n.text()===e.text())return i.append(t.children()),void l(this).remove();i=t,n=e})}}),s=i.extend({initialize:function(){var i=this.$el,n=this.getValue(),a=this.get("multiple"),t={width:"100%",allowClear:this.get("allowNull"),placeholder:this.get("placeholder"),separator:"||",multiple:this.get("multiple"),data:this.getChoices(),escapeMarkup:function(t){return acf.escHtml(t)},dropdownCss:{"z-index":"999999999"},initSelection:function(t,e){e(a?n:n.shift())}},e=i.siblings("input");e.length||(e=l('<input type="hidden" />'),i.before(e)),inputValue=n.map(function(t){return t.id}).join("||"),e.val(inputValue),t.multiple&&n.map(function(t){t.$el.detach().appendTo(i)}),t.allowClear&&(t.data=t.data.filter(function(t){return""!==t.id})),i.removeData("ajax"),i.removeAttr("data-ajax"),this.get("ajax")&&(t.ajax={url:acf.get("ajaxurl"),quietMillis:250,dataType:"json",type:"post",cache:!1,data:l.proxy(this.getAjaxData,this),results:l.proxy(this.processAjaxResults,this)});var s=this.get("field"),t=acf.applyFilters("select2_args",t,i,this.data,s||!1,this);e.select2(t);var o,r=e.select2("container"),c=l.proxy(this.getOption,this);t.multiple&&(o=r.find("ul")).sortable({stop:function(){o.find(".select2-search-choice").each(function(){var t=l(this).data("select2Data");c(t.id).detach().appendTo(i)}),i.trigger("change")}}),e.on("select2-selecting",function(t){var e=t.choice,t=c(e.id);(t=!t.length?l('<option value="'+e.id+'">'+e.text+"</option>"):t).detach().appendTo(i)}),r.addClass("-acf"),acf.doAction("select2_init",i,t,this.data,s||!1,this),e.on("change",function(){var t=e.val();t.indexOf("||")&&(t=t.split("||")),i.val(t).trigger("change")}),i.hide()},mergeOptions:function(){var i=!1;l("#select2-drop .select2-result-with-children").each(function(){var t=l(this).children("ul"),e=l(this).children(".select2-result-label");if(i&&i.text()===e.text())return i.append(t.children()),void l(this).remove();i=e})},getAjaxData:function(t,e){return i.prototype.getAjaxData.apply(this,[{term:t,page:e}])}});new acf.Model({priority:5,wait:"prepare",actions:{duplicate:"onDuplicate"},initialize:function(){var t=acf.get("locale"),e=(acf.get("rtl"),acf.get("select2L10n")),i=n();return!!e&&(0!==t.indexOf("en")&&void(4==i?this.addTranslations4():3==i&&this.addTranslations3()))},addTranslations4:function(){var e=acf.get("select2L10n"),t=(t=acf.get("locale")).replace("_","-"),i={errorLoading:function(){return e.load_fail},inputTooLong:function(t){t=t.input.length-t.maximum;return 1<t?e.input_too_long_n.replace("%d",t):e.input_too_long_1},inputTooShort:function(t){t=t.minimum-t.input.length;return 1<t?e.input_too_short_n.replace("%d",t):e.input_too_short_1},loadingMore:function(){return e.load_more},maximumSelected:function(t){t=t.maximum;return 1<t?e.selection_too_long_n.replace("%d",t):e.selection_too_long_1},noResults:function(){return e.matches_0},searching:function(){return e.searching}};jQuery.fn.select2.amd.define("select2/i18n/"+t,[],function(){return i})},addTranslations3:function(){var i=acf.get("select2L10n"),t=(t=acf.get("locale")).replace("_","-"),e={formatMatches:function(t){return 1<t?i.matches_n.replace("%d",t):i.matches_1},formatNoMatches:function(){return i.matches_0},formatAjaxError:function(){return i.load_fail},formatInputTooShort:function(t,e){t=e-t.length;return 1<t?i.input_too_short_n.replace("%d",t):i.input_too_short_1},formatInputTooLong:function(t,e){e=t.length-e;return 1<e?i.input_too_long_n.replace("%d",e):i.input_too_long_1},formatSelectionTooBig:function(t){return 1<t?i.selection_too_long_n.replace("%d",t):i.selection_too_long_1},formatLoadMore:function(){return i.load_more},formatSearching:function(){return i.searching}};l.fn.select2.locales=l.fn.select2.locales||{},l.fn.select2.locales[t]=e,l.extend(l.fn.select2.defaults,e)},onDuplicate:function(t,e){e.find(".select2-container").remove()}})}(jQuery),function(l){acf.tinymce={defaults:function(){return"undefined"!=typeof tinyMCEPreInit&&{tinymce:tinyMCEPreInit.mceInit.acf_content,quicktags:tinyMCEPreInit.qtInit.acf_content}},initialize:function(t,e){(e=acf.parseArgs(e,{tinymce:!0,quicktags:!0,toolbar:"full",mode:"visual",field:!1})).tinymce&&this.initializeTinymce(t,e),e.quicktags&&this.initializeQuicktags(t,e)},initializeTinymce:function(t,e){var i=l("#"+t),n=this.defaults(),a=acf.get("toolbars"),s=e.field||!1;s.$el;if("undefined"==typeof tinymce)return!1;if(!n)return!1;if(tinymce.get(t))return this.enable(t);var o=l.extend({},n.tinymce,e.tinymce);o.id=t,o.selector="#"+t;var r=e.toolbar;if(r&&a&&a[r])for(var c=1;c<=4;c++)o["toolbar"+c]=a[r][c]||"";if(o.setup=function(e){e.on("change",function(t){e.save(),i.trigger("change")}),e.on("mouseup",function(t){var e=new MouseEvent("mouseup");window.dispatchEvent(e)})},o.wp_autoresize_on=!1,o.tadv_noautop||(o.wpautop=!0),o=acf.applyFilters("wysiwyg_tinymce_settings",o,t,s),tinyMCEPreInit.mceInit[t]=o,"visual"==e.mode){tinymce.init(o);t=tinymce.get(t);if(!t)return!1;t.acf=e.field,acf.doAction("wysiwyg_tinymce_init",t,t.id,o,s)}},initializeQuicktags:function(t,e){var i=this.defaults();if("undefined"==typeof quicktags)return!1;if(!i)return!1;(i=l.extend({},i.quicktags,e.quicktags)).id=t;e=e.field||!1,e.$el,i=acf.applyFilters("wysiwyg_quicktags_settings",i,i.id,e);tinyMCEPreInit.qtInit[t]=i;t=quicktags(i);if(!t)return!1;this.buildQuicktags(t),acf.doAction("wysiwyg_quicktags_init",t,t.id,i,e)},buildQuicktags:function(t){t.canvas;var e,i,n=t.name,a=t.settings,s="",o={},r="",c=t.id;for(i in a.buttons&&(r=","+a.buttons+","),edButtons)edButtons[i]&&(e=edButtons[i].id,r&&-1!==",strong,em,link,block,del,ins,img,ul,ol,li,code,more,close,".indexOf(","+e+",")&&-1===r.indexOf(","+e+",")||edButtons[i].instance&&edButtons[i].instance!==c||(o[e]=edButtons[i],edButtons[i].html&&(s+=edButtons[i].html(n+"_"))));r&&-1!==r.indexOf(",dfw,")&&(o.dfw=new QTags.DFWButton,s+=o.dfw.html(n+"_")),"rtl"===document.getElementsByTagName("html")[0].dir&&(o.textdirection=new QTags.TextDirectionButton,s+=o.textdirection.html(n+"_")),t.toolbar.innerHTML=s,t.theButtons=o,"undefined"!=typeof jQuery&&jQuery(document).triggerHandler("quicktags-init",[t])},disable:function(t){this.destroyTinymce(t)},remove:function(t){this.destroyTinymce(t)},destroy:function(t){this.destroyTinymce(t)},destroyTinymce:function(t){if("undefined"==typeof tinymce)return!1;t=tinymce.get(t);return!!t&&(t.save(),t.destroy(),!0)},enable:function(t){this.enableTinymce(t)},enableTinymce:function(t){return"undefined"!=typeof switchEditors&&(void 0!==tinyMCEPreInit.mceInit[t]&&(l("#"+t).show(),switchEditors.go(t,"tmce"),!0))}};new acf.Model({priority:5,actions:{prepare:"onPrepare",ready:"onReady"},onPrepare:function(){var t=l("#acf-hidden-wp-editor");t.exists()&&t.appendTo("body")},onReady:function(){acf.isset(window,"wp","oldEditor")&&(wp.editor.autop=wp.oldEditor.autop,wp.editor.removep=wp.oldEditor.removep),acf.isset(window,"tinymce","on")&&tinymce.on("AddEditor",function(t){t=t.editor;"acf"===t.id.substr(0,3)&&(t=tinymce.editors.content||t,tinymce.activeEditor=t,wpActiveEditor=t.id)})}})}(jQuery),function(c){function n(t){return t.data("acf")||new e(t)}var e=acf.Model.extend({id:"Validator",data:{errors:[],notice:null,status:""},events:{"changed:status":"onChangeStatus"},addErrors:function(t){t.map(this.addError,this)},addError:function(t){this.data.errors.push(t)},hasErrors:function(){return this.data.errors.length},clearErrors:function(){return this.data.errors=[]},getErrors:function(){return this.data.errors},getFieldErrors:function(){var i=[],n=[];return this.getErrors().map(function(t){var e;t.input&&(-1<(e=n.indexOf(t.input))?i[e]=t:(i.push(t),n.push(t.input)))}),i},getGlobalErrors:function(){return this.getErrors().filter(function(t){return!t.input})},showErrors:function(){var t,i,n,e,a;this.hasErrors()&&(t=this.getFieldErrors(),a=this.getGlobalErrors(),i=0,n=!1,t.map(function(t){var e=this.$('[name="'+t.input+'"]').first();(e=!e.length?this.$('[name^="'+t.input+'"]').first():e).length&&(i++,(e=acf.getClosestField(e)).showError(t.message),n=n||e.$el)},this),e=acf.__("Validation failed"),a.map(function(t){e+=". "+t.message}),1==i?e+=". "+acf.__("1 field requires attention"):1<i&&(e+=". "+acf.__("%d fields require attention").replace("%d",i)),this.has("notice")?this.get("notice").update({type:"error",text:e}):(a=acf.newNotice({type:"error",text:e,target:this.$el}),this.set("notice",a)),n=n||this.get("notice").$el,setTimeout(function(){c("html, body").animate({scrollTop:n.offset().top-c(window).height()/2},500)},10))},onChangeStatus:function(t,e,i,n){this.$el.removeClass("is-"+n).addClass("is-"+i)},validate:function(t){if(t=acf.parseArgs(t,{event:!1,reset:!1,loading:function(){},complete:function(){},failure:function(){},success:function(t){t.submit()}}),"valid"==this.get("status"))return!0;if("validating"==this.get("status"))return!1;if(!this.$(".acf-field").length)return!0;var e;t.event&&(e=c.Event(null,t.event),t.success=function(){acf.enableSubmit(c(e.target)).trigger(e)}),acf.doAction("validation_begin",this.$el),acf.lockForm(this.$el),t.loading(this.$el,this),this.set("status","validating");var i=acf.serialize(this.$el);return i.action="acf/validate_save_post",c.ajax({url:acf.get("ajaxurl"),data:acf.prepareForAjax(i),type:"post",dataType:"json",context:this,success:function(t){acf.isAjaxSuccess(t)&&((t=acf.applyFilters("validation_complete",t.data,this.$el,this)).valid||this.addErrors(t.errors))},complete:function(){acf.unlockForm(this.$el),this.hasErrors()?(this.set("status","invalid"),acf.doAction("validation_failure",this.$el,this),this.showErrors(),t.failure(this.$el,this)):(this.set("status","valid"),this.has("notice")&&this.get("notice").update({type:"success",text:acf.__("Validation successful"),timeout:1e3}),acf.doAction("validation_success",this.$el,this),acf.doAction("submit",this.$el),t.success(this.$el,this),acf.lockForm(this.$el),t.reset&&this.reset()),t.complete(this.$el,this),this.clearErrors()}}),!1},setup:function(t){this.$el=t},reset:function(){this.set("errors",[]),this.set("notice",null),this.set("status",""),acf.unlockForm(this.$el)}});acf.validateForm=function(t){return n(t.form).validate(t)},acf.enableSubmit=function(t){return t.removeClass("disabled")},acf.disableSubmit=function(t){return t.addClass("disabled")},acf.showSpinner=function(t){return t.addClass("is-active"),t.css("display","inline-block"),t},acf.hideSpinner=function(t){return t.removeClass("is-active"),t.css("display","none"),t},acf.lockForm=function(t){var e=a(t),i=e.find('.button, [type="submit"]'),e=e.find(".spinner, .acf-spinner");return acf.hideSpinner(e),acf.disableSubmit(i),acf.showSpinner(e.last()),t},acf.unlockForm=function(t){var e=a(t),i=e.find('.button, [type="submit"]'),e=e.find(".spinner, .acf-spinner");return acf.enableSubmit(i),acf.hideSpinner(e),t};var a=function(t){var e=t.find("#submitdiv");return e.length||(e=t.find("#submitpost")).length||(e=t.find("p.submit").last()).length||(e=t.find(".acf-form-submit")).length?e:t},s=acf.debounce(function(t){t.submit()});acf.validation=new acf.Model({id:"validation",active:!0,wait:"prepare",actions:{ready:"addInputEvents",append:"addInputEvents"},events:{'click input[type="submit"]':"onClickSubmit",'click button[type="submit"]':"onClickSubmit","click #save-post":"onClickSave","submit form#post":"onSubmitPost","submit form":"onSubmit"},initialize:function(){acf.get("validation")||(this.active=!1,this.actions={},this.events={})},enable:function(){this.active=!0},disable:function(){this.active=!1},reset:function(t){n(t).reset()},addInputEvents:function(t){"safari"===acf.get("browser")||(t=c(".acf-field [name]",t)).length&&this.on(t,"invalid","onInvalid")},onInvalid:function(t,e){t.preventDefault();var i=e.closest("form");i.length&&(n(i).addError({input:e.attr("name"),message:acf.strEscape(t.target.validationMessage)}),s(i))},onClickSubmit:function(t,e){this.set("originalEvent",t)},onClickSave:function(t,e){this.set("ignore",!0)},onClickSubmitGutenberg:function(t,e){acf.validateForm({form:c("#editor"),event:t,reset:!0,failure:function(t,e){e=e.get("notice").$el;e.appendTo(".components-notice-list"),e.find(".acf-notice-dismiss").removeClass("small")}})||(t.preventDefault(),t.stopImmediatePropagation())},onSubmitPost:function(t,e){"dopreview"===c("input#wp-preview").val()&&(this.set("ignore",!0),acf.unlockForm(e))},onSubmit:function(t,e){if(!this.active||this.get("ignore")||t.isDefaultPrevented())return this.allowSubmit();acf.validateForm({form:e,event:this.get("originalEvent")})||t.preventDefault()},allowSubmit:function(){return this.set("ignore",!1),this.set("originalEvent",!1),!0}});new acf.Model({wait:"prepare",initialize:function(){acf.isGutenberg()&&this.customizeEditor()},customizeEditor:function(){var n=wp.data.dispatch("core/editor"),e=wp.data.select("core/editor"),a=wp.data.dispatch("core/notices"),s=n.savePost,o=!1,r="";wp.data.subscribe(function(){var t=e.getEditedPostAttribute("status");o="publish"===t||"future"===t,r="publish"!==t?t:r}),n.savePost=function(e){e=e||{};var t=this,i=arguments;return new Promise(function(t,i){return e.isAutosave||e.isPreview?t("Validation ignored (autosave)."):o?void(acf.validateForm({form:c("#editor"),reset:!0,complete:function(t,e){n.unlockPostSaving("acf")},failure:function(t,e){e=e.get("notice");a.createErrorNotice(e.get("text"),{id:"acf-validation",isDismissible:!0}),e.remove(),r&&n.editPost({status:r}),i("Validation failed.")},success:function(){a.removeNotice("acf-validation"),t("Validation success.")}})?t("Validation bypassed."):n.lockPostSaving("acf")):t("Validation ignored (draft).")}).then(function(){return s.apply(t,i)}).catch(function(t){})}}})}(jQuery),function(c){new acf.Model({priority:90,actions:{new_field:"refresh",show_field:"refresh",hide_field:"refresh",remove_field:"refresh",unmount_field:"refresh",remount_field:"refresh"},refresh:function(){acf.refresh()}}),new acf.Model({priority:1,actions:{sortstart:"onSortstart",sortstop:"onSortstop"},onSortstart:function(t){acf.doAction("unmount",t)},onSortstop:function(t){acf.doAction("remount",t)}}),new acf.Model({actions:{sortstart:"onSortstart"},onSortstart:function(t,e){t.is("tr")&&(e.html('<td style="padding:0;" colspan="'+e.children().length+'"></td>'),t.addClass("acf-sortable-tr-helper"),t.children().each(function(){c(this).width(c(this).width())}),e.height(t.height()+"px"),t.removeClass("acf-sortable-tr-helper"))}}),new acf.Model({actions:{after_duplicate:"onAfterDuplicate"},onAfterDuplicate:function(t,e){var i=[];t.find("select").each(function(t){i.push(c(this).val())}),e.find("select").each(function(t){c(this).val(i[t])})}}),new acf.Model({id:"tableHelper",priority:20,actions:{refresh:"renderTables"},renderTables:function(t){var e=this;c(".acf-table:visible").each(function(){e.renderTable(c(this))})},renderTable:function(t){var e=t.find("> thead > tr:visible > th[data-key]"),a=t.find("> tbody > tr:visible > td[data-key]");if(!e.length||!a.length)return!1;e.each(function(t){var e=c(this),i=e.data("key"),n=a.filter('[data-key="'+i+'"]'),i=n.filter(".acf-hidden");n.removeClass("acf-empty"),n.length===i.length?acf.hide(e):(acf.show(e),i.addClass("acf-empty"))}),e.css("width","auto");var e=e.not(".acf-hidden"),i=100;e.length;e.filter("[data-width]").each(function(){var t=c(this).data("width");c(this).css("width",t+"%"),i-=t});var n=e.not("[data-width]");n.length&&(t=i/n.length,n.css("width",t+"%"),i=0),0<i&&e.last().css("width","auto"),a.filter(".-collapsed-target").each(function(){var t=c(this);t.parent().hasClass("-collapsed")?t.attr("colspan",e.length):t.removeAttr("colspan")})}}),new acf.Model({id:"fieldsHelper",priority:30,actions:{refresh:"renderGroups"},renderGroups:function(){var t=this;c(".acf-fields:visible").each(function(){t.renderGroup(c(this))})},renderGroup:function(t){var s=0,o=0,r=c(),e=t.children(".acf-field[data-width]:visible");return!!e.length&&(t.hasClass("-left")?(e.removeAttr("data-width"),e.css("width","auto"),!1):(e.removeClass("-r0 -c0").css({"min-height":0}),e.each(function(t){var e=c(this),i=e.position(),n=Math.ceil(i.top),a=Math.ceil(i.left);r.length&&s<n&&(r.css({"min-height":o+"px"}),i=e.position(),n=Math.ceil(i.top),a=Math.ceil(i.left),o=s=0,r=c()),acf.get("rtl")&&(a=Math.ceil(e.parent().width()-(i.left+e.outerWidth()))),0==n?e.addClass("-r0"):0==a&&e.addClass("-c0");a=Math.ceil(e.outerHeight())+1;o=Math.max(o,a),s=Math.max(s,n),r=r.add(e)}),void(r.length&&r.css({"min-height":o+"px"}))))}}),new acf.Model({id:"bodyClassShiftHelper",events:{keydown:"onKeyDown",keyup:"onKeyUp"},isShiftKey:function(t){return 16===t.keyCode},onKeyDown:function(t){this.isShiftKey(t)&&c("body").addClass("acf-keydown-shift")},onKeyUp:function(t){this.isShiftKey(t)&&c("body").removeClass("acf-keydown-shift")}})}(jQuery),function(s){acf.newCompatibility=function(t,e){return(e=e||{}).__proto__=t.__proto__,t.__proto__=e,t.compatibility=e},acf.getCompatibility=function(t){return t.compatibility||null};var r=acf.newCompatibility(acf,{l10n:{},o:{},fields:{},update:acf.set,add_action:acf.addAction,remove_action:acf.removeAction,do_action:acf.doAction,add_filter:acf.addFilter,remove_filter:acf.removeFilter,apply_filters:acf.applyFilters,parse_args:acf.parseArgs,disable_el:acf.disable,disable_form:acf.disable,enable_el:acf.enable,enable_form:acf.enable,update_user_setting:acf.updateUserSetting,prepare_for_ajax:acf.prepareForAjax,is_ajax_success:acf.isAjaxSuccess,remove_el:acf.remove,remove_tr:acf.remove,str_replace:acf.strReplace,render_select:acf.renderSelect,get_uniqid:acf.uniqid,serialize_form:acf.serialize,esc_html:acf.strEscape,str_sanitize:acf.strSanitize});r._e=function(t,e){t=t||"";var i=(e=e||"")?t+"."+e:t,n={"image.select":"Select Image","image.edit":"Edit Image","image.update":"Update Image"};if(n[i])return acf.__(n[i]);t=this.l10n[t]||"";return t=e?t[e]||"":t},r.get_selector=function(t){var e=".acf-field";if(!t)return e;if(s.isPlainObject(t)){if(s.isEmptyObject(t))return e;for(var i in t){t=t[i];break}}return e+="-"+t,e=acf.strReplace("_","-",e),e=acf.strReplace("field-field-","field-",e)},r.get_fields=function(t,e,i){i={is:t||"",parent:e||!1,suppressFilters:i||!1};return i.is&&(i.is=this.get_selector(i.is)),acf.findFields(i)},r.get_field=function(t,e){var i=this.get_fields.apply(this,arguments);return!!i.length&&i.first()},r.get_closest_field=function(t,e){return t.closest(this.get_selector(e))},r.get_field_wrap=function(t){return t.closest(this.get_selector())},r.get_field_key=function(t){return t.data("key")},r.get_field_type=function(t){return t.data("type")},r.get_data=function(t,e){return acf.parseArgs(t.data(),e)},r.maybe_get=function(t,e,i){void 0===i&&(i=null),keys=String(e).split(".");for(var n=0;n<keys.length;n++){if(!t.hasOwnProperty(keys[n]))return i;t=t[keys[n]]}return t};function i(t){return t instanceof acf.Field?t.$el:t}function c(e){return function(){var t;return t=arguments.length?(t=arguments,acf.arrayArgs(t).map(i)):[s(document)],e.apply(this,t)}}r.add_action=function(t,e,i,n){var a=t.split(" "),s=a.length;if(1<s){for(var o=0;o<s;o++)t=a[o],r.add_action.apply(this,arguments);return this}e=c(e);return acf.addAction.apply(this,arguments)},r.add_filter=function(t,e,i,n){e=c(e);return acf.addFilter.apply(this,arguments)},r.model={actions:{},filters:{},events:{},extend:function(t){var i=s.extend({},this,t);return s.each(i.actions,function(t,e){i._add_action(t,e)}),s.each(i.filters,function(t,e){i._add_filter(t,e)}),s.each(i.events,function(t,e){i._add_event(t,e)}),i},_add_action:function(t,e){var i=t.split(" "),t=i[0]||"",i=i[1]||10;acf.add_action(t,this[e],i,this)},_add_filter:function(t,e){var i=t.split(" "),t=i[0]||"",i=i[1]||10;acf.add_filter(t,this[e],i,this)},_add_event:function(t,e){var i=this,n=t.indexOf(" "),a=0<n?t.substr(0,n):t,t=0<n?t.substr(n+1):"",n=function(t){t.$el=s(this),acf.field_group&&(t.$field=t.$el.closest(".acf-field-object")),"function"==typeof i.event&&(t=i.event(t)),i[e].apply(i,arguments)};t?s(document).on(a,t,n):s(document).on(a,n)},get:function(t,e){return e=e||null,e=void 0!==this[t]?this[t]:e},set:function(t,e){return this[t]=e,"function"==typeof this["_set_"+t]&&this["_set_"+t].apply(this),this}},r.field=acf.model.extend({type:"",o:{},$field:null,_add_action:function(t,e){var i=this;t=t+"_field/type="+i.type,acf.add_action(t,function(t){i.set("$field",t),i[e].apply(i,arguments)})},_add_filter:function(t,e){var i=this;t=t+"_field/type="+i.type,acf.add_filter(t,function(t){i.set("$field",t),i[e].apply(i,arguments)})},_add_event:function(t,n){var a=this,e=t.substr(0,t.indexOf(" ")),i=t.substr(t.indexOf(" ")+1),t=acf.get_selector(a.type);s(document).on(e,t+" "+i,function(t){var e=s(this),i=acf.get_closest_field(e,a.type);i.length&&(i.is(a.$field)||a.set("$field",i),t.$el=e,t.$field=i,a[n].apply(a,[t]))})},_set_$field:function(){"function"==typeof this.focus&&this.focus()},doFocus:function(t){return this.set("$field",t)}});acf.newCompatibility(acf.validation,{remove_error:function(t){acf.getField(t).removeError()},add_warning:function(t,e){acf.getField(t).showNotice({text:e,type:"warning",timeout:1e3})},fetch:acf.validateForm,enableSubmit:acf.enableSubmit,disableSubmit:acf.disableSubmit,showSpinner:acf.showSpinner,hideSpinner:acf.hideSpinner,unlockForm:acf.unlockForm,lockForm:acf.lockForm});r.tooltip={tooltip:function(t,e){return acf.newTooltip({text:t,target:e}).$el},temp:function(t,e){acf.newTooltip({text:t,target:e,timeout:250})},confirm:function(t,e,i,n,a){acf.newTooltip({confirm:function(){e(!0)},text:i,target:t,cancel:function(){e(!1)}})},confirm_remove:function(t,e){acf.newTooltip({confirmRemove:!0,target:t,confirm:function(){e(!0)},cancel:function(){e(!1)}})}},r.media=new acf.Model({activeFrame:!1,actions:{new_media_popup:"onNewMediaPopup"},frame:function(){return this.activeFrame},onNewMediaPopup:function(t){this.activeFrame=t.frame},popup:function(t){return t.mime_types&&(t.allowedTypes=t.mime_types),t.id&&(t.attachment=t.id),acf.newMediaPopup(t).frame}}),r.select2={init:function(t,e,i){return e.allow_null&&(e.allowNull=e.allow_null),e.ajax_action&&(e.ajaxAction=e.ajax_action),i&&(e.field=acf.getField(i)),acf.newSelect2(t,e)},destroy:function(t){return acf.getInstance(t).destroy()}},r.postbox={render:function(t){return t.edit_url&&(t.editLink=t.edit_url),t.edit_title&&(t.editTitle=t.edit_title),acf.newPostbox(t)}},acf.newCompatibility(acf.screen,{update:function(){return this.set.apply(this,arguments)},fetch:acf.screen.check}),r.ajax=acf.screen}(jQuery); |