bibhamrokhanpin/wp-content/plugins/__advanced-custom-fields-pro/assets/build/js/acf-input.min.js

1 line
101 KiB
JavaScript
Raw Normal View History

2024-04-10 12:01:06 +00:00
(()=>{var e={7787:()=>{!function(e,t){acf.newCompatibility=function(e,t){return(t=t||{}).__proto__=e.__proto__,e.__proto__=t,e.compatibility=t,t},acf.getCompatibility=function(e){return e.compatibility||null};var i=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});i._e=function(e,t){e=e||"";var i=(t=t||"")?e+"."+t:e,a={"image.select":"Select Image","image.edit":"Edit Image","image.update":"Update Image"};if(a[i])return acf.__(a[i]);var n=this.l10n[e]||"";return t&&(n=n[t]||""),n},i.get_selector=function(t){var i=".acf-field";if(!t)return i;if(e.isPlainObject(t)){if(e.isEmptyObject(t))return i;for(var a in t){t=t[a];break}}return i+="-"+t,i=acf.strReplace("_","-",i),acf.strReplace("field-field-","field-",i)},i.get_fields=function(e,t,i){var a={is:e||"",parent:t||!1,suppressFilters:i||!1};return a.is&&(a.is=this.get_selector(a.is)),acf.findFields(a)},i.get_field=function(e,t){var i=this.get_fields.apply(this,arguments);return!!i.length&&i.first()},i.get_closest_field=function(e,t){return e.closest(this.get_selector(t))},i.get_field_wrap=function(e){return e.closest(this.get_selector())},i.get_field_key=function(e){return e.data("key")},i.get_field_type=function(e){return e.data("type")},i.get_data=function(e,t){return acf.parseArgs(e.data(),t)},i.maybe_get=function(e,t,i){void 0===i&&(i=null),keys=String(t).split(".");for(var a=0;a<keys.length;a++){if(!e.hasOwnProperty(keys[a]))return i;e=e[keys[a]]}return e};var a=function(e){return e instanceof acf.Field?e.$el:e},n=function(t){return function(){if(arguments.length)var i=function(e){return acf.arrayArgs(e).map(a)}(arguments);else i=[e(document)];return t.apply(this,i)}};i.add_action=function(e,t,a,s){var r=e.split(" "),o=r.length;if(o>1){for(var c=0;c<o;c++)e=r[c],i.add_action.apply(this,arguments);return this}return t=n(t),acf.addAction.apply(this,arguments)},i.add_filter=function(e,t,i,a){return t=n(t),acf.addFilter.apply(this,arguments)},i.model={actions:{},filters:{},events:{},extend:function(t){var i=e.extend({},this,t);return e.each(i.actions,(function(e,t){i._add_action(e,t)})),e.each(i.filters,(function(e,t){i._add_filter(e,t)})),e.each(i.events,(function(e,t){i._add_event(e,t)})),i},_add_action:function(e,t){var i=e.split(" "),a=(e=i[0]||"",i[1]||10);acf.add_action(e,this[t],a,this)},_add_filter:function(e,t){var i=e.split(" "),a=(e=i[0]||"",i[1]||10);acf.add_filter(e,this[t],a,this)},_add_event:function(t,i){var a=this,n=t.indexOf(" "),s=n>0?t.substr(0,n):t,r=n>0?t.substr(n+1):"",o=function(t){t.$el=e(this),acf.field_group&&(t.$field=t.$el.closest(".acf-field-object")),"function"==typeof a.event&&(t=a.event(t)),a[i].apply(a,arguments)};r?e(document).on(s,r,o):e(document).on(s,o)},get:function(e,t){return t=t||null,void 0!==this[e]&&(t=this[e]),t},set:function(e,t){return this[e]=t,"function"==typeof this["_set_"+e]&&this["_set_"+e].apply(this),this}},i.field=acf.model.extend({type:"",o:{},$field:null,_add_action:function(e,t){var i=this;e=e+"_field/type="+i.type,acf.add_action(e,(function(e){i.set("$field",e),i[t].apply(i,arguments)}))},_add_filter:function(e,t){var i=this;e=e+"_field/type="+i.type,acf.add_filter(e,(function(e){i.set("$field",e),i[t].apply(i,arguments)}))},_add_event:function(t,i){var a=this,n=t.substr(0,t.indexOf(" ")),s=t.substr(t.indexOf(" ")+1),r=acf.get_selector(a.type);e(document).on(n,r+" "+s,(function(t){var n=e(this),s=acf.get_closest_field(n,a.type);s.length&&(s.is(a.$field)||a.set("$field",s),t.$el=n,t.$field=s,a[i].apply(a,[t]))})