1 |
- !function(){var e={2961:function(){!function(e,t){var i=acf.getCompatibility(acf);i.field_group={save_field:function(e,i){i=i!==t?i:"settings",acf.getFieldObject(e).save(i)},delete_field:function(e,i){i=i===t||i,acf.getFieldObject(e).delete({animate:i})},update_field_meta:function(e,t,i){acf.getFieldObject(e).prop(t,i)},delete_field_meta:function(e,t){acf.getFieldObject(e).prop(t,null)}},i.field_group.field_object=acf.model.extend({type:"",o:{},$field:null,$settings:null,tag:function(e){var t=this.type,i=e.split("_");return i.splice(1,0,"field"),e=i.join("_"),t&&(e+="/type="+t),e},selector:function(){var e=".acf-field-object",t=this.type;return t&&(e+="-"+t,e=acf.str_replace("_","-",e)),e},_add_action:function(e,t){var i=this;acf.add_action(this.tag(e),(function(e){i.set("$field",e),i[t].apply(i,arguments)}))},_add_filter:function(e,t){var i=this;acf.add_filter(this.tag(e),(function(e){i.set("$field",e),i[t].apply(i,arguments)}))},_add_event:function(t,i){var n=this,a=t.substr(0,t.indexOf(" ")),l=t.substr(t.indexOf(" ")+1),o=this.selector();e(document).on(a,o+" "+l,(function(t){t.$el=e(this),t.$field=t.$el.closest(".acf-field-object"),n.set("$field",t.$field),n[i].apply(n,[t])}))},_set_$field:function(){this.o=this.$field.data(),this.$settings=this.$field.find("> .settings > table > tbody"),this.focus()},focus:function(){},setting:function(e){return this.$settings.find("> .acf-field-setting-"+e)}}),new acf.Model({actions:{open_field_object:"onOpenFieldObject",close_field_object:"onCloseFieldObject",add_field_object:"onAddFieldObject",duplicate_field_object:"onDuplicateFieldObject",delete_field_object:"onDeleteFieldObject",change_field_object_type:"onChangeFieldObjectType",change_field_object_label:"onChangeFieldObjectLabel",change_field_object_name:"onChangeFieldObjectName",change_field_object_parent:"onChangeFieldObjectParent",sortstop_field_object:"onChangeFieldObjectParent"},onOpenFieldObject:function(e){acf.doAction("open_field",e.$el),acf.doAction("open_field/type="+e.get("type"),e.$el),acf.doAction("render_field_settings",e.$el),acf.doAction("render_field_settings/type="+e.get("type"),e.$el)},onCloseFieldObject:function(e){acf.doAction("close_field",e.$el),acf.doAction("close_field/type="+e.get("type"),e.$el)},onAddFieldObject:function(e){acf.doAction("add_field",e.$el),acf.doAction("add_field/type="+e.get("type"),e.$el)},onDuplicateFieldObject:function(e){acf.doAction("duplicate_field",e.$el),acf.doAction("duplicate_field/type="+e.get("type"),e.$el)},onDeleteFieldObject:function(e){acf.doAction("delete_field",e.$el),acf.doAction("delete_field/type="+e.get("type"),e.$el)},onChangeFieldObjectType:function(e){acf.doAction("change_field_type",e.$el),acf.doAction("change_field_type/type="+e.get("type"),e.$el),acf.doAction("render_field_settings",e.$el),acf.doAction("render_field_settings/type="+e.get("type"),e.$el)},onChangeFieldObjectLabel:function(e){acf.doAction("change_field_label",e.$el),acf.doAction("change_field_label/type="+e.get("type"),e.$el)},onChangeFieldObjectName:function(e){acf.doAction("change_field_name",e.$el),acf.doAction("change_field_name/type="+e.get("type"),e.$el)},onChangeFieldObjectParent:function(e){acf.doAction("update_field_parent",e.$el)}})}(jQuery)},8931:function(){var e,t;e=jQuery,t=acf.FieldSetting.extend({type:"",name:"conditional_logic",events:{"change .conditions-toggle":"onChangeToggle","click .add-conditional-group":"onClickAddGroup","focus .condition-rule-field":"onFocusField","change .condition-rule-field":"onChangeField","change .condition-rule-operator":"onChangeOperator","click .add-conditional-rule":"onClickAdd","click .remove-conditional-rule":"onClickRemove"},$rule:!1,scope:function(e){return this.$rule=e,this},ruleData:function(e,t){return this.$rule.data.apply(this.$rule,arguments)},$input:function(e){return this.$rule.find(".condition-rule-"+e)},$td:function(e){return this.$rule.find("td."+e)},$toggle:function(){return this.$(".conditions-toggle")},$control:function(){return this.$(".rule-groups")},$groups:function(){return this.$(".rule-group")},$rules:function(){return this.$(".rule")},$tabLabel:function(){return this.fieldObject.$el.find(".conditional-logic-badge")},open:function(){var e=this.$control();e.show(),acf.enable(e)},close:function(){var e=this.$control();e.hide(),acf.disable(e)},render:function(){this.$toggle().prop("checked")?(this.$tabLabel().addClass("is-enabled"),this.renderRules(),this.open()):(this.$tabLabel().removeClass("is-enabled"),this.close())},renderRules:function(){var t=this;this.$rules().each((function(){t.renderRule(e(this))}))},renderRule:function(e){this.scope(e),this.renderField(),this.renderOperator(),this.renderValue()},renderField:function(){var e=[],t=this.fieldObject.cid,i=this.$input("field");acf.getFieldObjects().map((function(i){var n={id:i.getKey(),text:i.getLabel()};i.cid===t&&(n.text+=acf.__("(this field)"),n.disabled=!0),acf.getConditionTypes({fieldType:i.getType()}).length||(n.disabled=!0);var a=i.getParents().length;n.text="- ".repeat(a)+n.text,e.push(n)})),e.length||e.push({id:"",text:acf.__("No toggle fields available")}),acf.renderSelect(i,e),this.ruleData("field",i.val())},renderOperator:function(){if(this.ruleData("field")){var e=this.$input("operator"),t=(e.val(),[]);null===e.val()&&acf.renderSelect(e,[{id:this.ruleData("operator"),text:""}]);var i=acf.findFieldObject(this.ruleData("field")),n=acf.getFieldObject(i);acf.getConditionTypes({fieldType:n.getType()}).map((function(e){t.push({id:e.prototype.operator,text:e.prototype.label})})),acf.renderSelect(e,t),this.ruleData("operator",e.val())}},renderValue:function(){if(this.ruleData("field")&&this.ruleData("operator")){var t=this.$input("value"),i=this.$td("value"),n=t.val(),a=acf.findFieldObject(this.ruleData("field")),l=acf.getFieldObject(a),o=acf.getConditionTypes({fieldType:l.getType(),operator:this.ruleData("operator")})[0].prototype.choices(l);if(o instanceof Array){var c=e("<select></select>");acf.renderSelect(c,o)}else c=e(o);t.detach(),i.html(c),setTimeout((function(){["class","name","id"].map((function(e){c.attr(e,t.attr(e))}))}),0),c.prop("disabled")||acf.val(c,n,!0),this.ruleData("value",c.val())}},onChangeToggle:function(){this.render()},onClickAddGroup:function(e,t){this.addGroup()},addGroup:function(){var e=this.$(".rule-group:last"),t=acf.duplicate(e);t.find("h4").text(acf.__("or")),t.find("tr").not(":first").remove(),this.fieldObject.save()},onFocusField:function(e,t){this.renderField()},onChangeField:function(e,t){this.scope(t.closest(".rule")),this.ruleData("field",t.val()),this.renderOperator(),this.renderValue()},onChangeOperator:function(e,t){this.scope(t.closest(".rule")),this.ruleData("operator",t.val()),this.renderValue()},onClickAdd:function(e,t){var i=acf.duplicate(t.closest(".rule"));this.renderRule(i)},onClickRemove:function(e,t){var i=t.closest(".rule");this.fieldObject.save(),0==i.siblings(".rule").length&&i.closest(".rule-group").remove(),i.remove()}}),acf.registerFieldSetting(t),new acf.Model({actions:{duplicate_field_objects:"onDuplicateFieldObjects"},onDuplicateFieldObjects:function(t,i,n){var a={},l=e();t.map((function(e){a[e.get("prevKey")]=e.get("key"),l=l.add(e.$(".condition-rule-field"))})),l.each((function(){var t=e(this),i=t.val();i&&a[i]&&(t.find("option:selected").attr("value",a[i]),t.val(a[i]))}))}})},5358:function(){var e;e=jQuery,acf.FieldObject=acf.Model.extend({eventScope:".acf-field-object",events:{"click .copyable":"onClickCopy","click .handle":"onClickEdit","click .close-field":"onClickEdit",'click a[data-key="acf_field_settings_tabs"]':"onChangeSettingsTab","click .delete-field":"onClickDelete","click .duplicate-field":"duplicate","click .move-field":"move","focus .edit-field":"onFocusEdit","blur .edit-field, .row-options a":"onBlurEdit","change .field-type":"onChangeType","change .field-required":"onChangeRequired","blur .field-label":"onChangeLabel","blur .field-name":"onChangeName",change:"onChange",changed:"onChanged"},data:{id:0,key:"",type:""},setup:function(e){this.$el=e,this.inherit(e),this.prop("ID"),this.prop("parent"),this.prop("menu_order")},$input:function(t){return e("#"+this.getInputId()+"-"+t)},$meta:function(){return this.$(".meta:first")},$handle:function(){return this.$(".handle:first")},$settings:function(){return this.$(".settings:first")},$setting:function(e){return this.$(".acf-field-settings:first .acf-field-setting-"+e)},getParent:function(){return acf.getFieldObjects({child:this.$el,limit:1}).pop()},getParents:function(){return acf.getFieldObjects({child:this.$el})},getFields:function(){return acf.getFieldObjects({parent:this.$el})},getInputName:function(){return"acf_fields["+this.get("id")+"]"},getInputId:function(){return"acf_fields-"+this.get("id")},newInput:function(t,i){var n=this.getInputId(),a=this.getInputName();t&&(n+="-"+t,a+="["+t+"]");var l=e("<input />").attr({id:n,name:a,value:i});return this.$("> .meta").append(l),l},getProp:function(e){if(this.has(e))return this.get(e);var t=this.$input(e),i=t.length?t.val():null;return this.set(e,i,!0),i},setProp:function(e,t){var i=this.$input(e);return i.val(),i.length||(i=this.newInput(e,t)),null===t?i.remove():i.val(t),this.has(e)?this.set(e,t):this.set(e,t,!0),this},prop:function(e,t){return void 0!==t?this.setProp(e,t):this.getProp(e)},props:function(e){Object.keys(e).map((function(t){this.setProp(t,e[t])}),this)},getLabel:function(){var e=this.prop("label");return""===e&&(e=acf.__("(no label)")),e},getName:function(){return this.prop("name")},getType:function(){return this.prop("type")},getTypeLabel:function(){var e=this.prop("type"),t=acf.get("fieldTypes");return t[e]?t[e].label:e},getKey:function(){return this.prop("key")},initialize:function(){this.addProFields(),this.checkCopyable()},makeCopyable:function(e){return navigator.clipboard?'<span class="copyable">'+e+"</span>":'<span class="copyable copy-unsupported">'+e+"</span>"},checkCopyable:function(){navigator.clipboard||this.$el.find(".copyable").addClass("copy-unsupported")},addProFields:function(){if(!acf.data.fieldTypes.hasOwnProperty("clone")){var t=e(".field-type").not(".acf-free-field-type");t.find('optgroup option[value="group"]').parent().append('<option value="null" disabled="disabled">'+acf.__("Repeater (Pro only)")+'</option><option value="null" disabled="disabled">'+acf.__("Flexible Content (Pro only)")+'</option><option value="null" disabled="disabled">'+acf.__("Clone (Pro only)")+"</option>"),t.find('optgroup option[value="image"]').parent().append('<option value="null" disabled="disabled">'+acf.__("Gallery (Pro only)")+"</option>"),t.addClass("acf-free-field-type")}},render:function(){var e=this.$(".handle:first"),t=this.prop("menu_order"),i=this.getLabel(),n=this.prop("name"),a=this.getTypeLabel(),l=this.prop("key"),o=this.$input("required").prop("checked");e.find(".acf-icon").html(parseInt(t)+1),o&&(i+=' <span class="acf-required">*</span>'),e.find(".li-field-label strong a").html(i),e.find(".li-field-name").html(this.makeCopyable(n));const c=acf.strSlugify(this.getType());e.find(".field-type-label").text(" "+a),e.find(".field-type-icon").removeClass().addClass("field-type-icon field-type-icon-"+c),e.find(".li-field-key").html(this.makeCopyable(l)),acf.doAction("render_field_object",this)},refresh:function(){acf.doAction("refresh_field_object",this)},isOpen:function(){return this.$el.hasClass("open")},onClickCopy:function(t){t.stopPropagation(),navigator.clipboard&&navigator.clipboard.writeText(e(t.target).text()).then((()=>{e(t.target).addClass("copied"),setTimeout((function(){e(t.target).removeClass("copied")}),2e3)}))},onClickEdit:function(t){$target=e(t.target),$target.parent().hasClass("row-options")&&!$target.hasClass("edit-field")||(this.isOpen()?this.close():this.open())},onChangeSettingsTab:function(){const e=this.$el.children(".settings");acf.doAction("show",e)},onFocusEdit:function(t){e(t.target).closest("li").find(".row-options").addClass("active")},onBlurEdit:function(t){var i=e(t.target).closest("li").find(".row-options");setTimeout((function(){var t=e(document.activeElement).closest("li").find(".row-options");i.is(t)||i.removeClass("active")}),50)},open:function(){var e=this.$el.children(".settings");acf.doAction("open_field_object",this),this.trigger("openFieldObject"),acf.doAction("show",e),e.slideDown(),this.$el.addClass("open")},close:function(){var e=this.$el.children(".settings");e.slideUp(),this.$el.removeClass("open"),acf.doAction("close_field_object",this),this.trigger("closeFieldObject"),acf.doAction("hide",e)},serialize:function(){return acf.serialize(this.$el,this.getInputName())},save:function(e){e=e||"settings","settings"!==this.getProp("save")&&(this.setProp("save",e),this.$el.attr("data-save",e),acf.doAction("save_field_object",this,e))},submit:function(){var e=this.getInputName(),t=this.get("save");this.isOpen()&&this.close(),"settings"==t||("meta"==t?this.$('> .settings [name^="'+e+'"]').remove():this.$('[name^="'+e+'"]').remove()),acf.doAction("submit_field_object",this)},onChange:function(e,t){this.save(),acf.doAction("change_field_object",this)},onChanged:function(e,t,i,n){"save"!=i&&(["menu_order","parent"].indexOf(i)>-1?this.save("meta"):this.save(),["menu_order","label","required","name","type","key"].indexOf(i)>-1&&this.render(),acf.doAction("change_field_object_"+i,this,n))},onChangeLabel:function(e,t){var i=t.val();if(this.set("label",i),""==this.prop("name")){var n=acf.applyFilters("generate_field_object_name",acf.strSanitize(i),this);this.prop("name",n)}},onChangeName:function(e,t){var i=t.val();this.set("name",i),"field_"===i.substr(0,6)&&alert(acf.__('The string "field_" may not be used at the start of a field name'))},onChangeRequired:function(e,t){var i=t.prop("checked")?1:0;this.set("required",i)},delete:function(t){t=acf.parseArgs(t,{animate:!0});var i=this.prop("ID");if(i){var n=e("#_acf_delete_fields"),a=n.val()+"|"+i;n.val(a)}acf.doAction("delete_field_object",this),t.animate?this.removeAnimate():this.remove()},onClickDelete:function(e,t){if(e.shiftKey)return this.delete();this.$el.addClass("-hover"),acf.newTooltip({confirmRemove:!0,target:t,context:this,confirm:function(){this.delete()},cancel:function(){this.$el.removeClass("-hover")}})},removeAnimate:function(){var e=this,t=this.$el.parent(),i=acf.findFieldObjects({sibling:this.$el});acf.remove({target:this.$el,endHeight:i.length?0:50,complete:function(){e.remove(),acf.doAction("removed_field_object",e,t)}}),acf.doAction("remove_field_object",e,t)},duplicate:function(){var e=acf.uniqid("field_"),t=acf.duplicate({target:this.$el,search:this.get("id"),replace:e});t.attr("data-key",e);var i=acf.getFieldObject(t);this.isOpen()?this.close():i.open();var n=i.$setting("label input");setTimeout((function(){n.trigger("focus")}),251);var a=i.prop("label"),l=i.prop("name"),o=l.split("_").pop(),c=acf.__("copy");if(acf.isNumeric(o)){var s=1*o+1;a=a.replace(o,s),l=l.replace(o,s)}else 0===o.indexOf(c)?(s=(s=1*o.replace(c,""))?s+1:2,a=a.replace(o,c+s),l=l.replace(o,c+s)):(a+=" ("+c+")",l+="_"+c);i.prop("ID",0),i.prop("label",a),i.prop("name",l),i.prop("key",e),acf.doAction("duplicate_field_object",this,i),acf.doAction("append_field_object",i)},wipe:function(){var e=this.get("id"),t=this.get("key"),i=acf.uniqid("field_");acf.rename({target:this.$el,search:e,replace:i}),this.set("id",i),this.set("prevId",e),this.set("prevKey",t),this.prop("key",i),this.prop("ID",0),this.$el.attr("data-key",i),this.$el.attr("data-id",i),acf.doAction("wipe_field_object",this)},move:function(){var t=function(e){return"settings"==e.get("save")},i=t(this);if(i||acf.getFieldObjects({parent:this.$el}).map((function(e){i=t(e)||e.changed})),i)alert(acf.__("This field cannot be moved until its changes have been saved"));else{var n=this.prop("ID"),a=this,l=!1,o=function(e){l.loading(!1),l.content(e),l.on("submit","form",c)},c=function(t,i){t.preventDefault(),acf.startButtonLoading(l.$(".button"));var a={action:"acf/field_group/move_field",field_id:n,field_group_id:l.$("select").val()};e.ajax({url:acf.get("ajaxurl"),data:acf.prepareForAjax(a),type:"post",dataType:"html",success:s})},s=function(e){l.content(e),wp.a11y&&wp.a11y.speak&&acf.__&&wp.a11y.speak(acf.__("Field moved to other group"),"polite"),l.$(".acf-close-popup").focus(),a.removeAnimate()};!function(){l=acf.newPopup({title:acf.__("Move Custom Field"),loading:!0,width:"300px",openedBy:a.$el.find(".move-field")});var t={action:"acf/field_group/move_field",field_id:n};e.ajax({url:acf.get("ajaxurl"),data:acf.prepareForAjax(t),type:"post",dataType:"html",success:o})}()}},onChangeType:function(e,t){this.changeTimeout&&clearTimeout(this.changeTimeout),this.changeTimeout=this.setTimeout((function(){this.changeType(t.val())}),300)},changeType:function(t){var i=this.prop("type"),n=acf.strSlugify("acf-field-object-"+i),a=acf.strSlugify("acf-field-object-"+t);this.$el.removeClass(n).addClass(a),this.$el.attr("data-type",t),this.$el.data("type",t),this.has("xhr")&&this.get("xhr").abort();const l=[];if(this.$el.find(".acf-field-settings:first > .acf-field-settings-main > .acf-field-type-settings").each((function(){let t=e(this).data("parent-tab"),i=e(this).children();l[t]=i,i.detach()})),this.set("settings-"+i,l),this.has("settings-"+t)){let e=this.get("settings-"+t);return this.showFieldTypeSettings(e),void this.set("type",t)}const o=e('<div class="acf-field"><div class="acf-input"><div class="acf-loading"></div></div></div>');this.$el.find(".acf-field-settings-main-general .acf-field-type-settings").before(o);const c={action:"acf/field_group/render_field_settings",field:this.serialize(),prefix:this.getInputName()};var s=e.ajax({url:acf.get("ajaxurl"),data:acf.prepareForAjax(c),type:"post",dataType:"json",context:this,success:function(e){acf.isAjaxSuccess(e)&&this.showFieldTypeSettings(e.data)},complete:function(){o.remove(),this.set("type",t)}});this.set("xhr",s)},showFieldTypeSettings:function(e){if("object"!=typeof e)return;const t=this;Object.keys(e).forEach((i=>{const n=t.$el.find(".acf-field-settings-main-"+i+" .acf-field-type-settings");let a="";["object","string"].includes(typeof e[i])&&(a=e[i]),n.prepend(a),acf.doAction("append",n)}))},updateParent:function(){var e=acf.get("post_id"),t=this.getParent();t&&(e=parseInt(t.prop("ID"))||t.prop("key")),this.prop("parent",e)}})},3523:function(){var e;e=jQuery,acf.findFieldObject=function(e){return acf.findFieldObjects({key:e,limit:1})},acf.findFieldObjects=function(t){t=t||{};var i=".acf-field-object",n=!1;return(t=acf.parseArgs(t,{id:"",key:"",type:"",limit:!1,list:null,parent:!1,sibling:!1,child:!1})).id&&(i+='[data-id="'+t.id+'"]'),t.key&&(i+='[data-key="'+t.key+'"]'),t.type&&(i+='[data-type="'+t.type+'"]'),n=t.list?t.list.children(i):t.parent?t.parent.find(i):t.sibling?t.sibling.siblings(i):t.child?t.child.parents(i):e(i),t.limit&&(n=n.slice(0,t.limit)),n},acf.getFieldObject=function(e){"string"==typeof e&&(e=acf.findFieldObject(e));var t=e.data("acf");return t||(t=acf.newFieldObject(e)),t},acf.getFieldObjects=function(t){var i=acf.findFieldObjects(t),n=[];return i.each((function(){var t=acf.getFieldObject(e(this));n.push(t)})),n},acf.newFieldObject=function(e){var t=new acf.FieldObject(e);return acf.doAction("new_field_object",t),t},new acf.Model({priority:5,initialize:function(){["prepare","ready","append","remove"].map((function(e){this.addFieldActions(e)}),this)},addFieldActions:function(e){var t=e+"_field_objects",i=e+"_field_object",n=e+"FieldObject";acf.addAction(e,(function(e){var i=acf.getFieldObjects({parent:e});if(i.length){var n=acf.arrayArgs(arguments);n.splice(0,1,t,i),acf.doAction.apply(null,n)}}),5),acf.addAction(t,(function(e){var t=acf.arrayArgs(arguments);t.unshift(i),e.map((function(e){t[1]=e,acf.doAction.apply(null,t)}))}),5),acf.addAction(i,(function(e){var t=acf.arrayArgs(arguments);t.unshift(i);var a=["type","name","key"];a.map((function(n){t[0]=i+"/"+n+"="+e.get(n),acf.doAction.apply(null,t)})),t.splice(0,2),e.trigger(n,t)}),5)}}),new acf.Model({id:"fieldManager",events:{"submit #post":"onSubmit","mouseenter .acf-field-list":"onHoverSortable","click .add-field":"onClickAdd"},actions:{removed_field_object:"onRemovedField",sortstop_field_object:"onReorderField",delete_field_object:"onDeleteField",change_field_object_type:"onChangeFieldType",duplicate_field_object:"onDuplicateField"},onSubmit:function(e,t){acf.getFieldObjects().map((function(e){e.submit()}))},setFieldMenuOrder:function(e){this.renderFields(e.$el.parent())},onHoverSortable:function(e,t){t.hasClass("ui-sortable")||t.sortable({helper:"clone",handle:".acf-sortable-handle",connectWith:".acf-field-list",start:function(e,i){var n=acf.getFieldObject(i.item);i.placeholder.height(i.item.height()),acf.doAction("sortstart_field_object",n,t)},update:function(e,i){var n=acf.getFieldObject(i.item);acf.doAction("sortstop_field_object",n,t)}})},onRemovedField:function(e,t){this.renderFields(t)},onReorderField:function(e,t){e.updateParent(),this.renderFields(t)},onDeleteField:function(e){e.getFields().map((function(e){e.delete({animate:!1})}))},onChangeFieldType:function(e){},onDuplicateField:function(e,t){var i=t.getFields();i.length&&(i.map((function(e){e.wipe(),e.updateParent()})),acf.doAction("duplicate_field_objects",i,t,e)),this.setFieldMenuOrder(t)},renderFields:function(e){var t=acf.getFieldObjects({list:e});if(!t.length)return e.addClass("-empty"),void e.parents(".acf-field-list-wrap").first().addClass("-empty");e.removeClass("-empty"),e.parents(".acf-field-list-wrap").first().removeClass("-empty"),t.map((function(e,t){e.prop("menu_order",t)}))},onClickAdd:function(t,i){let n;n=i.hasClass("add-first-field")?i.parents(".acf-field-list").eq(0):i.parent().hasClass("acf-headerbar-actions")||i.parent().hasClass("no-fields-message-inner")?e(".acf-field-list:first"):i.parent().hasClass("acf-sub-field-list-header")?i.parents(".acf-input:first").find(".acf-field-list"):i.closest(".acf-tfoot").siblings(".acf-field-list"),this.addField(n)},addField:function(t){var i=e("#tmpl-acf-field").html(),n=e(i),a=n.data("id"),l=acf.uniqid("field_"),o=acf.duplicate({target:n,search:a,replace:l,append:function(e,i){t.append(i)}}),c=acf.getFieldObject(o);c.prop("key",l),c.prop("ID",0),c.prop("label",""),c.prop("name",""),o.attr("data-key",l),o.attr("data-id",l),c.updateParent();var s=c.$input("type");setTimeout((function(){t.hasClass("acf-auto-add-field")?t.removeClass("acf-auto-add-field"):s.trigger("focus")}),251),c.open(),this.renderFields(t),acf.doAction("add_field_object",c),acf.doAction("append_field_object",c)}})},8687:function(){var e;e=jQuery,new acf.Model({id:"locationManager",wait:"ready",events:{"click .add-location-rule":"onClickAddRule","click .add-location-group":"onClickAddGroup","click .remove-location-rule":"onClickRemoveRule","change .refresh-location-rule":"onChangeRemoveRule"},initialize:function(){this.$el=e("#acf-field-group-options"),this.updateGroupsClass()},onClickAddRule:function(e,t){this.addRule(t.closest("tr"))},onClickRemoveRule:function(e,t){this.removeRule(t.closest("tr"))},onChangeRemoveRule:function(e,t){this.changeRule(t.closest("tr"))},onClickAddGroup:function(e,t){this.addGroup()},addRule:function(e){acf.duplicate(e),this.updateGroupsClass()},removeRule:function(e){0==e.siblings("tr").length?e.closest(".rule-group").remove():e.remove(),this.$(".rule-group:first").find("h4").text(acf.__("Show this field group if")),this.updateGroupsClass()},changeRule:function(t){var i=t.closest(".rule-group"),n=t.find("td.param select").attr("name").replace("[param]",""),a={action:"acf/field_group/render_location_rule"};a.rule=acf.serialize(t,n),a.rule.id=t.data("id"),a.rule.group=i.data("id"),acf.disable(t.find("td.value")),e.ajax({url:acf.get("ajaxurl"),data:acf.prepareForAjax(a),type:"post",dataType:"html",success:function(e){e&&t.replaceWith(e)}})},addGroup:function(){var e=this.$(".rule-group:last");$group2=acf.duplicate(e),$group2.find("h4").text(acf.__("or")),$group2.find("tr").not(":first").remove(),this.updateGroupsClass()},updateGroupsClass:function(){var e=this.$(".rule-group:last").closest(".rule-groups");e.find(".acf-table tr").length>1?e.addClass("rule-groups-multiple"):e.removeClass("rule-groups-multiple")}})},6125:function(){!function(e,t){var i=function(e){return acf.strPascalCase(e||"")+"FieldSetting"};acf.registerFieldSetting=function(e){var t=e.prototype,n=i(t.type+" "+t.name);this.models[n]=e},acf.newFieldSetting=function(e){var t=e.get("setting")||"",n=e.get("name")||"",a=i(t+" "+n),l=acf.models[a]||null;return null!==l&&new l(e)},acf.getFieldSetting=function(e){return e instanceof jQuery&&(e=acf.getField(e)),e.setting},new acf.Model({actions:{new_field:"onNewField"},onNewField:function(e){e.setting=acf.newFieldSetting(e)}}),acf.FieldSetting=acf.Model.extend({field:!1,type:"",name:"",wait:"ready",eventScope:".acf-field",events:{change:"render"},setup:function(t){var i=t.$el;this.$el=i,this.field=t,this.$fieldObject=i.closest(".acf-field-object"),this.fieldObject=acf.getFieldObject(this.$fieldObject),e.extend(this.data,t.data)},initialize:function(){this.render()},render:function(){}});var n=acf.FieldSetting.extend({type:"",name:"",render:function(){this.fieldObject.$setting("endpoint").find('input[type="checkbox"]:first').is(":checked")?this.fieldObject.$el.addClass("acf-field-is-endpoint"):this.fieldObject.$el.removeClass("acf-field-is-endpoint")}}),a=n.extend({type:"accordion",name:"endpoint"}),l=n.extend({type:"tab",name:"endpoint"});acf.registerFieldSetting(a),acf.registerFieldSetting(l);var o=acf.FieldSetting.extend({type:"",name:"",render:function(){var e=this.$('input[type="radio"]:checked');"other"!=e.val()&&this.$('input[type="text"]').val(e.val())}}),c=o.extend({type:"date_picker",name:"display_format"}),s=o.extend({type:"date_picker",name:"return_format"});acf.registerFieldSetting(c),acf.registerFieldSetting(s);var d=o.extend({type:"date_time_picker",name:"display_format"}),r=o.extend({type:"date_time_picker",name:"return_format"});acf.registerFieldSetting(d),acf.registerFieldSetting(r);var f=o.extend({type:"time_picker",name:"display_format"}),p=o.extend({type:"time_picker",name:"return_format"});acf.registerFieldSetting(f),acf.registerFieldSetting(p);var u=acf.FieldSetting.extend({type:"color_picker",name:"enable_opacity",render:function(){var e=this.fieldObject.$setting("return_format"),t=this.fieldObject.$setting("default_value"),i=e.find('input[type="radio"][value="string"]').parent("label").contents().last(),n=t.find('input[type="text"]'),a=acf.get("colorPickerL10n");this.field.val()?(i.replaceWith(a.rgba_string),n.attr("placeholder","rgba(255,255,255,0.8)")):(i.replaceWith(a.hex_string),n.attr("placeholder","#FFFFFF"))}});acf.registerFieldSetting(u)}(jQuery)},3791:function(){var e;e=jQuery,new acf.Model({id:"fieldGroupManager",events:{"submit #post":"onSubmit",'click a[href="#"]':"onClick","click .acf-delete-field-group":"onClickDeleteFieldGroup","blur input#title":"onBlurValidateTitle"},filters:{find_fields_args:"filterFindFieldArgs",find_fields_selector:"filterFindFieldsSelector"},initialize:function(){acf.addAction("prepare",this.maybeInitNewFieldGroup)},maybeInitNewFieldGroup:function(){e("#acf-field-group-fields > .inside > .acf-field-list-wrap.acf-auto-add-field").length&&(e(".acf-headerbar-actions .add-field").trigger("click"),e(".acf-title-wrap #title").trigger("focus"));let t=e(".acf-publish");e("input#title").on("input",(function(){e(this).val()?(t.removeClass("disabled"),e(this).removeClass("acf-input-error")):t.addClass("disabled")}))},onSubmit:function(t,i){var n=e(".acf-title-wrap #title");n.val()||(t.preventDefault(),acf.unlockForm(i),n.trigger("focus"))},onClick:function(e){e.preventDefault()},onClickDeleteFieldGroup:function(e,t){e.preventDefault(),t.addClass("-hover"),acf.newTooltip({confirm:!0,target:t,context:this,text:acf.__("Move field group to trash?"),confirm:function(){window.location.href=t.attr("href")},cancel:function(){t.removeClass("-hover")}})},onBlurValidateTitle:function(t,i){i.val()?(i.removeClass("acf-input-error"),e(".acf-publish").removeClass("disabled")):(i.addClass("acf-input-error"),e(".acf-publish").addClass("disabled"))},filterFindFieldArgs:function(e){return e.visible=!0,e.parent&&(e.parent.hasClass("acf-field-object")||e.parent.parents(".acf-field-object").length)&&(e.visible=!1,e.excludeSubFields=!0),e},filterFindFieldsSelector:function(e){return e+", .acf-field-acf-field-group-settings-tabs"}}),new acf.Model({id:"screenOptionsManager",wait:"prepare",events:{"change #acf-field-key-hide":"onFieldKeysChange","change #acf-field-settings-tabs":"onFieldSettingsTabsChange",'change [name="screen_columns"]':"render"},initialize:function(){var t=e("#adv-settings"),i=e("#acf-append-show-on-screen");t.find(".metabox-prefs").append(i.html()),t.find(".metabox-prefs br").remove(),i.remove(),this.$el=e("#screen-options-wrap"),this.render()},isFieldKeysChecked:function(){return this.$el.find("#acf-field-key-hide").prop("checked")},isFieldSettingsTabsChecked:function(){const e=this.$el.find("#acf-field-settings-tabs");return!!e.length&&e.prop("checked")},getSelectedColumnCount:function(){return this.$el.find('input[name="screen_columns"]:checked').val()},onFieldKeysChange:function(e,t){var i=this.isFieldKeysChecked()?1:0;acf.updateUserSetting("show_field_keys",i),this.render()},onFieldSettingsTabsChange:function(){const e=this.isFieldSettingsTabsChecked()?1:0;acf.updateUserSetting("show_field_settings_tabs",e),this.render()},render:function(){this.isFieldKeysChecked()?e("#acf-field-group-fields").addClass("show-field-keys"):e("#acf-field-group-fields").removeClass("show-field-keys"),this.isFieldSettingsTabsChecked()?(e("#acf-field-group-fields").removeClass("hide-tabs"),e(".acf-field-object.open").each((function(){const t=acf.getFields({type:"tab",parent:e(this),excludeSubFields:!0,limit:1});t.length&&t[0].tabs.set("initialized",!1),acf.doAction("show",e(this))}))):(e("#acf-field-group-fields").addClass("hide-tabs"),e(".acf-field-settings-main").removeClass("acf-hidden").prop("hidden",!1)),1==this.getSelectedColumnCount()?(e("body").removeClass("columns-2"),e("body").addClass("columns-1")):(e("body").removeClass("columns-1"),e("body").addClass("columns-2"))}}),new acf.Model({actions:{new_field:"onNewField"},onNewField:function(t){if(t.has("append")){var i=t.get("append"),n=t.$el.siblings('[data-name="'+i+'"]').first();if(n.length){var a=n.children(".acf-input"),l=a.children("ul");l.length||(a.wrapInner('<ul class="acf-hl"><li></li></ul>'),l=a.children("ul"));var o=t.$(".acf-input").html(),c=e("<li>"+o+"</li>");l.append(c),l.attr("data-cols",l.children().length),t.remove()}}}})}},t={};function i(n){var a=t[n];if(void 0!==a)return a.exports;var l=t[n]={exports:{}};return e[n](l,l.exports,i),l.exports}i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,{a:t}),t},i.d=function(e,t){for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){"use strict";i(3791),i(5358),i(6125),i(8931),i(3523),i(8687),i(2961)}()}();
|