/******/ (function() { // webpackBootstrap /******/ var __webpack_modules__ = ({ /***/ "./src/advanced-custom-fields-pro/assets/src/js/_acf-hooks.js": /*!********************************************************************!*\ !*** ./src/advanced-custom-fields-pro/assets/src/js/_acf-hooks.js ***! \********************************************************************/ /***/ (function() { (function (window, undefined) { 'use strict'; /** * Handles managing all events for whatever you plug it into. Priorities for hooks are based on lowest to highest in * that, lowest priority hooks are fired first. */ var EventManager = function () { /** * Maintain a reference to the object scope so our public methods never get confusing. */ var MethodsAvailable = { removeFilter: removeFilter, applyFilters: applyFilters, addFilter: addFilter, removeAction: removeAction, doAction: doAction, addAction: addAction, storage: getStorage }; /** * Contains the hooks that get registered with this EventManager. The array for storage utilizes a "flat" * object literal such that looking up the hook utilizes the native object literal hash. */ var STORAGE = { actions: {}, filters: {} }; function getStorage() { return STORAGE; } /** * Adds an action to the event manager. * * @param action Must contain namespace.identifier * @param callback Must be a valid callback function before this action is added * @param [priority=10] Used to control when the function is executed in relation to other callbacks bound to the same hook * @param [context] Supply a value to be used for this */ function addAction(action, callback, priority, context) { if (typeof action === 'string' && typeof callback === 'function') { priority = parseInt(priority || 10, 10); _addHook('actions', action, callback, priority, context); } return MethodsAvailable; } /** * Performs an action if it exists. You can pass as many arguments as you want to this function; the only rule is * that the first argument must always be the action. */ function doAction( /* action, arg1, arg2, ... */ ) { var args = Array.prototype.slice.call(arguments); var action = args.shift(); if (typeof action === 'string') { _runHook('actions', action, args); } return MethodsAvailable; } /** * Removes the specified action if it contains a namespace.identifier & exists. * * @param action The action to remove * @param [callback] Callback function to remove */ function removeAction(action, callback) { if (typeof action === 'string') { _removeHook('actions', action, callback); } return MethodsAvailable; } /** * Adds a filter to the event manager. * * @param filter Must contain namespace.identifier * @param callback Must be a valid callback function before this action is added * @param [priority=10] Used to control when the function is executed in relation to other callbacks bound to the same hook * @param [context] Supply a value to be used for this */ function addFilter(filter, callback, priority, context) { if (typeof filter === 'string' && typeof callback === 'function') { priority = parseInt(priority || 10, 10); _addHook('filters', filter, callback, priority, context); } return MethodsAvailable; } /** * Performs a filter if it exists. You should only ever pass 1 argument to be filtered. The only rule is that * the first argument must always be the filter. */ function applyFilters( /* filter, filtered arg, arg2, ... */ ) { var args = Array.prototype.slice.call(arguments); var filter = args.shift(); if (typeof filter === 'string') { return _runHook('filters', filter, args); } return MethodsAvailable; } /** * Removes the specified filter if it contains a namespace.identifier & exists. * * @param filter The action to remove * @param [callback] Callback function to remove */ function removeFilter(filter, callback) { if (typeof filter === 'string') { _removeHook('filters', filter, callback); } return MethodsAvailable; } /** * Removes the specified hook by resetting the value of it. * * @param type Type of hook, either 'actions' or 'filters' * @param hook The hook (namespace.identifier) to remove * @private */ function _removeHook(type, hook, callback, context) { if (!STORAGE[type][hook]) { return; } if (!callback) { STORAGE[type][hook] = []; } else { var handlers = STORAGE[type][hook]; var i; if (!context) { for (i = handlers.length; i--;) { if (handlers[i].callback === callback) { handlers.splice(i, 1); } } } else { for (i = handlers.length; i--;) { var handler = handlers[i]; if (handler.callback === callback && handler.context === context) { handlers.splice(i, 1); } } } } } /** * Adds the hook to the appropriate storage container * * @param type 'actions' or 'filters' * @param hook The hook (namespace.identifier) to add to our event manager * @param callback The function that will be called when the hook is executed. * @param priority The priority of this hook. Must be an integer. * @param [context] A value to be used for this * @private */ function _addHook(type, hook, callback, priority, context) { var hookObject = { callback: callback, priority: priority, context: context }; // Utilize 'prop itself' : http://jsperf.com/hasownproperty-vs-in-vs-undefined/19 var hooks = STORAGE[type][hook]; if (hooks) { hooks.push(hookObject); hooks = _hookInsertSort(hooks); } else { hooks = [hookObject]; } STORAGE[type][hook] = hooks; } /** * Use an insert sort for keeping our hooks organized based on priority. This function is ridiculously faster * than bubble sort, etc: http://jsperf.com/javascript-sort * * @param hooks The custom array containing all of the appropriate hooks to perform an insert sort on. * @private */ function _hookInsertSort(hooks) { var tmpHook, j, prevHook; for (var i = 1, len = hooks.length; i < len; i++) { tmpHook = hooks[i]; j = i; while ((prevHook = hooks[j - 1]) && prevHook.priority > tmpHook.priority) { hooks[j] = hooks[j - 1]; --j; } hooks[j] = tmpHook; } return hooks; } /** * Runs the specified hook. If it is an action, the value is not modified but if it is a filter, it is. * * @param type 'actions' or 'filters' * @param hook The hook ( namespace.identifier ) to be ran. * @param args Arguments to pass to the action/filter. If it's a filter, args is actually a single parameter. * @private */ function _runHook(type, hook, args) { var handlers = STORAGE[type][hook]; if (!handlers) { return type === 'filters' ? args[0] : false; } var i = 0, len = handlers.length; if (type === 'filters') { for (; i < len; i++) { args[0] = handlers[i].callback.apply(handlers[i].context, args); } } else { for (; i < len; i++) { handlers[i].callback.apply(handlers[i].context, args); } } return type === 'filters' ? args[0] : true; } // return all of the publicly available methods return MethodsAvailable; }; // instantiate acf.hooks = new EventManager(); })(window); /***/ }), /***/ "./src/advanced-custom-fields-pro/assets/src/js/_acf-modal.js": /*!********************************************************************!*\ !*** ./src/advanced-custom-fields-pro/assets/src/js/_acf-modal.js ***! \********************************************************************/ /***/ (function() { (function ($, undefined) { acf.models.Modal = acf.Model.extend({ data: { title: '', content: '', toolbar: '' }, events: { 'click .acf-modal-close': 'onClickClose' }, setup: function (props) { $.extend(this.data, props); this.$el = $(); this.render(); }, initialize: function () { this.open(); }, render: function () { // Extract vars. var title = this.get('title'); var content = this.get('content'); var toolbar = this.get('toolbar'); // Create element. var $el = $(['
', '
', '
', '

' + title + '

', '', '
', '
' + content + '
', '
' + toolbar + '
', '
', '
', '
'].join('')); // Update DOM. if (this.$el) { this.$el.replaceWith($el); } this.$el = $el; // Trigger action. acf.doAction('append', $el); }, update: function (props) { this.data = acf.parseArgs(props, this.data); this.render(); }, title: function (title) { this.$('.acf-modal-title h2').html(title); }, content: function (content) { this.$('.acf-modal-content').html(content); }, toolbar: function (toolbar) { this.$('.acf-modal-toolbar').html(toolbar); }, open: function () { $('body').append(this.$el); }, close: function () { this.remove(); }, onClickClose: function (e, $el) { e.preventDefault(); this.close(); }, /** * Places focus within the popup. */ focus: function () { this.$el.find('.acf-icon').first().trigger('focus'); }, /** * Locks focus within the modal. * * @param {boolean} locked True to lock focus, false to unlock. */ lockFocusToModal: function (locked) { let inertElement = $('#wpwrap'); if (!inertElement.length) { return; } inertElement[0].inert = locked; inertElement.attr('aria-hidden', locked); }, /** * Returns focus to the element that opened the popup * if it still exists in the DOM. */ returnFocusToOrigin: function () { if (this.data.openedBy instanceof $ && this.data.openedBy.closest('body').length > 0) { this.data.openedBy.trigger('focus'); } } }); /** * Returns a new modal. * * @date 21/4/20 * @since 5.9.0 * * @param object props The modal props. * @return object */ acf.newModal = function (props) { return new acf.models.Modal(props); }; })(jQuery); /***/ }), /***/ "./src/advanced-custom-fields-pro/assets/src/js/_acf-model.js": /*!********************************************************************!*\ !*** ./src/advanced-custom-fields-pro/assets/src/js/_acf-model.js ***! \********************************************************************/ /***/ (function() { (function ($, undefined) { // Cached regex to split keys for `addEvent`. var delegateEventSplitter = /^(\S+)\s*(.*)$/; /** * extend * * Helper function to correctly set up the prototype chain for subclasses * Heavily inspired by backbone.js * * @date 14/12/17 * @since 5.6.5 * * @param object protoProps New properties for this object. * @return function. */ var extend = function (protoProps) { // vars var Parent = this; var Child; // The constructor function for the new subclass is either defined by you // (the "constructor" property in your `extend` definition), or defaulted // by us to simply call the parent constructor. if (protoProps && protoProps.hasOwnProperty('constructor')) { Child = protoProps.constructor; } else { Child = function () { return Parent.apply(this, arguments); }; } // Add static properties to the constructor function, if supplied. $.extend(Child, Parent); // Set the prototype chain to inherit from `parent`, without calling // `parent`'s constructor function and add the prototype properties. Child.prototype = Object.create(Parent.prototype); $.extend(Child.prototype, protoProps); Child.prototype.constructor = Child; // Set a convenience property in case the parent's prototype is needed later. //Child.prototype.__parent__ = Parent.prototype; // return return Child; }; /** * Model * * Base class for all inheritence * * @date 14/12/17 * @since 5.6.5 * * @param object props * @return function. */ var Model = acf.Model = function () { // generate uique client id this.cid = acf.uniqueId('acf'); // set vars to avoid modifying prototype this.data = $.extend(true, {}, this.data); // pass props to setup function this.setup.apply(this, arguments); // store on element (allow this.setup to create this.$el) if (this.$el && !this.$el.data('acf')) { this.$el.data('acf', this); } // initialize var initialize = function () { this.initialize(); this.addEvents(); this.addActions(); this.addFilters(); }; // initialize on action if (this.wait && !acf.didAction(this.wait)) { this.addAction(this.wait, initialize); // initialize now } else { initialize.apply(this); } }; // Attach all inheritable methods to the Model prototype. $.extend(Model.prototype, { // Unique model id id: '', // Unique client id cid: '', // jQuery element $el: null, // Data specific to this instance data: {}, // toggle used when changing data busy: false, changed: false, // Setup events hooks events: {}, actions: {}, filters: {}, // class used to avoid nested event triggers eventScope: '', // action to wait until initialize wait: false, // action priority default priority: 10, /** * get * * Gets a specific data value * * @date 14/12/17 * @since 5.6.5 * * @param string name * @return mixed */ get: function (name) { return this.data[name]; }, /** * has * * Returns `true` if the data exists and is not null * * @date 14/12/17 * @since 5.6.5 * * @param string name * @return boolean */ has: function (name) { return this.get(name) != null; }, /** * set * * Sets a specific data value * * @date 14/12/17 * @since 5.6.5 * * @param string name * @param mixed value * @return this */ set: function (name, value, silent) { // bail if unchanged var prevValue = this.get(name); if (prevValue == value) { return this; } // set data this.data[name] = value; // trigger events if (!silent) { this.changed = true; this.trigger('changed:' + name, [value, prevValue]); this.trigger('changed', [name, value, prevValue]); } // return return this; }, /** * inherit * * Inherits the data from a jQuery element * * @date 14/12/17 * @since 5.6.5 * * @param jQuery $el * @return this */ inherit: function (data) { // allow jQuery if (data instanceof jQuery) { data = data.data(); } // extend $.extend(this.data, data); // return return this; }, /** * prop * * mimics the jQuery prop function * * @date 4/6/18 * @since 5.6.9 * * @param type $var Description. Default. * @return type Description. */ prop: function () { return this.$el.prop.apply(this.$el, arguments); }, /** * setup * * Run during constructor function * * @date 14/12/17 * @since 5.6.5 * * @param n/a * @return n/a */ setup: function (props) { $.extend(this, props); }, /** * initialize * * Also run during constructor function * * @date 14/12/17 * @since 5.6.5 * * @param n/a * @return n/a */ initialize: function () {}, /** * addElements * * Adds multiple jQuery elements to this object * * @date 9/5/18 * @since 5.6.9 * * @param type $var Description. Default. * @return type Description. */ addElements: function (elements) { elements = elements || this.elements || null; if (!elements || !Object.keys(elements).length) return false; for (var i in elements) { this.addElement(i, elements[i]); } }, /** * addElement * * description * * @date 9/5/18 * @since 5.6.9 * * @param type $var Description. Default. * @return type Description. */ addElement: function (name, selector) { this['$' + name] = this.$(selector); }, /** * addEvents * * Adds multiple event handlers * * @date 14/12/17 * @since 5.6.5 * * @param object events {event1 : callback, event2 : callback, etc } * @return n/a */ addEvents: function (events) { events = events || this.events || null; if (!events) return false; for (var key in events) { var match = key.match(delegateEventSplitter); this.on(match[1], match[2], events[key]); } }, /** * removeEvents * * Removes multiple event handlers * * @date 14/12/17 * @since 5.6.5 * * @param object events {event1 : callback, event2 : callback, etc } * @return n/a */ removeEvents: function (events) { events = events || this.events || null; if (!events) return false; for (var key in events) { var match = key.match(delegateEventSplitter); this.off(match[1], match[2], events[key]); } }, /** * getEventTarget * * Returns a jQuery element to trigger an event on. * * @date 5/6/18 * @since 5.6.9 * * @param jQuery $el The default jQuery element. Optional. * @param string event The event name. Optional. * @return jQuery */ getEventTarget: function ($el, event) { return $el || this.$el || $(document); }, /** * validateEvent * * Returns true if the event target's closest $el is the same as this.$el * Requires both this.el and this.$el to be defined * * @date 5/6/18 * @since 5.6.9 * * @param type $var Description. Default. * @return type Description. */ validateEvent: function (e) { if (this.eventScope) { return $(e.target).closest(this.eventScope).is(this.$el); } else { return true; } }, /** * proxyEvent * * Returns a new event callback function scoped to this model * * @date 29/3/18 * @since 5.6.9 * * @param function callback * @return function */ proxyEvent: function (callback) { return this.proxy(function (e) { // validate if (!this.validateEvent(e)) { return; } // construct args var args = acf.arrayArgs(arguments); var extraArgs = args.slice(1); var eventArgs = [e, $(e.currentTarget)].concat(extraArgs); // callback callback.apply(this, eventArgs); }); }, /** * on * * Adds an event handler similar to jQuery * Uses the instance 'cid' to namespace event * * @date 14/12/17 * @since 5.6.5 * * @param string name * @param string callback * @return n/a */ on: function (a1, a2, a3, a4) { // vars var $el, event, selector, callback, args; // find args if (a1 instanceof jQuery) { // 1. args( $el, event, selector, callback ) if (a4) { $el = a1; event = a2; selector = a3; callback = a4; // 2. args( $el, event, callback ) } else { $el = a1; event = a2; callback = a3; } } else { // 3. args( event, selector, callback ) if (a3) { event = a1; selector = a2; callback = a3; // 4. args( event, callback ) } else { event = a1; callback = a2; } } // element $el = this.getEventTarget($el); // modify callback if (typeof callback === 'string') { callback = this.proxyEvent(this[callback]); } // modify event event = event + '.' + this.cid; // args if (selector) { args = [event, selector, callback]; } else { args = [event, callback]; } // on() $el.on.apply($el, args); }, /** * off * * Removes an event handler similar to jQuery * * @date 14/12/17 * @since 5.6.5 * * @param string name * @param string callback * @return n/a */ off: function (a1, a2, a3) { // vars var $el, event, selector, args; // find args if (a1 instanceof jQuery) { // 1. args( $el, event, selector ) if (a3) { $el = a1; event = a2; selector = a3; // 2. args( $el, event ) } else { $el = a1; event = a2; } } else { // 3. args( event, selector ) if (a2) { event = a1; selector = a2; // 4. args( event ) } else { event = a1; } } // element $el = this.getEventTarget($el); // modify event event = event + '.' + this.cid; // args if (selector) { args = [event, selector]; } else { args = [event]; } // off() $el.off.apply($el, args); }, /** * trigger * * Triggers an event similar to jQuery * * @date 14/12/17 * @since 5.6.5 * * @param string name * @param string callback * @return n/a */ trigger: function (name, args, bubbles) { var $el = this.getEventTarget(); if (bubbles) { $el.trigger.apply($el, arguments); } else { $el.triggerHandler.apply($el, arguments); } return this; }, /** * addActions * * Adds multiple action handlers * * @date 14/12/17 * @since 5.6.5 * * @param object actions {action1 : callback, action2 : callback, etc } * @return n/a */ addActions: function (actions) { actions = actions || this.actions || null; if (!actions) return false; for (var i in actions) { this.addAction(i, actions[i]); } }, /** * removeActions * * Removes multiple action handlers * * @date 14/12/17 * @since 5.6.5 * * @param object actions {action1 : callback, action2 : callback, etc } * @return n/a */ removeActions: function (actions) { actions = actions || this.actions || null; if (!actions) return false; for (var i in actions) { this.removeAction(i, actions[i]); } }, /** * addAction * * Adds an action using the wp.hooks library * * @date 14/12/17 * @since 5.6.5 * * @param string name * @param string callback * @return n/a */ addAction: function (name, callback, priority) { //console.log('addAction', name, priority); // defaults priority = priority || this.priority; // modify callback if (typeof callback === 'string') { callback = this[callback]; } // add acf.addAction(name, callback, priority, this); }, /** * removeAction * * Remove an action using the wp.hooks library * * @date 14/12/17 * @since 5.6.5 * * @param string name * @param string callback * @return n/a */ removeAction: function (name, callback) { acf.removeAction(name, this[callback]); }, /** * addFilters * * Adds multiple filter handlers * * @date 14/12/17 * @since 5.6.5 * * @param object filters {filter1 : callback, filter2 : callback, etc } * @return n/a */ addFilters: function (filters) { filters = filters || this.filters || null; if (!filters) return false; for (var i in filters) { this.addFilter(i, filters[i]); } }, /** * addFilter * * Adds a filter using the wp.hooks library * * @date 14/12/17 * @since 5.6.5 * * @param string name * @param string callback * @return n/a */ addFilter: function (name, callback, priority) { // defaults priority = priority || this.priority; // modify callback if (typeof callback === 'string') { callback = this[callback]; } // add acf.addFilter(name, callback, priority, this); }, /** * removeFilters * * Removes multiple filter handlers * * @date 14/12/17 * @since 5.6.5 * * @param object filters {filter1 : callback, filter2 : callback, etc } * @return n/a */ removeFilters: function (filters) { filters = filters || this.filters || null; if (!filters) return false; for (var i in filters) { this.removeFilter(i, filters[i]); } }, /** * removeFilter * * Remove a filter using the wp.hooks library * * @date 14/12/17 * @since 5.6.5 * * @param string name * @param string callback * @return n/a */ removeFilter: function (name, callback) { acf.removeFilter(name, this[callback]); }, /** * $ * * description * * @date 16/12/17 * @since 5.6.5 * * @param type $var Description. Default. * @return type Description. */ $: function (selector) { return this.$el.find(selector); }, /** * remove * * Removes the element and listenters * * @date 19/12/17 * @since 5.6.5 * * @param type $var Description. Default. * @return type Description. */ remove: function () { this.removeEvents(); this.removeActions(); this.removeFilters(); this.$el.remove(); }, /** * setTimeout * * description * * @date 16/1/18 * @since 5.6.5 * * @param type $var Description. Default. * @return type Description. */ setTimeout: function (callback, milliseconds) { return setTimeout(this.proxy(callback), milliseconds); }, /** * time * * used for debugging * * @date 7/3/18 * @since 5.6.9 * * @param type $var Description. Default. * @return type Description. */ time: function () { console.time(this.id || this.cid); }, /** * timeEnd * * used for debugging * * @date 7/3/18 * @since 5.6.9 * * @param type $var Description. Default. * @return type Description. */ timeEnd: function () { console.timeEnd(this.id || this.cid); }, /** * show * * description * * @date 15/3/18 * @since 5.6.9 * * @param type $var Description. Default. * @return type Description. */ show: function () { acf.show(this.$el); }, /** * hide * * description * * @date 15/3/18 * @since 5.6.9 * * @param type $var Description. Default. * @return type Description. */ hide: function () { acf.hide(this.$el); }, /** * proxy * * Returns a new function scoped to this model * * @date 29/3/18 * @since 5.6.9 * * @param function callback * @return function */ proxy: function (callback) { return $.proxy(callback, this); } }); // Set up inheritance for the model Model.extend = extend; // Global model storage acf.models = {}; /** * acf.getInstance * * This function will get an instance from an element * * @date 5/3/18 * @since 5.6.9 * * @param type $var Description. Default. * @return type Description. */ acf.getInstance = function ($el) { return $el.data('acf'); }; /** * acf.getInstances * * This function will get an array of instances from multiple elements * * @date 5/3/18 * @since 5.6.9 * * @param type $var Description. Default. * @return type Description. */ acf.getInstances = function ($el) { var instances = []; $el.each(function () { instances.push(acf.getInstance($(this))); }); return instances; }; })(jQuery); /***/ }), /***/ "./src/advanced-custom-fields-pro/assets/src/js/_acf-notice.js": /*!*********************************************************************!*\ !*** ./src/advanced-custom-fields-pro/assets/src/js/_acf-notice.js ***! \*********************************************************************/ /***/ (function() { (function ($, undefined) { var Notice = acf.Model.extend({ data: { text: '', type: '', timeout: 0, dismiss: true, target: false, close: function () {} }, events: { 'click .acf-notice-dismiss': 'onClickClose' }, tmpl: function () { return '
'; }, setup: function (props) { $.extend(this.data, props); this.$el = $(this.tmpl()); }, initialize: function () { // render this.render(); // show this.show(); }, render: function () { // class this.type(this.get('type')); // text this.html('

' + this.get('text') + '

'); // close if (this.get('dismiss')) { this.$el.append(''); this.$el.addClass('-dismiss'); } // timeout var timeout = this.get('timeout'); if (timeout) { this.away(timeout); } }, update: function (props) { // update $.extend(this.data, props); // re-initialize this.initialize(); // refresh events this.removeEvents(); this.addEvents(); }, show: function () { var $target = this.get('target'); if ($target) { $target.prepend(this.$el); } }, hide: function () { this.$el.remove(); }, away: function (timeout) { this.setTimeout(function () { acf.remove(this.$el); }, timeout); }, type: function (type) { // remove prev type var prevType = this.get('type'); if (prevType) { this.$el.removeClass('-' + prevType); } // add new type this.$el.addClass('-' + type); // backwards compatibility if (type == 'error') { this.$el.addClass('acf-error-message'); } }, html: function (html) { this.$el.html(acf.escHtml(html)); }, text: function (text) { this.$('p').html(acf.escHtml(text)); }, onClickClose: function (e, $el) { e.preventDefault(); this.get('close').apply(this, arguments); this.remove(); } }); acf.newNotice = function (props) { // ensure object if (typeof props !== 'object') { props = { text: props }; } // instantiate return new Notice(props); }; var noticeManager = new acf.Model({ wait: 'prepare', priority: 1, initialize: function () { const $notices = $('.acf-admin-notice'); $notices.each(function () { // Move to avoid WP flicker. if ($(this).length) { $('h1:first').after($(this)); } if ($(this).data('persisted')) { let dismissed = acf.getPreference('dismissed-notices'); if (dismissed && typeof dismissed == 'object' && dismissed.includes($(this).data('persist-id'))) { $(this).remove(); } else { $(this).show(); $(this).on('click', '.notice-dismiss', function (e) { dismissed = acf.getPreference('dismissed-notices'); if (!dismissed || typeof dismissed != 'object') { dismissed = []; } dismissed.push($(this).closest('.acf-admin-notice').data('persist-id')); acf.setPreference('dismissed-notices', dismissed); }); } } }); } }); })(jQuery); /***/ }), /***/ "./src/advanced-custom-fields-pro/assets/src/js/_acf-panel.js": /*!********************************************************************!*\ !*** ./src/advanced-custom-fields-pro/assets/src/js/_acf-panel.js ***! \********************************************************************/ /***/ (function() { (function ($, undefined) { var panel = new acf.Model({ events: { 'click .acf-panel-title': 'onClick' }, onClick: function (e, $el) { e.preventDefault(); this.toggle($el.parent()); }, isOpen: function ($el) { return $el.hasClass('-open'); }, toggle: function ($el) { this.isOpen($el) ? this.close($el) : this.open($el); }, open: function ($el) { $el.addClass('-open'); $el.find('.acf-panel-title i').attr('class', 'dashicons dashicons-arrow-down'); }, close: function ($el) { $el.removeClass('-open'); $el.find('.acf-panel-title i').attr('class', 'dashicons dashicons-arrow-right'); } }); })(jQuery); /***/ }), /***/ "./src/advanced-custom-fields-pro/assets/src/js/_acf-popup.js": /*!********************************************************************!*\ !*** ./src/advanced-custom-fields-pro/assets/src/js/_acf-popup.js ***! \********************************************************************/ /***/ (function() { (function ($, undefined) { acf.models.Popup = acf.Model.extend({ data: { title: '', content: '', width: 0, height: 0, loading: false, openedBy: null }, events: { 'click [data-event="close"]': 'onClickClose', 'click .acf-close-popup': 'onClickClose', 'keydown': 'onPressEscapeClose' }, setup: function (props) { $.extend(this.data, props); this.$el = $(this.tmpl()); }, initialize: function () { this.render(); this.open(); this.focus(); this.lockFocusToPopup(true); }, tmpl: function () { return [''].join(''); }, render: function () { // Extract Vars. var title = this.get('title'); var content = this.get('content'); var loading = this.get('loading'); var width = this.get('width'); var height = this.get('height'); // Update. this.title(title); this.content(content); if (width) { this.$('.acf-popup-box').css('width', width); } if (height) { this.$('.acf-popup-box').css('min-height', height); } this.loading(loading); // Trigger action. acf.doAction('append', this.$el); }, /** * Places focus within the popup. */ focus: function () { this.$el.find('.acf-icon').first().trigger('focus'); }, /** * Locks focus within the popup. * * @param {boolean} locked True to lock focus, false to unlock. */ lockFocusToPopup: function (locked) { let inertElement = $('#wpwrap'); if (!inertElement.length) { return; } inertElement[0].inert = locked; inertElement.attr('aria-hidden', locked); }, update: function (props) { this.data = acf.parseArgs(props, this.data); this.render(); }, title: function (title) { this.$('.title:first h3').html(title); }, content: function (content) { this.$('.inner:first').html(content); }, loading: function (show) { var $loading = this.$('.loading:first'); show ? $loading.show() : $loading.hide(); }, open: function () { $('body').append(this.$el); }, close: function () { this.lockFocusToPopup(false); this.returnFocusToOrigin(); this.remove(); }, onClickClose: function (e, $el) { e.preventDefault(); this.close(); }, /** * Closes the popup when the escape key is pressed. * * @param {KeyboardEvent} e */ onPressEscapeClose: function (e) { if (e.key === 'Escape') { this.close(); } }, /** * Returns focus to the element that opened the popup * if it still exists in the DOM. */ returnFocusToOrigin: function () { if (this.data.openedBy instanceof $ && this.data.openedBy.closest('body').length > 0) { this.data.openedBy.trigger('focus'); } } }); /** * newPopup * * Creates a new Popup with the supplied props * * @date 17/12/17 * @since 5.6.5 * * @param object props * @return object */ acf.newPopup = function (props) { return new acf.models.Popup(props); }; })(jQuery); /***/ }), /***/ "./src/advanced-custom-fields-pro/assets/src/js/_acf-tooltip.js": /*!**********************************************************************!*\ !*** ./src/advanced-custom-fields-pro/assets/src/js/_acf-tooltip.js ***! \**********************************************************************/ /***/ (function() { (function ($, undefined) { acf.newTooltip = function (props) { // ensure object if (typeof props !== 'object') { props = { text: props }; } // confirmRemove if (props.confirmRemove !== undefined) { props.textConfirm = acf.__('Remove'); props.textCancel = acf.__('Cancel'); return new TooltipConfirm(props); // confirm } else if (props.confirm !== undefined) { return new TooltipConfirm(props); // default } else { return new Tooltip(props); } }; var Tooltip = acf.Model.extend({ data: { text: '', timeout: 0, target: null }, tmpl: function () { return '
'; }, setup: function (props) { $.extend(this.data, props); this.$el = $(this.tmpl()); }, initialize: function () { // render this.render(); // append this.show(); // position this.position(); // timeout var timeout = this.get('timeout'); if (timeout) { setTimeout($.proxy(this.fade, this), timeout); } }, update: function (props) { $.extend(this.data, props); this.initialize(); }, render: function () { this.html(this.get('text')); }, show: function () { $('body').append(this.$el); }, hide: function () { this.$el.remove(); }, fade: function () { // add class this.$el.addClass('acf-fade-up'); // remove this.setTimeout(function () { this.remove(); }, 250); }, html: function (html) { this.$el.html(html); }, position: function () { // vars var $tooltip = this.$el; var $target = this.get('target'); if (!$target) return; // Reset position. $tooltip.removeClass('right left bottom top').css({ top: 0, left: 0 }); // Declare tollerance to edge of screen. var tolerance = 10; // Find target position. var targetWidth = $target.outerWidth(); var targetHeight = $target.outerHeight(); var targetTop = $target.offset().top; var targetLeft = $target.offset().left; // Find tooltip position. var tooltipWidth = $tooltip.outerWidth(); var tooltipHeight = $tooltip.outerHeight(); var tooltipTop = $tooltip.offset().top; // Should be 0, but WP media grid causes this to be 32 (toolbar padding). // Assume default top alignment. var top = targetTop - tooltipHeight - tooltipTop; var left = targetLeft + targetWidth / 2 - tooltipWidth / 2; // Check if too far left. if (left < tolerance) { $tooltip.addClass('right'); left = targetLeft + targetWidth; top = targetTop + targetHeight / 2 - tooltipHeight / 2 - tooltipTop; // Check if too far right. } else if (left + tooltipWidth + tolerance > $(window).width()) { $tooltip.addClass('left'); left = targetLeft - tooltipWidth; top = targetTop + targetHeight / 2 - tooltipHeight / 2 - tooltipTop; // Check if too far up. } else if (top - $(window).scrollTop() < tolerance) { $tooltip.addClass('bottom'); top = targetTop + targetHeight - tooltipTop; // No colision with edges. } else { $tooltip.addClass('top'); } // update css $tooltip.css({ top: top, left: left }); } }); var TooltipConfirm = Tooltip.extend({ data: { text: '', textConfirm: '', textCancel: '', target: null, targetConfirm: true, confirm: function () {}, cancel: function () {}, context: false }, events: { 'click [data-event="cancel"]': 'onCancel', 'click [data-event="confirm"]': 'onConfirm' }, addEvents: function () { // add events acf.Model.prototype.addEvents.apply(this); // vars var $document = $(document); var $target = this.get('target'); // add global 'cancel' click event // - use timeout to avoid the current 'click' event triggering the onCancel function this.setTimeout(function () { this.on($document, 'click', 'onCancel'); }); // add target 'confirm' click event // - allow setting to control this feature if (this.get('targetConfirm')) { this.on($target, 'click', 'onConfirm'); } }, removeEvents: function () { // remove events acf.Model.prototype.removeEvents.apply(this); // vars var $document = $(document); var $target = this.get('target'); // remove custom events this.off($document, 'click'); this.off($target, 'click'); }, render: function () { // defaults var text = this.get('text') || acf.__('Are you sure?'); var textConfirm = this.get('textConfirm') || acf.__('Yes'); var textCancel = this.get('textCancel') || acf.__('No'); // html var html = [text, '' + textConfirm + '', '' + textCancel + ''].join(' '); // html this.html(html); // class this.$el.addClass('-confirm'); }, onCancel: function (e, $el) { // prevent default e.preventDefault(); e.stopImmediatePropagation(); // callback var callback = this.get('cancel'); var context = this.get('context') || this; callback.apply(context, arguments); //remove this.remove(); }, onConfirm: function (e, $el) { // Prevent event from propagating completely to allow "targetConfirm" to be clicked. e.preventDefault(); e.stopImmediatePropagation(); // callback var callback = this.get('confirm'); var context = this.get('context') || this; callback.apply(context, arguments); //remove this.remove(); } }); // storage acf.models.Tooltip = Tooltip; acf.models.TooltipConfirm = TooltipConfirm; /** * tooltipManager * * description * * @date 17/4/18 * @since 5.6.9 * * @param type $var Description. Default. * @return type Description. */ var tooltipHoverHelper = new acf.Model({ tooltip: false, events: { 'mouseenter .acf-js-tooltip': 'showTitle', 'mouseup .acf-js-tooltip': 'hideTitle', 'mouseleave .acf-js-tooltip': 'hideTitle', 'focus .acf-js-tooltip': 'showTitle', 'blur .acf-js-tooltip': 'hideTitle', 'keyup .acf-js-tooltip': 'onKeyUp' }, showTitle: function (e, $el) { // vars var title = $el.attr('title'); // bail early if no title if (!title) { return; } // clear title to avoid default browser tooltip $el.attr('title', ''); // create if (!this.tooltip) { this.tooltip = acf.newTooltip({ text: title, target: $el }); // update } else { this.tooltip.update({ text: title, target: $el }); } }, hideTitle: function (e, $el) { // hide tooltip this.tooltip.hide(); // restore title $el.attr('title', this.tooltip.get('text')); }, onKeyUp: function (e, $el) { if ('Escape' === e.key) { this.hideTitle(e, $el); } } }); })(jQuery); /***/ }), /***/ "./src/advanced-custom-fields-pro/assets/src/js/_acf.js": /*!**************************************************************!*\ !*** ./src/advanced-custom-fields-pro/assets/src/js/_acf.js ***! \**************************************************************/ /***/ (function() { (function ($, undefined) { /** * acf * * description * * @date 14/12/17 * @since 5.6.5 * * @param type $var Description. Default. * @return type Description. */ // The global acf object var acf = {}; // Set as a browser global window.acf = acf; /** @var object Data sent from PHP */ acf.data = {}; /** * get * * Gets a specific data value * * @date 14/12/17 * @since 5.6.5 * * @param string name * @return mixed */ acf.get = function (name) { return this.data[name] || null; }; /** * has * * Returns `true` if the data exists and is not null * * @date 14/12/17 * @since 5.6.5 * * @param string name * @return boolean */ acf.has = function (name) { return this.get(name) !== null; }; /** * set * * Sets a specific data value * * @date 14/12/17 * @since 5.6.5 * * @param string name * @param mixed value * @return this */ acf.set = function (name, value) { this.data[name] = value; return this; }; /** * uniqueId * * Returns a unique ID * * @date 9/11/17 * @since 5.6.3 * * @param string prefix Optional prefix. * @return string */ var idCounter = 0; acf.uniqueId = function (prefix) { var id = ++idCounter + ''; return prefix ? prefix + id : id; }; /** * acf.uniqueArray * * Returns a new array with only unique values * Credit: https://stackoverflow.com/questions/1960473/get-all-unique-values-in-an-array-remove-duplicates * * @date 23/3/18 * @since 5.6.9 * * @param type $var Description. Default. * @return type Description. */ acf.uniqueArray = function (array) { function onlyUnique(value, index, self) { return self.indexOf(value) === index; } return array.filter(onlyUnique); }; /** * uniqid * * Returns a unique ID (PHP version) * * @date 9/11/17 * @since 5.6.3 * @source http://locutus.io/php/misc/uniqid/ * * @param string prefix Optional prefix. * @return string */ var uniqidSeed = ''; acf.uniqid = function (prefix, moreEntropy) { // discuss at: http://locutus.io/php/uniqid/ // original by: Kevin van Zonneveld (http://kvz.io) // revised by: Kankrelune (http://www.webfaktory.info/) // note 1: Uses an internal counter (in locutus global) to avoid collision // example 1: var $id = uniqid() // example 1: var $result = $id.length === 13 // returns 1: true // example 2: var $id = uniqid('foo') // example 2: var $result = $id.length === (13 + 'foo'.length) // returns 2: true // example 3: var $id = uniqid('bar', true) // example 3: var $result = $id.length === (23 + 'bar'.length) // returns 3: true if (typeof prefix === 'undefined') { prefix = ''; } var retId; var formatSeed = function (seed, reqWidth) { seed = parseInt(seed, 10).toString(16); // to hex str if (reqWidth < seed.length) { // so long we split return seed.slice(seed.length - reqWidth); } if (reqWidth > seed.length) { // so short we pad return Array(1 + (reqWidth - seed.length)).join('0') + seed; } return seed; }; if (!uniqidSeed) { // init seed with big random int uniqidSeed = Math.floor(Math.random() * 0x75bcd15); } uniqidSeed++; retId = prefix; // start with prefix, add current milliseconds hex string retId += formatSeed(parseInt(new Date().getTime() / 1000, 10), 8); retId += formatSeed(uniqidSeed, 5); // add seed hex string if (moreEntropy) { // for more entropy we add a float lower to 10 retId += (Math.random() * 10).toFixed(8).toString(); } return retId; }; /** * strReplace * * Performs a string replace * * @date 14/12/17 * @since 5.6.5 * * @param string search * @param string replace * @param string subject * @return string */ acf.strReplace = function (search, replace, subject) { return subject.split(search).join(replace); }; /** * strCamelCase * * Converts a string into camelCase * Thanks to https://stackoverflow.com/questions/2970525/converting-any-string-into-camel-case * * @date 14/12/17 * @since 5.6.5 * * @param string str * @return string */ acf.strCamelCase = function (str) { var matches = str.match(/([a-zA-Z0-9]+)/g); return matches ? matches.map(function (s, i) { var c = s.charAt(0); return (i === 0 ? c.toLowerCase() : c.toUpperCase()) + s.slice(1); }).join('') : ''; }; /** * strPascalCase * * Converts a string into PascalCase * Thanks to https://stackoverflow.com/questions/1026069/how-do-i-make-the-first-letter-of-a-string-uppercase-in-javascript * * @date 14/12/17 * @since 5.6.5 * * @param string str * @return string */ acf.strPascalCase = function (str) { var camel = acf.strCamelCase(str); return camel.charAt(0).toUpperCase() + camel.slice(1); }; /** * acf.strSlugify * * Converts a string into a HTML class friendly slug * * @date 21/3/18 * @since 5.6.9 * * @param string str * @return string */ acf.strSlugify = function (str) { return acf.strReplace('_', '-', str.toLowerCase()); }; acf.strSanitize = function (str) { // chars (https://jsperf.com/replace-foreign-characters) var map = { À: 'A', Á: 'A', Â: 'A', Ã: 'A', Ä: 'A', Å: 'A', Æ: 'AE', Ç: 'C', È: 'E', É: 'E', Ê: 'E', Ë: 'E', Ì: 'I', Í: 'I', Î: 'I', Ï: 'I', Ð: 'D', Ñ: 'N', Ò: 'O', Ó: 'O', Ô: 'O', Õ: 'O', Ö: 'O', Ø: 'O', Ù: 'U', Ú: 'U', Û: 'U', Ü: 'U', Ý: 'Y', ß: 's', à: 'a', á: 'a', â: 'a', ã: 'a', ä: 'a', å: 'a', æ: 'ae', ç: 'c', è: 'e', é: 'e', ê: 'e', ë: 'e', ì: 'i', í: 'i', î: 'i', ï: 'i', ñ: 'n', ò: 'o', ó: 'o', ô: 'o', õ: 'o', ö: 'o', ø: 'o', ù: 'u', ú: 'u', û: 'u', ü: 'u', ý: 'y', ÿ: 'y', Ā: 'A', ā: 'a', Ă: 'A', ă: 'a', Ą: 'A', ą: 'a', Ć: 'C', ć: 'c', Ĉ: 'C', ĉ: 'c', Ċ: 'C', ċ: 'c', Č: 'C', č: 'c', Ď: 'D', ď: 'd', Đ: 'D', đ: 'd', Ē: 'E', ē: 'e', Ĕ: 'E', ĕ: 'e', Ė: 'E', ė: 'e', Ę: 'E', ę: 'e', Ě: 'E', ě: 'e', Ĝ: 'G', ĝ: 'g', Ğ: 'G', ğ: 'g', Ġ: 'G', ġ: 'g', Ģ: 'G', ģ: 'g', Ĥ: 'H', ĥ: 'h', Ħ: 'H', ħ: 'h', Ĩ: 'I', ĩ: 'i', Ī: 'I', ī: 'i', Ĭ: 'I', ĭ: 'i', Į: 'I', į: 'i', İ: 'I', ı: 'i', IJ: 'IJ', ij: 'ij', Ĵ: 'J', ĵ: 'j', Ķ: 'K', ķ: 'k', Ĺ: 'L', ĺ: 'l', Ļ: 'L', ļ: 'l', Ľ: 'L', ľ: 'l', Ŀ: 'L', ŀ: 'l', Ł: 'l', ł: 'l', Ń: 'N', ń: 'n', Ņ: 'N', ņ: 'n', Ň: 'N', ň: 'n', ʼn: 'n', Ō: 'O', ō: 'o', Ŏ: 'O', ŏ: 'o', Ő: 'O', ő: 'o', Œ: 'OE', œ: 'oe', Ŕ: 'R', ŕ: 'r', Ŗ: 'R', ŗ: 'r', Ř: 'R', ř: 'r', Ś: 'S', ś: 's', Ŝ: 'S', ŝ: 's', Ş: 'S', ş: 's', Š: 'S', š: 's', Ţ: 'T', ţ: 't', Ť: 'T', ť: 't', Ŧ: 'T', ŧ: 't', Ũ: 'U', ũ: 'u', Ū: 'U', ū: 'u', Ŭ: 'U', ŭ: 'u', Ů: 'U', ů: 'u', Ű: 'U', ű: 'u', Ų: 'U', ų: 'u', Ŵ: 'W', ŵ: 'w', Ŷ: 'Y', ŷ: 'y', Ÿ: 'Y', Ź: 'Z', ź: 'z', Ż: 'Z', ż: 'z', Ž: 'Z', ž: 'z', ſ: 's', ƒ: 'f', Ơ: 'O', ơ: 'o', Ư: 'U', ư: 'u', Ǎ: 'A', ǎ: 'a', Ǐ: 'I', ǐ: 'i', Ǒ: 'O', ǒ: 'o', Ǔ: 'U', ǔ: 'u', Ǖ: 'U', ǖ: 'u', Ǘ: 'U', ǘ: 'u', Ǚ: 'U', ǚ: 'u', Ǜ: 'U', ǜ: 'u', Ǻ: 'A', ǻ: 'a', Ǽ: 'AE', ǽ: 'ae', Ǿ: 'O', ǿ: 'o', // extra ' ': '_', "'": '', '?': '', '/': '', '\\': '', '.': '', ',': '', '`': '', '>': '', '<': '', '"': '', '[': '', ']': '', '|': '', '{': '', '}': '', '(': '', ')': '' }; // vars var nonWord = /\W/g; var mapping = function (c) { return map[c] !== undefined ? map[c] : c; }; // replace str = str.replace(nonWord, mapping); // lowercase str = str.toLowerCase(); // return return str; }; /** * acf.strMatch * * Returns the number of characters that match between two strings * * @date 1/2/18 * @since 5.6.5 * * @param type $var Description. Default. * @return type Description. */ acf.strMatch = function (s1, s2) { // vars var val = 0; var min = Math.min(s1.length, s2.length); // loop for (var i = 0; i < min; i++) { if (s1[i] !== s2[i]) { break; } val++; } // return return val; }; /** * Escapes HTML entities from a string. * * @date 08/06/2020 * @since 5.9.0 * * @param string string The input string. * @return string */ acf.strEscape = function (string) { var htmlEscapes = { '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }; return ('' + string).replace(/[&<>"']/g, function (chr) { return htmlEscapes[chr]; }); }; // Tests. //console.log( acf.strEscape('Test 1') ); //console.log( acf.strEscape('Test & 1') ); //console.log( acf.strEscape('Test\'s & 1') ); //console.log( acf.strEscape('') ); /** * Unescapes HTML entities from a string. * * @date 08/06/2020 * @since 5.9.0 * * @param string string The input string. * @return string */ acf.strUnescape = function (string) { var htmlUnescapes = { '&': '&', '<': '<', '>': '>', '"': '"', ''': "'" }; return ('' + string).replace(/&|<|>|"|'/g, function (entity) { return htmlUnescapes[entity]; }); }; // Tests. //console.log( acf.strUnescape( acf.strEscape('Test 1') ) ); //console.log( acf.strUnescape( acf.strEscape('Test & 1') ) ); //console.log( acf.strUnescape( acf.strEscape('Test\'s & 1') ) ); //console.log( acf.strUnescape( acf.strEscape('') ) ); /** * Escapes HTML entities from a string. * * @date 08/06/2020 * @since 5.9.0 * * @param string string The input string. * @return string */ acf.escAttr = acf.strEscape; /** * Encodes ') ); //console.log( acf.escHtml( acf.strEscape('') ) ); //console.log( acf.escHtml( '' ) ); /** * acf.decode * * description * * @date 13/1/18 * @since 5.6.5 * * @param type $var Description. Default. * @return type Description. */ acf.decode = function (string) { return $('