From 264f57b99f837fb249f8365581a7222745f4ee75 Mon Sep 17 00:00:00 2001 From: Marco Pereirinha Date: Tue, 3 Aug 2021 18:44:09 +0100 Subject: [PATCH 1/2] Provide a context to the settings page --- php/ui/component/class-page.php | 18 ++++++++++++++++++ src/js/components/ui.js | 9 +++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/php/ui/component/class-page.php b/php/ui/component/class-page.php index 7ef7facd9..84bdbab9c 100644 --- a/php/ui/component/class-page.php +++ b/php/ui/component/class-page.php @@ -23,6 +23,24 @@ class Page extends Panel { */ protected $blueprint = 'wrap|header/|tabs/|form|notice/|body|/body|settings/|/form|/wrap'; + /** + * Filter the wrap parts structure. + * + * @param array $struct The array structure. + * + * @return array + */ + protected function wrap( $struct ) { + static $added = null; + + if ( empty( $added ) ) { + $struct['attributes']['id'] = 'cloudinary-settings-page'; + $added = true; + } + + return parent::wrap( $struct ); + } + /** * Filter the form parts structure. * diff --git a/src/js/components/ui.js b/src/js/components/ui.js index 7e3e53a90..3eb7bd127 100644 --- a/src/js/components/ui.js +++ b/src/js/components/ui.js @@ -201,7 +201,12 @@ const UI = { } }, }; -// Init. -window.addEventListener( 'load', UI._init( document ) ); + +const context = document.getElementById( 'cloudinary-settings-page' ); + +if ( context ) { + // Init. + window.addEventListener( 'load', UI._init( context ) ); +} export default UI; From 4dbf1d861446bdacc8a92450bcd37b6b03fb205d Mon Sep 17 00:00:00 2001 From: Marco Pereirinha Date: Tue, 3 Aug 2021 18:44:49 +0100 Subject: [PATCH 2/2] Build assets --- js/cloudinary.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/cloudinary.js b/js/cloudinary.js index cff73667a..b1bc6b5cf 100644 --- a/js/cloudinary.js +++ b/js/cloudinary.js @@ -1 +1 @@ -!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=13)}([function(e,t,n){var r;!function(){"use strict";var i={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function o(e){return s(l(e),arguments)}function a(e,t){return o.apply(null,[e].concat(t||[]))}function s(e,t){var n,r,a,s,c,l,u,d,p,f=1,h=e.length,m="";for(r=0;r=0),s.type){case"b":n=parseInt(n,10).toString(2);break;case"c":n=String.fromCharCode(parseInt(n,10));break;case"d":case"i":n=parseInt(n,10);break;case"j":n=JSON.stringify(n,null,s.width?parseInt(s.width):0);break;case"e":n=s.precision?parseFloat(n).toExponential(s.precision):parseFloat(n).toExponential();break;case"f":n=s.precision?parseFloat(n).toFixed(s.precision):parseFloat(n);break;case"g":n=s.precision?String(Number(n.toPrecision(s.precision))):parseFloat(n);break;case"o":n=(parseInt(n,10)>>>0).toString(8);break;case"s":n=String(n),n=s.precision?n.substring(0,s.precision):n;break;case"t":n=String(!!n),n=s.precision?n.substring(0,s.precision):n;break;case"T":n=Object.prototype.toString.call(n).slice(8,-1).toLowerCase(),n=s.precision?n.substring(0,s.precision):n;break;case"u":n=parseInt(n,10)>>>0;break;case"v":n=n.valueOf(),n=s.precision?n.substring(0,s.precision):n;break;case"x":n=(parseInt(n,10)>>>0).toString(16);break;case"X":n=(parseInt(n,10)>>>0).toString(16).toUpperCase()}i.json.test(s.type)?m+=n:(!i.number.test(s.type)||d&&!s.sign?p="":(p=d?"+":"-",n=n.toString().replace(i.sign,"")),l=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",u=s.width-(p+n).length,c=s.width&&u>0?l.repeat(u):"",m+=s.align?p+n+c:"0"===l?p+c+n:c+p+n)}return m}var c=Object.create(null);function l(e){if(c[e])return c[e];for(var t,n=e,r=[],o=0;n;){if(null!==(t=i.text.exec(n)))r.push(t[0]);else if(null!==(t=i.modulo.exec(n)))r.push("%");else{if(null===(t=i.placeholder.exec(n)))throw new SyntaxError("[sprintf] unexpected placeholder");if(t[2]){o|=1;var a=[],s=t[2],l=[];if(null===(l=i.key.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(a.push(l[1]);""!==(s=s.substring(l[0].length));)if(null!==(l=i.key_access.exec(s)))a.push(l[1]);else{if(null===(l=i.index_access.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");a.push(l[1])}t[2]=a}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");r.push({placeholder:t[0],param_no:t[1],keys:t[2],sign:t[3],pad_char:t[4],align:t[5],width:t[6],precision:t[7],type:t[8]})}n=n.substring(t[0].length)}return c[e]=r}t.sprintf=o,t.vsprintf=a,"undefined"!=typeof window&&(window.sprintf=o,window.vsprintf=a,void 0===(r=function(){return{sprintf:o,vsprintf:a}}.call(t,n,t,e))||(e.exports=r))}()},function(e,t,n){e.exports=function(e,t){var n,r,i=0;function o(){var o,a,s=n,c=arguments.length;e:for(;s;){if(s.args.length===arguments.length){for(a=0;ao[0];break;case"lt":n=this.value=0&&(e.metadata.cldoverwrite="true")})),wp.media.events.on("editor:image-update",(function(e){const t=e.image.className.split(" ");e.metadata.cldoverwrite&&-1===t.indexOf("cld-overwrite")?t.push("cld-overwrite"):!e.metadata.cldoverwrite&&t.indexOf("cld-overwrite")>=0&&delete t[t.indexOf("cld-overwrite")],e.image.className=t.join(" ")}));let e=null;const t=wp.media.string.props;wp.media.string.props=function(n,r){n.cldoverwrite&&(n.classes=["cld-overwrite"],e=!0);return t(n,r)},wp.media.post=function(t,n){if("send-attachment-to-editor"===t){const t=wp.media.editor.get().state().get("selection").get(n.attachment);t.attributes.transformations&&(n.attachment.transformations=t.attributes.transformations),(n.html.indexOf("cld-overwrite")>-1||!0===e)&&(n.attachment.cldoverwrite=!0,e=null)}return wp.ajax.post(t,n)};const n=wp.media.view.MediaFrame.Select,r=wp.media.view.MediaFrame.Post,i=wp.media.view.MediaFrame.ImageDetails,o=wp.media.view.MediaFrame.VideoDetails,a=wp.media.View.extend({tagName:"div",className:"cloudinary-widget",template:wp.template("cloudinary-dam"),active:!1,toolbar:null,frame:null,ready(){const e=this.controller,t=this.model.get("selection"),n=this.model.get("library"),r=wp.media.model.Attachment;if(CLDN.mloptions.multiple=e.options.multiple,this.cid!==this.active){if(CLDN.mloptions.inline_container="#cloudinary-dam-"+e.cid,1===t.length){const e=r.get(t.models[0].id);void 0!==e.attributes.public_id&&(CLDN.mloptions.asset={resource_id:e.attributes.public_id})}else CLDN.mloptions.asset=null;try{CLDN.mloptions.folder||(CLDN.mloptions.folder={path:""});const e=t.props.attributes.type;CLDN.mloptions.folder.resource_type=Array.isArray(e)?e[0]:e}catch(e){}window.ml=cloudinary.openMediaLibrary(CLDN.mloptions,{insertHandler(i){for(let o=0;o0;a--)s/=o;return s.toFixed(2)},r.human=function(e){var t=r.calculate(e);return t.fixed+r.spacer+t.suffix},r}},e.exports?e.exports=a():(i=[],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))},,,,function(e,t){!function(e,t){"use strict";var n,r,i={rootMargin:"256px 0px",threshold:.01,lazyImage:'img[loading="lazy"]',lazyIframe:'iframe[loading="lazy"]'},o="loading"in HTMLImageElement.prototype&&"loading"in HTMLIFrameElement.prototype,a="onscroll"in window;function s(e){var t,n,r=[];"picture"===e.parentNode.tagName.toLowerCase()&&((n=(t=e.parentNode).querySelector("source[data-lazy-remove]"))&&t.removeChild(n),r=Array.prototype.slice.call(e.parentNode.querySelectorAll("source"))),r.push(e),r.forEach((function(e){e.hasAttribute("data-lazy-srcset")&&(e.setAttribute("srcset",e.getAttribute("data-lazy-srcset")),e.removeAttribute("data-lazy-srcset"))})),e.setAttribute("src",e.getAttribute("data-lazy-src")),e.removeAttribute("data-lazy-src")}function c(e){var t=document.createElement("div");for(t.innerHTML=function(e){var t=e.textContent||e.innerHTML,r="data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 "+((t.match(/width=['"](\d+)['"]/)||!1)[1]||1)+" "+((t.match(/height=['"](\d+)['"]/)||!1)[1]||1)+"%27%3E%3C/svg%3E";return!o&&a&&(void 0===n?t=t.replace(/(?:\r\n|\r|\n|\t| )src=/g,' lazyload="1" src='):("picture"===e.parentNode.tagName.toLowerCase()&&(t=''+t),t=t.replace(/(?:\r\n|\r|\n|\t| )srcset=/g," data-lazy-srcset=").replace(/(?:\r\n|\r|\n|\t| )src=/g,' src="'+r+'" data-lazy-src='))),t}(e);t.firstChild;)o||!a||void 0===n||!t.firstChild.tagName||"img"!==t.firstChild.tagName.toLowerCase()&&"iframe"!==t.firstChild.tagName.toLowerCase()||n.observe(t.firstChild),e.parentNode.insertBefore(t.firstChild,e);e.parentNode.removeChild(e)}function l(){document.querySelectorAll("noscript.loading-lazy").forEach(c),void 0!==window.matchMedia&&window.matchMedia("print").addListener((function(e){e.matches&&document.querySelectorAll(i.lazyImage+"[data-lazy-src],"+i.lazyIframe+"[data-lazy-src]").forEach((function(e){s(e)}))}))}"undefined"!=typeof NodeList&&NodeList.prototype&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),"IntersectionObserver"in window&&(n=new IntersectionObserver((function(e,t){e.forEach((function(e){if(0!==e.intersectionRatio){var n=e.target;t.unobserve(n),s(n)}}))}),i)),r="requestAnimationFrame"in window?window.requestAnimationFrame:function(e){e()},/comp|inter/.test(document.readyState)?r(l):"addEventListener"in document?document.addEventListener("DOMContentLoaded",(function(){r(l)})):document.attachEvent("onreadystatechange",(function(){"complete"===document.readyState&&l()}))}()},function(e,t){const n=document.querySelector(".cloudinary-collapsible__toggle");n&&n.addEventListener("click",(function(){const e=document.querySelector(".cloudinary-collapsible__content"),t="none"===window.getComputedStyle(e,null).getPropertyValue("display"),n=document.querySelector(".cloudinary-collapsible__toggle button i");e.style.display=t?"block":"none";const r="dashicons-arrow-down-alt2",i="dashicons-arrow-up-alt2";n.classList.contains(r)?(n.classList.remove(r),n.classList.add(i)):(n.classList.remove(i),n.classList.add(r))}))},function(e,t,n){var r=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var i=t&&t.prototype instanceof g?t:g,o=Object.create(i.prototype),a=new A(r||[]);return o._invoke=function(e,t,n){var r=d;return function(i,o){if(r===f)throw new Error("Generator is already running");if(r===h){if("throw"===i)throw o;return P()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=j(a,n);if(s){if(s===m)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===d)throw r=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=f;var c=u(e,t,n);if("normal"===c.type){if(r=n.done?h:p,c.arg===m)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r=h,n.method="throw",n.arg=c.arg)}}}(e,n,a),o}function u(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var d="suspendedStart",p="suspendedYield",f="executing",h="completed",m={};function g(){}function v(){}function y(){}var b={};b[o]=function(){return this};var w=Object.getPrototypeOf,_=w&&w(w(C([])));_&&_!==n&&r.call(_,o)&&(b=_);var x=y.prototype=g.prototype=Object.create(b);function O(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function n(i,o,a,s){var c=u(e[i],e,o);if("throw"!==c.type){var l=c.arg,d=l.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(d).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,s)}))}s(c.arg)}var i;this._invoke=function(e,r){function o(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(o,o):o()}}function j(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,j(e,n),"throw"===n.method))return m;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var i=u(r,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function L(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function C(e){if(e){var n=e[o];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function n(){for(;++i=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;k(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:C(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}(e.exports);try{regeneratorRuntime=r}catch(e){Function("r","regeneratorRuntime = r")(r)}},,function(e,t,n){"use strict";n.r(t),n.d(t,"cloudinary",(function(){return or}));n(9),n(10);var r=n(3),i=n.n(r),o=n(4),a=n.n(o);const s={sample:{image:document.getElementById("transformation-sample-image"),video:document.getElementById("transformation-sample-video")},preview:{image:document.getElementById("sample-image"),video:document.getElementById("sample-video")},fields:document.getElementsByClassName("cld-ui-input"),button:{image:document.getElementById("refresh-image-preview"),video:document.getElementById("refresh-video-preview")},spinner:{image:document.getElementById("image-loader"),video:document.getElementById("video-loader")},optimization:{image:document.getElementById("image_optimization"),video:document.getElementById("video_optimization")},error_container:document.getElementById("cld-preview-error"),activeItem:null,elements:{image:[],video:[]},_placeItem(e){null!==e&&(e.style.display="block",e.style.visibility="visible",e.style.position="absolute",e.style.top=e.parentElement.clientHeight/2-e.clientHeight/2+"px",e.style.left=e.parentElement.clientWidth/2-e.clientWidth/2+"px")},_setLoading(e){this.button[e].style.display="block",this._placeItem(this.button[e]),this.preview[e].style.opacity="0.1"},_build(e){this.sample[e].innerHTML="",this.elements[e]=[];for(const t of this.fields){if(e!==t.dataset.context||t.dataset.disabled&&"true"===t.dataset.disabled)continue;let n=t.value.trim();if(n.length){if("select-one"===t.type){if("none"===n||!1===this.optimization[e].checked)continue;n=t.dataset.meta+"_"+n}else e=t.dataset.context,t.dataset.meta&&(n=t.dataset.meta+"_"+n),t.dataset.suffix&&(n+=t.dataset.suffix),n=this._transformations(n,e,!0);n&&this.elements[e].push(n)}}let t="";this.elements[e].length&&(t="/"+this._getGlobalTransformationElements(e).replace(/ /g,"%20")),this.sample[e].textContent=t,this.sample[e].parentElement.href="https://res.cloudinary.com/demo/"+this.sample[e].parentElement.innerText.trim().replace("../","").replace(/ /g,"%20")},_clearLoading(e){this.spinner[e].style.visibility="hidden",this.activeItem=null,this.preview[e].style.opacity=1},_refresh(e,t){e&&e.preventDefault();const n=this,r=CLD_GLOBAL_TRANSFORMATIONS[t].preview_url+this._getGlobalTransformationElements(t)+CLD_GLOBAL_TRANSFORMATIONS[t].file;if(this.button[t].style.display="none",this._placeItem(this.spinner[t]),"image"===t){const e=new Image;e.onload=function(){n.preview[t].src=this.src,n._clearLoading(t),n.error_container&&(n.error_container.style.display="none"),e.remove()},e.onerror=function(){const e=n.elements[t].includes("f_mp4");n.error_container&&(n.error_container.style.display="block",e?(n.error_container.innerHTML=CLD_GLOBAL_TRANSFORMATIONS[t].warning.replace("%s","f_mp4"),n.error_container.classList.replace("settings-alert-error","settings-alert-warning")):(n.error_container.innerHTML=CLD_GLOBAL_TRANSFORMATIONS[t].error,n.error_container.classList.replace("settings-alert-warning","settings-alert-error"))),n._clearLoading(t)},e.src=r}else{const e=n._transformations(n._getGlobalTransformationElements(t),t);samplePlayer.source({publicId:"dog",transformation:e}),n._clearLoading(t)}},_getGlobalTransformationElements(e){let t=[];return t.push(this.elements[e].slice(0,2).join(",")),t.push(this.elements[e].slice(2).join(",")),t=t.filter((e=>e)).join("/"),t},_transformations(e,t,n=!1){const r=CLD_GLOBAL_TRANSFORMATIONS[t].valid_types;let i=null;const o=e.split("/"),a=[];for(let e=0;e{const r=!!n.length&&jQuery('[data-item="'+i+":"+n[0].id+'"]');r.length?r.remove():(jQuery(`.cld-tax-order-list-item:contains(${a})`).remove(),--e.startId),this.processTags(t)}))}),jQuery("body").on("change",".selectit input",(function(){const t=jQuery(this),n=t.val(),r=t.is(":checked"),i=t.parent().text().trim();!0===r?e.tags.find(`[data-item="category:${n}"]`).length||e._pushItem(`category:${n}`,i):e.tags.find(`[data-item="category:${n}"]`).remove()}))},_createItem(e,t){const n=jQuery("
  • "),r=jQuery(""),i=jQuery("");return n.addClass("cld-tax-order-list-item").attr("data-item",e),i.addClass("cld-tax-order-list-item-input").attr("type","hidden").attr("name","cld_tax_order[]").val(e),r.addClass("dashicons dashicons-menu cld-tax-order-list-item-handle"),n.append(r).append(t).append(i),n},_pushItem(e,t){const n=this._createItem(e,t);this.tags.append(n)},_sortable(){jQuery(".cld-tax-order-list").sortable({connectWith:".cld-tax-order",axis:"y",handle:".cld-tax-order-list-item-handle",placeholder:"cld-tax-order-list-item-placeholder",forcePlaceholderSize:!0,helper:"clone"})}};if(void 0!==window.CLDN&&(l._init(),jQuery("[data-wp-lists] .selectit input[checked]").each(((e,t)=>{jQuery(t).trigger("change")}))),wp.data&&wp.data.select("core/editor")){const e={};wp.data.subscribe((function(){const t=wp.data.select("core").getTaxonomies();if(t)for(const n in t){const r=wp.data.select("core/editor").getEditedPostAttribute(t[n].rest_base);e[t[n].slug]=r}}));const t=wp.element.createElement,n=n=>{class r extends n{constructor(e){super(e),this.currentItems=jQuery(".cld-tax-order-list-item").map(((e,t)=>jQuery(t).data("item"))).get()}makeItem(e){if(this.currentItems.includes(this.getId(e)))return;const t=this.makeElement(e);jQuery("#cld-tax-items").append(t)}removeItem(e){const t=jQuery(`[data-item="${this.getId(e)}"]`);t.length&&(t.remove(),this.currentItems=this.currentItems.filter((t=>t!==this.getId(e))))}findOrCreateTerm(e){return(e=super.findOrCreateTerm(e)).then((e=>this.makeItem(e))),e}onChange(t){super.onChange(t);const n=this.pickItem(t);n&&(e[this.props.slug].includes(n.id)?this.makeItem(n):this.removeItem(n))}pickItem(e){if("object"==typeof e){if(e.target){for(const t in this.state.availableTerms)if(this.state.availableTerms[t].id===parseInt(e.target.value))return this.state.availableTerms[t]}else if(Array.isArray(e)){let t=this.state.selectedTerms.filter((t=>!e.includes(t)))[0];return void 0===t&&(t=e.filter((e=>!this.state.selectedTerms.includes(e)))[0]),this.state.availableTerms.find((e=>e.name===t))}}else if("number"==typeof e){for(const t in this.state.availableTerms)if(this.state.availableTerms[t].id===e)return this.state.availableTerms[t]}else{let t;if(e.length>this.state.selectedTerms.length)for(const n in e)-1===this.state.selectedTerms.indexOf(e[n])&&(t=e[n]);else for(const n in this.state.selectedTerms)-1===e.indexOf(this.state.selectedTerms[n])&&(t=this.state.selectedTerms[n]);for(const e in this.state.availableTerms)if(this.state.availableTerms[e].name===t)return this.state.availableTerms[e]}}getId(e){return`${this.props.slug}:${e.id}`}makeElement(e){const t=jQuery("
  • "),n=jQuery(""),r=jQuery("");return t.addClass("cld-tax-order-list-item").attr("data-item",this.getId(e)),r.addClass("cld-tax-order-list-item-input").attr("type","hidden").attr("name","cld_tax_order[]").val(this.getId(e)),n.addClass("dashicons dashicons-menu cld-tax-order-list-item-handle"),t.append(n).append(e.name).append(r),t}}return e=>t(r,e)};wp.hooks.addFilter("editor.PostTaxonomyType","cld",n)}var u=l;const d={wpWrap:document.getElementById("wpwrap"),wpContent:document.getElementById("wpbody-content"),libraryWrap:document.getElementById("cloudinary-embed"),_init(){const e=this;"undefined"!=typeof CLD_ML&&(cloudinary.openMediaLibrary(CLD_ML.mloptions,{insertHandler(){alert("Import is not yet implemented.")}}),window.addEventListener("resize",(function(){e._resize()})),e._resize())},_resize(){const e=getComputedStyle(this.wpContent);this.libraryWrap.style.height=this.wpWrap.offsetHeight-parseInt(e.getPropertyValue("padding-bottom"))+"px"}};var p=d;d._init();const f={_init(){const e=this;if("undefined"!=typeof CLDIS){[...document.getElementsByClassName("cld-notice-box")].forEach((t=>{const n=t.getElementsByClassName("notice-dismiss");n.length&&n[0].addEventListener("click",(n=>{t.style.height=t.offsetHeight+"px",n.preventDefault(),setTimeout((function(){e._dismiss(t)}),5)}))}))}},_dismiss(e){const t=e.dataset.dismiss,n=parseInt(e.dataset.duration);e.classList.add("dismissed"),e.style.height="0px",setTimeout((function(){e.remove()}),400),0=0?e.ownerDocument.body:b(e)&&j(e)?e:C(A(e))}function P(e,t){var n;void 0===t&&(t=[]);var r=C(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=g(r),a=i?[o].concat(o.visualViewport||[],j(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(P(A(a)))}function T(e){return["table","td","th"].indexOf(_(e))>=0}function S(e){return b(e)&&"fixed"!==E(e).position?e.offsetParent:null}function D(e){for(var t=g(e),n=S(e);n&&T(n)&&"static"===E(n).position;)n=S(n);return n&&("html"===_(n)||"body"===_(n)&&"static"===E(n).position)?t:n||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&b(e)&&"fixed"===E(e).position)return null;for(var n=A(e);b(n)&&["html","body"].indexOf(_(n))<0;){var r=E(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}var I="top",N="bottom",M="right",F="left",B="auto",R=[I,N,M,F],z="start",H="end",q="viewport",U="popper",W=R.reduce((function(e,t){return e.concat([t+"-"+z,t+"-"+H])}),[]),Q=[].concat(R,[B]).reduce((function(e,t){return e.concat([t,t+"-"+z,t+"-"+H])}),[]),V=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function G(e){var t=new Map,n=new Set,r=[];function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&i(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||i(e)})),r}var $={placement:"bottom",modifiers:[],strategy:"absolute"};function J(){for(var e=arguments.length,t=new Array(e),n=0;n=0?"x":"y"}function ne(e){var t,n=e.reference,r=e.element,i=e.placement,o=i?Z(i):null,a=i?ee(i):null,s=n.x+n.width/2-r.width/2,c=n.y+n.height/2-r.height/2;switch(o){case I:t={x:s,y:n.y-r.height};break;case N:t={x:s,y:n.y+n.height};break;case M:t={x:n.x+n.width,y:c};break;case F:t={x:n.x-r.width,y:c};break;default:t={x:n.x,y:n.y}}var l=o?te(o):null;if(null!=l){var u="y"===l?"height":"width";switch(a){case z:t[l]=t[l]-(n[u]/2-r[u]/2);break;case H:t[l]=t[l]+(n[u]/2-r[u]/2)}}return t}var re={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=ne({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},ie=Math.max,oe=Math.min,ae=Math.round,se={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ce(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.offsets,a=e.position,s=e.gpuAcceleration,c=e.adaptive,l=e.roundOffsets,u=!0===l?function(e){var t=e.x,n=e.y,r=window.devicePixelRatio||1;return{x:ae(ae(t*r)/r)||0,y:ae(ae(n*r)/r)||0}}(o):"function"==typeof l?l(o):o,d=u.x,p=void 0===d?0:d,f=u.y,h=void 0===f?0:f,m=o.hasOwnProperty("x"),v=o.hasOwnProperty("y"),y=F,b=I,w=window;if(c){var _=D(n),O="clientHeight",j="clientWidth";_===g(n)&&"static"!==E(_=x(n)).position&&(O="scrollHeight",j="scrollWidth"),_=_,i===I&&(b=N,h-=_[O]-r.height,h*=s?1:-1),i===F&&(y=M,p-=_[j]-r.width,p*=s?1:-1)}var L,k=Object.assign({position:a},c&&se);return s?Object.assign({},k,((L={})[b]=v?"0":"",L[y]=m?"0":"",L.transform=(w.devicePixelRatio||1)<2?"translate("+p+"px, "+h+"px)":"translate3d("+p+"px, "+h+"px, 0)",L)):Object.assign({},k,((t={})[b]=v?h+"px":"",t[y]=m?p+"px":"",t.transform="",t))}var le={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];b(i)&&_(i)&&(Object.assign(i.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?i.removeAttribute(e):i.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],i=t.attributes[e]||{},o=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});b(r)&&_(r)&&(Object.assign(r.style,o),Object.keys(i).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};var ue={left:"right",right:"left",bottom:"top",top:"bottom"};function de(e){return e.replace(/left|right|bottom|top/g,(function(e){return ue[e]}))}var pe={start:"end",end:"start"};function fe(e){return e.replace(/start|end/g,(function(e){return pe[e]}))}function he(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&w(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function me(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function ge(e,t){return t===q?me(function(e){var t=g(e),n=x(e),r=t.visualViewport,i=n.clientWidth,o=n.clientHeight,a=0,s=0;return r&&(i=r.width,o=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=r.offsetLeft,s=r.offsetTop)),{width:i,height:o,x:a+O(e),y:s}}(e)):b(t)?function(e){var t=m(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(t):me(function(e){var t,n=x(e),r=v(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=ie(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=ie(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+O(e),c=-r.scrollTop;return"rtl"===E(i||n).direction&&(s+=ie(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:c}}(x(e)))}function ve(e,t,n){var r="clippingParents"===t?function(e){var t=P(A(e)),n=["absolute","fixed"].indexOf(E(e).position)>=0&&b(e)?D(e):e;return y(n)?t.filter((function(e){return y(e)&&he(e,n)&&"body"!==_(e)})):[]}(e):[].concat(t),i=[].concat(r,[n]),o=i[0],a=i.reduce((function(t,n){var r=ge(e,n);return t.top=ie(r.top,t.top),t.right=oe(r.right,t.right),t.bottom=oe(r.bottom,t.bottom),t.left=ie(r.left,t.left),t}),ge(e,o));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function ye(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function be(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function we(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=void 0===r?e.placement:r,o=n.boundary,a=void 0===o?"clippingParents":o,s=n.rootBoundary,c=void 0===s?q:s,l=n.elementContext,u=void 0===l?U:l,d=n.altBoundary,p=void 0!==d&&d,f=n.padding,h=void 0===f?0:f,g=ye("number"!=typeof h?h:be(h,R)),v=u===U?"reference":U,b=e.elements.reference,w=e.rects.popper,_=e.elements[p?v:u],O=ve(y(_)?_:_.contextElement||x(e.elements.popper),a,c),E=m(b),j=ne({reference:E,element:w,strategy:"absolute",placement:i}),L=me(Object.assign({},w,j)),k=u===U?L:E,A={top:O.top-k.top+g.top,bottom:k.bottom-O.bottom+g.bottom,left:O.left-k.left+g.left,right:k.right-O.right+g.right},C=e.modifiersData.offset;if(u===U&&C){var P=C[i];Object.keys(A).forEach((function(e){var t=[M,N].indexOf(e)>=0?1:-1,n=[I,N].indexOf(e)>=0?"y":"x";A[e]+=P[n]*t}))}return A}function _e(e,t,n){return ie(e,oe(t,n))}function xe(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Oe(e){return[I,M,N,F].some((function(t){return e[t]>=0}))}var Ee=X({defaultModifiers:[K,re,{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=void 0===r||r,o=n.adaptive,a=void 0===o||o,s=n.roundOffsets,c=void 0===s||s,l={placement:Z(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,ce(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:c})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,ce(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},le,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=void 0===i?[0,0]:i,a=Q.reduce((function(e,n){return e[n]=function(e,t,n){var r=Z(e),i=[F,I].indexOf(r)>=0?-1:1,o="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*i,[F,M].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,o),e}),{}),s=a[t.placement],c=s.x,l=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=l),t.modifiersData[r]=a}},{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=void 0===i||i,a=n.altAxis,s=void 0===a||a,c=n.fallbackPlacements,l=n.padding,u=n.boundary,d=n.rootBoundary,p=n.altBoundary,f=n.flipVariations,h=void 0===f||f,m=n.allowedAutoPlacements,g=t.options.placement,v=Z(g),y=c||(v===g||!h?[de(g)]:function(e){if(Z(e)===B)return[];var t=de(e);return[fe(e),t,fe(t)]}(g)),b=[g].concat(y).reduce((function(e,n){return e.concat(Z(n)===B?function(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,c=n.allowedAutoPlacements,l=void 0===c?Q:c,u=ee(r),d=u?s?W:W.filter((function(e){return ee(e)===u})):R,p=d.filter((function(e){return l.indexOf(e)>=0}));0===p.length&&(p=d);var f=p.reduce((function(t,n){return t[n]=we(e,{placement:n,boundary:i,rootBoundary:o,padding:a})[Z(n)],t}),{});return Object.keys(f).sort((function(e,t){return f[e]-f[t]}))}(t,{placement:n,boundary:u,rootBoundary:d,padding:l,flipVariations:h,allowedAutoPlacements:m}):n)}),[]),w=t.rects.reference,_=t.rects.popper,x=new Map,O=!0,E=b[0],j=0;j=0,P=C?"width":"height",T=we(t,{placement:L,boundary:u,rootBoundary:d,altBoundary:p,padding:l}),S=C?A?M:F:A?N:I;w[P]>_[P]&&(S=de(S));var D=de(S),H=[];if(o&&H.push(T[k]<=0),s&&H.push(T[S]<=0,T[D]<=0),H.every((function(e){return e}))){E=L,O=!1;break}x.set(L,H)}if(O)for(var q=function(e){var t=b.find((function(t){var n=x.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return E=t,"break"},U=h?3:1;U>0;U--){if("break"===q(U))break}t.placement!==E&&(t.modifiersData[r]._skip=!0,t.placement=E,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=void 0===i||i,a=n.altAxis,s=void 0!==a&&a,c=n.boundary,l=n.rootBoundary,u=n.altBoundary,d=n.padding,p=n.tether,f=void 0===p||p,h=n.tetherOffset,m=void 0===h?0:h,g=we(t,{boundary:c,rootBoundary:l,padding:d,altBoundary:u}),v=Z(t.placement),y=ee(t.placement),b=!y,w=te(v),_="x"===w?"y":"x",x=t.modifiersData.popperOffsets,O=t.rects.reference,E=t.rects.popper,j="function"==typeof m?m(Object.assign({},t.rects,{placement:t.placement})):m,L={x:0,y:0};if(x){if(o||s){var A="y"===w?I:F,C="y"===w?N:M,P="y"===w?"height":"width",T=x[w],S=x[w]+g[A],B=x[w]-g[C],R=f?-E[P]/2:0,H=y===z?O[P]:E[P],q=y===z?-E[P]:-O[P],U=t.elements.arrow,W=f&&U?k(U):{width:0,height:0},Q=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},V=Q[A],G=Q[C],$=_e(0,O[P],W[P]),J=b?O[P]/2-R-$-V-j:H-$-V-j,X=b?-O[P]/2+R+$+G+j:q+$+G+j,Y=t.elements.arrow&&D(t.elements.arrow),K=Y?"y"===w?Y.clientTop||0:Y.clientLeft||0:0,ne=t.modifiersData.offset?t.modifiersData.offset[t.placement][w]:0,re=x[w]+J-ne-K,ae=x[w]+X-ne;if(o){var se=_e(f?oe(S,re):S,T,f?ie(B,ae):B);x[w]=se,L[w]=se-T}if(s){var ce="x"===w?I:F,le="x"===w?N:M,ue=x[_],de=ue+g[ce],pe=ue-g[le],fe=_e(f?oe(de,re):de,ue,f?ie(pe,ae):pe);x[_]=fe,L[_]=fe-ue}}t.modifiersData[r]=L}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=Z(n.placement),c=te(s),l=[F,M].indexOf(s)>=0?"height":"width";if(o&&a){var u=function(e,t){return ye("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:be(e,R))}(i.padding,n),d=k(o),p="y"===c?I:F,f="y"===c?N:M,h=n.rects.reference[l]+n.rects.reference[c]-a[c]-n.rects.popper[l],m=a[c]-n.rects.reference[c],g=D(o),v=g?"y"===c?g.clientHeight||0:g.clientWidth||0:0,y=h/2-m/2,b=u[p],w=v-d[l]-u[f],_=v/2-d[l]/2+y,x=_e(b,_,w),O=c;n.modifiersData[r]=((t={})[O]=x,t.centerOffset=x-_,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&he(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=we(t,{elementContext:"reference"}),s=we(t,{altBoundary:!0}),c=xe(a,r),l=xe(s,i,o),u=Oe(c),d=Oe(l);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}}]}),je="tippy-content",Le="tippy-backdrop",ke="tippy-arrow",Ae="tippy-svg-arrow",Ce={passive:!0,capture:!0};function Pe(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function Te(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function Se(e,t){return"function"==typeof e?e.apply(void 0,t):e}function De(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout((function(){e(r)}),t)};var n}function Ie(e){return[].concat(e)}function Ne(e,t){-1===e.indexOf(t)&&e.push(t)}function Me(e){return e.split("-")[0]}function Fe(e){return[].slice.call(e)}function Be(){return document.createElement("div")}function Re(e){return["Element","Fragment"].some((function(t){return Te(e,t)}))}function ze(e){return Te(e,"MouseEvent")}function He(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function qe(e){return Re(e)?[e]:function(e){return Te(e,"NodeList")}(e)?Fe(e):Array.isArray(e)?e:Fe(document.querySelectorAll(e))}function Ue(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function We(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function Qe(e){var t,n=Ie(e)[0];return(null==n||null==(t=n.ownerDocument)?void 0:t.body)?n.ownerDocument:document}function Ve(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[r](t,n)}))}var Ge={isTouch:!1},$e=0;function Je(){Ge.isTouch||(Ge.isTouch=!0,window.performance&&document.addEventListener("mousemove",Xe))}function Xe(){var e=performance.now();e-$e<20&&(Ge.isTouch=!1,document.removeEventListener("mousemove",Xe)),$e=e}function Ye(){var e=document.activeElement;if(He(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var Ke="undefined"!=typeof window&&"undefined"!=typeof document?navigator.userAgent:"",Ze=/MSIE |Trident\//.test(Ke);var et={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},tt=Object.assign({appendTo:function(){return document.body},aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},et,{},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),nt=Object.keys(tt);function rt(e){var t=(e.plugins||[]).reduce((function(t,n){var r=n.name,i=n.defaultValue;return r&&(t[r]=void 0!==e[r]?e[r]:i),t}),{});return Object.assign({},e,{},t)}function it(e,t){var n=Object.assign({},t,{content:Se(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(rt(Object.assign({},tt,{plugins:t}))):nt).reduce((function(t,n){var r=(e.getAttribute("data-tippy-"+n)||"").trim();if(!r)return t;if("content"===n)t[n]=r;else try{t[n]=JSON.parse(r)}catch(e){t[n]=r}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},tt.aria,{},n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}function ot(e,t){e.innerHTML=t}function at(e){var t=Be();return!0===e?t.className=ke:(t.className=Ae,Re(e)?t.appendChild(e):ot(t,e)),t}function st(e,t){Re(t.content)?(ot(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?ot(e,t.content):e.textContent=t.content)}function ct(e){var t=e.firstElementChild,n=Fe(t.children);return{box:t,content:n.find((function(e){return e.classList.contains(je)})),arrow:n.find((function(e){return e.classList.contains(ke)||e.classList.contains(Ae)})),backdrop:n.find((function(e){return e.classList.contains(Le)}))}}function lt(e){var t=Be(),n=Be();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Be();function i(n,r){var i=ct(t),o=i.box,a=i.content,s=i.arrow;r.theme?o.setAttribute("data-theme",r.theme):o.removeAttribute("data-theme"),"string"==typeof r.animation?o.setAttribute("data-animation",r.animation):o.removeAttribute("data-animation"),r.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?o.setAttribute("role",r.role):o.removeAttribute("role"),n.content===r.content&&n.allowHTML===r.allowHTML||st(a,e.props),r.arrow?s?n.arrow!==r.arrow&&(o.removeChild(s),o.appendChild(at(r.arrow))):o.appendChild(at(r.arrow)):s&&o.removeChild(s)}return r.className=je,r.setAttribute("data-state","hidden"),st(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props),{popper:t,onUpdate:i}}lt.$$tippy=!0;var ut=1,dt=[],pt=[];function ft(e,t){var n,r,i,o,a,s,c,l,u,d=it(e,Object.assign({},tt,{},rt((n=t,Object.keys(n).reduce((function(e,t){return void 0!==n[t]&&(e[t]=n[t]),e}),{}))))),p=!1,f=!1,h=!1,m=!1,g=[],v=De($,d.interactiveDebounce),y=ut++,b=(u=d.plugins).filter((function(e,t){return u.indexOf(e)===t})),w={id:y,reference:e,popper:Be(),popperInstance:null,props:d,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:b,clearDelayTimeouts:function(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)},setProps:function(t){0;if(w.state.isDestroyed)return;I("onBeforeUpdate",[w,t]),V();var n=w.props,r=it(e,Object.assign({},w.props,{},t,{ignoreAttributes:!0}));w.props=r,Q(),n.interactiveDebounce!==r.interactiveDebounce&&(F(),v=De($,r.interactiveDebounce));n.triggerTarget&&!r.triggerTarget?Ie(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):r.triggerTarget&&e.removeAttribute("aria-expanded");M(),D(),O&&O(n,r);w.popperInstance&&(K(),ee().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));I("onAfterUpdate",[w,t])},setContent:function(e){w.setProps({content:e})},show:function(){0;var e=w.state.isVisible,t=w.state.isDestroyed,n=!w.state.isEnabled,r=Ge.isTouch&&!w.props.touch,i=Pe(w.props.duration,0,tt.duration);if(e||t||n||r)return;if(C().hasAttribute("disabled"))return;if(I("onShow",[w],!1),!1===w.props.onShow(w))return;w.state.isVisible=!0,A()&&(x.style.visibility="visible");D(),H(),w.state.isMounted||(x.style.transition="none");if(A()){var o=T(),a=o.box,s=o.content;Ue([a,s],0)}c=function(){var e;if(w.state.isVisible&&!m){if(m=!0,x.offsetHeight,x.style.transition=w.props.moveTransition,A()&&w.props.animation){var t=T(),n=t.box,r=t.content;Ue([n,r],i),We([n,r],"visible")}N(),M(),Ne(pt,w),null==(e=w.popperInstance)||e.forceUpdate(),w.state.isMounted=!0,I("onMount",[w]),w.props.animation&&A()&&function(e,t){U(e,t)}(i,(function(){w.state.isShown=!0,I("onShown",[w])}))}},function(){var e,t=w.props.appendTo,n=C();e=w.props.interactive&&t===tt.appendTo||"parent"===t?n.parentNode:Se(t,[n]);e.contains(x)||e.appendChild(x);K(),!1}()},hide:function(){0;var e=!w.state.isVisible,t=w.state.isDestroyed,n=!w.state.isEnabled,r=Pe(w.props.duration,1,tt.duration);if(e||t||n)return;if(I("onHide",[w],!1),!1===w.props.onHide(w))return;w.state.isVisible=!1,w.state.isShown=!1,m=!1,p=!1,A()&&(x.style.visibility="hidden");if(F(),q(),D(),A()){var i=T(),o=i.box,a=i.content;w.props.animation&&(Ue([o,a],r),We([o,a],"hidden"))}N(),M(),w.props.animation?A()&&function(e,t){U(e,(function(){!w.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&t()}))}(r,w.unmount):w.unmount()},hideWithInteractivity:function(e){0;P().addEventListener("mousemove",v),Ne(dt,v),v(e)},enable:function(){w.state.isEnabled=!0},disable:function(){w.hide(),w.state.isEnabled=!1},unmount:function(){0;w.state.isVisible&&w.hide();if(!w.state.isMounted)return;Z(),ee().forEach((function(e){e._tippy.unmount()})),x.parentNode&&x.parentNode.removeChild(x);pt=pt.filter((function(e){return e!==w})),w.state.isMounted=!1,I("onHidden",[w])},destroy:function(){0;if(w.state.isDestroyed)return;w.clearDelayTimeouts(),w.unmount(),V(),delete e._tippy,w.state.isDestroyed=!0,I("onDestroy",[w])}};if(!d.render)return w;var _=d.render(w),x=_.popper,O=_.onUpdate;x.setAttribute("data-tippy-root",""),x.id="tippy-"+w.id,w.popper=x,e._tippy=w,x._tippy=w;var E=b.map((function(e){return e.fn(w)})),j=e.hasAttribute("aria-expanded");return Q(),M(),D(),I("onCreate",[w]),d.showOnCreate&&te(),x.addEventListener("mouseenter",(function(){w.props.interactive&&w.state.isVisible&&w.clearDelayTimeouts()})),x.addEventListener("mouseleave",(function(e){w.props.interactive&&w.props.trigger.indexOf("mouseenter")>=0&&(P().addEventListener("mousemove",v),v(e))})),w;function L(){var e=w.props.touch;return Array.isArray(e)?e:[e,0]}function k(){return"hold"===L()[0]}function A(){var e;return!!(null==(e=w.props.render)?void 0:e.$$tippy)}function C(){return l||e}function P(){var e=C().parentNode;return e?Qe(e):document}function T(){return ct(x)}function S(e){return w.state.isMounted&&!w.state.isVisible||Ge.isTouch||a&&"focus"===a.type?0:Pe(w.props.delay,e?0:1,tt.delay)}function D(){x.style.pointerEvents=w.props.interactive&&w.state.isVisible?"":"none",x.style.zIndex=""+w.props.zIndex}function I(e,t,n){var r;(void 0===n&&(n=!0),E.forEach((function(n){n[e]&&n[e].apply(void 0,t)})),n)&&(r=w.props)[e].apply(r,t)}function N(){var t=w.props.aria;if(t.content){var n="aria-"+t.content,r=x.id;Ie(w.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(n);if(w.state.isVisible)e.setAttribute(n,t?t+" "+r:r);else{var i=t&&t.replace(r,"").trim();i?e.setAttribute(n,i):e.removeAttribute(n)}}))}}function M(){!j&&w.props.aria.expanded&&Ie(w.props.triggerTarget||e).forEach((function(e){w.props.interactive?e.setAttribute("aria-expanded",w.state.isVisible&&e===C()?"true":"false"):e.removeAttribute("aria-expanded")}))}function F(){P().removeEventListener("mousemove",v),dt=dt.filter((function(e){return e!==v}))}function B(e){if(!(Ge.isTouch&&(h||"mousedown"===e.type)||w.props.interactive&&x.contains(e.target))){if(C().contains(e.target)){if(Ge.isTouch)return;if(w.state.isVisible&&w.props.trigger.indexOf("click")>=0)return}else I("onClickOutside",[w,e]);!0===w.props.hideOnClick&&(w.clearDelayTimeouts(),w.hide(),f=!0,setTimeout((function(){f=!1})),w.state.isMounted||q())}}function R(){h=!0}function z(){h=!1}function H(){var e=P();e.addEventListener("mousedown",B,!0),e.addEventListener("touchend",B,Ce),e.addEventListener("touchstart",z,Ce),e.addEventListener("touchmove",R,Ce)}function q(){var e=P();e.removeEventListener("mousedown",B,!0),e.removeEventListener("touchend",B,Ce),e.removeEventListener("touchstart",z,Ce),e.removeEventListener("touchmove",R,Ce)}function U(e,t){var n=T().box;function r(e){e.target===n&&(Ve(n,"remove",r),t())}if(0===e)return t();Ve(n,"remove",s),Ve(n,"add",r),s=r}function W(t,n,r){void 0===r&&(r=!1),Ie(w.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,n,r),g.push({node:e,eventType:t,handler:n,options:r})}))}function Q(){var e;k()&&(W("touchstart",G,{passive:!0}),W("touchend",J,{passive:!0})),(e=w.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(W(e,G),e){case"mouseenter":W("mouseleave",J);break;case"focus":W(Ze?"focusout":"blur",X);break;case"focusin":W("focusout",X)}}))}function V(){g.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,i=e.options;t.removeEventListener(n,r,i)})),g=[]}function G(e){var t,n=!1;if(w.state.isEnabled&&!Y(e)&&!f){var r="focus"===(null==(t=a)?void 0:t.type);a=e,l=e.currentTarget,M(),!w.state.isVisible&&ze(e)&&dt.forEach((function(t){return t(e)})),"click"===e.type&&(w.props.trigger.indexOf("mouseenter")<0||p)&&!1!==w.props.hideOnClick&&w.state.isVisible?n=!0:te(e),"click"===e.type&&(p=!n),n&&!r&&ne(e)}}function $(e){var t=e.target,n=C().contains(t)||x.contains(t);"mousemove"===e.type&&n||function(e,t){var n=t.clientX,r=t.clientY;return e.every((function(e){var t=e.popperRect,i=e.popperState,o=e.props.interactiveBorder,a=Me(i.placement),s=i.modifiersData.offset;if(!s)return!0;var c="bottom"===a?s.top.y:0,l="top"===a?s.bottom.y:0,u="right"===a?s.left.x:0,d="left"===a?s.right.x:0,p=t.top-r+c>o,f=r-t.bottom-l>o,h=t.left-n+u>o,m=n-t.right-d>o;return p||f||h||m}))}(ee().concat(x).map((function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:d}:null})).filter(Boolean),e)&&(F(),ne(e))}function J(e){Y(e)||w.props.trigger.indexOf("click")>=0&&p||(w.props.interactive?w.hideWithInteractivity(e):ne(e))}function X(e){w.props.trigger.indexOf("focusin")<0&&e.target!==C()||w.props.interactive&&e.relatedTarget&&x.contains(e.relatedTarget)||ne(e)}function Y(e){return!!Ge.isTouch&&k()!==e.type.indexOf("touch")>=0}function K(){Z();var t=w.props,n=t.popperOptions,r=t.placement,i=t.offset,o=t.getReferenceClientRect,a=t.moveTransition,s=A()?ct(x).arrow:null,l=o?{getBoundingClientRect:o,contextElement:o.contextElement||C()}:e,u=[{name:"offset",options:{offset:i}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!a}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(A()){var n=T().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?n.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?n.setAttribute("data-"+e,""):n.removeAttribute("data-"+e)})),t.attributes.popper={}}}}];A()&&s&&u.push({name:"arrow",options:{element:s,padding:3}}),u.push.apply(u,(null==n?void 0:n.modifiers)||[]),w.popperInstance=Ee(l,x,Object.assign({},n,{placement:r,onFirstUpdate:c,modifiers:u}))}function Z(){w.popperInstance&&(w.popperInstance.destroy(),w.popperInstance=null)}function ee(){return Fe(x.querySelectorAll("[data-tippy-root]"))}function te(e){w.clearDelayTimeouts(),e&&I("onTrigger",[w,e]),H();var t=S(!0),n=L(),i=n[0],o=n[1];Ge.isTouch&&"hold"===i&&o&&(t=o),t?r=setTimeout((function(){w.show()}),t):w.show()}function ne(e){if(w.clearDelayTimeouts(),I("onUntrigger",[w,e]),w.state.isVisible){if(!(w.props.trigger.indexOf("mouseenter")>=0&&w.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&p)){var t=S(!1);t?i=setTimeout((function(){w.state.isVisible&&w.hide()}),t):o=requestAnimationFrame((function(){w.hide()}))}}else q()}}function ht(e,t){void 0===t&&(t={});var n=tt.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",Je,Ce),window.addEventListener("blur",Ye);var r=Object.assign({},t,{plugins:n}),i=qe(e).reduce((function(e,t){var n=t&&ft(t,r);return n&&e.push(n),e}),[]);return Re(e)?i[0]:i}ht.defaultProps=tt,ht.setDefaultProps=function(e){Object.keys(e).forEach((function(t){tt[t]=e[t]}))},ht.currentInput=Ge;Object.assign({},le,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}});ht.setDefaultProps({render:lt});var mt=ht,gt=n(5),vt=n.n(gt);var yt={controlled:null,bind(e){this.controlled=e,this.controlled.forEach((e=>{this._master(e)})),this._init()},_init(){this.controlled.forEach((e=>{this._checkUp(e)}))},_master(e){const t=JSON.parse(e.dataset.master);e.dataset.size&&(e.filesize=parseInt(e.dataset.size,10)),e.masters=t.map((t=>{const n=document.getElementById(t),r=document.getElementById(t+"_size_wrapper");return r&&(n.filesize=0,n.sizespan=r),this._addChild(n,e),n})),this._bindEvents(e),e.masters.forEach((e=>{this._bindEvents(e)}))},_bindEvents(e){e.eventBound||(e.addEventListener("click",(t=>{const n=t.target;n.elements&&(this._checkDown(n),this._evaluateSize(n)),n.masters&&this._checkUp(e)})),e.eventBound=!0)},_addChild(e,t){const n=e.elements?e.elements:[];-1===n.indexOf(t)&&(n.push(t),e.elements=n)},_removeChild(e,t){const n=e.elements.indexOf(t);-1{t.checked!==e.checked&&(t.checked=e.checked,t.disabled&&(t.checked=!1),t.dispatchEvent(new Event("change")))})),e.elements.forEach((t=>{this._checkDown(t),t.elements||this._checkUp(t,e)})))},_checkUp(e,t){e.masters&&[...e.masters].forEach((e=>{e!==t&&this._evaluateCheckStatus(e),this._checkUp(e),this._evaluateSize(e)}))},_evaluateCheckStatus(e){let t=0,n=e.classList.contains("partial");n&&(e.classList.remove("partial"),n=!1),e.elements.forEach((r=>{null!==r.parentNode?(t+=r.checked,r.classList.contains("partial")&&(n=!0)):this._removeChild(e,r)}));let r="some";t===e.elements.length?r="on":0===t?r="off":n=!0,n&&e.classList.add("partial");const i="off"!==r;e.checked===i&&e.value===r||(e.value=r,e.checked=i,e.dispatchEvent(new Event("change")))},_evaluateSize(e){if(e.sizespan&&e.elements){e.filesize=0,e.elements.forEach((t=>{t.checked&&(e.filesize+=t.filesize)}));let t=null;0=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var _t,xt,Ot,Et,jt=n(1),Lt=n.n(jt);n(0),Lt()(console.error);_t={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1},xt=["(","?"],Ot={")":["("],":":["?","?:"]},Et=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;var kt={"!":function(e){return!e},"*":function(e,t){return e*t},"/":function(e,t){return e/t},"%":function(e,t){return e%t},"+":function(e,t){return e+t},"-":function(e,t){return e-t},"<":function(e,t){return e":function(e,t){return e>t},">=":function(e,t){return e>=t},"==":function(e,t){return e===t},"!=":function(e,t){return e!==t},"&&":function(e,t){return e&&t},"||":function(e,t){return e||t},"?:":function(e,t,n){if(e)throw t;return n}};function At(e){var t=function(e){for(var t,n,r,i,o=[],a=[];t=e.match(Et);){for(n=t[0],(r=e.substr(0,t.index).trim())&&o.push(r);i=a.pop();){if(Ot[n]){if(Ot[n][0]===i){n=Ot[n][1]||n;break}}else if(xt.indexOf(i)>=0||_t[i]<_t[n]){a.push(i);break}o.push(i)}Ot[n]||a.push(n),e=e.substr(t.index+n.length)}return(e=e.trim())&&o.push(e),o.concat(a.reverse())}(e);return function(e){return function(e,t){var n,r,i,o,a,s,c=[];for(n=0;n3&&void 0!==arguments[3]?arguments[3]:10,a=e[t];if(Mt(n)&&Nt(r))if("function"==typeof i)if("number"==typeof o){var s={callback:i,priority:o,namespace:r};if(a[n]){var c,l=a[n].handlers;for(c=l.length;c>0&&!(o>=l[c-1].priority);c--);c===l.length?l[c]=s:l.splice(c,0,s),a.__current.forEach((function(e){e.name===n&&e.currentIndex>=c&&e.currentIndex++}))}else a[n]={handlers:[s],runs:0};"hookAdded"!==n&&e.doAction("hookAdded",n,r,i,o)}else console.error("If specified, the hook priority must be a number.");else console.error("The hook callback must be a function.")}};var Bt=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(r,i){var o=e[t];if(Mt(r)&&(n||Nt(i))){if(!o[r])return 0;var a=0;if(n)a=o[r].handlers.length,o[r]={runs:o[r].runs,handlers:[]};else for(var s=o[r].handlers,c=function(e){s[e].namespace===i&&(s.splice(e,1),a++,o.__current.forEach((function(t){t.name===r&&t.currentIndex>=e&&t.currentIndex--})))},l=s.length-1;l>=0;l--)c(l);return"hookRemoved"!==r&&e.doAction("hookRemoved",r,i),a}}};var Rt=function(e,t){return function(n,r){var i=e[t];return void 0!==r?n in i&&i[n].handlers.some((function(e){return e.namespace===r})):n in i}};function zt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]&&arguments[2];return function(r){var i=e[t];i[r]||(i[r]={handlers:[],runs:0}),i[r].runs++;var o=i[r].handlers;for(var a=arguments.length,s=new Array(a>1?a-1:0),c=1;c1&&void 0!==arguments[1]?arguments[1]:"default";r.data[t]=St(St(St({},Dt),r.data[t]),e),r.data[t][""]=St(St({},Dt[""]),r.data[t][""])},s=function(e,t){a(e,t),o()},c=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;return r.data[e]||a(void 0,e),r.dcnpgettext(e,t,n,i,o)},l=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return e},u=function(e,t,r){var i=c(r,t,e);return n?(i=n.applyFilters("i18n.gettext_with_context",i,e,t,r),n.applyFilters("i18n.gettext_with_context_"+l(r),i,e,t,r)):i};if(e&&s(e,t),n){var d=function(e){It.test(e)&&o()};n.addAction("hookAdded","core/i18n",d),n.addAction("hookRemoved","core/i18n",d)}return{getLocaleData:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return r.data[e]},setLocaleData:s,resetLocaleData:function(e,t){r.data={},r.pluralForms={},s(e,t)},subscribe:function(e){return i.add(e),function(){return i.delete(e)}},__:function(e,t){var r=c(t,void 0,e);return n?(r=n.applyFilters("i18n.gettext",r,e,t),n.applyFilters("i18n.gettext_"+l(t),r,e,t)):r},_x:u,_n:function(e,t,r,i){var o=c(i,void 0,e,t,r);return n?(o=n.applyFilters("i18n.ngettext",o,e,t,r,i),n.applyFilters("i18n.ngettext_"+l(i),o,e,t,r,i)):o},_nx:function(e,t,r,i,o){var a=c(o,i,e,t,r);return n?(a=n.applyFilters("i18n.ngettext_with_context",a,e,t,r,i,o),n.applyFilters("i18n.ngettext_with_context_"+l(o),a,e,t,r,i,o)):a},isRTL:function(){return"rtl"===u("ltr","text direction")},hasTranslation:function(e,t,i){var o,a,s=t?t+""+e:e,c=!(null===(o=r.data)||void 0===o||null===(a=o[null!=i?i:"default"])||void 0===a||!a[s]);return n&&(c=n.applyFilters("i18n.has_translation",c,e,t,i),c=n.applyFilters("i18n.has_translation_"+l(i),c,e,t,i)),c}}}(void 0,void 0,Gt)),Jt=($t.getLocaleData.bind($t),$t.setLocaleData.bind($t),$t.resetLocaleData.bind($t),$t.subscribe.bind($t),$t.__.bind($t));$t._x.bind($t),$t._n.bind($t),$t._nx.bind($t),$t.isRTL.bind($t),$t.hasTranslation.bind($t);function Xt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Yt(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function gn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;if(!t||!Object.keys(t).length)return e;var n=e,r=e.indexOf("?");return-1!==r&&(t=Object.assign(hn(e),t),n=n.substr(0,r)),n+"?"+vn(t)}function bn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function wn(e){for(var t=1;t]+)>; rel="next"/);return t?{next:t[1]}:{}}(e.headers.get("link")).next},On=function(e){var t=!!e.path&&-1!==e.path.indexOf("per_page=-1"),n=!!e.url&&-1!==e.url.indexOf("per_page=-1");return t||n},En=function(){var e,t=(e=un.a.mark((function e(t,n){var r,i,o,a,s,c;return un.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!1!==t.parse){e.next=2;break}return e.abrupt("return",n(t));case 2:if(On(t)){e.next=4;break}return e.abrupt("return",n(t));case 4:return e.next=6,Wn(wn(wn({},(u={per_page:100},d=void 0,p=void 0,d=(l=t).path,p=l.url,wn(wn({},wt(l,["path","url"])),{},{url:p&&yn(p,u),path:d&&yn(d,u)}))),{},{parse:!1}));case 6:return r=e.sent,e.next=9,_n(r);case 9:if(i=e.sent,Array.isArray(i)){e.next=12;break}return e.abrupt("return",i);case 12:if(o=xn(r)){e.next=15;break}return e.abrupt("return",i);case 15:a=[].concat(i);case 16:if(!o){e.next=27;break}return e.next=19,Wn(wn(wn({},t),{},{path:void 0,url:o,parse:!1}));case 19:return s=e.sent,e.next=22,_n(s);case 22:c=e.sent,a=a.concat(c),o=xn(s),e.next=16;break;case 27:return e.abrupt("return",a);case 28:case"end":return e.stop()}var l,u,d,p}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){cn(o,r,i,a,s,"next",e)}function s(e){cn(o,r,i,a,s,"throw",e)}a(void 0)}))});return function(e,n){return t.apply(this,arguments)}}();function jn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ln(e){for(var t=1;t1&&void 0!==arguments[1])||arguments[1];return t?204===e.status?null:e.json?e.json():Promise.reject(e):e},Pn=function(e){var t={code:"invalid_json",message:Jt("The response is not a valid JSON response.")};if(!e||!e.json)throw t;return e.json().catch((function(){throw t}))},Tn=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Promise.resolve(Cn(e,t)).catch((function(e){return Sn(e,t)}))};function Sn(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!t)throw e;return Pn(e).then((function(e){var t={code:"unknown_error",message:Jt("An unknown error occurred.")};throw e||t}))}function Dn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function In(e){for(var t=1;t=500&&t.status<600&&n?r(n).catch((function(){return!1!==e.parse?Promise.reject({code:"post_process",message:Jt("Media upload failed. If this is a photo or a large image, please scale it down and try again.")}):Promise.reject(t)})):Sn(t,e.parse)})).then((function(t){return Tn(t,e.parse)}))};function Mn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Fn(e){for(var t=1;t=200&&e.status<300)return e;throw e},qn=function(e){var t=e.url,n=e.path,r=e.data,i=e.parse,o=void 0===i||i,a=wt(e,["url","path","data","parse"]),s=e.body,c=e.headers;return c=Fn(Fn({},Bn),c),r&&(s=JSON.stringify(r),c["Content-Type"]="application/json"),window.fetch(t||n||window.location.href,Fn(Fn(Fn({},Rn),a),{},{body:s,headers:c})).then((function(e){return Promise.resolve(e).then(Hn).catch((function(e){return Sn(e,o)})).then((function(e){return Tn(e,o)}))}),(function(){throw{code:"fetch_error",message:Jt("You are probably offline.")}}))};function Un(e){return zn.reduceRight((function(e,t){return function(n){return t(n,e)}}),qn)(e).catch((function(t){return"rest_cookie_invalid_nonce"!==t.code?Promise.reject(t):window.fetch(Un.nonceEndpoint).then(Hn).then((function(e){return e.text()})).then((function(t){return Un.nonceMiddleware.nonce=t,Un(e)}))}))}Un.use=function(e){zn.unshift(e)},Un.setFetchHandler=function(e){qn=e},Un.createNonceMiddleware=Kt,Un.createPreloadingMiddleware=sn,Un.createRootURLMiddleware=on,Un.fetchAllMiddleware=En,Un.mediaUploadMiddleware=Nn;var Wn=Un;Lt()(console.error);function Qn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Vn(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:"default";Jn.data[t]=Vn(Vn(Vn({},Zn),Jn.data[t]),e),Jn.data[t][""]=Vn(Vn({},Zn[""]),Jn.data[t][""])},Yn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;return Jn.data[e]||Xn(void 0,e),Jn.dcnpgettext(e,t,n,r,i)},Kn=function(e,t,n){return Yn(n,t,e)},Gn&&Xn(Gn,$n),{setLocaleData:Xn,__:function(e,t){return Yn(t,void 0,e)},_x:Kn,_n:function(e,t,n,r){return Yn(r,void 0,e,t,n)},_nx:function(e,t,n,r,i){return Yn(i,r,e,t,n)},isRTL:function(){return"rtl"===Kn("ltr","text direction")}}),tr=(er.setLocaleData.bind(er),er.__.bind(er));er._x.bind(er),er._n.bind(er),er._nx.bind(er),er.isRTL.bind(er);var nr={cachePoints:{},spinners:{},init(e){if("undefined"!=typeof CLDCACHE){Wn.use(Wn.createNonceMiddleware(CLDCACHE.nonce));e.querySelectorAll("[data-cache-point]").forEach((e=>this._bind(e)));const t=e.getElementById("cld_purge_all");t&&(t.disabled="disabled",t.style.width="100px",t.style.transition="width 0.5s",t.addEventListener("click",(()=>{t.dataset.purging||confirm(wp.i18n.__("Purge entire cache?","cloudinary"))&&this._purgeAll(t,!1)})),this._watchPurge(t),setInterval((()=>{this._watchPurge(t)}),5e3))}},getCachePoint(e){return this.cachePoints["_"+e]?this.cachePoints["_"+e]:null},setCachePoint(e,t){const n=document.createElement("div"),r=this._getRow(),i=document.createElement("td");i.colSpan=2,i.className="cld-loading",r.appendChild(i);const o=document.getElementById(t.dataset.slug),a=document.getElementById(t.dataset.slug+"_search"),s=document.getElementById(t.dataset.slug+"_reload"),c=document.getElementById(t.dataset.browser),l=document.getElementById(t.dataset.apply);l.style.float="right",l.style.marginLeft="6px",c.addEventListener("change",(t=>{this._handleManager(e)})),window.addEventListener("CacheToggle",(e=>{e.detail.cachePoint===t&&this._cacheChange(t,e.detail)})),l.addEventListener("click",(e=>{this._applyChanges(t)})),s.addEventListener("click",(t=>{this._load(e)})),a.addEventListener("keydown",(t=>{13===t.which&&(t.preventDefault(),t.stopPropagation(),this._load(e))})),n.className="cld-pagenav",l.cacheChanges={disable:[],enable:[],delete:[]},t.master=o,t.search=a,t.controller=c,t.viewer=t.parentNode.parentNode,t.loader=r,t.table=t.parentNode,t.apply=l,t.paginate=n,t.currentPage=1,t.viewer.appendChild(n),this.cachePoints["_"+e]=t},close(e){e.classList.add("closed")},open(e){e.classList.remove("closed")},isOpen(e){const t=this.getCachePoint(e);let n=!1;return t&&(n=t.controller.checked&&t.master.checked),n},_bind(e){const t=e.dataset.cachePoint;this.setCachePoint(t,e),this._handleManager(t)},_handleManager(e){const t=this.getCachePoint(e);t&&(this.isOpen(e)?(this.open(t.viewer),t.loaded||this._load(e)):(this.close(t.viewer),t.controller.checked=!1))},_load(e){const t=this.getCachePoint(e);let n="100px";t.clientHeight&&(n=t.clientHeight-16+"px"),this._clearChildren(t),t.appendChild(t.loader),this.open(t.loader),t.loader.firstChild.style.height=n,Wn({path:CLDCACHE.fetch_url,data:{ID:e,page:t.currentPage,search:t.search.value},method:"POST"}).then((e=>{t.removeChild(t.loader),this._buildList(t,e.items),this._buildNav(t,e);const n=t.querySelectorAll("[data-master]");yt.bind(n),t.loaded=!0}))},_cacheChange(e,t){const n=t.checked?t.states.on:t.states.off,r=t.checked?t.states.off:t.states.on;this._removeFromList(e,t.item.ID,r)||this._addToList(e,t.item.ID,n),this._evaluateApply(e)},_evaluateApply(e){e.apply.disabled="disabled";const t=e.apply.cacheChanges;let n=!1;for(const e in t)t[e].length&&(n=!0);n&&(e.apply.disabled="")},_applyChanges(e){const t=e.apply.cacheChanges;e.apply.disabled="disabled";for(const n in t)t[n].length&&this._set_state(e,n,t[n])},_watchPurge(e){e.dataset.purging||e.dataset.updating||(e.dataset.updating=!0,Wn({path:CLDCACHE.purge_all,data:{count:!0},method:"POST"}).then((t=>{e.dataset.updating="",0t.percent?(e.disabled="",this._purgeAll(e,!0)):0{e.innerText=tr("Purging cache","cloudinary")+" "+Math.round(t.percent,2)+"%",e.style.backgroundImage="linear-gradient(90deg, #2a0 "+t.percent+"%, #787878 "+t.percent+"%)",100>t.percent?this._purgeAction(e,!0,n):n?n():(e.innerText=wp.i18n.__("Purge complete.","cloudinary"),setTimeout((()=>{e.dataset.purging="",e.style.backgroundImage="",e.style.minHeight="",e.style.border="",e.style.width="100px",e.disabled="disabled",e.innerText=e.dataset.title}),2e3))}))},_set_state(e,t,n){this._showSpinners(n),Wn({path:CLDCACHE.update_url,data:{state:t,ids:n},method:"POST"}).then((n=>{this._hideSpinners(n),n.forEach((n=>{this._removeFromList(e,n,t),this._evaluateApply(e),e.apply.disabled="disabled"})),"delete"===t&&this._load(e.dataset.cachePoint)}))},_showSpinners(e){e.forEach((e=>{this.spinners["spinner_"+e].style.visibility="visible"}))},_hideSpinners(e){e.forEach((e=>{this.spinners["spinner_"+e].style.visibility="hidden"}))},_removeFromList(e,t,n){const r=this._getListIndex(e,t,n);let i=!1;return-1e.apply.cacheChanges[n].indexOf(t),_noCache(e){const t=this._getNote(wp.i18n.__("No files cached.","cloudinary"));e.viewer.appendChild(t),this.close(e.table)},_clearChildren(e){for(;e.children.length;){const t=e.lastChild;t.children.length&&this._clearChildren(t),e.removeChild(t)}},_buildList(e,t){t.forEach((t=>{if(t.note)return void e.appendChild(this._getNote(t.note));const n=this._getRow(t.ID),r=this._getStateSwitch(e,t,{on:"enable",off:"disable"}),i=this._getFile(e,t,n);n.appendChild(i),n.appendChild(r),e.appendChild(n)}))},_buildNav(e,t){e.paginate.innerHTML="";const n=document.createElement("button"),r=document.createElement("button");n.type="button",n.innerHTML="‹",n.className="button cld-pagenav-prev",1===t.current_page?n.disabled=!0:n.addEventListener("click",(n=>{e.currentPage=t.current_page-1,this._load(e.dataset.cachePoint)})),r.type="button",r.innerHTML="›",r.className="button cld-pagenav-next",t.current_page===t.total_pages||0===t.total_pages?r.disabled=!0:r.addEventListener("click",(n=>{e.currentPage=t.current_page+1,this._load(e.dataset.cachePoint)}));const i=document.createElement("span");if(i.innerText=t.nav_text,i.className="cld-pagenav-text",e.paginate.appendChild(n),e.paginate.appendChild(i),e.paginate.appendChild(r),e.paginate.appendChild(e.apply),e.apply.classList.remove("closed"),e.apply.disabled="disabled",t.items.length){const t=document.createElement("button");t.type="button",t.className="button",t.innerText=wp.i18n.__("Purge cache point","cloudinary"),t.style.float="right",e.paginate.appendChild(t),t.addEventListener("click",(n=>{if(confirm(wp.i18n.__("Purge entire cache point?","cloudinary"))){t.dataset.parent=e.dataset.cachePoint;const n=this;t.classList.add("button-primary"),this._purgeAll(t,!1,(function(){n._load(e.dataset.cachePoint)}))}}))}},_getNote(e){const t=this._getRow(),n=document.createElement("td");return n.colSpan=2,n.innerText=e,t.appendChild(n),t},_getRow(e){const t=document.createElement("tr");return e&&(t.id="row_"+e),t},_getFile(e,t){const n=document.createElement("td"),r=document.createElement("label"),i=this._getDeleter(e,n,t);r.innerText=t.short_url,r.htmlFor=t.key,n.appendChild(i),n.appendChild(r);const o=document.createElement("span"),a="spinner_"+t.ID;return o.className="spinner",o.id=a,n.appendChild(o),this.spinners[a]=o,n},_getDeleter(e,t,n){const r=document.createElement("input"),i=[e.dataset.slug+"_deleter"],o=this._getListIndex(e,n.ID,"delete");return r.type="checkbox",r.value=n.ID,r.id=n.key,r.dataset.master=JSON.stringify(i),-1{t.style.opacity=1,t.style.textDecoration="",r.checked&&(t.style.opacity=.8,t.style.textDecoration="line-through");const o=new CustomEvent("CacheToggle",{detail:{checked:r.checked,states:{on:"delete",off:n.active?"enable":"disable"},item:n,cachePoint:e}});window.dispatchEvent(o)})),r},_getStateSwitch(e,t,n){const r=document.createElement("td"),i=document.createElement("label"),o=document.createElement("input"),a=document.createElement("span"),s=(e.dataset.slug,this._getListIndex(e,t.ID,"disable"));return r.style.textAlign="right",i.className="cld-input-on-off-control mini",o.type="checkbox",o.value=t.ID,o.checked=!(-1{const i=new CustomEvent("CacheToggle",{detail:{checked:o.checked,states:n,item:t,cachePoint:e}});window.dispatchEvent(i)})),r.appendChild(i),r}};const rr={bindings:{},parent_check_data:{},check_parents:{},_init(e){const t=e.querySelectorAll("[data-condition]"),n=e.querySelectorAll("[data-toggle]"),r=e.querySelectorAll("[data-for]"),i=e.querySelectorAll("[data-tooltip]"),o=e.querySelectorAll("[data-bind-trigger]"),a=e.querySelectorAll("[data-master]"),s=e.querySelectorAll("[data-file]"),c=e.querySelectorAll("[data-auto-suffix]"),l={};yt.bind(a),c.forEach((e=>this._autoSuffix(e))),o.forEach((e=>this._trigger(e))),n.forEach((e=>this._toggle(e))),t.forEach((e=>this._bind(e))),r.forEach((e=>this._alias(e))),s.forEach((e=>this._files(e,l))),mt(i,{theme:"cloudinary",arrow:!1,placement:"bottom-start",aria:{content:"auto",expanded:"auto"},content:t=>e.getElementById(t.getAttribute("data-tooltip")).innerHTML}),[...o].forEach((e=>{e.dispatchEvent(new Event("input"))})),nr.init(e)},_autoSuffix(e){const t=e.dataset.autoSuffix;let n="";const r=[...t.split(";")].map((e=>0===e.indexOf("*")?(n=e.replace("*",""),n):e));e.addEventListener("change",(()=>{const t=e.value.replace(" ",""),i=t.replace(/[^0-9]/g,""),o=t.replace(/[0-9]/g,"").toLowerCase();i&&(-1===r.indexOf(o)?e.value=i+n:e.value=i+o)})),e.dispatchEvent(new Event("change"))},_files(e,t){const n=e.dataset.parent;n&&(this.check_parents[n]=document.getElementById(n),this.parent_check_data[n]||(this.parent_check_data[n]=this.check_parents[n].value?JSON.parse(this.check_parents[n].value):[]),e.addEventListener("change",(()=>{const r=this.parent_check_data[n].indexOf(e.value);e.checked?this.parent_check_data[n].push(e.value):this.parent_check_data[n].splice(r,1),t[n]&&clearTimeout(t[n]),t[n]=setTimeout((()=>{this._compileParent(n)}),10)})))},_compileParent(e){this.check_parents[e].value=JSON.stringify(this.parent_check_data[e]),this.check_parents[e].dispatchEvent(new Event("change"))},_bind(e){e.condition=JSON.parse(e.dataset.condition);for(const t in e.condition)this.bindings[t]&&this.bindings[t].elements.push(e)},_trigger(e){const t=e.dataset.bindTrigger,n=this;n.bindings[t]={input:e,value:e.value,checked:!0,elements:[]},e.addEventListener("change",(function(t){e.dispatchEvent(new Event("input"))})),e.addEventListener("input",(function(){if(n.bindings[t].value=e.value,"checkbox"===e.type&&(n.bindings[t].checked=e.checked),"radio"!==e.type||!1!==e.checked)for(const r in n.bindings[t].elements)n.toggle(n.bindings[t].elements[r],e)}))},_alias(e){e.addEventListener("click",(function(){document.getElementById(e.dataset.for).dispatchEvent(new Event("click"))}))},_toggle(e){const t=this;e.addEventListener("click",(function(n){n.stopPropagation();const r=document.querySelector('[data-wrap="'+e.dataset.toggle+'"]'),i=r.classList.contains("open")?"closed":"open";t.toggle(r,e,i)}))},toggle(e,t,n){if(!n){n="open";for(const t in e.condition){let r=this.bindings[t].value;const i=e.condition[t];"boolean"==typeof i&&(r=this.bindings[t].checked),i!==r&&(n="closed")}}const r=e.getElementsByClassName("cld-ui-input");"closed"===n?(e.classList.remove("open"),e.classList.add("closed"),t&&t.classList.contains("dashicons")&&(t.classList.remove("dashicons-arrow-up-alt2"),t.classList.add("dashicons-arrow-down-alt2")),[...r].forEach((function(e){e.dataset.disabled=!0}))):(e.classList.remove("closed"),e.classList.add("open"),t&&t.classList.contains("dashicons")&&(t.classList.remove("dashicons-arrow-down-alt2"),t.classList.add("dashicons-arrow-up-alt2")),[...r].forEach((function(e){e.dataset.disabled=!1})))}};window.addEventListener("load",rr._init(document));var ir=rr;n.p,n.p,n.p,n.p,n.p,n.p,n.p,n.p,n.p,n.p,n.p,n.p,n.p;window.$=window.jQuery;const or={UI:ir,Settings:i.a,Widget:a.a,GlobalTransformations:c,TermsOrder:u,MediaLibrary:p,Notices:h}}]); \ No newline at end of file +!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=14)}([function(e,t,n){var r;!function(){"use strict";var i={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function o(e){return s(l(e),arguments)}function a(e,t){return o.apply(null,[e].concat(t||[]))}function s(e,t){var n,r,a,s,c,l,u,d,p,f=1,h=e.length,m="";for(r=0;r=0),s.type){case"b":n=parseInt(n,10).toString(2);break;case"c":n=String.fromCharCode(parseInt(n,10));break;case"d":case"i":n=parseInt(n,10);break;case"j":n=JSON.stringify(n,null,s.width?parseInt(s.width):0);break;case"e":n=s.precision?parseFloat(n).toExponential(s.precision):parseFloat(n).toExponential();break;case"f":n=s.precision?parseFloat(n).toFixed(s.precision):parseFloat(n);break;case"g":n=s.precision?String(Number(n.toPrecision(s.precision))):parseFloat(n);break;case"o":n=(parseInt(n,10)>>>0).toString(8);break;case"s":n=String(n),n=s.precision?n.substring(0,s.precision):n;break;case"t":n=String(!!n),n=s.precision?n.substring(0,s.precision):n;break;case"T":n=Object.prototype.toString.call(n).slice(8,-1).toLowerCase(),n=s.precision?n.substring(0,s.precision):n;break;case"u":n=parseInt(n,10)>>>0;break;case"v":n=n.valueOf(),n=s.precision?n.substring(0,s.precision):n;break;case"x":n=(parseInt(n,10)>>>0).toString(16);break;case"X":n=(parseInt(n,10)>>>0).toString(16).toUpperCase()}i.json.test(s.type)?m+=n:(!i.number.test(s.type)||d&&!s.sign?p="":(p=d?"+":"-",n=n.toString().replace(i.sign,"")),l=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",u=s.width-(p+n).length,c=s.width&&u>0?l.repeat(u):"",m+=s.align?p+n+c:"0"===l?p+c+n:c+p+n)}return m}var c=Object.create(null);function l(e){if(c[e])return c[e];for(var t,n=e,r=[],o=0;n;){if(null!==(t=i.text.exec(n)))r.push(t[0]);else if(null!==(t=i.modulo.exec(n)))r.push("%");else{if(null===(t=i.placeholder.exec(n)))throw new SyntaxError("[sprintf] unexpected placeholder");if(t[2]){o|=1;var a=[],s=t[2],l=[];if(null===(l=i.key.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(a.push(l[1]);""!==(s=s.substring(l[0].length));)if(null!==(l=i.key_access.exec(s)))a.push(l[1]);else{if(null===(l=i.index_access.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");a.push(l[1])}t[2]=a}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");r.push({placeholder:t[0],param_no:t[1],keys:t[2],sign:t[3],pad_char:t[4],align:t[5],width:t[6],precision:t[7],type:t[8]})}n=n.substring(t[0].length)}return c[e]=r}t.sprintf=o,t.vsprintf=a,"undefined"!=typeof window&&(window.sprintf=o,window.vsprintf=a,void 0===(r=function(){return{sprintf:o,vsprintf:a}}.call(t,n,t,e))||(e.exports=r))}()},function(e,t,n){e.exports=function(e,t){var n,r,i=0;function o(){var o,a,s=n,c=arguments.length;e:for(;s;){if(s.args.length===arguments.length){for(a=0;ao[0];break;case"lt":n=this.value=0&&(e.metadata.cldoverwrite="true")})),wp.media.events.on("editor:image-update",(function(e){const t=e.image.className.split(" ");e.metadata.cldoverwrite&&-1===t.indexOf("cld-overwrite")?t.push("cld-overwrite"):!e.metadata.cldoverwrite&&t.indexOf("cld-overwrite")>=0&&delete t[t.indexOf("cld-overwrite")],e.image.className=t.join(" ")}));let e=null;const t=wp.media.string.props;wp.media.string.props=function(n,r){n.cldoverwrite&&(n.classes=["cld-overwrite"],e=!0);return t(n,r)},wp.media.post=function(t,n){if("send-attachment-to-editor"===t){const t=wp.media.editor.get().state().get("selection").get(n.attachment);t.attributes.transformations&&(n.attachment.transformations=t.attributes.transformations),(n.html.indexOf("cld-overwrite")>-1||!0===e)&&(n.attachment.cldoverwrite=!0,e=null)}return wp.ajax.post(t,n)};const n=wp.media.view.MediaFrame.Select,r=wp.media.view.MediaFrame.Post,i=wp.media.view.MediaFrame.ImageDetails,o=wp.media.view.MediaFrame.VideoDetails,a=wp.media.View.extend({tagName:"div",className:"cloudinary-widget",template:wp.template("cloudinary-dam"),active:!1,toolbar:null,frame:null,ready(){const e=this.controller,t=this.model.get("selection"),n=this.model.get("library"),r=wp.media.model.Attachment;if(CLDN.mloptions.multiple=e.options.multiple,this.cid!==this.active){if(CLDN.mloptions.inline_container="#cloudinary-dam-"+e.cid,1===t.length){const e=r.get(t.models[0].id);void 0!==e.attributes.public_id&&(CLDN.mloptions.asset={resource_id:e.attributes.public_id})}else CLDN.mloptions.asset=null;try{CLDN.mloptions.folder||(CLDN.mloptions.folder={path:""});const e=t.props.attributes.type;CLDN.mloptions.folder.resource_type=Array.isArray(e)?e[0]:e}catch(e){}window.ml=cloudinary.openMediaLibrary(CLDN.mloptions,{insertHandler(i){for(let o=0;o0;a--)s/=o;return s.toFixed(2)},r.human=function(e){var t=r.calculate(e);return t.fixed+r.spacer+t.suffix},r}},e.exports?e.exports=a():(i=[],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))},,,,function(e,t){!function(e,t){"use strict";var n,r,i={rootMargin:"256px 0px",threshold:.01,lazyImage:'img[loading="lazy"]',lazyIframe:'iframe[loading="lazy"]'},o="loading"in HTMLImageElement.prototype&&"loading"in HTMLIFrameElement.prototype,a="onscroll"in window;function s(e){var t,n,r=[];"picture"===e.parentNode.tagName.toLowerCase()&&((n=(t=e.parentNode).querySelector("source[data-lazy-remove]"))&&t.removeChild(n),r=Array.prototype.slice.call(e.parentNode.querySelectorAll("source"))),r.push(e),r.forEach((function(e){e.hasAttribute("data-lazy-srcset")&&(e.setAttribute("srcset",e.getAttribute("data-lazy-srcset")),e.removeAttribute("data-lazy-srcset"))})),e.setAttribute("src",e.getAttribute("data-lazy-src")),e.removeAttribute("data-lazy-src")}function c(e){var t=document.createElement("div");for(t.innerHTML=function(e){var t=e.textContent||e.innerHTML,r="data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 "+((t.match(/width=['"](\d+)['"]/)||!1)[1]||1)+" "+((t.match(/height=['"](\d+)['"]/)||!1)[1]||1)+"%27%3E%3C/svg%3E";return!o&&a&&(void 0===n?t=t.replace(/(?:\r\n|\r|\n|\t| )src=/g,' lazyload="1" src='):("picture"===e.parentNode.tagName.toLowerCase()&&(t=''+t),t=t.replace(/(?:\r\n|\r|\n|\t| )srcset=/g," data-lazy-srcset=").replace(/(?:\r\n|\r|\n|\t| )src=/g,' src="'+r+'" data-lazy-src='))),t}(e);t.firstChild;)o||!a||void 0===n||!t.firstChild.tagName||"img"!==t.firstChild.tagName.toLowerCase()&&"iframe"!==t.firstChild.tagName.toLowerCase()||n.observe(t.firstChild),e.parentNode.insertBefore(t.firstChild,e);e.parentNode.removeChild(e)}function l(){document.querySelectorAll("noscript.loading-lazy").forEach(c),void 0!==window.matchMedia&&window.matchMedia("print").addListener((function(e){e.matches&&document.querySelectorAll(i.lazyImage+"[data-lazy-src],"+i.lazyIframe+"[data-lazy-src]").forEach((function(e){s(e)}))}))}"undefined"!=typeof NodeList&&NodeList.prototype&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),"IntersectionObserver"in window&&(n=new IntersectionObserver((function(e,t){e.forEach((function(e){if(0!==e.intersectionRatio){var n=e.target;t.unobserve(n),s(n)}}))}),i)),r="requestAnimationFrame"in window?window.requestAnimationFrame:function(e){e()},/comp|inter/.test(document.readyState)?r(l):"addEventListener"in document?document.addEventListener("DOMContentLoaded",(function(){r(l)})):document.attachEvent("onreadystatechange",(function(){"complete"===document.readyState&&l()}))}()},function(e,t){const n=document.querySelector(".cloudinary-collapsible__toggle");n&&n.addEventListener("click",(function(){const e=document.querySelector(".cloudinary-collapsible__content"),t="none"===window.getComputedStyle(e,null).getPropertyValue("display"),n=document.querySelector(".cloudinary-collapsible__toggle button i");e.style.display=t?"block":"none";const r="dashicons-arrow-down-alt2",i="dashicons-arrow-up-alt2";n.classList.contains(r)?(n.classList.remove(r),n.classList.add(i)):(n.classList.remove(i),n.classList.add(r))}))},function(e,t,n){var r=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var i=t&&t.prototype instanceof g?t:g,o=Object.create(i.prototype),a=new A(r||[]);return o._invoke=function(e,t,n){var r=d;return function(i,o){if(r===f)throw new Error("Generator is already running");if(r===h){if("throw"===i)throw o;return P()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=j(a,n);if(s){if(s===m)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===d)throw r=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=f;var c=u(e,t,n);if("normal"===c.type){if(r=n.done?h:p,c.arg===m)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r=h,n.method="throw",n.arg=c.arg)}}}(e,n,a),o}function u(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var d="suspendedStart",p="suspendedYield",f="executing",h="completed",m={};function g(){}function v(){}function y(){}var b={};b[o]=function(){return this};var w=Object.getPrototypeOf,_=w&&w(w(C([])));_&&_!==n&&r.call(_,o)&&(b=_);var x=y.prototype=g.prototype=Object.create(b);function O(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function n(i,o,a,s){var c=u(e[i],e,o);if("throw"!==c.type){var l=c.arg,d=l.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(d).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,s)}))}s(c.arg)}var i;this._invoke=function(e,r){function o(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(o,o):o()}}function j(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,j(e,n),"throw"===n.method))return m;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var i=u(r,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function L(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function C(e){if(e){var n=e[o];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function n(){for(;++i=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;k(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:C(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}(e.exports);try{regeneratorRuntime=r}catch(e){Function("r","regeneratorRuntime = r")(r)}},,,function(e,t,n){"use strict";n.r(t),n.d(t,"cloudinary",(function(){return ar}));n(9),n(10);var r=n(3),i=n.n(r),o=n(4),a=n.n(o);const s={sample:{image:document.getElementById("transformation-sample-image"),video:document.getElementById("transformation-sample-video")},preview:{image:document.getElementById("sample-image"),video:document.getElementById("sample-video")},fields:document.getElementsByClassName("cld-ui-input"),button:{image:document.getElementById("refresh-image-preview"),video:document.getElementById("refresh-video-preview")},spinner:{image:document.getElementById("image-loader"),video:document.getElementById("video-loader")},optimization:{image:document.getElementById("image_optimization"),video:document.getElementById("video_optimization")},error_container:document.getElementById("cld-preview-error"),activeItem:null,elements:{image:[],video:[]},_placeItem(e){null!==e&&(e.style.display="block",e.style.visibility="visible",e.style.position="absolute",e.style.top=e.parentElement.clientHeight/2-e.clientHeight/2+"px",e.style.left=e.parentElement.clientWidth/2-e.clientWidth/2+"px")},_setLoading(e){this.button[e].style.display="block",this._placeItem(this.button[e]),this.preview[e].style.opacity="0.1"},_build(e){this.sample[e].innerHTML="",this.elements[e]=[];for(const t of this.fields){if(e!==t.dataset.context||t.dataset.disabled&&"true"===t.dataset.disabled)continue;let n=t.value.trim();if(n.length){if("select-one"===t.type){if("none"===n||!1===this.optimization[e].checked)continue;n=t.dataset.meta+"_"+n}else e=t.dataset.context,t.dataset.meta&&(n=t.dataset.meta+"_"+n),t.dataset.suffix&&(n+=t.dataset.suffix),n=this._transformations(n,e,!0);n&&this.elements[e].push(n)}}let t="";this.elements[e].length&&(t="/"+this._getGlobalTransformationElements(e).replace(/ /g,"%20")),this.sample[e].textContent=t,this.sample[e].parentElement.href="https://res.cloudinary.com/demo/"+this.sample[e].parentElement.innerText.trim().replace("../","").replace(/ /g,"%20")},_clearLoading(e){this.spinner[e].style.visibility="hidden",this.activeItem=null,this.preview[e].style.opacity=1},_refresh(e,t){e&&e.preventDefault();const n=this,r=CLD_GLOBAL_TRANSFORMATIONS[t].preview_url+this._getGlobalTransformationElements(t)+CLD_GLOBAL_TRANSFORMATIONS[t].file;if(this.button[t].style.display="none",this._placeItem(this.spinner[t]),"image"===t){const e=new Image;e.onload=function(){n.preview[t].src=this.src,n._clearLoading(t),n.error_container&&(n.error_container.style.display="none"),e.remove()},e.onerror=function(){const e=n.elements[t].includes("f_mp4");n.error_container&&(n.error_container.style.display="block",e?(n.error_container.innerHTML=CLD_GLOBAL_TRANSFORMATIONS[t].warning.replace("%s","f_mp4"),n.error_container.classList.replace("settings-alert-error","settings-alert-warning")):(n.error_container.innerHTML=CLD_GLOBAL_TRANSFORMATIONS[t].error,n.error_container.classList.replace("settings-alert-warning","settings-alert-error"))),n._clearLoading(t)},e.src=r}else{const e=n._transformations(n._getGlobalTransformationElements(t),t);samplePlayer.source({publicId:"dog",transformation:e}),n._clearLoading(t)}},_getGlobalTransformationElements(e){let t=[];return t.push(this.elements[e].slice(0,2).join(",")),t.push(this.elements[e].slice(2).join(",")),t=t.filter((e=>e)).join("/"),t},_transformations(e,t,n=!1){const r=CLD_GLOBAL_TRANSFORMATIONS[t].valid_types;let i=null;const o=e.split("/"),a=[];for(let e=0;e{const r=!!n.length&&jQuery('[data-item="'+i+":"+n[0].id+'"]');r.length?r.remove():(jQuery(`.cld-tax-order-list-item:contains(${a})`).remove(),--e.startId),this.processTags(t)}))}),jQuery("body").on("change",".selectit input",(function(){const t=jQuery(this),n=t.val(),r=t.is(":checked"),i=t.parent().text().trim();!0===r?e.tags.find(`[data-item="category:${n}"]`).length||e._pushItem(`category:${n}`,i):e.tags.find(`[data-item="category:${n}"]`).remove()}))},_createItem(e,t){const n=jQuery("
  • "),r=jQuery(""),i=jQuery("");return n.addClass("cld-tax-order-list-item").attr("data-item",e),i.addClass("cld-tax-order-list-item-input").attr("type","hidden").attr("name","cld_tax_order[]").val(e),r.addClass("dashicons dashicons-menu cld-tax-order-list-item-handle"),n.append(r).append(t).append(i),n},_pushItem(e,t){const n=this._createItem(e,t);this.tags.append(n)},_sortable(){jQuery(".cld-tax-order-list").sortable({connectWith:".cld-tax-order",axis:"y",handle:".cld-tax-order-list-item-handle",placeholder:"cld-tax-order-list-item-placeholder",forcePlaceholderSize:!0,helper:"clone"})}};if(void 0!==window.CLDN&&(l._init(),jQuery("[data-wp-lists] .selectit input[checked]").each(((e,t)=>{jQuery(t).trigger("change")}))),wp.data&&wp.data.select("core/editor")){const e={};wp.data.subscribe((function(){const t=wp.data.select("core").getTaxonomies();if(t)for(const n in t){const r=wp.data.select("core/editor").getEditedPostAttribute(t[n].rest_base);e[t[n].slug]=r}}));const t=wp.element.createElement,n=n=>{class r extends n{constructor(e){super(e),this.currentItems=jQuery(".cld-tax-order-list-item").map(((e,t)=>jQuery(t).data("item"))).get()}makeItem(e){if(this.currentItems.includes(this.getId(e)))return;const t=this.makeElement(e);jQuery("#cld-tax-items").append(t)}removeItem(e){const t=jQuery(`[data-item="${this.getId(e)}"]`);t.length&&(t.remove(),this.currentItems=this.currentItems.filter((t=>t!==this.getId(e))))}findOrCreateTerm(e){return(e=super.findOrCreateTerm(e)).then((e=>this.makeItem(e))),e}onChange(t){super.onChange(t);const n=this.pickItem(t);n&&(e[this.props.slug].includes(n.id)?this.makeItem(n):this.removeItem(n))}pickItem(e){if("object"==typeof e){if(e.target){for(const t in this.state.availableTerms)if(this.state.availableTerms[t].id===parseInt(e.target.value))return this.state.availableTerms[t]}else if(Array.isArray(e)){let t=this.state.selectedTerms.filter((t=>!e.includes(t)))[0];return void 0===t&&(t=e.filter((e=>!this.state.selectedTerms.includes(e)))[0]),this.state.availableTerms.find((e=>e.name===t))}}else if("number"==typeof e){for(const t in this.state.availableTerms)if(this.state.availableTerms[t].id===e)return this.state.availableTerms[t]}else{let t;if(e.length>this.state.selectedTerms.length)for(const n in e)-1===this.state.selectedTerms.indexOf(e[n])&&(t=e[n]);else for(const n in this.state.selectedTerms)-1===e.indexOf(this.state.selectedTerms[n])&&(t=this.state.selectedTerms[n]);for(const e in this.state.availableTerms)if(this.state.availableTerms[e].name===t)return this.state.availableTerms[e]}}getId(e){return`${this.props.slug}:${e.id}`}makeElement(e){const t=jQuery("
  • "),n=jQuery(""),r=jQuery("");return t.addClass("cld-tax-order-list-item").attr("data-item",this.getId(e)),r.addClass("cld-tax-order-list-item-input").attr("type","hidden").attr("name","cld_tax_order[]").val(this.getId(e)),n.addClass("dashicons dashicons-menu cld-tax-order-list-item-handle"),t.append(n).append(e.name).append(r),t}}return e=>t(r,e)};wp.hooks.addFilter("editor.PostTaxonomyType","cld",n)}var u=l;const d={wpWrap:document.getElementById("wpwrap"),wpContent:document.getElementById("wpbody-content"),libraryWrap:document.getElementById("cloudinary-embed"),_init(){const e=this;"undefined"!=typeof CLD_ML&&(cloudinary.openMediaLibrary(CLD_ML.mloptions,{insertHandler(){alert("Import is not yet implemented.")}}),window.addEventListener("resize",(function(){e._resize()})),e._resize())},_resize(){const e=getComputedStyle(this.wpContent);this.libraryWrap.style.height=this.wpWrap.offsetHeight-parseInt(e.getPropertyValue("padding-bottom"))+"px"}};var p=d;d._init();const f={_init(){const e=this;if("undefined"!=typeof CLDIS){[...document.getElementsByClassName("cld-notice-box")].forEach((t=>{const n=t.getElementsByClassName("notice-dismiss");n.length&&n[0].addEventListener("click",(n=>{t.style.height=t.offsetHeight+"px",n.preventDefault(),setTimeout((function(){e._dismiss(t)}),5)}))}))}},_dismiss(e){const t=e.dataset.dismiss,n=parseInt(e.dataset.duration);e.classList.add("dismissed"),e.style.height="0px",setTimeout((function(){e.remove()}),400),0=0?e.ownerDocument.body:b(e)&&j(e)?e:C(A(e))}function P(e,t){var n;void 0===t&&(t=[]);var r=C(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=g(r),a=i?[o].concat(o.visualViewport||[],j(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(P(A(a)))}function T(e){return["table","td","th"].indexOf(_(e))>=0}function S(e){return b(e)&&"fixed"!==E(e).position?e.offsetParent:null}function D(e){for(var t=g(e),n=S(e);n&&T(n)&&"static"===E(n).position;)n=S(n);return n&&("html"===_(n)||"body"===_(n)&&"static"===E(n).position)?t:n||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&b(e)&&"fixed"===E(e).position)return null;for(var n=A(e);b(n)&&["html","body"].indexOf(_(n))<0;){var r=E(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}var I="top",N="bottom",M="right",F="left",B="auto",R=[I,N,M,F],z="start",H="end",q="viewport",U="popper",W=R.reduce((function(e,t){return e.concat([t+"-"+z,t+"-"+H])}),[]),Q=[].concat(R,[B]).reduce((function(e,t){return e.concat([t,t+"-"+z,t+"-"+H])}),[]),V=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function G(e){var t=new Map,n=new Set,r=[];function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&i(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||i(e)})),r}var $={placement:"bottom",modifiers:[],strategy:"absolute"};function J(){for(var e=arguments.length,t=new Array(e),n=0;n=0?"x":"y"}function ne(e){var t,n=e.reference,r=e.element,i=e.placement,o=i?Z(i):null,a=i?ee(i):null,s=n.x+n.width/2-r.width/2,c=n.y+n.height/2-r.height/2;switch(o){case I:t={x:s,y:n.y-r.height};break;case N:t={x:s,y:n.y+n.height};break;case M:t={x:n.x+n.width,y:c};break;case F:t={x:n.x-r.width,y:c};break;default:t={x:n.x,y:n.y}}var l=o?te(o):null;if(null!=l){var u="y"===l?"height":"width";switch(a){case z:t[l]=t[l]-(n[u]/2-r[u]/2);break;case H:t[l]=t[l]+(n[u]/2-r[u]/2)}}return t}var re={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=ne({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},ie=Math.max,oe=Math.min,ae=Math.round,se={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ce(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.offsets,a=e.position,s=e.gpuAcceleration,c=e.adaptive,l=e.roundOffsets,u=!0===l?function(e){var t=e.x,n=e.y,r=window.devicePixelRatio||1;return{x:ae(ae(t*r)/r)||0,y:ae(ae(n*r)/r)||0}}(o):"function"==typeof l?l(o):o,d=u.x,p=void 0===d?0:d,f=u.y,h=void 0===f?0:f,m=o.hasOwnProperty("x"),v=o.hasOwnProperty("y"),y=F,b=I,w=window;if(c){var _=D(n),O="clientHeight",j="clientWidth";_===g(n)&&"static"!==E(_=x(n)).position&&(O="scrollHeight",j="scrollWidth"),_=_,i===I&&(b=N,h-=_[O]-r.height,h*=s?1:-1),i===F&&(y=M,p-=_[j]-r.width,p*=s?1:-1)}var L,k=Object.assign({position:a},c&&se);return s?Object.assign({},k,((L={})[b]=v?"0":"",L[y]=m?"0":"",L.transform=(w.devicePixelRatio||1)<2?"translate("+p+"px, "+h+"px)":"translate3d("+p+"px, "+h+"px, 0)",L)):Object.assign({},k,((t={})[b]=v?h+"px":"",t[y]=m?p+"px":"",t.transform="",t))}var le={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];b(i)&&_(i)&&(Object.assign(i.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?i.removeAttribute(e):i.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],i=t.attributes[e]||{},o=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});b(r)&&_(r)&&(Object.assign(r.style,o),Object.keys(i).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};var ue={left:"right",right:"left",bottom:"top",top:"bottom"};function de(e){return e.replace(/left|right|bottom|top/g,(function(e){return ue[e]}))}var pe={start:"end",end:"start"};function fe(e){return e.replace(/start|end/g,(function(e){return pe[e]}))}function he(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&w(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function me(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function ge(e,t){return t===q?me(function(e){var t=g(e),n=x(e),r=t.visualViewport,i=n.clientWidth,o=n.clientHeight,a=0,s=0;return r&&(i=r.width,o=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=r.offsetLeft,s=r.offsetTop)),{width:i,height:o,x:a+O(e),y:s}}(e)):b(t)?function(e){var t=m(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(t):me(function(e){var t,n=x(e),r=v(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=ie(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=ie(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+O(e),c=-r.scrollTop;return"rtl"===E(i||n).direction&&(s+=ie(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:c}}(x(e)))}function ve(e,t,n){var r="clippingParents"===t?function(e){var t=P(A(e)),n=["absolute","fixed"].indexOf(E(e).position)>=0&&b(e)?D(e):e;return y(n)?t.filter((function(e){return y(e)&&he(e,n)&&"body"!==_(e)})):[]}(e):[].concat(t),i=[].concat(r,[n]),o=i[0],a=i.reduce((function(t,n){var r=ge(e,n);return t.top=ie(r.top,t.top),t.right=oe(r.right,t.right),t.bottom=oe(r.bottom,t.bottom),t.left=ie(r.left,t.left),t}),ge(e,o));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function ye(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function be(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function we(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=void 0===r?e.placement:r,o=n.boundary,a=void 0===o?"clippingParents":o,s=n.rootBoundary,c=void 0===s?q:s,l=n.elementContext,u=void 0===l?U:l,d=n.altBoundary,p=void 0!==d&&d,f=n.padding,h=void 0===f?0:f,g=ye("number"!=typeof h?h:be(h,R)),v=u===U?"reference":U,b=e.elements.reference,w=e.rects.popper,_=e.elements[p?v:u],O=ve(y(_)?_:_.contextElement||x(e.elements.popper),a,c),E=m(b),j=ne({reference:E,element:w,strategy:"absolute",placement:i}),L=me(Object.assign({},w,j)),k=u===U?L:E,A={top:O.top-k.top+g.top,bottom:k.bottom-O.bottom+g.bottom,left:O.left-k.left+g.left,right:k.right-O.right+g.right},C=e.modifiersData.offset;if(u===U&&C){var P=C[i];Object.keys(A).forEach((function(e){var t=[M,N].indexOf(e)>=0?1:-1,n=[I,N].indexOf(e)>=0?"y":"x";A[e]+=P[n]*t}))}return A}function _e(e,t,n){return ie(e,oe(t,n))}function xe(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Oe(e){return[I,M,N,F].some((function(t){return e[t]>=0}))}var Ee=X({defaultModifiers:[K,re,{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=void 0===r||r,o=n.adaptive,a=void 0===o||o,s=n.roundOffsets,c=void 0===s||s,l={placement:Z(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,ce(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:c})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,ce(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},le,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=void 0===i?[0,0]:i,a=Q.reduce((function(e,n){return e[n]=function(e,t,n){var r=Z(e),i=[F,I].indexOf(r)>=0?-1:1,o="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*i,[F,M].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,o),e}),{}),s=a[t.placement],c=s.x,l=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=l),t.modifiersData[r]=a}},{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=void 0===i||i,a=n.altAxis,s=void 0===a||a,c=n.fallbackPlacements,l=n.padding,u=n.boundary,d=n.rootBoundary,p=n.altBoundary,f=n.flipVariations,h=void 0===f||f,m=n.allowedAutoPlacements,g=t.options.placement,v=Z(g),y=c||(v===g||!h?[de(g)]:function(e){if(Z(e)===B)return[];var t=de(e);return[fe(e),t,fe(t)]}(g)),b=[g].concat(y).reduce((function(e,n){return e.concat(Z(n)===B?function(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,c=n.allowedAutoPlacements,l=void 0===c?Q:c,u=ee(r),d=u?s?W:W.filter((function(e){return ee(e)===u})):R,p=d.filter((function(e){return l.indexOf(e)>=0}));0===p.length&&(p=d);var f=p.reduce((function(t,n){return t[n]=we(e,{placement:n,boundary:i,rootBoundary:o,padding:a})[Z(n)],t}),{});return Object.keys(f).sort((function(e,t){return f[e]-f[t]}))}(t,{placement:n,boundary:u,rootBoundary:d,padding:l,flipVariations:h,allowedAutoPlacements:m}):n)}),[]),w=t.rects.reference,_=t.rects.popper,x=new Map,O=!0,E=b[0],j=0;j=0,P=C?"width":"height",T=we(t,{placement:L,boundary:u,rootBoundary:d,altBoundary:p,padding:l}),S=C?A?M:F:A?N:I;w[P]>_[P]&&(S=de(S));var D=de(S),H=[];if(o&&H.push(T[k]<=0),s&&H.push(T[S]<=0,T[D]<=0),H.every((function(e){return e}))){E=L,O=!1;break}x.set(L,H)}if(O)for(var q=function(e){var t=b.find((function(t){var n=x.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return E=t,"break"},U=h?3:1;U>0;U--){if("break"===q(U))break}t.placement!==E&&(t.modifiersData[r]._skip=!0,t.placement=E,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=void 0===i||i,a=n.altAxis,s=void 0!==a&&a,c=n.boundary,l=n.rootBoundary,u=n.altBoundary,d=n.padding,p=n.tether,f=void 0===p||p,h=n.tetherOffset,m=void 0===h?0:h,g=we(t,{boundary:c,rootBoundary:l,padding:d,altBoundary:u}),v=Z(t.placement),y=ee(t.placement),b=!y,w=te(v),_="x"===w?"y":"x",x=t.modifiersData.popperOffsets,O=t.rects.reference,E=t.rects.popper,j="function"==typeof m?m(Object.assign({},t.rects,{placement:t.placement})):m,L={x:0,y:0};if(x){if(o||s){var A="y"===w?I:F,C="y"===w?N:M,P="y"===w?"height":"width",T=x[w],S=x[w]+g[A],B=x[w]-g[C],R=f?-E[P]/2:0,H=y===z?O[P]:E[P],q=y===z?-E[P]:-O[P],U=t.elements.arrow,W=f&&U?k(U):{width:0,height:0},Q=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},V=Q[A],G=Q[C],$=_e(0,O[P],W[P]),J=b?O[P]/2-R-$-V-j:H-$-V-j,X=b?-O[P]/2+R+$+G+j:q+$+G+j,Y=t.elements.arrow&&D(t.elements.arrow),K=Y?"y"===w?Y.clientTop||0:Y.clientLeft||0:0,ne=t.modifiersData.offset?t.modifiersData.offset[t.placement][w]:0,re=x[w]+J-ne-K,ae=x[w]+X-ne;if(o){var se=_e(f?oe(S,re):S,T,f?ie(B,ae):B);x[w]=se,L[w]=se-T}if(s){var ce="x"===w?I:F,le="x"===w?N:M,ue=x[_],de=ue+g[ce],pe=ue-g[le],fe=_e(f?oe(de,re):de,ue,f?ie(pe,ae):pe);x[_]=fe,L[_]=fe-ue}}t.modifiersData[r]=L}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=Z(n.placement),c=te(s),l=[F,M].indexOf(s)>=0?"height":"width";if(o&&a){var u=function(e,t){return ye("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:be(e,R))}(i.padding,n),d=k(o),p="y"===c?I:F,f="y"===c?N:M,h=n.rects.reference[l]+n.rects.reference[c]-a[c]-n.rects.popper[l],m=a[c]-n.rects.reference[c],g=D(o),v=g?"y"===c?g.clientHeight||0:g.clientWidth||0:0,y=h/2-m/2,b=u[p],w=v-d[l]-u[f],_=v/2-d[l]/2+y,x=_e(b,_,w),O=c;n.modifiersData[r]=((t={})[O]=x,t.centerOffset=x-_,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&he(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=we(t,{elementContext:"reference"}),s=we(t,{altBoundary:!0}),c=xe(a,r),l=xe(s,i,o),u=Oe(c),d=Oe(l);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}}]}),je="tippy-content",Le="tippy-backdrop",ke="tippy-arrow",Ae="tippy-svg-arrow",Ce={passive:!0,capture:!0};function Pe(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function Te(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function Se(e,t){return"function"==typeof e?e.apply(void 0,t):e}function De(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout((function(){e(r)}),t)};var n}function Ie(e){return[].concat(e)}function Ne(e,t){-1===e.indexOf(t)&&e.push(t)}function Me(e){return e.split("-")[0]}function Fe(e){return[].slice.call(e)}function Be(){return document.createElement("div")}function Re(e){return["Element","Fragment"].some((function(t){return Te(e,t)}))}function ze(e){return Te(e,"MouseEvent")}function He(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function qe(e){return Re(e)?[e]:function(e){return Te(e,"NodeList")}(e)?Fe(e):Array.isArray(e)?e:Fe(document.querySelectorAll(e))}function Ue(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function We(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function Qe(e){var t,n=Ie(e)[0];return(null==n||null==(t=n.ownerDocument)?void 0:t.body)?n.ownerDocument:document}function Ve(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[r](t,n)}))}var Ge={isTouch:!1},$e=0;function Je(){Ge.isTouch||(Ge.isTouch=!0,window.performance&&document.addEventListener("mousemove",Xe))}function Xe(){var e=performance.now();e-$e<20&&(Ge.isTouch=!1,document.removeEventListener("mousemove",Xe)),$e=e}function Ye(){var e=document.activeElement;if(He(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var Ke="undefined"!=typeof window&&"undefined"!=typeof document?navigator.userAgent:"",Ze=/MSIE |Trident\//.test(Ke);var et={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},tt=Object.assign({appendTo:function(){return document.body},aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},et,{},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),nt=Object.keys(tt);function rt(e){var t=(e.plugins||[]).reduce((function(t,n){var r=n.name,i=n.defaultValue;return r&&(t[r]=void 0!==e[r]?e[r]:i),t}),{});return Object.assign({},e,{},t)}function it(e,t){var n=Object.assign({},t,{content:Se(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(rt(Object.assign({},tt,{plugins:t}))):nt).reduce((function(t,n){var r=(e.getAttribute("data-tippy-"+n)||"").trim();if(!r)return t;if("content"===n)t[n]=r;else try{t[n]=JSON.parse(r)}catch(e){t[n]=r}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},tt.aria,{},n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}function ot(e,t){e.innerHTML=t}function at(e){var t=Be();return!0===e?t.className=ke:(t.className=Ae,Re(e)?t.appendChild(e):ot(t,e)),t}function st(e,t){Re(t.content)?(ot(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?ot(e,t.content):e.textContent=t.content)}function ct(e){var t=e.firstElementChild,n=Fe(t.children);return{box:t,content:n.find((function(e){return e.classList.contains(je)})),arrow:n.find((function(e){return e.classList.contains(ke)||e.classList.contains(Ae)})),backdrop:n.find((function(e){return e.classList.contains(Le)}))}}function lt(e){var t=Be(),n=Be();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Be();function i(n,r){var i=ct(t),o=i.box,a=i.content,s=i.arrow;r.theme?o.setAttribute("data-theme",r.theme):o.removeAttribute("data-theme"),"string"==typeof r.animation?o.setAttribute("data-animation",r.animation):o.removeAttribute("data-animation"),r.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?o.setAttribute("role",r.role):o.removeAttribute("role"),n.content===r.content&&n.allowHTML===r.allowHTML||st(a,e.props),r.arrow?s?n.arrow!==r.arrow&&(o.removeChild(s),o.appendChild(at(r.arrow))):o.appendChild(at(r.arrow)):s&&o.removeChild(s)}return r.className=je,r.setAttribute("data-state","hidden"),st(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props),{popper:t,onUpdate:i}}lt.$$tippy=!0;var ut=1,dt=[],pt=[];function ft(e,t){var n,r,i,o,a,s,c,l,u,d=it(e,Object.assign({},tt,{},rt((n=t,Object.keys(n).reduce((function(e,t){return void 0!==n[t]&&(e[t]=n[t]),e}),{}))))),p=!1,f=!1,h=!1,m=!1,g=[],v=De($,d.interactiveDebounce),y=ut++,b=(u=d.plugins).filter((function(e,t){return u.indexOf(e)===t})),w={id:y,reference:e,popper:Be(),popperInstance:null,props:d,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:b,clearDelayTimeouts:function(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)},setProps:function(t){0;if(w.state.isDestroyed)return;I("onBeforeUpdate",[w,t]),V();var n=w.props,r=it(e,Object.assign({},w.props,{},t,{ignoreAttributes:!0}));w.props=r,Q(),n.interactiveDebounce!==r.interactiveDebounce&&(F(),v=De($,r.interactiveDebounce));n.triggerTarget&&!r.triggerTarget?Ie(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):r.triggerTarget&&e.removeAttribute("aria-expanded");M(),D(),O&&O(n,r);w.popperInstance&&(K(),ee().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));I("onAfterUpdate",[w,t])},setContent:function(e){w.setProps({content:e})},show:function(){0;var e=w.state.isVisible,t=w.state.isDestroyed,n=!w.state.isEnabled,r=Ge.isTouch&&!w.props.touch,i=Pe(w.props.duration,0,tt.duration);if(e||t||n||r)return;if(C().hasAttribute("disabled"))return;if(I("onShow",[w],!1),!1===w.props.onShow(w))return;w.state.isVisible=!0,A()&&(x.style.visibility="visible");D(),H(),w.state.isMounted||(x.style.transition="none");if(A()){var o=T(),a=o.box,s=o.content;Ue([a,s],0)}c=function(){var e;if(w.state.isVisible&&!m){if(m=!0,x.offsetHeight,x.style.transition=w.props.moveTransition,A()&&w.props.animation){var t=T(),n=t.box,r=t.content;Ue([n,r],i),We([n,r],"visible")}N(),M(),Ne(pt,w),null==(e=w.popperInstance)||e.forceUpdate(),w.state.isMounted=!0,I("onMount",[w]),w.props.animation&&A()&&function(e,t){U(e,t)}(i,(function(){w.state.isShown=!0,I("onShown",[w])}))}},function(){var e,t=w.props.appendTo,n=C();e=w.props.interactive&&t===tt.appendTo||"parent"===t?n.parentNode:Se(t,[n]);e.contains(x)||e.appendChild(x);K(),!1}()},hide:function(){0;var e=!w.state.isVisible,t=w.state.isDestroyed,n=!w.state.isEnabled,r=Pe(w.props.duration,1,tt.duration);if(e||t||n)return;if(I("onHide",[w],!1),!1===w.props.onHide(w))return;w.state.isVisible=!1,w.state.isShown=!1,m=!1,p=!1,A()&&(x.style.visibility="hidden");if(F(),q(),D(),A()){var i=T(),o=i.box,a=i.content;w.props.animation&&(Ue([o,a],r),We([o,a],"hidden"))}N(),M(),w.props.animation?A()&&function(e,t){U(e,(function(){!w.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&t()}))}(r,w.unmount):w.unmount()},hideWithInteractivity:function(e){0;P().addEventListener("mousemove",v),Ne(dt,v),v(e)},enable:function(){w.state.isEnabled=!0},disable:function(){w.hide(),w.state.isEnabled=!1},unmount:function(){0;w.state.isVisible&&w.hide();if(!w.state.isMounted)return;Z(),ee().forEach((function(e){e._tippy.unmount()})),x.parentNode&&x.parentNode.removeChild(x);pt=pt.filter((function(e){return e!==w})),w.state.isMounted=!1,I("onHidden",[w])},destroy:function(){0;if(w.state.isDestroyed)return;w.clearDelayTimeouts(),w.unmount(),V(),delete e._tippy,w.state.isDestroyed=!0,I("onDestroy",[w])}};if(!d.render)return w;var _=d.render(w),x=_.popper,O=_.onUpdate;x.setAttribute("data-tippy-root",""),x.id="tippy-"+w.id,w.popper=x,e._tippy=w,x._tippy=w;var E=b.map((function(e){return e.fn(w)})),j=e.hasAttribute("aria-expanded");return Q(),M(),D(),I("onCreate",[w]),d.showOnCreate&&te(),x.addEventListener("mouseenter",(function(){w.props.interactive&&w.state.isVisible&&w.clearDelayTimeouts()})),x.addEventListener("mouseleave",(function(e){w.props.interactive&&w.props.trigger.indexOf("mouseenter")>=0&&(P().addEventListener("mousemove",v),v(e))})),w;function L(){var e=w.props.touch;return Array.isArray(e)?e:[e,0]}function k(){return"hold"===L()[0]}function A(){var e;return!!(null==(e=w.props.render)?void 0:e.$$tippy)}function C(){return l||e}function P(){var e=C().parentNode;return e?Qe(e):document}function T(){return ct(x)}function S(e){return w.state.isMounted&&!w.state.isVisible||Ge.isTouch||a&&"focus"===a.type?0:Pe(w.props.delay,e?0:1,tt.delay)}function D(){x.style.pointerEvents=w.props.interactive&&w.state.isVisible?"":"none",x.style.zIndex=""+w.props.zIndex}function I(e,t,n){var r;(void 0===n&&(n=!0),E.forEach((function(n){n[e]&&n[e].apply(void 0,t)})),n)&&(r=w.props)[e].apply(r,t)}function N(){var t=w.props.aria;if(t.content){var n="aria-"+t.content,r=x.id;Ie(w.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(n);if(w.state.isVisible)e.setAttribute(n,t?t+" "+r:r);else{var i=t&&t.replace(r,"").trim();i?e.setAttribute(n,i):e.removeAttribute(n)}}))}}function M(){!j&&w.props.aria.expanded&&Ie(w.props.triggerTarget||e).forEach((function(e){w.props.interactive?e.setAttribute("aria-expanded",w.state.isVisible&&e===C()?"true":"false"):e.removeAttribute("aria-expanded")}))}function F(){P().removeEventListener("mousemove",v),dt=dt.filter((function(e){return e!==v}))}function B(e){if(!(Ge.isTouch&&(h||"mousedown"===e.type)||w.props.interactive&&x.contains(e.target))){if(C().contains(e.target)){if(Ge.isTouch)return;if(w.state.isVisible&&w.props.trigger.indexOf("click")>=0)return}else I("onClickOutside",[w,e]);!0===w.props.hideOnClick&&(w.clearDelayTimeouts(),w.hide(),f=!0,setTimeout((function(){f=!1})),w.state.isMounted||q())}}function R(){h=!0}function z(){h=!1}function H(){var e=P();e.addEventListener("mousedown",B,!0),e.addEventListener("touchend",B,Ce),e.addEventListener("touchstart",z,Ce),e.addEventListener("touchmove",R,Ce)}function q(){var e=P();e.removeEventListener("mousedown",B,!0),e.removeEventListener("touchend",B,Ce),e.removeEventListener("touchstart",z,Ce),e.removeEventListener("touchmove",R,Ce)}function U(e,t){var n=T().box;function r(e){e.target===n&&(Ve(n,"remove",r),t())}if(0===e)return t();Ve(n,"remove",s),Ve(n,"add",r),s=r}function W(t,n,r){void 0===r&&(r=!1),Ie(w.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,n,r),g.push({node:e,eventType:t,handler:n,options:r})}))}function Q(){var e;k()&&(W("touchstart",G,{passive:!0}),W("touchend",J,{passive:!0})),(e=w.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(W(e,G),e){case"mouseenter":W("mouseleave",J);break;case"focus":W(Ze?"focusout":"blur",X);break;case"focusin":W("focusout",X)}}))}function V(){g.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,i=e.options;t.removeEventListener(n,r,i)})),g=[]}function G(e){var t,n=!1;if(w.state.isEnabled&&!Y(e)&&!f){var r="focus"===(null==(t=a)?void 0:t.type);a=e,l=e.currentTarget,M(),!w.state.isVisible&&ze(e)&&dt.forEach((function(t){return t(e)})),"click"===e.type&&(w.props.trigger.indexOf("mouseenter")<0||p)&&!1!==w.props.hideOnClick&&w.state.isVisible?n=!0:te(e),"click"===e.type&&(p=!n),n&&!r&&ne(e)}}function $(e){var t=e.target,n=C().contains(t)||x.contains(t);"mousemove"===e.type&&n||function(e,t){var n=t.clientX,r=t.clientY;return e.every((function(e){var t=e.popperRect,i=e.popperState,o=e.props.interactiveBorder,a=Me(i.placement),s=i.modifiersData.offset;if(!s)return!0;var c="bottom"===a?s.top.y:0,l="top"===a?s.bottom.y:0,u="right"===a?s.left.x:0,d="left"===a?s.right.x:0,p=t.top-r+c>o,f=r-t.bottom-l>o,h=t.left-n+u>o,m=n-t.right-d>o;return p||f||h||m}))}(ee().concat(x).map((function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:d}:null})).filter(Boolean),e)&&(F(),ne(e))}function J(e){Y(e)||w.props.trigger.indexOf("click")>=0&&p||(w.props.interactive?w.hideWithInteractivity(e):ne(e))}function X(e){w.props.trigger.indexOf("focusin")<0&&e.target!==C()||w.props.interactive&&e.relatedTarget&&x.contains(e.relatedTarget)||ne(e)}function Y(e){return!!Ge.isTouch&&k()!==e.type.indexOf("touch")>=0}function K(){Z();var t=w.props,n=t.popperOptions,r=t.placement,i=t.offset,o=t.getReferenceClientRect,a=t.moveTransition,s=A()?ct(x).arrow:null,l=o?{getBoundingClientRect:o,contextElement:o.contextElement||C()}:e,u=[{name:"offset",options:{offset:i}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!a}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(A()){var n=T().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?n.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?n.setAttribute("data-"+e,""):n.removeAttribute("data-"+e)})),t.attributes.popper={}}}}];A()&&s&&u.push({name:"arrow",options:{element:s,padding:3}}),u.push.apply(u,(null==n?void 0:n.modifiers)||[]),w.popperInstance=Ee(l,x,Object.assign({},n,{placement:r,onFirstUpdate:c,modifiers:u}))}function Z(){w.popperInstance&&(w.popperInstance.destroy(),w.popperInstance=null)}function ee(){return Fe(x.querySelectorAll("[data-tippy-root]"))}function te(e){w.clearDelayTimeouts(),e&&I("onTrigger",[w,e]),H();var t=S(!0),n=L(),i=n[0],o=n[1];Ge.isTouch&&"hold"===i&&o&&(t=o),t?r=setTimeout((function(){w.show()}),t):w.show()}function ne(e){if(w.clearDelayTimeouts(),I("onUntrigger",[w,e]),w.state.isVisible){if(!(w.props.trigger.indexOf("mouseenter")>=0&&w.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&p)){var t=S(!1);t?i=setTimeout((function(){w.state.isVisible&&w.hide()}),t):o=requestAnimationFrame((function(){w.hide()}))}}else q()}}function ht(e,t){void 0===t&&(t={});var n=tt.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",Je,Ce),window.addEventListener("blur",Ye);var r=Object.assign({},t,{plugins:n}),i=qe(e).reduce((function(e,t){var n=t&&ft(t,r);return n&&e.push(n),e}),[]);return Re(e)?i[0]:i}ht.defaultProps=tt,ht.setDefaultProps=function(e){Object.keys(e).forEach((function(t){tt[t]=e[t]}))},ht.currentInput=Ge;Object.assign({},le,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}});ht.setDefaultProps({render:lt});var mt=ht,gt=n(5),vt=n.n(gt);var yt={controlled:null,bind(e){this.controlled=e,this.controlled.forEach((e=>{this._master(e)})),this._init()},_init(){this.controlled.forEach((e=>{this._checkUp(e)}))},_master(e){const t=JSON.parse(e.dataset.master);e.dataset.size&&(e.filesize=parseInt(e.dataset.size,10)),e.masters=t.map((t=>{const n=document.getElementById(t),r=document.getElementById(t+"_size_wrapper");return r&&(n.filesize=0,n.sizespan=r),this._addChild(n,e),n})),this._bindEvents(e),e.masters.forEach((e=>{this._bindEvents(e)}))},_bindEvents(e){e.eventBound||(e.addEventListener("click",(t=>{const n=t.target;n.elements&&(this._checkDown(n),this._evaluateSize(n)),n.masters&&this._checkUp(e)})),e.eventBound=!0)},_addChild(e,t){const n=e.elements?e.elements:[];-1===n.indexOf(t)&&(n.push(t),e.elements=n)},_removeChild(e,t){const n=e.elements.indexOf(t);-1{t.checked!==e.checked&&(t.checked=e.checked,t.disabled&&(t.checked=!1),t.dispatchEvent(new Event("change")))})),e.elements.forEach((t=>{this._checkDown(t),t.elements||this._checkUp(t,e)})))},_checkUp(e,t){e.masters&&[...e.masters].forEach((e=>{e!==t&&this._evaluateCheckStatus(e),this._checkUp(e),this._evaluateSize(e)}))},_evaluateCheckStatus(e){let t=0,n=e.classList.contains("partial");n&&(e.classList.remove("partial"),n=!1),e.elements.forEach((r=>{null!==r.parentNode?(t+=r.checked,r.classList.contains("partial")&&(n=!0)):this._removeChild(e,r)}));let r="some";t===e.elements.length?r="on":0===t?r="off":n=!0,n&&e.classList.add("partial");const i="off"!==r;e.checked===i&&e.value===r||(e.value=r,e.checked=i,e.dispatchEvent(new Event("change")))},_evaluateSize(e){if(e.sizespan&&e.elements){e.filesize=0,e.elements.forEach((t=>{t.checked&&(e.filesize+=t.filesize)}));let t=null;0=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var _t,xt,Ot,Et,jt=n(1),Lt=n.n(jt);n(0),Lt()(console.error);_t={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1},xt=["(","?"],Ot={")":["("],":":["?","?:"]},Et=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;var kt={"!":function(e){return!e},"*":function(e,t){return e*t},"/":function(e,t){return e/t},"%":function(e,t){return e%t},"+":function(e,t){return e+t},"-":function(e,t){return e-t},"<":function(e,t){return e":function(e,t){return e>t},">=":function(e,t){return e>=t},"==":function(e,t){return e===t},"!=":function(e,t){return e!==t},"&&":function(e,t){return e&&t},"||":function(e,t){return e||t},"?:":function(e,t,n){if(e)throw t;return n}};function At(e){var t=function(e){for(var t,n,r,i,o=[],a=[];t=e.match(Et);){for(n=t[0],(r=e.substr(0,t.index).trim())&&o.push(r);i=a.pop();){if(Ot[n]){if(Ot[n][0]===i){n=Ot[n][1]||n;break}}else if(xt.indexOf(i)>=0||_t[i]<_t[n]){a.push(i);break}o.push(i)}Ot[n]||a.push(n),e=e.substr(t.index+n.length)}return(e=e.trim())&&o.push(e),o.concat(a.reverse())}(e);return function(e){return function(e,t){var n,r,i,o,a,s,c=[];for(n=0;n3&&void 0!==arguments[3]?arguments[3]:10,a=e[t];if(Mt(n)&&Nt(r))if("function"==typeof i)if("number"==typeof o){var s={callback:i,priority:o,namespace:r};if(a[n]){var c,l=a[n].handlers;for(c=l.length;c>0&&!(o>=l[c-1].priority);c--);c===l.length?l[c]=s:l.splice(c,0,s),a.__current.forEach((function(e){e.name===n&&e.currentIndex>=c&&e.currentIndex++}))}else a[n]={handlers:[s],runs:0};"hookAdded"!==n&&e.doAction("hookAdded",n,r,i,o)}else console.error("If specified, the hook priority must be a number.");else console.error("The hook callback must be a function.")}};var Bt=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(r,i){var o=e[t];if(Mt(r)&&(n||Nt(i))){if(!o[r])return 0;var a=0;if(n)a=o[r].handlers.length,o[r]={runs:o[r].runs,handlers:[]};else for(var s=o[r].handlers,c=function(e){s[e].namespace===i&&(s.splice(e,1),a++,o.__current.forEach((function(t){t.name===r&&t.currentIndex>=e&&t.currentIndex--})))},l=s.length-1;l>=0;l--)c(l);return"hookRemoved"!==r&&e.doAction("hookRemoved",r,i),a}}};var Rt=function(e,t){return function(n,r){var i=e[t];return void 0!==r?n in i&&i[n].handlers.some((function(e){return e.namespace===r})):n in i}};function zt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]&&arguments[2];return function(r){var i=e[t];i[r]||(i[r]={handlers:[],runs:0}),i[r].runs++;var o=i[r].handlers;for(var a=arguments.length,s=new Array(a>1?a-1:0),c=1;c1&&void 0!==arguments[1]?arguments[1]:"default";r.data[t]=St(St(St({},Dt),r.data[t]),e),r.data[t][""]=St(St({},Dt[""]),r.data[t][""])},s=function(e,t){a(e,t),o()},c=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;return r.data[e]||a(void 0,e),r.dcnpgettext(e,t,n,i,o)},l=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return e},u=function(e,t,r){var i=c(r,t,e);return n?(i=n.applyFilters("i18n.gettext_with_context",i,e,t,r),n.applyFilters("i18n.gettext_with_context_"+l(r),i,e,t,r)):i};if(e&&s(e,t),n){var d=function(e){It.test(e)&&o()};n.addAction("hookAdded","core/i18n",d),n.addAction("hookRemoved","core/i18n",d)}return{getLocaleData:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return r.data[e]},setLocaleData:s,resetLocaleData:function(e,t){r.data={},r.pluralForms={},s(e,t)},subscribe:function(e){return i.add(e),function(){return i.delete(e)}},__:function(e,t){var r=c(t,void 0,e);return n?(r=n.applyFilters("i18n.gettext",r,e,t),n.applyFilters("i18n.gettext_"+l(t),r,e,t)):r},_x:u,_n:function(e,t,r,i){var o=c(i,void 0,e,t,r);return n?(o=n.applyFilters("i18n.ngettext",o,e,t,r,i),n.applyFilters("i18n.ngettext_"+l(i),o,e,t,r,i)):o},_nx:function(e,t,r,i,o){var a=c(o,i,e,t,r);return n?(a=n.applyFilters("i18n.ngettext_with_context",a,e,t,r,i,o),n.applyFilters("i18n.ngettext_with_context_"+l(o),a,e,t,r,i,o)):a},isRTL:function(){return"rtl"===u("ltr","text direction")},hasTranslation:function(e,t,i){var o,a,s=t?t+""+e:e,c=!(null===(o=r.data)||void 0===o||null===(a=o[null!=i?i:"default"])||void 0===a||!a[s]);return n&&(c=n.applyFilters("i18n.has_translation",c,e,t,i),c=n.applyFilters("i18n.has_translation_"+l(i),c,e,t,i)),c}}}(void 0,void 0,Gt)),Jt=($t.getLocaleData.bind($t),$t.setLocaleData.bind($t),$t.resetLocaleData.bind($t),$t.subscribe.bind($t),$t.__.bind($t));$t._x.bind($t),$t._n.bind($t),$t._nx.bind($t),$t.isRTL.bind($t),$t.hasTranslation.bind($t);function Xt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Yt(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function gn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;if(!t||!Object.keys(t).length)return e;var n=e,r=e.indexOf("?");return-1!==r&&(t=Object.assign(hn(e),t),n=n.substr(0,r)),n+"?"+vn(t)}function bn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function wn(e){for(var t=1;t]+)>; rel="next"/);return t?{next:t[1]}:{}}(e.headers.get("link")).next},On=function(e){var t=!!e.path&&-1!==e.path.indexOf("per_page=-1"),n=!!e.url&&-1!==e.url.indexOf("per_page=-1");return t||n},En=function(){var e,t=(e=un.a.mark((function e(t,n){var r,i,o,a,s,c;return un.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!1!==t.parse){e.next=2;break}return e.abrupt("return",n(t));case 2:if(On(t)){e.next=4;break}return e.abrupt("return",n(t));case 4:return e.next=6,Wn(wn(wn({},(u={per_page:100},d=void 0,p=void 0,d=(l=t).path,p=l.url,wn(wn({},wt(l,["path","url"])),{},{url:p&&yn(p,u),path:d&&yn(d,u)}))),{},{parse:!1}));case 6:return r=e.sent,e.next=9,_n(r);case 9:if(i=e.sent,Array.isArray(i)){e.next=12;break}return e.abrupt("return",i);case 12:if(o=xn(r)){e.next=15;break}return e.abrupt("return",i);case 15:a=[].concat(i);case 16:if(!o){e.next=27;break}return e.next=19,Wn(wn(wn({},t),{},{path:void 0,url:o,parse:!1}));case 19:return s=e.sent,e.next=22,_n(s);case 22:c=e.sent,a=a.concat(c),o=xn(s),e.next=16;break;case 27:return e.abrupt("return",a);case 28:case"end":return e.stop()}var l,u,d,p}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){cn(o,r,i,a,s,"next",e)}function s(e){cn(o,r,i,a,s,"throw",e)}a(void 0)}))});return function(e,n){return t.apply(this,arguments)}}();function jn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ln(e){for(var t=1;t1&&void 0!==arguments[1])||arguments[1];return t?204===e.status?null:e.json?e.json():Promise.reject(e):e},Pn=function(e){var t={code:"invalid_json",message:Jt("The response is not a valid JSON response.")};if(!e||!e.json)throw t;return e.json().catch((function(){throw t}))},Tn=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Promise.resolve(Cn(e,t)).catch((function(e){return Sn(e,t)}))};function Sn(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!t)throw e;return Pn(e).then((function(e){var t={code:"unknown_error",message:Jt("An unknown error occurred.")};throw e||t}))}function Dn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function In(e){for(var t=1;t=500&&t.status<600&&n?r(n).catch((function(){return!1!==e.parse?Promise.reject({code:"post_process",message:Jt("Media upload failed. If this is a photo or a large image, please scale it down and try again.")}):Promise.reject(t)})):Sn(t,e.parse)})).then((function(t){return Tn(t,e.parse)}))};function Mn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Fn(e){for(var t=1;t=200&&e.status<300)return e;throw e},qn=function(e){var t=e.url,n=e.path,r=e.data,i=e.parse,o=void 0===i||i,a=wt(e,["url","path","data","parse"]),s=e.body,c=e.headers;return c=Fn(Fn({},Bn),c),r&&(s=JSON.stringify(r),c["Content-Type"]="application/json"),window.fetch(t||n||window.location.href,Fn(Fn(Fn({},Rn),a),{},{body:s,headers:c})).then((function(e){return Promise.resolve(e).then(Hn).catch((function(e){return Sn(e,o)})).then((function(e){return Tn(e,o)}))}),(function(){throw{code:"fetch_error",message:Jt("You are probably offline.")}}))};function Un(e){return zn.reduceRight((function(e,t){return function(n){return t(n,e)}}),qn)(e).catch((function(t){return"rest_cookie_invalid_nonce"!==t.code?Promise.reject(t):window.fetch(Un.nonceEndpoint).then(Hn).then((function(e){return e.text()})).then((function(t){return Un.nonceMiddleware.nonce=t,Un(e)}))}))}Un.use=function(e){zn.unshift(e)},Un.setFetchHandler=function(e){qn=e},Un.createNonceMiddleware=Kt,Un.createPreloadingMiddleware=sn,Un.createRootURLMiddleware=on,Un.fetchAllMiddleware=En,Un.mediaUploadMiddleware=Nn;var Wn=Un;Lt()(console.error);function Qn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Vn(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:"default";Jn.data[t]=Vn(Vn(Vn({},Zn),Jn.data[t]),e),Jn.data[t][""]=Vn(Vn({},Zn[""]),Jn.data[t][""])},Yn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;return Jn.data[e]||Xn(void 0,e),Jn.dcnpgettext(e,t,n,r,i)},Kn=function(e,t,n){return Yn(n,t,e)},Gn&&Xn(Gn,$n),{setLocaleData:Xn,__:function(e,t){return Yn(t,void 0,e)},_x:Kn,_n:function(e,t,n,r){return Yn(r,void 0,e,t,n)},_nx:function(e,t,n,r,i){return Yn(i,r,e,t,n)},isRTL:function(){return"rtl"===Kn("ltr","text direction")}}),tr=(er.setLocaleData.bind(er),er.__.bind(er));er._x.bind(er),er._n.bind(er),er._nx.bind(er),er.isRTL.bind(er);var nr={cachePoints:{},spinners:{},init(e){if("undefined"!=typeof CLDCACHE){Wn.use(Wn.createNonceMiddleware(CLDCACHE.nonce));e.querySelectorAll("[data-cache-point]").forEach((e=>this._bind(e)));const t=e.getElementById("cld_purge_all");t&&(t.disabled="disabled",t.style.width="100px",t.style.transition="width 0.5s",t.addEventListener("click",(()=>{t.dataset.purging||confirm(wp.i18n.__("Purge entire cache?","cloudinary"))&&this._purgeAll(t,!1)})),this._watchPurge(t),setInterval((()=>{this._watchPurge(t)}),5e3))}},getCachePoint(e){return this.cachePoints["_"+e]?this.cachePoints["_"+e]:null},setCachePoint(e,t){const n=document.createElement("div"),r=this._getRow(),i=document.createElement("td");i.colSpan=2,i.className="cld-loading",r.appendChild(i);const o=document.getElementById(t.dataset.slug),a=document.getElementById(t.dataset.slug+"_search"),s=document.getElementById(t.dataset.slug+"_reload"),c=document.getElementById(t.dataset.browser),l=document.getElementById(t.dataset.apply);l.style.float="right",l.style.marginLeft="6px",c.addEventListener("change",(t=>{this._handleManager(e)})),window.addEventListener("CacheToggle",(e=>{e.detail.cachePoint===t&&this._cacheChange(t,e.detail)})),l.addEventListener("click",(e=>{this._applyChanges(t)})),s.addEventListener("click",(t=>{this._load(e)})),a.addEventListener("keydown",(t=>{13===t.which&&(t.preventDefault(),t.stopPropagation(),this._load(e))})),n.className="cld-pagenav",l.cacheChanges={disable:[],enable:[],delete:[]},t.master=o,t.search=a,t.controller=c,t.viewer=t.parentNode.parentNode,t.loader=r,t.table=t.parentNode,t.apply=l,t.paginate=n,t.currentPage=1,t.viewer.appendChild(n),this.cachePoints["_"+e]=t},close(e){e.classList.add("closed")},open(e){e.classList.remove("closed")},isOpen(e){const t=this.getCachePoint(e);let n=!1;return t&&(n=t.controller.checked&&t.master.checked),n},_bind(e){const t=e.dataset.cachePoint;this.setCachePoint(t,e),this._handleManager(t)},_handleManager(e){const t=this.getCachePoint(e);t&&(this.isOpen(e)?(this.open(t.viewer),t.loaded||this._load(e)):(this.close(t.viewer),t.controller.checked=!1))},_load(e){const t=this.getCachePoint(e);let n="100px";t.clientHeight&&(n=t.clientHeight-16+"px"),this._clearChildren(t),t.appendChild(t.loader),this.open(t.loader),t.loader.firstChild.style.height=n,Wn({path:CLDCACHE.fetch_url,data:{ID:e,page:t.currentPage,search:t.search.value},method:"POST"}).then((e=>{t.removeChild(t.loader),this._buildList(t,e.items),this._buildNav(t,e);const n=t.querySelectorAll("[data-master]");yt.bind(n),t.loaded=!0}))},_cacheChange(e,t){const n=t.checked?t.states.on:t.states.off,r=t.checked?t.states.off:t.states.on;this._removeFromList(e,t.item.ID,r)||this._addToList(e,t.item.ID,n),this._evaluateApply(e)},_evaluateApply(e){e.apply.disabled="disabled";const t=e.apply.cacheChanges;let n=!1;for(const e in t)t[e].length&&(n=!0);n&&(e.apply.disabled="")},_applyChanges(e){const t=e.apply.cacheChanges;e.apply.disabled="disabled";for(const n in t)t[n].length&&this._set_state(e,n,t[n])},_watchPurge(e){e.dataset.purging||e.dataset.updating||(e.dataset.updating=!0,Wn({path:CLDCACHE.purge_all,data:{count:!0},method:"POST"}).then((t=>{e.dataset.updating="",0t.percent?(e.disabled="",this._purgeAll(e,!0)):0{e.innerText=tr("Purging cache","cloudinary")+" "+Math.round(t.percent,2)+"%",e.style.backgroundImage="linear-gradient(90deg, #2a0 "+t.percent+"%, #787878 "+t.percent+"%)",100>t.percent?this._purgeAction(e,!0,n):n?n():(e.innerText=wp.i18n.__("Purge complete.","cloudinary"),setTimeout((()=>{e.dataset.purging="",e.style.backgroundImage="",e.style.minHeight="",e.style.border="",e.style.width="100px",e.disabled="disabled",e.innerText=e.dataset.title}),2e3))}))},_set_state(e,t,n){this._showSpinners(n),Wn({path:CLDCACHE.update_url,data:{state:t,ids:n},method:"POST"}).then((n=>{this._hideSpinners(n),n.forEach((n=>{this._removeFromList(e,n,t),this._evaluateApply(e),e.apply.disabled="disabled"})),"delete"===t&&this._load(e.dataset.cachePoint)}))},_showSpinners(e){e.forEach((e=>{this.spinners["spinner_"+e].style.visibility="visible"}))},_hideSpinners(e){e.forEach((e=>{this.spinners["spinner_"+e].style.visibility="hidden"}))},_removeFromList(e,t,n){const r=this._getListIndex(e,t,n);let i=!1;return-1e.apply.cacheChanges[n].indexOf(t),_noCache(e){const t=this._getNote(wp.i18n.__("No files cached.","cloudinary"));e.viewer.appendChild(t),this.close(e.table)},_clearChildren(e){for(;e.children.length;){const t=e.lastChild;t.children.length&&this._clearChildren(t),e.removeChild(t)}},_buildList(e,t){t.forEach((t=>{if(t.note)return void e.appendChild(this._getNote(t.note));const n=this._getRow(t.ID),r=this._getStateSwitch(e,t,{on:"enable",off:"disable"}),i=this._getFile(e,t,n);n.appendChild(i),n.appendChild(r),e.appendChild(n)}))},_buildNav(e,t){e.paginate.innerHTML="";const n=document.createElement("button"),r=document.createElement("button");n.type="button",n.innerHTML="‹",n.className="button cld-pagenav-prev",1===t.current_page?n.disabled=!0:n.addEventListener("click",(n=>{e.currentPage=t.current_page-1,this._load(e.dataset.cachePoint)})),r.type="button",r.innerHTML="›",r.className="button cld-pagenav-next",t.current_page===t.total_pages||0===t.total_pages?r.disabled=!0:r.addEventListener("click",(n=>{e.currentPage=t.current_page+1,this._load(e.dataset.cachePoint)}));const i=document.createElement("span");if(i.innerText=t.nav_text,i.className="cld-pagenav-text",e.paginate.appendChild(n),e.paginate.appendChild(i),e.paginate.appendChild(r),e.paginate.appendChild(e.apply),e.apply.classList.remove("closed"),e.apply.disabled="disabled",t.items.length){const t=document.createElement("button");t.type="button",t.className="button",t.innerText=wp.i18n.__("Purge cache point","cloudinary"),t.style.float="right",e.paginate.appendChild(t),t.addEventListener("click",(n=>{if(confirm(wp.i18n.__("Purge entire cache point?","cloudinary"))){t.dataset.parent=e.dataset.cachePoint;const n=this;t.classList.add("button-primary"),this._purgeAll(t,!1,(function(){n._load(e.dataset.cachePoint)}))}}))}},_getNote(e){const t=this._getRow(),n=document.createElement("td");return n.colSpan=2,n.innerText=e,t.appendChild(n),t},_getRow(e){const t=document.createElement("tr");return e&&(t.id="row_"+e),t},_getFile(e,t){const n=document.createElement("td"),r=document.createElement("label"),i=this._getDeleter(e,n,t);r.innerText=t.short_url,r.htmlFor=t.key,n.appendChild(i),n.appendChild(r);const o=document.createElement("span"),a="spinner_"+t.ID;return o.className="spinner",o.id=a,n.appendChild(o),this.spinners[a]=o,n},_getDeleter(e,t,n){const r=document.createElement("input"),i=[e.dataset.slug+"_deleter"],o=this._getListIndex(e,n.ID,"delete");return r.type="checkbox",r.value=n.ID,r.id=n.key,r.dataset.master=JSON.stringify(i),-1{t.style.opacity=1,t.style.textDecoration="",r.checked&&(t.style.opacity=.8,t.style.textDecoration="line-through");const o=new CustomEvent("CacheToggle",{detail:{checked:r.checked,states:{on:"delete",off:n.active?"enable":"disable"},item:n,cachePoint:e}});window.dispatchEvent(o)})),r},_getStateSwitch(e,t,n){const r=document.createElement("td"),i=document.createElement("label"),o=document.createElement("input"),a=document.createElement("span"),s=(e.dataset.slug,this._getListIndex(e,t.ID,"disable"));return r.style.textAlign="right",i.className="cld-input-on-off-control mini",o.type="checkbox",o.value=t.ID,o.checked=!(-1{const i=new CustomEvent("CacheToggle",{detail:{checked:o.checked,states:n,item:t,cachePoint:e}});window.dispatchEvent(i)})),r.appendChild(i),r}};const rr={bindings:{},parent_check_data:{},check_parents:{},_init(e){const t=e.querySelectorAll("[data-condition]"),n=e.querySelectorAll("[data-toggle]"),r=e.querySelectorAll("[data-for]"),i=e.querySelectorAll("[data-tooltip]"),o=e.querySelectorAll("[data-bind-trigger]"),a=e.querySelectorAll("[data-master]"),s=e.querySelectorAll("[data-file]"),c=e.querySelectorAll("[data-auto-suffix]"),l={};yt.bind(a),c.forEach((e=>this._autoSuffix(e))),o.forEach((e=>this._trigger(e))),n.forEach((e=>this._toggle(e))),t.forEach((e=>this._bind(e))),r.forEach((e=>this._alias(e))),s.forEach((e=>this._files(e,l))),mt(i,{theme:"cloudinary",arrow:!1,placement:"bottom-start",aria:{content:"auto",expanded:"auto"},content:t=>e.getElementById(t.getAttribute("data-tooltip")).innerHTML}),[...o].forEach((e=>{e.dispatchEvent(new Event("input"))})),nr.init(e)},_autoSuffix(e){const t=e.dataset.autoSuffix;let n="";const r=[...t.split(";")].map((e=>0===e.indexOf("*")?(n=e.replace("*",""),n):e));e.addEventListener("change",(()=>{const t=e.value.replace(" ",""),i=t.replace(/[^0-9]/g,""),o=t.replace(/[0-9]/g,"").toLowerCase();i&&(-1===r.indexOf(o)?e.value=i+n:e.value=i+o)})),e.dispatchEvent(new Event("change"))},_files(e,t){const n=e.dataset.parent;n&&(this.check_parents[n]=document.getElementById(n),this.parent_check_data[n]||(this.parent_check_data[n]=this.check_parents[n].value?JSON.parse(this.check_parents[n].value):[]),e.addEventListener("change",(()=>{const r=this.parent_check_data[n].indexOf(e.value);e.checked?this.parent_check_data[n].push(e.value):this.parent_check_data[n].splice(r,1),t[n]&&clearTimeout(t[n]),t[n]=setTimeout((()=>{this._compileParent(n)}),10)})))},_compileParent(e){this.check_parents[e].value=JSON.stringify(this.parent_check_data[e]),this.check_parents[e].dispatchEvent(new Event("change"))},_bind(e){e.condition=JSON.parse(e.dataset.condition);for(const t in e.condition)this.bindings[t]&&this.bindings[t].elements.push(e)},_trigger(e){const t=e.dataset.bindTrigger,n=this;n.bindings[t]={input:e,value:e.value,checked:!0,elements:[]},e.addEventListener("change",(function(t){e.dispatchEvent(new Event("input"))})),e.addEventListener("input",(function(){if(n.bindings[t].value=e.value,"checkbox"===e.type&&(n.bindings[t].checked=e.checked),"radio"!==e.type||!1!==e.checked)for(const r in n.bindings[t].elements)n.toggle(n.bindings[t].elements[r],e)}))},_alias(e){e.addEventListener("click",(function(){document.getElementById(e.dataset.for).dispatchEvent(new Event("click"))}))},_toggle(e){const t=this;e.addEventListener("click",(function(n){n.stopPropagation();const r=document.querySelector('[data-wrap="'+e.dataset.toggle+'"]'),i=r.classList.contains("open")?"closed":"open";t.toggle(r,e,i)}))},toggle(e,t,n){if(!n){n="open";for(const t in e.condition){let r=this.bindings[t].value;const i=e.condition[t];"boolean"==typeof i&&(r=this.bindings[t].checked),i!==r&&(n="closed")}}const r=e.getElementsByClassName("cld-ui-input");"closed"===n?(e.classList.remove("open"),e.classList.add("closed"),t&&t.classList.contains("dashicons")&&(t.classList.remove("dashicons-arrow-up-alt2"),t.classList.add("dashicons-arrow-down-alt2")),[...r].forEach((function(e){e.dataset.disabled=!0}))):(e.classList.remove("closed"),e.classList.add("open"),t&&t.classList.contains("dashicons")&&(t.classList.remove("dashicons-arrow-down-alt2"),t.classList.add("dashicons-arrow-up-alt2")),[...r].forEach((function(e){e.dataset.disabled=!1})))}},ir=document.getElementById("cloudinary-settings-page");ir&&window.addEventListener("load",rr._init(ir));var or=rr;n.p,n.p,n.p,n.p,n.p,n.p,n.p,n.p,n.p,n.p,n.p,n.p,n.p;window.$=window.jQuery;const ar={UI:or,Settings:i.a,Widget:a.a,GlobalTransformations:c,TermsOrder:u,MediaLibrary:p,Notices:h}}]); \ No newline at end of file