File: /home/mciraet/www/wp-content/plugins/polylang-pro/js/build/integrations/acf.min.js
(()=>{var t={631(t){t.exports=function(){return this.wp.apiFetch}()}},e={};function n(o){var a=e[o];if(void 0!==a)return a.exports;var r=e[o]={exports:{}};return t[o](r,r.exports,n),r.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);(()=>{"use strict";var t=n(631),e=n.n(t);function o(){const t=[];return document.querySelectorAll(".acf-field-relationship, .acf-field-post-object, .acf-field-taxonomy").forEach((function(e){const n=e.getAttribute("data-key");t.push(n)})),t}function a(t){const e=document.querySelector(".acf-"+t.field_key);e.outerHTML=t.field_data,acf.do_action("ready_field/type="+e.getAttribute("data-type"),e)}function r(t){t.forEach((function(t){t.fetch()}))}function c(){return{relationShip:acf.getFields({type:"relationship"}),postObject:acf.getFields({type:"post_object"})}}function i(){const t=document.querySelector("#term_lang_choice");return JSON.parse(t.options.item(t.selectedIndex).getAttribute("data-lang")).slug}document.addEventListener("onPostLangChoice",(function(t){const n=o();if(0===n.length)return;const i=document.getElementById("post_ID").getAttribute("value");let l=document.querySelector("#_pll_nonce")?.value;void 0===l&&(l=pll_block_editor_plugin_settings.nonce);const d=new FormData;d.set("action","acf_post_lang_choice"),d.set("lang",encodeURI(t.detail.lang.slug)),d.set("fields",n),d.set("post_id",i),d.set("_pll_nonce",l),e()({url:ajaxurl,method:"POST",body:d}).then((t=>{t.fields.forEach((function(t){a(t)}));r(c().relationShip)}))})),document.addEventListener("DOMContentLoaded",(function(){"edit-tags-php"===adminpage&&(acf.addFilter("relationship_ajax_data",(function(t){return t.lang=i(),t})),acf.addFilter("select2_ajax_data",(function(t){return t.lang=i(),t})))})),document.addEventListener("onTermLangChoice",(function(t){const n=o();if(0===n.length)return;const i=document.querySelector("input[name='tag_ID']")?document.querySelector("input[name='tag_ID']").value:"0";let l=document.querySelector("#_pll_nonce")?.value;void 0===l&&(l=pll_block_editor_plugin_settings.nonce);const d=new URLSearchParams(wp.sanitize.stripTags(window.location.search)).get("taxonomy"),u=new FormData;u.set("action","acf_term_lang_choice"),u.set("lang",encodeURI(t.detail.lang.slug)),u.set("fields",n),u.set("term_id",i),u.set("_pll_nonce",l),u.set("taxonomy",d),e()({url:ajaxurl,method:"POST",body:u}).then((t=>{t.fields.forEach((function(t){a(t)}));const e=c();e.relationShip&&acf.addFilter("relationship_ajax_data",(function(e){return e.lang=t.lang,e})),e.postObject&&acf.addFilter("select2_ajax_data",(function(e){return e.lang=t.lang,e})),r(e.relationShip)}))}))})(),this["polylang-pro"]={}})();