diff --git a/.version b/.version index 06eda28ac..9b7a431d9 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -3.2.3 \ No newline at end of file +3.2.4 \ No newline at end of file diff --git a/js/block-editor.asset.php b/js/block-editor.asset.php index 07b40714e..f777d63a8 100644 --- a/js/block-editor.asset.php +++ b/js/block-editor.asset.php @@ -1 +1 @@ - array('react', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-plugins'), 'version' => '8f1f83558398bdc930fd'); + array('react', 'wp-api-fetch', 'wp-components', 'wp-data', 'wp-i18n'), 'version' => 'c8e1eb2b75a7df74cf6a'); diff --git a/js/block-editor.js b/js/block-editor.js index f9bba1587..d03bdcb7a 100644 --- a/js/block-editor.js +++ b/js/block-editor.js @@ -1 +1 @@ -!function(){"use strict";var e=window.React,t=window.wp.i18n,r=window.wp.data,i=window.wp.components;const o={_init(){"undefined"!=typeof CLD_VIDEO_PLAYER&&wp.hooks.addFilter("blocks.registerBlockType","Cloudinary/Media/Video",(function(e,t){return"core/video"===t&&("off"!==CLD_VIDEO_PLAYER.video_autoplay_mode&&(e.attributes.autoplay.default=!0),"on"===CLD_VIDEO_PLAYER.video_loop&&(e.attributes.loop.default=!0),"off"===CLD_VIDEO_PLAYER.video_controls&&(e.attributes.controls.default=!1)),e}))}};o._init();wp.hooks.addFilter("blocks.registerBlockType","cloudinary/addAttributes",(function(e,t){return"core/image"!==t&&"core/video"!==t||(e.attributes||(e.attributes={}),e.attributes.overwrite_transformations={type:"boolean"},e.attributes.transformations={type:"boolean"}),e}));const a=r=>{const{attributes:{overwrite_transformations:o},setAttributes:a}=r;return(0,e.createElement)(i.PanelBody,{title:(0,t.__)("Transformations","cloudinary")},(0,e.createElement)(i.ToggleControl,{label:(0,t.__)("Overwrite Global Transformations","cloudinary"),checked:o,onChange:e=>{a({overwrite_transformations:e})}}))};let n=t=>{const{setAttributes:r,media:i}=t,{InspectorControls:o}=wp.editor;return i&&i.transformations&&r({transformations:!0}),(0,e.createElement)(o,null,(0,e.createElement)(a,{...t}))};n=(0,r.withSelect)(((e,t)=>({...t,media:t.attributes.id?e("core").getMedia(t.attributes.id):null})))(n);wp.hooks.addFilter("editor.BlockEdit","cloudinary/filterEdit",(t=>r=>{const{name:i}=r,o="core/image"===i||"core/video"===i;return(0,e.createElement)(e.Fragment,null,o?(0,e.createElement)(n,{...r}):null,(0,e.createElement)(t,{...r}))}),20);let s=r=>(0,e.createElement)(e.Fragment,null,r.modalClass&&(0,e.createElement)(i.ToggleControl,{label:(0,t.__)("Overwrite Cloudinary Global Transformations","cloudinary"),checked:r.overwrite_featured_transformations,onChange:e=>r.setOverwrite(e),className:"cloudinary-overwrite-transformations"}));s=(0,r.withSelect)((e=>{var t;return{overwrite_featured_transformations:null!==(t=e("core/editor")?.getEditedPostAttribute("meta")._cloudinary_featured_overwrite)&&void 0!==t&&t}}))(s),s=(0,r.withDispatch)((e=>({setOverwrite:t=>{e("core/editor").editPost({meta:{_cloudinary_featured_overwrite:t}})}})))(s);const l=t=>class extends t{render(){return(0,e.createElement)(e.Fragment,null,super.render(),!!this.props.value&&(0,e.createElement)(s,{...this.props}))}},d={_init(){wp.hooks.addFilter("editor.MediaUpload","cloudinary/filter-featured-image",l)}};d._init();const c={wrapper:null,query:{per_page:-1,orderby:"name",order:"asc",_fields:"id,name,parent",context:"view"},available:{},taxonomies:null,fetchWait:null,_init(){this.wrapper=document.getElementById("cld-tax-items");const{getTaxonomies:e}=(0,r.select)("core");this.fetchWait=setInterval((()=>{this.taxonomies=e(),this.taxonomies&&(clearInterval(this.fetchWait),this._init_listeners())}),1e3)},_init_listeners(){this.taxonomies.forEach((e=>{e.rest_base&&e.visibility.public&&(0,r.subscribe)((()=>{const t=e.slug,i=e.hierarchical,{isResolving:o}=(0,r.select)("core/data"),a=["taxonomy",t,this.query];this.available[t]=null,i&&(this.available[t]=(0,r.select)("core").getEntityRecords("taxonomy",t,this.query)),o("core","getEntityRecords",a)||this.event(e)}))}))},event(e){const t=(0,r.select)("core/editor").getEditedPostAttribute(e.rest_base);if(!t)return;const i=[...t],o=Array.from(this.wrapper.querySelectorAll(`[data-item*="${e.slug}"]`));[...i].forEach((t=>{const r=this.wrapper.querySelector(`[data-item="${e.slug}:${t}"]`);o.splice(o.indexOf(r),1),null===r&&this.createItem(this.getItem(e,t))})),o.forEach((e=>{e.parentNode.removeChild(e)}))},createItem(e){if(!e||!e.id)return;const t=document.createElement("li"),r=document.createElement("span"),i=document.createElement("input"),o=document.createTextNode(e.name);t.classList.add("cld-tax-order-list-item"),t.dataset.item=`${e.taxonomy}:${e.id}`,i.classList.add("cld-tax-order-list-item-input"),i.type="hidden",i.name="cld_tax_order[]",i.value=`${e.taxonomy}:${e.id}`,r.className="dashicons dashicons-menu cld-tax-order-list-item-handle",t.appendChild(r),t.appendChild(i),t.appendChild(o),this.wrapper.appendChild(t)},getItem(e,t){let i={};if(null===this.available[e.slug])i=(0,r.select)("core").getEntityRecord("taxonomy",e.slug,t);else for(const r of this.available[e.slug])if(r.id===t){i=r,i.taxonomy=e.slug;break}return i}};window.addEventListener("load",(()=>c._init()));var u=window.wp.plugins,m=window.wp.element;const p=()=>{const e=(0,r.useSelect)((e=>e("core/editor").isSavingPost())),t=(0,r.useSelect)((e=>e("core/editor").isEditedPostDirty())),{storage:i}=window?.CLDN||null;(0,m.useEffect)((()=>{e&&!t&&"cld"===i&&window.location.reload()}),[e])};(0,u.registerPlugin)("cloudinary-maybe-reload-after-save",{render:p});window.$=window.jQuery}(); \ No newline at end of file +!function(){"use strict";var e={n:function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,{a:r}),r},d:function(t,r){for(var o in r)e.o(r,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:r[o]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},t=window.wp.apiFetch,r=e.n(t),o=window.React,i=window.wp.i18n,a=window.wp.data,n=window.wp.components;const l={_init(){"undefined"!=typeof CLD_VIDEO_PLAYER&&wp.hooks.addFilter("blocks.registerBlockType","Cloudinary/Media/Video",(function(e,t){return"core/video"===t&&("off"!==CLD_VIDEO_PLAYER.video_autoplay_mode&&(e.attributes.autoplay.default=!0),"on"===CLD_VIDEO_PLAYER.video_loop&&(e.attributes.loop.default=!0),"off"===CLD_VIDEO_PLAYER.video_controls&&(e.attributes.controls.default=!1)),e}))}};l._init();wp.hooks.addFilter("blocks.registerBlockType","cloudinary/addAttributes",(function(e,t){return"core/image"!==t&&"core/video"!==t||(e.attributes||(e.attributes={}),e.attributes.overwrite_transformations={type:"boolean"},e.attributes.transformations={type:"boolean"}),e}));const s=e=>{const{attributes:{overwrite_transformations:t},setAttributes:r}=e;return(0,o.createElement)(n.PanelBody,{title:(0,i.__)("Transformations","cloudinary")},(0,o.createElement)(n.ToggleControl,{label:(0,i.__)("Overwrite Global Transformations","cloudinary"),checked:t,onChange:e=>{r({overwrite_transformations:e})}}))};let d=e=>{const{setAttributes:t,media:r}=e,{InspectorControls:i}=wp.editor;return r&&r.transformations&&t({transformations:!0}),(0,o.createElement)(i,null,(0,o.createElement)(s,{...e}))};d=(0,a.withSelect)(((e,t)=>({...t,media:t.attributes.id?e("core").getMedia(t.attributes.id):null})))(d);wp.hooks.addFilter("editor.BlockEdit","cloudinary/filterEdit",(e=>t=>{const{name:r}=t,i="core/image"===r||"core/video"===r;return(0,o.createElement)(o.Fragment,null,i?(0,o.createElement)(d,{...t}):null,(0,o.createElement)(e,{...t}))}),20);let c=e=>(0,o.createElement)(o.Fragment,null,e.modalClass&&(0,o.createElement)(n.ToggleControl,{label:(0,i.__)("Overwrite Cloudinary Global Transformations","cloudinary"),checked:e.overwrite_featured_transformations,onChange:t=>e.setOverwrite(t),className:"cloudinary-overwrite-transformations"}));c=(0,a.withSelect)((e=>{var t;return{overwrite_featured_transformations:null!==(t=e("core/editor")?.getEditedPostAttribute("meta")._cloudinary_featured_overwrite)&&void 0!==t&&t}}))(c),c=(0,a.withDispatch)((e=>({setOverwrite:t=>{e("core/editor").editPost({meta:{_cloudinary_featured_overwrite:t}})}})))(c);const u=e=>class extends e{render(){return(0,o.createElement)(o.Fragment,null,super.render(),!!this.props.value&&(0,o.createElement)(c,{...this.props}))}},m={_init(){wp.hooks.addFilter("editor.MediaUpload","cloudinary/filter-featured-image",u)}};m._init();const p={wrapper:null,query:{per_page:-1,orderby:"name",order:"asc",_fields:"id,name,parent",context:"view"},available:{},taxonomies:null,fetchWait:null,_init(){this.wrapper=document.getElementById("cld-tax-items");const{getTaxonomies:e}=(0,a.select)("core");this.fetchWait=setInterval((()=>{this.taxonomies=e(),this.taxonomies&&(clearInterval(this.fetchWait),this._init_listeners())}),1e3)},_init_listeners(){this.taxonomies.forEach((e=>{e.rest_base&&e.visibility.public&&(0,a.subscribe)((()=>{const t=e.slug,r=e.hierarchical,{isResolving:o}=(0,a.select)("core/data"),i=["taxonomy",t,this.query];this.available[t]=null,r&&(this.available[t]=(0,a.select)("core").getEntityRecords("taxonomy",t,this.query)),o("core","getEntityRecords",i)||this.event(e)}))}))},event(e){const t=(0,a.select)("core/editor").getEditedPostAttribute(e.rest_base);if(!t)return;const r=[...t],o=Array.from(this.wrapper.querySelectorAll(`[data-item*="${e.slug}"]`));[...r].forEach((t=>{const r=this.wrapper.querySelector(`[data-item="${e.slug}:${t}"]`);o.splice(o.indexOf(r),1),null===r&&this.createItem(this.getItem(e,t))})),o.forEach((e=>{e.parentNode.removeChild(e)}))},createItem(e){if(!e||!e.id)return;const t=document.createElement("li"),r=document.createElement("span"),o=document.createElement("input"),i=document.createTextNode(e.name);t.classList.add("cld-tax-order-list-item"),t.dataset.item=`${e.taxonomy}:${e.id}`,o.classList.add("cld-tax-order-list-item-input"),o.type="hidden",o.name="cld_tax_order[]",o.value=`${e.taxonomy}:${e.id}`,r.className="dashicons dashicons-menu cld-tax-order-list-item-handle",t.appendChild(r),t.appendChild(o),t.appendChild(i),this.wrapper.appendChild(t)},getItem(e,t){let r={};if(null===this.available[e.slug])r=(0,a.select)("core").getEntityRecord("taxonomy",e.slug,t);else for(const o of this.available[e.slug])if(o.id===t){r=o,r.taxonomy=e.slug;break}return r}};window.addEventListener("load",(()=>p._init()));window.$=window.jQuery,r().use(((e,t)=>{if("cors"===e.mode)return t(e);if(e.url)try{const r=new URL(e.url,location.href);if(r.protocol!==location.protocol||r.hostname!==location.hostname||r.port!==location.port)return t(e)}catch{return t(e)}return e.headers||(e.headers={}),e.headers["x-cld-fetch-from-editor"]="true",t(e)}))}(); \ No newline at end of file diff --git a/js/front-overlay.js b/js/front-overlay.js index bcc167f88..af1ce719a 100644 --- a/js/front-overlay.js +++ b/js/front-overlay.js @@ -1 +1 @@ -!function(){var e={616:function(e){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;a=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)||f&&!s.sign?l="":(l=f?"+":"-",n=n.toString().replace(i.sign,"")),u=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",p=s.width-(l+n).length,c=s.width&&p>0?u.repeat(p):"",m+=s.align?l+n+c:"0"===u?l+c+n:c+l+n)}return m}(function(e){if(s[e])return s[e];var t,n=e,r=[],o=0;for(;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=[],c=t[2],u=[];if(null===(u=i.key.exec(c)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(a.push(u[1]);""!==(c=c.substring(u[0].length));)if(null!==(u=i.key_access.exec(c)))a.push(u[1]);else{if(null===(u=i.index_access.exec(c)))throw new SyntaxError("[sprintf] failed to parse named argument key");a.push(u[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 s[e]=r}(e),arguments)}function a(e,t){return o.apply(null,[e].concat(t||[]))}var s=Object.create(null);o,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))}()}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){"use strict";var e,t,r,i,o=n(616),a=n.n(o);n(604),a()(console.error);function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function c(e){var t=function(e,t){if("object"!=s(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==s(t)?t:t+""}e={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1},t=["(","?"],r={")":["("],":":["?","?:"]},i=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;var u={"!":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 p(n){var o=function(n){for(var o,a,s,c,u=[],p=[];o=n.match(i);){for(a=o[0],(s=n.substr(0,o.index).trim())&&u.push(s);c=p.pop();){if(r[a]){if(r[a][0]===c){a=r[a][1]||a;break}}else if(t.indexOf(c)>=0||e[c]3&&void 0!==arguments[3]?arguments[3]:10,a=e[t];if(y(n)&&g(r))if("function"==typeof i)if("number"==typeof o){var s={callback:i,priority:o,namespace:r};if(a[n]){var c,u=a[n].handlers;for(c=u.length;c>0&&!(o>=u[c-1].priority);c--);c===u.length?u[c]=s:u.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 x=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(r,i){var o=e[t];if(y(r)&&(n||g(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--})))},u=s.length-1;u>=0;u--)c(u);return"hookRemoved"!==r&&e.doAction("hookRemoved",r,i),a}}};var w=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}};var O=function(e,t){var n=arguments.length>2&&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]=h(h(h({},m),r.data[t]),e),r.data[t][""]=h(h({},m[""]),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)},u=function(){return arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default"},p=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_"+u(r),i,e,t,r)):i};if(e&&s(e,t),n){var f=function(e){v.test(e)&&o()};n.addAction("hookAdded","core/i18n",f),n.addAction("hookRemoved","core/i18n",f)}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_"+u(t),r,e,t)):r},_x:p,_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_"+u(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_"+u(o),a,e,t,r,i,o)):a},isRTL:function(){return"rtl"===p("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_"+u(i),c,e,t,i)),c}}}(void 0,void 0,k)),L=(j.getLocaleData.bind(j),j.setLocaleData.bind(j),j.resetLocaleData.bind(j),j.subscribe.bind(j),j.__.bind(j));j._x.bind(j),j._n.bind(j),j._nx.bind(j),j.isRTL.bind(j),j.hasTranslation.bind(j);function D(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function C(e){return e instanceof D(e).Element||e instanceof Element}function S(e){return e instanceof D(e).HTMLElement||e instanceof HTMLElement}function F(e){return"undefined"!=typeof ShadowRoot&&(e instanceof D(e).ShadowRoot||e instanceof ShadowRoot)}var P=Math.max,I=Math.min,M=Math.round;function R(){var e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function H(){return!/^((?!chrome|android).)*safari/i.test(R())}function V(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&S(e)&&(i=e.offsetWidth>0&&M(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&M(r.height)/e.offsetHeight||1);var a=(C(e)?D(e):window).visualViewport,s=!H()&&n,c=(r.left+(s&&a?a.offsetLeft:0))/i,u=(r.top+(s&&a?a.offsetTop:0))/o,p=r.width/i,f=r.height/o;return{width:p,height:f,top:u,right:c+p,bottom:u+f,left:c,x:c,y:u}}function W(e){var t=D(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function N(e){return e?(e.nodeName||"").toLowerCase():null}function B(e){return((C(e)?e.ownerDocument:e.document)||window.document).documentElement}function z(e){return V(B(e)).left+W(e).scrollLeft}function q(e){return D(e).getComputedStyle(e)}function U(e){var t=q(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function $(e,t,n){void 0===n&&(n=!1);var r,i,o=S(t),a=S(t)&&function(e){var t=e.getBoundingClientRect(),n=M(t.width)/e.offsetWidth||1,r=M(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),s=B(t),c=V(e,a,n),u={scrollLeft:0,scrollTop:0},p={x:0,y:0};return(o||!o&&!n)&&(("body"!==N(t)||U(s))&&(u=(r=t)!==D(r)&&S(r)?{scrollLeft:(i=r).scrollLeft,scrollTop:i.scrollTop}:W(r)),S(t)?((p=V(t,!0)).x+=t.clientLeft,p.y+=t.clientTop):s&&(p.x=z(s))),{x:c.left+u.scrollLeft-p.x,y:c.top+u.scrollTop-p.y,width:c.width,height:c.height}}function X(e){var t=V(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function Z(e){return"html"===N(e)?e:e.assignedSlot||e.parentNode||(F(e)?e.host:null)||B(e)}function K(e){return["html","body","#document"].indexOf(N(e))>=0?e.ownerDocument.body:S(e)&&U(e)?e:K(Z(e))}function Y(e,t){var n;void 0===t&&(t=[]);var r=K(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=D(r),a=i?[o].concat(o.visualViewport||[],U(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(Y(Z(a)))}function J(e){return["table","td","th"].indexOf(N(e))>=0}function G(e){return S(e)&&"fixed"!==q(e).position?e.offsetParent:null}function Q(e){for(var t=D(e),n=G(e);n&&J(n)&&"static"===q(n).position;)n=G(n);return n&&("html"===N(n)||"body"===N(n)&&"static"===q(n).position)?t:n||function(e){var t=/firefox/i.test(R());if(/Trident/i.test(R())&&S(e)&&"fixed"===q(e).position)return null;var n=Z(e);for(F(n)&&(n=n.host);S(n)&&["html","body"].indexOf(N(n))<0;){var r=q(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 ee="top",te="bottom",ne="right",re="left",ie="auto",oe=[ee,te,ne,re],ae="start",se="end",ce="clippingParents",ue="viewport",pe="popper",fe="reference",le=oe.reduce((function(e,t){return e.concat([t+"-"+ae,t+"-"+se])}),[]),de=[].concat(oe,[ie]).reduce((function(e,t){return e.concat([t,t+"-"+ae,t+"-"+se])}),[]),he=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function me(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 ve={placement:"bottom",modifiers:[],strategy:"absolute"};function ge(){for(var e=arguments.length,t=new Array(e),n=0;n=0?"x":"y"}function Ae(e){var t,n=e.reference,r=e.element,i=e.placement,o=i?xe(i):null,a=i?we(i):null,s=n.x+n.width/2-r.width/2,c=n.y+n.height/2-r.height/2;switch(o){case ee:t={x:s,y:n.y-r.height};break;case te:t={x:s,y:n.y+n.height};break;case ne:t={x:n.x+n.width,y:c};break;case re:t={x:n.x-r.width,y:c};break;default:t={x:n.x,y:n.y}}var u=o?Oe(o):null;if(null!=u){var p="y"===u?"height":"width";switch(a){case ae:t[u]=t[u]-(n[p]/2-r[p]/2);break;case se:t[u]=t[u]+(n[p]/2-r[p]/2)}}return t}var Ee={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Te(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,a=e.offsets,s=e.position,c=e.gpuAcceleration,u=e.adaptive,p=e.roundOffsets,f=e.isFixed,l=a.x,d=void 0===l?0:l,h=a.y,m=void 0===h?0:h,v="function"==typeof p?p({x:d,y:m}):{x:d,y:m};d=v.x,m=v.y;var g=a.hasOwnProperty("x"),y=a.hasOwnProperty("y"),b=re,x=ee,w=window;if(u){var O=Q(n),A="clientHeight",E="clientWidth";if(O===D(n)&&"static"!==q(O=B(n)).position&&"absolute"===s&&(A="scrollHeight",E="scrollWidth"),i===ee||(i===re||i===ne)&&o===se)x=te,m-=(f&&O===w&&w.visualViewport?w.visualViewport.height:O[A])-r.height,m*=c?1:-1;if(i===re||(i===ee||i===te)&&o===se)b=ne,d-=(f&&O===w&&w.visualViewport?w.visualViewport.width:O[E])-r.width,d*=c?1:-1}var T,_=Object.assign({position:s},u&&Ee),k=!0===p?function(e){var t=e.x,n=e.y,r=window.devicePixelRatio||1;return{x:M(t*r)/r||0,y:M(n*r)/r||0}}({x:d,y:m}):{x:d,y:m};return d=k.x,m=k.y,c?Object.assign({},_,((T={})[x]=y?"0":"",T[b]=g?"0":"",T.transform=(w.devicePixelRatio||1)<=1?"translate("+d+"px, "+m+"px)":"translate3d("+d+"px, "+m+"px, 0)",T)):Object.assign({},_,((t={})[x]=y?m+"px":"",t[b]=g?d+"px":"",t.transform="",t))}var _e={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];S(i)&&N(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}),{});S(r)&&N(r)&&(Object.assign(r.style,o),Object.keys(i).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};var ke={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=de.reduce((function(e,n){return e[n]=function(e,t,n){var r=xe(e),i=[re,ee].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,[re,ne].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,o),e}),{}),s=a[t.placement],c=s.x,u=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=a}},je={left:"right",right:"left",bottom:"top",top:"bottom"};function Le(e){return e.replace(/left|right|bottom|top/g,(function(e){return je[e]}))}var De={start:"end",end:"start"};function Ce(e){return e.replace(/start|end/g,(function(e){return De[e]}))}function Se(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&F(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Fe(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Pe(e,t,n){return t===ue?Fe(function(e,t){var n=D(e),r=B(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,s=0,c=0;if(i){o=i.width,a=i.height;var u=H();(u||!u&&"fixed"===t)&&(s=i.offsetLeft,c=i.offsetTop)}return{width:o,height:a,x:s+z(e),y:c}}(e,n)):C(t)?function(e,t){var n=V(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):Fe(function(e){var t,n=B(e),r=W(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=P(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=P(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+z(e),c=-r.scrollTop;return"rtl"===q(i||n).direction&&(s+=P(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:c}}(B(e)))}function Ie(e,t,n,r){var i="clippingParents"===t?function(e){var t=Y(Z(e)),n=["absolute","fixed"].indexOf(q(e).position)>=0&&S(e)?Q(e):e;return C(n)?t.filter((function(e){return C(e)&&Se(e,n)&&"body"!==N(e)})):[]}(e):[].concat(t),o=[].concat(i,[n]),a=o[0],s=o.reduce((function(t,n){var i=Pe(e,n,r);return t.top=P(i.top,t.top),t.right=I(i.right,t.right),t.bottom=I(i.bottom,t.bottom),t.left=P(i.left,t.left),t}),Pe(e,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function Me(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function Re(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function He(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=void 0===r?e.placement:r,o=n.strategy,a=void 0===o?e.strategy:o,s=n.boundary,c=void 0===s?ce:s,u=n.rootBoundary,p=void 0===u?ue:u,f=n.elementContext,l=void 0===f?pe:f,d=n.altBoundary,h=void 0!==d&&d,m=n.padding,v=void 0===m?0:m,g=Me("number"!=typeof v?v:Re(v,oe)),y=l===pe?fe:pe,b=e.rects.popper,x=e.elements[h?y:l],w=Ie(C(x)?x:x.contextElement||B(e.elements.popper),c,p,a),O=V(e.elements.reference),A=Ae({reference:O,element:b,strategy:"absolute",placement:i}),E=Fe(Object.assign({},b,A)),T=l===pe?E:O,_={top:w.top-T.top+g.top,bottom:T.bottom-w.bottom+g.bottom,left:w.left-T.left+g.left,right:T.right-w.right+g.right},k=e.modifiersData.offset;if(l===pe&&k){var j=k[i];Object.keys(_).forEach((function(e){var t=[ne,te].indexOf(e)>=0?1:-1,n=[ee,te].indexOf(e)>=0?"y":"x";_[e]+=j[n]*t}))}return _}function Ve(e,t,n){return P(e,I(t,n))}var We={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,u=n.rootBoundary,p=n.altBoundary,f=n.padding,l=n.tether,d=void 0===l||l,h=n.tetherOffset,m=void 0===h?0:h,v=He(t,{boundary:c,rootBoundary:u,padding:f,altBoundary:p}),g=xe(t.placement),y=we(t.placement),b=!y,x=Oe(g),w="x"===x?"y":"x",O=t.modifiersData.popperOffsets,A=t.rects.reference,E=t.rects.popper,T="function"==typeof m?m(Object.assign({},t.rects,{placement:t.placement})):m,_="number"==typeof T?{mainAxis:T,altAxis:T}:Object.assign({mainAxis:0,altAxis:0},T),k=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,j={x:0,y:0};if(O){if(o){var L,D="y"===x?ee:re,C="y"===x?te:ne,S="y"===x?"height":"width",F=O[x],M=F+v[D],R=F-v[C],H=d?-E[S]/2:0,V=y===ae?A[S]:E[S],W=y===ae?-E[S]:-A[S],N=t.elements.arrow,B=d&&N?X(N):{width:0,height:0},z=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},q=z[D],U=z[C],$=Ve(0,A[S],B[S]),Z=b?A[S]/2-H-$-q-_.mainAxis:V-$-q-_.mainAxis,K=b?-A[S]/2+H+$+U+_.mainAxis:W+$+U+_.mainAxis,Y=t.elements.arrow&&Q(t.elements.arrow),J=Y?"y"===x?Y.clientTop||0:Y.clientLeft||0:0,G=null!=(L=null==k?void 0:k[x])?L:0,ie=F+K-G,oe=Ve(d?I(M,F+Z-G-J):M,F,d?P(R,ie):R);O[x]=oe,j[x]=oe-F}if(s){var se,ce="x"===x?ee:re,ue="x"===x?te:ne,pe=O[w],fe="y"===w?"height":"width",le=pe+v[ce],de=pe-v[ue],he=-1!==[ee,re].indexOf(g),me=null!=(se=null==k?void 0:k[w])?se:0,ve=he?le:pe-A[fe]-E[fe]-me+_.altAxis,ge=he?pe+A[fe]+E[fe]-me-_.altAxis:de,ye=d&&he?function(e,t,n){var r=Ve(e,t,n);return r>n?n:r}(ve,pe,ge):Ve(d?ve:le,pe,d?ge:de);O[w]=ye,j[w]=ye-pe}t.modifiersData[r]=j}},requiresIfExists:["offset"]};var Ne={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=xe(n.placement),c=Oe(s),u=[re,ne].indexOf(s)>=0?"height":"width";if(o&&a){var p=function(e,t){return Me("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:Re(e,oe))}(i.padding,n),f=X(o),l="y"===c?ee:re,d="y"===c?te:ne,h=n.rects.reference[u]+n.rects.reference[c]-a[c]-n.rects.popper[u],m=a[c]-n.rects.reference[c],v=Q(o),g=v?"y"===c?v.clientHeight||0:v.clientWidth||0:0,y=h/2-m/2,b=p[l],x=g-f[u]-p[d],w=g/2-f[u]/2+y,O=Ve(b,w,x),A=c;n.modifiersData[r]=((t={})[A]=O,t.centerOffset=O-w,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)))&&Se(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Be(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 ze(e){return[ee,ne,te,re].some((function(t){return e[t]>=0}))}var qe=ye({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=void 0===i||i,a=r.resize,s=void 0===a||a,c=D(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&u.forEach((function(e){e.addEventListener("scroll",n.update,be)})),s&&c.addEventListener("resize",n.update,be),function(){o&&u.forEach((function(e){e.removeEventListener("scroll",n.update,be)})),s&&c.removeEventListener("resize",n.update,be)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=Ae({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{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,u={placement:xe(t.placement),variation:we(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,Te(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:c})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,Te(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},_e,ke,{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,u=n.padding,p=n.boundary,f=n.rootBoundary,l=n.altBoundary,d=n.flipVariations,h=void 0===d||d,m=n.allowedAutoPlacements,v=t.options.placement,g=xe(v),y=c||(g===v||!h?[Le(v)]:function(e){if(xe(e)===ie)return[];var t=Le(e);return[Ce(e),t,Ce(t)]}(v)),b=[v].concat(y).reduce((function(e,n){return e.concat(xe(n)===ie?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,u=void 0===c?de:c,p=we(r),f=p?s?le:le.filter((function(e){return we(e)===p})):oe,l=f.filter((function(e){return u.indexOf(e)>=0}));0===l.length&&(l=f);var d=l.reduce((function(t,n){return t[n]=He(e,{placement:n,boundary:i,rootBoundary:o,padding:a})[xe(n)],t}),{});return Object.keys(d).sort((function(e,t){return d[e]-d[t]}))}(t,{placement:n,boundary:p,rootBoundary:f,padding:u,flipVariations:h,allowedAutoPlacements:m}):n)}),[]),x=t.rects.reference,w=t.rects.popper,O=new Map,A=!0,E=b[0],T=0;T=0,D=L?"width":"height",C=He(t,{placement:_,boundary:p,rootBoundary:f,altBoundary:l,padding:u}),S=L?j?ne:re:j?te:ee;x[D]>w[D]&&(S=Le(S));var F=Le(S),P=[];if(o&&P.push(C[k]<=0),s&&P.push(C[S]<=0,C[F]<=0),P.every((function(e){return e}))){E=_,A=!1;break}O.set(_,P)}if(A)for(var I=function(e){var t=b.find((function(t){var n=O.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return E=t,"break"},M=h?3:1;M>0;M--){if("break"===I(M))break}t.placement!==E&&(t.modifiersData[r]._skip=!0,t.placement=E,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},We,Ne,{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=He(t,{elementContext:"reference"}),s=He(t,{altBoundary:!0}),c=Be(a,r),u=Be(s,i,o),p=ze(c),f=ze(u);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:u,isReferenceHidden:p,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":p,"data-popper-escaped":f})}}]}),Ue="tippy-content",$e="tippy-backdrop",Xe="tippy-arrow",Ze="tippy-svg-arrow",Ke={passive:!0,capture:!0},Ye=function(){return document.body};function Je(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function Ge(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function Qe(e,t){return"function"==typeof e?e.apply(void 0,t):e}function et(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout((function(){e(r)}),t)};var n}function tt(e){return[].concat(e)}function nt(e,t){-1===e.indexOf(t)&&e.push(t)}function rt(e){return e.split("-")[0]}function it(e){return[].slice.call(e)}function ot(e){return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})}function at(){return document.createElement("div")}function st(e){return["Element","Fragment"].some((function(t){return Ge(e,t)}))}function ct(e){return Ge(e,"MouseEvent")}function ut(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function pt(e){return st(e)?[e]:function(e){return Ge(e,"NodeList")}(e)?it(e):Array.isArray(e)?e:it(document.querySelectorAll(e))}function ft(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function lt(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function dt(e){var t,n=tt(e)[0];return null!=n&&null!=(t=n.ownerDocument)&&t.body?n.ownerDocument:document}function ht(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[r](t,n)}))}function mt(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=null==n.getRootNode||null==(r=n.getRootNode())?void 0:r.host}return!1}var vt={isTouch:!1},gt=0;function yt(){vt.isTouch||(vt.isTouch=!0,window.performance&&document.addEventListener("mousemove",bt))}function bt(){var e=performance.now();e-gt<20&&(vt.isTouch=!1,document.removeEventListener("mousemove",bt)),gt=e}function xt(){var e=document.activeElement;if(ut(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var wt=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto;var Ot={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},At=Object.assign({appendTo:Ye,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},Ot,{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),Et=Object.keys(At);function Tt(e){var t=(e.plugins||[]).reduce((function(t,n){var r,i=n.name,o=n.defaultValue;i&&(t[i]=void 0!==e[i]?e[i]:null!=(r=At[i])?r:o);return t}),{});return Object.assign({},e,t)}function _t(e,t){var n=Object.assign({},t,{content:Qe(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(Tt(Object.assign({},At,{plugins:t}))):Et).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({},At.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}var kt=function(){return"innerHTML"};function jt(e,t){e[kt()]=t}function Lt(e){var t=at();return!0===e?t.className=Xe:(t.className=Ze,st(e)?t.appendChild(e):jt(t,e)),t}function Dt(e,t){st(t.content)?(jt(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?jt(e,t.content):e.textContent=t.content)}function Ct(e){var t=e.firstElementChild,n=it(t.children);return{box:t,content:n.find((function(e){return e.classList.contains(Ue)})),arrow:n.find((function(e){return e.classList.contains(Xe)||e.classList.contains(Ze)})),backdrop:n.find((function(e){return e.classList.contains($e)}))}}function St(e){var t=at(),n=at();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=at();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||Dt(a,e.props),r.arrow?s?n.arrow!==r.arrow&&(o.removeChild(s),o.appendChild(Lt(r.arrow))):o.appendChild(Lt(r.arrow)):s&&o.removeChild(s)}return r.className=Ue,r.setAttribute("data-state","hidden"),Dt(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props),{popper:t,onUpdate:i}}St.$$tippy=!0;var Ft=1,Pt=[],It=[];function Mt(e,t){var n,r,i,o,a,s,c,u,p=_t(e,Object.assign({},At,Tt(ot(t)))),f=!1,l=!1,d=!1,h=!1,m=[],v=et(X,p.interactiveDebounce),g=Ft++,y=(u=p.plugins).filter((function(e,t){return u.indexOf(e)===t})),b={id:g,reference:e,popper:at(),popperInstance:null,props:p,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:y,clearDelayTimeouts:function(){clearTimeout(n),clearTimeout(r),cancelAnimationFrame(i)},setProps:function(t){0;if(b.state.isDestroyed)return;F("onBeforeUpdate",[b,t]),U();var n=b.props,r=_t(e,Object.assign({},n,ot(t),{ignoreAttributes:!0}));b.props=r,q(),n.interactiveDebounce!==r.interactiveDebounce&&(M(),v=et(X,r.interactiveDebounce));n.triggerTarget&&!r.triggerTarget?tt(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):r.triggerTarget&&e.removeAttribute("aria-expanded");I(),S(),O&&O(n,r);b.popperInstance&&(J(),Q().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));F("onAfterUpdate",[b,t])},setContent:function(e){b.setProps({content:e})},show:function(){0;var e=b.state.isVisible,t=b.state.isDestroyed,n=!b.state.isEnabled,r=vt.isTouch&&!b.props.touch,i=Je(b.props.duration,0,At.duration);if(e||t||n||r)return;if(j().hasAttribute("disabled"))return;if(F("onShow",[b],!1),!1===b.props.onShow(b))return;b.state.isVisible=!0,k()&&(w.style.visibility="visible");S(),W(),b.state.isMounted||(w.style.transition="none");if(k()){var o=D();ft([o.box,o.content],0)}s=function(){var e;if(b.state.isVisible&&!h){if(h=!0,w.offsetHeight,w.style.transition=b.props.moveTransition,k()&&b.props.animation){var t=D(),n=t.box,r=t.content;ft([n,r],i),lt([n,r],"visible")}P(),I(),nt(It,b),null==(e=b.popperInstance)||e.forceUpdate(),F("onMount",[b]),b.props.animation&&k()&&function(e,t){B(e,t)}(i,(function(){b.state.isShown=!0,F("onShown",[b])}))}},function(){var e,t=b.props.appendTo,n=j();e=b.props.interactive&&t===Ye||"parent"===t?n.parentNode:Qe(t,[n]);e.contains(w)||e.appendChild(w);b.state.isMounted=!0,J(),!1}()},hide:function(){0;var e=!b.state.isVisible,t=b.state.isDestroyed,n=!b.state.isEnabled,r=Je(b.props.duration,1,At.duration);if(e||t||n)return;if(F("onHide",[b],!1),!1===b.props.onHide(b))return;b.state.isVisible=!1,b.state.isShown=!1,h=!1,f=!1,k()&&(w.style.visibility="hidden");if(M(),N(),S(!0),k()){var i=D(),o=i.box,a=i.content;b.props.animation&&(ft([o,a],r),lt([o,a],"hidden"))}P(),I(),b.props.animation?k()&&function(e,t){B(e,(function(){!b.state.isVisible&&w.parentNode&&w.parentNode.contains(w)&&t()}))}(r,b.unmount):b.unmount()},hideWithInteractivity:function(e){0;L().addEventListener("mousemove",v),nt(Pt,v),v(e)},enable:function(){b.state.isEnabled=!0},disable:function(){b.hide(),b.state.isEnabled=!1},unmount:function(){0;b.state.isVisible&&b.hide();if(!b.state.isMounted)return;G(),Q().forEach((function(e){e._tippy.unmount()})),w.parentNode&&w.parentNode.removeChild(w);It=It.filter((function(e){return e!==b})),b.state.isMounted=!1,F("onHidden",[b])},destroy:function(){0;if(b.state.isDestroyed)return;b.clearDelayTimeouts(),b.unmount(),U(),delete e._tippy,b.state.isDestroyed=!0,F("onDestroy",[b])}};if(!p.render)return b;var x=p.render(b),w=x.popper,O=x.onUpdate;w.setAttribute("data-tippy-root",""),w.id="tippy-"+b.id,b.popper=w,e._tippy=b,w._tippy=b;var A=y.map((function(e){return e.fn(b)})),E=e.hasAttribute("aria-expanded");return q(),I(),S(),F("onCreate",[b]),p.showOnCreate&&ee(),w.addEventListener("mouseenter",(function(){b.props.interactive&&b.state.isVisible&&b.clearDelayTimeouts()})),w.addEventListener("mouseleave",(function(){b.props.interactive&&b.props.trigger.indexOf("mouseenter")>=0&&L().addEventListener("mousemove",v)})),b;function T(){var e=b.props.touch;return Array.isArray(e)?e:[e,0]}function _(){return"hold"===T()[0]}function k(){var e;return!(null==(e=b.props.render)||!e.$$tippy)}function j(){return c||e}function L(){var e=j().parentNode;return e?dt(e):document}function D(){return Ct(w)}function C(e){return b.state.isMounted&&!b.state.isVisible||vt.isTouch||o&&"focus"===o.type?0:Je(b.props.delay,e?0:1,At.delay)}function S(e){void 0===e&&(e=!1),w.style.pointerEvents=b.props.interactive&&!e?"":"none",w.style.zIndex=""+b.props.zIndex}function F(e,t,n){var r;(void 0===n&&(n=!0),A.forEach((function(n){n[e]&&n[e].apply(n,t)})),n)&&(r=b.props)[e].apply(r,t)}function P(){var t=b.props.aria;if(t.content){var n="aria-"+t.content,r=w.id;tt(b.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(n);if(b.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 I(){!E&&b.props.aria.expanded&&tt(b.props.triggerTarget||e).forEach((function(e){b.props.interactive?e.setAttribute("aria-expanded",b.state.isVisible&&e===j()?"true":"false"):e.removeAttribute("aria-expanded")}))}function M(){L().removeEventListener("mousemove",v),Pt=Pt.filter((function(e){return e!==v}))}function R(t){if(!vt.isTouch||!d&&"mousedown"!==t.type){var n=t.composedPath&&t.composedPath()[0]||t.target;if(!b.props.interactive||!mt(w,n)){if(tt(b.props.triggerTarget||e).some((function(e){return mt(e,n)}))){if(vt.isTouch)return;if(b.state.isVisible&&b.props.trigger.indexOf("click")>=0)return}else F("onClickOutside",[b,t]);!0===b.props.hideOnClick&&(b.clearDelayTimeouts(),b.hide(),l=!0,setTimeout((function(){l=!1})),b.state.isMounted||N())}}}function H(){d=!0}function V(){d=!1}function W(){var e=L();e.addEventListener("mousedown",R,!0),e.addEventListener("touchend",R,Ke),e.addEventListener("touchstart",V,Ke),e.addEventListener("touchmove",H,Ke)}function N(){var e=L();e.removeEventListener("mousedown",R,!0),e.removeEventListener("touchend",R,Ke),e.removeEventListener("touchstart",V,Ke),e.removeEventListener("touchmove",H,Ke)}function B(e,t){var n=D().box;function r(e){e.target===n&&(ht(n,"remove",r),t())}if(0===e)return t();ht(n,"remove",a),ht(n,"add",r),a=r}function z(t,n,r){void 0===r&&(r=!1),tt(b.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,n,r),m.push({node:e,eventType:t,handler:n,options:r})}))}function q(){var e;_()&&(z("touchstart",$,{passive:!0}),z("touchend",Z,{passive:!0})),(e=b.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(z(e,$),e){case"mouseenter":z("mouseleave",Z);break;case"focus":z(wt?"focusout":"blur",K);break;case"focusin":z("focusout",K)}}))}function U(){m.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,i=e.options;t.removeEventListener(n,r,i)})),m=[]}function $(e){var t,n=!1;if(b.state.isEnabled&&!Y(e)&&!l){var r="focus"===(null==(t=o)?void 0:t.type);o=e,c=e.currentTarget,I(),!b.state.isVisible&&ct(e)&&Pt.forEach((function(t){return t(e)})),"click"===e.type&&(b.props.trigger.indexOf("mouseenter")<0||f)&&!1!==b.props.hideOnClick&&b.state.isVisible?n=!0:ee(e),"click"===e.type&&(f=!n),n&&!r&&te(e)}}function X(e){var t=e.target,n=j().contains(t)||w.contains(t);if("mousemove"!==e.type||!n){var r=Q().concat(w).map((function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:p}:null})).filter(Boolean);(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=rt(i.placement),s=i.modifiersData.offset;if(!s)return!0;var c="bottom"===a?s.top.y:0,u="top"===a?s.bottom.y:0,p="right"===a?s.left.x:0,f="left"===a?s.right.x:0,l=t.top-r+c>o,d=r-t.bottom-u>o,h=t.left-n+p>o,m=n-t.right-f>o;return l||d||h||m}))})(r,e)&&(M(),te(e))}}function Z(e){Y(e)||b.props.trigger.indexOf("click")>=0&&f||(b.props.interactive?b.hideWithInteractivity(e):te(e))}function K(e){b.props.trigger.indexOf("focusin")<0&&e.target!==j()||b.props.interactive&&e.relatedTarget&&w.contains(e.relatedTarget)||te(e)}function Y(e){return!!vt.isTouch&&_()!==e.type.indexOf("touch")>=0}function J(){G();var t=b.props,n=t.popperOptions,r=t.placement,i=t.offset,o=t.getReferenceClientRect,a=t.moveTransition,c=k()?Ct(w).arrow:null,u=o?{getBoundingClientRect:o,contextElement:o.contextElement||j()}:e,p={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(k()){var n=D().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={}}}},f=[{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}},p];k()&&c&&f.push({name:"arrow",options:{element:c,padding:3}}),f.push.apply(f,(null==n?void 0:n.modifiers)||[]),b.popperInstance=qe(u,w,Object.assign({},n,{placement:r,onFirstUpdate:s,modifiers:f}))}function G(){b.popperInstance&&(b.popperInstance.destroy(),b.popperInstance=null)}function Q(){return it(w.querySelectorAll("[data-tippy-root]"))}function ee(e){b.clearDelayTimeouts(),e&&F("onTrigger",[b,e]),W();var t=C(!0),r=T(),i=r[0],o=r[1];vt.isTouch&&"hold"===i&&o&&(t=o),t?n=setTimeout((function(){b.show()}),t):b.show()}function te(e){if(b.clearDelayTimeouts(),F("onUntrigger",[b,e]),b.state.isVisible){if(!(b.props.trigger.indexOf("mouseenter")>=0&&b.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&f)){var t=C(!1);t?r=setTimeout((function(){b.state.isVisible&&b.hide()}),t):i=requestAnimationFrame((function(){b.hide()}))}}else N()}}function Rt(e,t){void 0===t&&(t={});var n=At.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",yt,Ke),window.addEventListener("blur",xt);var r=Object.assign({},t,{plugins:n}),i=pt(e).reduce((function(e,t){var n=t&&Mt(t,r);return n&&e.push(n),e}),[]);return st(e)?i[0]:i}Rt.defaultProps=At,Rt.setDefaultProps=function(e){Object.keys(e).forEach((function(t){At[t]=e[t]}))},Rt.currentInput=vt;Object.assign({},_e,{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)}});Rt.setDefaultProps({render:St});var Ht=Rt;const Vt={init(){[...document.images].forEach((e=>{this.wrapImage(e)}));const e=document.querySelectorAll(".cld-tag");Ht(e,{placement:"bottom-start",interactive:!0,appendTo:()=>document.body,aria:{content:"auto",expanded:"auto"},content:e=>e.template.innerHTML,allowHTML:!0})},wrapImage(e){e.dataset.publicId?this.cldTag(e):this.wpTag(e)},createTag(e){const t=document.createElement("span");return t.classList.add("overlay-tag"),e.parentNode.insertBefore(t,e),t},cldTag(e){const t=this.createTag(e);t.template=this.createTemplate(e),t.innerText=L("Cloudinary","cloudinary"),t.classList.add("cld-tag")},wpTag(e){const t=this.createTag(e);t.innerText=L("WordPress","cloudinary"),t.classList.add("wp-tag")},createTemplate(e){const t=document.createElement("div");t.classList.add("cld-tag-info"),t.appendChild(this.makeLine(L("Local size","cloudinary"),e.dataset.filesize)),t.appendChild(this.makeLine(L("Optimized size","cloudinary"),e.dataset.optsize)),t.appendChild(this.makeLine(L("Optimized format","cloudinary"),e.dataset.optformat)),e.dataset.percent&&t.appendChild(this.makeLine(L("Reduction","cloudinary"),e.dataset.percent+"%")),t.appendChild(this.makeLine(L("Transformations","cloudinary"),e.dataset.transformations)),e.dataset.transformationCrop&&t.appendChild(this.makeLine(L("Crop transformations","cloudinary"),e.dataset.transformationCrop));const n=document.createElement("a");return n.classList.add("edit-link"),n.href=e.dataset.permalink,n.innerText=L("Edit asset","cloudinary"),t.appendChild(this.makeLine("","",n)),t},makeLine(e,t,n){const r=document.createElement("div"),i=document.createElement("span"),o=document.createElement("span");return i.innerText=e,i.classList.add("title"),o.innerText=t,n&&o.appendChild(n),r.appendChild(i),r.appendChild(o),r}};window.addEventListener("load",(()=>Vt.init()))}()}(); \ No newline at end of file +!function(){var e={616:function(e){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;a=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)||f&&!s.sign?l="":(l=f?"+":"-",n=n.toString().replace(i.sign,"")),u=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",p=s.width-(l+n).length,c=s.width&&p>0?u.repeat(p):"",m+=s.align?l+n+c:"0"===u?l+c+n:c+l+n)}return m}(function(e){if(s[e])return s[e];var t,n=e,r=[],o=0;for(;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=[],c=t[2],u=[];if(null===(u=i.key.exec(c)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(a.push(u[1]);""!==(c=c.substring(u[0].length));)if(null!==(u=i.key_access.exec(c)))a.push(u[1]);else{if(null===(u=i.index_access.exec(c)))throw new SyntaxError("[sprintf] failed to parse named argument key");a.push(u[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 s[e]=r}(e),arguments)}function a(e,t){return o.apply(null,[e].concat(t||[]))}var s=Object.create(null);o,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))}()}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){"use strict";var e,t,r,i,o=n(616),a=n.n(o);n(604),a()(console.error);function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function c(e){var t=function(e,t){if("object"!=s(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==s(t)?t:t+""}e={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1},t=["(","?"],r={")":["("],":":["?","?:"]},i=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;var u={"!":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 p(n){var o=function(n){for(var o,a,s,c,u=[],p=[];o=n.match(i);){for(a=o[0],(s=n.substr(0,o.index).trim())&&u.push(s);c=p.pop();){if(r[a]){if(r[a][0]===c){a=r[a][1]||a;break}}else if(t.indexOf(c)>=0||e[c]3&&void 0!==arguments[3]?arguments[3]:10,a=e[t];if(y(n)&&g(r))if("function"==typeof i)if("number"==typeof o){var s={callback:i,priority:o,namespace:r};if(a[n]){var c,u=a[n].handlers;for(c=u.length;c>0&&!(o>=u[c-1].priority);c--);c===u.length?u[c]=s:u.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 x=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(r,i){var o=e[t];if(y(r)&&(n||g(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--})))},u=s.length-1;u>=0;u--)c(u);return"hookRemoved"!==r&&e.doAction("hookRemoved",r,i),a}}};var w=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}};var O=function(e,t){var n=arguments.length>2&&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]=h(h(h({},m),r.data[t]),e),r.data[t][""]=h(h({},m[""]),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)},u=function(){return arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default"},p=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_"+u(r),i,e,t,r)):i};if(e&&s(e,t),n){var f=function(e){v.test(e)&&o()};n.addAction("hookAdded","core/i18n",f),n.addAction("hookRemoved","core/i18n",f)}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_"+u(t),r,e,t)):r},_x:p,_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_"+u(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_"+u(o),a,e,t,r,i,o)):a},isRTL:function(){return"rtl"===p("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_"+u(i),c,e,t,i)),c}}}(void 0,void 0,k)),L=(j.getLocaleData.bind(j),j.setLocaleData.bind(j),j.resetLocaleData.bind(j),j.subscribe.bind(j),j.__.bind(j));j._x.bind(j),j._n.bind(j),j._nx.bind(j),j.isRTL.bind(j),j.hasTranslation.bind(j);function D(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function C(e){return e instanceof D(e).Element||e instanceof Element}function S(e){return e instanceof D(e).HTMLElement||e instanceof HTMLElement}function F(e){return"undefined"!=typeof ShadowRoot&&(e instanceof D(e).ShadowRoot||e instanceof ShadowRoot)}var P=Math.max,I=Math.min,M=Math.round;function R(){var e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function H(){return!/^((?!chrome|android).)*safari/i.test(R())}function V(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&S(e)&&(i=e.offsetWidth>0&&M(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&M(r.height)/e.offsetHeight||1);var a=(C(e)?D(e):window).visualViewport,s=!H()&&n,c=(r.left+(s&&a?a.offsetLeft:0))/i,u=(r.top+(s&&a?a.offsetTop:0))/o,p=r.width/i,f=r.height/o;return{width:p,height:f,top:u,right:c+p,bottom:u+f,left:c,x:c,y:u}}function W(e){var t=D(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function N(e){return e?(e.nodeName||"").toLowerCase():null}function B(e){return((C(e)?e.ownerDocument:e.document)||window.document).documentElement}function z(e){return V(B(e)).left+W(e).scrollLeft}function q(e){return D(e).getComputedStyle(e)}function U(e){var t=q(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function $(e,t,n){void 0===n&&(n=!1);var r,i,o=S(t),a=S(t)&&function(e){var t=e.getBoundingClientRect(),n=M(t.width)/e.offsetWidth||1,r=M(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),s=B(t),c=V(e,a,n),u={scrollLeft:0,scrollTop:0},p={x:0,y:0};return(o||!o&&!n)&&(("body"!==N(t)||U(s))&&(u=(r=t)!==D(r)&&S(r)?{scrollLeft:(i=r).scrollLeft,scrollTop:i.scrollTop}:W(r)),S(t)?((p=V(t,!0)).x+=t.clientLeft,p.y+=t.clientTop):s&&(p.x=z(s))),{x:c.left+u.scrollLeft-p.x,y:c.top+u.scrollTop-p.y,width:c.width,height:c.height}}function X(e){var t=V(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function Z(e){return"html"===N(e)?e:e.assignedSlot||e.parentNode||(F(e)?e.host:null)||B(e)}function K(e){return["html","body","#document"].indexOf(N(e))>=0?e.ownerDocument.body:S(e)&&U(e)?e:K(Z(e))}function Y(e,t){var n;void 0===t&&(t=[]);var r=K(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=D(r),a=i?[o].concat(o.visualViewport||[],U(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(Y(Z(a)))}function J(e){return["table","td","th"].indexOf(N(e))>=0}function G(e){return S(e)&&"fixed"!==q(e).position?e.offsetParent:null}function Q(e){for(var t=D(e),n=G(e);n&&J(n)&&"static"===q(n).position;)n=G(n);return n&&("html"===N(n)||"body"===N(n)&&"static"===q(n).position)?t:n||function(e){var t=/firefox/i.test(R());if(/Trident/i.test(R())&&S(e)&&"fixed"===q(e).position)return null;var n=Z(e);for(F(n)&&(n=n.host);S(n)&&["html","body"].indexOf(N(n))<0;){var r=q(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 ee="top",te="bottom",ne="right",re="left",ie="auto",oe=[ee,te,ne,re],ae="start",se="end",ce="clippingParents",ue="viewport",pe="popper",fe="reference",le=oe.reduce((function(e,t){return e.concat([t+"-"+ae,t+"-"+se])}),[]),de=[].concat(oe,[ie]).reduce((function(e,t){return e.concat([t,t+"-"+ae,t+"-"+se])}),[]),he=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function me(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 ve={placement:"bottom",modifiers:[],strategy:"absolute"};function ge(){for(var e=arguments.length,t=new Array(e),n=0;n=0?"x":"y"}function Ae(e){var t,n=e.reference,r=e.element,i=e.placement,o=i?xe(i):null,a=i?we(i):null,s=n.x+n.width/2-r.width/2,c=n.y+n.height/2-r.height/2;switch(o){case ee:t={x:s,y:n.y-r.height};break;case te:t={x:s,y:n.y+n.height};break;case ne:t={x:n.x+n.width,y:c};break;case re:t={x:n.x-r.width,y:c};break;default:t={x:n.x,y:n.y}}var u=o?Oe(o):null;if(null!=u){var p="y"===u?"height":"width";switch(a){case ae:t[u]=t[u]-(n[p]/2-r[p]/2);break;case se:t[u]=t[u]+(n[p]/2-r[p]/2)}}return t}var Ee={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Te(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,a=e.offsets,s=e.position,c=e.gpuAcceleration,u=e.adaptive,p=e.roundOffsets,f=e.isFixed,l=a.x,d=void 0===l?0:l,h=a.y,m=void 0===h?0:h,v="function"==typeof p?p({x:d,y:m}):{x:d,y:m};d=v.x,m=v.y;var g=a.hasOwnProperty("x"),y=a.hasOwnProperty("y"),b=re,x=ee,w=window;if(u){var O=Q(n),A="clientHeight",E="clientWidth";if(O===D(n)&&"static"!==q(O=B(n)).position&&"absolute"===s&&(A="scrollHeight",E="scrollWidth"),i===ee||(i===re||i===ne)&&o===se)x=te,m-=(f&&O===w&&w.visualViewport?w.visualViewport.height:O[A])-r.height,m*=c?1:-1;if(i===re||(i===ee||i===te)&&o===se)b=ne,d-=(f&&O===w&&w.visualViewport?w.visualViewport.width:O[E])-r.width,d*=c?1:-1}var T,_=Object.assign({position:s},u&&Ee),k=!0===p?function(e){var t=e.x,n=e.y,r=window.devicePixelRatio||1;return{x:M(t*r)/r||0,y:M(n*r)/r||0}}({x:d,y:m}):{x:d,y:m};return d=k.x,m=k.y,c?Object.assign({},_,((T={})[x]=y?"0":"",T[b]=g?"0":"",T.transform=(w.devicePixelRatio||1)<=1?"translate("+d+"px, "+m+"px)":"translate3d("+d+"px, "+m+"px, 0)",T)):Object.assign({},_,((t={})[x]=y?m+"px":"",t[b]=g?d+"px":"",t.transform="",t))}var _e={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];S(i)&&N(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}),{});S(r)&&N(r)&&(Object.assign(r.style,o),Object.keys(i).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};var ke={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=de.reduce((function(e,n){return e[n]=function(e,t,n){var r=xe(e),i=[re,ee].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,[re,ne].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,o),e}),{}),s=a[t.placement],c=s.x,u=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=a}},je={left:"right",right:"left",bottom:"top",top:"bottom"};function Le(e){return e.replace(/left|right|bottom|top/g,(function(e){return je[e]}))}var De={start:"end",end:"start"};function Ce(e){return e.replace(/start|end/g,(function(e){return De[e]}))}function Se(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&F(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Fe(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Pe(e,t,n){return t===ue?Fe(function(e,t){var n=D(e),r=B(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,s=0,c=0;if(i){o=i.width,a=i.height;var u=H();(u||!u&&"fixed"===t)&&(s=i.offsetLeft,c=i.offsetTop)}return{width:o,height:a,x:s+z(e),y:c}}(e,n)):C(t)?function(e,t){var n=V(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):Fe(function(e){var t,n=B(e),r=W(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=P(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=P(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+z(e),c=-r.scrollTop;return"rtl"===q(i||n).direction&&(s+=P(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:c}}(B(e)))}function Ie(e,t,n,r){var i="clippingParents"===t?function(e){var t=Y(Z(e)),n=["absolute","fixed"].indexOf(q(e).position)>=0&&S(e)?Q(e):e;return C(n)?t.filter((function(e){return C(e)&&Se(e,n)&&"body"!==N(e)})):[]}(e):[].concat(t),o=[].concat(i,[n]),a=o[0],s=o.reduce((function(t,n){var i=Pe(e,n,r);return t.top=P(i.top,t.top),t.right=I(i.right,t.right),t.bottom=I(i.bottom,t.bottom),t.left=P(i.left,t.left),t}),Pe(e,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function Me(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function Re(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function He(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=void 0===r?e.placement:r,o=n.strategy,a=void 0===o?e.strategy:o,s=n.boundary,c=void 0===s?ce:s,u=n.rootBoundary,p=void 0===u?ue:u,f=n.elementContext,l=void 0===f?pe:f,d=n.altBoundary,h=void 0!==d&&d,m=n.padding,v=void 0===m?0:m,g=Me("number"!=typeof v?v:Re(v,oe)),y=l===pe?fe:pe,b=e.rects.popper,x=e.elements[h?y:l],w=Ie(C(x)?x:x.contextElement||B(e.elements.popper),c,p,a),O=V(e.elements.reference),A=Ae({reference:O,element:b,strategy:"absolute",placement:i}),E=Fe(Object.assign({},b,A)),T=l===pe?E:O,_={top:w.top-T.top+g.top,bottom:T.bottom-w.bottom+g.bottom,left:w.left-T.left+g.left,right:T.right-w.right+g.right},k=e.modifiersData.offset;if(l===pe&&k){var j=k[i];Object.keys(_).forEach((function(e){var t=[ne,te].indexOf(e)>=0?1:-1,n=[ee,te].indexOf(e)>=0?"y":"x";_[e]+=j[n]*t}))}return _}function Ve(e,t,n){return P(e,I(t,n))}var We={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,u=n.rootBoundary,p=n.altBoundary,f=n.padding,l=n.tether,d=void 0===l||l,h=n.tetherOffset,m=void 0===h?0:h,v=He(t,{boundary:c,rootBoundary:u,padding:f,altBoundary:p}),g=xe(t.placement),y=we(t.placement),b=!y,x=Oe(g),w="x"===x?"y":"x",O=t.modifiersData.popperOffsets,A=t.rects.reference,E=t.rects.popper,T="function"==typeof m?m(Object.assign({},t.rects,{placement:t.placement})):m,_="number"==typeof T?{mainAxis:T,altAxis:T}:Object.assign({mainAxis:0,altAxis:0},T),k=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,j={x:0,y:0};if(O){if(o){var L,D="y"===x?ee:re,C="y"===x?te:ne,S="y"===x?"height":"width",F=O[x],M=F+v[D],R=F-v[C],H=d?-E[S]/2:0,V=y===ae?A[S]:E[S],W=y===ae?-E[S]:-A[S],N=t.elements.arrow,B=d&&N?X(N):{width:0,height:0},z=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},q=z[D],U=z[C],$=Ve(0,A[S],B[S]),Z=b?A[S]/2-H-$-q-_.mainAxis:V-$-q-_.mainAxis,K=b?-A[S]/2+H+$+U+_.mainAxis:W+$+U+_.mainAxis,Y=t.elements.arrow&&Q(t.elements.arrow),J=Y?"y"===x?Y.clientTop||0:Y.clientLeft||0:0,G=null!=(L=null==k?void 0:k[x])?L:0,ie=F+K-G,oe=Ve(d?I(M,F+Z-G-J):M,F,d?P(R,ie):R);O[x]=oe,j[x]=oe-F}if(s){var se,ce="x"===x?ee:re,ue="x"===x?te:ne,pe=O[w],fe="y"===w?"height":"width",le=pe+v[ce],de=pe-v[ue],he=-1!==[ee,re].indexOf(g),me=null!=(se=null==k?void 0:k[w])?se:0,ve=he?le:pe-A[fe]-E[fe]-me+_.altAxis,ge=he?pe+A[fe]+E[fe]-me-_.altAxis:de,ye=d&&he?function(e,t,n){var r=Ve(e,t,n);return r>n?n:r}(ve,pe,ge):Ve(d?ve:le,pe,d?ge:de);O[w]=ye,j[w]=ye-pe}t.modifiersData[r]=j}},requiresIfExists:["offset"]};var Ne={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=xe(n.placement),c=Oe(s),u=[re,ne].indexOf(s)>=0?"height":"width";if(o&&a){var p=function(e,t){return Me("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:Re(e,oe))}(i.padding,n),f=X(o),l="y"===c?ee:re,d="y"===c?te:ne,h=n.rects.reference[u]+n.rects.reference[c]-a[c]-n.rects.popper[u],m=a[c]-n.rects.reference[c],v=Q(o),g=v?"y"===c?v.clientHeight||0:v.clientWidth||0:0,y=h/2-m/2,b=p[l],x=g-f[u]-p[d],w=g/2-f[u]/2+y,O=Ve(b,w,x),A=c;n.modifiersData[r]=((t={})[A]=O,t.centerOffset=O-w,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)))&&Se(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Be(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 ze(e){return[ee,ne,te,re].some((function(t){return e[t]>=0}))}var qe=ye({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=void 0===i||i,a=r.resize,s=void 0===a||a,c=D(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&u.forEach((function(e){e.addEventListener("scroll",n.update,be)})),s&&c.addEventListener("resize",n.update,be),function(){o&&u.forEach((function(e){e.removeEventListener("scroll",n.update,be)})),s&&c.removeEventListener("resize",n.update,be)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=Ae({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{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,u={placement:xe(t.placement),variation:we(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,Te(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:c})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,Te(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},_e,ke,{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,u=n.padding,p=n.boundary,f=n.rootBoundary,l=n.altBoundary,d=n.flipVariations,h=void 0===d||d,m=n.allowedAutoPlacements,v=t.options.placement,g=xe(v),y=c||(g===v||!h?[Le(v)]:function(e){if(xe(e)===ie)return[];var t=Le(e);return[Ce(e),t,Ce(t)]}(v)),b=[v].concat(y).reduce((function(e,n){return e.concat(xe(n)===ie?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,u=void 0===c?de:c,p=we(r),f=p?s?le:le.filter((function(e){return we(e)===p})):oe,l=f.filter((function(e){return u.indexOf(e)>=0}));0===l.length&&(l=f);var d=l.reduce((function(t,n){return t[n]=He(e,{placement:n,boundary:i,rootBoundary:o,padding:a})[xe(n)],t}),{});return Object.keys(d).sort((function(e,t){return d[e]-d[t]}))}(t,{placement:n,boundary:p,rootBoundary:f,padding:u,flipVariations:h,allowedAutoPlacements:m}):n)}),[]),x=t.rects.reference,w=t.rects.popper,O=new Map,A=!0,E=b[0],T=0;T=0,D=L?"width":"height",C=He(t,{placement:_,boundary:p,rootBoundary:f,altBoundary:l,padding:u}),S=L?j?ne:re:j?te:ee;x[D]>w[D]&&(S=Le(S));var F=Le(S),P=[];if(o&&P.push(C[k]<=0),s&&P.push(C[S]<=0,C[F]<=0),P.every((function(e){return e}))){E=_,A=!1;break}O.set(_,P)}if(A)for(var I=function(e){var t=b.find((function(t){var n=O.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return E=t,"break"},M=h?3:1;M>0;M--){if("break"===I(M))break}t.placement!==E&&(t.modifiersData[r]._skip=!0,t.placement=E,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},We,Ne,{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=He(t,{elementContext:"reference"}),s=He(t,{altBoundary:!0}),c=Be(a,r),u=Be(s,i,o),p=ze(c),f=ze(u);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:u,isReferenceHidden:p,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":p,"data-popper-escaped":f})}}]}),Ue="tippy-content",$e="tippy-backdrop",Xe="tippy-arrow",Ze="tippy-svg-arrow",Ke={passive:!0,capture:!0},Ye=function(){return document.body};function Je(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function Ge(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function Qe(e,t){return"function"==typeof e?e.apply(void 0,t):e}function et(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout((function(){e(r)}),t)};var n}function tt(e){return[].concat(e)}function nt(e,t){-1===e.indexOf(t)&&e.push(t)}function rt(e){return e.split("-")[0]}function it(e){return[].slice.call(e)}function ot(e){return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})}function at(){return document.createElement("div")}function st(e){return["Element","Fragment"].some((function(t){return Ge(e,t)}))}function ct(e){return Ge(e,"MouseEvent")}function ut(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function pt(e){return st(e)?[e]:function(e){return Ge(e,"NodeList")}(e)?it(e):Array.isArray(e)?e:it(document.querySelectorAll(e))}function ft(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function lt(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function dt(e){var t,n=tt(e)[0];return null!=n&&null!=(t=n.ownerDocument)&&t.body?n.ownerDocument:document}function ht(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[r](t,n)}))}function mt(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=null==n.getRootNode||null==(r=n.getRootNode())?void 0:r.host}return!1}var vt={isTouch:!1},gt=0;function yt(){vt.isTouch||(vt.isTouch=!0,window.performance&&document.addEventListener("mousemove",bt))}function bt(){var e=performance.now();e-gt<20&&(vt.isTouch=!1,document.removeEventListener("mousemove",bt)),gt=e}function xt(){var e=document.activeElement;if(ut(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var wt=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto;var Ot={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},At=Object.assign({appendTo:Ye,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},Ot,{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),Et=Object.keys(At);function Tt(e){var t=(e.plugins||[]).reduce((function(t,n){var r,i=n.name,o=n.defaultValue;i&&(t[i]=void 0!==e[i]?e[i]:null!=(r=At[i])?r:o);return t}),{});return Object.assign({},e,t)}function _t(e,t){var n=Object.assign({},t,{content:Qe(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(Tt(Object.assign({},At,{plugins:t}))):Et).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({},At.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}var kt=function(){return"innerHTML"};function jt(e,t){e[kt()]=t}function Lt(e){var t=at();return!0===e?t.className=Xe:(t.className=Ze,st(e)?t.appendChild(e):jt(t,e)),t}function Dt(e,t){st(t.content)?(jt(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?jt(e,t.content):e.textContent=t.content)}function Ct(e){var t=e.firstElementChild,n=it(t.children);return{box:t,content:n.find((function(e){return e.classList.contains(Ue)})),arrow:n.find((function(e){return e.classList.contains(Xe)||e.classList.contains(Ze)})),backdrop:n.find((function(e){return e.classList.contains($e)}))}}function St(e){var t=at(),n=at();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=at();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||Dt(a,e.props),r.arrow?s?n.arrow!==r.arrow&&(o.removeChild(s),o.appendChild(Lt(r.arrow))):o.appendChild(Lt(r.arrow)):s&&o.removeChild(s)}return r.className=Ue,r.setAttribute("data-state","hidden"),Dt(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props),{popper:t,onUpdate:i}}St.$$tippy=!0;var Ft=1,Pt=[],It=[];function Mt(e,t){var n,r,i,o,a,s,c,u,p=_t(e,Object.assign({},At,Tt(ot(t)))),f=!1,l=!1,d=!1,h=!1,m=[],v=et(X,p.interactiveDebounce),g=Ft++,y=(u=p.plugins).filter((function(e,t){return u.indexOf(e)===t})),b={id:g,reference:e,popper:at(),popperInstance:null,props:p,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:y,clearDelayTimeouts:function(){clearTimeout(n),clearTimeout(r),cancelAnimationFrame(i)},setProps:function(t){0;if(b.state.isDestroyed)return;F("onBeforeUpdate",[b,t]),U();var n=b.props,r=_t(e,Object.assign({},n,ot(t),{ignoreAttributes:!0}));b.props=r,q(),n.interactiveDebounce!==r.interactiveDebounce&&(M(),v=et(X,r.interactiveDebounce));n.triggerTarget&&!r.triggerTarget?tt(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):r.triggerTarget&&e.removeAttribute("aria-expanded");I(),S(),O&&O(n,r);b.popperInstance&&(J(),Q().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));F("onAfterUpdate",[b,t])},setContent:function(e){b.setProps({content:e})},show:function(){0;var e=b.state.isVisible,t=b.state.isDestroyed,n=!b.state.isEnabled,r=vt.isTouch&&!b.props.touch,i=Je(b.props.duration,0,At.duration);if(e||t||n||r)return;if(j().hasAttribute("disabled"))return;if(F("onShow",[b],!1),!1===b.props.onShow(b))return;b.state.isVisible=!0,k()&&(w.style.visibility="visible");S(),W(),b.state.isMounted||(w.style.transition="none");if(k()){var o=D();ft([o.box,o.content],0)}s=function(){var e;if(b.state.isVisible&&!h){if(h=!0,w.offsetHeight,w.style.transition=b.props.moveTransition,k()&&b.props.animation){var t=D(),n=t.box,r=t.content;ft([n,r],i),lt([n,r],"visible")}P(),I(),nt(It,b),null==(e=b.popperInstance)||e.forceUpdate(),F("onMount",[b]),b.props.animation&&k()&&function(e,t){B(e,t)}(i,(function(){b.state.isShown=!0,F("onShown",[b])}))}},function(){var e,t=b.props.appendTo,n=j();e=b.props.interactive&&t===Ye||"parent"===t?n.parentNode:Qe(t,[n]);e.contains(w)||e.appendChild(w);b.state.isMounted=!0,J(),!1}()},hide:function(){0;var e=!b.state.isVisible,t=b.state.isDestroyed,n=!b.state.isEnabled,r=Je(b.props.duration,1,At.duration);if(e||t||n)return;if(F("onHide",[b],!1),!1===b.props.onHide(b))return;b.state.isVisible=!1,b.state.isShown=!1,h=!1,f=!1,k()&&(w.style.visibility="hidden");if(M(),N(),S(!0),k()){var i=D(),o=i.box,a=i.content;b.props.animation&&(ft([o,a],r),lt([o,a],"hidden"))}P(),I(),b.props.animation?k()&&function(e,t){B(e,(function(){!b.state.isVisible&&w.parentNode&&w.parentNode.contains(w)&&t()}))}(r,b.unmount):b.unmount()},hideWithInteractivity:function(e){0;L().addEventListener("mousemove",v),nt(Pt,v),v(e)},enable:function(){b.state.isEnabled=!0},disable:function(){b.hide(),b.state.isEnabled=!1},unmount:function(){0;b.state.isVisible&&b.hide();if(!b.state.isMounted)return;G(),Q().forEach((function(e){e._tippy.unmount()})),w.parentNode&&w.parentNode.removeChild(w);It=It.filter((function(e){return e!==b})),b.state.isMounted=!1,F("onHidden",[b])},destroy:function(){0;if(b.state.isDestroyed)return;b.clearDelayTimeouts(),b.unmount(),U(),delete e._tippy,b.state.isDestroyed=!0,F("onDestroy",[b])}};if(!p.render)return b;var x=p.render(b),w=x.popper,O=x.onUpdate;w.setAttribute("data-tippy-root",""),w.id="tippy-"+b.id,b.popper=w,e._tippy=b,w._tippy=b;var A=y.map((function(e){return e.fn(b)})),E=e.hasAttribute("aria-expanded");return q(),I(),S(),F("onCreate",[b]),p.showOnCreate&&ee(),w.addEventListener("mouseenter",(function(){b.props.interactive&&b.state.isVisible&&b.clearDelayTimeouts()})),w.addEventListener("mouseleave",(function(){b.props.interactive&&b.props.trigger.indexOf("mouseenter")>=0&&L().addEventListener("mousemove",v)})),b;function T(){var e=b.props.touch;return Array.isArray(e)?e:[e,0]}function _(){return"hold"===T()[0]}function k(){var e;return!(null==(e=b.props.render)||!e.$$tippy)}function j(){return c||e}function L(){var e=j().parentNode;return e?dt(e):document}function D(){return Ct(w)}function C(e){return b.state.isMounted&&!b.state.isVisible||vt.isTouch||o&&"focus"===o.type?0:Je(b.props.delay,e?0:1,At.delay)}function S(e){void 0===e&&(e=!1),w.style.pointerEvents=b.props.interactive&&!e?"":"none",w.style.zIndex=""+b.props.zIndex}function F(e,t,n){var r;(void 0===n&&(n=!0),A.forEach((function(n){n[e]&&n[e].apply(n,t)})),n)&&(r=b.props)[e].apply(r,t)}function P(){var t=b.props.aria;if(t.content){var n="aria-"+t.content,r=w.id;tt(b.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(n);if(b.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 I(){!E&&b.props.aria.expanded&&tt(b.props.triggerTarget||e).forEach((function(e){b.props.interactive?e.setAttribute("aria-expanded",b.state.isVisible&&e===j()?"true":"false"):e.removeAttribute("aria-expanded")}))}function M(){L().removeEventListener("mousemove",v),Pt=Pt.filter((function(e){return e!==v}))}function R(t){if(!vt.isTouch||!d&&"mousedown"!==t.type){var n=t.composedPath&&t.composedPath()[0]||t.target;if(!b.props.interactive||!mt(w,n)){if(tt(b.props.triggerTarget||e).some((function(e){return mt(e,n)}))){if(vt.isTouch)return;if(b.state.isVisible&&b.props.trigger.indexOf("click")>=0)return}else F("onClickOutside",[b,t]);!0===b.props.hideOnClick&&(b.clearDelayTimeouts(),b.hide(),l=!0,setTimeout((function(){l=!1})),b.state.isMounted||N())}}}function H(){d=!0}function V(){d=!1}function W(){var e=L();e.addEventListener("mousedown",R,!0),e.addEventListener("touchend",R,Ke),e.addEventListener("touchstart",V,Ke),e.addEventListener("touchmove",H,Ke)}function N(){var e=L();e.removeEventListener("mousedown",R,!0),e.removeEventListener("touchend",R,Ke),e.removeEventListener("touchstart",V,Ke),e.removeEventListener("touchmove",H,Ke)}function B(e,t){var n=D().box;function r(e){e.target===n&&(ht(n,"remove",r),t())}if(0===e)return t();ht(n,"remove",a),ht(n,"add",r),a=r}function z(t,n,r){void 0===r&&(r=!1),tt(b.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,n,r),m.push({node:e,eventType:t,handler:n,options:r})}))}function q(){var e;_()&&(z("touchstart",$,{passive:!0}),z("touchend",Z,{passive:!0})),(e=b.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(z(e,$),e){case"mouseenter":z("mouseleave",Z);break;case"focus":z(wt?"focusout":"blur",K);break;case"focusin":z("focusout",K)}}))}function U(){m.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,i=e.options;t.removeEventListener(n,r,i)})),m=[]}function $(e){var t,n=!1;if(b.state.isEnabled&&!Y(e)&&!l){var r="focus"===(null==(t=o)?void 0:t.type);o=e,c=e.currentTarget,I(),!b.state.isVisible&&ct(e)&&Pt.forEach((function(t){return t(e)})),"click"===e.type&&(b.props.trigger.indexOf("mouseenter")<0||f)&&!1!==b.props.hideOnClick&&b.state.isVisible?n=!0:ee(e),"click"===e.type&&(f=!n),n&&!r&&te(e)}}function X(e){var t=e.target,n=j().contains(t)||w.contains(t);if("mousemove"!==e.type||!n){var r=Q().concat(w).map((function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:p}:null})).filter(Boolean);(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=rt(i.placement),s=i.modifiersData.offset;if(!s)return!0;var c="bottom"===a?s.top.y:0,u="top"===a?s.bottom.y:0,p="right"===a?s.left.x:0,f="left"===a?s.right.x:0,l=t.top-r+c>o,d=r-t.bottom-u>o,h=t.left-n+p>o,m=n-t.right-f>o;return l||d||h||m}))})(r,e)&&(M(),te(e))}}function Z(e){Y(e)||b.props.trigger.indexOf("click")>=0&&f||(b.props.interactive?b.hideWithInteractivity(e):te(e))}function K(e){b.props.trigger.indexOf("focusin")<0&&e.target!==j()||b.props.interactive&&e.relatedTarget&&w.contains(e.relatedTarget)||te(e)}function Y(e){return!!vt.isTouch&&_()!==e.type.indexOf("touch")>=0}function J(){G();var t=b.props,n=t.popperOptions,r=t.placement,i=t.offset,o=t.getReferenceClientRect,a=t.moveTransition,c=k()?Ct(w).arrow:null,u=o?{getBoundingClientRect:o,contextElement:o.contextElement||j()}:e,p={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(k()){var n=D().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={}}}},f=[{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}},p];k()&&c&&f.push({name:"arrow",options:{element:c,padding:3}}),f.push.apply(f,(null==n?void 0:n.modifiers)||[]),b.popperInstance=qe(u,w,Object.assign({},n,{placement:r,onFirstUpdate:s,modifiers:f}))}function G(){b.popperInstance&&(b.popperInstance.destroy(),b.popperInstance=null)}function Q(){return it(w.querySelectorAll("[data-tippy-root]"))}function ee(e){b.clearDelayTimeouts(),e&&F("onTrigger",[b,e]),W();var t=C(!0),r=T(),i=r[0],o=r[1];vt.isTouch&&"hold"===i&&o&&(t=o),t?n=setTimeout((function(){b.show()}),t):b.show()}function te(e){if(b.clearDelayTimeouts(),F("onUntrigger",[b,e]),b.state.isVisible){if(!(b.props.trigger.indexOf("mouseenter")>=0&&b.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&f)){var t=C(!1);t?r=setTimeout((function(){b.state.isVisible&&b.hide()}),t):i=requestAnimationFrame((function(){b.hide()}))}}else N()}}function Rt(e,t){void 0===t&&(t={});var n=At.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",yt,Ke),window.addEventListener("blur",xt);var r=Object.assign({},t,{plugins:n}),i=pt(e).reduce((function(e,t){var n=t&&Mt(t,r);return n&&e.push(n),e}),[]);return st(e)?i[0]:i}Rt.defaultProps=At,Rt.setDefaultProps=function(e){Object.keys(e).forEach((function(t){At[t]=e[t]}))},Rt.currentInput=vt;Object.assign({},_e,{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)}});Rt.setDefaultProps({render:St});var Ht=Rt;const Vt={init(){[...document.images].forEach((e=>{const t=e.parentNode;"PICTURE"===t.tagName?(this.processPicture(e,t),e.addEventListener("load",this.load.bind(this,e,t))):this.wrapImage(e)}));const e=document.querySelectorAll(".cld-tag");this.tippy(e)},load(e,t){t.querySelectorAll(".overlay-tag").forEach((e=>e.remove())),this.processPicture(e,t),this.tippy(t.querySelectorAll(".cld-tag"))},processPicture(e,t){const n=t.querySelectorAll("source");n.length>0&&n.forEach((t=>{[t.src,t.srcset].some((t=>t.includes(e.currentSrc)))&&([...e.attributes].forEach((t=>{t.name.startsWith("data-")&&e.removeAttribute(t.name)})),Object.assign(e.dataset,{...t.dataset}))})),this.wrapImage(e)},wrapImage(e){e.dataset.publicId?this.cldTag(e):this.wpTag(e)},createTag(e){const t=document.createElement("span");return t.classList.add("overlay-tag"),e.parentNode.insertBefore(t,e),t},cldTag(e){const t=this.createTag(e);t.template=this.createTemplate(e),t.innerText=L("Cloudinary","cloudinary"),t.classList.add("cld-tag")},wpTag(e){const t=this.createTag(e);t.innerText=L("WordPress","cloudinary"),t.classList.add("wp-tag")},createTemplate(e){const t=document.createElement("div");t.classList.add("cld-tag-info"),t.appendChild(this.makeLine(L("Local size","cloudinary"),e.dataset.filesize)),t.appendChild(this.makeLine(L("Optimized size","cloudinary"),e.dataset.optsize)),t.appendChild(this.makeLine(L("Optimized format","cloudinary"),e.dataset.optformat)),e.dataset.percent&&t.appendChild(this.makeLine(L("Reduction","cloudinary"),e.dataset.percent+"%")),t.appendChild(this.makeLine(L("Transformations","cloudinary"),e.dataset.transformations)),e.dataset.transformationCrop&&t.appendChild(this.makeLine(L("Crop transformations","cloudinary"),e.dataset.transformationCrop));const n=document.createElement("a");return n.classList.add("edit-link"),n.href=e.dataset.permalink,n.innerText=L("Edit asset","cloudinary"),t.appendChild(this.makeLine("","",n)),t},makeLine(e,t,n){const r=document.createElement("div"),i=document.createElement("span"),o=document.createElement("span");return i.innerText=e,i.classList.add("title"),o.innerText=t,n&&o.appendChild(n),r.appendChild(i),r.appendChild(o),r},tippy(e){Ht(e,{placement:"bottom-start",interactive:!0,appendTo:()=>document.body,aria:{content:"auto",expanded:"auto"},content:e=>e.template.innerHTML,allowHTML:!0})},debounce(e,t){let n=null;return(...r)=>{window.clearTimeout(n),n=window.setTimeout((()=>{e(...r)}),t)}}};window.addEventListener("load",(()=>Vt.init()))}()}(); \ No newline at end of file diff --git a/languages/cloudinary.pot b/languages/cloudinary.pot index a9dd52e28..b39d9f8fe 100644 --- a/languages/cloudinary.pot +++ b/languages/cloudinary.pot @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: Cloudinary STABLETAG\n" "Report-Msgid-Bugs-To: https://github.com/cloudinary/cloudinary_wordpress\n" -"POT-Creation-Date: 2024-10-22 15:03:23+00:00\n" +"POT-Creation-Date: 2024-12-20 16:52:13+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -122,79 +122,79 @@ msgstr "" msgid "External Asset Sync Settings" msgstr "" -#: php/class-assets.php:1280 php/class-cache.php:615 +#: php/class-assets.php:1304 php/class-cache.php:615 msgid "Plugin" msgstr "" -#: php/class-assets.php:1316 php/class-cache.php:792 +#: php/class-assets.php:1340 php/class-cache.php:792 msgid "Plugins" msgstr "" -#: php/class-assets.php:1334 php/class-cache.php:809 +#: php/class-assets.php:1358 php/class-cache.php:809 msgid "Deliver assets from all plugin folders" msgstr "" -#: php/class-assets.php:1366 php/class-cache.php:652 +#: php/class-assets.php:1390 php/class-cache.php:652 msgid "Theme" msgstr "" -#: php/class-assets.php:1398 php/class-cache.php:843 +#: php/class-assets.php:1422 php/class-cache.php:843 msgid "Themes" msgstr "" -#: php/class-assets.php:1416 php/class-cache.php:860 +#: php/class-assets.php:1440 php/class-cache.php:860 msgid "Deliver all assets from active theme." msgstr "" -#: php/class-assets.php:1441 php/class-assets.php:1476 php/class-cache.php:684 +#: php/class-assets.php:1465 php/class-assets.php:1500 php/class-cache.php:684 #: php/class-cache.php:895 msgid "WordPress" msgstr "" -#: php/class-assets.php:1450 php/class-cache.php:668 +#: php/class-assets.php:1474 php/class-cache.php:668 msgid "WordPress Admin" msgstr "" -#: php/class-assets.php:1457 php/class-cache.php:675 +#: php/class-assets.php:1481 php/class-cache.php:675 msgid "WordPress Includes" msgstr "" -#: php/class-assets.php:1494 php/class-cache.php:912 +#: php/class-assets.php:1518 php/class-cache.php:912 msgid "Deliver all assets from WordPress core." msgstr "" -#: php/class-assets.php:1520 php/class-assets.php:1546 php/class-cache.php:708 +#: php/class-assets.php:1544 php/class-assets.php:1570 php/class-cache.php:708 #: php/class-cache.php:947 msgid "Content" msgstr "" -#: php/class-assets.php:1527 php/class-cache.php:699 +#: php/class-assets.php:1551 php/class-cache.php:699 msgid "Uploads" msgstr "" -#: php/class-assets.php:1564 php/class-cache.php:964 +#: php/class-assets.php:1588 php/class-cache.php:964 msgid "Deliver all content assets from WordPress Media Library." msgstr "" -#: php/class-assets.php:1588 +#: php/class-assets.php:1612 msgid "Enable external assets" msgstr "" -#: php/class-assets.php:1589 +#: php/class-assets.php:1613 msgid "" "Enabling external assets allows you to sync assets from specific external " "sources with Cloudinary." msgstr "" -#: php/class-assets.php:1599 +#: php/class-assets.php:1623 msgid "Domains for each external source." msgstr "" -#: php/class-assets.php:1602 +#: php/class-assets.php:1626 msgid "Enter a domain" msgstr "" -#: php/class-assets.php:1603 +#: php/class-assets.php:1627 msgid "Press ENTER or SPACE or type comma or tab to continue." msgstr "" @@ -506,14 +506,14 @@ msgstr "" msgid "Unsynced" msgstr "" -#: php/class-media.php:455 +#: php/class-media.php:449 #. translators: variable is file size. msgid "" "File size exceeds the maximum of %s. This media asset will be served from " "WordPress." msgstr "" -#: php/class-media.php:2057 +#: php/class-media.php:2051 msgid "Import" msgstr "" @@ -521,43 +521,43 @@ msgstr "" msgid "Cloudinary" msgstr "" -#: php/class-media.php:2413 +#: php/class-media.php:2407 msgid "The delivery for this asset is disabled." msgstr "" -#: php/class-media.php:2417 +#: php/class-media.php:2411 msgid "Not syncable. This is an external media." msgstr "" -#: php/class-media.php:2421 +#: php/class-media.php:2415 msgid "This media is Fetch type." msgstr "" -#: php/class-media.php:2425 +#: php/class-media.php:2419 msgid "This media is Sprite type." msgstr "" -#: php/class-media.php:2435 +#: php/class-media.php:2429 msgid "Not Synced" msgstr "" -#: php/class-media.php:2440 +#: php/class-media.php:2434 msgid "Synced" msgstr "" -#: php/class-media.php:3091 +#: php/class-media.php:3085 msgid "No Cloudinary filters" msgstr "" -#: php/class-media.php:3191 +#: php/class-media.php:3185 msgid "Media Settings" msgstr "" -#: php/class-media.php:3194 +#: php/class-media.php:3188 msgid "Media Display" msgstr "" -#: php/class-media.php:3198 php/media/class-global-transformations.php:620 +#: php/class-media.php:3192 php/media/class-global-transformations.php:620 #: php/ui/component/class-asset-preview.php:73 #: php/ui/component/class-plan-details.php:119 #: php/ui/component/class-plan-status.php:128 @@ -565,7 +565,7 @@ msgstr "" msgid "Transformations" msgstr "" -#: php/class-media.php:3199 +#: php/class-media.php:3193 msgid "" "Cloudinary allows you to easily transform your images on-the-fly to any " "required format, style and dimension, and also optimizes images for minimal " @@ -574,12 +574,12 @@ msgid "" "transformation and delivery URLs." msgstr "" -#: php/class-media.php:3204 ui-definitions/settings-image.php:171 +#: php/class-media.php:3198 ui-definitions/settings-image.php:171 #: ui-definitions/settings-video.php:257 msgid "See examples" msgstr "" -#: php/class-plugin.php:742 +#: php/class-plugin.php:751 msgid "Visit plugin site" msgstr "" @@ -769,7 +769,7 @@ msgstr "" msgid "Cloudinary only" msgstr "" -#: php/class-sync.php:1304 php/delivery/class-lazy-load.php:538 +#: php/class-sync.php:1304 php/delivery/class-lazy-load.php:543 #: php/media/class-gallery.php:416 ui-definitions/components/header.php:19 #: ui-definitions/settings-image.php:253 ui-definitions/settings-pages.php:206 #: ui-definitions/settings-pages.php:222 ui-definitions/settings-pages.php:223 @@ -799,46 +799,46 @@ msgstr "" msgid "Debug log is empty" msgstr "" -#: php/class-utils.php:837 +#: php/class-utils.php:841 msgid "Missing SRC attribute." msgstr "" -#: php/class-utils.php:874 +#: php/class-utils.php:879 #. translators: The attachment ID. msgid "Clean up sync metadata for %d" msgstr "" -#: php/class-utils.php:922 +#: php/class-utils.php:927 msgid "Thumbnail" msgstr "" -#: php/class-utils.php:923 +#: php/class-utils.php:928 msgid "Medium" msgstr "" -#: php/class-utils.php:924 +#: php/class-utils.php:929 msgid "Medium Large" msgstr "" -#: php/class-utils.php:925 +#: php/class-utils.php:930 msgid "Large" msgstr "" -#: php/class-utils.php:926 +#: php/class-utils.php:931 msgid "Full Size" msgstr "" -#: php/class-utils.php:1279 +#: php/class-utils.php:1284 msgid "Cloudinary global transformations" msgstr "" -#: php/class-utils.php:1286 +#: php/class-utils.php:1291 #. translators: %1$s is the taxonomy label and the %2$s is the context of the #. use. msgid "%1$s %2$s transformations" msgstr "" -#: php/class-utils.php:1296 +#: php/class-utils.php:1301 #. translators: %s is the term name. msgid "%s transformations" msgstr "" @@ -860,108 +860,108 @@ msgstr "" msgid "Deliver from WordPress" msgstr "" -#: php/delivery/class-lazy-load.php:400 php/delivery/class-lazy-load.php:401 -#: php/delivery/class-lazy-load.php:433 +#: php/delivery/class-lazy-load.php:405 php/delivery/class-lazy-load.php:406 +#: php/delivery/class-lazy-load.php:438 msgid "Lazy loading" msgstr "" -#: php/delivery/class-lazy-load.php:408 +#: php/delivery/class-lazy-load.php:413 msgid "Lazy Loading" msgstr "" -#: php/delivery/class-lazy-load.php:415 ui-definitions/settings-image.php:23 +#: php/delivery/class-lazy-load.php:420 ui-definitions/settings-image.php:23 #: ui-definitions/settings-pages.php:100 ui-definitions/settings-video.php:23 msgid "Settings" msgstr "" -#: php/delivery/class-lazy-load.php:419 php/delivery/class-lazy-load.php:529 +#: php/delivery/class-lazy-load.php:424 php/delivery/class-lazy-load.php:534 #: ui-definitions/settings-image.php:27 ui-definitions/settings-image.php:240 #: ui-definitions/settings-pages.php:104 ui-definitions/settings-pages.php:197 #: ui-definitions/settings-video.php:27 msgid "Preview" msgstr "" -#: php/delivery/class-lazy-load.php:431 +#: php/delivery/class-lazy-load.php:436 msgid "Enable lazy loading" msgstr "" -#: php/delivery/class-lazy-load.php:432 +#: php/delivery/class-lazy-load.php:437 msgid "" "Lazy loading delays the initialization of your web assets to improve page " "load times." msgstr "" -#: php/delivery/class-lazy-load.php:444 +#: php/delivery/class-lazy-load.php:449 msgid "Lazy loading threshold" msgstr "" -#: php/delivery/class-lazy-load.php:445 +#: php/delivery/class-lazy-load.php:450 msgid "How far down the page to start lazy loading assets." msgstr "" -#: php/delivery/class-lazy-load.php:461 +#: php/delivery/class-lazy-load.php:466 msgid "Pre-loader color" msgstr "" -#: php/delivery/class-lazy-load.php:462 +#: php/delivery/class-lazy-load.php:467 msgid "" "On page load, the pre-loader is used to fill the space while the image is " "downloaded, preventing content shift." msgstr "" -#: php/delivery/class-lazy-load.php:471 +#: php/delivery/class-lazy-load.php:476 msgid "Pre-loader animation" msgstr "" -#: php/delivery/class-lazy-load.php:481 +#: php/delivery/class-lazy-load.php:486 msgid "Placeholder generation type" msgstr "" -#: php/delivery/class-lazy-load.php:482 +#: php/delivery/class-lazy-load.php:487 msgid "" "Placeholders are low-res representations of the image, that's loaded below " "the fold. They are then replaced with the actual image, just before it " "comes into view." msgstr "" -#: php/delivery/class-lazy-load.php:492 +#: php/delivery/class-lazy-load.php:497 msgid "Blur" msgstr "" -#: php/delivery/class-lazy-load.php:493 +#: php/delivery/class-lazy-load.php:498 msgid "Pixelate" msgstr "" -#: php/delivery/class-lazy-load.php:494 +#: php/delivery/class-lazy-load.php:499 msgid "Vectorize" msgstr "" -#: php/delivery/class-lazy-load.php:495 +#: php/delivery/class-lazy-load.php:500 msgid "Dominant Color" msgstr "" -#: php/delivery/class-lazy-load.php:496 php/delivery/class-lazy-load.php:511 +#: php/delivery/class-lazy-load.php:501 php/delivery/class-lazy-load.php:516 #: ui-definitions/settings-video.php:142 msgid "Off" msgstr "" -#: php/delivery/class-lazy-load.php:507 +#: php/delivery/class-lazy-load.php:512 msgid "DPR settings" msgstr "" -#: php/delivery/class-lazy-load.php:508 +#: php/delivery/class-lazy-load.php:513 msgid "The device pixel ratio to use for your generated images." msgstr "" -#: php/delivery/class-lazy-load.php:512 +#: php/delivery/class-lazy-load.php:517 msgid "Auto (2x)" msgstr "" -#: php/delivery/class-lazy-load.php:513 +#: php/delivery/class-lazy-load.php:518 msgid "Max DPR" msgstr "" -#: php/delivery/class-lazy-load.php:541 +#: php/delivery/class-lazy-load.php:546 #. Translators: The HTML for opening and closing link tags. msgid "" "Watch free lessons on how to use the Lazy Load Settings in the " diff --git a/php/class-assets.php b/php/class-assets.php index 3884586ac..4c366b2b0 100644 --- a/php/class-assets.php +++ b/php/class-assets.php @@ -1265,6 +1265,30 @@ public function register_settings( $pages ) { return $pages; } + /** + * Checks if the URL is an asset. + * + * @param string $url The URL to check. + * + * @return bool + */ + public function is_asset( $url ) { + global $wpdb; + + // Bail early if it's not an URL. + if ( empty( parse_url( $url, PHP_URL_HOST ) ) ) { + return false; + } + + $url = Utils::clean_url( $url ); + + $wpdb->cld_table = Utils::get_relationship_table(); + $prepare = $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->cld_table WHERE sized_url = %s AND sync_type = 'asset';", $url ); + $result = $wpdb->get_var( $prepare ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery, WordPress.DB.PreparedSQL.NotPrepared + + return (bool) $result; + } + /** * Get the plugins table structure. * diff --git a/php/class-cron.php b/php/class-cron.php index 8f2da6294..36a5419df 100644 --- a/php/class-cron.php +++ b/php/class-cron.php @@ -448,4 +448,12 @@ public function cleanup_failed_cron() { $this->locker->delete_lock_file( $this->init_time ); } + /** + * Allow cleanup of the locker. + * + * @return void + */ + public function cleanup_locker() { + $this->locker->delete_lock_file(); + } } diff --git a/php/class-deactivation.php b/php/class-deactivation.php index 511f34498..28075e12f 100644 --- a/php/class-deactivation.php +++ b/php/class-deactivation.php @@ -64,8 +64,6 @@ public function __construct( Plugin $plugin ) { add_action( 'init', array( $this, 'load_hooks' ) ); add_action( 'current_screen', array( $this, 'maybe_load_hooks' ) ); add_action( 'cloudinary_init_settings', array( $this, 'settings_init' ) ); - - add_filter( 'plugin_action_links_' . $this->plugin->plugin_file, array( $this, 'tag_deactivate' ) ); } /** @@ -78,6 +76,7 @@ public function __construct( Plugin $plugin ) { public function load_hooks() { add_filter( 'cloudinary_api_rest_endpoints', array( $this, 'rest_endpoint' ) ); add_action( 'cloudinary_cleanup_event', array( $this, 'cleanup' ) ); + add_filter( 'plugin_action_links_' . $this->plugin->plugin_file, array( $this, 'tag_deactivate' ) ); } /** @@ -479,6 +478,8 @@ protected function cleanup() { $this->cleanup_post_type(); $this->drop_tables(); $this->cleanup_options(); + $this->cleanup_cron(); + $this->cleanup_legacy_cron(); // If we got this far, let's remove the cron event. wp_clear_scheduled_hook( 'cloudinary_cleanup_event' ); @@ -600,4 +601,51 @@ protected function cleanup_options() { delete_transient( $key ); } } + + /** + * Remove all cron-related tasks. + * + * @return void + */ + protected function cleanup_cron() { + // Get the Cron instance. + $cron_instance = Cron::get_instance(); + $schedule = $cron_instance->get_schedule(); + + // Unregister all registered schedules. + if ( ! empty( $schedule ) ) { + foreach ( array_keys( $schedule ) as $schedule_name ) { + $cron_instance->unregister_schedule( $schedule_name ); + } + } + + // Remove any lock files or objects used by the Locker instance. + $cron_instance->cleanup_locker(); + + // Delete the cron schedule option saved in database. + delete_option( Cron::CRON_META_KEY ); + } + + /** + * Cleanup legacy cron jobs. + * + * @return void + */ + protected function cleanup_legacy_cron() { + wp_clear_scheduled_hook( 'cloudinary_status' ); + + $jobs = array( + 'cloudinary_rest_api_connectivity', + 'cloudinary_resume_queue', + 'cloudinary_resume_upgrade', + 'cloudinary_sync_items', + ); + + foreach ( $jobs as $job ) { + $time = wp_next_scheduled( $job ); + if ( false !== $time ) { + wp_clear_scheduled_hook( $job ); + } + } + } } diff --git a/php/class-delivery.php b/php/class-delivery.php index 5c1a692b8..ec9ed2ade 100644 --- a/php/class-delivery.php +++ b/php/class-delivery.php @@ -142,6 +142,7 @@ public function init() { add_action( 'before_delete_post', array( $this, 'delete_size_relationship' ) ); add_action( 'delete_attachment', array( $this, 'delete_size_relationship' ) ); add_action( 'cloudinary_register_sync_types', array( $this, 'register_sync_type' ), 30 ); + add_action( 'rest_request_before_callbacks', array( $this, 'maybe_unset_attributes' ), 10, 3 ); add_action( 'the_post', function ( $post ) { @@ -158,6 +159,71 @@ function ( $post ) { } } + /** + * Determine if attributes should be added to image tags. + * + * @param WP_REST_Response $response The response object. + * @param WP_REST_Server $handler The request handler. + * @param WP_REST_Request|null $request The request object, if available. + * + * @return void + */ + public function maybe_unset_attributes( $response, $handler, $request ) { + $route = $request->get_route(); + + if ( + (bool) $request->get_header( 'x-cld-fetch-from-editor' ) + || ( + false !== strpos( $route, 'wp/v2/media' ) + && 'edit' === $request->get_param( 'context' ) + ) + ) { + // This has a priority of 10 so can be overridden by other filters. + add_filter( + 'cloudinary_unset_attributes', + '__return_true' + ); + + add_filter( + 'cloudinary_apply_breakpoints', + '__return_false' + ); + + add_filter( + 'cloudinary_parse_element', + static function ( $tag_element ) { + $tag_element['breakpoints'] = false; + return $tag_element; + } + ); + + add_filter( + 'cloudinary_skip_responsive_breakpoints', + '__return_true' + ); + + if ( false === strpos( $route, 'wp/v2/blocks/' ) ) { + add_filter( + 'cloudinary_tag_skip_classes', + function ( $skip, $tag_element ) { + // Bail on additional assets. + return $this->plugin->get_component( 'assets' )->is_asset( $tag_element['atts']['src'] ); + }, + 10, + 2 + ); + + add_filter( + 'cloudinary_parse_element', + function ( $element ) { + unset( $element['atts']['class'] ); + return $element; + } + ); + } + } + } + /** * Maybe filter out Cloudinary URLs in post meta. * @@ -816,6 +882,7 @@ public function process_featured_image( $html, $post_id, $attachment_id ) { if ( empty( $html ) ) { return $html; // Ignore empty tags. } + $tags = $this->get_media_tags( $html, 'img' ); $tags = array_map( array( $this, 'parse_element' ), $tags ); $tags = array_filter( $tags ); @@ -971,7 +1038,7 @@ public function convert_tags( $content, $context = 'view' ) { $cached = $has_cache[ $type ]; } - $tags = $this->get_media_tags( $content, 'img|video|article' ); + $tags = $this->get_media_tags( $content, 'img|video|article|source' ); $tags = array_map( array( $this, 'parse_element' ), $tags ); $tags = array_filter( $tags ); @@ -1109,8 +1176,36 @@ protected function standardize_tag( $tag_element ) { if ( isset( $tag_element['format'] ) ) { $tag_element['atts']['data-format'] = $tag_element['format']; } + + /** + * Maybe skip the classes for th tag element. + * + * @hook cloudinary_tag_skip_classes + * @since 3.2.4 + * @default {false} + * + * @param $skip {bool} True to unset attributes. + * @param $tag_element {array} The tag element. + * + * @retun {bool} + */ + $skip_classes = apply_filters( 'cloudinary_tag_skip_classes', false, $tag_element ); + // Add wp-{media-type}-{id} class name. - if ( empty( $tag_element['atts']['class'] ) || ! in_array( 'wp-' . $tag_element['type'] . '-' . $tag_element['id'], $tag_element['atts']['class'], true ) ) { + if ( + ! $skip_classes + && + ( + empty( $tag_element['atts']['class'] ) + || + ( + is_array( $tag_element['atts']['class'] ) + && + ! in_array( 'wp-' . $tag_element['type'] . '-' . $tag_element['id'], $tag_element['atts']['class'], true ) + ) + ) + ) { + $tag_element['atts']['class'] = ! empty( $tag_element['atts']['class'] ) ? $tag_element['atts']['class'] : array(); $tag_element['atts']['class'][] = 'wp-' . $tag_element['type'] . '-' . $tag_element['id']; } @@ -1171,6 +1266,32 @@ protected function standardize_tag( $tag_element ) { $att = implode( ' ', $parts ); } + /** + * Unset the attributes to avoid block errors in the admin. + * + * @hook cloudinary_unset_attributes + * @since 3.2.4 + * @default {false} + * + * @param $unset {bool} True to unset attributes. + * @param $tag_element {array} The tag element. + * + * @retun {bool} + */ + if ( apply_filters( 'cloudinary_unset_attributes', false, $tag_element ) ) { + unset( + $tag_element['atts']['data-public-id'], + $tag_element['atts']['data-format'], + $tag_element['atts']['width'], + $tag_element['atts']['height'], + $tag_element['atts']['data-crop'], + $tag_element['atts']['srcset'], + $tag_element['atts']['data-responsive'] + ); + + return $tag_element; + } + // Add transformations attribute. $transformations = $this->media->get_transformations_from_string( $tag_element['atts']['src'] ); if ( false !== $this->media->get_crop_from_transformation( $transformations ) ) { @@ -1207,6 +1328,7 @@ protected function standardize_tag( $tag_element ) { * @return {string} */ $permalink = apply_filters( 'cloudinary_edit_asset_permalink', add_query_arg( 'asset', $tag_element['id'], $base_url ) ); + $tag_element['atts']['data-permalink'] = $permalink; } @@ -1365,14 +1487,14 @@ public function parse_element( $element ) { return null; } - $tag_element['type'] = 'img' === $tag_element['tag'] ? 'image' : $tag_element['tag']; - $third_party_change = Utils::maybe_get_third_party_changes( $attributes ); + $tag_element['type'] = in_array( $tag_element['tag'], array( 'img', 'source' ), true ) ? 'image' : $tag_element['tag']; + $third_party_change = Utils::maybe_get_third_party_changes( $attributes, $tag_element['tag'] ); if ( ! empty( $third_party_change ) ) { Utils::log( $third_party_change, 'third-party-loading' ); return null; } - $raw_url = $attributes['src']; + $raw_url = 'source' === $tag_element['tag'] && ! empty( $attributes['srcset'] ) ? $attributes['srcset'] : $attributes['src']; $url = $this->maybe_unsize_url( Utils::clean_url( $this->sanitize_url( $raw_url ) ) ); $tag_element['base_url'] = $url; // Track back the found URL. @@ -1401,7 +1523,7 @@ public function parse_element( $element ) { $attributes['data-public-id'] = $public_id; $tag_element['format'] = $item['format']; - if ( 'img' === $tag_element['tag'] ) { + if ( in_array( $tag_element['tag'], array( 'img', 'source' ), true ) ) { // Check if this is a crop or a scale. $has_size = $this->media->get_size_from_url( $this->sanitize_url( $raw_url ) ); if ( ! empty( $has_size ) && ! empty( $item['height'] ) ) { @@ -1423,8 +1545,9 @@ public function parse_element( $element ) { } } } + if ( ! empty( $attributes['class'] ) ) { - if ( preg_match( '/wp-post-(\d+)+/', $attributes['class'], $match ) ) { + if ( preg_match( '/wp-post-(\d+)/', $attributes['class'], $match ) ) { $tag_element['context'] = (int) $match[1]; $post_context = $tag_element['context']; } @@ -1443,6 +1566,7 @@ public function parse_element( $element ) { $attributes['class'][] = 'cld-overwrite'; $tag_element['overwrite_transformations'] = true; } + $inline_transformations = $this->get_transformations_maybe( $raw_url ); if ( $inline_transformations ) { // Ensure that we don't get duplicated transformations. diff --git a/php/class-plugin.php b/php/class-plugin.php index 0ff01421c..c2cc26833 100644 --- a/php/class-plugin.php +++ b/php/class-plugin.php @@ -422,6 +422,7 @@ private function is_notice_component( $component ) { */ public function init() { require_once ABSPATH . 'wp-admin/includes/plugin.php'; + $plugin = get_plugin_data( CLDN_CORE ); $location = $this->locate_plugin(); $this->slug = ! empty( $plugin['TextDomain'] ) ? $plugin['TextDomain'] : $location['dir_basename']; @@ -586,7 +587,7 @@ protected function setup_endpoints() { * The Cloudinary Video Player version. */ if ( ! defined( 'CLOUDINARY_ENDPOINTS_VIDEO_PLAYER_VERSION' ) ) { - define( 'CLOUDINARY_ENDPOINTS_VIDEO_PLAYER_VERSION', '1.11.1' ); + define( 'CLOUDINARY_ENDPOINTS_VIDEO_PLAYER_VERSION', '2.2.0' ); } } diff --git a/php/class-utils.php b/php/class-utils.php index 076e74bf7..0f774118b 100644 --- a/php/class-utils.php +++ b/php/class-utils.php @@ -331,6 +331,8 @@ protected static function table_installed() { * Install our custom table. */ public static function install() { + // Ensure that the plugin bootstrap is loaded. + get_plugin_instance()->init(); $sql = self::get_table_sql(); @@ -790,11 +792,12 @@ public static function get_debug_messages() { /** * Check if the tag attributes contain possible third party manipulated data, and return found data. * - * @param array $attributes The tag attributes. + * @param array $attributes The tag attributes. + * @param string $tag The tag. * * @return string|false */ - public static function maybe_get_third_party_changes( $attributes ) { + public static function maybe_get_third_party_changes( $attributes, $tag ) { static $filtered_keys, $filtered_classes; $lazy_keys = array( 'src', @@ -833,14 +836,18 @@ public static function maybe_get_third_party_changes( $attributes ) { $filtered_classes = apply_filters( 'cloudinary_ignored_class_keywords', $lazy_classes ); } $is = false; - if ( ! isset( $attributes['src'] ) ) { - $is = __( 'Missing SRC attribute.', 'cloudinary' ); - } elseif ( false !== strpos( $attributes['src'], 'data:image' ) ) { - $is = $attributes['src']; - } elseif ( isset( $attributes['class'] ) ) { - $classes = explode( '-', str_replace( ' ', '-', $attributes['class'] ) ); - if ( ! empty( array_intersect( $filtered_classes, $classes ) ) ) { - $is = $attributes['class']; + + // Source tag on Picture tags are not lazy-loaded. + if ( 'source' !== $tag ) { + if ( ! isset( $attributes['src'] ) ) { + $is = __( 'Missing SRC attribute.', 'cloudinary' ); + } elseif ( false !== strpos( $attributes['src'], 'data:image' ) ) { + $is = $attributes['src']; + } elseif ( isset( $attributes['class'] ) ) { + $classes = explode( '-', str_replace( ' ', '-', $attributes['class'] ) ); + if ( ! empty( array_intersect( $filtered_classes, $classes ) ) ) { + $is = $attributes['class']; + } } } diff --git a/php/delivery/class-lazy-load.php b/php/delivery/class-lazy-load.php index 92b2a0c9e..8624279b7 100644 --- a/php/delivery/class-lazy-load.php +++ b/php/delivery/class-lazy-load.php @@ -83,6 +83,11 @@ public function bypass_lazy_load( $bypass, $tag_element ) { $bypass = true; } + // Sources on Picture tag are not lazyloaded. + if ( 'source' === $tag_element['tag'] ) { + $bypass = true; + } + /** * Filter the classes that bypass lazy loading. * diff --git a/php/delivery/class-responsive-breakpoints.php b/php/delivery/class-responsive-breakpoints.php index 43c2babaa..b147ba232 100644 --- a/php/delivery/class-responsive-breakpoints.php +++ b/php/delivery/class-responsive-breakpoints.php @@ -59,6 +59,22 @@ public function add_features( $tag_element ) { return $tag_element; } + /** + * Do not add the responsive breakpoint features. + * + * @hook cloudinary_skip_responsive_breakpoints + * @since 3.2.4 + * @default {false} + * + * @param $skip_features {bool} True to skip adding in the features. + * @param $tag_element {array} The tag element. + * + * @return {bool} + */ + if ( apply_filters( 'cloudinary_skip_responsive_breakpoints', false, $tag_element ) ) { + return $tag_element; + } + // Bypass file formats that shouldn't have Responsive Images. if ( in_array( diff --git a/readme.txt b/readme.txt index f72eb727a..983ede424 100644 --- a/readme.txt +++ b/readme.txt @@ -142,6 +142,16 @@ Your site is now setup to start using Cloudinary. == Changelog == += 3.2.4 (14 January 2025) = + +Fixes and Improvements: + +* Upgraded the Cloudinary Video Player to v2.2.0 +* Fixed image block validation errors in the Block Patterns UI +* Resolved image block error messages that required recovery +* De-registered all Cloudinary cron jobs when deactivating the plugin + + = 3.2.3 (03 December 2024) = Fixes and Improvements: @@ -151,6 +161,7 @@ Fixes and Improvements: * Addressed an issue preventing the activation of the crop and gravity beta feature at the asset level * Fixed the timing of when translations are loaded to comply with updated WordPress initialization requirements + = 3.2.2 (28 October 2024) = Fixes and improvements: diff --git a/src/js/blocks.js b/src/js/blocks.js index 27c060bf2..3cd0e30d3 100644 --- a/src/js/blocks.js +++ b/src/js/blocks.js @@ -1,18 +1,55 @@ +/** + * WordPress dependencies + */ +import apiFetch from '@wordpress/api-fetch'; + /** * Internal dependencies */ import Video from './components/video'; import Featured from './components/featured-image'; import Terms from './components/terms-inspector'; -import MaybeReloadAfterSave from './components/maybe-reload-after-save'; // jQuery, because reasons. window.$ = window.jQuery; +// Register middleware for @wordpress/api-fetch to indicate the fetch is coming from the editor. +// Taken from https://github.com/Automattic/jetpack/blob/trunk/projects/plugins/jetpack/extensions/editor.js. +apiFetch.use( ( options, next ) => { + // Skip explicit cors requests. + if ( options.mode === 'cors' ) { + return next( options ); + } + + // If a URL is set, skip if it's not same-origin. + // @see https://html.spec.whatwg.org/multipage/origin.html#same-origin + if ( options.url ) { + try { + const url = new URL( options.url, location.href ); + if ( + url.protocol !== location.protocol || + url.hostname !== location.hostname || + url.port !== location.port + ) { + return next( options ); + } + } catch { + // Huh? Skip it. + return next( options ); + } + } + + // Ok, add header. + if ( ! options.headers ) { + options.headers = {}; + } + options.headers[ 'x-cld-fetch-from-editor' ] = 'true'; + return next( options ); +} ); + // Global Constants export const cloudinaryBlocks = { Video, Featured, Terms, - MaybeReloadAfterSave, }; diff --git a/src/js/components/maybe-reload-after-save.js b/src/js/components/maybe-reload-after-save.js deleted file mode 100644 index b934e4988..000000000 --- a/src/js/components/maybe-reload-after-save.js +++ /dev/null @@ -1,25 +0,0 @@ -import { registerPlugin } from '@wordpress/plugins'; -import { useSelect } from '@wordpress/data'; -import { useEffect } from '@wordpress/element'; - -const MaybeReloadAfterSave = () => { - const isSaving = useSelect( ( select ) => - select( 'core/editor' ).isSavingPost() - ); - const isDirty = useSelect( ( select ) => - select( 'core/editor' ).isEditedPostDirty() - ); - const { storage } = window?.CLDN || null; - - useEffect( () => { - if ( isSaving && ! isDirty && 'cld' === storage ) { - window.location.reload(); - } - }, [ isSaving ] ); -}; - -registerPlugin( 'cloudinary-maybe-reload-after-save', { - render: MaybeReloadAfterSave, -} ); - -export default MaybeReloadAfterSave; diff --git a/src/js/front-overlay.js b/src/js/front-overlay.js index 97024a01d..c7b872b92 100644 --- a/src/js/front-overlay.js +++ b/src/js/front-overlay.js @@ -8,24 +8,44 @@ const Front_Overlay = { init() { [ ...document.images ].forEach( ( image ) => { - this.wrapImage( image ); - } ); + const parent = image.parentNode; + if ( parent.tagName === 'PICTURE' ) { + this.processPicture( image, parent ); + image.addEventListener( 'load', this.load.bind( this, image, parent) ); + } else { + this.wrapImage( image ); + } + }); const tooltips = document.querySelectorAll( '.cld-tag' ); - tippy( tooltips, { - placement: 'bottom-start', - interactive: true, - appendTo: () => document.body, - aria: { - content: 'auto', - expanded: 'auto', - }, - content( reference ) { - return reference.template.innerHTML; - }, - allowHTML: true, - } ); + this.tippy( tooltips ); + }, + load( image, parent ) { + parent.querySelectorAll( '.overlay-tag' ).forEach( tag => tag.remove() ); + this.processPicture( image, parent ); + this.tippy( parent.querySelectorAll( '.cld-tag' ) ); + }, + processPicture( image, parent ) { + const siblings = parent.querySelectorAll( 'source' ); + if ( siblings.length > 0 ) { + siblings.forEach( + ( sibling ) => { + if ( [ sibling.src, sibling.srcset ].some( src => src.includes( image.currentSrc ) )) { + [ ...image.attributes ].forEach( + attr => { + if ( attr.name.startsWith( 'data-' ) ) { + image.removeAttribute( attr.name ); + } + } + ); + Object.assign( image.dataset, { ...sibling.dataset } ); + } + } + ); + } + + this.wrapImage( image ); }, wrapImage( image ) { if ( image.dataset.publicId ) { @@ -104,6 +124,33 @@ const Front_Overlay = { line.appendChild( title ); line.appendChild( detail ); return line; + }, + tippy( tooltips ) { + tippy( tooltips, { + placement: 'bottom-start', + interactive: true, + appendTo: () => document.body, + aria: { + content: 'auto', + expanded: 'auto', + }, + content( reference ) { + return reference.template.innerHTML; + }, + allowHTML: true, + } ); + }, + debounce( callback, wait ) { + let timeoutId = null; + return (...args) => { + window.clearTimeout( timeoutId ); + timeoutId = window.setTimeout( + () => { + callback( ...args ); + }, + wait + ); + }; } };