diff --git a/cloudinary.php b/cloudinary.php index 0b5b22251..2b6223bcc 100644 --- a/cloudinary.php +++ b/cloudinary.php @@ -3,7 +3,7 @@ * Plugin Name: Cloudinary * Plugin URI: https://cloudinary.com/documentation/wordpress_integration * Description: With the Cloudinary plugin, you can upload and manage your media assets in the cloud, then deliver them to your users through a fast content delivery network, improving your website’s loading speed and overall user experience. Apply multiple transformations and take advantage of a full digital asset management solution without leaving WordPress. - * Version: 2.6.0 + * Version: 2.7.0-RC-6 * Author: Cloudinary Ltd., XWP * Author URI: https://cloudinary.com/ * License: GPLv2+ diff --git a/js/cloudinary.js b/js/cloudinary.js index 33fb67ff1..4fee75c04 100644 --- a/js/cloudinary.js +++ b/js/cloudinary.js @@ -1 +1 @@ -!function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=7)}([function(e,t){!function(){const e=function(){const e=jQuery("#field-video_player").val(),t=jQuery("#field-video_controls").prop("checked"),n=jQuery('#field-video_autoplay_mode option[value="off"]');"cld"!==e||t?n.prop("disabled",!1):(n.prop("disabled",!0),n.prop("selected")&&n.next().prop("selected",!0))};e(),jQuery(document).on("change","#field-video_player",e),jQuery(document).on("change","#field-video_controls",e),jQuery(document).ready((function(e){e.isFunction(e.fn.wpColorPicker)&&e(".regular-color").wpColorPicker(),e(document).on("tabs.init",(function(){const t=e(".settings-tab-trigger"),n=e(".settings-tab-section");e(this).on("click",".settings-tab-trigger",(function(i){const r=e(this),o=e(r.attr("href"));i.preventDefault(),t.removeClass("active"),n.removeClass("active"),r.addClass("active"),o.addClass("active"),e(document).trigger("settings.tabbed",r)})),e(".cld-field").not('[data-condition="false"]').each((function(){const t=e(this),n=t.data("condition");for(const i in n){let r=e("#field-"+i);const o=n[i],a=t.closest("tr");r.length||(r=e(`[id^=field-${i}-]`));let s=!1;r.on("change init",(function(e,t=!1){if(s&&t)return;let n=this.value===o||this.checked;if(Array.isArray(o)&&2===o.length)switch(o[1]){case"neq":n=this.value!==o[0];break;case"gt":n=this.value>o[0];break;case"lt":n=this.value=0&&(e.metadata.cldoverwrite="true")})),wp.media.events.on("editor:image-update",(function(e){const t=e.image.className.split(" ");e.metadata.cldoverwrite&&-1===t.indexOf("cld-overwrite")?t.push("cld-overwrite"):!e.metadata.cldoverwrite&&t.indexOf("cld-overwrite")>=0&&delete t[t.indexOf("cld-overwrite")],e.image.className=t.join(" ")}));let e=null;const t=wp.media.string.props;wp.media.string.props=function(n,i){n.cldoverwrite&&(n.classes=["cld-overwrite"],e=!0);return t(n,i)},wp.media.post=function(t,n){if("send-attachment-to-editor"===t){const t=wp.media.editor.get().state().get("selection").get(n.attachment);t.attributes.transformations&&(n.attachment.transformations=t.attributes.transformations),(n.html.indexOf("cld-overwrite")>-1||!0===e)&&(n.attachment.cldoverwrite=!0,e=null)}return wp.ajax.post(t,n)};const n=wp.media.view.MediaFrame.Select,i=wp.media.view.MediaFrame.Post,r=wp.media.view.MediaFrame.ImageDetails,o=wp.media.view.MediaFrame.VideoDetails,a=wp.media.View.extend({tagName:"div",className:"cloudinary-widget",template:wp.template("cloudinary-dam"),active:!1,toolbar:null,frame:null,ready(){const e=this.controller,t=this.model.get("selection"),n=this.model.get("library"),i=wp.media.model.Attachment;if(CLDN.mloptions.multiple=e.options.multiple,this.cid!==this.active){if(CLDN.mloptions.inline_container="#cloudinary-dam-"+e.cid,1===t.length){const e=i.get(t.models[0].id);void 0!==e.attributes.public_id&&(CLDN.mloptions.asset={resource_id:e.attributes.public_id})}else CLDN.mloptions.asset=null;try{CLDN.mloptions.folder||(CLDN.mloptions.folder={path:""});const e=t.props.attributes.type;CLDN.mloptions.folder.resource_type=Array.isArray(e)?e[0]:e}catch(e){}window.ml=cloudinary.openMediaLibrary(CLDN.mloptions,{insertHandler(r){for(let o=0;o'+t),t=t.replace(/(?:\r\n|\r|\n|\t| )srcset=/g," data-lazy-srcset=").replace(/(?:\r\n|\r|\n|\t| )src=/g,' src="'+i+'" data-lazy-src='))),t}(e);t.firstChild;)o||!a||void 0===n||!t.firstChild.tagName||"img"!==t.firstChild.tagName.toLowerCase()&&"iframe"!==t.firstChild.tagName.toLowerCase()||n.observe(t.firstChild),e.parentNode.insertBefore(t.firstChild,e);e.parentNode.removeChild(e)}function d(){document.querySelectorAll("noscript.loading-lazy").forEach(c),void 0!==window.matchMedia&&window.matchMedia("print").addListener((function(e){e.matches&&document.querySelectorAll(r.lazyImage+"[data-lazy-src],"+r.lazyIframe+"[data-lazy-src]").forEach((function(e){s(e)}))}))}"undefined"!=typeof NodeList&&NodeList.prototype&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),"IntersectionObserver"in window&&(n=new IntersectionObserver((function(e,t){e.forEach((function(e){if(0!==e.intersectionRatio){var n=e.target;t.unobserve(n),s(n)}}))}),r)),i="requestAnimationFrame"in window?window.requestAnimationFrame:function(e){e()},/comp|inter/.test(document.readyState)?i(d):"addEventListener"in document?document.addEventListener("DOMContentLoaded",(function(){i(d)})):document.attachEvent("onreadystatechange",(function(){"complete"===document.readyState&&d()}))}()},function(e,t){const n=document.querySelector(".cloudinary-collapsible__toggle");n&&n.addEventListener("click",(function(){const e=document.querySelector(".cloudinary-collapsible__content"),t="none"===window.getComputedStyle(e,null).getPropertyValue("display"),n=document.querySelector(".cloudinary-collapsible__toggle button i");e.style.display=t?"block":"none";const i="dashicons-arrow-down-alt2",r="dashicons-arrow-up-alt2";n.classList.contains(i)?(n.classList.remove(i),n.classList.add(r)):(n.classList.remove(r),n.classList.add(i))}))},,function(e,t,n){"use strict";n.r(t),n.d(t,"cloudinary",(function(){return ut}));n(4),n(5);var i=n(0),r=n.n(i),o=n(1),a=n.n(o);const s={sample:{image:document.getElementById("transformation-sample-image"),video:document.getElementById("transformation-sample-video")},preview:{image:document.getElementById("sample-image"),video:document.getElementById("sample-video")},fields:document.getElementsByClassName("cld-ui-input"),button:{image:document.getElementById("refresh-image-preview"),video:document.getElementById("refresh-video-preview")},spinner:{image:document.getElementById("image-loader"),video:document.getElementById("video-loader")},optimization:{image:document.getElementById("image_optimization"),video:document.getElementById("video_optimization")},error_container:document.getElementById("cld-preview-error"),activeItem:null,elements:{image:[],video:[]},_placeItem(e){null!==e&&(e.style.display="block",e.style.visibility="visible",e.style.position="absolute",e.style.top=e.parentElement.clientHeight/2-e.clientHeight/2+"px",e.style.left=e.parentElement.clientWidth/2-e.clientWidth/2+"px")},_setLoading(e){this.button[e].style.display="block",this._placeItem(this.button[e]),this.preview[e].style.opacity="0.1"},_build(e){this.sample[e].innerHTML="",this.elements[e]=[];for(const t of this.fields){if(e!==t.dataset.context||t.dataset.disabled&&"true"===t.dataset.disabled)continue;let n=t.value.trim();if(n.length){if("select-one"===t.type){if("none"===n||!1===this.optimization[e].checked)continue;n=t.dataset.meta+"_"+n}else e=t.dataset.context,t.dataset.meta&&(n=t.dataset.meta+"_"+n),t.dataset.suffix&&(n+=t.dataset.suffix),n=this._transformations(n,e,!0);n&&this.elements[e].push(n)}}let t="";this.elements[e].length&&(t="/"+this._getGlobalTransformationElements(e).replace(/ /g,"%20")),this.sample[e].textContent=t,this.sample[e].parentElement.href="https://res.cloudinary.com/demo/"+this.sample[e].parentElement.innerText.trim().replace("../","").replace(/ /g,"%20")},_clearLoading(e){this.spinner[e].style.visibility="hidden",this.activeItem=null,this.preview[e].style.opacity=1},_refresh(e,t){e&&e.preventDefault();const n=this,i=CLD_GLOBAL_TRANSFORMATIONS[t].preview_url+this._getGlobalTransformationElements(t)+CLD_GLOBAL_TRANSFORMATIONS[t].file;if(this.button[t].style.display="none",this._placeItem(this.spinner[t]),"image"===t){const e=new Image;e.onload=function(){n.preview[t].src=this.src,n._clearLoading(t),n.error_container&&(n.error_container.style.display="none"),e.remove()},e.onerror=function(){const e=n.elements[t].includes("f_mp4");n.error_container&&(n.error_container.style.display="block",e?(n.error_container.innerHTML=CLD_GLOBAL_TRANSFORMATIONS[t].warning.replace("%s","f_mp4"),n.error_container.classList.replace("settings-alert-error","settings-alert-warning")):(n.error_container.innerHTML=CLD_GLOBAL_TRANSFORMATIONS[t].error,n.error_container.classList.replace("settings-alert-warning","settings-alert-error"))),n._clearLoading(t)},e.src=i}else{const e=n._transformations(n._getGlobalTransformationElements(t),t);samplePlayer.source({publicId:"dog",transformation:e}),n._clearLoading(t)}},_getGlobalTransformationElements(e){let t=[];return t.push(this.elements[e].slice(0,2).join(",")),t.push(this.elements[e].slice(2).join(",")),t=t.filter((e=>e)).join("/"),t},_transformations(e,t,n=!1){const i=CLD_GLOBAL_TRANSFORMATIONS[t].valid_types;let r=null;const o=e.split("/"),a=[];for(let e=0;e{const i=!!n.length&&jQuery('[data-item="'+r+":"+n[0].id+'"]');i.length?i.remove():(jQuery(`.cld-tax-order-list-item:contains(${a})`).remove(),--e.startId),this.processTags(t)}))}),jQuery("body").on("change",".selectit input",(function(){const t=jQuery(this),n=t.val(),i=t.is(":checked"),r=t.parent().text().trim();!0===i?e.tags.find(`[data-item="category:${n}"]`).length||e._pushItem("category:"+n,r):e.tags.find(`[data-item="category:${n}"]`).remove()}))},_createItem(e,t){const n=jQuery("
  • "),i=jQuery(""),r=jQuery("");return n.addClass("cld-tax-order-list-item").attr("data-item",e),r.addClass("cld-tax-order-list-item-input").attr("type","hidden").attr("name","cld_tax_order[]").val(e),i.addClass("dashicons dashicons-menu cld-tax-order-list-item-handle"),n.append(i).append(t).append(r),n},_pushItem(e,t){const n=this._createItem(e,t);this.tags.append(n)},_sortable(){jQuery(".cld-tax-order-list").sortable({connectWith:".cld-tax-order",axis:"y",handle:".cld-tax-order-list-item-handle",placeholder:"cld-tax-order-list-item-placeholder",forcePlaceholderSize:!0,helper:"clone"})}};if(void 0!==window.CLDN&&(d._init(),jQuery("[data-wp-lists] .selectit input[checked]").each(((e,t)=>{jQuery(t).trigger("change")}))),wp.data&&wp.data.select("core/editor")){const e={};wp.data.subscribe((function(){const t=wp.data.select("core").getTaxonomies();if(t)for(const n in t){const i=wp.data.select("core/editor").getEditedPostAttribute(t[n].rest_base);e[t[n].slug]=i}}));const t=wp.element.createElement,n=n=>{class i extends n{constructor(e){super(e),this.currentItems=jQuery(".cld-tax-order-list-item").map(((e,t)=>jQuery(t).data("item"))).get()}makeItem(e){if(this.currentItems.includes(this.getId(e)))return;const t=this.makeElement(e);jQuery("#cld-tax-items").append(t)}removeItem(e){const t=jQuery(`[data-item="${this.getId(e)}"]`);t.length&&(t.remove(),this.currentItems=this.currentItems.filter((t=>t!==this.getId(e))))}findOrCreateTerm(e){return(e=super.findOrCreateTerm(e)).then((e=>this.makeItem(e))),e}onChange(t){super.onChange(t);const n=this.pickItem(t);n&&(e[this.props.slug].includes(n.id)?this.makeItem(n):this.removeItem(n))}pickItem(e){if("object"==typeof e){if(e.target){for(const t in this.state.availableTerms)if(this.state.availableTerms[t].id===parseInt(e.target.value))return this.state.availableTerms[t]}else if(Array.isArray(e)){let t=this.state.selectedTerms.filter((t=>!e.includes(t)))[0];return void 0===t&&(t=e.filter((e=>!this.state.selectedTerms.includes(e)))[0]),this.state.availableTerms.find((e=>e.name===t))}}else if("number"==typeof e){for(const t in this.state.availableTerms)if(this.state.availableTerms[t].id===e)return this.state.availableTerms[t]}else{let t;if(e.length>this.state.selectedTerms.length)for(const n in e)-1===this.state.selectedTerms.indexOf(e[n])&&(t=e[n]);else for(const n in this.state.selectedTerms)-1===e.indexOf(this.state.selectedTerms[n])&&(t=this.state.selectedTerms[n]);for(const e in this.state.availableTerms)if(this.state.availableTerms[e].name===t)return this.state.availableTerms[e]}}getId(e){return`${this.props.slug}:${e.id}`}makeElement(e){const t=jQuery("
  • "),n=jQuery(""),i=jQuery("");return t.addClass("cld-tax-order-list-item").attr("data-item",this.getId(e)),i.addClass("cld-tax-order-list-item-input").attr("type","hidden").attr("name","cld_tax_order[]").val(this.getId(e)),n.addClass("dashicons dashicons-menu cld-tax-order-list-item-handle"),t.append(n).append(e.name).append(i),t}}return e=>t(i,e)};wp.hooks.addFilter("editor.PostTaxonomyType","cld",n)}var l=d;const u={wpWrap:document.getElementById("wpwrap"),wpContent:document.getElementById("wpbody-content"),libraryWrap:document.getElementById("cloudinary-embed"),_init(){const e=this;"undefined"!=typeof CLD_ML&&(cloudinary.openMediaLibrary(CLD_ML.mloptions,{insertHandler(){alert("Import is not yet implemented.")}}),window.addEventListener("resize",(function(){e._resize()})),e._resize())},_resize(){const e=getComputedStyle(this.wpContent);this.libraryWrap.style.height=this.wpWrap.offsetHeight-parseInt(e.getPropertyValue("padding-bottom"))+"px"}};var p=u;u._init();const f={_init(){const e=this;if("undefined"!=typeof CLDIS){[...document.getElementsByClassName("cld-notice-box")].forEach((t=>{const n=t.getElementsByClassName("notice-dismiss");n.length&&n[0].addEventListener("click",(n=>{t.style.height=t.offsetHeight+"px",n.preventDefault(),setTimeout((function(){e._dismiss(t)}),5)}))}))}},_dismiss(e){const t=e.dataset.dismiss,n=parseInt(e.dataset.duration);e.classList.add("dismissed"),e.style.height="0px",setTimeout((function(){e.remove()}),400),0=0?e.ownerDocument.body:b(e)&&E(e)?e:A(j(e))}function C(e,t){void 0===t&&(t=[]);var n=A(e),i="body"===w(n),r=g(n),o=i?[r].concat(r.visualViewport||[],E(n)?n:[]):n,a=t.concat(o);return i?a:a.concat(C(j(o)))}function I(e){return["table","td","th"].indexOf(w(e))>=0}function D(e){if(!b(e)||"fixed"===L(e).position)return null;var t=e.offsetParent;if(t){var n=x(t);if("body"===w(t)&&"static"===L(t).position&&"static"!==L(n).position)return n}return t}function M(e){for(var t=g(e),n=D(e);n&&I(n)&&"static"===L(n).position;)n=D(n);return n&&"body"===w(n)&&"static"===L(n).position?t:n||function(e){for(var t=j(e);b(t)&&["html","body"].indexOf(w(t))<0;){var n=L(t);if("none"!==n.transform||"none"!==n.perspective||n.willChange&&"auto"!==n.willChange)return t;t=t.parentNode}return null}(e)||t}var k="top",S="bottom",N="right",B="left",R="auto",P=[k,S,N,B],H="start",q="end",z="viewport",Q="popper",W=P.reduce((function(e,t){return e.concat([t+"-"+H,t+"-"+q])}),[]),V=[].concat(P,[R]).reduce((function(e,t){return e.concat([t,t+"-"+H,t+"-"+q])}),[]),F=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function U(e){var t=new Map,n=new Set,i=[];function r(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var i=t.get(e);i&&r(i)}})),i.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||r(e)})),i}var $={placement:"bottom",modifiers:[],strategy:"absolute"};function G(){for(var e=arguments.length,t=new Array(e),n=0;n=0?"x":"y"}function ee(e){var t,n=e.reference,i=e.element,r=e.placement,o=r?J(r):null,a=r?K(r):null,s=n.x+n.width/2-i.width/2,c=n.y+n.height/2-i.height/2;switch(o){case k:t={x:s,y:n.y-i.height};break;case S:t={x:s,y:n.y+n.height};break;case N:t={x:n.x+n.width,y:c};break;case B:t={x:n.x-i.width,y:c};break;default:t={x:n.x,y:n.y}}var d=o?Z(o):null;if(null!=d){var l="y"===d?"height":"width";switch(a){case H:t[d]=Math.floor(t[d])-Math.floor(n[l]/2-i[l]/2);break;case q:t[d]=Math.floor(t[d])+Math.ceil(n[l]/2-i[l]/2)}}return t}var te={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ne(e){var t,n=e.popper,i=e.popperRect,r=e.placement,o=e.offsets,a=e.position,s=e.gpuAcceleration,c=e.adaptive,d=function(e){var t=e.x,n=e.y,i=window.devicePixelRatio||1;return{x:Math.round(t*i)/i||0,y:Math.round(n*i)/i||0}}(o),l=d.x,u=d.y,p=o.hasOwnProperty("x"),f=o.hasOwnProperty("y"),m=B,h=k,v=window;if(c){var y=M(n);y===g(n)&&(y=x(n)),r===k&&(h=S,u-=y.clientHeight-i.height,u*=s?1:-1),r===B&&(m=N,l-=y.clientWidth-i.width,l*=s?1:-1)}var b,w=Object.assign({position:a},c&&te);return s?Object.assign(Object.assign({},w),{},((b={})[h]=f?"0":"",b[m]=p?"0":"",b.transform=(v.devicePixelRatio||1)<2?"translate("+l+"px, "+u+"px)":"translate3d("+l+"px, "+u+"px, 0)",b)):Object.assign(Object.assign({},w),{},((t={})[h]=f?u+"px":"",t[m]=p?l+"px":"",t.transform="",t))}var ie={left:"right",right:"left",bottom:"top",top:"bottom"};function re(e){return e.replace(/left|right|bottom|top/g,(function(e){return ie[e]}))}var oe={start:"end",end:"start"};function ae(e){return e.replace(/start|end/g,(function(e){return oe[e]}))}function se(e,t){var n,i=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(i&&((n=i)instanceof g(n).ShadowRoot||n instanceof ShadowRoot)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function ce(e){return Object.assign(Object.assign({},e),{},{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function de(e,t){return t===z?ce(function(e){var t=g(e),n=x(e),i=t.visualViewport,r=n.clientWidth,o=n.clientHeight,a=0,s=0;return i&&(r=i.width,o=i.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=i.offsetLeft,s=i.offsetTop)),{width:r,height:o,x:a+O(e),y:s}}(e)):b(t)?function(e){var t=h(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(t):ce(function(e){var t=x(e),n=v(e),i=e.ownerDocument.body,r=Math.max(t.scrollWidth,t.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),o=Math.max(t.scrollHeight,t.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-n.scrollLeft+O(e),s=-n.scrollTop;return"rtl"===L(i||t).direction&&(a+=Math.max(t.clientWidth,i?i.clientWidth:0)-r),{width:r,height:o,x:a,y:s}}(x(e)))}function le(e,t,n){var i="clippingParents"===t?function(e){var t=C(j(e)),n=["absolute","fixed"].indexOf(L(e).position)>=0&&b(e)?M(e):e;return y(n)?t.filter((function(e){return y(e)&&se(e,n)&&"body"!==w(e)})):[]}(e):[].concat(t),r=[].concat(i,[n]),o=r[0],a=r.reduce((function(t,n){var i=de(e,n);return t.top=Math.max(i.top,t.top),t.right=Math.min(i.right,t.right),t.bottom=Math.min(i.bottom,t.bottom),t.left=Math.max(i.left,t.left),t}),de(e,o));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function ue(e){return Object.assign(Object.assign({},{top:0,right:0,bottom:0,left:0}),e)}function pe(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function fe(e,t){void 0===t&&(t={});var n=t,i=n.placement,r=void 0===i?e.placement:i,o=n.boundary,a=void 0===o?"clippingParents":o,s=n.rootBoundary,c=void 0===s?z:s,d=n.elementContext,l=void 0===d?Q:d,u=n.altBoundary,p=void 0!==u&&u,f=n.padding,m=void 0===f?0:f,g=ue("number"!=typeof m?m:pe(m,P)),v=l===Q?"reference":Q,b=e.elements.reference,w=e.rects.popper,O=e.elements[p?v:l],L=le(y(O)?O:O.contextElement||x(e.elements.popper),a,c),E=h(b),_=ee({reference:E,element:w,strategy:"absolute",placement:r}),T=ce(Object.assign(Object.assign({},w),_)),j=l===Q?T:E,A={top:L.top-j.top+g.top,bottom:j.bottom-L.bottom+g.bottom,left:L.left-j.left+g.left,right:j.right-L.right+g.right},C=e.modifiersData.offset;if(l===Q&&C){var I=C[r];Object.keys(A).forEach((function(e){var t=[N,S].indexOf(e)>=0?1:-1,n=[k,S].indexOf(e)>=0?"y":"x";A[e]+=I[n]*t}))}return A}function me(e,t,n){return Math.max(e,Math.min(t,n))}function he(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 ge(e){return[k,N,S,B].some((function(t){return e[t]>=0}))}var ve=X({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,i=e.options,r=i.scroll,o=void 0===r||r,a=i.resize,s=void 0===a||a,c=g(t.elements.popper),d=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&d.forEach((function(e){e.addEventListener("scroll",n.update,Y)})),s&&c.addEventListener("resize",n.update,Y),function(){o&&d.forEach((function(e){e.removeEventListener("scroll",n.update,Y)})),s&&c.removeEventListener("resize",n.update,Y)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=ee({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,i=n.gpuAcceleration,r=void 0===i||i,o=n.adaptive,a=void 0===o||o,s={placement:J(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign(Object.assign({},t.styles.popper),ne(Object.assign(Object.assign({},s),{},{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign(Object.assign({},t.styles.arrow),ne(Object.assign(Object.assign({},s),{},{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1})))),t.attributes.popper=Object.assign(Object.assign({},t.attributes.popper),{},{"data-popper-placement":t.placement})},data:{}},{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]||{},i=t.attributes[e]||{},r=t.elements[e];b(r)&&w(r)&&(Object.assign(r.style,n),Object.keys(i).forEach((function(e){var t=i[e];!1===t?r.removeAttribute(e):r.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.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var i=t.elements[e],r=t.attributes[e]||{},o=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});b(i)&&w(i)&&(Object.assign(i.style,o),Object.keys(r).forEach((function(e){i.removeAttribute(e)})))}))}},requires:["computeStyles"]},{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,i=e.name,r=n.offset,o=void 0===r?[0,0]:r,a=V.reduce((function(e,n){return e[n]=function(e,t,n){var i=J(e),r=[B,k].indexOf(i)>=0?-1:1,o="function"==typeof n?n(Object.assign(Object.assign({},t),{},{placement:e})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*r,[B,N].indexOf(i)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,o),e}),{}),s=a[t.placement],c=s.x,d=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=d),t.modifiersData[i]=a}},{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,i=e.name;if(!t.modifiersData[i]._skip){for(var r=n.mainAxis,o=void 0===r||r,a=n.altAxis,s=void 0===a||a,c=n.fallbackPlacements,d=n.padding,l=n.boundary,u=n.rootBoundary,p=n.altBoundary,f=n.flipVariations,m=void 0===f||f,h=n.allowedAutoPlacements,g=t.options.placement,v=J(g),y=c||(v===g||!m?[re(g)]:function(e){if(J(e)===R)return[];var t=re(e);return[ae(e),t,ae(t)]}(g)),b=[g].concat(y).reduce((function(e,n){return e.concat(J(n)===R?function(e,t){void 0===t&&(t={});var n=t,i=n.placement,r=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,c=n.allowedAutoPlacements,d=void 0===c?V:c,l=K(i),u=l?s?W:W.filter((function(e){return K(e)===l})):P,p=u.filter((function(e){return d.indexOf(e)>=0}));0===p.length&&(p=u);var f=p.reduce((function(t,n){return t[n]=fe(e,{placement:n,boundary:r,rootBoundary:o,padding:a})[J(n)],t}),{});return Object.keys(f).sort((function(e,t){return f[e]-f[t]}))}(t,{placement:n,boundary:l,rootBoundary:u,padding:d,flipVariations:m,allowedAutoPlacements:h}):n)}),[]),w=t.rects.reference,x=t.rects.popper,O=new Map,L=!0,E=b[0],_=0;_=0,I=C?"width":"height",D=fe(t,{placement:T,boundary:l,rootBoundary:u,altBoundary:p,padding:d}),M=C?A?N:B:A?S:k;w[I]>x[I]&&(M=re(M));var q=re(M),z=[];if(o&&z.push(D[j]<=0),s&&z.push(D[M]<=0,D[q]<=0),z.every((function(e){return e}))){E=T,L=!1;break}O.set(T,z)}if(L)for(var Q=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"},F=m?3:1;F>0;F--){if("break"===Q(F))break}t.placement!==E&&(t.modifiersData[i]._skip=!0,t.placement=E,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,i=e.name,r=n.mainAxis,o=void 0===r||r,a=n.altAxis,s=void 0!==a&&a,c=n.boundary,d=n.rootBoundary,l=n.altBoundary,u=n.padding,p=n.tether,f=void 0===p||p,m=n.tetherOffset,h=void 0===m?0:m,g=fe(t,{boundary:c,rootBoundary:d,padding:u,altBoundary:l}),v=J(t.placement),y=K(t.placement),b=!y,w=Z(v),x="x"===w?"y":"x",O=t.modifiersData.popperOffsets,L=t.rects.reference,E=t.rects.popper,_="function"==typeof h?h(Object.assign(Object.assign({},t.rects),{},{placement:t.placement})):h,j={x:0,y:0};if(O){if(o){var A="y"===w?k:B,C="y"===w?S:N,I="y"===w?"height":"width",D=O[w],R=O[w]+g[A],P=O[w]-g[C],q=f?-E[I]/2:0,z=y===H?L[I]:E[I],Q=y===H?-E[I]:-L[I],W=t.elements.arrow,V=f&&W?T(W):{width:0,height:0},F=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},U=F[A],$=F[C],G=me(0,L[I],V[I]),X=b?L[I]/2-q-G-U-_:z-G-U-_,Y=b?-L[I]/2+q+G+$+_:Q+G+$+_,ee=t.elements.arrow&&M(t.elements.arrow),te=ee?"y"===w?ee.clientTop||0:ee.clientLeft||0:0,ne=t.modifiersData.offset?t.modifiersData.offset[t.placement][w]:0,ie=O[w]+X-ne-te,re=O[w]+Y-ne,oe=me(f?Math.min(R,ie):R,D,f?Math.max(P,re):P);O[w]=oe,j[w]=oe-D}if(s){var ae="x"===w?k:B,se="x"===w?S:N,ce=O[x],de=me(ce+g[ae],ce,ce-g[se]);O[x]=de,j[x]=de-ce}t.modifiersData[i]=j}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,i=e.name,r=n.elements.arrow,o=n.modifiersData.popperOffsets,a=J(n.placement),s=Z(a),c=[B,N].indexOf(a)>=0?"height":"width";if(r&&o){var d=n.modifiersData[i+"#persistent"].padding,l=T(r),u="y"===s?k:B,p="y"===s?S:N,f=n.rects.reference[c]+n.rects.reference[s]-o[s]-n.rects.popper[c],m=o[s]-n.rects.reference[s],h=M(r),g=h?"y"===s?h.clientHeight||0:h.clientWidth||0:0,v=f/2-m/2,y=d[u],b=g-l[c]-d[p],w=g/2-l[c]/2+v,x=me(y,w,b),O=s;n.modifiersData[i]=((t={})[O]=x,t.centerOffset=x-w,t)}},effect:function(e){var t=e.state,n=e.options,i=e.name,r=n.element,o=void 0===r?"[data-popper-arrow]":r,a=n.padding,s=void 0===a?0:a;null!=o&&("string"!=typeof o||(o=t.elements.popper.querySelector(o)))&&se(t.elements.popper,o)&&(t.elements.arrow=o,t.modifiersData[i+"#persistent"]={padding:ue("number"!=typeof s?s:pe(s,P))})},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,i=t.rects.reference,r=t.rects.popper,o=t.modifiersData.preventOverflow,a=fe(t,{elementContext:"reference"}),s=fe(t,{altBoundary:!0}),c=he(a,i),d=he(s,r,o),l=ge(c),u=ge(d);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:d,isReferenceHidden:l,hasPopperEscaped:u},t.attributes.popper=Object.assign(Object.assign({},t.attributes.popper),{},{"data-popper-reference-hidden":l,"data-popper-escaped":u})}}]}),ye="tippy-content",be="tippy-backdrop",we="tippy-arrow",xe="tippy-svg-arrow",Oe={passive:!0,capture:!0};function Le(e,t,n){if(Array.isArray(e)){var i=e[t];return null==i?Array.isArray(n)?n[t]:n:i}return e}function Ee(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function _e(e,t){return"function"==typeof e?e.apply(void 0,t):e}function Te(e,t){return 0===t?e:function(i){clearTimeout(n),n=setTimeout((function(){e(i)}),t)};var n}function je(e){return[].concat(e)}function Ae(e,t){-1===e.indexOf(t)&&e.push(t)}function Ce(e){return e.split("-")[0]}function Ie(e){return[].slice.call(e)}function De(){return document.createElement("div")}function Me(e){return["Element","Fragment"].some((function(t){return Ee(e,t)}))}function ke(e){return Ee(e,"MouseEvent")}function Se(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function Ne(e){return Me(e)?[e]:function(e){return Ee(e,"NodeList")}(e)?Ie(e):Array.isArray(e)?e:Ie(document.querySelectorAll(e))}function Be(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function Re(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function Pe(e){var t=je(e)[0];return t&&t.ownerDocument||document}function He(e,t,n){var i=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[i](t,n)}))}var qe={isTouch:!1},ze=0;function Qe(){qe.isTouch||(qe.isTouch=!0,window.performance&&document.addEventListener("mousemove",We))}function We(){var e=performance.now();e-ze<20&&(qe.isTouch=!1,document.removeEventListener("mousemove",We)),ze=e}function Ve(){var e=document.activeElement;if(Se(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var Fe="undefined"!=typeof window&&"undefined"!=typeof document?navigator.userAgent:"",Ue=/MSIE |Trident\//.test(Fe);var $e={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Ge=Object.assign({appendTo:function(){return document.body},aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},$e,{},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),Xe=Object.keys(Ge);function Ye(e){var t=(e.plugins||[]).reduce((function(t,n){var i=n.name,r=n.defaultValue;return i&&(t[i]=void 0!==e[i]?e[i]:r),t}),{});return Object.assign({},e,{},t)}function Je(e,t){var n=Object.assign({},t,{content:_e(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(Ye(Object.assign({},Ge,{plugins:t}))):Xe).reduce((function(t,n){var i=(e.getAttribute("data-tippy-"+n)||"").trim();if(!i)return t;if("content"===n)t[n]=i;else try{t[n]=JSON.parse(i)}catch(e){t[n]=i}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},Ge.aria,{},n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}function Ke(e,t){e.innerHTML=t}function Ze(e){var t=De();return!0===e?t.className=we:(t.className=xe,Me(e)?t.appendChild(e):Ke(t,e)),t}function et(e,t){Me(t.content)?(Ke(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?Ke(e,t.content):e.textContent=t.content)}function tt(e){var t=e.firstElementChild,n=Ie(t.children);return{box:t,content:n.find((function(e){return e.classList.contains(ye)})),arrow:n.find((function(e){return e.classList.contains(we)||e.classList.contains(xe)})),backdrop:n.find((function(e){return e.classList.contains(be)}))}}function nt(e){var t=De(),n=De();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var i=De();function r(n,i){var r=tt(t),o=r.box,a=r.content,s=r.arrow;i.theme?o.setAttribute("data-theme",i.theme):o.removeAttribute("data-theme"),"string"==typeof i.animation?o.setAttribute("data-animation",i.animation):o.removeAttribute("data-animation"),i.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof i.maxWidth?i.maxWidth+"px":i.maxWidth,i.role?o.setAttribute("role",i.role):o.removeAttribute("role"),n.content===i.content&&n.allowHTML===i.allowHTML||et(a,e.props),i.arrow?s?n.arrow!==i.arrow&&(o.removeChild(s),o.appendChild(Ze(i.arrow))):o.appendChild(Ze(i.arrow)):s&&o.removeChild(s)}return i.className=ye,i.setAttribute("data-state","hidden"),et(i,e.props),t.appendChild(n),n.appendChild(i),r(e.props,e.props),{popper:t,onUpdate:r}}nt.$$tippy=!0;var it=1,rt=[],ot=[];function at(e,t){var n,i,r,o,a,s,c,d,l,u=Je(e,Object.assign({},Ge,{},Ye((n=t,Object.keys(n).reduce((function(e,t){return void 0!==n[t]&&(e[t]=n[t]),e}),{}))))),p=!1,f=!1,m=!1,h=!1,g=[],v=Te(G,u.interactiveDebounce),y=it++,b=(l=u.plugins).filter((function(e,t){return l.indexOf(e)===t})),w={id:y,reference:e,popper:De(),popperInstance:null,props:u,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:b,clearDelayTimeouts:function(){clearTimeout(i),clearTimeout(r),cancelAnimationFrame(o)},setProps:function(t){0;if(w.state.isDestroyed)return;S("onBeforeUpdate",[w,t]),U();var n=w.props,i=Je(e,Object.assign({},w.props,{},t,{ignoreAttributes:!0}));w.props=i,F(),n.interactiveDebounce!==i.interactiveDebounce&&(R(),v=Te(G,i.interactiveDebounce));n.triggerTarget&&!i.triggerTarget?je(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):i.triggerTarget&&e.removeAttribute("aria-expanded");B(),k(),L&&L(n,i);w.popperInstance&&(K(),ee().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));S("onAfterUpdate",[w,t])},setContent:function(e){w.setProps({content:e})},show:function(){0;var e=w.state.isVisible,t=w.state.isDestroyed,n=!w.state.isEnabled,i=qe.isTouch&&!w.props.touch,r=Le(w.props.duration,0,Ge.duration);if(e||t||n||i)return;if(C().hasAttribute("disabled"))return;if(S("onShow",[w],!1),!1===w.props.onShow(w))return;w.state.isVisible=!0,A()&&(O.style.visibility="visible");k(),z(),w.state.isMounted||(O.style.transition="none");if(A()){var o=D(),a=o.box,s=o.content;Be([a,s],0)}c=function(){if(w.state.isVisible&&!h){if(h=!0,O.offsetHeight,O.style.transition=w.props.moveTransition,A()&&w.props.animation){var e=D(),t=e.box,n=e.content;Be([t,n],r),Re([t,n],"visible")}N(),B(),Ae(ot,w),w.state.isMounted=!0,S("onMount",[w]),w.props.animation&&A()&&function(e,t){W(e,t)}(r,(function(){w.state.isShown=!0,S("onShown",[w])}))}},function(){var e,t=w.props.appendTo,n=C();e=w.props.interactive&&t===Ge.appendTo||"parent"===t?n.parentNode:_e(t,[n]);e.contains(O)||e.appendChild(O);K(),!1}()},hide:function(){0;var e=!w.state.isVisible,t=w.state.isDestroyed,n=!w.state.isEnabled,i=Le(w.props.duration,1,Ge.duration);if(e||t||n)return;if(S("onHide",[w],!1),!1===w.props.onHide(w))return;w.state.isVisible=!1,w.state.isShown=!1,h=!1,p=!1,A()&&(O.style.visibility="hidden");if(R(),Q(),k(),A()){var r=D(),o=r.box,a=r.content;w.props.animation&&(Be([o,a],i),Re([o,a],"hidden"))}N(),B(),w.props.animation?A()&&function(e,t){W(e,(function(){!w.state.isVisible&&O.parentNode&&O.parentNode.contains(O)&&t()}))}(i,w.unmount):w.unmount()},hideWithInteractivity:function(e){0;I().addEventListener("mousemove",v),Ae(rt,v),v(e)},enable:function(){w.state.isEnabled=!0},disable:function(){w.hide(),w.state.isEnabled=!1},unmount:function(){0;w.state.isVisible&&w.hide();if(!w.state.isMounted)return;Z(),ee().forEach((function(e){e._tippy.unmount()})),O.parentNode&&O.parentNode.removeChild(O);ot=ot.filter((function(e){return e!==w})),w.state.isMounted=!1,S("onHidden",[w])},destroy:function(){0;if(w.state.isDestroyed)return;w.clearDelayTimeouts(),w.unmount(),U(),delete e._tippy,w.state.isDestroyed=!0,S("onDestroy",[w])}};if(!u.render)return w;var x=u.render(w),O=x.popper,L=x.onUpdate;O.setAttribute("data-tippy-root",""),O.id="tippy-"+w.id,w.popper=O,e._tippy=w,O._tippy=w;var E=b.map((function(e){return e.fn(w)})),_=e.hasAttribute("aria-expanded");return F(),B(),k(),S("onCreate",[w]),u.showOnCreate&&te(),O.addEventListener("mouseenter",(function(){w.props.interactive&&w.state.isVisible&&w.clearDelayTimeouts()})),O.addEventListener("mouseleave",(function(e){w.props.interactive&&w.props.trigger.indexOf("mouseenter")>=0&&(I().addEventListener("mousemove",v),v(e))})),w;function T(){var e=w.props.touch;return Array.isArray(e)?e:[e,0]}function j(){return"hold"===T()[0]}function A(){var e;return!!(null==(e=w.props.render)?void 0:e.$$tippy)}function C(){return d||e}function I(){var e=C().parentNode;return e?Pe(e):document}function D(){return tt(O)}function M(e){return w.state.isMounted&&!w.state.isVisible||qe.isTouch||a&&"focus"===a.type?0:Le(w.props.delay,e?0:1,Ge.delay)}function k(){O.style.pointerEvents=w.props.interactive&&w.state.isVisible?"":"none",O.style.zIndex=""+w.props.zIndex}function S(e,t,n){var i;(void 0===n&&(n=!0),E.forEach((function(n){n[e]&&n[e].apply(void 0,t)})),n)&&(i=w.props)[e].apply(i,t)}function N(){var t=w.props.aria;if(t.content){var n="aria-"+t.content,i=O.id;je(w.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(n);if(w.state.isVisible)e.setAttribute(n,t?t+" "+i:i);else{var r=t&&t.replace(i,"").trim();r?e.setAttribute(n,r):e.removeAttribute(n)}}))}}function B(){!_&&w.props.aria.expanded&&je(w.props.triggerTarget||e).forEach((function(e){w.props.interactive?e.setAttribute("aria-expanded",w.state.isVisible&&e===C()?"true":"false"):e.removeAttribute("aria-expanded")}))}function R(){I().removeEventListener("mousemove",v),rt=rt.filter((function(e){return e!==v}))}function P(e){if(!(qe.isTouch&&(m||"mousedown"===e.type)||w.props.interactive&&O.contains(e.target))){if(C().contains(e.target)){if(qe.isTouch)return;if(w.state.isVisible&&w.props.trigger.indexOf("click")>=0)return}else S("onClickOutside",[w,e]);!0===w.props.hideOnClick&&(w.clearDelayTimeouts(),w.hide(),f=!0,setTimeout((function(){f=!1})),w.state.isMounted||Q())}}function H(){m=!0}function q(){m=!1}function z(){var e=I();e.addEventListener("mousedown",P,!0),e.addEventListener("touchend",P,Oe),e.addEventListener("touchstart",q,Oe),e.addEventListener("touchmove",H,Oe)}function Q(){var e=I();e.removeEventListener("mousedown",P,!0),e.removeEventListener("touchend",P,Oe),e.removeEventListener("touchstart",q,Oe),e.removeEventListener("touchmove",H,Oe)}function W(e,t){var n=D().box;function i(e){e.target===n&&(He(n,"remove",i),t())}if(0===e)return t();He(n,"remove",s),He(n,"add",i),s=i}function V(t,n,i){void 0===i&&(i=!1),je(w.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,n,i),g.push({node:e,eventType:t,handler:n,options:i})}))}function F(){var e;j()&&(V("touchstart",$,{passive:!0}),V("touchend",X,{passive:!0})),(e=w.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(V(e,$),e){case"mouseenter":V("mouseleave",X);break;case"focus":V(Ue?"focusout":"blur",Y);break;case"focusin":V("focusout",Y)}}))}function U(){g.forEach((function(e){var t=e.node,n=e.eventType,i=e.handler,r=e.options;t.removeEventListener(n,i,r)})),g=[]}function $(e){var t,n=!1;if(w.state.isEnabled&&!J(e)&&!f){var i="focus"===(null==(t=a)?void 0:t.type);a=e,d=e.currentTarget,B(),!w.state.isVisible&&ke(e)&&rt.forEach((function(t){return t(e)})),"click"===e.type&&(w.props.trigger.indexOf("mouseenter")<0||p)&&!1!==w.props.hideOnClick&&w.state.isVisible?n=!0:te(e),"click"===e.type&&(p=!n),n&&!i&&ne(e)}}function G(e){var t=e.target,n=C().contains(t)||O.contains(t);"mousemove"===e.type&&n||function(e,t){var n=t.clientX,i=t.clientY;return e.every((function(e){var t=e.popperRect,r=e.popperState,o=e.props.interactiveBorder,a=Ce(r.placement),s=r.modifiersData.offset;if(!s)return!0;var c="bottom"===a?s.top.y:0,d="top"===a?s.bottom.y:0,l="right"===a?s.left.x:0,u="left"===a?s.right.x:0,p=t.top-i+c>o,f=i-t.bottom-d>o,m=t.left-n+l>o,h=n-t.right-u>o;return p||f||m||h}))}(ee().concat(O).map((function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:u}:null})).filter(Boolean),e)&&(R(),ne(e))}function X(e){J(e)||w.props.trigger.indexOf("click")>=0&&p||(w.props.interactive?w.hideWithInteractivity(e):ne(e))}function Y(e){w.props.trigger.indexOf("focusin")<0&&e.target!==C()||w.props.interactive&&e.relatedTarget&&O.contains(e.relatedTarget)||ne(e)}function J(e){return!!qe.isTouch&&j()!==e.type.indexOf("touch")>=0}function K(){Z();var t=w.props,n=t.popperOptions,i=t.placement,r=t.offset,o=t.getReferenceClientRect,a=t.moveTransition,s=A()?tt(O).arrow:null,d=o?{getBoundingClientRect:o,contextElement:o.contextElement||C()}:e,l=[{name:"offset",options:{offset:r}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!a}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(A()){var n=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={}}}}];A()&&s&&l.push({name:"arrow",options:{element:s,padding:3}}),l.push.apply(l,(null==n?void 0:n.modifiers)||[]),w.popperInstance=ve(d,O,Object.assign({},n,{placement:i,onFirstUpdate:c,modifiers:l}))}function Z(){w.popperInstance&&(w.popperInstance.destroy(),w.popperInstance=null)}function ee(){return Ie(O.querySelectorAll("[data-tippy-root]"))}function te(e){w.clearDelayTimeouts(),e&&S("onTrigger",[w,e]),z();var t=M(!0),n=T(),r=n[0],o=n[1];qe.isTouch&&"hold"===r&&o&&(t=o),t?i=setTimeout((function(){w.show()}),t):w.show()}function ne(e){if(w.clearDelayTimeouts(),S("onUntrigger",[w,e]),w.state.isVisible){if(!(w.props.trigger.indexOf("mouseenter")>=0&&w.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&p)){var t=M(!1);t?r=setTimeout((function(){w.state.isVisible&&w.hide()}),t):o=requestAnimationFrame((function(){w.hide()}))}}else Q()}}function st(e,t){void 0===t&&(t={});var n=Ge.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",Qe,Oe),window.addEventListener("blur",Ve);var i=Object.assign({},t,{plugins:n}),r=Ne(e).reduce((function(e,t){var n=t&&at(t,i);return n&&e.push(n),e}),[]);return Me(e)?r[0]:r}st.defaultProps=Ge,st.setDefaultProps=function(e){Object.keys(e).forEach((function(t){Ge[t]=e[t]}))},st.currentInput=qe;st.setDefaultProps({render:nt});var ct=st;const dt={_init(){const e=document.querySelectorAll("[data-bind]"),t=document.querySelectorAll("[data-toggle]"),n=document.querySelectorAll("[data-for]"),i=document.querySelectorAll("[data-tooltip]"),r=this;e.forEach(r._bind),t.forEach(r._toggle),n.forEach(r._alias),ct(i,{theme:"cloudinary",arrow:!1,placement:"bottom-start",aria:{content:"auto",expanded:"auto"},content:e=>document.getElementById(e.getAttribute("data-tooltip")).innerHTML})},_bind(e){const t=JSON.parse(e.dataset.condition),n=document.querySelector('input[data-bound="'+e.dataset.bind+'"],select[data-bound="'+e.dataset.bind+'"]');n.addEventListener("change",(function(){dt.compare(e,n,t)})),n.addEventListener("input",(function(){dt.compare(e,n,t)})),n.dispatchEvent(new Event("change"))},_alias(e){e.addEventListener("click",(function(){document.getElementById(e.dataset.for).dispatchEvent(new Event("click"))}))},_toggle(e){e.addEventListener("click",(function(){const t=document.querySelector('[data-wrap="'+e.dataset.toggle+'"]'),n=t.classList.contains("open")?"closed":"open";dt.toggle(t,e,n)}))},compare(e,t,n){const i=t.id;let r=!1,o="closed";r="checkbox"===t.type||"radio"===t.type?t.checked===n[i]:t.value===n[i],!0===r&&(o="open"),dt.toggle(e,t,o)},toggle(e,t,n){const i=e.getElementsByClassName("cld-ui-input");"closed"===n?(e.classList.remove("open"),e.classList.add("closed"),t.classList.contains("dashicons")&&(t.classList.remove("dashicons-arrow-up-alt2"),t.classList.add("dashicons-arrow-down-alt2")),[...i].forEach((function(e){e.dataset.disabled=!0}))):(e.classList.remove("closed"),e.classList.add("open"),t.classList.contains("dashicons")&&(t.classList.remove("dashicons-arrow-down-alt2"),t.classList.add("dashicons-arrow-up-alt2")),[...i].forEach((function(e){e.dataset.disabled=!1})))}};window.addEventListener("load",dt._init());var lt=dt;window.$=window.jQuery;const ut={UI:lt,Settings:r.a,Widget:a.a,GlobalTransformations:c,TermsOrder:l,MediaLibrary:p,Notices:m}}]); \ No newline at end of file +!function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=7)}([function(e,t){!function(){const e=function(){const e=jQuery("#field-video_player").val(),t=jQuery("#field-video_controls").prop("checked"),n=jQuery('#field-video_autoplay_mode option[value="off"]');"cld"!==e||t?n.prop("disabled",!1):(n.prop("disabled",!0),n.prop("selected")&&n.next().prop("selected",!0))};e(),jQuery(document).on("change","#field-video_player",e),jQuery(document).on("change","#field-video_controls",e),jQuery(document).ready((function(e){e.isFunction(e.fn.wpColorPicker)&&e(".regular-color").wpColorPicker(),e(document).on("tabs.init",(function(){const t=e(".settings-tab-trigger"),n=e(".settings-tab-section");e(this).on("click",".settings-tab-trigger",(function(i){const r=e(this),o=e(r.attr("href"));i.preventDefault(),t.removeClass("active"),n.removeClass("active"),r.addClass("active"),o.addClass("active"),e(document).trigger("settings.tabbed",r)})),e(".cld-field").not('[data-condition="false"]').each((function(){const t=e(this),n=t.data("condition");for(const i in n){let r=e("#field-"+i);const o=n[i],a=t.closest("tr");r.length||(r=e(`[id^=field-${i}-]`));let s=!1;r.on("change init",(function(e,t=!1){if(s&&t)return;let n=this.value===o||this.checked;if(Array.isArray(o)&&2===o.length)switch(o[1]){case"neq":n=this.value!==o[0];break;case"gt":n=this.value>o[0];break;case"lt":n=this.value=0&&(e.metadata.cldoverwrite="true")})),wp.media.events.on("editor:image-update",(function(e){const t=e.image.className.split(" ");e.metadata.cldoverwrite&&-1===t.indexOf("cld-overwrite")?t.push("cld-overwrite"):!e.metadata.cldoverwrite&&t.indexOf("cld-overwrite")>=0&&delete t[t.indexOf("cld-overwrite")],e.image.className=t.join(" ")}));let e=null;const t=wp.media.string.props;wp.media.string.props=function(n,i){n.cldoverwrite&&(n.classes=["cld-overwrite"],e=!0);return t(n,i)},wp.media.post=function(t,n){if("send-attachment-to-editor"===t){const t=wp.media.editor.get().state().get("selection").get(n.attachment);t.attributes.transformations&&(n.attachment.transformations=t.attributes.transformations),(n.html.indexOf("cld-overwrite")>-1||!0===e)&&(n.attachment.cldoverwrite=!0,e=null)}return wp.ajax.post(t,n)};const n=wp.media.view.MediaFrame.Select,i=wp.media.view.MediaFrame.Post,r=wp.media.view.MediaFrame.ImageDetails,o=wp.media.view.MediaFrame.VideoDetails,a=wp.media.View.extend({tagName:"div",className:"cloudinary-widget",template:wp.template("cloudinary-dam"),active:!1,toolbar:null,frame:null,ready(){const e=this.controller,t=this.model.get("selection"),n=this.model.get("library"),i=wp.media.model.Attachment;if(CLDN.mloptions.multiple=e.options.multiple,this.cid!==this.active){if(CLDN.mloptions.inline_container="#cloudinary-dam-"+e.cid,1===t.length){const e=i.get(t.models[0].id);void 0!==e.attributes.public_id&&(CLDN.mloptions.asset={resource_id:e.attributes.public_id})}else CLDN.mloptions.asset=null;try{CLDN.mloptions.folder||(CLDN.mloptions.folder={path:""});const e=t.props.attributes.type;CLDN.mloptions.folder.resource_type=Array.isArray(e)?e[0]:e}catch(e){}window.ml=cloudinary.openMediaLibrary(CLDN.mloptions,{insertHandler(r){for(let o=0;o'+t),t=t.replace(/(?:\r\n|\r|\n|\t| )srcset=/g," data-lazy-srcset=").replace(/(?:\r\n|\r|\n|\t| )src=/g,' src="'+i+'" data-lazy-src='))),t}(e);t.firstChild;)o||!a||void 0===n||!t.firstChild.tagName||"img"!==t.firstChild.tagName.toLowerCase()&&"iframe"!==t.firstChild.tagName.toLowerCase()||n.observe(t.firstChild),e.parentNode.insertBefore(t.firstChild,e);e.parentNode.removeChild(e)}function d(){document.querySelectorAll("noscript.loading-lazy").forEach(c),void 0!==window.matchMedia&&window.matchMedia("print").addListener((function(e){e.matches&&document.querySelectorAll(r.lazyImage+"[data-lazy-src],"+r.lazyIframe+"[data-lazy-src]").forEach((function(e){s(e)}))}))}"undefined"!=typeof NodeList&&NodeList.prototype&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),"IntersectionObserver"in window&&(n=new IntersectionObserver((function(e,t){e.forEach((function(e){if(0!==e.intersectionRatio){var n=e.target;t.unobserve(n),s(n)}}))}),r)),i="requestAnimationFrame"in window?window.requestAnimationFrame:function(e){e()},/comp|inter/.test(document.readyState)?i(d):"addEventListener"in document?document.addEventListener("DOMContentLoaded",(function(){i(d)})):document.attachEvent("onreadystatechange",(function(){"complete"===document.readyState&&d()}))}()},function(e,t){const n=document.querySelector(".cloudinary-collapsible__toggle");n&&n.addEventListener("click",(function(){const e=document.querySelector(".cloudinary-collapsible__content"),t="none"===window.getComputedStyle(e,null).getPropertyValue("display"),n=document.querySelector(".cloudinary-collapsible__toggle button i");e.style.display=t?"block":"none";const i="dashicons-arrow-down-alt2",r="dashicons-arrow-up-alt2";n.classList.contains(i)?(n.classList.remove(i),n.classList.add(r)):(n.classList.remove(r),n.classList.add(i))}))},,function(e,t,n){"use strict";n.r(t),n.d(t,"cloudinary",(function(){return yt}));n(4),n(5);var i=n(0),r=n.n(i),o=n(1),a=n.n(o);const s={sample:{image:document.getElementById("transformation-sample-image"),video:document.getElementById("transformation-sample-video")},preview:{image:document.getElementById("sample-image"),video:document.getElementById("sample-video")},fields:document.getElementsByClassName("cld-ui-input"),button:{image:document.getElementById("refresh-image-preview"),video:document.getElementById("refresh-video-preview")},spinner:{image:document.getElementById("image-loader"),video:document.getElementById("video-loader")},optimization:{image:document.getElementById("image_optimization"),video:document.getElementById("video_optimization")},error_container:document.getElementById("cld-preview-error"),activeItem:null,elements:{image:[],video:[]},_placeItem(e){null!==e&&(e.style.display="block",e.style.visibility="visible",e.style.position="absolute",e.style.top=e.parentElement.clientHeight/2-e.clientHeight/2+"px",e.style.left=e.parentElement.clientWidth/2-e.clientWidth/2+"px")},_setLoading(e){this.button[e].style.display="block",this._placeItem(this.button[e]),this.preview[e].style.opacity="0.1"},_build(e){this.sample[e].innerHTML="",this.elements[e]=[];for(const t of this.fields){if(e!==t.dataset.context||t.dataset.disabled&&"true"===t.dataset.disabled)continue;let n=t.value.trim();if(n.length){if("select-one"===t.type){if("none"===n||!1===this.optimization[e].checked)continue;n=t.dataset.meta+"_"+n}else e=t.dataset.context,t.dataset.meta&&(n=t.dataset.meta+"_"+n),t.dataset.suffix&&(n+=t.dataset.suffix),n=this._transformations(n,e,!0);n&&this.elements[e].push(n)}}let t="";this.elements[e].length&&(t="/"+this._getGlobalTransformationElements(e).replace(/ /g,"%20")),this.sample[e].textContent=t,this.sample[e].parentElement.href="https://res.cloudinary.com/demo/"+this.sample[e].parentElement.innerText.trim().replace("../","").replace(/ /g,"%20")},_clearLoading(e){this.spinner[e].style.visibility="hidden",this.activeItem=null,this.preview[e].style.opacity=1},_refresh(e,t){e&&e.preventDefault();const n=this,i=CLD_GLOBAL_TRANSFORMATIONS[t].preview_url+this._getGlobalTransformationElements(t)+CLD_GLOBAL_TRANSFORMATIONS[t].file;if(this.button[t].style.display="none",this._placeItem(this.spinner[t]),"image"===t){const e=new Image;e.onload=function(){n.preview[t].src=this.src,n._clearLoading(t),n.error_container&&(n.error_container.style.display="none"),e.remove()},e.onerror=function(){const e=n.elements[t].includes("f_mp4");n.error_container&&(n.error_container.style.display="block",e?(n.error_container.innerHTML=CLD_GLOBAL_TRANSFORMATIONS[t].warning.replace("%s","f_mp4"),n.error_container.classList.replace("settings-alert-error","settings-alert-warning")):(n.error_container.innerHTML=CLD_GLOBAL_TRANSFORMATIONS[t].error,n.error_container.classList.replace("settings-alert-warning","settings-alert-error"))),n._clearLoading(t)},e.src=i}else{const e=n._transformations(n._getGlobalTransformationElements(t),t);samplePlayer.source({publicId:"dog",transformation:e}),n._clearLoading(t)}},_getGlobalTransformationElements(e){let t=[];return t.push(this.elements[e].slice(0,2).join(",")),t.push(this.elements[e].slice(2).join(",")),t=t.filter((e=>e)).join("/"),t},_transformations(e,t,n=!1){const i=CLD_GLOBAL_TRANSFORMATIONS[t].valid_types;let r=null;const o=e.split("/"),a=[];for(let e=0;e{const i=!!n.length&&jQuery('[data-item="'+r+":"+n[0].id+'"]');i.length?i.remove():(jQuery(`.cld-tax-order-list-item:contains(${a})`).remove(),--e.startId),this.processTags(t)}))}),jQuery("body").on("change",".selectit input",(function(){const t=jQuery(this),n=t.val(),i=t.is(":checked"),r=t.parent().text().trim();!0===i?e.tags.find(`[data-item="category:${n}"]`).length||e._pushItem("category:"+n,r):e.tags.find(`[data-item="category:${n}"]`).remove()}))},_createItem(e,t){const n=jQuery("
  • "),i=jQuery(""),r=jQuery("");return n.addClass("cld-tax-order-list-item").attr("data-item",e),r.addClass("cld-tax-order-list-item-input").attr("type","hidden").attr("name","cld_tax_order[]").val(e),i.addClass("dashicons dashicons-menu cld-tax-order-list-item-handle"),n.append(i).append(t).append(r),n},_pushItem(e,t){const n=this._createItem(e,t);this.tags.append(n)},_sortable(){jQuery(".cld-tax-order-list").sortable({connectWith:".cld-tax-order",axis:"y",handle:".cld-tax-order-list-item-handle",placeholder:"cld-tax-order-list-item-placeholder",forcePlaceholderSize:!0,helper:"clone"})}};if(void 0!==window.CLDN&&(d._init(),jQuery("[data-wp-lists] .selectit input[checked]").each(((e,t)=>{jQuery(t).trigger("change")}))),wp.data&&wp.data.select("core/editor")){const e={};wp.data.subscribe((function(){const t=wp.data.select("core").getTaxonomies();if(t)for(const n in t){const i=wp.data.select("core/editor").getEditedPostAttribute(t[n].rest_base);e[t[n].slug]=i}}));const t=wp.element.createElement,n=n=>{class i extends n{constructor(e){super(e),this.currentItems=jQuery(".cld-tax-order-list-item").map(((e,t)=>jQuery(t).data("item"))).get()}makeItem(e){if(this.currentItems.includes(this.getId(e)))return;const t=this.makeElement(e);jQuery("#cld-tax-items").append(t)}removeItem(e){const t=jQuery(`[data-item="${this.getId(e)}"]`);t.length&&(t.remove(),this.currentItems=this.currentItems.filter((t=>t!==this.getId(e))))}findOrCreateTerm(e){return(e=super.findOrCreateTerm(e)).then((e=>this.makeItem(e))),e}onChange(t){super.onChange(t);const n=this.pickItem(t);n&&(e[this.props.slug].includes(n.id)?this.makeItem(n):this.removeItem(n))}pickItem(e){if("object"==typeof e){if(e.target){for(const t in this.state.availableTerms)if(this.state.availableTerms[t].id===parseInt(e.target.value))return this.state.availableTerms[t]}else if(Array.isArray(e)){let t=this.state.selectedTerms.filter((t=>!e.includes(t)))[0];return void 0===t&&(t=e.filter((e=>!this.state.selectedTerms.includes(e)))[0]),this.state.availableTerms.find((e=>e.name===t))}}else if("number"==typeof e){for(const t in this.state.availableTerms)if(this.state.availableTerms[t].id===e)return this.state.availableTerms[t]}else{let t;if(e.length>this.state.selectedTerms.length)for(const n in e)-1===this.state.selectedTerms.indexOf(e[n])&&(t=e[n]);else for(const n in this.state.selectedTerms)-1===e.indexOf(this.state.selectedTerms[n])&&(t=this.state.selectedTerms[n]);for(const e in this.state.availableTerms)if(this.state.availableTerms[e].name===t)return this.state.availableTerms[e]}}getId(e){return`${this.props.slug}:${e.id}`}makeElement(e){const t=jQuery("
  • "),n=jQuery(""),i=jQuery("");return t.addClass("cld-tax-order-list-item").attr("data-item",this.getId(e)),i.addClass("cld-tax-order-list-item-input").attr("type","hidden").attr("name","cld_tax_order[]").val(this.getId(e)),n.addClass("dashicons dashicons-menu cld-tax-order-list-item-handle"),t.append(n).append(e.name).append(i),t}}return e=>t(i,e)};wp.hooks.addFilter("editor.PostTaxonomyType","cld",n)}var l=d;const u={wpWrap:document.getElementById("wpwrap"),wpContent:document.getElementById("wpbody-content"),libraryWrap:document.getElementById("cloudinary-embed"),_init(){const e=this;"undefined"!=typeof CLD_ML&&(cloudinary.openMediaLibrary(CLD_ML.mloptions,{insertHandler(){alert("Import is not yet implemented.")}}),window.addEventListener("resize",(function(){e._resize()})),e._resize())},_resize(){const e=getComputedStyle(this.wpContent);this.libraryWrap.style.height=this.wpWrap.offsetHeight-parseInt(e.getPropertyValue("padding-bottom"))+"px"}};var p=u;u._init();const f={_init(){const e=this;if("undefined"!=typeof CLDIS){[...document.getElementsByClassName("cld-notice-box")].forEach((t=>{const n=t.getElementsByClassName("notice-dismiss");n.length&&n[0].addEventListener("click",(n=>{t.style.height=t.offsetHeight+"px",n.preventDefault(),setTimeout((function(){e._dismiss(t)}),5)}))}))}},_dismiss(e){const t=e.dataset.dismiss,n=parseInt(e.dataset.duration);e.classList.add("dismissed"),e.style.height="0px",setTimeout((function(){e.remove()}),400),0=0?e.ownerDocument.body:b(e)&&_(e)?e:C(j(e))}function I(e,t){var n;void 0===t&&(t=[]);var i=C(e),r=i===(null==(n=e.ownerDocument)?void 0:n.body),o=v(i),a=r?[o].concat(o.visualViewport||[],_(i)?i:[]):i,s=t.concat(a);return r?s:s.concat(I(j(a)))}function D(e){return["table","td","th"].indexOf(x(e))>=0}function S(e){return b(e)&&"fixed"!==E(e).position?e.offsetParent:null}function k(e){for(var t=v(e),n=S(e);n&&D(n)&&"static"===E(n).position;)n=S(n);return n&&("html"===x(n)||"body"===x(n)&&"static"===E(n).position)?t:n||function(e){for(var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox"),n=j(e);b(n)&&["html","body"].indexOf(x(n))<0;){var i=E(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||t&&"filter"===i.willChange||t&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}(e)||t}var N="top",M="bottom",B="right",R="left",P="auto",H=[N,M,B,R],q="start",z="end",W="viewport",Q="popper",V=H.reduce((function(e,t){return e.concat([t+"-"+q,t+"-"+z])}),[]),F=[].concat(H,[P]).reduce((function(e,t){return e.concat([t,t+"-"+q,t+"-"+z])}),[]),U=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function $(e){var t=new Map,n=new Set,i=[];function r(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var i=t.get(e);i&&r(i)}})),i.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||r(e)})),i}var G={placement:"bottom",modifiers:[],strategy:"absolute"};function X(){for(var e=arguments.length,t=new Array(e),n=0;n=0?"x":"y"}function ne(e){var t,n=e.reference,i=e.element,r=e.placement,o=r?Z(r):null,a=r?ee(r):null,s=n.x+n.width/2-i.width/2,c=n.y+n.height/2-i.height/2;switch(o){case N:t={x:s,y:n.y-i.height};break;case M:t={x:s,y:n.y+n.height};break;case B:t={x:n.x+n.width,y:c};break;case R:t={x:n.x-i.width,y:c};break;default:t={x:n.x,y:n.y}}var d=o?te(o):null;if(null!=d){var l="y"===d?"height":"width";switch(a){case q:t[d]=t[d]-(n[l]/2-i[l]/2);break;case z:t[d]=t[d]+(n[l]/2-i[l]/2)}}return t}var ie={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=ne({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},re=Math.max,oe=Math.min,ae=Math.round,se={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ce(e){var t,n=e.popper,i=e.popperRect,r=e.placement,o=e.offsets,a=e.position,s=e.gpuAcceleration,c=e.adaptive,d=e.roundOffsets,l=!0===d?function(e){var t=e.x,n=e.y,i=window.devicePixelRatio||1;return{x:ae(ae(t*i)/i)||0,y:ae(ae(n*i)/i)||0}}(o):"function"==typeof d?d(o):o,u=l.x,p=void 0===u?0:u,f=l.y,m=void 0===f?0:f,h=o.hasOwnProperty("x"),g=o.hasOwnProperty("y"),y=R,b=N,w=window;if(c){var x=k(n),L="clientHeight",_="clientWidth";x===v(n)&&"static"!==E(x=O(n)).position&&(L="scrollHeight",_="scrollWidth"),x=x,r===N&&(b=M,m-=x[L]-i.height,m*=s?1:-1),r===R&&(y=B,p-=x[_]-i.width,p*=s?1:-1)}var T,A=Object.assign({position:a},c&&se);return s?Object.assign({},A,((T={})[b]=g?"0":"",T[y]=h?"0":"",T.transform=(w.devicePixelRatio||1)<2?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",T)):Object.assign({},A,((t={})[b]=g?m+"px":"",t[y]=h?p+"px":"",t.transform="",t))}var de={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]||{},i=t.attributes[e]||{},r=t.elements[e];b(r)&&x(r)&&(Object.assign(r.style,n),Object.keys(i).forEach((function(e){var t=i[e];!1===t?r.removeAttribute(e):r.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 i=t.elements[e],r=t.attributes[e]||{},o=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});b(i)&&x(i)&&(Object.assign(i.style,o),Object.keys(r).forEach((function(e){i.removeAttribute(e)})))}))}},requires:["computeStyles"]};var le={left:"right",right:"left",bottom:"top",top:"bottom"};function ue(e){return e.replace(/left|right|bottom|top/g,(function(e){return le[e]}))}var pe={start:"end",end:"start"};function fe(e){return e.replace(/start|end/g,(function(e){return pe[e]}))}function me(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&w(n)){var i=t;do{if(i&&e.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function he(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function ve(e,t){return t===W?he(function(e){var t=v(e),n=O(e),i=t.visualViewport,r=n.clientWidth,o=n.clientHeight,a=0,s=0;return i&&(r=i.width,o=i.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=i.offsetLeft,s=i.offsetTop)),{width:r,height:o,x:a+L(e),y:s}}(e)):b(t)?function(e){var t=h(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(t):he(function(e){var t,n=O(e),i=g(e),r=null==(t=e.ownerDocument)?void 0:t.body,o=re(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=re(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),s=-i.scrollLeft+L(e),c=-i.scrollTop;return"rtl"===E(r||n).direction&&(s+=re(n.clientWidth,r?r.clientWidth:0)-o),{width:o,height:a,x:s,y:c}}(O(e)))}function ge(e,t,n){var i="clippingParents"===t?function(e){var t=I(j(e)),n=["absolute","fixed"].indexOf(E(e).position)>=0&&b(e)?k(e):e;return y(n)?t.filter((function(e){return y(e)&&me(e,n)&&"body"!==x(e)})):[]}(e):[].concat(t),r=[].concat(i,[n]),o=r[0],a=r.reduce((function(t,n){var i=ve(e,n);return t.top=re(i.top,t.top),t.right=oe(i.right,t.right),t.bottom=oe(i.bottom,t.bottom),t.left=re(i.left,t.left),t}),ve(e,o));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function ye(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function be(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function we(e,t){void 0===t&&(t={});var n=t,i=n.placement,r=void 0===i?e.placement:i,o=n.boundary,a=void 0===o?"clippingParents":o,s=n.rootBoundary,c=void 0===s?W:s,d=n.elementContext,l=void 0===d?Q:d,u=n.altBoundary,p=void 0!==u&&u,f=n.padding,m=void 0===f?0:f,v=ye("number"!=typeof m?m:be(m,H)),g=l===Q?"reference":Q,b=e.elements.reference,w=e.rects.popper,x=e.elements[p?g:l],L=ge(y(x)?x:x.contextElement||O(e.elements.popper),a,c),E=h(b),_=ne({reference:E,element:w,strategy:"absolute",placement:r}),T=he(Object.assign({},w,_)),A=l===Q?T:E,j={top:L.top-A.top+v.top,bottom:A.bottom-L.bottom+v.bottom,left:L.left-A.left+v.left,right:A.right-L.right+v.right},C=e.modifiersData.offset;if(l===Q&&C){var I=C[r];Object.keys(j).forEach((function(e){var t=[B,M].indexOf(e)>=0?1:-1,n=[N,M].indexOf(e)>=0?"y":"x";j[e]+=I[n]*t}))}return j}function xe(e,t,n){return re(e,oe(t,n))}function Oe(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 Le(e){return[N,B,M,R].some((function(t){return e[t]>=0}))}var Ee=Y({defaultModifiers:[K,ie,{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,i=n.gpuAcceleration,r=void 0===i||i,o=n.adaptive,a=void 0===o||o,s=n.roundOffsets,c=void 0===s||s,d={placement:Z(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,ce(Object.assign({},d,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:c})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,ce(Object.assign({},d,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},de,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,i=e.name,r=n.offset,o=void 0===r?[0,0]:r,a=F.reduce((function(e,n){return e[n]=function(e,t,n){var i=Z(e),r=[R,N].indexOf(i)>=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)*r,[R,B].indexOf(i)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,o),e}),{}),s=a[t.placement],c=s.x,d=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=d),t.modifiersData[i]=a}},{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,i=e.name;if(!t.modifiersData[i]._skip){for(var r=n.mainAxis,o=void 0===r||r,a=n.altAxis,s=void 0===a||a,c=n.fallbackPlacements,d=n.padding,l=n.boundary,u=n.rootBoundary,p=n.altBoundary,f=n.flipVariations,m=void 0===f||f,h=n.allowedAutoPlacements,v=t.options.placement,g=Z(v),y=c||(g===v||!m?[ue(v)]:function(e){if(Z(e)===P)return[];var t=ue(e);return[fe(e),t,fe(t)]}(v)),b=[v].concat(y).reduce((function(e,n){return e.concat(Z(n)===P?function(e,t){void 0===t&&(t={});var n=t,i=n.placement,r=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,c=n.allowedAutoPlacements,d=void 0===c?F:c,l=ee(i),u=l?s?V:V.filter((function(e){return ee(e)===l})):H,p=u.filter((function(e){return d.indexOf(e)>=0}));0===p.length&&(p=u);var f=p.reduce((function(t,n){return t[n]=we(e,{placement:n,boundary:r,rootBoundary:o,padding:a})[Z(n)],t}),{});return Object.keys(f).sort((function(e,t){return f[e]-f[t]}))}(t,{placement:n,boundary:l,rootBoundary:u,padding:d,flipVariations:m,allowedAutoPlacements:h}):n)}),[]),w=t.rects.reference,x=t.rects.popper,O=new Map,L=!0,E=b[0],_=0;_=0,I=C?"width":"height",D=we(t,{placement:T,boundary:l,rootBoundary:u,altBoundary:p,padding:d}),S=C?j?B:R:j?M:N;w[I]>x[I]&&(S=ue(S));var k=ue(S),z=[];if(o&&z.push(D[A]<=0),s&&z.push(D[S]<=0,D[k]<=0),z.every((function(e){return e}))){E=T,L=!1;break}O.set(T,z)}if(L)for(var W=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"},Q=m?3:1;Q>0;Q--){if("break"===W(Q))break}t.placement!==E&&(t.modifiersData[i]._skip=!0,t.placement=E,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,i=e.name,r=n.mainAxis,o=void 0===r||r,a=n.altAxis,s=void 0!==a&&a,c=n.boundary,d=n.rootBoundary,l=n.altBoundary,u=n.padding,p=n.tether,f=void 0===p||p,m=n.tetherOffset,h=void 0===m?0:m,v=we(t,{boundary:c,rootBoundary:d,padding:u,altBoundary:l}),g=Z(t.placement),y=ee(t.placement),b=!y,w=te(g),x="x"===w?"y":"x",O=t.modifiersData.popperOffsets,L=t.rects.reference,E=t.rects.popper,_="function"==typeof h?h(Object.assign({},t.rects,{placement:t.placement})):h,T={x:0,y:0};if(O){if(o||s){var j="y"===w?N:R,C="y"===w?M:B,I="y"===w?"height":"width",D=O[w],S=O[w]+v[j],P=O[w]-v[C],H=f?-E[I]/2:0,z=y===q?L[I]:E[I],W=y===q?-E[I]:-L[I],Q=t.elements.arrow,V=f&&Q?A(Q):{width:0,height:0},F=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},U=F[j],$=F[C],G=xe(0,L[I],V[I]),X=b?L[I]/2-H-G-U-_:z-G-U-_,Y=b?-L[I]/2+H+G+$+_:W+G+$+_,J=t.elements.arrow&&k(t.elements.arrow),K=J?"y"===w?J.clientTop||0:J.clientLeft||0:0,ne=t.modifiersData.offset?t.modifiersData.offset[t.placement][w]:0,ie=O[w]+X-ne-K,ae=O[w]+Y-ne;if(o){var se=xe(f?oe(S,ie):S,D,f?re(P,ae):P);O[w]=se,T[w]=se-D}if(s){var ce="x"===w?N:R,de="x"===w?M:B,le=O[x],ue=le+v[ce],pe=le-v[de],fe=xe(f?oe(ue,ie):ue,le,f?re(pe,ae):pe);O[x]=fe,T[x]=fe-le}}t.modifiersData[i]=T}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,i=e.name,r=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=Z(n.placement),c=te(s),d=[R,B].indexOf(s)>=0?"height":"width";if(o&&a){var l=function(e,t){return ye("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:be(e,H))}(r.padding,n),u=A(o),p="y"===c?N:R,f="y"===c?M:B,m=n.rects.reference[d]+n.rects.reference[c]-a[c]-n.rects.popper[d],h=a[c]-n.rects.reference[c],v=k(o),g=v?"y"===c?v.clientHeight||0:v.clientWidth||0:0,y=m/2-h/2,b=l[p],w=g-u[d]-l[f],x=g/2-u[d]/2+y,O=xe(b,x,w),L=c;n.modifiersData[i]=((t={})[L]=O,t.centerOffset=O-x,t)}},effect:function(e){var t=e.state,n=e.options.element,i=void 0===n?"[data-popper-arrow]":n;null!=i&&("string"!=typeof i||(i=t.elements.popper.querySelector(i)))&&me(t.elements.popper,i)&&(t.elements.arrow=i)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,i=t.rects.reference,r=t.rects.popper,o=t.modifiersData.preventOverflow,a=we(t,{elementContext:"reference"}),s=we(t,{altBoundary:!0}),c=Oe(a,i),d=Oe(s,r,o),l=Le(c),u=Le(d);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:d,isReferenceHidden:l,hasPopperEscaped:u},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":l,"data-popper-escaped":u})}}]}),_e="tippy-content",Te="tippy-backdrop",Ae="tippy-arrow",je="tippy-svg-arrow",Ce={passive:!0,capture:!0};function Ie(e,t,n){if(Array.isArray(e)){var i=e[t];return null==i?Array.isArray(n)?n[t]:n:i}return e}function De(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function Se(e,t){return"function"==typeof e?e.apply(void 0,t):e}function ke(e,t){return 0===t?e:function(i){clearTimeout(n),n=setTimeout((function(){e(i)}),t)};var n}function Ne(e){return[].concat(e)}function Me(e,t){-1===e.indexOf(t)&&e.push(t)}function Be(e){return e.split("-")[0]}function Re(e){return[].slice.call(e)}function Pe(){return document.createElement("div")}function He(e){return["Element","Fragment"].some((function(t){return De(e,t)}))}function qe(e){return De(e,"MouseEvent")}function ze(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function We(e){return He(e)?[e]:function(e){return De(e,"NodeList")}(e)?Re(e):Array.isArray(e)?e:Re(document.querySelectorAll(e))}function Qe(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function Ve(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function Fe(e){var t,n=Ne(e)[0];return(null==n||null==(t=n.ownerDocument)?void 0:t.body)?n.ownerDocument:document}function Ue(e,t,n){var i=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[i](t,n)}))}var $e={isTouch:!1},Ge=0;function Xe(){$e.isTouch||($e.isTouch=!0,window.performance&&document.addEventListener("mousemove",Ye))}function Ye(){var e=performance.now();e-Ge<20&&($e.isTouch=!1,document.removeEventListener("mousemove",Ye)),Ge=e}function Je(){var e=document.activeElement;if(ze(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var Ke="undefined"!=typeof window&&"undefined"!=typeof document?navigator.userAgent:"",Ze=/MSIE |Trident\//.test(Ke);var et={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},tt=Object.assign({appendTo:function(){return document.body},aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},et,{},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),nt=Object.keys(tt);function it(e){var t=(e.plugins||[]).reduce((function(t,n){var i=n.name,r=n.defaultValue;return i&&(t[i]=void 0!==e[i]?e[i]:r),t}),{});return Object.assign({},e,{},t)}function rt(e,t){var n=Object.assign({},t,{content:Se(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(it(Object.assign({},tt,{plugins:t}))):nt).reduce((function(t,n){var i=(e.getAttribute("data-tippy-"+n)||"").trim();if(!i)return t;if("content"===n)t[n]=i;else try{t[n]=JSON.parse(i)}catch(e){t[n]=i}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},tt.aria,{},n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}function ot(e,t){e.innerHTML=t}function at(e){var t=Pe();return!0===e?t.className=Ae:(t.className=je,He(e)?t.appendChild(e):ot(t,e)),t}function st(e,t){He(t.content)?(ot(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?ot(e,t.content):e.textContent=t.content)}function ct(e){var t=e.firstElementChild,n=Re(t.children);return{box:t,content:n.find((function(e){return e.classList.contains(_e)})),arrow:n.find((function(e){return e.classList.contains(Ae)||e.classList.contains(je)})),backdrop:n.find((function(e){return e.classList.contains(Te)}))}}function dt(e){var t=Pe(),n=Pe();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var i=Pe();function r(n,i){var r=ct(t),o=r.box,a=r.content,s=r.arrow;i.theme?o.setAttribute("data-theme",i.theme):o.removeAttribute("data-theme"),"string"==typeof i.animation?o.setAttribute("data-animation",i.animation):o.removeAttribute("data-animation"),i.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof i.maxWidth?i.maxWidth+"px":i.maxWidth,i.role?o.setAttribute("role",i.role):o.removeAttribute("role"),n.content===i.content&&n.allowHTML===i.allowHTML||st(a,e.props),i.arrow?s?n.arrow!==i.arrow&&(o.removeChild(s),o.appendChild(at(i.arrow))):o.appendChild(at(i.arrow)):s&&o.removeChild(s)}return i.className=_e,i.setAttribute("data-state","hidden"),st(i,e.props),t.appendChild(n),n.appendChild(i),r(e.props,e.props),{popper:t,onUpdate:r}}dt.$$tippy=!0;var lt=1,ut=[],pt=[];function ft(e,t){var n,i,r,o,a,s,c,d,l,u=rt(e,Object.assign({},tt,{},it((n=t,Object.keys(n).reduce((function(e,t){return void 0!==n[t]&&(e[t]=n[t]),e}),{}))))),p=!1,f=!1,m=!1,h=!1,v=[],g=ke(G,u.interactiveDebounce),y=lt++,b=(l=u.plugins).filter((function(e,t){return l.indexOf(e)===t})),w={id:y,reference:e,popper:Pe(),popperInstance:null,props:u,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:b,clearDelayTimeouts:function(){clearTimeout(i),clearTimeout(r),cancelAnimationFrame(o)},setProps:function(t){0;if(w.state.isDestroyed)return;N("onBeforeUpdate",[w,t]),U();var n=w.props,i=rt(e,Object.assign({},w.props,{},t,{ignoreAttributes:!0}));w.props=i,F(),n.interactiveDebounce!==i.interactiveDebounce&&(R(),g=ke(G,i.interactiveDebounce));n.triggerTarget&&!i.triggerTarget?Ne(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):i.triggerTarget&&e.removeAttribute("aria-expanded");B(),k(),L&&L(n,i);w.popperInstance&&(K(),ee().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));N("onAfterUpdate",[w,t])},setContent:function(e){w.setProps({content:e})},show:function(){0;var e=w.state.isVisible,t=w.state.isDestroyed,n=!w.state.isEnabled,i=$e.isTouch&&!w.props.touch,r=Ie(w.props.duration,0,tt.duration);if(e||t||n||i)return;if(C().hasAttribute("disabled"))return;if(N("onShow",[w],!1),!1===w.props.onShow(w))return;w.state.isVisible=!0,j()&&(O.style.visibility="visible");k(),z(),w.state.isMounted||(O.style.transition="none");if(j()){var o=D(),a=o.box,s=o.content;Qe([a,s],0)}c=function(){var e;if(w.state.isVisible&&!h){if(h=!0,O.offsetHeight,O.style.transition=w.props.moveTransition,j()&&w.props.animation){var t=D(),n=t.box,i=t.content;Qe([n,i],r),Ve([n,i],"visible")}M(),B(),Me(pt,w),null==(e=w.popperInstance)||e.forceUpdate(),w.state.isMounted=!0,N("onMount",[w]),w.props.animation&&j()&&function(e,t){Q(e,t)}(r,(function(){w.state.isShown=!0,N("onShown",[w])}))}},function(){var e,t=w.props.appendTo,n=C();e=w.props.interactive&&t===tt.appendTo||"parent"===t?n.parentNode:Se(t,[n]);e.contains(O)||e.appendChild(O);K(),!1}()},hide:function(){0;var e=!w.state.isVisible,t=w.state.isDestroyed,n=!w.state.isEnabled,i=Ie(w.props.duration,1,tt.duration);if(e||t||n)return;if(N("onHide",[w],!1),!1===w.props.onHide(w))return;w.state.isVisible=!1,w.state.isShown=!1,h=!1,p=!1,j()&&(O.style.visibility="hidden");if(R(),W(),k(),j()){var r=D(),o=r.box,a=r.content;w.props.animation&&(Qe([o,a],i),Ve([o,a],"hidden"))}M(),B(),w.props.animation?j()&&function(e,t){Q(e,(function(){!w.state.isVisible&&O.parentNode&&O.parentNode.contains(O)&&t()}))}(i,w.unmount):w.unmount()},hideWithInteractivity:function(e){0;I().addEventListener("mousemove",g),Me(ut,g),g(e)},enable:function(){w.state.isEnabled=!0},disable:function(){w.hide(),w.state.isEnabled=!1},unmount:function(){0;w.state.isVisible&&w.hide();if(!w.state.isMounted)return;Z(),ee().forEach((function(e){e._tippy.unmount()})),O.parentNode&&O.parentNode.removeChild(O);pt=pt.filter((function(e){return e!==w})),w.state.isMounted=!1,N("onHidden",[w])},destroy:function(){0;if(w.state.isDestroyed)return;w.clearDelayTimeouts(),w.unmount(),U(),delete e._tippy,w.state.isDestroyed=!0,N("onDestroy",[w])}};if(!u.render)return w;var x=u.render(w),O=x.popper,L=x.onUpdate;O.setAttribute("data-tippy-root",""),O.id="tippy-"+w.id,w.popper=O,e._tippy=w,O._tippy=w;var E=b.map((function(e){return e.fn(w)})),_=e.hasAttribute("aria-expanded");return F(),B(),k(),N("onCreate",[w]),u.showOnCreate&&te(),O.addEventListener("mouseenter",(function(){w.props.interactive&&w.state.isVisible&&w.clearDelayTimeouts()})),O.addEventListener("mouseleave",(function(e){w.props.interactive&&w.props.trigger.indexOf("mouseenter")>=0&&(I().addEventListener("mousemove",g),g(e))})),w;function T(){var e=w.props.touch;return Array.isArray(e)?e:[e,0]}function A(){return"hold"===T()[0]}function j(){var e;return!!(null==(e=w.props.render)?void 0:e.$$tippy)}function C(){return d||e}function I(){var e=C().parentNode;return e?Fe(e):document}function D(){return ct(O)}function S(e){return w.state.isMounted&&!w.state.isVisible||$e.isTouch||a&&"focus"===a.type?0:Ie(w.props.delay,e?0:1,tt.delay)}function k(){O.style.pointerEvents=w.props.interactive&&w.state.isVisible?"":"none",O.style.zIndex=""+w.props.zIndex}function N(e,t,n){var i;(void 0===n&&(n=!0),E.forEach((function(n){n[e]&&n[e].apply(void 0,t)})),n)&&(i=w.props)[e].apply(i,t)}function M(){var t=w.props.aria;if(t.content){var n="aria-"+t.content,i=O.id;Ne(w.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(n);if(w.state.isVisible)e.setAttribute(n,t?t+" "+i:i);else{var r=t&&t.replace(i,"").trim();r?e.setAttribute(n,r):e.removeAttribute(n)}}))}}function B(){!_&&w.props.aria.expanded&&Ne(w.props.triggerTarget||e).forEach((function(e){w.props.interactive?e.setAttribute("aria-expanded",w.state.isVisible&&e===C()?"true":"false"):e.removeAttribute("aria-expanded")}))}function R(){I().removeEventListener("mousemove",g),ut=ut.filter((function(e){return e!==g}))}function P(e){if(!($e.isTouch&&(m||"mousedown"===e.type)||w.props.interactive&&O.contains(e.target))){if(C().contains(e.target)){if($e.isTouch)return;if(w.state.isVisible&&w.props.trigger.indexOf("click")>=0)return}else N("onClickOutside",[w,e]);!0===w.props.hideOnClick&&(w.clearDelayTimeouts(),w.hide(),f=!0,setTimeout((function(){f=!1})),w.state.isMounted||W())}}function H(){m=!0}function q(){m=!1}function z(){var e=I();e.addEventListener("mousedown",P,!0),e.addEventListener("touchend",P,Ce),e.addEventListener("touchstart",q,Ce),e.addEventListener("touchmove",H,Ce)}function W(){var e=I();e.removeEventListener("mousedown",P,!0),e.removeEventListener("touchend",P,Ce),e.removeEventListener("touchstart",q,Ce),e.removeEventListener("touchmove",H,Ce)}function Q(e,t){var n=D().box;function i(e){e.target===n&&(Ue(n,"remove",i),t())}if(0===e)return t();Ue(n,"remove",s),Ue(n,"add",i),s=i}function V(t,n,i){void 0===i&&(i=!1),Ne(w.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,n,i),v.push({node:e,eventType:t,handler:n,options:i})}))}function F(){var e;A()&&(V("touchstart",$,{passive:!0}),V("touchend",X,{passive:!0})),(e=w.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(V(e,$),e){case"mouseenter":V("mouseleave",X);break;case"focus":V(Ze?"focusout":"blur",Y);break;case"focusin":V("focusout",Y)}}))}function U(){v.forEach((function(e){var t=e.node,n=e.eventType,i=e.handler,r=e.options;t.removeEventListener(n,i,r)})),v=[]}function $(e){var t,n=!1;if(w.state.isEnabled&&!J(e)&&!f){var i="focus"===(null==(t=a)?void 0:t.type);a=e,d=e.currentTarget,B(),!w.state.isVisible&&qe(e)&&ut.forEach((function(t){return t(e)})),"click"===e.type&&(w.props.trigger.indexOf("mouseenter")<0||p)&&!1!==w.props.hideOnClick&&w.state.isVisible?n=!0:te(e),"click"===e.type&&(p=!n),n&&!i&&ne(e)}}function G(e){var t=e.target,n=C().contains(t)||O.contains(t);"mousemove"===e.type&&n||function(e,t){var n=t.clientX,i=t.clientY;return e.every((function(e){var t=e.popperRect,r=e.popperState,o=e.props.interactiveBorder,a=Be(r.placement),s=r.modifiersData.offset;if(!s)return!0;var c="bottom"===a?s.top.y:0,d="top"===a?s.bottom.y:0,l="right"===a?s.left.x:0,u="left"===a?s.right.x:0,p=t.top-i+c>o,f=i-t.bottom-d>o,m=t.left-n+l>o,h=n-t.right-u>o;return p||f||m||h}))}(ee().concat(O).map((function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:u}:null})).filter(Boolean),e)&&(R(),ne(e))}function X(e){J(e)||w.props.trigger.indexOf("click")>=0&&p||(w.props.interactive?w.hideWithInteractivity(e):ne(e))}function Y(e){w.props.trigger.indexOf("focusin")<0&&e.target!==C()||w.props.interactive&&e.relatedTarget&&O.contains(e.relatedTarget)||ne(e)}function J(e){return!!$e.isTouch&&A()!==e.type.indexOf("touch")>=0}function K(){Z();var t=w.props,n=t.popperOptions,i=t.placement,r=t.offset,o=t.getReferenceClientRect,a=t.moveTransition,s=j()?ct(O).arrow:null,d=o?{getBoundingClientRect:o,contextElement:o.contextElement||C()}:e,l=[{name:"offset",options:{offset:r}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!a}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(j()){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={}}}}];j()&&s&&l.push({name:"arrow",options:{element:s,padding:3}}),l.push.apply(l,(null==n?void 0:n.modifiers)||[]),w.popperInstance=Ee(d,O,Object.assign({},n,{placement:i,onFirstUpdate:c,modifiers:l}))}function Z(){w.popperInstance&&(w.popperInstance.destroy(),w.popperInstance=null)}function ee(){return Re(O.querySelectorAll("[data-tippy-root]"))}function te(e){w.clearDelayTimeouts(),e&&N("onTrigger",[w,e]),z();var t=S(!0),n=T(),r=n[0],o=n[1];$e.isTouch&&"hold"===r&&o&&(t=o),t?i=setTimeout((function(){w.show()}),t):w.show()}function ne(e){if(w.clearDelayTimeouts(),N("onUntrigger",[w,e]),w.state.isVisible){if(!(w.props.trigger.indexOf("mouseenter")>=0&&w.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&p)){var t=S(!1);t?r=setTimeout((function(){w.state.isVisible&&w.hide()}),t):o=requestAnimationFrame((function(){w.hide()}))}}else W()}}function mt(e,t){void 0===t&&(t={});var n=tt.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",Xe,Ce),window.addEventListener("blur",Je);var i=Object.assign({},t,{plugins:n}),r=We(e).reduce((function(e,t){var n=t&&ft(t,i);return n&&e.push(n),e}),[]);return He(e)?r[0]:r}mt.defaultProps=tt,mt.setDefaultProps=function(e){Object.keys(e).forEach((function(t){tt[t]=e[t]}))},mt.currentInput=$e;Object.assign({},de,{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)}});mt.setDefaultProps({render:dt});var ht=mt;const vt={_init(){const e=document.querySelectorAll("[data-bind]"),t=document.querySelectorAll("[data-toggle]"),n=document.querySelectorAll("[data-for]"),i=document.querySelectorAll("[data-tooltip]"),r=this;e.forEach(r._bind),t.forEach(r._toggle),n.forEach(r._alias),ht(i,{theme:"cloudinary",arrow:!1,placement:"bottom-start",aria:{content:"auto",expanded:"auto"},content:e=>document.getElementById(e.getAttribute("data-tooltip")).innerHTML})},_bind(e){const t=JSON.parse(e.dataset.condition),n=document.querySelector('input[data-bound="'+e.dataset.bind+'"],select[data-bound="'+e.dataset.bind+'"]');n.addEventListener("change",(function(){vt.compare(e,n,t)})),n.addEventListener("input",(function(){vt.compare(e,n,t)})),n.dispatchEvent(new Event("change"))},_alias(e){e.addEventListener("click",(function(){document.getElementById(e.dataset.for).dispatchEvent(new Event("click"))}))},_toggle(e){e.addEventListener("click",(function(){const t=document.querySelector('[data-wrap="'+e.dataset.toggle+'"]'),n=t.classList.contains("open")?"closed":"open";vt.toggle(t,e,n)}))},compare(e,t,n){const i=t.id;let r=!1,o="closed";r="checkbox"===t.type||"radio"===t.type?t.checked===n[i]:t.value===n[i],!0===r&&(o="open"),vt.toggle(e,t,o)},toggle(e,t,n){const i=e.getElementsByClassName("cld-ui-input");"closed"===n?(e.classList.remove("open"),e.classList.add("closed"),t.classList.contains("dashicons")&&(t.classList.remove("dashicons-arrow-up-alt2"),t.classList.add("dashicons-arrow-down-alt2")),[...i].forEach((function(e){e.dataset.disabled=!0}))):(e.classList.remove("closed"),e.classList.add("open"),t.classList.contains("dashicons")&&(t.classList.remove("dashicons-arrow-down-alt2"),t.classList.add("dashicons-arrow-up-alt2")),[...i].forEach((function(e){e.dataset.disabled=!1})))}};window.addEventListener("load",vt._init());var gt=vt;window.$=window.jQuery;const yt={UI:gt,Settings:r.a,Widget:a.a,GlobalTransformations:c,TermsOrder:l,MediaLibrary:p,Notices:m}}]); \ No newline at end of file diff --git a/js/gallery-block.asset.php b/js/gallery-block.asset.php index 98d31620f..00e5b662d 100644 --- a/js/gallery-block.asset.php +++ b/js/gallery-block.asset.php @@ -1 +1 @@ - array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-components/build-style/style.css', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '2695e94cb7e3a139b92189c7f3552ac8'); \ No newline at end of file + array('react', 'react-dom', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-components/build-style/style.css', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '95635dcdce3468c638dab46e572af7a3'); \ No newline at end of file diff --git a/js/gallery-block.js b/js/gallery-block.js index 086c27828..54418be48 100644 --- a/js/gallery-block.js +++ b/js/gallery-block.js @@ -1 +1 @@ -!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=135)}([function(e,t){!function(){e.exports=this.React}()},function(e,t){!function(){e.exports=this.wp.i18n}()},function(e,t){!function(){e.exports=this.wp.components}()},function(e,t){!function(){e.exports=this.wp.element}()},function(e,t,n){var r=n(37),o="object"==typeof self&&self&&self.Object===Object&&self,a=r||o||Function("return this")();e.exports=a},function(e,t,n){var r=n(76),o=n(82);e.exports=function(e,t){var n=o(e,t);return r(n)?n:void 0}},function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=n=function(e){return typeof e}:e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(t)}e.exports=n},function(e,t){!function(){e.exports=this.wp.blockEditor}()},function(e,t,n){"use strict";function r(e,t){var n,r;if("function"==typeof t)void 0!==(r=t(e))&&(e=r);else if(Array.isArray(t))for(n=0;n=0&&(e=e.replace(/\[/g,t).replace(/]/g,""));var n=e.split(t);if(n.filter(u).length!==n.length)throw Error("Refusing to update blacklisted property "+e);return n}var p=Object.prototype.hasOwnProperty;function f(e,t,n,r){if(!(this instanceof f))return new f(e,t,n,r);void 0===t&&(t=!1),void 0===n&&(n=!0),void 0===r&&(r=!0),this.separator=e||".",this.override=t,this.useArray=n,this.useBrackets=r,this.keepArray=!1,this.cleanup=[]}var d=new f(".",!1,!0,!0);function y(e){return function(){return d[e].apply(d,arguments)}}f.prototype._fill=function(e,t,n,o){var a=e.shift();if(e.length>0){if(t[a]=t[a]||(this.useArray&&function(e){return/^\d+$/.test(e)}(e[0])?[]:{}),!i(t[a])){if(!this.override){if(!i(n)||!c(n))throw new Error("Trying to redefine `"+a+"` which is a "+typeof t[a]);return}t[a]={}}this._fill(e,t[a],n,o)}else{if(!this.override&&i(t[a])&&!c(t[a])){if(!i(n)||!c(n))throw new Error("Trying to redefine non-empty obj['"+a+"']");return}t[a]=r(n,o)}},f.prototype.object=function(e,t){var n=this;return Object.keys(e).forEach((function(o){var a=void 0===t?null:t[o],i=s(o,n.separator).join(n.separator);-1!==i.indexOf(n.separator)?(n._fill(i.split(n.separator),e,e[o],a),delete e[o]):e[o]=r(e[o],a)})),e},f.prototype.str=function(e,t,n,o){var a=s(e,this.separator).join(this.separator);return-1!==e.indexOf(this.separator)?this._fill(a.split(this.separator),n,t,o):n[e]=r(t,o),n},f.prototype.pick=function(e,t,n,r){var a,i,c,l,u;for(i=s(e,this.separator),a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}},function(e,t,n){var r=n(66),o=n(67),a=n(68),i=n(69),c=n(70);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e<=9007199254740991}},function(e,t){e.exports=function(e,t){return function(n){return e(t(n))}}},function(e,t,n){var r=n(36),o=n(43);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},function(e,t){e.exports=function(){return[]}},function(e,t,n){var r=n(48),o=n(49),a=n(29),i=n(46),c=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,a(e)),e=o(e);return t}:i;e.exports=c},function(e,t){e.exports=function(e,t){for(var n=-1,r=t.length,o=e.length;++n=0||(o[n]=e[n]);return o}},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,o=!1,a=void 0;try{for(var i,c=e[Symbol.iterator]();!(r=(i=c.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw a}}return n}}},function(e,t,n){var r=n(61);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n-1}},function(e,t,n){var r=n(13);e.exports=function(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}},function(e,t,n){var r=n(12);e.exports=function(){this.__data__=new r,this.size=0}},function(e,t){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},function(e,t){e.exports=function(e){return this.__data__.get(e)}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t,n){var r=n(12),o=n(20),a=n(83);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var i=n.__data__;if(!o||i.length<199)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new a(i)}return n.set(e,t),this.size=n.size,this}},function(e,t,n){var r=n(36),o=n(80),a=n(9),i=n(38),c=/^\[object .+?Constructor\]$/,l=Function.prototype,u=Object.prototype,s=l.toString,p=u.hasOwnProperty,f=RegExp("^"+s.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!a(e)||o(e))&&(r(e)?f:c).test(i(e))}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){var r=n(21),o=Object.prototype,a=o.hasOwnProperty,i=o.toString,c=r?r.toStringTag:void 0;e.exports=function(e){var t=a.call(e,c),n=e[c];try{e[c]=void 0;var r=!0}catch(e){}var o=i.call(e);return r&&(t?e[c]=n:delete e[c]),o}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t,n){var r,o=n(81),a=(r=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!a&&a in e}},function(e,t,n){var r=n(4)["__core-js_shared__"];e.exports=r},function(e,t){e.exports=function(e,t){return null==e?void 0:e[t]}},function(e,t,n){var r=n(84),o=n(91),a=n(93),i=n(94),c=n(95);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e=0&&(e=e.replace(/\[/g,t).replace(/]/g,""));var n=e.split(t);if(n.filter(s).length!==n.length)throw Error("Refusing to update blacklisted property "+e);return n}var p=Object.prototype.hasOwnProperty;function f(e,t,n,r){if(!(this instanceof f))return new f(e,t,n,r);void 0===t&&(t=!1),void 0===n&&(n=!0),void 0===r&&(r=!0),this.separator=e||".",this.override=t,this.useArray=n,this.useBrackets=r,this.keepArray=!1,this.cleanup=[]}var d=new f(".",!1,!0,!0);function m(e){return function(){return d[e].apply(d,arguments)}}f.prototype._fill=function(e,t,n,o){var i=e.shift();if(e.length>0){if(t[i]=t[i]||(this.useArray&&function(e){return/^\d+$/.test(e)}(e[0])?[]:{}),!a(t[i])){if(!this.override){if(!a(n)||!c(n))throw new Error("Trying to redefine `"+i+"` which is a "+typeof t[i]);return}t[i]={}}this._fill(e,t[i],n,o)}else{if(!this.override&&a(t[i])&&!c(t[i])){if(!a(n)||!c(n))throw new Error("Trying to redefine non-empty obj['"+i+"']");return}t[i]=r(n,o)}},f.prototype.object=function(e,t){var n=this;return Object.keys(e).forEach((function(o){var i=void 0===t?null:t[o],a=l(o,n.separator).join(n.separator);-1!==a.indexOf(n.separator)?(n._fill(a.split(n.separator),e,e[o],i),delete e[o]):e[o]=r(e[o],i)})),e},f.prototype.str=function(e,t,n,o){var i=l(e,this.separator).join(this.separator);return-1!==e.indexOf(this.separator)?this._fill(i.split(this.separator),n,t,o):n[e]=r(t,o),n},f.prototype.pick=function(e,t,n,r){var i,a,c,u,s;for(a=l(e,this.separator),i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}},function(e,t,n){var r=n(69),o=n(70),i=n(71),a=n(72),c=n(73);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e<=9007199254740991}},function(e,t){e.exports=function(e,t){return function(n){return e(t(n))}}},function(e,t,n){var r=n(36),o=n(43);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},function(e,t){e.exports=function(){return[]}},function(e,t,n){var r=n(48),o=n(49),i=n(29),a=n(46),c=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,i(e)),e=o(e);return t}:a;e.exports=c},function(e,t){e.exports=function(e,t){for(var n=-1,r=t.length,o=e.length;++n=0||(o[n]=e[n]);return o}},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}}},function(e,t,n){var r=n(64);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n-1}},function(e,t,n){var r=n(13);e.exports=function(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}},function(e,t,n){var r=n(12);e.exports=function(){this.__data__=new r,this.size=0}},function(e,t){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},function(e,t){e.exports=function(e){return this.__data__.get(e)}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t,n){var r=n(12),o=n(20),i=n(86);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!o||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new i(a)}return n.set(e,t),this.size=n.size,this}},function(e,t,n){var r=n(36),o=n(83),i=n(9),a=n(38),c=/^\[object .+?Constructor\]$/,u=Function.prototype,s=Object.prototype,l=u.toString,p=s.hasOwnProperty,f=RegExp("^"+l.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!i(e)||o(e))&&(r(e)?f:c).test(a(e))}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){var r=n(21),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,c=r?r.toStringTag:void 0;e.exports=function(e){var t=i.call(e,c),n=e[c];try{e[c]=void 0;var r=!0}catch(e){}var o=a.call(e);return r&&(t?e[c]=n:delete e[c]),o}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t,n){var r,o=n(84),i=(r=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!i&&i in e}},function(e,t,n){var r=n(4)["__core-js_shared__"];e.exports=r},function(e,t){e.exports=function(e,t){return null==e?void 0:e[t]}},function(e,t,n){var r=n(87),o=n(94),i=n(96),a=n(97),c=n(98);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e=0?e.ownerDocument.body:M(e)&&Z(e)?e:z(W(e))}function U(e,t){var n;void 0===t&&(t=[]);var r=z(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=A(r),a=o?[i].concat(i.visualViewport||[],Z(r)?r:[]):r,c=t.concat(a);return o?c:c.concat(U(W(a)))}function V(e){return["table","td","th"].indexOf(D(e))>=0}function H(e){return M(e)&&"fixed"!==N(e).position?e.offsetParent:null}function q(e){for(var t=A(e),n=H(e);n&&V(n)&&"static"===N(n).position;)n=H(n);return n&&("html"===D(n)||"body"===D(n)&&"static"===N(n).position)?t:n||function(e){for(var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox"),n=W(e);M(n)&&["html","body"].indexOf(D(n))<0;){var r=N(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 $="top",G="bottom",J="right",X="left",Y="auto",K=[$,G,J,X],Q="start",ee="end",te="viewport",ne="popper",re=K.reduce((function(e,t){return e.concat([t+"-"+Q,t+"-"+ee])}),[]),oe=[].concat(K,[Y]).reduce((function(e,t){return e.concat([t,t+"-"+Q,t+"-"+ee])}),[]),ie=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function ae(e){var t=new Map,n=new Set,r=[];function o(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&o(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||o(e)})),r}var ce={placement:"bottom",modifiers:[],strategy:"absolute"};function ue(){for(var e=arguments.length,t=new Array(e),n=0;n=0?"x":"y"}function ve(e){var t,n=e.reference,r=e.element,o=e.placement,i=o?fe(o):null,a=o?de(o):null,c=n.x+n.width/2-r.width/2,u=n.y+n.height/2-r.height/2;switch(i){case $:t={x:c,y:n.y-r.height};break;case G:t={x:c,y:n.y+n.height};break;case J:t={x:n.x+n.width,y:u};break;case X:t={x:n.x-r.width,y:u};break;default:t={x:n.x,y:n.y}}var s=i?me(i):null;if(null!=s){var l="y"===s?"height":"width";switch(a){case Q:t[s]=t[s]-(n[l]/2-r[l]/2);break;case ee:t[s]=t[s]+(n[l]/2-r[l]/2)}}return t}var ye={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=ve({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},be=Math.max,he=Math.min,ge=Math.round,_e={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Oe(e){var t,n=e.popper,r=e.popperRect,o=e.placement,i=e.offsets,a=e.position,c=e.gpuAcceleration,u=e.adaptive,s=e.roundOffsets,l=!0===s?function(e){var t=e.x,n=e.y,r=window.devicePixelRatio||1;return{x:ge(ge(t*r)/r)||0,y:ge(ge(n*r)/r)||0}}(i):"function"==typeof s?s(i):i,p=l.x,f=void 0===p?0:p,d=l.y,m=void 0===d?0:d,v=i.hasOwnProperty("x"),y=i.hasOwnProperty("y"),b=X,h=$,g=window;if(u){var _=q(n),O="clientHeight",w="clientWidth";_===A(n)&&"static"!==N(_=B(n)).position&&(O="scrollHeight",w="scrollWidth"),_=_,o===$&&(h=G,m-=_[O]-r.height,m*=c?1:-1),o===X&&(b=J,f-=_[w]-r.width,f*=c?1:-1)}var j,x=Object.assign({position:a},u&&_e);return c?Object.assign({},x,((j={})[h]=y?"0":"",j[b]=v?"0":"",j.transform=(g.devicePixelRatio||1)<2?"translate("+f+"px, "+m+"px)":"translate3d("+f+"px, "+m+"px, 0)",j)):Object.assign({},x,((t={})[h]=y?m+"px":"",t[b]=v?f+"px":"",t.transform="",t))}var we={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]||{},o=t.elements[e];M(o)&&D(o)&&(Object.assign(o.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?o.removeAttribute(e):o.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],o=t.attributes[e]||{},i=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});M(r)&&D(r)&&(Object.assign(r.style,i),Object.keys(o).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};var je={left:"right",right:"left",bottom:"top",top:"bottom"};function xe(e){return e.replace(/left|right|bottom|top/g,(function(e){return je[e]}))}var Le={start:"end",end:"start"};function Ee(e){return e.replace(/start|end/g,(function(e){return Le[e]}))}function Pe(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&T(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function ke(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Ae(e,t){return t===te?ke(function(e){var t=A(e),n=B(e),r=t.visualViewport,o=n.clientWidth,i=n.clientHeight,a=0,c=0;return r&&(o=r.width,i=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=r.offsetLeft,c=r.offsetTop)),{width:o,height:i,x:a+R(e),y:c}}(e)):M(t)?function(e){var t=k(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(t):ke(function(e){var t,n=B(e),r=S(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=be(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=be(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),c=-r.scrollLeft+R(e),u=-r.scrollTop;return"rtl"===N(o||n).direction&&(c+=be(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:c,y:u}}(B(e)))}function Se(e,t,n){var r="clippingParents"===t?function(e){var t=U(W(e)),n=["absolute","fixed"].indexOf(N(e).position)>=0&&M(e)?q(e):e;return C(n)?t.filter((function(e){return C(e)&&Pe(e,n)&&"body"!==D(e)})):[]}(e):[].concat(t),o=[].concat(r,[n]),i=o[0],a=o.reduce((function(t,n){var r=Ae(e,n);return t.top=be(r.top,t.top),t.right=he(r.right,t.right),t.bottom=he(r.bottom,t.bottom),t.left=be(r.left,t.left),t}),Ae(e,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Ce(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function Me(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function Te(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=void 0===r?e.placement:r,i=n.boundary,a=void 0===i?"clippingParents":i,c=n.rootBoundary,u=void 0===c?te:c,s=n.elementContext,l=void 0===s?ne:s,p=n.altBoundary,f=void 0!==p&&p,d=n.padding,m=void 0===d?0:d,v=Ce("number"!=typeof m?m:Me(m,K)),y=l===ne?"reference":ne,b=e.elements.reference,h=e.rects.popper,g=e.elements[f?y:l],_=Se(C(g)?g:g.contextElement||B(e.elements.popper),a,u),O=k(b),w=ve({reference:O,element:h,strategy:"absolute",placement:o}),j=ke(Object.assign({},h,w)),x=l===ne?j:O,L={top:_.top-x.top+v.top,bottom:x.bottom-_.bottom+v.bottom,left:_.left-x.left+v.left,right:x.right-_.right+v.right},E=e.modifiersData.offset;if(l===ne&&E){var P=E[o];Object.keys(L).forEach((function(e){var t=[J,G].indexOf(e)>=0?1:-1,n=[$,G].indexOf(e)>=0?"y":"x";L[e]+=P[n]*t}))}return L}function De(e,t,n){return be(e,he(t,n))}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 Re(e){return[$,J,G,X].some((function(t){return e[t]>=0}))}var Ne=se({defaultModifiers:[pe,ye,{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=void 0===r||r,i=n.adaptive,a=void 0===i||i,c=n.roundOffsets,u=void 0===c||c,s={placement:fe(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,Oe(Object.assign({},s,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:u})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,Oe(Object.assign({},s,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},we,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=void 0===o?[0,0]:o,a=oe.reduce((function(e,n){return e[n]=function(e,t,n){var r=fe(e),o=[X,$].indexOf(r)>=0?-1:1,i="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=i[0],c=i[1];return a=a||0,c=(c||0)*o,[X,J].indexOf(r)>=0?{x:c,y:a}:{x:a,y:c}}(n,t.rects,i),e}),{}),c=a[t.placement],u=c.x,s=c.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=u,t.modifiersData.popperOffsets.y+=s),t.modifiersData[r]=a}},{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=void 0===o||o,a=n.altAxis,c=void 0===a||a,u=n.fallbackPlacements,s=n.padding,l=n.boundary,p=n.rootBoundary,f=n.altBoundary,d=n.flipVariations,m=void 0===d||d,v=n.allowedAutoPlacements,y=t.options.placement,b=fe(y),h=u||(b===y||!m?[xe(y)]:function(e){if(fe(e)===Y)return[];var t=xe(e);return[Ee(e),t,Ee(t)]}(y)),g=[y].concat(h).reduce((function(e,n){return e.concat(fe(n)===Y?function(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,a=n.padding,c=n.flipVariations,u=n.allowedAutoPlacements,s=void 0===u?oe:u,l=de(r),p=l?c?re:re.filter((function(e){return de(e)===l})):K,f=p.filter((function(e){return s.indexOf(e)>=0}));0===f.length&&(f=p);var d=f.reduce((function(t,n){return t[n]=Te(e,{placement:n,boundary:o,rootBoundary:i,padding:a})[fe(n)],t}),{});return Object.keys(d).sort((function(e,t){return d[e]-d[t]}))}(t,{placement:n,boundary:l,rootBoundary:p,padding:s,flipVariations:m,allowedAutoPlacements:v}):n)}),[]),_=t.rects.reference,O=t.rects.popper,w=new Map,j=!0,x=g[0],L=0;L=0,S=A?"width":"height",C=Te(t,{placement:E,boundary:l,rootBoundary:p,altBoundary:f,padding:s}),M=A?k?J:X:k?G:$;_[S]>O[S]&&(M=xe(M));var T=xe(M),D=[];if(i&&D.push(C[P]<=0),c&&D.push(C[M]<=0,C[T]<=0),D.every((function(e){return e}))){x=E,j=!1;break}w.set(E,D)}if(j)for(var B=function(e){var t=g.find((function(t){var n=w.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return x=t,"break"},R=m?3:1;R>0;R--){if("break"===B(R))break}t.placement!==x&&(t.modifiersData[r]._skip=!0,t.placement=x,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,i=void 0===o||o,a=n.altAxis,c=void 0!==a&&a,u=n.boundary,s=n.rootBoundary,l=n.altBoundary,p=n.padding,f=n.tether,d=void 0===f||f,m=n.tetherOffset,v=void 0===m?0:m,y=Te(t,{boundary:u,rootBoundary:s,padding:p,altBoundary:l}),b=fe(t.placement),h=de(t.placement),g=!h,_=me(b),O="x"===_?"y":"x",w=t.modifiersData.popperOffsets,j=t.rects.reference,x=t.rects.popper,L="function"==typeof v?v(Object.assign({},t.rects,{placement:t.placement})):v,E={x:0,y:0};if(w){if(i||c){var P="y"===_?$:X,k="y"===_?G:J,A="y"===_?"height":"width",S=w[_],C=w[_]+y[P],M=w[_]-y[k],T=d?-x[A]/2:0,D=h===Q?j[A]:x[A],B=h===Q?-x[A]:-j[A],R=t.elements.arrow,N=d&&R?F(R):{width:0,height:0},Z=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},I=Z[P],W=Z[k],z=De(0,j[A],N[A]),U=g?j[A]/2-T-z-I-L:D-z-I-L,V=g?-j[A]/2+T+z+W+L:B+z+W+L,H=t.elements.arrow&&q(t.elements.arrow),Y=H?"y"===_?H.clientTop||0:H.clientLeft||0:0,K=t.modifiersData.offset?t.modifiersData.offset[t.placement][_]:0,ee=w[_]+U-K-Y,te=w[_]+V-K;if(i){var ne=De(d?he(C,ee):C,S,d?be(M,te):M);w[_]=ne,E[_]=ne-S}if(c){var re="x"===_?$:X,oe="x"===_?G:J,ie=w[O],ae=ie+y[re],ce=ie-y[oe],ue=De(d?he(ae,ee):ae,ie,d?be(ce,te):ce);w[O]=ue,E[O]=ue-ie}}t.modifiersData[r]=E}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,c=fe(n.placement),u=me(c),s=[X,J].indexOf(c)>=0?"height":"width";if(i&&a){var l=function(e,t){return Ce("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:Me(e,K))}(o.padding,n),p=F(i),f="y"===u?$:X,d="y"===u?G:J,m=n.rects.reference[s]+n.rects.reference[u]-a[u]-n.rects.popper[s],v=a[u]-n.rects.reference[u],y=q(i),b=y?"y"===u?y.clientHeight||0:y.clientWidth||0:0,h=m/2-v/2,g=l[f],_=b-p[s]-l[d],O=b/2-p[s]/2+h,w=De(g,O,_),j=u;n.modifiersData[r]=((t={})[j]=w,t.centerOffset=w-O,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)))&&Pe(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=Te(t,{elementContext:"reference"}),c=Te(t,{altBoundary:!0}),u=Be(a,r),s=Be(c,o,i),l=Re(u),p=Re(s);t.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:s,isReferenceHidden:l,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":l,"data-popper-escaped":p})}}]}),Ze="tippy-content",Ie="tippy-backdrop",Fe="tippy-arrow",We="tippy-svg-arrow",ze={passive:!0,capture:!0};function Ue(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function Ve(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function He(e,t){return"function"==typeof e?e.apply(void 0,t):e}function qe(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout((function(){e(r)}),t)};var n}function $e(e){return[].concat(e)}function Ge(e,t){-1===e.indexOf(t)&&e.push(t)}function Je(e){return e.split("-")[0]}function Xe(e){return[].slice.call(e)}function Ye(){return document.createElement("div")}function Ke(e){return["Element","Fragment"].some((function(t){return Ve(e,t)}))}function Qe(e){return Ve(e,"MouseEvent")}function et(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function tt(e){return Ke(e)?[e]:function(e){return Ve(e,"NodeList")}(e)?Xe(e):Array.isArray(e)?e:Xe(document.querySelectorAll(e))}function nt(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function rt(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function ot(e){var t,n=$e(e)[0];return(null==n||null==(t=n.ownerDocument)?void 0:t.body)?n.ownerDocument:document}function it(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[r](t,n)}))}var at={isTouch:!1},ct=0;function ut(){at.isTouch||(at.isTouch=!0,window.performance&&document.addEventListener("mousemove",st))}function st(){var e=performance.now();e-ct<20&&(at.isTouch=!1,document.removeEventListener("mousemove",st)),ct=e}function lt(){var e=document.activeElement;if(et(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var pt="undefined"!=typeof window&&"undefined"!=typeof document?navigator.userAgent:"",ft=/MSIE |Trident\//.test(pt);var dt={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},mt=Object.assign({appendTo:function(){return document.body},aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},dt,{},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),vt=Object.keys(mt);function yt(e){var t=(e.plugins||[]).reduce((function(t,n){var r=n.name,o=n.defaultValue;return r&&(t[r]=void 0!==e[r]?e[r]:o),t}),{});return Object.assign({},e,{},t)}function bt(e,t){var n=Object.assign({},t,{content:He(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(yt(Object.assign({},mt,{plugins:t}))):vt).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({},mt.aria,{},n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}function ht(e,t){e.innerHTML=t}function gt(e){var t=Ye();return!0===e?t.className=Fe:(t.className=We,Ke(e)?t.appendChild(e):ht(t,e)),t}function _t(e,t){Ke(t.content)?(ht(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?ht(e,t.content):e.textContent=t.content)}function Ot(e){var t=e.firstElementChild,n=Xe(t.children);return{box:t,content:n.find((function(e){return e.classList.contains(Ze)})),arrow:n.find((function(e){return e.classList.contains(Fe)||e.classList.contains(We)})),backdrop:n.find((function(e){return e.classList.contains(Ie)}))}}function wt(e){var t=Ye(),n=Ye();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Ye();function o(n,r){var o=Ot(t),i=o.box,a=o.content,c=o.arrow;r.theme?i.setAttribute("data-theme",r.theme):i.removeAttribute("data-theme"),"string"==typeof r.animation?i.setAttribute("data-animation",r.animation):i.removeAttribute("data-animation"),r.inertia?i.setAttribute("data-inertia",""):i.removeAttribute("data-inertia"),i.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?i.setAttribute("role",r.role):i.removeAttribute("role"),n.content===r.content&&n.allowHTML===r.allowHTML||_t(a,e.props),r.arrow?c?n.arrow!==r.arrow&&(i.removeChild(c),i.appendChild(gt(r.arrow))):i.appendChild(gt(r.arrow)):c&&i.removeChild(c)}return r.className=Ze,r.setAttribute("data-state","hidden"),_t(r,e.props),t.appendChild(n),n.appendChild(r),o(e.props,e.props),{popper:t,onUpdate:o}}wt.$$tippy=!0;var jt=1,xt=[],Lt=[];function Et(e,t){var n,r,o,i,a,c,u,s,l,p=bt(e,Object.assign({},mt,{},yt((n=t,Object.keys(n).reduce((function(e,t){return void 0!==n[t]&&(e[t]=n[t]),e}),{}))))),f=!1,d=!1,m=!1,v=!1,y=[],b=qe(G,p.interactiveDebounce),h=jt++,g=(l=p.plugins).filter((function(e,t){return l.indexOf(e)===t})),_={id:h,reference:e,popper:Ye(),popperInstance:null,props:p,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:g,clearDelayTimeouts:function(){clearTimeout(r),clearTimeout(o),cancelAnimationFrame(i)},setProps:function(t){0;if(_.state.isDestroyed)return;D("onBeforeUpdate",[_,t]),q();var n=_.props,r=bt(e,Object.assign({},_.props,{},t,{ignoreAttributes:!0}));_.props=r,H(),n.interactiveDebounce!==r.interactiveDebounce&&(N(),b=qe(G,r.interactiveDebounce));n.triggerTarget&&!r.triggerTarget?$e(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):r.triggerTarget&&e.removeAttribute("aria-expanded");R(),T(),j&&j(n,r);_.popperInstance&&(K(),ee().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));D("onAfterUpdate",[_,t])},setContent:function(e){_.setProps({content:e})},show:function(){0;var e=_.state.isVisible,t=_.state.isDestroyed,n=!_.state.isEnabled,r=at.isTouch&&!_.props.touch,o=Ue(_.props.duration,0,mt.duration);if(e||t||n||r)return;if(A().hasAttribute("disabled"))return;if(D("onShow",[_],!1),!1===_.props.onShow(_))return;_.state.isVisible=!0,k()&&(w.style.visibility="visible");T(),W(),_.state.isMounted||(w.style.transition="none");if(k()){var i=C(),a=i.box,c=i.content;nt([a,c],0)}u=function(){var e;if(_.state.isVisible&&!v){if(v=!0,w.offsetHeight,w.style.transition=_.props.moveTransition,k()&&_.props.animation){var t=C(),n=t.box,r=t.content;nt([n,r],o),rt([n,r],"visible")}B(),R(),Ge(Lt,_),null==(e=_.popperInstance)||e.forceUpdate(),_.state.isMounted=!0,D("onMount",[_]),_.props.animation&&k()&&function(e,t){U(e,t)}(o,(function(){_.state.isShown=!0,D("onShown",[_])}))}},function(){var e,t=_.props.appendTo,n=A();e=_.props.interactive&&t===mt.appendTo||"parent"===t?n.parentNode:He(t,[n]);e.contains(w)||e.appendChild(w);K(),!1}()},hide:function(){0;var e=!_.state.isVisible,t=_.state.isDestroyed,n=!_.state.isEnabled,r=Ue(_.props.duration,1,mt.duration);if(e||t||n)return;if(D("onHide",[_],!1),!1===_.props.onHide(_))return;_.state.isVisible=!1,_.state.isShown=!1,v=!1,f=!1,k()&&(w.style.visibility="hidden");if(N(),z(),T(),k()){var o=C(),i=o.box,a=o.content;_.props.animation&&(nt([i,a],r),rt([i,a],"hidden"))}B(),R(),_.props.animation?k()&&function(e,t){U(e,(function(){!_.state.isVisible&&w.parentNode&&w.parentNode.contains(w)&&t()}))}(r,_.unmount):_.unmount()},hideWithInteractivity:function(e){0;S().addEventListener("mousemove",b),Ge(xt,b),b(e)},enable:function(){_.state.isEnabled=!0},disable:function(){_.hide(),_.state.isEnabled=!1},unmount:function(){0;_.state.isVisible&&_.hide();if(!_.state.isMounted)return;Q(),ee().forEach((function(e){e._tippy.unmount()})),w.parentNode&&w.parentNode.removeChild(w);Lt=Lt.filter((function(e){return e!==_})),_.state.isMounted=!1,D("onHidden",[_])},destroy:function(){0;if(_.state.isDestroyed)return;_.clearDelayTimeouts(),_.unmount(),q(),delete e._tippy,_.state.isDestroyed=!0,D("onDestroy",[_])}};if(!p.render)return _;var O=p.render(_),w=O.popper,j=O.onUpdate;w.setAttribute("data-tippy-root",""),w.id="tippy-"+_.id,_.popper=w,e._tippy=_,w._tippy=_;var x=g.map((function(e){return e.fn(_)})),L=e.hasAttribute("aria-expanded");return H(),R(),T(),D("onCreate",[_]),p.showOnCreate&&te(),w.addEventListener("mouseenter",(function(){_.props.interactive&&_.state.isVisible&&_.clearDelayTimeouts()})),w.addEventListener("mouseleave",(function(e){_.props.interactive&&_.props.trigger.indexOf("mouseenter")>=0&&(S().addEventListener("mousemove",b),b(e))})),_;function E(){var e=_.props.touch;return Array.isArray(e)?e:[e,0]}function P(){return"hold"===E()[0]}function k(){var e;return!!(null==(e=_.props.render)?void 0:e.$$tippy)}function A(){return s||e}function S(){var e=A().parentNode;return e?ot(e):document}function C(){return Ot(w)}function M(e){return _.state.isMounted&&!_.state.isVisible||at.isTouch||a&&"focus"===a.type?0:Ue(_.props.delay,e?0:1,mt.delay)}function T(){w.style.pointerEvents=_.props.interactive&&_.state.isVisible?"":"none",w.style.zIndex=""+_.props.zIndex}function D(e,t,n){var r;(void 0===n&&(n=!0),x.forEach((function(n){n[e]&&n[e].apply(void 0,t)})),n)&&(r=_.props)[e].apply(r,t)}function B(){var t=_.props.aria;if(t.content){var n="aria-"+t.content,r=w.id;$e(_.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(n);if(_.state.isVisible)e.setAttribute(n,t?t+" "+r:r);else{var o=t&&t.replace(r,"").trim();o?e.setAttribute(n,o):e.removeAttribute(n)}}))}}function R(){!L&&_.props.aria.expanded&&$e(_.props.triggerTarget||e).forEach((function(e){_.props.interactive?e.setAttribute("aria-expanded",_.state.isVisible&&e===A()?"true":"false"):e.removeAttribute("aria-expanded")}))}function N(){S().removeEventListener("mousemove",b),xt=xt.filter((function(e){return e!==b}))}function Z(e){if(!(at.isTouch&&(m||"mousedown"===e.type)||_.props.interactive&&w.contains(e.target))){if(A().contains(e.target)){if(at.isTouch)return;if(_.state.isVisible&&_.props.trigger.indexOf("click")>=0)return}else D("onClickOutside",[_,e]);!0===_.props.hideOnClick&&(_.clearDelayTimeouts(),_.hide(),d=!0,setTimeout((function(){d=!1})),_.state.isMounted||z())}}function I(){m=!0}function F(){m=!1}function W(){var e=S();e.addEventListener("mousedown",Z,!0),e.addEventListener("touchend",Z,ze),e.addEventListener("touchstart",F,ze),e.addEventListener("touchmove",I,ze)}function z(){var e=S();e.removeEventListener("mousedown",Z,!0),e.removeEventListener("touchend",Z,ze),e.removeEventListener("touchstart",F,ze),e.removeEventListener("touchmove",I,ze)}function U(e,t){var n=C().box;function r(e){e.target===n&&(it(n,"remove",r),t())}if(0===e)return t();it(n,"remove",c),it(n,"add",r),c=r}function V(t,n,r){void 0===r&&(r=!1),$e(_.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,n,r),y.push({node:e,eventType:t,handler:n,options:r})}))}function H(){var e;P()&&(V("touchstart",$,{passive:!0}),V("touchend",J,{passive:!0})),(e=_.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(V(e,$),e){case"mouseenter":V("mouseleave",J);break;case"focus":V(ft?"focusout":"blur",X);break;case"focusin":V("focusout",X)}}))}function q(){y.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,o=e.options;t.removeEventListener(n,r,o)})),y=[]}function $(e){var t,n=!1;if(_.state.isEnabled&&!Y(e)&&!d){var r="focus"===(null==(t=a)?void 0:t.type);a=e,s=e.currentTarget,R(),!_.state.isVisible&&Qe(e)&&xt.forEach((function(t){return t(e)})),"click"===e.type&&(_.props.trigger.indexOf("mouseenter")<0||f)&&!1!==_.props.hideOnClick&&_.state.isVisible?n=!0:te(e),"click"===e.type&&(f=!n),n&&!r&&ne(e)}}function G(e){var t=e.target,n=A().contains(t)||w.contains(t);"mousemove"===e.type&&n||function(e,t){var n=t.clientX,r=t.clientY;return e.every((function(e){var t=e.popperRect,o=e.popperState,i=e.props.interactiveBorder,a=Je(o.placement),c=o.modifiersData.offset;if(!c)return!0;var u="bottom"===a?c.top.y:0,s="top"===a?c.bottom.y:0,l="right"===a?c.left.x:0,p="left"===a?c.right.x:0,f=t.top-r+u>i,d=r-t.bottom-s>i,m=t.left-n+l>i,v=n-t.right-p>i;return f||d||m||v}))}(ee().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),e)&&(N(),ne(e))}function J(e){Y(e)||_.props.trigger.indexOf("click")>=0&&f||(_.props.interactive?_.hideWithInteractivity(e):ne(e))}function X(e){_.props.trigger.indexOf("focusin")<0&&e.target!==A()||_.props.interactive&&e.relatedTarget&&w.contains(e.relatedTarget)||ne(e)}function Y(e){return!!at.isTouch&&P()!==e.type.indexOf("touch")>=0}function K(){Q();var t=_.props,n=t.popperOptions,r=t.placement,o=t.offset,i=t.getReferenceClientRect,a=t.moveTransition,c=k()?Ot(w).arrow:null,s=i?{getBoundingClientRect:i,contextElement:i.contextElement||A()}:e,l=[{name:"offset",options:{offset:o}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!a}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(k()){var n=C().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={}}}}];k()&&c&&l.push({name:"arrow",options:{element:c,padding:3}}),l.push.apply(l,(null==n?void 0:n.modifiers)||[]),_.popperInstance=Ne(s,w,Object.assign({},n,{placement:r,onFirstUpdate:u,modifiers:l}))}function Q(){_.popperInstance&&(_.popperInstance.destroy(),_.popperInstance=null)}function ee(){return Xe(w.querySelectorAll("[data-tippy-root]"))}function te(e){_.clearDelayTimeouts(),e&&D("onTrigger",[_,e]),W();var t=M(!0),n=E(),o=n[0],i=n[1];at.isTouch&&"hold"===o&&i&&(t=i),t?r=setTimeout((function(){_.show()}),t):_.show()}function ne(e){if(_.clearDelayTimeouts(),D("onUntrigger",[_,e]),_.state.isVisible){if(!(_.props.trigger.indexOf("mouseenter")>=0&&_.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&f)){var t=M(!1);t?o=setTimeout((function(){_.state.isVisible&&_.hide()}),t):i=requestAnimationFrame((function(){_.hide()}))}}else z()}}function Pt(e,t){void 0===t&&(t={});var n=mt.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",ut,ze),window.addEventListener("blur",lt);var r=Object.assign({},t,{plugins:n}),o=tt(e).reduce((function(e,t){var n=t&&Et(t,r);return n&&e.push(n),e}),[]);return Ke(e)?o[0]:o}Pt.defaultProps=mt,Pt.setDefaultProps=function(e){Object.keys(e).forEach((function(t){mt[t]=e[t]}))},Pt.currentInput=at;Object.assign({},we,{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)}});Pt.setDefaultProps({render:wt});var kt=Pt,At=n(55);function St(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}var Ct="undefined"!=typeof window&&"undefined"!=typeof document;function Mt(e,t){e&&("function"==typeof e&&e(t),{}.hasOwnProperty.call(e,"current")&&(e.current=t))}function Tt(){return Ct&&document.createElement("div")}function Dt(e,t){var n,r,o,i,a;return Object.assign({},t,{popperOptions:Object.assign({},e.popperOptions,t.popperOptions,{modifiers:(o=[].concat((null==(n=e.popperOptions)?void 0:n.modifiers)||[],(null==(r=t.popperOptions)?void 0:r.modifiers)||[]),i=[],a=Object.create(null),o.forEach((function(e){void 0===a[JSON.stringify(e)]&&i.push(e),a[JSON.stringify(e)]=!0})),i)})})}var Bt=Ct?y.useLayoutEffect:y.useEffect;function Rt(e){var t=Object(y.useRef)();return t.current||(t.current="function"==typeof e?e():e),t.current}function Nt(e,t,n){n.split(/\s+/).forEach((function(n){n&&e.classList[t](n)}))}var Zt={name:"className",defaultValue:"",fn:function(e){var t=e.popper.firstElementChild,n=function(){var t;return!!(null==(t=e.props.render)?void 0:t.$$tippy)};function r(){e.props.className&&!n()||Nt(t,"add",e.props.className)}return{onCreate:r,onBeforeUpdate:function(){n()&&Nt(t,"remove",e.props.className)},onAfterUpdate:r}}};function It(e){return function(t){var n=t.children,r=t.content,o=t.visible,i=t.singleton,a=t.render,c=t.reference,u=t.disabled,s=void 0!==u&&u,l=t.ignoreAttributes,p=void 0===l||l,f=(t.__source,t.__self,St(t,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"])),d=void 0!==o,m=void 0!==i,v=Object(y.useState)(!1),h=v[0],g=v[1],_=Object(y.useState)({}),O=_[0],w=_[1],j=Object(y.useState)(),x=j[0],L=j[1],E=Rt((function(){return{container:Tt(),renders:1}})),P=Object.assign({ignoreAttributes:p},f,{content:E.container});d&&(P.trigger="manual",P.hideOnClick=!1),m&&(s=!0);var k=P,A=P.plugins||[];a&&(k=Object.assign({},P,{plugins:m?[].concat(A,[{fn:function(){return{onTrigger:function(e,t){var n=i.data.children.find((function(e){return e.instance.reference===t.currentTarget})).content;L(n)}}}}]):A,render:function(){return{popper:E.container}}}));var S=[c].concat(n?[n.type]:[]);return Bt((function(){var t=c;c&&c.hasOwnProperty("current")&&(t=c.current);var n=e(t||E.ref||Tt(),Object.assign({},k,{plugins:[Zt].concat(P.plugins||[])}));return E.instance=n,s&&n.disable(),o&&n.show(),m&&i.hook({instance:n,content:r,props:k}),g(!0),function(){n.destroy(),null==i||i.cleanup(n)}}),S),Bt((function(){var e;if(1!==E.renders){var t=E.instance;t.setProps(Dt(t.props,k)),null==(e=t.popperInstance)||e.forceUpdate(),s?t.disable():t.enable(),d&&(o?t.show():t.hide()),m&&i.hook({instance:t,content:r,props:k})}else E.renders++})),Bt((function(){var e;if(a){var t=E.instance;t.setProps({popperOptions:Object.assign({},t.props.popperOptions,{modifiers:[].concat(((null==(e=t.props.popperOptions)?void 0:e.modifiers)||[]).filter((function(e){return"$$tippyReact"!==e.name})),[{name:"$$tippyReact",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t,n=e.state,r=null==(t=n.modifiersData)?void 0:t.hide;O.placement===n.placement&&O.referenceHidden===(null==r?void 0:r.isReferenceHidden)&&O.escaped===(null==r?void 0:r.hasPopperEscaped)||w({placement:n.placement,referenceHidden:null==r?void 0:r.isReferenceHidden,escaped:null==r?void 0:r.hasPopperEscaped}),n.attributes.popper={}}}])})})}}),[O.placement,O.referenceHidden,O.escaped].concat(S)),b.a.createElement(b.a.Fragment,null,n?Object(y.cloneElement)(n,{ref:function(e){E.ref=e,Mt(n.ref,e)}}):null,h&&Object(At.createPortal)(a?a(function(e){var t={"data-placement":e.placement};return e.referenceHidden&&(t["data-reference-hidden"]=""),e.escaped&&(t["data-escaped"]=""),t}(O),x,E.instance):r,E.container))}}var Ft=function(e,t){return Object(y.forwardRef)((function(n,r){var o=n.children,i=St(n,["children"]);return b.a.createElement(e,Object.assign({},t,i),o?Object(y.cloneElement)(o,{ref:function(e){Mt(r,e),Mt(o.ref,e)}}):null)}))},Wt=Ft(It(kt)),zt=function(){return b.a.createElement("svg",{width:"18px",height:"18px",viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},b.a.createElement("title",null,"shape-round"),b.a.createElement("desc",null,"Created with Sketch."),b.a.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},b.a.createElement("g",{id:"widgets/shape-round",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},b.a.createElement("path",{d:"M12,3 C16.9705627,3 21,7.02943725 21,12 C21,16.9705627 16.9705627,21 12,21 C7.02943725,21 3,16.9705627 3,12 C3,7.02943725 7.02943725,3 12,3 Z M12,5 C8.13400675,5 5,8.13400675 5,12 C5,15.8659932 8.13400675,19 12,19 C15.8659932,19 19,15.8659932 19,12 C19,8.13400675 15.8659932,5 12,5 Z",id:"Combined-Shape"}))))},Ut=function(){return b.a.createElement("svg",{width:"18px",height:"18px",viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},b.a.createElement("title",null,"ratio-square"),b.a.createElement("desc",null,"Created with Sketch."),b.a.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},b.a.createElement("g",{id:"widgets/shape-square",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},b.a.createElement("path",{d:"M3,3 L3,21 L21,21 L21,3 L3,3 Z M5,5 L5,19 L19,19 L19,5 L5,5 Z",id:"shape"}))))},Vt=function(){return b.a.createElement("svg",{width:"18px",height:"18px",viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},b.a.createElement("title",null,"shape-radius"),b.a.createElement("desc",null,"Created with Sketch."),b.a.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},b.a.createElement("g",{id:"widgets/shape-radius",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},b.a.createElement("path",{d:"M17,3 C19.209139,3 21,4.790861 21,7 L21,17 C21,19.209139 19.209139,21 17,21 L7,21 C4.790861,21 3,19.209139 3,17 L3,7 C3,4.790861 4.790861,3 7,3 L17,3 Z M17,5 L7,5 C5.9456382,5 5.08183488,5.81587779 5.00548574,6.85073766 L5,7 L5,17 C5,18.0543618 5.81587779,18.9181651 6.85073766,18.9945143 L7,19 L17,19 C18.0543618,19 18.9181651,18.1841222 18.9945143,17.1492623 L19,17 L19,7 C19,5.9456382 18.1841222,5.08183488 17.1492623,5.00548574 L17,5 Z",id:"Rectangle"}))))},Ht=function(){return b.a.createElement("svg",{width:"18px",height:"18px",viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},b.a.createElement("title",null,"shape-none"),b.a.createElement("desc",null,"Created with Sketch."),b.a.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},b.a.createElement("g",{id:"widgets/shape-none",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},b.a.createElement("path",{d:"M5,19 L5,21 L3,21 L3,19 L5,19 Z M21,19 L21,21 L19,21 L19,19 L21,19 Z M13,19 L13,21 L11,21 L11,19 L13,19 Z M9,19 L9,21 L7,21 L7,19 L9,19 Z M17,19 L17,21 L15,21 L15,19 L17,19 Z M21,15 L21,17 L19,17 L19,15 L21,15 Z M21,11 L21,13 L19,13 L19,11 L21,11 Z M5,11 L5,13 L3,13 L3,11 L5,11 Z M21,7 L21,9 L19,9 L19,7 L21,7 Z M5,7 L5,9 L3,9 L3,7 L5,7 Z M13,3 L13,5 L11,5 L11,3 L13,3 Z M9,3 L9,5 L7,5 L7,3 L9,3 Z M17,3 L17,5 L15,5 L15,3 L17,3 Z M21,3 L21,5 L19,5 L19,3 L21,3 Z M5,3 L5,5 L3,5 L3,3 L5,3 Z M3,15 L5,15 L5,17 L3,17 L3,15 Z",id:"Shape"}))))},qt=[{value:{type:"expanded",columns:1},icon:function(){return b.a.createElement("svg",{width:"17px",height:"20px",viewBox:"0 0 17 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},b.a.createElement("title",null,"layout-modern"),b.a.createElement("desc",null,"Created with Sketch."),b.a.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},b.a.createElement("g",{id:"widgets/layout-modern",transform:"translate(-2.000000, -3.000000)",fill:"#000000"},b.a.createElement("path",{d:"M2,10 L5,10 L5,7 L2,7 L2,10 Z M2,14 L5,14 L5,11 L2,11 L2,14 Z M2,6 L5,6 L5,3 L2,3 L2,6 Z M6,3 L6,17 L19,17 L19,3 L6,3 Z M8,5 L8,15 L17,15 L17,5 L8,5 Z M6,18 L6,23 L19,23 L19,18 L6,18 Z M8,20 L8,23 L17,23 L17,20 L8,20 Z",id:"shape"}))))},label:Object(r.__)("Expanded - 1 Column","cloudinary")},{value:{type:"expanded",columns:2},icon:function(){return b.a.createElement("svg",{width:"18px",height:"17px",viewBox:"0 0 18 17",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},b.a.createElement("title",null,"layout-grid-2-column"),b.a.createElement("desc",null,"Created with Sketch."),b.a.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},b.a.createElement("g",{id:"widgets/layout-gird-2-col",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},b.a.createElement("path",{d:"M11,12 L11,20 L3,20 L3,12 L11,12 Z M21,12 L21,20 L13,20 L13,12 L21,12 Z M9,14 L5,14 L5,18 L9,18 L9,14 Z M19,14 L15,14 L15,18 L19,18 L19,14 Z M11,3 L11,11 L3,11 L3,3 L11,3 Z M21,3 L21,11 L13,11 L13,3 L21,3 Z M9,5 L5,5 L5,9 L9,9 L9,5 Z M19,5 L15,5 L15,9 L19,9 L19,5 Z",id:"Shape"}))))},label:Object(r.__)("Expanded - 2 Column","cloudinary")},{value:{type:"expanded",columns:3},icon:function(){return b.a.createElement("svg",{width:"20px",height:"13px",viewBox:"0 0 20 13",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},b.a.createElement("title",null,"layout-grid-3-column"),b.a.createElement("desc",null,"Created with Sketch."),b.a.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},b.a.createElement("g",{id:"widgets/layout-gird-3-col",transform:"translate(-2.000000, -5.000000)",fill:"#000000"},b.a.createElement("path",{d:"M8,12 L8,18 L2,18 L2,12 L8,12 Z M15,12 L15,18 L9,18 L9,12 L15,12 Z M22,12 L22,18 L16,18 L16,12 L22,12 Z M6,14 L4,14 L4,16 L6,16 L6,14 Z M13,14 L11,14 L11,16 L13,16 L13,14 Z M20,14 L18,14 L18,16 L20,16 L20,14 Z M8,5 L8,11 L2,11 L2,5 L8,5 Z M15,5 L15,11 L9,11 L9,5 L15,5 Z M22,5 L22,11 L16,11 L16,5 L22,5 Z M6,7 L4,7 L4,9 L6,9 L6,7 Z M13,7 L11,7 L11,9 L13,9 L13,7 Z M20,7 L18,7 L18,9 L20,9 L20,7 Z",id:"Combined-Shape"}))))},label:Object(r.__)("Expanded - 3 Column","cloudinary")},{value:{type:"classic",columns:1},icon:function(){return b.a.createElement("svg",{width:"17px",height:"14px",viewBox:"0 0 17 14",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},b.a.createElement("title",null,"layout-classic"),b.a.createElement("desc",null,"Created with Sketch."),b.a.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},b.a.createElement("g",{id:"widgets/layout-classic",transform:"translate(-3.000000, -5.000000)",fill:"#000000"},b.a.createElement("path",{d:"M3,12 L6,12 L6,9 L3,9 L3,12 Z M3,16 L6,16 L6,13 L3,13 L3,16 Z M3,8 L6,8 L6,5 L3,5 L3,8 Z M7,5 L7,19 L20,19 L20,5 L7,5 Z M9,7 L9,17 L18,17 L18,7 L9,7 Z",id:"shape"}))))},label:Object(r.__)("Classic","cloudinary")}],$t=["image"],Gt=[{label:Object(r.__)("1:1","cloudinary"),value:"1:1"},{label:Object(r.__)("3:4","cloudinary"),value:"3:4"},{label:Object(r.__)("4:3","cloudinary"),value:"4:3"},{label:Object(r.__)("4:6","cloudinary"),value:"4:6"},{label:Object(r.__)("6:4","cloudinary"),value:"6:4"},{label:Object(r.__)("5:7","cloudinary"),value:"5:7"},{label:Object(r.__)("7:5","cloudinary"),value:"7:5"},{label:Object(r.__)("8:5","cloudinary"),value:"8:5"},{label:Object(r.__)("5:8","cloudinary"),value:"5:8"},{label:Object(r.__)("9:16","cloudinary"),value:"9:16"},{label:Object(r.__)("16:9","cloudinary"),value:"16:9"}],Jt=[{label:Object(r.__)("None","cloudinary"),value:"none"},{label:Object(r.__)("Fade","cloudinary"),value:"fade"},{label:Object(r.__)("Slide","cloudinary"),value:"slide"}],Xt=[{label:Object(r.__)("Always","cloudinary"),value:"always"},{label:Object(r.__)("None","cloudinary"),value:"none"},{label:Object(r.__)("MouseOver","cloudinary"),value:"mouseover"}],Yt=[{label:Object(r.__)("Inline","cloudinary"),value:"inline"},{label:Object(r.__)("Flyout","cloudinary"),value:"flyout"},{label:Object(r.__)("Popup","cloudinary"),value:"popup"}],Kt=[{label:Object(r.__)("Top","cloudinary"),value:"top"},{label:Object(r.__)("Bottom","cloudinary"),value:"bottom"},{label:Object(r.__)("Left","cloudinary"),value:"left"},{label:Object(r.__)("Right","cloudinary"),value:"right"}],Qt=[{label:Object(r.__)("Click","cloudinary"),value:"click"},{label:Object(r.__)("Hover","cloudinary"),value:"hover"}],en=[{label:Object(r.__)("Left","cloudinary"),value:"left"},{label:Object(r.__)("Right","cloudinary"),value:"right"},{label:Object(r.__)("Top","cloudinary"),value:"top"},{label:Object(r.__)("Bottom","cloudinary"),value:"bottom"}],tn=[{label:Object(r.__)("Thumbnails","cloudinary"),value:"thumbnails"},{label:Object(r.__)("Indicators","cloudinary"),value:"indicators"},{label:Object(r.__)("None","cloudinary"),value:"none"}],nn=[{value:"round",icon:zt,label:Object(r.__)("Round","cloudinary")},{value:"radius",icon:Vt,label:Object(r.__)("Radius","cloudinary")},{value:"none",icon:Ht,label:Object(r.__)("None","cloudinary")},{value:"square",icon:Ut,label:Object(r.__)("Square","cloudinary")},{value:"rectangle",icon:function(){return b.a.createElement("svg",{width:"14px",height:"20px",viewBox:"0 0 14 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},b.a.createElement("title",null,"ratio-9-16"),b.a.createElement("desc",null,"Created with Sketch."),b.a.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},b.a.createElement("g",{id:"ratio/9-16",transform:"translate(-5.000000, -2.000000)",fill:"#000000"},b.a.createElement("path",{d:"M22,5.5 L22,18.5 L2,18.5 L2,5.5 L22,5.5 Z M20,7.5 L4,7.5 L4,16.5 L20,16.5 L20,7.5 Z",id:"Combined-Shape",transform:"translate(12.000000, 12.000000) rotate(-90.000000) translate(-12.000000, -12.000000) "}))))},label:Object(r.__)("Rectangle","cloudinary")}],rn=[{value:"round",icon:zt,label:Object(r.__)("Round","cloudinary")},{value:"radius",icon:Vt,label:Object(r.__)("Radius","cloudinary")},{value:"square",icon:Ut,label:Object(r.__)("Square","cloudinary")}],on=[{label:Object(r.__)("All","cloudinary"),value:"all"},{label:Object(r.__)("Border","cloudinary"),value:"border"},{label:Object(r.__)("Gradient","cloudinary"),value:"gradient"}],an=[{label:Object(r.__)("All","cloudinary"),value:"all"},{label:Object(r.__)("Top","cloudinary"),value:"top"},{label:Object(r.__)("Top-Bottom","cloudinary"),value:"top-bottom"},{label:Object(r.__)("Left-Right","cloudinary"),value:"left-right"},{label:Object(r.__)("Bottom","cloudinary"),value:"bottom"},{label:Object(r.__)("Left","cloudinary"),value:"left"},{label:Object(r.__)("Right","cloudinary"),value:"right"}],cn=[{value:"round",icon:zt,label:Object(r.__)("Round","cloudinary")},{value:"radius",icon:Vt,label:Object(r.__)("Radius","cloudinary")},{value:"none",icon:Ht,label:Object(r.__)("None","cloudinary")},{value:"square",icon:Ut,label:Object(r.__)("Square","cloudinary")}],un=[{label:Object(r.__)("Pad","cloudinary"),value:"pad"},{label:Object(r.__)("Fill","cloudinary"),value:"fill"}],sn=[{label:Object(r.__)("White padding","cloudinary"),value:"rgb:FFFFFF"},{label:Object(r.__)("Border color padding","cloudinary"),value:"auto"},{label:Object(r.__)("Predominant color padding","cloudinary"),value:"auto:predominant"},{label:Object(r.__)("Gradient fade padding","cloudinary"),value:"auto:predominant_gradient"}],ln=n(54),pn=n.n(ln),fn=function(e){var t=e.value,n=e.children,r=e.icon,o=e.onChange,i=e.current,a="object"===L()(t)?JSON.stringify(t)===JSON.stringify(i):i===t;return b.a.createElement("button",{type:"button",onClick:function(){return o(t)},className:pn()("radio-select",{"radio-select--active":a})},b.a.createElement(r,null),b.a.createElement("div",{className:"radio-select__label"},n))},dn=function(e){var t=e.children,n=e.value;return b.a.createElement("div",{className:"colorpalette-color-label"},b.a.createElement("span",null,t),b.a.createElement("span",{className:"component-color-indicator","aria-label":"Color: ".concat(n),style:{background:n}}))},mn=new g.a("_"),vn=function(e){var t=e.attributes,n=e.setAttributes,o=e.colors,i=P()(t),a=mn.object(i);return a.customSettings="object"===L()(a.customSettings)?JSON.stringify(a.customSettings):a.customSettings,t.transformation_crop||(t.transformation_crop="pad",t.transformation_background="rgb:FFFFFF"),"fill"===t.transformation_crop&&delete t.transformation_background,b.a.createElement(b.a.Fragment,null,b.a.createElement(w.PanelBody,{title:Object(r.__)("Layout","cloudinary")},qt.map((function(e){return b.a.createElement(fn,{key:"".concat(e.value.type,"-").concat(e.value.columns,"-layout"),value:e.value,onChange:function(e){n({displayProps_mode:e.type,displayProps_columns:e.columns||1})},icon:e.icon,current:{type:t.displayProps_mode,columns:t.displayProps_columns||1}},e.label)}))),b.a.createElement(w.PanelBody,{title:Object(r.__)("Color Palette","cloudinary"),initialOpen:!1},b.a.createElement(dn,{value:t.themeProps_primary},Object(r.__)("Primary","cloudinary")),b.a.createElement(j.ColorPalette,{value:t.themeProps_primary,colors:o,disableCustomColors:!1,onChange:function(e){return n({themeProps_primary:e})}}),b.a.createElement(dn,{value:t.themeProps_onPrimary},Object(r.__)("On Primary","cloudinary")),b.a.createElement(j.ColorPalette,{value:t.themeProps_onPrimary,colors:o,disableCustomColors:!1,onChange:function(e){return n({themeProps_onPrimary:e})}}),b.a.createElement(dn,{value:t.themeProps_active},Object(r.__)("Active","cloudinary")),b.a.createElement(j.ColorPalette,{value:t.themeProps_active,colors:o,disableCustomColors:!1,onChange:function(e){return n({themeProps_active:e})}})),"classic"===t.displayProps_mode&&b.a.createElement(w.PanelBody,{title:Object(r.__)("Fade Transition","cloudinary"),initialOpen:!1},b.a.createElement(w.SelectControl,{value:t.transition,options:Jt,onChange:function(e){return n({transition:e})}})),b.a.createElement(w.PanelBody,{title:Object(r.__)("Main Viewer Parameters","cloudinary"),initialOpen:!1},b.a.createElement(w.SelectControl,{label:Object(r.__)("Aspect Ratio","cloudinary"),value:t.aspectRatio,options:Gt,onChange:function(e){return n({aspectRatio:e})}}),b.a.createElement("p",null,b.a.createElement(Wt,{content:b.a.createElement("span",null,Object(r.__)("How to resize or crop images to fit the gallery. Pad adds padding around the image using the specified padding style. Fill crops the image from the center so it fills as much of the available space as possible.","cloudinary")),theme:"cloudinary",arrow:!1,placement:"bottom-start"},b.a.createElement("div",{className:"cld-ui-title"},Object(r.__)("Resize/Crop Mode","cloudinary"),b.a.createElement("span",{className:"dashicons dashicons-info cld-tooltip"}))),b.a.createElement(w.ButtonGroup,null,un.map((function(e){return b.a.createElement(w.Button,{key:e.value+"-look-and-feel",isDefault:!0,isPressed:e.value===t.transformation_crop,onClick:function(){return n({transformation_crop:e.value,transformation_background:null})}},e.label)})))),"pad"===t.transformation_crop&&b.a.createElement(w.SelectControl,{label:Object(r.__)("Pad style","cloudinary"),value:t.transformation_background,options:sn,onChange:function(e){n({transformation_background:e})}}),b.a.createElement("p",null,Object(r.__)("Navigation","cloudinary")),b.a.createElement("p",null,b.a.createElement(w.ButtonGroup,null,Xt.map((function(e){return b.a.createElement(w.Button,{key:e.value+"-navigation",isDefault:!0,isPressed:e.value===t.navigation,onClick:function(){return n({navigation:e.value})}},e.label)})))),b.a.createElement("div",{style:{marginTop:"30px"}},b.a.createElement(w.ToggleControl,{label:Object(r.__)("Show Zoom","cloudinary"),checked:t.zoom,onChange:function(){return n({zoom:!t.zoom})}}),t.zoom&&b.a.createElement(b.a.Fragment,null,b.a.createElement("p",null,Object(r.__)("Zoom Type","cloudinary")),b.a.createElement("p",null,b.a.createElement(w.ButtonGroup,null,Yt.map((function(e){return b.a.createElement(w.Button,{key:e.value+"-zoom-type",isDefault:!0,isPressed:e.value===t.zoomProps_type,onClick:function(){return n({zoomProps_type:e.value})}},e.label)})))),"flyout"===t.zoomProps_type&&b.a.createElement(w.SelectControl,{label:Object(r.__)("Zoom Viewer Position","cloudinary"),value:t.zoomProps_viewerPosition,options:Kt,onChange:function(e){return n({zoomProps_viewerPosition:e})}}),"popup"!==t.zoomProps_type&&b.a.createElement(b.a.Fragment,null,b.a.createElement("p",null,Object(r.__)("Zoom Trigger","cloudinary")),b.a.createElement("p",null,b.a.createElement(w.ButtonGroup,null,Qt.map((function(e){return b.a.createElement(w.Button,{key:e.value+"-zoom-trigger",isDefault:!0,isPressed:e.value===t.zoomProps_trigger,onClick:function(){return n({zoomProps_trigger:e.value})}},e.label)})))))))),b.a.createElement(w.PanelBody,{title:Object(r.__)("Carousel Parameters","cloudinary"),initialOpen:!1},b.a.createElement("p",null,Object(r.__)("Carousel Location","cloudinary")),b.a.createElement("p",null,b.a.createElement(w.ButtonGroup,null,en.map((function(e){return b.a.createElement(w.Button,{key:e.value+"-carousel-location",isDefault:!0,isPressed:e.value===t.carouselLocation,onClick:function(){return n({carouselLocation:e.value})}},e.label)})))),b.a.createElement(w.RangeControl,{label:Object(r.__)("Carousel Offset","cloudinary"),value:t.carouselOffset,onChange:function(e){return n({carouselOffset:e})},min:0,max:100}),b.a.createElement("p",null,Object(r.__)("Carousel Style","cloudinary")),b.a.createElement("p",null,b.a.createElement(w.ButtonGroup,null,tn.map((function(e){return b.a.createElement(w.Button,{key:e.value+"-carousel-style",isDefault:!0,isPressed:e.value===t.carouselStyle,onClick:function(){return n({carouselStyle:e.value})}},e.label)})))),"thumbnails"===t.carouselStyle&&b.a.createElement(b.a.Fragment,null,b.a.createElement(w.RangeControl,{label:Object(r.__)("Width","cloudinary"),value:t.thumbnailProps_width,onChange:function(e){return n({thumbnailProps_width:e})},min:5,max:300}),b.a.createElement(w.RangeControl,{label:Object(r.__)("Height","cloudinary"),value:t.thumbnailProps_height,onChange:function(e){return n({thumbnailProps_height:e})},min:5,max:300}),b.a.createElement("p",null,Object(r.__)("Navigation Button Shape","cloudinary")),nn.map((function(e){return b.a.createElement(fn,{key:e.value+"-navigation-button-shape",value:e.value,onChange:function(e){return n({thumbnailProps_navigationShape:e})},icon:e.icon,current:t.thumbnailProps_navigationShape},e.label)})),b.a.createElement("p",null,Object(r.__)("Selected Style","cloudinary")),b.a.createElement("p",null,b.a.createElement(w.ButtonGroup,null,on.map((function(e){return b.a.createElement(w.Button,{key:e.value+"-selected-style",isDefault:!0,isPressed:e.value===t.thumbnailProps_selectedStyle,onClick:function(){return n({thumbnailProps_selectedStyle:e.value})}},e.label)})))),b.a.createElement(w.SelectControl,{label:Object(r.__)("Selected Border Position","cloudinary"),value:t.thumbnailProps_selectedBorderPosition,options:an,onChange:function(e){return n({thumbnailProps_selectedBorderPosition:e})}}),b.a.createElement(w.RangeControl,{label:Object(r.__)("Selected Border Width","cloudinary"),value:t.thumbnailProps_selectedBorderWidth,onChange:function(e){return n({thumbnailProps_selectedBorderWidth:e})},min:0,max:10}),b.a.createElement("p",null,Object(r.__)("Media Shape Icon","cloudinary")),cn.map((function(e){return b.a.createElement(fn,{key:e.value+"-media",value:e.value,onChange:function(e){return n({thumbnailProps_mediaSymbolShape:e})},icon:e.icon,current:t.thumbnailProps_mediaSymbolShape},e.label)}))),"indicators"===t.carouselStyle&&b.a.createElement(b.a.Fragment,null,b.a.createElement("p",null,Object(r.__)("Indicators Shape","cloudinary")),rn.map((function(e){return b.a.createElement(fn,{key:e.value+"-indicator",value:e.value,onChange:function(e){return n({indicatorProps_shape:e})},icon:e.icon,current:t.indicatorProps_shape},e.label)})))),b.a.createElement(w.PanelBody,{title:Object(r.__)("Additional Settings","cloudinary"),initialOpen:!1},b.a.createElement(w.TextareaControl,{label:Object(r.__)("Custom Settings","cloudinary"),help:Object(r.__)("Provide a JSON string of the settings you want to add and/or override.","cloudinary"),value:a.customSettings,onChange:function(e){try{n({customSettings:JSON.parse(e)})}catch(t){n({customSettings:e})}}})))},yn=n(56);function bn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function hn(e){for(var t=1;t array('react', 'wp-block-editor', 'wp-components', 'wp-components/build-style/style.css', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '8208197bd5ef998a03d54b699afa3696'); \ No newline at end of file + array('react', 'react-dom', 'wp-block-editor', 'wp-components', 'wp-components/build-style/style.css', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '29099104bb87442e73de687aa973be61'); \ No newline at end of file diff --git a/js/gallery.js b/js/gallery.js index cf87775f9..b77b8b721 100644 --- a/js/gallery.js +++ b/js/gallery.js @@ -1 +1 @@ -!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=129)}([function(e,t){!function(){e.exports=this.React}()},function(e,t){!function(){e.exports=this.wp.i18n}()},function(e,t){!function(){e.exports=this.wp.components}()},function(e,t,n){var r=n(34),o="object"==typeof self&&self&&self.Object===Object&&self,a=r||o||Function("return this")();e.exports=a},function(e,t){!function(){e.exports=this.wp.element}()},function(e,t,n){var r=n(69),o=n(75);e.exports=function(e,t){var n=o(e,t);return r(n)?n:void 0}},function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=n=function(e){return typeof e}:e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(t)}e.exports=n},function(e,t,n){"use strict";function r(e,t){var n,r;if("function"==typeof t)void 0!==(r=t(e))&&(e=r);else if(Array.isArray(t))for(n=0;n=0&&(e=e.replace(/\[/g,t).replace(/]/g,""));var n=e.split(t);if(n.filter(u).length!==n.length)throw Error("Refusing to update blacklisted property "+e);return n}var p=Object.prototype.hasOwnProperty;function f(e,t,n,r){if(!(this instanceof f))return new f(e,t,n,r);void 0===t&&(t=!1),void 0===n&&(n=!0),void 0===r&&(r=!0),this.separator=e||".",this.override=t,this.useArray=n,this.useBrackets=r,this.keepArray=!1,this.cleanup=[]}var d=new f(".",!1,!0,!0);function y(e){return function(){return d[e].apply(d,arguments)}}f.prototype._fill=function(e,t,n,o){var a=e.shift();if(e.length>0){if(t[a]=t[a]||(this.useArray&&function(e){return/^\d+$/.test(e)}(e[0])?[]:{}),!i(t[a])){if(!this.override){if(!i(n)||!c(n))throw new Error("Trying to redefine `"+a+"` which is a "+typeof t[a]);return}t[a]={}}this._fill(e,t[a],n,o)}else{if(!this.override&&i(t[a])&&!c(t[a])){if(!i(n)||!c(n))throw new Error("Trying to redefine non-empty obj['"+a+"']");return}t[a]=r(n,o)}},f.prototype.object=function(e,t){var n=this;return Object.keys(e).forEach((function(o){var a=void 0===t?null:t[o],i=s(o,n.separator).join(n.separator);-1!==i.indexOf(n.separator)?(n._fill(i.split(n.separator),e,e[o],a),delete e[o]):e[o]=r(e[o],a)})),e},f.prototype.str=function(e,t,n,o){var a=s(e,this.separator).join(this.separator);return-1!==e.indexOf(this.separator)?this._fill(a.split(this.separator),n,t,o):n[e]=r(t,o),n},f.prototype.pick=function(e,t,n,r){var a,i,c,l,u;for(i=s(e,this.separator),a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}},function(e,t,n){var r=n(59),o=n(60),a=n(61),i=n(62),c=n(63);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e<=9007199254740991}},function(e,t){e.exports=function(e,t){return function(n){return e(t(n))}}},function(e,t,n){var r=n(33),o=n(40);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},function(e,t){e.exports=function(){return[]}},function(e,t,n){var r=n(45),o=n(46),a=n(29),i=n(43),c=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,a(e)),e=o(e);return t}:i;e.exports=c},function(e,t){e.exports=function(e,t){for(var n=-1,r=t.length,o=e.length;++ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n]);return o}},function(e,t,n){var r=n(58),o=n(89),a=n(36),i=n(91),c=n(101),l=n(104),u=n(105),s=n(106),p=n(108),f=n(109),d=n(110),y=n(30),b=n(115),v=n(116),h=n(122),m=n(23),_=n(39),g=n(124),j=n(8),O=n(126),L=n(22),x=n(28),w="[object Arguments]",E="[object Function]",P="[object Object]",k={};k[w]=k["[object Array]"]=k["[object ArrayBuffer]"]=k["[object DataView]"]=k["[object Boolean]"]=k["[object Date]"]=k["[object Float32Array]"]=k["[object Float64Array]"]=k["[object Int8Array]"]=k["[object Int16Array]"]=k["[object Int32Array]"]=k["[object Map]"]=k["[object Number]"]=k[P]=k["[object RegExp]"]=k["[object Set]"]=k["[object String]"]=k["[object Symbol]"]=k["[object Uint8Array]"]=k["[object Uint8ClampedArray]"]=k["[object Uint16Array]"]=k["[object Uint32Array]"]=!0,k["[object Error]"]=k[E]=k["[object WeakMap]"]=!1,e.exports=function e(t,n,S,A,C,M){var Z,B=1&n,R=2&n,N=4&n;if(S&&(Z=C?S(t,A,C,M):S(t)),void 0!==Z)return Z;if(!j(t))return t;var z=m(t);if(z){if(Z=b(t),!B)return u(t,Z)}else{var D=y(t),I=D==E||"[object GeneratorFunction]"==D;if(_(t))return l(t,B);if(D==P||D==w||I&&!C){if(Z=R||I?{}:h(t),!B)return R?p(t,c(Z,t)):s(t,i(Z,t))}else{if(!k[D])return C?t:{};Z=v(t,D,B)}}M||(M=new r);var T=M.get(t);if(T)return T;M.set(t,Z),O(t)?t.forEach((function(r){Z.add(e(r,n,S,r,t,M))})):g(t)&&t.forEach((function(r,o){Z.set(o,e(r,n,S,o,t,M))}));var F=z?void 0:(N?R?d:f:R?x:L)(t);return o(F||t,(function(r,o){F&&(r=t[o=r]),a(Z,o,e(r,n,S,o,t,M))})),Z}},function(e,t,n){var r=n(11),o=n(64),a=n(65),i=n(66),c=n(67),l=n(68);function u(e){var t=this.__data__=new r(e);this.size=t.size}u.prototype.clear=o,u.prototype.delete=a,u.prototype.get=i,u.prototype.has=c,u.prototype.set=l,e.exports=u},function(e,t){e.exports=function(){this.__data__=[],this.size=0}},function(e,t,n){var r=n(12),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0)&&(n==t.length-1?t.pop():o.call(t,n,1),--this.size,!0)}},function(e,t,n){var r=n(12);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},function(e,t,n){var r=n(12);e.exports=function(e){return r(this.__data__,e)>-1}},function(e,t,n){var r=n(12);e.exports=function(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}},function(e,t,n){var r=n(11);e.exports=function(){this.__data__=new r,this.size=0}},function(e,t){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},function(e,t){e.exports=function(e){return this.__data__.get(e)}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t,n){var r=n(11),o=n(20),a=n(76);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var i=n.__data__;if(!o||i.length<199)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new a(i)}return n.set(e,t),this.size=n.size,this}},function(e,t,n){var r=n(33),o=n(73),a=n(8),i=n(35),c=/^\[object .+?Constructor\]$/,l=Function.prototype,u=Object.prototype,s=l.toString,p=u.hasOwnProperty,f=RegExp("^"+s.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!a(e)||o(e))&&(r(e)?f:c).test(i(e))}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){var r=n(21),o=Object.prototype,a=o.hasOwnProperty,i=o.toString,c=r?r.toStringTag:void 0;e.exports=function(e){var t=a.call(e,c),n=e[c];try{e[c]=void 0;var r=!0}catch(e){}var o=i.call(e);return r&&(t?e[c]=n:delete e[c]),o}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t,n){var r,o=n(74),a=(r=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!a&&a in e}},function(e,t,n){var r=n(3)["__core-js_shared__"];e.exports=r},function(e,t){e.exports=function(e,t){return null==e?void 0:e[t]}},function(e,t,n){var r=n(77),o=n(84),a=n(86),i=n(87),c=n(88);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e=0&&(e=e.replace(/\[/g,t).replace(/]/g,""));var n=e.split(t);if(n.filter(s).length!==n.length)throw Error("Refusing to update blacklisted property "+e);return n}var p=Object.prototype.hasOwnProperty;function f(e,t,n,r){if(!(this instanceof f))return new f(e,t,n,r);void 0===t&&(t=!1),void 0===n&&(n=!0),void 0===r&&(r=!0),this.separator=e||".",this.override=t,this.useArray=n,this.useBrackets=r,this.keepArray=!1,this.cleanup=[]}var d=new f(".",!1,!0,!0);function v(e){return function(){return d[e].apply(d,arguments)}}f.prototype._fill=function(e,t,n,o){var i=e.shift();if(e.length>0){if(t[i]=t[i]||(this.useArray&&function(e){return/^\d+$/.test(e)}(e[0])?[]:{}),!a(t[i])){if(!this.override){if(!a(n)||!c(n))throw new Error("Trying to redefine `"+i+"` which is a "+typeof t[i]);return}t[i]={}}this._fill(e,t[i],n,o)}else{if(!this.override&&a(t[i])&&!c(t[i])){if(!a(n)||!c(n))throw new Error("Trying to redefine non-empty obj['"+i+"']");return}t[i]=r(n,o)}},f.prototype.object=function(e,t){var n=this;return Object.keys(e).forEach((function(o){var i=void 0===t?null:t[o],a=l(o,n.separator).join(n.separator);-1!==a.indexOf(n.separator)?(n._fill(a.split(n.separator),e,e[o],i),delete e[o]):e[o]=r(e[o],i)})),e},f.prototype.str=function(e,t,n,o){var i=l(e,this.separator).join(this.separator);return-1!==e.indexOf(this.separator)?this._fill(i.split(this.separator),n,t,o):n[e]=r(t,o),n},f.prototype.pick=function(e,t,n,r){var i,a,c,u,s;for(a=l(e,this.separator),i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}},function(e,t,n){var r=n(62),o=n(63),i=n(64),a=n(65),c=n(66);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e<=9007199254740991}},function(e,t){e.exports=function(e,t){return function(n){return e(t(n))}}},function(e,t,n){var r=n(33),o=n(40);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},function(e,t){e.exports=function(){return[]}},function(e,t,n){var r=n(45),o=n(46),i=n(29),a=n(43),c=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,i(e)),e=o(e);return t}:a;e.exports=c},function(e,t){e.exports=function(e,t){for(var n=-1,r=t.length,o=e.length;++ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n]);return o}},function(e,t,n){var r=n(61),o=n(92),i=n(36),a=n(94),c=n(104),u=n(107),s=n(108),l=n(109),p=n(111),f=n(112),d=n(113),v=n(30),m=n(118),b=n(119),h=n(125),y=n(23),g=n(39),_=n(127),O=n(8),j=n(129),w=n(22),x=n(28),L="[object Arguments]",E="[object Function]",k="[object Object]",A={};A[L]=A["[object Array]"]=A["[object ArrayBuffer]"]=A["[object DataView]"]=A["[object Boolean]"]=A["[object Date]"]=A["[object Float32Array]"]=A["[object Float64Array]"]=A["[object Int8Array]"]=A["[object Int16Array]"]=A["[object Int32Array]"]=A["[object Map]"]=A["[object Number]"]=A[k]=A["[object RegExp]"]=A["[object Set]"]=A["[object String]"]=A["[object Symbol]"]=A["[object Uint8Array]"]=A["[object Uint8ClampedArray]"]=A["[object Uint16Array]"]=A["[object Uint32Array]"]=!0,A["[object Error]"]=A[E]=A["[object WeakMap]"]=!1,e.exports=function e(t,n,P,S,C,M){var T,D=1&n,B=2&n,R=4&n;if(P&&(T=C?P(t,S,C,M):P(t)),void 0!==T)return T;if(!O(t))return t;var N=y(t);if(N){if(T=m(t),!D)return s(t,T)}else{var Z=v(t),I=Z==E||"[object GeneratorFunction]"==Z;if(g(t))return u(t,D);if(Z==k||Z==L||I&&!C){if(T=B||I?{}:h(t),!D)return B?p(t,c(T,t)):l(t,a(T,t))}else{if(!A[Z])return C?t:{};T=b(t,Z,D)}}M||(M=new r);var F=M.get(t);if(F)return F;M.set(t,T),j(t)?t.forEach((function(r){T.add(e(r,n,P,r,t,M))})):_(t)&&t.forEach((function(r,o){T.set(o,e(r,n,P,o,t,M))}));var W=N?void 0:(R?B?d:f:B?x:w)(t);return o(W||t,(function(r,o){W&&(r=t[o=r]),i(T,o,e(r,n,P,o,t,M))})),T}},function(e,t,n){var r=n(11),o=n(67),i=n(68),a=n(69),c=n(70),u=n(71);function s(e){var t=this.__data__=new r(e);this.size=t.size}s.prototype.clear=o,s.prototype.delete=i,s.prototype.get=a,s.prototype.has=c,s.prototype.set=u,e.exports=s},function(e,t){e.exports=function(){this.__data__=[],this.size=0}},function(e,t,n){var r=n(12),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0)&&(n==t.length-1?t.pop():o.call(t,n,1),--this.size,!0)}},function(e,t,n){var r=n(12);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},function(e,t,n){var r=n(12);e.exports=function(e){return r(this.__data__,e)>-1}},function(e,t,n){var r=n(12);e.exports=function(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}},function(e,t,n){var r=n(11);e.exports=function(){this.__data__=new r,this.size=0}},function(e,t){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},function(e,t){e.exports=function(e){return this.__data__.get(e)}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t,n){var r=n(11),o=n(20),i=n(79);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!o||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new i(a)}return n.set(e,t),this.size=n.size,this}},function(e,t,n){var r=n(33),o=n(76),i=n(8),a=n(35),c=/^\[object .+?Constructor\]$/,u=Function.prototype,s=Object.prototype,l=u.toString,p=s.hasOwnProperty,f=RegExp("^"+l.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!i(e)||o(e))&&(r(e)?f:c).test(a(e))}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){var r=n(21),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,c=r?r.toStringTag:void 0;e.exports=function(e){var t=i.call(e,c),n=e[c];try{e[c]=void 0;var r=!0}catch(e){}var o=a.call(e);return r&&(t?e[c]=n:delete e[c]),o}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t,n){var r,o=n(77),i=(r=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!i&&i in e}},function(e,t,n){var r=n(3)["__core-js_shared__"];e.exports=r},function(e,t){e.exports=function(e,t){return null==e?void 0:e[t]}},function(e,t,n){var r=n(80),o=n(87),i=n(89),a=n(90),c=n(91);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e=0?e.ownerDocument.body:w(e)&&P(e)?e:T(M(e))}function D(e,t){var n;void 0===t&&(t=[]);var r=T(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=_(r),a=o?[i].concat(i.visualViewport||[],P(r)?r:[]):r,c=t.concat(a);return o?c:c.concat(D(M(a)))}function B(e){return["table","td","th"].indexOf(L(e))>=0}function R(e){return w(e)&&"fixed"!==A(e).position?e.offsetParent:null}function N(e){for(var t=_(e),n=R(e);n&&B(n)&&"static"===A(n).position;)n=R(n);return n&&("html"===L(n)||"body"===L(n)&&"static"===A(n).position)?t:n||function(e){for(var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox"),n=M(e);w(n)&&["html","body"].indexOf(L(n))<0;){var r=A(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 Z="top",I="bottom",F="right",W="left",z="auto",H=[Z,I,F,W],U="start",V="end",q="viewport",$="popper",G=H.reduce((function(e,t){return e.concat([t+"-"+U,t+"-"+V])}),[]),J=[].concat(H,[z]).reduce((function(e,t){return e.concat([t,t+"-"+U,t+"-"+V])}),[]),X=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Y(e){var t=new Map,n=new Set,r=[];function o(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&o(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||o(e)})),r}var K={placement:"bottom",modifiers:[],strategy:"absolute"};function Q(){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,o=e.placement,i=o?re(o):null,a=o?oe(o):null,c=n.x+n.width/2-r.width/2,u=n.y+n.height/2-r.height/2;switch(i){case Z:t={x:c,y:n.y-r.height};break;case I:t={x:c,y:n.y+n.height};break;case F:t={x:n.x+n.width,y:u};break;case W:t={x:n.x-r.width,y:u};break;default:t={x:n.x,y:n.y}}var s=i?ie(i):null;if(null!=s){var l="y"===s?"height":"width";switch(a){case U:t[s]=t[s]-(n[l]/2-r[l]/2);break;case V:t[s]=t[s]+(n[l]/2-r[l]/2)}}return t}var ce={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:{}},ue=Math.max,se=Math.min,le=Math.round,pe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function fe(e){var t,n=e.popper,r=e.popperRect,o=e.placement,i=e.offsets,a=e.position,c=e.gpuAcceleration,u=e.adaptive,s=e.roundOffsets,l=!0===s?function(e){var t=e.x,n=e.y,r=window.devicePixelRatio||1;return{x:le(le(t*r)/r)||0,y:le(le(n*r)/r)||0}}(i):"function"==typeof s?s(i):i,p=l.x,f=void 0===p?0:p,d=l.y,v=void 0===d?0:d,m=i.hasOwnProperty("x"),b=i.hasOwnProperty("y"),h=W,y=Z,g=window;if(u){var O=N(n),j="clientHeight",w="clientWidth";O===_(n)&&"static"!==A(O=E(n)).position&&(j="scrollHeight",w="scrollWidth"),O=O,o===Z&&(y=I,v-=O[j]-r.height,v*=c?1:-1),o===W&&(h=F,f-=O[w]-r.width,f*=c?1:-1)}var x,L=Object.assign({position:a},u&&pe);return c?Object.assign({},L,((x={})[y]=b?"0":"",x[h]=m?"0":"",x.transform=(g.devicePixelRatio||1)<2?"translate("+f+"px, "+v+"px)":"translate3d("+f+"px, "+v+"px, 0)",x)):Object.assign({},L,((t={})[y]=b?v+"px":"",t[h]=m?f+"px":"",t.transform="",t))}var de={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]||{},o=t.elements[e];w(o)&&L(o)&&(Object.assign(o.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?o.removeAttribute(e):o.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],o=t.attributes[e]||{},i=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});w(r)&&L(r)&&(Object.assign(r.style,i),Object.keys(o).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};var ve={left:"right",right:"left",bottom:"top",top:"bottom"};function me(e){return e.replace(/left|right|bottom|top/g,(function(e){return ve[e]}))}var be={start:"end",end:"start"};function he(e){return e.replace(/start|end/g,(function(e){return be[e]}))}function ye(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&x(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function ge(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function _e(e,t){return t===q?ge(function(e){var t=_(e),n=E(e),r=t.visualViewport,o=n.clientWidth,i=n.clientHeight,a=0,c=0;return r&&(o=r.width,i=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=r.offsetLeft,c=r.offsetTop)),{width:o,height:i,x:a+k(e),y:c}}(e)):w(t)?function(e){var t=g(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(t):ge(function(e){var t,n=E(e),r=O(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=ue(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=ue(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),c=-r.scrollLeft+k(e),u=-r.scrollTop;return"rtl"===A(o||n).direction&&(c+=ue(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:c,y:u}}(E(e)))}function Oe(e,t,n){var r="clippingParents"===t?function(e){var t=D(M(e)),n=["absolute","fixed"].indexOf(A(e).position)>=0&&w(e)?N(e):e;return j(n)?t.filter((function(e){return j(e)&&ye(e,n)&&"body"!==L(e)})):[]}(e):[].concat(t),o=[].concat(r,[n]),i=o[0],a=o.reduce((function(t,n){var r=_e(e,n);return t.top=ue(r.top,t.top),t.right=se(r.right,t.right),t.bottom=se(r.bottom,t.bottom),t.left=ue(r.left,t.left),t}),_e(e,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function je(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function we(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function xe(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=void 0===r?e.placement:r,i=n.boundary,a=void 0===i?"clippingParents":i,c=n.rootBoundary,u=void 0===c?q:c,s=n.elementContext,l=void 0===s?$:s,p=n.altBoundary,f=void 0!==p&&p,d=n.padding,v=void 0===d?0:d,m=je("number"!=typeof v?v:we(v,H)),b=l===$?"reference":$,h=e.elements.reference,y=e.rects.popper,_=e.elements[f?b:l],O=Oe(j(_)?_:_.contextElement||E(e.elements.popper),a,u),w=g(h),x=ae({reference:w,element:y,strategy:"absolute",placement:o}),L=ge(Object.assign({},y,x)),k=l===$?L:w,A={top:O.top-k.top+m.top,bottom:k.bottom-O.bottom+m.bottom,left:O.left-k.left+m.left,right:k.right-O.right+m.right},P=e.modifiersData.offset;if(l===$&&P){var S=P[o];Object.keys(A).forEach((function(e){var t=[F,I].indexOf(e)>=0?1:-1,n=[Z,I].indexOf(e)>=0?"y":"x";A[e]+=S[n]*t}))}return A}function Le(e,t,n){return ue(e,se(t,n))}function Ee(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 ke(e){return[Z,F,I,W].some((function(t){return e[t]>=0}))}var Ae=ee({defaultModifiers:[ne,ce,{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=void 0===r||r,i=n.adaptive,a=void 0===i||i,c=n.roundOffsets,u=void 0===c||c,s={placement:re(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,fe(Object.assign({},s,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:u})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,fe(Object.assign({},s,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},de,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=void 0===o?[0,0]:o,a=J.reduce((function(e,n){return e[n]=function(e,t,n){var r=re(e),o=[W,Z].indexOf(r)>=0?-1:1,i="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=i[0],c=i[1];return a=a||0,c=(c||0)*o,[W,F].indexOf(r)>=0?{x:c,y:a}:{x:a,y:c}}(n,t.rects,i),e}),{}),c=a[t.placement],u=c.x,s=c.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=u,t.modifiersData.popperOffsets.y+=s),t.modifiersData[r]=a}},{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=void 0===o||o,a=n.altAxis,c=void 0===a||a,u=n.fallbackPlacements,s=n.padding,l=n.boundary,p=n.rootBoundary,f=n.altBoundary,d=n.flipVariations,v=void 0===d||d,m=n.allowedAutoPlacements,b=t.options.placement,h=re(b),y=u||(h===b||!v?[me(b)]:function(e){if(re(e)===z)return[];var t=me(e);return[he(e),t,he(t)]}(b)),g=[b].concat(y).reduce((function(e,n){return e.concat(re(n)===z?function(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,a=n.padding,c=n.flipVariations,u=n.allowedAutoPlacements,s=void 0===u?J:u,l=oe(r),p=l?c?G:G.filter((function(e){return oe(e)===l})):H,f=p.filter((function(e){return s.indexOf(e)>=0}));0===f.length&&(f=p);var d=f.reduce((function(t,n){return t[n]=xe(e,{placement:n,boundary:o,rootBoundary:i,padding:a})[re(n)],t}),{});return Object.keys(d).sort((function(e,t){return d[e]-d[t]}))}(t,{placement:n,boundary:l,rootBoundary:p,padding:s,flipVariations:v,allowedAutoPlacements:m}):n)}),[]),_=t.rects.reference,O=t.rects.popper,j=new Map,w=!0,x=g[0],L=0;L=0,S=P?"width":"height",C=xe(t,{placement:E,boundary:l,rootBoundary:p,altBoundary:f,padding:s}),M=P?A?F:W:A?I:Z;_[S]>O[S]&&(M=me(M));var T=me(M),D=[];if(i&&D.push(C[k]<=0),c&&D.push(C[M]<=0,C[T]<=0),D.every((function(e){return e}))){x=E,w=!1;break}j.set(E,D)}if(w)for(var B=function(e){var t=g.find((function(t){var n=j.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return x=t,"break"},R=v?3:1;R>0;R--){if("break"===B(R))break}t.placement!==x&&(t.modifiersData[r]._skip=!0,t.placement=x,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,i=void 0===o||o,a=n.altAxis,c=void 0!==a&&a,u=n.boundary,s=n.rootBoundary,l=n.altBoundary,p=n.padding,f=n.tether,d=void 0===f||f,v=n.tetherOffset,m=void 0===v?0:v,b=xe(t,{boundary:u,rootBoundary:s,padding:p,altBoundary:l}),h=re(t.placement),y=oe(t.placement),g=!y,_=ie(h),O="x"===_?"y":"x",j=t.modifiersData.popperOffsets,w=t.rects.reference,x=t.rects.popper,L="function"==typeof m?m(Object.assign({},t.rects,{placement:t.placement})):m,E={x:0,y:0};if(j){if(i||c){var k="y"===_?Z:W,A="y"===_?I:F,P="y"===_?"height":"width",S=j[_],M=j[_]+b[k],T=j[_]-b[A],D=d?-x[P]/2:0,B=y===U?w[P]:x[P],R=y===U?-x[P]:-w[P],z=t.elements.arrow,H=d&&z?C(z):{width:0,height:0},V=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},q=V[k],$=V[A],G=Le(0,w[P],H[P]),J=g?w[P]/2-D-G-q-L:B-G-q-L,X=g?-w[P]/2+D+G+$+L:R+G+$+L,Y=t.elements.arrow&&N(t.elements.arrow),K=Y?"y"===_?Y.clientTop||0:Y.clientLeft||0:0,Q=t.modifiersData.offset?t.modifiersData.offset[t.placement][_]:0,ee=j[_]+J-Q-K,te=j[_]+X-Q;if(i){var ne=Le(d?se(M,ee):M,S,d?ue(T,te):T);j[_]=ne,E[_]=ne-S}if(c){var ae="x"===_?Z:W,ce="x"===_?I:F,le=j[O],pe=le+b[ae],fe=le-b[ce],de=Le(d?se(pe,ee):pe,le,d?ue(fe,te):fe);j[O]=de,E[O]=de-le}}t.modifiersData[r]=E}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,c=re(n.placement),u=ie(c),s=[W,F].indexOf(c)>=0?"height":"width";if(i&&a){var l=function(e,t){return je("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:we(e,H))}(o.padding,n),p=C(i),f="y"===u?Z:W,d="y"===u?I:F,v=n.rects.reference[s]+n.rects.reference[u]-a[u]-n.rects.popper[s],m=a[u]-n.rects.reference[u],b=N(i),h=b?"y"===u?b.clientHeight||0:b.clientWidth||0:0,y=v/2-m/2,g=l[f],_=h-p[s]-l[d],O=h/2-p[s]/2+y,j=Le(g,O,_),w=u;n.modifiersData[r]=((t={})[w]=j,t.centerOffset=j-O,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)))&&ye(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=xe(t,{elementContext:"reference"}),c=xe(t,{altBoundary:!0}),u=Ee(a,r),s=Ee(c,o,i),l=ke(u),p=ke(s);t.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:s,isReferenceHidden:l,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":l,"data-popper-escaped":p})}}]}),Pe="tippy-content",Se="tippy-backdrop",Ce="tippy-arrow",Me="tippy-svg-arrow",Te={passive:!0,capture:!0};function De(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function Be(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function Re(e,t){return"function"==typeof e?e.apply(void 0,t):e}function Ne(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout((function(){e(r)}),t)};var n}function Ze(e){return[].concat(e)}function Ie(e,t){-1===e.indexOf(t)&&e.push(t)}function Fe(e){return e.split("-")[0]}function We(e){return[].slice.call(e)}function ze(){return document.createElement("div")}function He(e){return["Element","Fragment"].some((function(t){return Be(e,t)}))}function Ue(e){return Be(e,"MouseEvent")}function Ve(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function qe(e){return He(e)?[e]:function(e){return Be(e,"NodeList")}(e)?We(e):Array.isArray(e)?e:We(document.querySelectorAll(e))}function $e(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function Ge(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function Je(e){var t,n=Ze(e)[0];return(null==n||null==(t=n.ownerDocument)?void 0:t.body)?n.ownerDocument:document}function Xe(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[r](t,n)}))}var Ye={isTouch:!1},Ke=0;function Qe(){Ye.isTouch||(Ye.isTouch=!0,window.performance&&document.addEventListener("mousemove",et))}function et(){var e=performance.now();e-Ke<20&&(Ye.isTouch=!1,document.removeEventListener("mousemove",et)),Ke=e}function tt(){var e=document.activeElement;if(Ve(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var nt="undefined"!=typeof window&&"undefined"!=typeof document?navigator.userAgent:"",rt=/MSIE |Trident\//.test(nt);var ot={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},it=Object.assign({appendTo:function(){return document.body},aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},ot,{},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),at=Object.keys(it);function ct(e){var t=(e.plugins||[]).reduce((function(t,n){var r=n.name,o=n.defaultValue;return r&&(t[r]=void 0!==e[r]?e[r]:o),t}),{});return Object.assign({},e,{},t)}function ut(e,t){var n=Object.assign({},t,{content:Re(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(ct(Object.assign({},it,{plugins:t}))):at).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({},it.aria,{},n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}function st(e,t){e.innerHTML=t}function lt(e){var t=ze();return!0===e?t.className=Ce:(t.className=Me,He(e)?t.appendChild(e):st(t,e)),t}function pt(e,t){He(t.content)?(st(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?st(e,t.content):e.textContent=t.content)}function ft(e){var t=e.firstElementChild,n=We(t.children);return{box:t,content:n.find((function(e){return e.classList.contains(Pe)})),arrow:n.find((function(e){return e.classList.contains(Ce)||e.classList.contains(Me)})),backdrop:n.find((function(e){return e.classList.contains(Se)}))}}function dt(e){var t=ze(),n=ze();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=ze();function o(n,r){var o=ft(t),i=o.box,a=o.content,c=o.arrow;r.theme?i.setAttribute("data-theme",r.theme):i.removeAttribute("data-theme"),"string"==typeof r.animation?i.setAttribute("data-animation",r.animation):i.removeAttribute("data-animation"),r.inertia?i.setAttribute("data-inertia",""):i.removeAttribute("data-inertia"),i.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?i.setAttribute("role",r.role):i.removeAttribute("role"),n.content===r.content&&n.allowHTML===r.allowHTML||pt(a,e.props),r.arrow?c?n.arrow!==r.arrow&&(i.removeChild(c),i.appendChild(lt(r.arrow))):i.appendChild(lt(r.arrow)):c&&i.removeChild(c)}return r.className=Pe,r.setAttribute("data-state","hidden"),pt(r,e.props),t.appendChild(n),n.appendChild(r),o(e.props,e.props),{popper:t,onUpdate:o}}dt.$$tippy=!0;var vt=1,mt=[],bt=[];function ht(e,t){var n,r,o,i,a,c,u,s,l,p=ut(e,Object.assign({},it,{},ct((n=t,Object.keys(n).reduce((function(e,t){return void 0!==n[t]&&(e[t]=n[t]),e}),{}))))),f=!1,d=!1,v=!1,m=!1,b=[],h=Ne(G,p.interactiveDebounce),y=vt++,g=(l=p.plugins).filter((function(e,t){return l.indexOf(e)===t})),_={id:y,reference:e,popper:ze(),popperInstance:null,props:p,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:g,clearDelayTimeouts:function(){clearTimeout(r),clearTimeout(o),cancelAnimationFrame(i)},setProps:function(t){0;if(_.state.isDestroyed)return;D("onBeforeUpdate",[_,t]),q();var n=_.props,r=ut(e,Object.assign({},_.props,{},t,{ignoreAttributes:!0}));_.props=r,V(),n.interactiveDebounce!==r.interactiveDebounce&&(N(),h=Ne(G,r.interactiveDebounce));n.triggerTarget&&!r.triggerTarget?Ze(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):r.triggerTarget&&e.removeAttribute("aria-expanded");R(),T(),w&&w(n,r);_.popperInstance&&(K(),ee().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));D("onAfterUpdate",[_,t])},setContent:function(e){_.setProps({content:e})},show:function(){0;var e=_.state.isVisible,t=_.state.isDestroyed,n=!_.state.isEnabled,r=Ye.isTouch&&!_.props.touch,o=De(_.props.duration,0,it.duration);if(e||t||n||r)return;if(P().hasAttribute("disabled"))return;if(D("onShow",[_],!1),!1===_.props.onShow(_))return;_.state.isVisible=!0,A()&&(j.style.visibility="visible");T(),W(),_.state.isMounted||(j.style.transition="none");if(A()){var i=C(),a=i.box,c=i.content;$e([a,c],0)}u=function(){var e;if(_.state.isVisible&&!m){if(m=!0,j.offsetHeight,j.style.transition=_.props.moveTransition,A()&&_.props.animation){var t=C(),n=t.box,r=t.content;$e([n,r],o),Ge([n,r],"visible")}B(),R(),Ie(bt,_),null==(e=_.popperInstance)||e.forceUpdate(),_.state.isMounted=!0,D("onMount",[_]),_.props.animation&&A()&&function(e,t){H(e,t)}(o,(function(){_.state.isShown=!0,D("onShown",[_])}))}},function(){var e,t=_.props.appendTo,n=P();e=_.props.interactive&&t===it.appendTo||"parent"===t?n.parentNode:Re(t,[n]);e.contains(j)||e.appendChild(j);K(),!1}()},hide:function(){0;var e=!_.state.isVisible,t=_.state.isDestroyed,n=!_.state.isEnabled,r=De(_.props.duration,1,it.duration);if(e||t||n)return;if(D("onHide",[_],!1),!1===_.props.onHide(_))return;_.state.isVisible=!1,_.state.isShown=!1,m=!1,f=!1,A()&&(j.style.visibility="hidden");if(N(),z(),T(),A()){var o=C(),i=o.box,a=o.content;_.props.animation&&($e([i,a],r),Ge([i,a],"hidden"))}B(),R(),_.props.animation?A()&&function(e,t){H(e,(function(){!_.state.isVisible&&j.parentNode&&j.parentNode.contains(j)&&t()}))}(r,_.unmount):_.unmount()},hideWithInteractivity:function(e){0;S().addEventListener("mousemove",h),Ie(mt,h),h(e)},enable:function(){_.state.isEnabled=!0},disable:function(){_.hide(),_.state.isEnabled=!1},unmount:function(){0;_.state.isVisible&&_.hide();if(!_.state.isMounted)return;Q(),ee().forEach((function(e){e._tippy.unmount()})),j.parentNode&&j.parentNode.removeChild(j);bt=bt.filter((function(e){return e!==_})),_.state.isMounted=!1,D("onHidden",[_])},destroy:function(){0;if(_.state.isDestroyed)return;_.clearDelayTimeouts(),_.unmount(),q(),delete e._tippy,_.state.isDestroyed=!0,D("onDestroy",[_])}};if(!p.render)return _;var O=p.render(_),j=O.popper,w=O.onUpdate;j.setAttribute("data-tippy-root",""),j.id="tippy-"+_.id,_.popper=j,e._tippy=_,j._tippy=_;var x=g.map((function(e){return e.fn(_)})),L=e.hasAttribute("aria-expanded");return V(),R(),T(),D("onCreate",[_]),p.showOnCreate&&te(),j.addEventListener("mouseenter",(function(){_.props.interactive&&_.state.isVisible&&_.clearDelayTimeouts()})),j.addEventListener("mouseleave",(function(e){_.props.interactive&&_.props.trigger.indexOf("mouseenter")>=0&&(S().addEventListener("mousemove",h),h(e))})),_;function E(){var e=_.props.touch;return Array.isArray(e)?e:[e,0]}function k(){return"hold"===E()[0]}function A(){var e;return!!(null==(e=_.props.render)?void 0:e.$$tippy)}function P(){return s||e}function S(){var e=P().parentNode;return e?Je(e):document}function C(){return ft(j)}function M(e){return _.state.isMounted&&!_.state.isVisible||Ye.isTouch||a&&"focus"===a.type?0:De(_.props.delay,e?0:1,it.delay)}function T(){j.style.pointerEvents=_.props.interactive&&_.state.isVisible?"":"none",j.style.zIndex=""+_.props.zIndex}function D(e,t,n){var r;(void 0===n&&(n=!0),x.forEach((function(n){n[e]&&n[e].apply(void 0,t)})),n)&&(r=_.props)[e].apply(r,t)}function B(){var t=_.props.aria;if(t.content){var n="aria-"+t.content,r=j.id;Ze(_.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(n);if(_.state.isVisible)e.setAttribute(n,t?t+" "+r:r);else{var o=t&&t.replace(r,"").trim();o?e.setAttribute(n,o):e.removeAttribute(n)}}))}}function R(){!L&&_.props.aria.expanded&&Ze(_.props.triggerTarget||e).forEach((function(e){_.props.interactive?e.setAttribute("aria-expanded",_.state.isVisible&&e===P()?"true":"false"):e.removeAttribute("aria-expanded")}))}function N(){S().removeEventListener("mousemove",h),mt=mt.filter((function(e){return e!==h}))}function Z(e){if(!(Ye.isTouch&&(v||"mousedown"===e.type)||_.props.interactive&&j.contains(e.target))){if(P().contains(e.target)){if(Ye.isTouch)return;if(_.state.isVisible&&_.props.trigger.indexOf("click")>=0)return}else D("onClickOutside",[_,e]);!0===_.props.hideOnClick&&(_.clearDelayTimeouts(),_.hide(),d=!0,setTimeout((function(){d=!1})),_.state.isMounted||z())}}function I(){v=!0}function F(){v=!1}function W(){var e=S();e.addEventListener("mousedown",Z,!0),e.addEventListener("touchend",Z,Te),e.addEventListener("touchstart",F,Te),e.addEventListener("touchmove",I,Te)}function z(){var e=S();e.removeEventListener("mousedown",Z,!0),e.removeEventListener("touchend",Z,Te),e.removeEventListener("touchstart",F,Te),e.removeEventListener("touchmove",I,Te)}function H(e,t){var n=C().box;function r(e){e.target===n&&(Xe(n,"remove",r),t())}if(0===e)return t();Xe(n,"remove",c),Xe(n,"add",r),c=r}function U(t,n,r){void 0===r&&(r=!1),Ze(_.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,n,r),b.push({node:e,eventType:t,handler:n,options:r})}))}function V(){var e;k()&&(U("touchstart",$,{passive:!0}),U("touchend",J,{passive:!0})),(e=_.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(U(e,$),e){case"mouseenter":U("mouseleave",J);break;case"focus":U(rt?"focusout":"blur",X);break;case"focusin":U("focusout",X)}}))}function q(){b.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,o=e.options;t.removeEventListener(n,r,o)})),b=[]}function $(e){var t,n=!1;if(_.state.isEnabled&&!Y(e)&&!d){var r="focus"===(null==(t=a)?void 0:t.type);a=e,s=e.currentTarget,R(),!_.state.isVisible&&Ue(e)&&mt.forEach((function(t){return t(e)})),"click"===e.type&&(_.props.trigger.indexOf("mouseenter")<0||f)&&!1!==_.props.hideOnClick&&_.state.isVisible?n=!0:te(e),"click"===e.type&&(f=!n),n&&!r&&ne(e)}}function G(e){var t=e.target,n=P().contains(t)||j.contains(t);"mousemove"===e.type&&n||function(e,t){var n=t.clientX,r=t.clientY;return e.every((function(e){var t=e.popperRect,o=e.popperState,i=e.props.interactiveBorder,a=Fe(o.placement),c=o.modifiersData.offset;if(!c)return!0;var u="bottom"===a?c.top.y:0,s="top"===a?c.bottom.y:0,l="right"===a?c.left.x:0,p="left"===a?c.right.x:0,f=t.top-r+u>i,d=r-t.bottom-s>i,v=t.left-n+l>i,m=n-t.right-p>i;return f||d||v||m}))}(ee().concat(j).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),e)&&(N(),ne(e))}function J(e){Y(e)||_.props.trigger.indexOf("click")>=0&&f||(_.props.interactive?_.hideWithInteractivity(e):ne(e))}function X(e){_.props.trigger.indexOf("focusin")<0&&e.target!==P()||_.props.interactive&&e.relatedTarget&&j.contains(e.relatedTarget)||ne(e)}function Y(e){return!!Ye.isTouch&&k()!==e.type.indexOf("touch")>=0}function K(){Q();var t=_.props,n=t.popperOptions,r=t.placement,o=t.offset,i=t.getReferenceClientRect,a=t.moveTransition,c=A()?ft(j).arrow:null,s=i?{getBoundingClientRect:i,contextElement:i.contextElement||P()}:e,l=[{name:"offset",options:{offset:o}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!a}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(A()){var n=C().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?n.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?n.setAttribute("data-"+e,""):n.removeAttribute("data-"+e)})),t.attributes.popper={}}}}];A()&&c&&l.push({name:"arrow",options:{element:c,padding:3}}),l.push.apply(l,(null==n?void 0:n.modifiers)||[]),_.popperInstance=Ae(s,j,Object.assign({},n,{placement:r,onFirstUpdate:u,modifiers:l}))}function Q(){_.popperInstance&&(_.popperInstance.destroy(),_.popperInstance=null)}function ee(){return We(j.querySelectorAll("[data-tippy-root]"))}function te(e){_.clearDelayTimeouts(),e&&D("onTrigger",[_,e]),W();var t=M(!0),n=E(),o=n[0],i=n[1];Ye.isTouch&&"hold"===o&&i&&(t=i),t?r=setTimeout((function(){_.show()}),t):_.show()}function ne(e){if(_.clearDelayTimeouts(),D("onUntrigger",[_,e]),_.state.isVisible){if(!(_.props.trigger.indexOf("mouseenter")>=0&&_.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&f)){var t=M(!1);t?o=setTimeout((function(){_.state.isVisible&&_.hide()}),t):i=requestAnimationFrame((function(){_.hide()}))}}else z()}}function yt(e,t){void 0===t&&(t={});var n=it.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",Qe,Te),window.addEventListener("blur",tt);var r=Object.assign({},t,{plugins:n}),o=qe(e).reduce((function(e,t){var n=t&&ht(t,r);return n&&e.push(n),e}),[]);return He(e)?o[0]:o}yt.defaultProps=it,yt.setDefaultProps=function(e){Object.keys(e).forEach((function(t){it[t]=e[t]}))},yt.currentInput=Ye;Object.assign({},de,{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)}});yt.setDefaultProps({render:dt});var gt=yt,_t=n(50);function Ot(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}var jt="undefined"!=typeof window&&"undefined"!=typeof document;function wt(e,t){e&&("function"==typeof e&&e(t),{}.hasOwnProperty.call(e,"current")&&(e.current=t))}function xt(){return jt&&document.createElement("div")}function Lt(e,t){var n,r,o,i,a;return Object.assign({},t,{popperOptions:Object.assign({},e.popperOptions,t.popperOptions,{modifiers:(o=[].concat((null==(n=e.popperOptions)?void 0:n.modifiers)||[],(null==(r=t.popperOptions)?void 0:r.modifiers)||[]),i=[],a=Object.create(null),o.forEach((function(e){void 0===a[JSON.stringify(e)]&&i.push(e),a[JSON.stringify(e)]=!0})),i)})})}var Et=jt?l.useLayoutEffect:l.useEffect;function kt(e){var t=Object(l.useRef)();return t.current||(t.current="function"==typeof e?e():e),t.current}function At(e,t,n){n.split(/\s+/).forEach((function(n){n&&e.classList[t](n)}))}var Pt={name:"className",defaultValue:"",fn:function(e){var t=e.popper.firstElementChild,n=function(){var t;return!!(null==(t=e.props.render)?void 0:t.$$tippy)};function r(){e.props.className&&!n()||At(t,"add",e.props.className)}return{onCreate:r,onBeforeUpdate:function(){n()&&At(t,"remove",e.props.className)},onAfterUpdate:r}}};function St(e){return function(t){var n=t.children,r=t.content,o=t.visible,i=t.singleton,a=t.render,c=t.reference,u=t.disabled,s=void 0!==u&&u,f=t.ignoreAttributes,d=void 0===f||f,v=(t.__source,t.__self,Ot(t,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"])),m=void 0!==o,b=void 0!==i,h=Object(l.useState)(!1),y=h[0],g=h[1],_=Object(l.useState)({}),O=_[0],j=_[1],w=Object(l.useState)(),x=w[0],L=w[1],E=kt((function(){return{container:xt(),renders:1}})),k=Object.assign({ignoreAttributes:d},v,{content:E.container});m&&(k.trigger="manual",k.hideOnClick=!1),b&&(s=!0);var A=k,P=k.plugins||[];a&&(A=Object.assign({},k,{plugins:b?[].concat(P,[{fn:function(){return{onTrigger:function(e,t){var n=i.data.children.find((function(e){return e.instance.reference===t.currentTarget})).content;L(n)}}}}]):P,render:function(){return{popper:E.container}}}));var S=[c].concat(n?[n.type]:[]);return Et((function(){var t=c;c&&c.hasOwnProperty("current")&&(t=c.current);var n=e(t||E.ref||xt(),Object.assign({},A,{plugins:[Pt].concat(k.plugins||[])}));return E.instance=n,s&&n.disable(),o&&n.show(),b&&i.hook({instance:n,content:r,props:A}),g(!0),function(){n.destroy(),null==i||i.cleanup(n)}}),S),Et((function(){var e;if(1!==E.renders){var t=E.instance;t.setProps(Lt(t.props,A)),null==(e=t.popperInstance)||e.forceUpdate(),s?t.disable():t.enable(),m&&(o?t.show():t.hide()),b&&i.hook({instance:t,content:r,props:A})}else E.renders++})),Et((function(){var e;if(a){var t=E.instance;t.setProps({popperOptions:Object.assign({},t.props.popperOptions,{modifiers:[].concat(((null==(e=t.props.popperOptions)?void 0:e.modifiers)||[]).filter((function(e){return"$$tippyReact"!==e.name})),[{name:"$$tippyReact",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t,n=e.state,r=null==(t=n.modifiersData)?void 0:t.hide;O.placement===n.placement&&O.referenceHidden===(null==r?void 0:r.isReferenceHidden)&&O.escaped===(null==r?void 0:r.hasPopperEscaped)||j({placement:n.placement,referenceHidden:null==r?void 0:r.isReferenceHidden,escaped:null==r?void 0:r.hasPopperEscaped}),n.attributes.popper={}}}])})})}}),[O.placement,O.referenceHidden,O.escaped].concat(S)),p.a.createElement(p.a.Fragment,null,n?Object(l.cloneElement)(n,{ref:function(e){E.ref=e,wt(n.ref,e)}}):null,y&&Object(_t.createPortal)(a?a(function(e){var t={"data-placement":e.placement};return e.referenceHidden&&(t["data-reference-hidden"]=""),e.escaped&&(t["data-escaped"]=""),t}(O),x,E.instance):r,E.container))}}var Ct=function(e,t){return Object(l.forwardRef)((function(n,r){var o=n.children,i=Ot(n,["children"]);return p.a.createElement(e,Object.assign({},t,i),o?Object(l.cloneElement)(o,{ref:function(e){wt(r,e),wt(o.ref,e)}}):null)}))},Mt=Ct(St(gt)),Tt=(n(131),n(2)),Dt=n(19),Bt=function(){return p.a.createElement("svg",{width:"18px",height:"18px",viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},p.a.createElement("title",null,"shape-round"),p.a.createElement("desc",null,"Created with Sketch."),p.a.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},p.a.createElement("g",{id:"widgets/shape-round",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},p.a.createElement("path",{d:"M12,3 C16.9705627,3 21,7.02943725 21,12 C21,16.9705627 16.9705627,21 12,21 C7.02943725,21 3,16.9705627 3,12 C3,7.02943725 7.02943725,3 12,3 Z M12,5 C8.13400675,5 5,8.13400675 5,12 C5,15.8659932 8.13400675,19 12,19 C15.8659932,19 19,15.8659932 19,12 C19,8.13400675 15.8659932,5 12,5 Z",id:"Combined-Shape"}))))},Rt=function(){return p.a.createElement("svg",{width:"18px",height:"18px",viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},p.a.createElement("title",null,"ratio-square"),p.a.createElement("desc",null,"Created with Sketch."),p.a.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},p.a.createElement("g",{id:"widgets/shape-square",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},p.a.createElement("path",{d:"M3,3 L3,21 L21,21 L21,3 L3,3 Z M5,5 L5,19 L19,19 L19,5 L5,5 Z",id:"shape"}))))},Nt=function(){return p.a.createElement("svg",{width:"18px",height:"18px",viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},p.a.createElement("title",null,"shape-radius"),p.a.createElement("desc",null,"Created with Sketch."),p.a.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},p.a.createElement("g",{id:"widgets/shape-radius",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},p.a.createElement("path",{d:"M17,3 C19.209139,3 21,4.790861 21,7 L21,17 C21,19.209139 19.209139,21 17,21 L7,21 C4.790861,21 3,19.209139 3,17 L3,7 C3,4.790861 4.790861,3 7,3 L17,3 Z M17,5 L7,5 C5.9456382,5 5.08183488,5.81587779 5.00548574,6.85073766 L5,7 L5,17 C5,18.0543618 5.81587779,18.9181651 6.85073766,18.9945143 L7,19 L17,19 C18.0543618,19 18.9181651,18.1841222 18.9945143,17.1492623 L19,17 L19,7 C19,5.9456382 18.1841222,5.08183488 17.1492623,5.00548574 L17,5 Z",id:"Rectangle"}))))},Zt=function(){return p.a.createElement("svg",{width:"18px",height:"18px",viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},p.a.createElement("title",null,"shape-none"),p.a.createElement("desc",null,"Created with Sketch."),p.a.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},p.a.createElement("g",{id:"widgets/shape-none",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},p.a.createElement("path",{d:"M5,19 L5,21 L3,21 L3,19 L5,19 Z M21,19 L21,21 L19,21 L19,19 L21,19 Z M13,19 L13,21 L11,21 L11,19 L13,19 Z M9,19 L9,21 L7,21 L7,19 L9,19 Z M17,19 L17,21 L15,21 L15,19 L17,19 Z M21,15 L21,17 L19,17 L19,15 L21,15 Z M21,11 L21,13 L19,13 L19,11 L21,11 Z M5,11 L5,13 L3,13 L3,11 L5,11 Z M21,7 L21,9 L19,9 L19,7 L21,7 Z M5,7 L5,9 L3,9 L3,7 L5,7 Z M13,3 L13,5 L11,5 L11,3 L13,3 Z M9,3 L9,5 L7,5 L7,3 L9,3 Z M17,3 L17,5 L15,5 L15,3 L17,3 Z M21,3 L21,5 L19,5 L19,3 L21,3 Z M5,3 L5,5 L3,5 L3,3 L5,3 Z M3,15 L5,15 L5,17 L3,17 L3,15 Z",id:"Shape"}))))},It=[{value:{type:"expanded",columns:1},icon:function(){return p.a.createElement("svg",{width:"17px",height:"20px",viewBox:"0 0 17 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},p.a.createElement("title",null,"layout-modern"),p.a.createElement("desc",null,"Created with Sketch."),p.a.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},p.a.createElement("g",{id:"widgets/layout-modern",transform:"translate(-2.000000, -3.000000)",fill:"#000000"},p.a.createElement("path",{d:"M2,10 L5,10 L5,7 L2,7 L2,10 Z M2,14 L5,14 L5,11 L2,11 L2,14 Z M2,6 L5,6 L5,3 L2,3 L2,6 Z M6,3 L6,17 L19,17 L19,3 L6,3 Z M8,5 L8,15 L17,15 L17,5 L8,5 Z M6,18 L6,23 L19,23 L19,18 L6,18 Z M8,20 L8,23 L17,23 L17,20 L8,20 Z",id:"shape"}))))},label:Object(b.__)("Expanded - 1 Column","cloudinary")},{value:{type:"expanded",columns:2},icon:function(){return p.a.createElement("svg",{width:"18px",height:"17px",viewBox:"0 0 18 17",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},p.a.createElement("title",null,"layout-grid-2-column"),p.a.createElement("desc",null,"Created with Sketch."),p.a.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},p.a.createElement("g",{id:"widgets/layout-gird-2-col",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},p.a.createElement("path",{d:"M11,12 L11,20 L3,20 L3,12 L11,12 Z M21,12 L21,20 L13,20 L13,12 L21,12 Z M9,14 L5,14 L5,18 L9,18 L9,14 Z M19,14 L15,14 L15,18 L19,18 L19,14 Z M11,3 L11,11 L3,11 L3,3 L11,3 Z M21,3 L21,11 L13,11 L13,3 L21,3 Z M9,5 L5,5 L5,9 L9,9 L9,5 Z M19,5 L15,5 L15,9 L19,9 L19,5 Z",id:"Shape"}))))},label:Object(b.__)("Expanded - 2 Column","cloudinary")},{value:{type:"expanded",columns:3},icon:function(){return p.a.createElement("svg",{width:"20px",height:"13px",viewBox:"0 0 20 13",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},p.a.createElement("title",null,"layout-grid-3-column"),p.a.createElement("desc",null,"Created with Sketch."),p.a.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},p.a.createElement("g",{id:"widgets/layout-gird-3-col",transform:"translate(-2.000000, -5.000000)",fill:"#000000"},p.a.createElement("path",{d:"M8,12 L8,18 L2,18 L2,12 L8,12 Z M15,12 L15,18 L9,18 L9,12 L15,12 Z M22,12 L22,18 L16,18 L16,12 L22,12 Z M6,14 L4,14 L4,16 L6,16 L6,14 Z M13,14 L11,14 L11,16 L13,16 L13,14 Z M20,14 L18,14 L18,16 L20,16 L20,14 Z M8,5 L8,11 L2,11 L2,5 L8,5 Z M15,5 L15,11 L9,11 L9,5 L15,5 Z M22,5 L22,11 L16,11 L16,5 L22,5 Z M6,7 L4,7 L4,9 L6,9 L6,7 Z M13,7 L11,7 L11,9 L13,9 L13,7 Z M20,7 L18,7 L18,9 L20,9 L20,7 Z",id:"Combined-Shape"}))))},label:Object(b.__)("Expanded - 3 Column","cloudinary")},{value:{type:"classic",columns:1},icon:function(){return p.a.createElement("svg",{width:"17px",height:"14px",viewBox:"0 0 17 14",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},p.a.createElement("title",null,"layout-classic"),p.a.createElement("desc",null,"Created with Sketch."),p.a.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},p.a.createElement("g",{id:"widgets/layout-classic",transform:"translate(-3.000000, -5.000000)",fill:"#000000"},p.a.createElement("path",{d:"M3,12 L6,12 L6,9 L3,9 L3,12 Z M3,16 L6,16 L6,13 L3,13 L3,16 Z M3,8 L6,8 L6,5 L3,5 L3,8 Z M7,5 L7,19 L20,19 L20,5 L7,5 Z M9,7 L9,17 L18,17 L18,7 L9,7 Z",id:"shape"}))))},label:Object(b.__)("Classic","cloudinary")}],Ft=[{label:Object(b.__)("1:1","cloudinary"),value:"1:1"},{label:Object(b.__)("3:4","cloudinary"),value:"3:4"},{label:Object(b.__)("4:3","cloudinary"),value:"4:3"},{label:Object(b.__)("4:6","cloudinary"),value:"4:6"},{label:Object(b.__)("6:4","cloudinary"),value:"6:4"},{label:Object(b.__)("5:7","cloudinary"),value:"5:7"},{label:Object(b.__)("7:5","cloudinary"),value:"7:5"},{label:Object(b.__)("8:5","cloudinary"),value:"8:5"},{label:Object(b.__)("5:8","cloudinary"),value:"5:8"},{label:Object(b.__)("9:16","cloudinary"),value:"9:16"},{label:Object(b.__)("16:9","cloudinary"),value:"16:9"}],Wt=[{label:Object(b.__)("None","cloudinary"),value:"none"},{label:Object(b.__)("Fade","cloudinary"),value:"fade"},{label:Object(b.__)("Slide","cloudinary"),value:"slide"}],zt=[{label:Object(b.__)("Always","cloudinary"),value:"always"},{label:Object(b.__)("None","cloudinary"),value:"none"},{label:Object(b.__)("MouseOver","cloudinary"),value:"mouseover"}],Ht=[{label:Object(b.__)("Inline","cloudinary"),value:"inline"},{label:Object(b.__)("Flyout","cloudinary"),value:"flyout"},{label:Object(b.__)("Popup","cloudinary"),value:"popup"}],Ut=[{label:Object(b.__)("Top","cloudinary"),value:"top"},{label:Object(b.__)("Bottom","cloudinary"),value:"bottom"},{label:Object(b.__)("Left","cloudinary"),value:"left"},{label:Object(b.__)("Right","cloudinary"),value:"right"}],Vt=[{label:Object(b.__)("Click","cloudinary"),value:"click"},{label:Object(b.__)("Hover","cloudinary"),value:"hover"}],qt=[{label:Object(b.__)("Left","cloudinary"),value:"left"},{label:Object(b.__)("Right","cloudinary"),value:"right"},{label:Object(b.__)("Top","cloudinary"),value:"top"},{label:Object(b.__)("Bottom","cloudinary"),value:"bottom"}],$t=[{label:Object(b.__)("Thumbnails","cloudinary"),value:"thumbnails"},{label:Object(b.__)("Indicators","cloudinary"),value:"indicators"},{label:Object(b.__)("None","cloudinary"),value:"none"}],Gt=[{value:"round",icon:Bt,label:Object(b.__)("Round","cloudinary")},{value:"radius",icon:Nt,label:Object(b.__)("Radius","cloudinary")},{value:"none",icon:Zt,label:Object(b.__)("None","cloudinary")},{value:"square",icon:Rt,label:Object(b.__)("Square","cloudinary")},{value:"rectangle",icon:function(){return p.a.createElement("svg",{width:"14px",height:"20px",viewBox:"0 0 14 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},p.a.createElement("title",null,"ratio-9-16"),p.a.createElement("desc",null,"Created with Sketch."),p.a.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},p.a.createElement("g",{id:"ratio/9-16",transform:"translate(-5.000000, -2.000000)",fill:"#000000"},p.a.createElement("path",{d:"M22,5.5 L22,18.5 L2,18.5 L2,5.5 L22,5.5 Z M20,7.5 L4,7.5 L4,16.5 L20,16.5 L20,7.5 Z",id:"Combined-Shape",transform:"translate(12.000000, 12.000000) rotate(-90.000000) translate(-12.000000, -12.000000) "}))))},label:Object(b.__)("Rectangle","cloudinary")}],Jt=[{value:"round",icon:Bt,label:Object(b.__)("Round","cloudinary")},{value:"radius",icon:Nt,label:Object(b.__)("Radius","cloudinary")},{value:"square",icon:Rt,label:Object(b.__)("Square","cloudinary")}],Xt=[{label:Object(b.__)("All","cloudinary"),value:"all"},{label:Object(b.__)("Border","cloudinary"),value:"border"},{label:Object(b.__)("Gradient","cloudinary"),value:"gradient"}],Yt=[{label:Object(b.__)("All","cloudinary"),value:"all"},{label:Object(b.__)("Top","cloudinary"),value:"top"},{label:Object(b.__)("Top-Bottom","cloudinary"),value:"top-bottom"},{label:Object(b.__)("Left-Right","cloudinary"),value:"left-right"},{label:Object(b.__)("Bottom","cloudinary"),value:"bottom"},{label:Object(b.__)("Left","cloudinary"),value:"left"},{label:Object(b.__)("Right","cloudinary"),value:"right"}],Kt=[{value:"round",icon:Bt,label:Object(b.__)("Round","cloudinary")},{value:"radius",icon:Nt,label:Object(b.__)("Radius","cloudinary")},{value:"none",icon:Zt,label:Object(b.__)("None","cloudinary")},{value:"square",icon:Rt,label:Object(b.__)("Square","cloudinary")}],Qt=[{label:Object(b.__)("Pad","cloudinary"),value:"pad"},{label:Object(b.__)("Fill","cloudinary"),value:"fill"}],en=[{label:Object(b.__)("White padding","cloudinary"),value:"rgb:FFFFFF"},{label:Object(b.__)("Border color padding","cloudinary"),value:"auto"},{label:Object(b.__)("Predominant color padding","cloudinary"),value:"auto:predominant"},{label:Object(b.__)("Gradient fade padding","cloudinary"),value:"auto:predominant_gradient"}],tn=n(49),nn=n.n(tn),rn=function(e){var t=e.value,n=e.children,r=e.icon,o=e.onChange,i=e.current,a="object"===m()(t)?JSON.stringify(t)===JSON.stringify(i):i===t;return p.a.createElement("button",{type:"button",onClick:function(){return o(t)},className:nn()("radio-select",{"radio-select--active":a})},p.a.createElement(r,null),p.a.createElement("div",{className:"radio-select__label"},n))},on=function(e){var t=e.children,n=e.value;return p.a.createElement("div",{className:"colorpalette-color-label"},p.a.createElement("span",null,t),p.a.createElement("span",{className:"component-color-indicator","aria-label":"Color: ".concat(n),style:{background:n}}))},an=new d.a("_"),cn=function(e){var t=e.attributes,n=e.setAttributes,r=e.colors,o=y()(t),i=an.object(o);return i.customSettings="object"===m()(i.customSettings)?JSON.stringify(i.customSettings):i.customSettings,t.transformation_crop||(t.transformation_crop="pad",t.transformation_background="rgb:FFFFFF"),"fill"===t.transformation_crop&&delete t.transformation_background,p.a.createElement(p.a.Fragment,null,p.a.createElement(Tt.PanelBody,{title:Object(b.__)("Layout","cloudinary")},It.map((function(e){return p.a.createElement(rn,{key:"".concat(e.value.type,"-").concat(e.value.columns,"-layout"),value:e.value,onChange:function(e){n({displayProps_mode:e.type,displayProps_columns:e.columns||1})},icon:e.icon,current:{type:t.displayProps_mode,columns:t.displayProps_columns||1}},e.label)}))),p.a.createElement(Tt.PanelBody,{title:Object(b.__)("Color Palette","cloudinary"),initialOpen:!1},p.a.createElement(on,{value:t.themeProps_primary},Object(b.__)("Primary","cloudinary")),p.a.createElement(Dt.ColorPalette,{value:t.themeProps_primary,colors:r,disableCustomColors:!1,onChange:function(e){return n({themeProps_primary:e})}}),p.a.createElement(on,{value:t.themeProps_onPrimary},Object(b.__)("On Primary","cloudinary")),p.a.createElement(Dt.ColorPalette,{value:t.themeProps_onPrimary,colors:r,disableCustomColors:!1,onChange:function(e){return n({themeProps_onPrimary:e})}}),p.a.createElement(on,{value:t.themeProps_active},Object(b.__)("Active","cloudinary")),p.a.createElement(Dt.ColorPalette,{value:t.themeProps_active,colors:r,disableCustomColors:!1,onChange:function(e){return n({themeProps_active:e})}})),"classic"===t.displayProps_mode&&p.a.createElement(Tt.PanelBody,{title:Object(b.__)("Fade Transition","cloudinary"),initialOpen:!1},p.a.createElement(Tt.SelectControl,{value:t.transition,options:Wt,onChange:function(e){return n({transition:e})}})),p.a.createElement(Tt.PanelBody,{title:Object(b.__)("Main Viewer Parameters","cloudinary"),initialOpen:!1},p.a.createElement(Tt.SelectControl,{label:Object(b.__)("Aspect Ratio","cloudinary"),value:t.aspectRatio,options:Ft,onChange:function(e){return n({aspectRatio:e})}}),p.a.createElement("p",null,p.a.createElement(Mt,{content:p.a.createElement("span",null,Object(b.__)("How to resize or crop images to fit the gallery. Pad adds padding around the image using the specified padding style. Fill crops the image from the center so it fills as much of the available space as possible.","cloudinary")),theme:"cloudinary",arrow:!1,placement:"bottom-start"},p.a.createElement("div",{className:"cld-ui-title"},Object(b.__)("Resize/Crop Mode","cloudinary"),p.a.createElement("span",{className:"dashicons dashicons-info cld-tooltip"}))),p.a.createElement(Tt.ButtonGroup,null,Qt.map((function(e){return p.a.createElement(Tt.Button,{key:e.value+"-look-and-feel",isDefault:!0,isPressed:e.value===t.transformation_crop,onClick:function(){return n({transformation_crop:e.value,transformation_background:null})}},e.label)})))),"pad"===t.transformation_crop&&p.a.createElement(Tt.SelectControl,{label:Object(b.__)("Pad style","cloudinary"),value:t.transformation_background,options:en,onChange:function(e){n({transformation_background:e})}}),p.a.createElement("p",null,Object(b.__)("Navigation","cloudinary")),p.a.createElement("p",null,p.a.createElement(Tt.ButtonGroup,null,zt.map((function(e){return p.a.createElement(Tt.Button,{key:e.value+"-navigation",isDefault:!0,isPressed:e.value===t.navigation,onClick:function(){return n({navigation:e.value})}},e.label)})))),p.a.createElement("div",{style:{marginTop:"30px"}},p.a.createElement(Tt.ToggleControl,{label:Object(b.__)("Show Zoom","cloudinary"),checked:t.zoom,onChange:function(){return n({zoom:!t.zoom})}}),t.zoom&&p.a.createElement(p.a.Fragment,null,p.a.createElement("p",null,Object(b.__)("Zoom Type","cloudinary")),p.a.createElement("p",null,p.a.createElement(Tt.ButtonGroup,null,Ht.map((function(e){return p.a.createElement(Tt.Button,{key:e.value+"-zoom-type",isDefault:!0,isPressed:e.value===t.zoomProps_type,onClick:function(){return n({zoomProps_type:e.value})}},e.label)})))),"flyout"===t.zoomProps_type&&p.a.createElement(Tt.SelectControl,{label:Object(b.__)("Zoom Viewer Position","cloudinary"),value:t.zoomProps_viewerPosition,options:Ut,onChange:function(e){return n({zoomProps_viewerPosition:e})}}),"popup"!==t.zoomProps_type&&p.a.createElement(p.a.Fragment,null,p.a.createElement("p",null,Object(b.__)("Zoom Trigger","cloudinary")),p.a.createElement("p",null,p.a.createElement(Tt.ButtonGroup,null,Vt.map((function(e){return p.a.createElement(Tt.Button,{key:e.value+"-zoom-trigger",isDefault:!0,isPressed:e.value===t.zoomProps_trigger,onClick:function(){return n({zoomProps_trigger:e.value})}},e.label)})))))))),p.a.createElement(Tt.PanelBody,{title:Object(b.__)("Carousel Parameters","cloudinary"),initialOpen:!1},p.a.createElement("p",null,Object(b.__)("Carousel Location","cloudinary")),p.a.createElement("p",null,p.a.createElement(Tt.ButtonGroup,null,qt.map((function(e){return p.a.createElement(Tt.Button,{key:e.value+"-carousel-location",isDefault:!0,isPressed:e.value===t.carouselLocation,onClick:function(){return n({carouselLocation:e.value})}},e.label)})))),p.a.createElement(Tt.RangeControl,{label:Object(b.__)("Carousel Offset","cloudinary"),value:t.carouselOffset,onChange:function(e){return n({carouselOffset:e})},min:0,max:100}),p.a.createElement("p",null,Object(b.__)("Carousel Style","cloudinary")),p.a.createElement("p",null,p.a.createElement(Tt.ButtonGroup,null,$t.map((function(e){return p.a.createElement(Tt.Button,{key:e.value+"-carousel-style",isDefault:!0,isPressed:e.value===t.carouselStyle,onClick:function(){return n({carouselStyle:e.value})}},e.label)})))),"thumbnails"===t.carouselStyle&&p.a.createElement(p.a.Fragment,null,p.a.createElement(Tt.RangeControl,{label:Object(b.__)("Width","cloudinary"),value:t.thumbnailProps_width,onChange:function(e){return n({thumbnailProps_width:e})},min:5,max:300}),p.a.createElement(Tt.RangeControl,{label:Object(b.__)("Height","cloudinary"),value:t.thumbnailProps_height,onChange:function(e){return n({thumbnailProps_height:e})},min:5,max:300}),p.a.createElement("p",null,Object(b.__)("Navigation Button Shape","cloudinary")),Gt.map((function(e){return p.a.createElement(rn,{key:e.value+"-navigation-button-shape",value:e.value,onChange:function(e){return n({thumbnailProps_navigationShape:e})},icon:e.icon,current:t.thumbnailProps_navigationShape},e.label)})),p.a.createElement("p",null,Object(b.__)("Selected Style","cloudinary")),p.a.createElement("p",null,p.a.createElement(Tt.ButtonGroup,null,Xt.map((function(e){return p.a.createElement(Tt.Button,{key:e.value+"-selected-style",isDefault:!0,isPressed:e.value===t.thumbnailProps_selectedStyle,onClick:function(){return n({thumbnailProps_selectedStyle:e.value})}},e.label)})))),p.a.createElement(Tt.SelectControl,{label:Object(b.__)("Selected Border Position","cloudinary"),value:t.thumbnailProps_selectedBorderPosition,options:Yt,onChange:function(e){return n({thumbnailProps_selectedBorderPosition:e})}}),p.a.createElement(Tt.RangeControl,{label:Object(b.__)("Selected Border Width","cloudinary"),value:t.thumbnailProps_selectedBorderWidth,onChange:function(e){return n({thumbnailProps_selectedBorderWidth:e})},min:0,max:10}),p.a.createElement("p",null,Object(b.__)("Media Shape Icon","cloudinary")),Kt.map((function(e){return p.a.createElement(rn,{key:e.value+"-media",value:e.value,onChange:function(e){return n({thumbnailProps_mediaSymbolShape:e})},icon:e.icon,current:t.thumbnailProps_mediaSymbolShape},e.label)}))),"indicators"===t.carouselStyle&&p.a.createElement(p.a.Fragment,null,p.a.createElement("p",null,Object(b.__)("Indicators Shape","cloudinary")),Jt.map((function(e){return p.a.createElement(rn,{key:e.value+"-indicator",value:e.value,onChange:function(e){return n({indicatorProps_shape:e})},icon:e.icon,current:t.indicatorProps_shape},e.label)})))),p.a.createElement(Tt.PanelBody,{title:Object(b.__)("Additional Settings","cloudinary"),initialOpen:!1},p.a.createElement(Tt.TextareaControl,{label:Object(b.__)("Custom Settings","cloudinary"),help:Object(b.__)("Provide a JSON string of the settings you want to add and/or override.","cloudinary"),value:i.customSettings,onChange:function(e){try{n({customSettings:JSON.parse(e)})}catch(t){n({customSettings:e})}}})))};n(51);function un(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function sn(e){for(var t=1;t { ? JSON.stringify( nestedAttrs.customSettings ) : nestedAttrs.customSettings; + if ( ! attributes.transformation_crop ) { + attributes.transformation_crop = 'pad'; + attributes.transformation_background = 'rgb:FFFFFF'; + } + + if ( 'fill' === attributes.transformation_crop ) { + delete attributes.transformation_background; + } + return ( <> @@ -144,6 +156,58 @@ const Controls = ( { attributes, setAttributes, colors } ) => { setAttributes( { aspectRatio: value } ) } /> +

    + + { __( + 'How to resize or crop images to fit the gallery. Pad adds padding around the image using the specified padding style. Fill crops the image from the center so it fills as much of the available space as possible.', + 'cloudinary' + ) } + + } + theme={ 'cloudinary' } + arrow={ false } + placement={ 'bottom-start' } + > +

    + { __( 'Resize/Crop Mode', 'cloudinary' ) } + +
    + + + { RESIZE_CROP.map( ( type ) => ( + + ) ) } + +

    + { 'pad' === attributes.transformation_crop && ( + { + setAttributes( { + transformation_background: value, + } ); + } } + /> + ) }

    { __( 'Navigation', 'cloudinary' ) }

    diff --git a/js/src/gallery-block/edit.js b/js/src/gallery-block/edit.js index 8db50ea42..6084f158e 100644 --- a/js/src/gallery-block/edit.js +++ b/js/src/gallery-block/edit.js @@ -41,6 +41,11 @@ const Edit = ( { setAttributes, attributes, className, isSelected } ) => { const [ loading, setLoading ] = useState( false ); const preparedAttributes = useMemo( () => { + // Do not override block settings with defaults on existing ones. + if ( 0 !== attributes.selectedImages.length ) { + return attributes; + } + const defaultAttrs = {}; // eslint-disable-next-line no-unused-vars diff --git a/js/src/gallery-block/options.js b/js/src/gallery-block/options.js index baa60900c..632329f4d 100644 --- a/js/src/gallery-block/options.js +++ b/js/src/gallery-block/options.js @@ -97,6 +97,7 @@ export const CAROUSEL_LOCATION = [ { label: __( 'Left', 'cloudinary' ), value: 'left' }, { label: __( 'Right', 'cloudinary' ), value: 'right' }, { label: __( 'Top', 'cloudinary' ), value: 'top' }, + { label: __( 'Bottom', 'cloudinary' ), value: 'bottom' }, ]; export const CAROUSEL_STYLE = [ @@ -189,3 +190,33 @@ export const MEDIA_ICON_SHAPE = [ label: __( 'Square', 'cloudinary' ), }, ]; + +export const RESIZE_CROP = [ + { + label: __( 'Pad', 'cloudinary' ), + value: 'pad', + }, + { + label: __( 'Fill', 'cloudinary' ), + value: 'fill', + }, +]; + +export const PAD_STYLES = [ + { + label: __( 'White padding', 'cloudinary' ), + value: 'rgb:FFFFFF', + }, + { + label: __( 'Border color padding', 'cloudinary' ), + value: 'auto', + }, + { + label: __( 'Predominant color padding', 'cloudinary' ), + value: 'auto:predominant', + }, + { + label: __( 'Gradient fade padding', 'cloudinary' ), + value: 'auto:predominant_gradient', + }, +]; diff --git a/js/src/gallery-block/utils.js b/js/src/gallery-block/utils.js index 764370e64..c3c26267b 100644 --- a/js/src/gallery-block/utils.js +++ b/js/src/gallery-block/utils.js @@ -71,6 +71,14 @@ export const setupAttributesForRendering = ( attributes ) => { delete config.displayProps.columns; } + if ( 'pad' !== config?.transformation_crop ) { + delete config.transformation_background; + } + + if ( 'pad' !== config?.transformation?.crop ) { + delete config.transformation.background; + } + if ( config.customSettings ) { try { const customSettings = JSON.parse( config.customSettings ); diff --git a/package-lock.json b/package-lock.json index db7f59779..bab0994d5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,6 +13,7 @@ "@babel/plugin-proposal-optional-chaining": "7.12.1", "@babel/polyfill": "7.12.1", "@testing-library/react": "11.1.0", + "@tippyjs/react": "^4.2.4", "@wordpress/api-fetch": "^3.21.1", "@wordpress/block-editor": "5.1.2", "@wordpress/blocks": "6.24.1", @@ -110,8 +111,6 @@ "integrity": "sha512-eRJREyrfAJ2r42Iaxe8h3v6yyj1wu9OyosaUHW6UImjGf9ahGL9nsFNh7OCopvtcPL8WnEo7tp78wrZaZ6vG9g==", "dev": true, "dependencies": { - "@nicolo-ribaudo/chokidar-2": "^2.1.8", - "chokidar": "^3.4.0", "commander": "^4.0.1", "convert-source-map": "^1.1.0", "fs-readdir-recursive": "^1.1.0", @@ -2418,7 +2417,6 @@ "jest-resolve": "^25.5.1", "jest-util": "^25.5.0", "jest-worker": "^25.5.0", - "node-notifier": "^6.0.0", "slash": "^3.0.0", "source-map": "^0.6.0", "string-length": "^3.1.0", @@ -3045,10 +3043,14 @@ } }, "node_modules/@popperjs/core": { - "version": "2.5.4", - "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.5.4.tgz", - "integrity": "sha512-ZpKr+WTb8zsajqgDkvCEWgp6d5eJT6Q63Ng2neTbzBO76Lbe91vX/iVIW9dikq+Fs3yEo+ls4cxeXABD2LtcbQ==", - "dev": true + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.9.1.tgz", + "integrity": "sha512-DvJbbn3dUgMxDnJLH+RZQPnXak1h4ZVYQ7CWiFWjQwBFkVajT4rfw2PdpHLTSTwxrYfnoEXkuBiwkDm6tPMQeA==", + "dev": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/popperjs" + } }, "node_modules/@sinonjs/commons": { "version": "1.8.1", @@ -3379,6 +3381,19 @@ "node": ">=10" } }, + "node_modules/@tippyjs/react": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/@tippyjs/react/-/react-4.2.4.tgz", + "integrity": "sha512-reg/57H/HTrMnu5kkaUMqm5o4242iZw6qEmumCk+BvwJVI+B8JMlSa23MYmS4jTCQauDhTuGivdt+EO+Tt3DQA==", + "dev": true, + "dependencies": { + "tippy.js": "^6.3.1" + }, + "peerDependencies": { + "react": ">=16.8", + "react-dom": ">=16.8" + } + }, "node_modules/@types/anymatch": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/@types/anymatch/-/anymatch-1.3.1.tgz", @@ -5890,7 +5905,6 @@ "integrity": "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==", "dev": true, "dependencies": { - "@types/yauzl": "^2.9.1", "debug": "^4.1.1", "get-stream": "^5.1.0", "yauzl": "^2.10.0" @@ -7441,7 +7455,6 @@ "@types/node": "*", "anymatch": "^3.0.3", "fb-watchman": "^2.0.0", - "fsevents": "^2.1.2", "graceful-fs": "^4.2.4", "jest-regex-util": "^26.0.0", "jest-serializer": "^26.6.2", @@ -10990,18 +11003,18 @@ "dev": true }, "node_modules/elliptic": { - "version": "6.5.3", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz", - "integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==", + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", + "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", "dev": true, "dependencies": { - "bn.js": "^4.4.0", - "brorand": "^1.0.1", + "bn.js": "^4.11.9", + "brorand": "^1.1.0", "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.0" + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" } }, "node_modules/elliptic/node_modules/bn.js": { @@ -11329,8 +11342,7 @@ "esprima": "^4.0.1", "estraverse": "^4.2.0", "esutils": "^2.0.2", - "optionator": "^0.8.1", - "source-map": "~0.6.1" + "optionator": "^0.8.1" }, "bin": { "escodegen": "bin/escodegen.js", @@ -12757,7 +12769,6 @@ "integrity": "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==", "dev": true, "dependencies": { - "@types/yauzl": "^2.9.1", "debug": "^4.1.1", "get-stream": "^5.1.0", "yauzl": "^2.10.0" @@ -14111,7 +14122,6 @@ "dependencies": { "archiver": "^1.3.0", "chalk": "^1.1.1", - "iltorb": "^2.4.3", "lodash": "^4.7.0", "pretty-bytes": "^4.0.2", "stream-buffers": "^2.1.0" @@ -15423,13 +15433,10 @@ "dev": true }, "node_modules/ini": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", - "dev": true, - "engines": { - "node": "*" - } + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true }, "node_modules/inquirer": { "version": "6.5.2", @@ -17405,7 +17412,6 @@ "@types/graceful-fs": "^4.1.2", "anymatch": "^3.0.3", "fb-watchman": "^2.0.0", - "fsevents": "^2.1.2", "graceful-fs": "^4.2.4", "jest-serializer": "^25.5.0", "jest-util": "^25.5.0", @@ -32550,12 +32556,12 @@ } }, "node_modules/tippy.js": { - "version": "6.2.7", - "resolved": "https://registry.npmjs.org/tippy.js/-/tippy.js-6.2.7.tgz", - "integrity": "sha512-k+kWF9AJz5xLQHBi3K/XlmJiyu+p9gsCyc5qZhxxGaJWIW8SMjw1R+C7saUnP33IM8gUhDA2xX//ejRSwqR0tA==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/tippy.js/-/tippy.js-6.3.1.tgz", + "integrity": "sha512-JnFncCq+rF1dTURupoJ4yPie5Cof978inW6/4S6kmWV7LL9YOSEVMifED3KdrVPEG+Z/TFH2CDNJcQEfaeuQww==", "dev": true, "dependencies": { - "@popperjs/core": "^2.4.4" + "@popperjs/core": "^2.8.3" } }, "node_modules/tmp": { @@ -33557,10 +33563,8 @@ "integrity": "sha512-9P3MWk6SrKjHsGkLT2KHXdQ/9SNkyoJbabxnKOoJepsvJjJG8uYTR3yTPxPQvNDI3w4Nz1xnE0TLHK4RIVe/MQ==", "dev": true, "dependencies": { - "chokidar": "^3.4.1", "graceful-fs": "^4.1.2", - "neo-async": "^2.5.0", - "watchpack-chokidar2": "^2.0.1" + "neo-async": "^2.5.0" }, "optionalDependencies": { "chokidar": "^3.4.1", @@ -37099,9 +37103,9 @@ } }, "@popperjs/core": { - "version": "2.5.4", - "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.5.4.tgz", - "integrity": "sha512-ZpKr+WTb8zsajqgDkvCEWgp6d5eJT6Q63Ng2neTbzBO76Lbe91vX/iVIW9dikq+Fs3yEo+ls4cxeXABD2LtcbQ==", + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.9.1.tgz", + "integrity": "sha512-DvJbbn3dUgMxDnJLH+RZQPnXak1h4ZVYQ7CWiFWjQwBFkVajT4rfw2PdpHLTSTwxrYfnoEXkuBiwkDm6tPMQeA==", "dev": true }, "@sinonjs/commons": { @@ -37371,6 +37375,15 @@ "@testing-library/dom": "^7.26.0" } }, + "@tippyjs/react": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/@tippyjs/react/-/react-4.2.4.tgz", + "integrity": "sha512-reg/57H/HTrMnu5kkaUMqm5o4242iZw6qEmumCk+BvwJVI+B8JMlSa23MYmS4jTCQauDhTuGivdt+EO+Tt3DQA==", + "dev": true, + "requires": { + "tippy.js": "^6.3.1" + } + }, "@types/anymatch": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/@types/anymatch/-/anymatch-1.3.1.tgz", @@ -43906,18 +43919,18 @@ "dev": true }, "elliptic": { - "version": "6.5.3", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz", - "integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==", + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", + "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", "dev": true, "requires": { - "bn.js": "^4.4.0", - "brorand": "^1.0.1", + "bn.js": "^4.11.9", + "brorand": "^1.1.0", "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.0" + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" }, "dependencies": { "bn.js": { @@ -47514,9 +47527,9 @@ "dev": true }, "ini": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", "dev": true }, "inquirer": { @@ -61577,12 +61590,12 @@ "dev": true }, "tippy.js": { - "version": "6.2.7", - "resolved": "https://registry.npmjs.org/tippy.js/-/tippy.js-6.2.7.tgz", - "integrity": "sha512-k+kWF9AJz5xLQHBi3K/XlmJiyu+p9gsCyc5qZhxxGaJWIW8SMjw1R+C7saUnP33IM8gUhDA2xX//ejRSwqR0tA==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/tippy.js/-/tippy.js-6.3.1.tgz", + "integrity": "sha512-JnFncCq+rF1dTURupoJ4yPie5Cof978inW6/4S6kmWV7LL9YOSEVMifED3KdrVPEG+Z/TFH2CDNJcQEfaeuQww==", "dev": true, "requires": { - "@popperjs/core": "^2.4.4" + "@popperjs/core": "^2.8.3" } }, "tmp": { diff --git a/package.json b/package.json index c7aabbdcc..2df4f364e 100644 --- a/package.json +++ b/package.json @@ -49,6 +49,7 @@ "@babel/plugin-proposal-optional-chaining": "7.12.1", "@babel/polyfill": "7.12.1", "@testing-library/react": "11.1.0", + "@tippyjs/react": "^4.2.4", "@wordpress/api-fetch": "^3.21.1", "@wordpress/block-editor": "5.1.2", "@wordpress/blocks": "6.24.1", diff --git a/php/class-media.php b/php/class-media.php index 0a3505aba..86f3d6f55 100644 --- a/php/class-media.php +++ b/php/class-media.php @@ -158,6 +158,7 @@ public function get_compatible_media_types() { 'video', 'audio', 'application', + 'text', ); /** @@ -170,6 +171,25 @@ public function get_compatible_media_types() { return apply_filters( 'cloudinary_media_types', $media_types ); } + /** + * Get an array of syncable delivery types. + * + * @return array + */ + public function get_syncable_delivery_types() { + $types = array( + 'upload', + ); + + /** + * Filter the delivery types that are able to sync. + * + * @param array $types The default syncable types. + * + * @return array + */ + return apply_filters( 'cloudinary_syncable_delivery_types', $types ); + } /** * Get convertible extensions and converted file types. * @@ -208,7 +228,7 @@ public function get_convertible_extensions() { } /** - * Check if a file type is compatibile with Cloudinary & WordPress. + * Check if a file type is compatible with Cloudinary & WordPress. * * @param string $file The file to check. * @@ -223,7 +243,7 @@ public function is_file_compatible( $file ) { $conversions = $this->get_convertible_extensions(); $convertibles = array_keys( $conversions ); - return in_array( $type, $types, true ) && ! in_array( $mime['ext'], $convertibles ); + return in_array( $type, $types, true ) && ! in_array( $mime['ext'], $convertibles, true ); } /** @@ -235,15 +255,46 @@ public function is_file_compatible( $file ) { */ public function is_media( $attachment_id ) { $is_media = false; - if ( 'attachment' === get_post_type( $attachment_id ) && wp_get_attachment_metadata( $attachment_id ) ) { + if ( 'attachment' === get_post_type( $attachment_id ) ) { $media_types = $this->get_compatible_media_types(); $type = $this->get_media_type( $attachment_id ); - $is_media = in_array( $type, $media_types ); + $is_media = in_array( $type, $media_types, true ); } return $is_media; } + /** + * Check if the attachment is local. + * + * @param int $attachment_id The attachment ID to check. + * + * @return bool + */ + public function is_local_media( $attachment_id ) { + $local_host = wp_parse_url( get_site_url(), PHP_URL_HOST ); + $media_host = wp_parse_url( get_the_guid( $attachment_id ), PHP_URL_HOST ); + + return $local_host === $media_host; + } + + /** + * Get the Cloudinary delivery type. + * + * @param int $attachment_id The attachment ID. + * + * @return string + */ + public function get_media_delivery( $attachment_id ) { + $delivery = $this->get_post_meta( $attachment_id, Sync::META_KEYS['delivery'], true ); + + if ( ! empty( $delivery ) ) { + return $delivery; + } + + return 'upload'; + } + /** * Convert media extension. * @@ -316,6 +367,41 @@ public function get_media_type( $attachment_id ) { return $this->get_file_type( get_attached_file( $attachment_id ) ); } + /** + * Get the resource type. + * + * @param int $attachment_id The attachment ID. + * + * @return string + */ + public function get_resource_type( $attachment_id ) { + $media_type = $this->get_media_type( $attachment_id ); + + switch ( $media_type ) { + case 'application': + case 'text': + $type = 'raw'; + break; + + case 'audio': + $type = 'video'; + break; + + default: + $type = $media_type; + } + + /** + * Filter the Cloudinary resource type for the attachment. + * + * @param string $type The type. + * @param int $attachment_id The attachment ID. + */ + $type = apply_filters( 'cloudinary_resource_type', $type, $attachment_id ); + + return $type; + } + /** * Remove the crop size from a url. * @@ -525,7 +611,14 @@ public function get_crop( $url, $attachment_id ) { $additional_sizes = wp_get_additional_image_sizes(); foreach ( $meta['sizes'] as $size_name => $size ) { if ( $file === $size['file'] ) { - $cropped = ! wp_image_matches_ratio( $meta['width'], $meta['height'], $size['width'], $size['height'] ); + $cropped = ! wp_image_matches_ratio( + // PDFs do not always have width and height, but they do have full sizes. + // This is important for the thumbnail crops on the media library. + ! empty( $meta['width'] ) ? $meta['width'] : $meta['sizes']['full']['width'], + ! empty( $meta['height'] ) ? $meta['height'] : $meta['sizes']['full']['height'], + $size['width'], + $size['height'] + ); if ( isset( $additional_sizes[ $size_name ]['crop'] ) ) { $cropped = $additional_sizes[ $size_name ]['crop']; } @@ -589,6 +682,40 @@ public function get_transformation( $transformations, $type ) { return false; } + /** + * Get transformations for an attachment to use in a final URL. + * + * @param int $attachment_id The attachment ID. + * @param array $transformations Base/starter set of transformations. + * @param bool $overwrite_transformations Flag to indicate if default transformations should not be applied. + * + * @return array + */ + public function get_transformations( $attachment_id, $transformations = array(), $overwrite_transformations = false ) { + // If not provided, get transformations from the attachment meta. + if ( empty( $transformations ) ) { + $transformations = $this->get_transformation_from_meta( $attachment_id ); + } + if ( false === $overwrite_transformations ) { + $overwrite_transformations = $this->maybe_overwrite_featured_image( $attachment_id ); + } + + // Defaults are only to be added on front, main images ( not breakpoints, since these are adapted down), and videos. + if ( false === $overwrite_transformations && ! is_admin() ) { + $transformations = $this->apply_default_transformations( $transformations, $attachment_id ); + } + + /** + * Filter the Cloudinary transformations. + * + * @param array $transformations Array of transformation options. + * @param int $attachment_id The id of the asset. + * + * @return array + */ + return apply_filters( 'cloudinary_transformations', $transformations, $attachment_id ); + } + /** * Extract the crop size part of a transformation that was done in the DAM widget. * @@ -698,13 +825,24 @@ public function attachment_url( $url, $attachment_id ) { /** * Apply default image transformations before building the URL. * - * @param array $transformations The set of transformations. - * @param string $type Default transformations type. + * @param array $transformations The set of transformations. + * @param int $attachment_id The attachment ID. * * @return array */ - public function apply_default_transformations( array $transformations, $type = 'image' ) { - + public function apply_default_transformations( array $transformations, $attachment_id ) { + /** + * Filter to allow bypassing defaults. Return false to not apply defaults. + * + * @param bool $true True to apply defaults. + * @param int $attachment_id The current attachment ID. + * + * @return bool + */ + if ( false === apply_filters( 'cloudinary_apply_default_transformations', true, $attachment_id ) ) { + return $transformations; + } + $type = $this->get_media_type( $attachment_id ); // Base image level. $new_transformations = array( 'image' => Api::generate_transformation_string( $transformations, $type ), @@ -806,10 +944,10 @@ public function default_image_freeform_transformations( $default ) { /** * Generate a Cloudinary URL based on attachment ID and required size. * - * @param int $attachment_id The id of the attachment. - * @param array|string $size The wp size to set for the URL. - * @param array $transformations Set of transformations to apply to this url. - * @param string $cloudinary_id Optional forced cloudinary ID. + * @param int $attachment_id The id of the attachment. + * @param array|string $size The wp size to set for the URL. + * @param array $transformations Set of transformations to apply to this url. + * @param string $cloudinary_id Optional forced cloudinary ID. * @param bool $overwrite_transformations Flag url is a breakpoint URL to stop re-applying default transformations. * * @return string The converted URL. @@ -821,44 +959,30 @@ public function cloudinary_url( $attachment_id, $size = array(), $transformation return null; } } - if ( empty( $transformations ) ) { - $transformations = $this->get_transformation_from_meta( $attachment_id ); - } + // Get the attachment resource type. - $resource_type = $this->get_media_type( $attachment_id ); + $resource_type = $this->get_resource_type( $attachment_id ); // Setup initial args for cloudinary_url. + $delivery = $this->get_media_delivery( $attachment_id ); $pre_args = array( 'secure' => is_ssl(), 'version' => $this->get_cloudinary_version( $attachment_id ), 'resource_type' => $resource_type, + 'delivery_type' => $delivery, ); - - $size = $this->prepare_size( $attachment_id, $size ); - if ( false === $overwrite_transformations ) { - $overwrite_transformations = $this->maybe_overwrite_featured_image( $attachment_id ); - } - /** - * Filter the Cloudinary transformations. - * - * @param array $transformations Array of transformation options. - * @param int $attachment_id The id of the asset. - * - * @return array - */ - $pre_args['transformation'] = apply_filters( 'cloudinary_transformations', $transformations, $attachment_id ); - $apply_default_transformations = apply_filters( 'cloudinary_apply_default_transformations', true ); - - // Defaults are only to be added on front, main images ( not breakpoints, since these are adapted down), and videos. - if ( true === $apply_default_transformations && false === $overwrite_transformations && ! is_admin() ) { - $pre_args['transformation'] = $this->apply_default_transformations( $pre_args['transformation'], $resource_type ); + $set_size = array(); + if ( 'upload' === $delivery ) { + $set_size = $this->prepare_size( $attachment_id, $size ); } + // Prepare transformations. + $pre_args['transformation'] = $this->get_transformations( $attachment_id, $transformations, $overwrite_transformations ); // Make a copy as not to destroy the options in \Cloudinary::cloudinary_url(). $args = $pre_args; - $url = $this->plugin->components['connect']->api->cloudinary_url( $cloudinary_id, $args, $size ); + $url = $this->plugin->components['connect']->api->cloudinary_url( $cloudinary_id, $args, $set_size ); // Check if this type is a preview only type. i.e PDF. - if ( ! empty( $size ) && $this->is_preview_only( $attachment_id ) ) { + if ( ! empty( $set_size ) && $this->is_preview_only( $attachment_id ) ) { $url = $this->convert_media_extension( $url ); } @@ -909,6 +1033,16 @@ public function prepare_size( $attachment_id, $size ) { } } + /** + * Filter Cloudinary size and crops + * + * @param array|string $size The size array or slug. + * @param int $attachment_id The attachment ID. + * + * @return array|string + */ + $size = apply_filters( 'cloudinary_prepare_size', $size, $attachment_id ); + return $size; } @@ -958,7 +1092,7 @@ public function get_cloudinary_folder( $add_trailing_slash = true ) { public function get_public_id( $attachment_id, $suffixed = false ) { // Check for a public_id. if ( $this->has_public_id( $attachment_id ) ) { - $public_id = $this->get_post_meta( $attachment_id, Sync::META_KEYS['public_id'], true ); + $public_id = get_post_meta( $attachment_id, Sync::META_KEYS['public_id'], true ); if ( $this->is_folder_synced( $attachment_id ) ) { $public_id = $this->get_cloudinary_folder() . pathinfo( $public_id, PATHINFO_BASENAME ); } @@ -980,7 +1114,7 @@ public function get_public_id( $attachment_id, $suffixed = false ) { * @return bool */ public function has_public_id( $attachment_id ) { - return ! empty( $this->get_post_meta( $attachment_id, Sync::META_KEYS['public_id'], true ) ); + return ! empty( get_post_meta( $attachment_id, Sync::META_KEYS['public_id'], true ) ); } /** @@ -995,9 +1129,7 @@ public function get_cloudinary_id( $attachment_id ) { $cloudinary_id = null; // A cloudinary_id is a public_id with a file extension. if ( $this->has_public_id( $attachment_id ) ) { - $public_id = $this->get_post_meta( $attachment_id, Sync::META_KEYS['public_id'], true ); - // Since this is based on saved and not a dynamic, append a suffix. - $public_id .= $this->get_post_meta( $attachment_id, Sync::META_KEYS['suffix'], true ); + $public_id = $this->get_public_id( $attachment_id, true ); // Get the file, and use the same extension. $file = get_attached_file( $attachment_id ); // @todo: Make this use the globals, overrides, and application conversion. @@ -1284,7 +1416,7 @@ public function editor_assets() { /** * Create a new attachment post item. * - * @param array $asset The asset arrah data. + * @param array $asset The asset array data. * @param string $public_id The cloudinary public id. * * @return int|\WP_Error @@ -1309,23 +1441,24 @@ private function create_attachment( $asset, $public_id ) { $sync_key = $asset['sync_key']; // Capture public_id. Use core update_post_meta since this attachment data doesnt exist yet. - update_post_meta( $attachment_id, Sync::META_KEYS['public_id'], $public_id ); + $this->update_post_meta( $attachment_id, Sync::META_KEYS['public_id'], $public_id ); // Capture version number. - update_post_meta( $attachment_id, Sync::META_KEYS['version'], $asset['version'] ); + $this->update_post_meta( $attachment_id, Sync::META_KEYS['version'], $asset['version'] ); if ( ! empty( $asset['transformations'] ) ) { // Save a combined key. $sync_key .= wp_json_encode( $asset['transformations'] ); - update_post_meta( $attachment_id, Sync::META_KEYS['transformation'], $asset['transformations'] ); + $this->update_post_meta( $attachment_id, Sync::META_KEYS['transformation'], $asset['transformations'] ); } // create a trackable key in post meta. update_post_meta( $attachment_id, '_' . md5( $sync_key ), true ); // record a base to ensure primary isn't deleted. update_post_meta( $attachment_id, '_' . md5( 'base_' . $public_id ), true ); - + // capture the delivery type. + $this->update_post_meta( $attachment_id, Sync::META_KEYS['delivery'], $asset['type'] ); // Capture the ALT Text. if ( ! empty( $asset['meta']['alt'] ) ) { $alt_text = wp_strip_all_tags( $asset['meta']['alt'] ); - update_post_meta( $attachment_id, '_wp_attachment_image_alt', $alt_text ); + $this->update_post_meta( $attachment_id, '_wp_attachment_image_alt', $alt_text ); } return $attachment_id; @@ -1369,6 +1502,7 @@ public function get_asset_payload() { $asset = array( 'version' => (int) filter_var( $data['asset']['version'], FILTER_SANITIZE_NUMBER_INT ), 'public_id' => filter_var( $data['asset']['public_id'], FILTER_SANITIZE_STRING ), + 'type' => filter_var( $data['asset']['type'], FILTER_SANITIZE_STRING ), 'format' => filter_var( $data['asset']['format'], FILTER_SANITIZE_STRING ), 'src' => filter_var( $data['asset']['secure_url'], FILTER_SANITIZE_URL ), 'url' => filter_var( $data['asset']['secure_url'], FILTER_SANITIZE_URL ), @@ -1510,7 +1644,7 @@ public function media_column( $cols ) { */ public function media_column_value( $column_name, $attachment_id ) { if ( 'cld_status' === $column_name ) { - if ( $this->is_media( $attachment_id ) ) { + if ( $this->is_media( $attachment_id ) && $this->is_local_media( $attachment_id ) ) : $status = array( 'state' => 'inactive', 'note' => esc_html__( 'Not Synced', 'cloudinary' ), @@ -1538,7 +1672,12 @@ public function media_column_value( $column_name, $attachment_id ) { ?> is_local_media( $attachment_id ) ) : + ?> + + build_cached_meta( $post_id, $key, $single ); @@ -1710,8 +1852,6 @@ public function delete_post_meta( $post_id, $key ) { unset( $meta_data[ Sync::META_KEYS['cloudinary'] ][ $key ] ); wp_update_attachment_metadata( $post_id, $meta_data ); } - // Delete meta data. - delete_post_meta( $post_id, $key ); } /** @@ -1843,7 +1983,7 @@ public function get_upload_options( $attachment_id ) { $options = array( 'unique_filename' => true, 'overwrite' => false, - 'resource_type' => $this->get_media_type( $attachment_id ), + 'resource_type' => $this->get_resource_type( $attachment_id ), 'public_id' => basename( $public_id ), 'context' => $this->get_context_options( $attachment_id ), ); @@ -1985,6 +2125,48 @@ public function can_filter_out_local() { return $can; } + /** + * Filters the new sizes to ensure non upload (sprites), don't get resized. + * + * @param array $new_sizes Array of sizes. + * @param array $image_meta Image metadata. + * @param int $attachment_id The attachment ID. + * + * @return array + */ + public function manage_sizes( $new_sizes, $image_meta, $attachment_id ) { + + if ( $this->has_public_id( $attachment_id ) ) { + // Get delivery type. + $delivery = $this->get_media_delivery( $attachment_id ); + if ( 'upload' !== $delivery ) { + // Only upload based deliveries will get intermediate sizes. + $new_sizes = array(); + } + } + + return $new_sizes; + } + + /** + * Fix the PDF resource type. + * + * @link https://cloudinary.com/cookbook/convert_pdf_to_jpg + * + * @param string $type The default type. + * @param int $attachment_id The attachment ID. + * + * @return string + **/ + public function pdf_resource_type( $type, $attachment_id ) { + + if ( 'application/pdf' === get_post_mime_type( $attachment_id ) ) { + $type = 'image'; + } + + return $type; + } + /** * Setup the hooks and base_url if configured. */ @@ -2031,6 +2213,12 @@ public function setup() { // Filter and action the custom column. add_filter( 'manage_media_columns', array( $this, 'media_column' ) ); add_action( 'manage_media_custom_column', array( $this, 'media_column_value' ), 10, 2 ); + + // Handle other delivery types. + add_filter( 'intermediate_image_sizes_advanced', array( $this, 'manage_sizes' ), PHP_INT_MAX, 3 ); // High level to avoid other plugins breaking it. + + // Filter PDF resource type. + add_filter( 'cloudinary_resource_type', array( $this, 'pdf_resource_type' ), 10, 2 ); } } diff --git a/php/class-plugin.php b/php/class-plugin.php index ec57135b8..131df9aa7 100644 --- a/php/class-plugin.php +++ b/php/class-plugin.php @@ -127,13 +127,13 @@ public function __construct() { * that extend the Customizer to ensure resources are available in time. */ public function init() { - $this->components['connect'] = new Connect( $this ); $this->components['deactivation'] = new Deactivation( $this ); $this->components['sync'] = new Sync( $this ); $this->components['media'] = new Media( $this ); $this->components['api'] = new REST_API( $this ); $this->components['storage'] = new Storage( $this ); + $this->components['report'] = new Report( $this ); } /** @@ -141,7 +141,7 @@ public function init() { * * @param mixed $component The component. * - * @return Connect|Media|REST_API|Settings_Page|Sync|null + * @return Report|Connect|Media|REST_API|Settings_Page|Sync|null */ public function get_component( $component ) { $return = null; diff --git a/php/class-report.php b/php/class-report.php new file mode 100644 index 000000000..71f3ca52d --- /dev/null +++ b/php/class-report.php @@ -0,0 +1,252 @@ +get_report_items(); + foreach ( $post_ids as $id ) { + if ( ! in_array( $id, $items, true ) ) { + $items[] = (int) $id; + } + } + update_option( self::REPORT_KEY, $items, false ); + } + + return $location; + } + + /** + * Add an inline action for adding to report. + * + * @param array $actions All actions. + * @param WP_Post $post The current post object. + * + * @return array + */ + public function add_inline_action( $actions, $post ) { + + if ( 'on' === $this->settings->get_value( 'enable_report' ) ) { + + $screen = get_current_screen(); + + if ( in_array( $post->ID, $this->get_report_items(), true ) ) { + $actions['cloudinary-report'] = esc_html__( 'Added to the Cloudinary Report.', 'cloudinary' ); + } else { + if ( $screen && 'upload' === $screen->id ) { + + $args = array( + 'action' => 'cloudinary-report', + 'media[]' => $post->ID, + '_wpnonce' => wp_create_nonce( 'bulk-media' ), + ); + + } else { + $args = array( + 'action' => 'cloudinary-report', + 'post[]' => $post->ID, + '_wpnonce' => wp_create_nonce( 'bulk-posts' ), + ); + } + $action_url = add_query_arg( $args, '' ); + $title = esc_html__( 'Add to Cloudinary Report', 'cloudinary' ); + $actions['cloudinary-report'] = sprintf( + '%2$s', + $action_url, + $title + ); + } + } + + return $actions; + } + + /** + * Setup the component. + */ + public function setup() { + if ( 'on' === $this->settings->get_value( 'enable_report' ) ) { + add_action( 'add_meta_boxes', array( $this, 'image_meta_viewer' ) ); + } + } + + /** + * Init the report by clearing and preparing the report options. + * + * @param mixed $new_value The new value. + * + * @return mixed + */ + public function init_reporting( $new_value ) { + delete_option( self::REPORT_KEY ); + + return $new_value; + } + + /** + * Add Meta view meta box. + */ + public function image_meta_viewer() { + $screen = get_current_screen(); + if ( ! $screen instanceof WP_Screen || 'attachment' !== $screen->id ) { + return; + } + + add_meta_box( + 'meta-viewer', + __( 'Cloudinary Metadata viewer', 'cloudinary' ), + array( $this, 'render' ) + ); + } + + /** + * Render the metabox content. + * + * @param WP_Post $post The post. + */ + public function render( $post ) { + if ( 'attachment' === $post->post_type ) { + $meta = wp_get_attachment_metadata( $post->ID ); + + $args = array( + 'type' => 'tag', + 'element' => 'pre', + 'attributes' => array( + 'style' => 'overflow:auto;', + ), + 'content' => wp_json_encode( $meta, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES ), + ); + $this->settings->create_setting( 'meta_viewer', $args )->get_component()->render( true ); + } + } + + /** + * Get the settings structure. + * + * @return array + */ + public function settings() { + return array( + 'type' => 'page', + 'menu_title' => __( 'System Report', 'cloudinary' ), + 'tabs' => array( + 'setup' => array( + 'page_title' => __( 'System Report', 'cloudinary' ), + array( + 'type' => 'panel', + 'title' => __( 'System information report', 'cloudinary' ), + array( + 'title' => __( 'Enable report', 'cloudinary' ), + 'type' => 'on_off', + 'slug' => 'enable_report', + ), + array( + 'type' => 'tag', + 'element' => 'div', + 'content' => $this->get_report_body(), + 'enabled' => function () { + $enabled = get_plugin_instance()->settings->get_value( 'enable_report' ); + return 'on' !== $enabled; + }, + ), + array( + 'type' => 'system', + 'enabled' => function () { + $enabled = get_plugin_instance()->settings->get_value( 'enable_report' ); + return 'on' === $enabled; + }, + ), + ), + array( + 'type' => 'submit', + ), + ), + ), + ); + } + + /** + * Get items ID that are part of the report. + * + * @return array + */ + public function get_report_items() { + static $items; + + if ( is_null( $items ) ) { + $items = get_option( self::REPORT_KEY, array() ); + } + + return $items; + } + + /** + * Get the message for disabled report. + * + * @return string + */ + protected function get_report_body() { + ob_start(); + esc_attr_e( 'Enabling system information reporting will allow you to generate and download a realtime snapshot report. The report will be in JSON format and will include information about:', 'cloudinary' ); + ?> +

      +
    • +
    • +
    • +
    • +
    • +
    + '_cloudinary_version', 'plugin_version' => '_plugin_version', 'breakpoints' => '_cloudinary_breakpoints', + 'delivery' => '_cloudinary_delivery', 'public_id' => '_public_id', 'transformation' => '_transformations', 'sync_error' => '_sync_error', @@ -238,6 +239,21 @@ public function can_sync( $attachment_id, $type = 'file' ) { $can = true; } + if ( ! $this->managers['media']->is_local_media( $attachment_id ) ) { + $can = false; + } + + // Can sync only syncable delivery types. + if ( + ! in_array( + $this->managers['media']->get_media_delivery( $attachment_id ), + $this->managers['media']->get_syncable_delivery_types(), + true + ) + ) { + $can = false; + } + /** * Filter to allow changing if an asset is allowed to be synced. * Return a WP Error with reason why it can't be synced. @@ -361,7 +377,7 @@ public function register_sync_type( $type, $structure ) { public function setup_sync_base_struct() { $base_struct = array( - 'upgrade' => array( + 'upgrade' => array( 'generate' => array( $this, 'get_sync_version' ), // Method to generate a signature. 'validate' => array( $this, 'been_synced' ), 'priority' => 0, @@ -370,7 +386,7 @@ public function setup_sync_base_struct() { 'note' => __( 'Upgrading from previous version', 'cloudinary' ), 'realtime' => true, ), - 'download' => array( + 'download' => array( 'generate' => '__return_false', 'validate' => function ( $attachment_id ) { $file = get_attached_file( $attachment_id ); @@ -382,7 +398,7 @@ public function setup_sync_base_struct() { 'state' => 'info downloading', 'note' => __( 'Downloading from Cloudinary', 'cloudinary' ), ), - 'file' => array( + 'file' => array( 'generate' => array( $this, 'generate_file_signature' ), 'priority' => 5.1, 'sync' => array( $this->managers['upload'], 'upload_asset' ), @@ -393,7 +409,7 @@ public function setup_sync_base_struct() { 'note' => __( 'Uploading to Cloudinary', 'cloudinary' ), 'required' => true, // Required to complete URL render flag. ), - 'folder' => array( + 'folder' => array( 'generate' => array( $this->managers['media'], 'get_cloudinary_folder' ), 'validate' => array( $this->managers['media'], 'is_folder_synced' ), 'priority' => 10, @@ -408,7 +424,7 @@ public function setup_sync_base_struct() { }, 'required' => true, // Required to complete URL render flag. ), - 'public_id' => array( + 'public_id' => array( 'generate' => array( $this->managers['media'], 'get_public_id' ), 'validate' => function ( $attachment_id ) { $public_id = $this->managers['media']->has_public_id( $attachment_id ); @@ -421,21 +437,26 @@ public function setup_sync_base_struct() { 'note' => __( 'Updating metadata', 'cloudinary' ), 'required' => true, ), - 'breakpoints' => array( + 'breakpoints' => array( 'generate' => array( $this->managers['media'], 'get_breakpoint_options' ), 'priority' => 25, 'sync' => array( $this->managers['upload'], 'explicit_update' ), + 'validate' => function ( $attachment_id ) { + $delivery = $this->managers['media']->get_post_meta( $attachment_id, self::META_KEYS['delivery'] ); + + return empty( $delivery ) || 'upload' === $delivery; + }, 'state' => 'info syncing', 'note' => __( 'Updating breakpoints', 'cloudinary' ), ), - 'options' => array( + 'options' => array( 'generate' => array( $this->managers['media'], 'get_upload_options' ), 'priority' => 30, 'sync' => array( $this->managers['upload'], 'context_update' ), 'state' => 'info syncing', 'note' => __( 'Updating metadata', 'cloudinary' ), ), - 'cloud_name' => array( + 'cloud_name' => array( 'generate' => array( $this->managers['connect'], 'get_cloud_name' ), 'priority' => 5.5, 'sync' => array( $this->managers['upload'], 'upload_asset' ), @@ -443,6 +464,34 @@ public function setup_sync_base_struct() { 'note' => __( 'Uploading to new cloud name.', 'cloudinary' ), 'required' => true, ), + 'meta_cleanup' => array( + 'generate' => function ( $attachment_id ) { + $meta = $this->managers['media']->get_post_meta( $attachment_id ); + $return = false; + foreach ( $meta as $key => $value ) { + if ( get_post_meta( $attachment_id, $key, true ) === $value ) { + $return = true; + break; + } + } + + return $return; + }, + 'priority' => 100, // Always be the highest. + 'sync' => function ( $attachment_id ) { + $meta = $this->managers['media']->get_post_meta( $attachment_id ); + foreach ( $meta as $key => $value ) { + if ( self::META_KEYS['public_id'] === $key ) { + $this->managers['media']->delete_post_meta( $attachment_id, $key ); + continue; + } + delete_post_meta( $attachment_id, $key, $value ); + } + $this->set_signature_item( $attachment_id, 'meta_cleanup' ); + }, + 'required' => true, + 'realtime' => true, + ), ); /** @@ -771,24 +820,14 @@ public function sync_signature_by_type( $attachment_id, $type ) { public function set_signature_item( $attachment_id, $type, $value = null ) { // Get the core meta. - $meta = wp_get_attachment_metadata( $attachment_id, true ); - if ( ! is_array( $meta ) ) { - $meta = array(); - } - if ( empty( $meta[ self::META_KEYS['cloudinary'] ] ) ) { - $meta[ self::META_KEYS['cloudinary'] ] = array(); - } + $meta = (array) $this->managers['media']->get_post_meta( $attachment_id, self::META_KEYS['signature'], true ); // Set the specific value. if ( is_null( $value ) ) { // Generate a new value based on generator. $value = $this->generate_type_signature( $type, $attachment_id ); } - // Ensure we have an array. - if ( empty( $meta[ self::META_KEYS['cloudinary'] ][ self::META_KEYS['signature'] ] ) || ! is_array( $meta[ self::META_KEYS['cloudinary'] ][ self::META_KEYS['signature'] ] ) ) { - $meta[ self::META_KEYS['cloudinary'] ][ self::META_KEYS['signature'] ] = array(); - } - $meta[ self::META_KEYS['cloudinary'] ][ self::META_KEYS['signature'] ][ $type ] = $value; - wp_update_attachment_metadata( $attachment_id, $meta ); + $meta[ $type ] = $value; + $this->managers['media']->update_post_meta( $attachment_id, self::META_KEYS['signature'], $meta ); } /** @@ -831,6 +870,24 @@ public function is_auto_sync_enabled() { return false; } + /** + * Delete Cloudinary meta for the attachment ID. + * + * @param int $attachment_id The attachment ID. + */ + public function delete_cloudinary_meta( $attachment_id ) { + // Update attachment meta. + $meta = wp_get_attachment_metadata( $attachment_id, true ); + unset( $meta[ self::META_KEYS['cloudinary'] ] ); + wp_update_attachment_metadata( $attachment_id, $meta ); + + // Cleanup postmeta. + $queued = get_post_meta( $attachment_id, self::META_KEYS['queued'] ); + delete_post_meta( $attachment_id, self::META_KEYS['pending'] ); + delete_post_meta( $attachment_id, self::META_KEYS['queued'] ); + delete_post_meta( $attachment_id, $queued ); + } + /** * Additional component setup. */ @@ -880,7 +937,10 @@ public function settings() { array( 'type' => 'radio', 'title' => __( 'Sync method', 'cloudinary' ), - 'tooltip_text' => __( 'Auto sync: Ensures that all of your WordPress assets are automatically synced with Cloudinary when they are added to the WordPress Media Library. Manual sync: Assets must be synced manually using the WordPress Media Library', 'cloudinary' ), + 'tooltip_text' => __( + 'Auto sync: Ensures that all of your WordPress assets are automatically synced with Cloudinary when they are added to the WordPress Media Library. Manual sync: Assets must be synced manually using the WordPress Media Library', + 'cloudinary' + ), 'slug' => 'auto_sync', 'no_cached' => true, 'default' => 'on', diff --git a/php/class-utils.php b/php/class-utils.php index 7522e1248..4be4688d9 100644 --- a/php/class-utils.php +++ b/php/class-utils.php @@ -62,6 +62,7 @@ public static function get_active_setting() { * * @param array $input The array that will be processed. * @param string $separator Separator string. + * * @return array */ public static function expand_dot_notation( array $input, $separator = '.' ) { @@ -105,4 +106,27 @@ public static function is_amp( $html_string ) { public static function is_webstory_post_type( $post_type ) { return class_exists( Story_Post_Type::class ) && Story_Post_Type::POST_TYPE_SLUG === $post_type; } + + /** + * Get all the attributes from an HTML tag. + * + * @param string $tag HTML tag to get attributes from. + * + * @return array + */ + public static function get_tag_attributes( $tag ) { + $tag = strstr( $tag, ' ', false ); + $tag = trim( $tag, '> ' ); + $args = shortcode_parse_atts( $tag ); + $return = array(); + foreach ( $args as $key => $value ) { + if ( is_int( $key ) ) { + $return[ $value ] = 'true'; + continue; + } + $return[ $key ] = $value; + } + + return $return; + } } diff --git a/php/connect/class-api.php b/php/connect/class-api.php index 98ac66da0..cc66d1094 100644 --- a/php/connect/class-api.php +++ b/php/connect/class-api.php @@ -172,7 +172,7 @@ public function url( $resource, $function = null, $endpoint = false ) { $parts[] = $this->credentials['cloud_name']; } - if ( false === $endpoint && 'image' === $resource ) { + if ( false === $endpoint && 'image' === $resource && 'upload' === $function ) { $parts[] = 'images'; } else { $parts[] = $resource; @@ -242,8 +242,6 @@ public function cloudinary_url( $public_id = null, $args = array(), $size = arra 'version' => 'v1', ); $args = wp_parse_args( array_filter( $args ), $defaults ); - // Correct Audio to Video. - $args['resource_type'] = $this->convert_resource_type( $args['resource_type'] ); // check for version. if ( ! empty( $args['version'] ) && is_numeric( $args['version'] ) ) { @@ -252,7 +250,7 @@ public function cloudinary_url( $public_id = null, $args = array(), $size = arra // Determine if we're dealing with a fetched. // ...or uploaded image and update the URL accordingly. - $asset_endpoint = filter_var( $public_id, FILTER_VALIDATE_URL ) ? 'fetch' : 'upload'; + $asset_endpoint = filter_var( $public_id, FILTER_VALIDATE_URL ) ? 'fetch' : $args['delivery_type']; $url_parts = array( 'https:/', @@ -263,7 +261,8 @@ public function cloudinary_url( $public_id = null, $args = array(), $size = arra $url_parts[] = self::generate_transformation_string( $args['transformation'], $args['resource_type'] ); } $base = pathinfo( $public_id ); - if ( 'image' === $args['resource_type'] ) { + // Only do dynamic naming and sizes if upload type. + if ( 'image' === $args['resource_type'] && 'upload' === $args['delivery_type'] ) { $new_path = $base['filename'] . '/' . $base['basename']; $public_id = str_replace( $base['basename'], $new_path, $public_id ); } @@ -285,26 +284,6 @@ public function cloudinary_url( $public_id = null, $args = array(), $size = arra return implode( '/', $url_parts ); } - /** - * Convert the resource type into the usable Cloudinary type. - * - * @param string $type The type to convert. - * - * @return string - */ - public function convert_resource_type( $type ) { - $convert_resource_type = array( - 'application' => 'image', - 'audio' => 'video', - ); - - if ( isset( $convert_resource_type[ $type ] ) ) { - $type = $convert_resource_type[ $type ]; - } - - return $type; - } - /** * Get the details of an asset by public ID. * @@ -406,7 +385,6 @@ public function upload_large( $attachment_id, $args ) { public function upload( $attachment_id, $args, $headers = array(), $try_remote = true ) { $resource = ! empty( $args['resource_type'] ) ? $args['resource_type'] : 'image'; - $resource = $this->convert_resource_type( $resource ); $url = $this->url( $resource, 'upload', true ); $args = $this->clean_args( $args ); $disable_https_fetch = get_transient( '_cld_disable_http_upload' ); @@ -427,8 +405,12 @@ public function upload( $attachment_id, $args, $headers = array(), $try_remote = } else { // We should have the file in args at this point, but if the transient was set, it will be defaulting here. if ( empty( $args['file'] ) ) { - $get_path_func = function_exists( 'wp_get_original_image_path' ) ? 'wp_get_original_image_path' : 'get_attached_file'; - $args['file'] = call_user_func( $get_path_func, $attachment_id ); + if ( wp_attachment_is_image( $attachment_id ) ) { + $get_path_func = function_exists( 'wp_get_original_image_path' ) ? 'wp_get_original_image_path' : 'get_attached_file'; + $args['file'] = call_user_func( $get_path_func, $attachment_id ); + } else { + $args['file'] = get_attached_file( $attachment_id ); + } } // Headers indicate chunked upload. if ( empty( $headers ) ) { diff --git a/php/media/class-filter.php b/php/media/class-filter.php index eb9a13430..5aa4a1956 100644 --- a/php/media/class-filter.php +++ b/php/media/class-filter.php @@ -207,6 +207,11 @@ public function filter_video_shortcodes( $content ) { foreach ( $shortcodes as $shortcode ) { $args = shortcode_parse_atts( $shortcode['args'] ); + // Bypass empty args shortcodes. + if ( empty( $args ) ) { + continue; + } + // Get the format. list( $format ) = array_intersect( $exts, array_keys( $args ) ); if ( null !== $format ) { @@ -692,6 +697,25 @@ public function catch_media_templates_maybe() { } } + /** + * Fallback for render_block_data filter. + * + * @param string $block_content The block content about to be appended. + * @param array $block The full block, including name and attributes. + * + * @return string + */ + public function filter_image_block_render_block( $block_content, array $block ) { + if ( 'core/image' === $block['blockName'] && empty( $block['cld_render'] ) ) { + $filtered_block = $this->filter_image_block_pre_render( $block, $block ); + $filtered_block['cld_render'] = true; + $block_content = render_block( $filtered_block ); + + } + + return $block_content; + } + /** * Filter an image block to add the class for cld-overriding. * @@ -758,7 +782,12 @@ public function setup_hooks() { add_action( 'admin_footer', array( $this, 'catch_media_templates_maybe' ), 9 ); // Filter for block rendering. - add_filter( 'render_block_data', array( $this, 'filter_image_block_pre_render' ), 10, 2 ); + if ( has_filter( 'render_block_data' ) ) { + add_filter( 'render_block_data', array( $this, 'filter_image_block_pre_render' ), 10, 2 ); + } else { + // The render_block_data filter was only introduced on WP 5.1.0. This is the fallback for 5.0.*. + add_filter( 'render_block', array( $this, 'filter_image_block_render_block' ), 10, 2 ); + } // Filter out locals and responsive images setup. if ( $this->media->can_filter_out_local() ) { diff --git a/php/media/class-gallery.php b/php/media/class-gallery.php index 8a3ee3b92..826c97bf2 100644 --- a/php/media/class-gallery.php +++ b/php/media/class-gallery.php @@ -65,9 +65,6 @@ class Gallery { 'mode' => 'classic', 'columns' => 1, ), - 'transformation' => array( - 'crop' => 'fill', - ), 'indicatorProps' => array( 'shape' => 'round' ), 'themeProps' => array( 'primary' => '#cf2e2e', @@ -117,9 +114,9 @@ public function __construct( Media $media ) { $config = ! empty( $media->plugin->settings->get_value( 'gallery_config' ) ) ? $media->plugin->settings->get_value( 'gallery_config' ) : - wp_json_encode( self::$default_config ); + self::$default_config; - $this->config = json_decode( $config, true ); + $this->config = $this->maybe_decode_config( $config ); } /** @@ -256,30 +253,30 @@ public function get_image_data( array $images ) { foreach ( $images as $index => $image ) { $image_id = is_int( $image ) ? $image : $image['id']; - $transformations = null; - $image_data[ $index ] = array(); + $transformations = null; + $data = array(); // Send back the attachment id. - $image_data[ $index ]['attachmentId'] = $image_id; + $data['attachmentId'] = $image_id; // Fetch the public id by either syncing NOW or getting the current public id. - if ( ! $this->media->sync->is_synced( $image_id ) ) { + if ( ! $this->media->has_public_id( $image_id ) ) { $res = $this->media->sync->managers['upload']->upload_asset( $image_id ); - if ( ! is_wp_error( $res ) ) { - $image_data[ $index ]['publicId'] = $this->media->get_public_id_from_url( $res['url'] ); - $transformations = $this->media->get_transformations_from_string( $res['url'] ); + if ( is_wp_error( $res ) ) { + // Skip and move on to the next image as this is unlikely to get synced. + continue; } - } else { - $image_data[ $index ]['publicId'] = $this->media->get_public_id( $image_id, true ); - - $image_url = is_int( $image ) ? $this->media->cloudinary_url( $image_id ) : $image['url']; - $transformations = $this->media->get_transformations_from_string( $image_url ); } - + // If synced now, the ID will be available in the meta. + $data['publicId'] = $this->media->get_public_id( $image_id, true ); + $transformations = $this->media->get_transformation_from_meta( $image_id ); if ( $transformations ) { - $image_data[ $index ]['transformation'] = array( 'transformation' => $transformations ); + $data['transformation'] = array( 'transformation' => $transformations ); } + + // Add to output array. + $image_data[] = $data; } return $image_data; @@ -435,6 +432,22 @@ public function prepare_block_render( $content, $block ) { return $content . ob_get_clean(); } + /** + * Maybe decode the gallery configuration. + * This has historical reasons, as it was used to be stored as encoded information. + * + * @param array|string $config The configuration for the gallery. + * + * @return array + */ + protected function maybe_decode_config( $config ) { + if ( ! is_array( $config ) ) { + $config = json_decode( $config, true ); + } + + return $config; + } + /** * Setup hooks for the gallery. */ diff --git a/php/media/class-upgrade.php b/php/media/class-upgrade.php index e132dcca9..851b01bb1 100644 --- a/php/media/class-upgrade.php +++ b/php/media/class-upgrade.php @@ -109,7 +109,7 @@ public function convert_cloudinary_version( $attachment_id ) { $public_id = $this->media->get_public_id( $attachment_id, true ); // Check folder sync in order. if ( $this->media->is_folder_synced( $attachment_id ) ) { - $public_id_folder = ltrim( dirname( $this->media->get_post_meta( $attachment_id, Sync::META_KEYS['public_id'], true ) ), '.' ); + $public_id_folder = ltrim( dirname( $this->media->get_public_id( $attachment_id ) ) ); $test_signature = md5( false ); $folder_signature = md5( $public_id_folder ); $signature = $this->sync->get_signature( $attachment_id ); diff --git a/php/media/class-video.php b/php/media/class-video.php index ebb5a9e64..9f23e2a04 100644 --- a/php/media/class-video.php +++ b/php/media/class-video.php @@ -8,6 +8,7 @@ namespace Cloudinary\Media; use Cloudinary\Media; +use Cloudinary\Utils; /** * Class Video. @@ -34,13 +35,6 @@ class Video { */ private $config; - /** - * Determines if the video player is active. - * - * @var bool - */ - private $player_enabled = false; - /** * List of attachment ID's to enable. * @@ -53,7 +47,7 @@ class Video { * * @var string */ - const PLAYER_VER = '1.4.0'; + const PLAYER_VER = '1.5.1'; /** * Cloudinary Core Version. @@ -87,44 +81,7 @@ public function __construct( Media $media ) { * @return bool */ public function player_enabled() { - return $this->player_enabled; - } - - /** - * $this->>register_scripts(); - * Initialises the Cloudinary player if it's enabled and if video content is found. - */ - public function init_player() { - if ( isset( $this->config['video_player'] ) && 'cld' === $this->config['video_player'] && ! is_admin() ) { - global $wp_query; - $posts = $wp_query->get_posts(); - // Check content has a video to enqueue assets in correct location. - foreach ( $posts as $post ) { - $has_video = $this->media->filter->get_video_shortcodes( get_the_content() ); - $video_tags = $this->media->filter->get_media_tags( get_the_content(), 'video' ); - if ( ! empty( $has_video ) || ! empty( $video_tags ) ) { - // Setup initial scripts. - wp_enqueue_style( 'cld-player' ); - wp_enqueue_style( 'cld-player-local', $this->media->plugin->dir_url . 'css/video.css', null, self::PLAYER_VER ); - wp_enqueue_script( 'cld-player' ); - - // Init cld script object. - $cld = array( - 'cloud_name' => $this->media->credentials['cloud_name'], - ); - if ( ! empty( $this->media->credentials['cname'] ) ) { - $cld['cname'] = $this->media->credentials['cname']; - $cld['private_cdn'] = true; - } - $code = 'var cld = cloudinary.Cloudinary.new(' . wp_json_encode( $cld ) . ');'; - wp_add_inline_script( 'cld-player', $code ); - - // Enable video for output. - $this->player_enabled = true; - break; // Exit since we determined that a video is present. - } - } - } + return isset( $this->config['video_player'] ) && 'cld' === $this->config['video_player'] && ! is_admin(); } /** @@ -195,206 +152,79 @@ public function validate_usable_transformations( $attachment_id, $transformation */ public function filter_video_shortcode( $html, $attr ) { - // If not CLD video init, return default. - if ( false === $this->player_enabled ) { - return $html; - } - // Check for override flag. - $overwrite_transformations = false; - if ( ! empty( $attr['cldoverwrite'] ) ) { - $overwrite_transformations = true; - } - // Check for a cloudinary url, or prep sync if not found. - $cloudinary_url = $this->media->cloudinary_url( $attr['id'], false, false, null, $overwrite_transformations ); - if ( ! $this->media->plugin->components['sync']->is_synced( $attr['id'] ) ) { - // If the asset is not synced, then the metadata will not be complete since v1 didn't save any. - // Return html for now since cloudinary_url will queue it up for syncing in the background. + // Confirm we have an ID and it's synced. + if ( empty( $attr['id'] ) || ! $this->media->has_public_id( $attr['id'] ) ) { return $html; } - // Queue video. - $video = wp_get_attachment_metadata( $attr['id'] ); - $transformations = $this->media->get_transformations_from_string( $cloudinary_url, 'video' ); - $args = array(); + // If not CLD video init, return default. + if ( ! $this->player_enabled() ) { + if ( empty( $attr['cloudinary'] ) ) { + $video = wp_get_attachment_metadata( $attr['id'] ); + $url = $this->media->cloudinary_url( $attr['id'] ); + $attr[ $video['fileformat'] ] = $url; + $attr['cloudinary'] = true; // Flag Cloudinary to ensure we don't call it again. + $html = wp_video_shortcode( $attr, $html ); + } - if ( isset( $attr['autoplay'] ) ) { - $args['autoplay'] = 'true' === $attr['autoplay']; - $args['muted'] = 'true' === $attr['autoplay']; - } - if ( isset( $attr['loop'] ) ) { - $args['loop'] = 'true' === $attr['loop']; - } - // Transformations. - if ( ! empty( $transformations ) ) { - $args['transformation'] = $transformations; - } - $args['overwrite_transformations'] = $overwrite_transformations; - // Size settings. - $size = ''; - if ( ! empty( $attr['width'] ) ) { - $size .= ' width="' . esc_attr( $attr['width'] ) . '"'; - $args['size'] = true; - } - if ( ! empty( $attr['height'] ) ) { - $size .= ' height="' . esc_attr( $attr['height'] ) . '"'; - $args['size'] = true; + return $html; } - $instance = $this->queue_video_config( $attr['id'], $attr[ $video['fileformat'] ], $video['fileformat'], $args ); + $attachment_id = $attr['id']; + unset( $attr['id'], $attr['width'], $attr['height'], $attr['controls'] ); + + $overwrite_transformations = ! empty( $attr['cldoverwrite'] ); - // Replace with video tag. - return ''; + return $this->build_video_embed( $attachment_id, $attr, $overwrite_transformations ); } /** - * Filter video tags and queue them for the player. - * - * @param string $content HTML content of the post. - * - * @return mixed + * Enqueue BLock Assets */ - public function filter_video_tags( $content ) { - - $video_tags = $this->media->filter->get_media_tags( $content, 'video' ); - foreach ( $video_tags as $tag ) { - $args = array(); - - // Catch poster. - $poster_url = $this->media->filter->get_poster_from_tag( $tag ); - if ( false !== $poster_url ) { - - $poster_id = $this->media->get_id_from_url( $poster_url ); - $cloudinary_id = $this->media->cloudinary_id( $poster_id ); - $cloudinary_url = $this->media->cloudinary_url( $poster_id ); - $transformations = $this->media->get_transformations_from_string( $cloudinary_url ); - $args['posterOptions'] = array( - 'publicId' => $cloudinary_id, - ); - if ( ! empty( $transformations ) ) { - $args['posterOptions']['transformation'] = $transformations; - } - } - - $url = $this->media->filter->get_url_from_tag( $tag ); - if ( false === $url ) { - continue; - } - $attachment_id = $this->media->filter->get_id_from_tag( $tag ); - if ( empty( $attachment_id ) ) { - continue; // Missing or no attachment ID found. - } - // Enable Autoplay for this video. - if ( false !== strpos( $tag, 'autoplay' ) ) { - $args['autoplayMode'] = $this->config['video_autoplay_mode']; // if on, use defined mode. - $args['muted'] = 'always' === $this->config['video_autoplay_mode']; - } - // Enable Loop. - if ( false !== strpos( $tag, 'loop' ) ) { - $args['loop'] = true; - } - // If there is no controls, it has been turned off. - if ( false !== strpos( $tag, 'controls' ) ) { - $args['controls'] = true; - } - // If there is a muted, it has been turned on. - if ( false !== strpos( $tag, 'muted' ) ) { - $args['muted'] = true; - } - // If preload. - if ( preg_match( '/preload=\"([^\"]*)\"/i', $tag, $found ) ) { - $args['preload'] = $found[1]; - } - // Add transformations if found. - $classes = $this->media->filter->get_classes( $tag ); // check if this is a transformation overwrite. - $overwrite_transformations = false; - if ( false !== strpos( $classes, 'cld-overwrite' ) ) { - $overwrite_transformations = true; - } - $args['overwrite_transformations'] = $overwrite_transformations; - - $cloudinary_url = $this->media->cloudinary_url( $attachment_id, false, false, null, $overwrite_transformations ); - // Bail replacing the video URL for cases where it doesn't exist. - // Cases are, for instance, when the file size is larger than the API limits — free accounts. - if ( ! empty( $cloudinary_url ) ) { - $transformations = $this->media->get_transformations_from_string( $cloudinary_url, 'video' ); - if ( ! empty( $transformations ) ) { - $args['transformation'] = $transformations; - } - $video = wp_get_attachment_metadata( $attachment_id ); - if ( $this->player_enabled() ) { - $instance = $this->queue_video_config( $attachment_id, $url, $video['fileformat'], $args ); - // Remove src and replace with an ID. - $new_tag = str_replace( 'src="' . $url . '"', 'id="cloudinary-video-' . esc_attr( $instance ) . '"', $tag ); - $content = str_replace( $tag, $new_tag, $content ); - } else { - // Just replace URL. - $content = str_replace( $url, $cloudinary_url, $content ); - } - } - } - - return $content; + public function enqueue_block_assets() { + wp_enqueue_script( 'cloudinary-block', $this->media->plugin->dir_url . 'js/block-editor.js', array(), $this->media->plugin->version, true ); + wp_add_inline_script( 'cloudinary-block', 'var CLD_VIDEO_PLAYER = ' . wp_json_encode( $this->config ), 'before' ); } /** - * Output init scripts in footer for videos. + * Register assets for the player for preview. */ - public function print_video_scripts() { - - if ( $this->player_enabled() && ! empty( $this->attachments ) ) { - - $cld_videos = array(); - foreach ( $this->attachments as $instance => $video ) { - // @todo - ping the URL to ensure it has transformation available, else update an eager. - $cloudinary_id = $this->media->get_public_id( $video['id'] ); - $default = array( - 'publicId' => $cloudinary_id, - 'sourceTypes' => array( $video['format'] ), // @todo Make this based on eager items as mentioned above. - 'autoplay' => 'off' !== $this->config['video_autoplay_mode'], - 'loop' => $this->config['video_loop'], - ); - - $valid_autoplay_modes = array( 'never', 'always', 'on-scroll' ); - if ( $default['autoplay'] && in_array( $this->config['video_autoplay_mode'], $valid_autoplay_modes, true ) ) { - $default['autoplayMode'] = $this->config['video_autoplay_mode']; - } - - $config = wp_parse_args( $video['args'], $default ); - - if ( empty( $config['size'] ) && ! empty( $config['transformation'] ) && ! $this->media->get_crop_from_transformation( $config['transformation'] ) ) { - $config['fluid'] = true; - } - - $config['controls'] = $this->config['video_controls']; - $cld_videos[ $instance ] = $config; - } - - if ( empty( $cld_videos ) ) { - return; - } + public function admin_enqueue_scripts() { + $current_screen = get_current_screen(); + $requiring_screens = array( + 'cloudinary_page_media', + 'edit-tags', + ); - $json_cld_videos = wp_json_encode( $cld_videos ); - $video_freeform = esc_js( $this->config['video_freeform'] ); + if ( null === $current_screen ) { + return; + } - wp_add_inline_script( 'cld-player', "var cldVideos = '{$json_cld_videos}'; var videoFreeForm = '{$video_freeform}';" ); + if ( in_array( $current_screen->base, $requiring_screens, true ) ) { + wp_register_style( 'cld-player', 'https://unpkg.com/cloudinary-video-player@' . self::PLAYER_VER . '/dist/cld-video-player.min.css', null, self::PLAYER_VER ); + wp_register_script( 'cld-core', 'https://unpkg.com/cloudinary-core@' . self::CORE_VER . '/cloudinary-core-shrinkwrap.min.js', null, self::CORE_VER, true ); + wp_register_script( 'cld-player', 'https://unpkg.com/cloudinary-video-player@' . self::PLAYER_VER . '/dist/cld-video-player.min.js', array( 'cld-core' ), self::PLAYER_VER, true ); } } /** - * Enqueue BLock Assets + * Fallback for render_block_data filter. + * + * @param string $block_content The block content about to be appended. + * @param array $block The full block, including name and attributes. + * + * @return string */ - public function enqueue_block_assets() { - wp_enqueue_script( 'cloudinary-block', $this->media->plugin->dir_url . 'js/block-editor.js', array(), $this->media->plugin->version, true ); - wp_add_inline_script( 'cloudinary-block', 'var CLD_VIDEO_PLAYER = ' . wp_json_encode( $this->config ), 'before' ); - } + public function filter_video_block_render_block( $block_content, array $block ) { + if ( 'core/video' === $block['blockName'] ) { + remove_filter( 'render_block', array( $this, 'filter_video_block_render_block' ), 10, 2 ); - /** - * Register assets for the player. - */ - public function register_scripts_styles() { - wp_register_style( 'cld-player', 'https://unpkg.com/cloudinary-video-player@' . self::PLAYER_VER . '/dist/cld-video-player.min.css', null, self::PLAYER_VER ); - wp_register_script( 'cld-core', 'https://unpkg.com/cloudinary-core@' . self::CORE_VER . '/cloudinary-core-shrinkwrap.min.js', null, self::CORE_VER, true ); - wp_register_script( 'cld-player', 'https://unpkg.com/cloudinary-video-player@' . self::PLAYER_VER . '/dist/cld-video-player.min.js', array( 'cld-core' ), self::PLAYER_VER, true ); - wp_enqueue_script( 'cld-video-init', CLDN_URL . 'js/video-init.js', array( 'cld-player' ), self::CORE_VER, true ); + $filtered_block = $this->filter_video_block_pre_render( $block, $block ); + $block_content = render_block( $filtered_block ); + + add_filter( 'render_block', array( $this, 'filter_video_block_render_block' ), 10, 2 ); + } + + return $block_content; } /** @@ -407,23 +237,19 @@ public function register_scripts_styles() { */ public function filter_video_block_pre_render( $block, $source_block ) { - if ( 'core/video' === $source_block['blockName'] ) { - $classes = 'cld-fluid'; - if ( ! empty( $source_block['attrs']['overwrite_transformations'] ) ) { - $classes .= ' cld-overwrite'; - } - if ( ! empty( $source_block['attrs']['id'] ) ) { - $classes .= ' wp-video-' . $source_block['attrs']['id']; - } + if ( 'core/video' === $source_block['blockName'] && ! empty( $source_block['attrs']['id'] ) && $this->media->has_public_id( $source_block['attrs']['id'] ) ) { + $attachment_id = $source_block['attrs']['id']; + $overwrite_transformations = ! empty( $source_block['attrs']['overwrite_transformations'] ); foreach ( $block['innerContent'] as &$content ) { - $video_tags = $this->media->filter->get_media_tags( $content ); - foreach ( $video_tags as $tag ) { - if ( false !== strpos( $tag, 'class="' ) ) { - $content = str_replace( 'class="', 'class="' . $classes . ' ', $content ); - } else { - $content = str_replace( '