/*! For license information please see editor-canvas.min.js.LICENSE.txt */ !function(){"use strict";var e,t,n={2020:function(e){e.exports=window.elementorV2.editorProps},5338:function(e,t,n){var r=n(43617);t.createRoot=r.createRoot,t.hydrateRoot=r.hydrateRoot},5527:function(e){e.exports=window.elementorV2.editorV1Adapters},9854:function(e){e.exports=window.elementorV2.twing},18998:function(e){e.exports=window.elementorV2.httpClient},21020:function(e,t,n){var r=n(97557),o=Symbol.for("react.element"),i=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function q(e,t,n){var r,i={},c=null,u=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)s.call(t,r)&&!l.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:o,type:e,key:c,ref:u,props:i,_owner:a.current}}t.Fragment=i,t.jsx=q,t.jsxs=q},22444:function(e){e.exports=window.elementorV2.utils},22504:function(e){e.exports=window.elementorV2.editor},24778:function(e){e.exports=window.elementorV2.editorNotifications},25454:function(e){const{entries:t,setPrototypeOf:n,isFrozen:r,getPrototypeOf:o,getOwnPropertyDescriptor:i}=Object;let{freeze:s,seal:a,create:l}=Object,{apply:c,construct:u}="undefined"!=typeof Reflect&&Reflect;s||(s=function freeze(e){return e}),a||(a=function seal(e){return e}),c||(c=function apply(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o1?t-1:0),r=1;r1?n-1:0),o=1;o2&&void 0!==arguments[2]?arguments[2]:h;n&&n(e,null);let i=t.length;for(;i--;){let n=t[i];if("string"==typeof n){const e=o(n);e!==n&&(r(t)||(t[i]=e),n=e)}e[n]=!0}return e}function cleanArray(e){for(let t=0;t/gm),$=a(/\$\{[\w\W]*/gm),V=a(/^data-[\-\w.\u00B7-\uFFFF]+$/),j=a(/^aria-[\-\w]+$/),W=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),B=a(/^(?:\w+script|data):/i),z=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),U=a(/^html$/i),H=a(/^[a-z][.\w]*(-[.\w]+)+$/i);var G=Object.freeze({__proto__:null,ARIA_ATTR:j,ATTR_WHITESPACE:z,CUSTOM_ELEMENT:H,DATA_ATTR:V,DOCTYPE_NAME:U,ERB_EXPR:F,IS_ALLOWED_URI:W,IS_SCRIPT_OR_DATA:B,MUSTACHE_EXPR:D,TMPLIT_EXPR:$});const K=1,Y=3,X=7,J=8,Z=9,Q=function getGlobal(){return"undefined"==typeof window?null:window};var ee=function createDOMPurify(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Q();const DOMPurify=e=>createDOMPurify(e);if(DOMPurify.version="3.3.0",DOMPurify.removed=[],!e||!e.document||e.document.nodeType!==Z||!e.Element)return DOMPurify.isSupported=!1,DOMPurify;let{document:n}=e;const r=n,o=r.currentScript,{DocumentFragment:i,HTMLTemplateElement:a,Node:c,Element:u,NodeFilter:D,NamedNodeMap:F=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:$,DOMParser:V,trustedTypes:j}=e,B=u.prototype,z=lookupGetter(B,"cloneNode"),H=lookupGetter(B,"remove"),ee=lookupGetter(B,"nextSibling"),te=lookupGetter(B,"childNodes"),ne=lookupGetter(B,"parentNode");if("function"==typeof a){const e=n.createElement("template");e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let re,oe="";const{implementation:ie,createNodeIterator:se,createDocumentFragment:ae,getElementsByTagName:le}=n,{importNode:ce}=r;let ue={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};DOMPurify.isSupported="function"==typeof t&&"function"==typeof ne&&ie&&void 0!==ie.createHTMLDocument;const{MUSTACHE_EXPR:de,ERB_EXPR:fe,TMPLIT_EXPR:me,DATA_ATTR:pe,ARIA_ATTR:ge,IS_SCRIPT_OR_DATA:he,ATTR_WHITESPACE:ye,CUSTOM_ELEMENT:ve}=G;let{IS_ALLOWED_URI:be}=G,we=null;const Ee=addToSet({},[...C,...R,..._,...k,...I]);let Te=null;const Se=addToSet({},[...P,...L,...M,...N]);let xe=Object.seal(l(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ce=null,Re=null;const _e=Object.seal(l(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ae=!0,ke=!0,Oe=!1,Ie=!0,Pe=!1,Le=!0,Me=!1,Ne=!1,De=!1,Fe=!1,$e=!1,Ve=!1,je=!0,We=!1,Be=!0,ze=!1,Ue={},He=null;const Ge=addToSet({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let qe=null;const Ke=addToSet({},["audio","video","img","source","image","track"]);let Ye=null;const Xe=addToSet({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Je="http://www.w3.org/1998/Math/MathML",Ze="http://www.w3.org/2000/svg",Qe="http://www.w3.org/1999/xhtml";let et=Qe,tt=!1,nt=null;const rt=addToSet({},[Je,Ze,Qe],y);let ot=addToSet({},["mi","mo","mn","ms","mtext"]),it=addToSet({},["annotation-xml"]);const st=addToSet({},["title","style","font","a","script"]);let at=null;const lt=["application/xhtml+xml","text/html"];let ct=null,ut=null;const dt=n.createElement("form"),ft=function isRegexOrFunction(e){return e instanceof RegExp||e instanceof Function},mt=function _parseConfig(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!ut||ut!==e){if(e&&"object"==typeof e||(e={}),e=clone(e),at=-1===lt.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,ct="application/xhtml+xml"===at?y:h,we=T(e,"ALLOWED_TAGS")?addToSet({},e.ALLOWED_TAGS,ct):Ee,Te=T(e,"ALLOWED_ATTR")?addToSet({},e.ALLOWED_ATTR,ct):Se,nt=T(e,"ALLOWED_NAMESPACES")?addToSet({},e.ALLOWED_NAMESPACES,y):rt,Ye=T(e,"ADD_URI_SAFE_ATTR")?addToSet(clone(Xe),e.ADD_URI_SAFE_ATTR,ct):Xe,qe=T(e,"ADD_DATA_URI_TAGS")?addToSet(clone(Ke),e.ADD_DATA_URI_TAGS,ct):Ke,He=T(e,"FORBID_CONTENTS")?addToSet({},e.FORBID_CONTENTS,ct):Ge,Ce=T(e,"FORBID_TAGS")?addToSet({},e.FORBID_TAGS,ct):clone({}),Re=T(e,"FORBID_ATTR")?addToSet({},e.FORBID_ATTR,ct):clone({}),Ue=!!T(e,"USE_PROFILES")&&e.USE_PROFILES,Ae=!1!==e.ALLOW_ARIA_ATTR,ke=!1!==e.ALLOW_DATA_ATTR,Oe=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ie=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Pe=e.SAFE_FOR_TEMPLATES||!1,Le=!1!==e.SAFE_FOR_XML,Me=e.WHOLE_DOCUMENT||!1,Fe=e.RETURN_DOM||!1,$e=e.RETURN_DOM_FRAGMENT||!1,Ve=e.RETURN_TRUSTED_TYPE||!1,De=e.FORCE_BODY||!1,je=!1!==e.SANITIZE_DOM,We=e.SANITIZE_NAMED_PROPS||!1,Be=!1!==e.KEEP_CONTENT,ze=e.IN_PLACE||!1,be=e.ALLOWED_URI_REGEXP||W,et=e.NAMESPACE||Qe,ot=e.MATHML_TEXT_INTEGRATION_POINTS||ot,it=e.HTML_INTEGRATION_POINTS||it,xe=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ft(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(xe.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ft(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(xe.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(xe.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Pe&&(ke=!1),$e&&(Fe=!0),Ue&&(we=addToSet({},I),Te=[],!0===Ue.html&&(addToSet(we,C),addToSet(Te,P)),!0===Ue.svg&&(addToSet(we,R),addToSet(Te,L),addToSet(Te,N)),!0===Ue.svgFilters&&(addToSet(we,_),addToSet(Te,L),addToSet(Te,N)),!0===Ue.mathMl&&(addToSet(we,k),addToSet(Te,M),addToSet(Te,N))),e.ADD_TAGS&&("function"==typeof e.ADD_TAGS?_e.tagCheck=e.ADD_TAGS:(we===Ee&&(we=clone(we)),addToSet(we,e.ADD_TAGS,ct))),e.ADD_ATTR&&("function"==typeof e.ADD_ATTR?_e.attributeCheck=e.ADD_ATTR:(Te===Se&&(Te=clone(Te)),addToSet(Te,e.ADD_ATTR,ct))),e.ADD_URI_SAFE_ATTR&&addToSet(Ye,e.ADD_URI_SAFE_ATTR,ct),e.FORBID_CONTENTS&&(He===Ge&&(He=clone(He)),addToSet(He,e.FORBID_CONTENTS,ct)),Be&&(we["#text"]=!0),Me&&addToSet(we,["html","head","body"]),we.table&&(addToSet(we,["tbody"]),delete Ce.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw x('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw x('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');re=e.TRUSTED_TYPES_POLICY,oe=re.createHTML("")}else void 0===re&&(re=function _createTrustedTypesPolicy(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML(e){return e},createScriptURL(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(j,o)),null!==re&&"string"==typeof oe&&(oe=re.createHTML(""));s&&s(e),ut=e}},pt=addToSet({},[...R,..._,...A]),gt=addToSet({},[...k,...O]),ht=function _forceRemove(e){p(DOMPurify.removed,{element:e});try{ne(e).removeChild(e)}catch(t){H(e)}},yt=function _removeAttribute(e,t){try{p(DOMPurify.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){p(DOMPurify.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(Fe||$e)try{ht(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},vt=function _initDocument(e){let t=null,r=null;if(De)e=""+e;else{const t=v(e,/^[\r\n\t ]+/);r=t&&t[0]}"application/xhtml+xml"===at&&et===Qe&&(e=''+e+"");const o=re?re.createHTML(e):e;if(et===Qe)try{t=(new V).parseFromString(o,at)}catch(e){}if(!t||!t.documentElement){t=ie.createDocument(et,"template",null);try{t.documentElement.innerHTML=tt?oe:o}catch(e){}}const i=t.body||t.documentElement;return e&&r&&i.insertBefore(n.createTextNode(r),i.childNodes[0]||null),et===Qe?le.call(t,Me?"html":"body")[0]:Me?t.documentElement:i},bt=function _createNodeIterator(e){return se.call(e.ownerDocument||e,e,D.SHOW_ELEMENT|D.SHOW_COMMENT|D.SHOW_TEXT|D.SHOW_PROCESSING_INSTRUCTION|D.SHOW_CDATA_SECTION,null)},wt=function _isClobbered(e){return e instanceof $&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof F)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Et=function _isNode(e){return"function"==typeof c&&e instanceof c};function _executeHooks(e,t,n){d(e,e=>{e.call(DOMPurify,t,n,ut)})}const Tt=function _sanitizeElements(e){let t=null;if(_executeHooks(ue.beforeSanitizeElements,e,null),wt(e))return ht(e),!0;const n=ct(e.nodeName);if(_executeHooks(ue.uponSanitizeElement,e,{tagName:n,allowedTags:we}),Le&&e.hasChildNodes()&&!Et(e.firstElementChild)&&S(/<[/\w!]/g,e.innerHTML)&&S(/<[/\w!]/g,e.textContent))return ht(e),!0;if(e.nodeType===X)return ht(e),!0;if(Le&&e.nodeType===J&&S(/<[/\w]/g,e.data))return ht(e),!0;if(!(_e.tagCheck instanceof Function&&_e.tagCheck(n))&&(!we[n]||Ce[n])){if(!Ce[n]&&xt(n)){if(xe.tagNameCheck instanceof RegExp&&S(xe.tagNameCheck,n))return!1;if(xe.tagNameCheck instanceof Function&&xe.tagNameCheck(n))return!1}if(Be&&!He[n]){const t=ne(e)||e.parentNode,n=te(e)||e.childNodes;if(n&&t){for(let r=n.length-1;r>=0;--r){const o=z(n[r],!0);o.__removalCount=(e.__removalCount||0)+1,t.insertBefore(o,ee(e))}}}return ht(e),!0}return e instanceof u&&!function _checkValidNamespace(e){let t=ne(e);t&&t.tagName||(t={namespaceURI:et,tagName:"template"});const n=h(e.tagName),r=h(t.tagName);return!!nt[e.namespaceURI]&&(e.namespaceURI===Ze?t.namespaceURI===Qe?"svg"===n:t.namespaceURI===Je?"svg"===n&&("annotation-xml"===r||ot[r]):Boolean(pt[n]):e.namespaceURI===Je?t.namespaceURI===Qe?"math"===n:t.namespaceURI===Ze?"math"===n&&it[r]:Boolean(gt[n]):e.namespaceURI===Qe?!(t.namespaceURI===Ze&&!it[r])&&!(t.namespaceURI===Je&&!ot[r])&&!gt[n]&&(st[n]||!pt[n]):!("application/xhtml+xml"!==at||!nt[e.namespaceURI]))}(e)?(ht(e),!0):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!S(/<\/no(script|embed|frames)/i,e.innerHTML)?(Pe&&e.nodeType===Y&&(t=e.textContent,d([de,fe,me],e=>{t=b(t,e," ")}),e.textContent!==t&&(p(DOMPurify.removed,{element:e.cloneNode()}),e.textContent=t)),_executeHooks(ue.afterSanitizeElements,e,null),!1):(ht(e),!0)},St=function _isValidAttribute(e,t,r){if(je&&("id"===t||"name"===t)&&(r in n||r in dt))return!1;if(ke&&!Re[t]&&S(pe,t));else if(Ae&&S(ge,t));else if(_e.attributeCheck instanceof Function&&_e.attributeCheck(t,e));else if(!Te[t]||Re[t]){if(!(xt(e)&&(xe.tagNameCheck instanceof RegExp&&S(xe.tagNameCheck,e)||xe.tagNameCheck instanceof Function&&xe.tagNameCheck(e))&&(xe.attributeNameCheck instanceof RegExp&&S(xe.attributeNameCheck,t)||xe.attributeNameCheck instanceof Function&&xe.attributeNameCheck(t,e))||"is"===t&&xe.allowCustomizedBuiltInElements&&(xe.tagNameCheck instanceof RegExp&&S(xe.tagNameCheck,r)||xe.tagNameCheck instanceof Function&&xe.tagNameCheck(r))))return!1}else if(Ye[t]);else if(S(be,b(r,ye,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==w(r,"data:")||!qe[e]){if(Oe&&!S(he,b(r,ye,"")));else if(r)return!1}else;return!0},xt=function _isBasicCustomElement(e){return"annotation-xml"!==e&&v(e,ve)},Ct=function _sanitizeAttributes(e){_executeHooks(ue.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||wt(e))return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Te,forceKeepAttr:void 0};let r=t.length;for(;r--;){const o=t[r],{name:i,namespaceURI:s,value:a}=o,l=ct(i),c=a;let u="value"===i?c:E(c);if(n.attrName=l,n.attrValue=u,n.keepAttr=!0,n.forceKeepAttr=void 0,_executeHooks(ue.uponSanitizeAttribute,e,n),u=n.attrValue,!We||"id"!==l&&"name"!==l||(yt(i,e),u="user-content-"+u),Le&&S(/((--!?|])>)|<\/(style|title|textarea)/i,u)){yt(i,e);continue}if("attributename"===l&&v(u,"href")){yt(i,e);continue}if(n.forceKeepAttr)continue;if(!n.keepAttr){yt(i,e);continue}if(!Ie&&S(/\/>/i,u)){yt(i,e);continue}Pe&&d([de,fe,me],e=>{u=b(u,e," ")});const f=ct(e.nodeName);if(St(f,l,u)){if(re&&"object"==typeof j&&"function"==typeof j.getAttributeType)if(s);else switch(j.getAttributeType(f,l)){case"TrustedHTML":u=re.createHTML(u);break;case"TrustedScriptURL":u=re.createScriptURL(u)}if(u!==c)try{s?e.setAttributeNS(s,i,u):e.setAttribute(i,u),wt(e)?ht(e):m(DOMPurify.removed)}catch(t){yt(i,e)}}else yt(i,e)}_executeHooks(ue.afterSanitizeAttributes,e,null)},Rt=function _sanitizeShadowDOM(e){let t=null;const n=bt(e);for(_executeHooks(ue.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)_executeHooks(ue.uponSanitizeShadowNode,t,null),Tt(t),Ct(t),t.content instanceof i&&_sanitizeShadowDOM(t.content);_executeHooks(ue.afterSanitizeShadowDOM,e,null)};return DOMPurify.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,o=null,s=null,a=null;if(tt=!e,tt&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Et(e)){if("function"!=typeof e.toString)throw x("toString is not a function");if("string"!=typeof(e=e.toString()))throw x("dirty is not a string, aborting")}if(!DOMPurify.isSupported)return e;if(Ne||mt(t),DOMPurify.removed=[],"string"==typeof e&&(ze=!1),ze){if(e.nodeName){const t=ct(e.nodeName);if(!we[t]||Ce[t])throw x("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof c)n=vt("\x3c!----\x3e"),o=n.ownerDocument.importNode(e,!0),o.nodeType===K&&"BODY"===o.nodeName||"HTML"===o.nodeName?n=o:n.appendChild(o);else{if(!Fe&&!Pe&&!Me&&-1===e.indexOf("<"))return re&&Ve?re.createHTML(e):e;if(n=vt(e),!n)return Fe?null:Ve?oe:""}n&&De&&ht(n.firstChild);const l=bt(ze?e:n);for(;s=l.nextNode();)Tt(s),Ct(s),s.content instanceof i&&Rt(s.content);if(ze)return e;if(Fe){if($e)for(a=ae.call(n.ownerDocument);n.firstChild;)a.appendChild(n.firstChild);else a=n;return(Te.shadowroot||Te.shadowrootmode)&&(a=ce.call(r,a,!0)),a}let u=Me?n.outerHTML:n.innerHTML;return Me&&we["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&S(U,n.ownerDocument.doctype.name)&&(u="\n"+u),Pe&&d([de,fe,me],e=>{u=b(u,e," ")}),re&&Ve?re.createHTML(u):u},DOMPurify.setConfig=function(){mt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Ne=!0},DOMPurify.clearConfig=function(){ut=null,Ne=!1},DOMPurify.isValidAttribute=function(e,t,n){ut||mt({});const r=ct(e),o=ct(t);return St(r,o,n)},DOMPurify.addHook=function(e,t){"function"==typeof t&&p(ue[e],t)},DOMPurify.removeHook=function(e,t){if(void 0!==t){const n=f(ue[e],t);return-1===n?void 0:g(ue[e],n,1)[0]}return m(ue[e])},DOMPurify.removeHooks=function(e){ue[e]=[]},DOMPurify.removeAllHooks=function(){ue={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},DOMPurify}();e.exports=ee},27723:function(e){e.exports=window.wp.i18n},33176:function(e){e.exports=window.elementorV2.events},43617:function(e){e.exports=window.ReactDOM},46280:function(e){e.exports=window.elementorV2.editorDocuments},47182:function(e){e.exports=window.elementorV2.editorStylesRepository},47290:function(e){e.exports=window.elementorV2.editorStyles},55534:function(e){e.exports=window.elementorV2.editorMcp},59618:function(e){e.exports=window.elementorV2.schema},61869:function(e,t,n){var r,o=Object.create,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,__copyProps=(e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let o of a(t))c.call(e,o)||o===n||i(e,o,{get:()=>t[o],enumerable:!(r=s(t,o))||r.enumerable});return e},__toESM=(e,t,n)=>(n=null!=e?o(l(e)):{},__copyProps(!t&&e&&e.__esModule?n:i(n,"default",{value:e,enumerable:!0}),e)),u={};((e,t)=>{for(var n in t)i(e,n,{get:t[n],enumerable:!0})})(u,{BREAKPOINTS_SCHEMA_FULL_URI:()=>S,BREAKPOINTS_SCHEMA_URI:()=>T,DOCUMENT_STRUCTURE_URI:()=>cn,ELEMENT_ADDED_EVENT:()=>Un,GLOBAL_STYLES_IMPORTED_EVENT:()=>_r,SpotlightBackdrop:()=>SpotlightBackdrop,UnknownStyleStateError:()=>Xe,UnknownStyleTypeError:()=>Ye,WIDGET_SCHEMA_FULL_URI:()=>w,WIDGET_SCHEMA_URI:()=>b,canBeNestedTemplated:()=>canBeNestedTemplated,convertCssToAtomic:()=>convertCssToAtomic,convertStyleBlocksToAtomic:()=>convertStyleBlocksToAtomic,createNestedTemplatedElementType:()=>createNestedTemplatedElementType,createNestedTemplatedElementView:()=>createNestedTemplatedElementView,createPropsResolver:()=>createPropsResolver,createTemplatedElementView:()=>createTemplatedElementView,createTransformer:()=>createTransformer,createTransformersRegistry:()=>createTransformersRegistry,doAfterRender:()=>doAfterRender,endDragElementFromPanel:()=>endDragElementFromPanel,formatGridTrackRepeat:()=>formatGridTrackRepeat,init:()=>init,isAtomicWidget:()=>isAtomicWidget,isGridTrackProperty:()=>isGridTrackProperty,registerElementType:()=>registerElementType,registerModelExtensions:()=>registerModelExtensions,settingsTransformersRegistry:()=>dt,startDragElementFromPanel:()=>startDragElementFromPanel,styleTransformersRegistry:()=>ze,stylesInheritanceTransformersRegistry:()=>Be,useCanvasDocument:()=>useCanvasDocument,useEscapeOnCanvas:()=>useEscapeOnCanvas,waitForChildrenToComplete:()=>waitForChildrenToComplete}),e.exports=(r=u,__copyProps(i({},"__esModule",{value:!0}),r));var d=n(5527),f=n(70975),m=n(55534),p=n(2020),g=n(70975);function hasV3Controls(e){return"object"==typeof e&&null!==e&&Object.keys(e).length>0}function isWidgetAvailableForLLM(e){return!!e&&(!1!==e.meta?.llm_support&&("Component"!==e.title&&(!!e.atomic_props_schema||hasV3Controls(e.controls))))}function getWidgetVersion(e){return e?.atomic_props_schema?"v4":"v3"}function getAvailableWidgets(){const e=(0,g.getWidgetsCache)()??{};return Object.keys(e).filter(t=>isWidgetAvailableForLLM(e[t])).sort().map(t=>{const n=e[t],r="string"==typeof n?.meta?.description?n.meta.description:void 0;return{type:t,version:getWidgetVersion(n),...r&&{description:r}}})}function getRequiredDefaultChildTemplates(e){const t=e?.default_children;return Array.isArray(t)?t.filter(e=>e?.meta?.required??!1):[]}var h="Has a widget default — omit unless user explicitly requests a change. See llm_guidance.default_settings.";function buildLlmGuidance(e,t,n){const r={},o=e?.base_styles;o&&Object.values(o).forEach(e=>{e.variants.forEach(e=>{Object.assign(r,e.props)})});const i=e?.base_settings??{},s=Object.keys(r).length>0,a=Object.keys(i).length>0,l={can_have_children:!!e?.meta?.is_container};s&&(l.instructions="These are the default styles applied to the widget. Override only when necessary.",l.default_styles=r),a&&(l.instructions=function mergeInstructions(e,t){return"string"==typeof e&&e.length>0?`${e} ${t}`:t}(l.instructions,"These are the default settings applied to the widget. Omit them from elementConfig unless the user explicitly asks to change them."),l.default_settings=i);const c=e.allowed_child_types,u=Object.entries(n).filter(([,e])=>e.allowed_child_types?.includes(t)).map(([e])=>e);(c?.length||u.length)&&(l.nesting={...c?.length?{allowed_child_types:c}:{},...u.length?{allowed_parents:u}:{}});const d=function getRequiredDefaultChildTypes(e){return getRequiredDefaultChildTemplates(e).map(e=>e.widgetType??e.elType??"").filter(e=>Boolean(e))}(e);return d.length&&(l.required_direct_children=d),l}var y=new Set(["section","tab","tabs"]);var v="editor-canvas",b="elementor://widgets/schema/{widgetType}",w=`${v}_${b}`,E="elementor://styles/best-practices",initWidgetsSchemaResource=e=>{const{resource:t}=e;t("styles-best-practices",E,{description:"Styling best practices"},async()=>({contents:[{uri:E,text:'# Styling best practices\nPrefer using "em" and "rem" values for text-related sizes, padding and spacing. Use percentages for dynamic sizing relative to parent containers.\nThis flexboxes are by default "flex" with "stretch" alignment. To ensure proper layout, define the "justify-content" and "align-items" as in the schema.\n\nStyling is provided as raw CSS. The css string must follow standard CSS syntax, with properties and values separated by semicolons, no selectors, or nesting rules allowed.\n\n** CRITICAL - VARIABLES **\nWhen using global variables, ensure that the variables are defined in the elementor://global-variables resource.\nVariables from the user context ARE NOT SUPPORTED AND WILL RESOLVE IN ERROR.\n\n'}]})),t("widget-schema-by-type",new m.ResourceTemplate(b,{list:()=>{const e=(0,f.getWidgetsCache)()||{};return{resources:Object.keys(e).filter(t=>isWidgetAvailableForLLM(e[t])).map(e=>({uri:`elementor://widgets/schema/${e}`,name:"Widget schema for "+e}))}}}),{description:"PropType schema for the specified widget type"},async(e,t)=>{const n="string"==typeof t.widgetType?t.widgetType:t.widgetType?.[0],r=(0,f.getWidgetsCache)()?.[n];if(!r)throw new Error(`No prop schema found for element type: ${n}`);const o=r.atomic_props_schema;if(!o){if(!hasV3Controls(r.controls))throw new Error(`No prop schema found for element type: ${n}`);const t=function extractV3ControlsMetadata(e){if(!hasV3Controls(e))return{};const t={};for(const[n,r]of Object.entries(e)){if(!r||"object"!=typeof r)continue;const e=r,o="string"==typeof e.type?e.type:void 0;if(o&&y.has(o))continue;const i={};if(Object.prototype.hasOwnProperty.call(e,"default")&&(i.default=e.default),o&&(i.type=o),Object.prototype.hasOwnProperty.call(e,"options")&&void 0!==e.options){const t=e.options;t&&"object"==typeof t&&!Array.isArray(t)?i.options=Object.keys(t):i.options=t}t[n]=i}return t}(r.controls);return{contents:[{uri:e.toString(),mimeType:"application/json",text:JSON.stringify({widget_version:"v3",message:"This widget exists in the editor but has no atomic props schema (V4). Use control_metadata as non-authoritative hints from legacy controls.",fields_note:"All settings are optional; there is no JSON schema for this widget type.",properties:t})}]}}const i=Object.keys(r?.base_settings??{}),s=function enrichPropertiesWithBaseSettingsHints(e,t){if(!t.length)return e;const n={...e};for(const e of t){const t=n[e];t&&(n[e]={...t,description:t.description?`${t.description} ${h}`:h})}return n}(Object.fromEntries(Object.entries(o).filter(([e,t])=>p.Schema.isPropKeyConfigurable(e,t)).map(([e,t])=>[e,p.Schema.propTypeToJsonSchema(t)])),i),a="string"==typeof r?.meta?.description?r.meta.description:void 0,l=buildLlmGuidance(r,n,(0,f.getWidgetsCache)()||{});return{contents:[{uri:e.toString(),mimeType:"application/json",text:JSON.stringify({type:"object",properties:s,description:a,llm_guidance:l})}]}})},T="elementor://breakpoints/list",S=`${v}_${T}`,x=n(18998),C="default",convertStyleBlocksToAtomic=async e=>(async e=>{const{data:t}=await(0,x.httpService)().post("elementor/v1/css-to-atomic",{blocks:e});return t.data})(e),convertCssToAtomic=async e=>(await convertStyleBlocksToAtomic({[C]:e}))[C],R=n(22504),_=n(55534),A=n(97557),k=n(46280),O=n(47182),I=n(22444),ClassesRename=()=>((0,A.useEffect)(()=>{const e=subscribeToStylesRepository();return()=>{e()}},[]),null),subscribeToStylesRepository=()=>O.stylesRepository.subscribe((e,t)=>{if(!e||!t)return;Object.keys(t).forEach(n=>{if(!(e[n]&&(0,I.hash)(e[n])!==(0,I.hash)(t[n])))return;const r=e[n],o=t[n];r.label!==o.label&&renameClass(r.label,o.label)})}),renameClass=(e,t)=>{Object.values((0,k.getV1DocumentsManager)().documents).forEach(n=>{const r=n.container;r.view?.el?.querySelectorAll(`.elementor .${e}`).forEach(n=>{n.classList.replace(e,t)})})},P=__toESM(n(97557)),L=n(70975),M=n(5527),N=n(97557),D=n(97557),F=n(22444);function useElementRect(e){const[t,n]=(0,D.useState)(new DOMRect(0,0,0,0)),r=(0,F.throttle)(()=>{n(e?.getBoundingClientRect()??new DOMRect(0,0,0,0))},20,!0);return function useScrollListener({element:e,onChange:t}){(0,D.useEffect)(()=>{if(!e)return;const n=e.ownerDocument?.defaultView;return n?.addEventListener("scroll",t,{passive:!0}),()=>{n?.removeEventListener("scroll",t)}},[e,t])}({element:e,onChange:r}),function useResizeListener({element:e,onChange:t}){(0,D.useEffect)(()=>{if(!e)return;const n=new ResizeObserver(t);n.observe(e);const r=e.ownerDocument?.defaultView;return r?.addEventListener("resize",t,{passive:!0}),()=>{n.disconnect(),r?.removeEventListener("resize",t)}},[e,t])}({element:e,onChange:r}),function useMutationsListener({element:e,onChange:t}){(0,D.useEffect)(()=>{if(!e)return;const n=new MutationObserver(t);return n.observe(e,{childList:!0,subtree:!0}),()=>{n.disconnect()}},[e,t])}({element:e,onChange:r}),(0,D.useEffect)(()=>()=>{r.cancel()},[r]),t}var $=n(97557),V=n(70975),j=n(5527);function uniqueSorted(e){return Array.from(new Set(e)).sort((e,t)=>e-t)}function computeTrackSegments(e,t,n){const r=[];let o=n;for(let n=0;ne>0):[]}function toPx(e){const t=parseFloat(e);return Number.isFinite(t)?t:0}function resolveGapPx(e,t){if(e.trim().endsWith("%")){const n=parseFloat(e),r=parseFloat(t);return Number.isFinite(n)&&Number.isFinite(r)?n/100*r:0}return toPx(e)}var W=n(97557);var B={columns:[],rows:[],columnGap:0,rowGap:0,padding:{top:0,right:0,bottom:0,left:0},borderColor:""};function useGridTracks(e,t){const[n,r]=(0,$.useState)(B),o=(0,j.__privateUseListenTo)([(0,j.windowEvent)(V.ELEMENT_STYLE_CHANGE_EVENT),(0,j.windowEvent)("elementor/device-mode/change")],()=>({})),i=function useGridChildren(e){const[t,n]=(0,W.useState)(0);return(0,W.useEffect)(()=>{if(!e)return;const bump=()=>n(e=>e+1),t=new ResizeObserver(bump),r=new Set,syncChildren=()=>{for(const n of Array.from(e.children))r.has(n)||(t.observe(n),r.add(n));for(const n of r)n.parentElement!==e&&(t.unobserve(n),r.delete(n))};syncChildren();const o=new MutationObserver(()=>{syncChildren(),bump()});return o.observe(e,{childList:!0}),()=>{o.disconnect(),t.disconnect(),r.clear()}},[e]),t}(e);return(0,$.useEffect)(()=>{const t=e?.ownerDocument?.defaultView;if(!e||!t)return void r(B);const n=t.requestAnimationFrame(()=>{r(function toGridTracks(e){return{columns:parseTrackList(e.gridTemplateColumns),rows:parseTrackList(e.gridTemplateRows),columnGap:resolveGapPx(e.columnGap,e.width),rowGap:resolveGapPx(e.rowGap,e.height),padding:{top:toPx(e.paddingTop),right:toPx(e.paddingRight),bottom:toPx(e.paddingBottom),left:toPx(e.paddingLeft)},borderColor:e.getPropertyValue("--e-a-border-color-bold").trim()}}(t.getComputedStyle(e)))});return()=>{t.cancelAnimationFrame(n)}},[e,t.width,t.height,o,i]),n}function findFirstEmptyCell(e,t,n){if(!e||0===t||0===n)return null;const r=e.ownerDocument?.defaultView;if(!r)return null;const o=r.getComputedStyle(e).gridAutoFlow.trim().startsWith("column"),i=Array.from({length:n},()=>new Array(t).fill(!1)),s=[],a=[];for(const t of Array.from(e.children)){if(!t.classList.contains("elementor-element"))continue;const e=r.getComputedStyle(t);if("none"===e.display)continue;const n=resolvePlacement(e.gridColumnStart,e.gridColumnEnd),o=resolvePlacement(e.gridRowStart,e.gridRowEnd);null!==n.start||null!==o.start?s.push({col:n.start,colSpan:n.span,row:o.start,rowSpan:o.span}):a.push({colSpan:n.span,rowSpan:o.span})}for(const e of s)fillMatrix(i,e.col??0,e.row??0,e.colSpan,e.rowSpan);for(const e of a){const t=findNextFreeSlot(i,e.colSpan,e.rowSpan,o);t&&fillMatrix(i,t.col,t.row,e.colSpan,e.rowSpan)}return function scanFirstEmpty(e,t){const n=e.length,r=n>0?e[0].length:0;if(t){for(let t=0;t=0?e:null,span:n.n}}return{start:null,span:n.n}}if("number"==typeof r){const e=r-2;return{start:e>=0?e:null,span:1}}return isSpan(r)?{start:null,span:r.n}:{start:null,span:1}}function parseLineValue(e){const t=e.trim();if(""===t||"auto"===t)return"auto";const n=t.match(/^span\s+(\d+)$/);if(n){const e=parseInt(n[1],10);return{kind:"span",n:Math.max(1,e)}}const r=parseInt(t,10);return Number.isFinite(r)&&r>0?r:"auto"}function isSpan(e){return"object"==typeof e&&null!==e&&"kind"in e&&"span"===e.kind}function fillMatrix(e,t,n,r,o){const i=e.length,s=i>0?e[0].length:0,a=Math.max(0,n),l=Math.max(0,t),c=Math.min(i,n+o),u=Math.min(s,t+r);for(let t=a;t0?e[0].length:0)-t,s=o-n;if(i<0||s<0)return null;if(r){for(let r=0;r<=i;r++)for(let o=0;o<=s;o++)if(canFit(e,r,o,t,n))return{row:o,col:r}}else for(let r=0;r<=s;r++)for(let o=0;o<=i;o++)if(canFit(e,o,r,t,n))return{row:r,col:o};return null}function canFit(e,t,n,r,o){for(let i=n;i{e.style.removeProperty(z),e.style.removeProperty(U),e.style.removeProperty(H)},G=__toESM(n(97557)),K=n(70975),Y=n(79513),X=n(77422),J=n(97557),Z=n(77422);function useFloatingOnElement({element:e,isSelected:t}){const[n,r]=(0,J.useState)(!1),{refs:o,floatingStyles:i,context:s}=(0,Z.useFloating)({open:n||t,onOpenChange:r,whileElementsMounted:Z.autoUpdate,middleware:[(0,Z.size)(()=>({apply({elements:e,rects:t}){Object.assign(e.floating.style,{width:`${t.reference.width+2}px`,height:`${t.reference.height+2}px`})}})),(0,Z.offset)(({rects:e})=>-e.reference.height/2-e.floating.height/2)]});return(0,J.useEffect)(()=>{o.setReference(e)},[e,o]),{isVisible:n||t,context:s,floating:{setRef:o.setFloating,ref:o.floating,styles:i}}}var Q=__toESM(n(97557)),ee=n(79513),te=n(77422),ne=n(97557);function useBindReactPropsToElement(e,t){(0,ne.useEffect)(()=>{const n=e,{events:r,attrs:o}=function groupProps(e){const t=/^on(?=[A-Z])/;return Object.entries(e).reduce((e,[n,r])=>{if(!t.test(n))return e.attrs.push([n,r]),e;const o=n.replace(t,"").toLowerCase(),i=r;return e.events.push([o,i]),e},{events:[],attrs:[]})}(t());return r.forEach(([e,t])=>n.addEventListener(e,t)),o.forEach(([e,t])=>n.setAttribute(e,t)),()=>{r.forEach(([e,t])=>n.removeEventListener(e,t)),o.forEach(([e])=>n.removeAttribute(e))}},[t,e])}var re=[".e-off-canvas"],oe=new Set(["e-form-input"]);var ie="elementor-preview-responsive-wrapper",se=(0,ee.styled)(ee.Box,{shouldForwardProp:e=>"isSelected"!==e&&"isSmallerOffset"!==e&&"isGlobal"!==e})(({theme:e,isSelected:t,isSmallerOffset:n,isGlobal:r})=>({outline:`${t?"2px":"1px"} solid ${r?e.palette.global.main:e.palette.primary.light}`,outlineOffset:t&&!n?"-2px":"-1px",pointerEvents:"none"})),OutlineOverlay=({element:e,isSelected:t,id:n,isGlobal:r=!1,widgetType:o})=>{const{context:i,floating:s,isVisible:a}=useFloatingOnElement({element:e,isSelected:t}),{getFloatingProps:l,getReferenceProps:c}=(0,te.useInteractions)([(0,te.useHover)(i)]),u=(()=>{const e=window.elementor?.$preview?.[0];return!!e&&re.map(t=>Array.from(e?.contentWindow?.document.body.querySelectorAll(t)??[])).flat().some(e=>e.checkVisibility({opacityProperty:!0,visibilityProperty:!0,contentVisibilityAuto:!0}))})();useBindReactPropsToElement(e,c);const d=function shouldUseSmallerOutlineOffset(e,t){return e.offsetHeight<=1||void 0!==t&&oe.has(t)}(e,o);return a&&!u&&Q.createElement(te.FloatingPortal,{id:ie},Q.createElement(se,{ref:s.setRef,isSelected:t,isGlobal:r,style:s.styles,"data-element-overlay":n,role:"presentation",isSmallerOffset:d,...l()}))},ae=__toESM(n(97557)),le=n(97557),ce=__toESM(n(97557));function Cell({x:e,y:t,width:n,height:r,color:o}){return ce.createElement("rect",{x:e,y:t,width:n,height:r,fill:"none",stroke:o||"rgba(0, 0, 0, 0.12)",strokeWidth:1,strokeDasharray:"2 2",vectorEffect:"non-scaling-stroke"})}var ue=__toESM(n(97557));function FirstEmptyCell({rect:e,color:t}){const n=Math.min(19,e.width,e.height);if(n<=0)return null;const r=e.x+e.width/2,o=e.y+e.height/2;return ue.createElement("i",{className:"eicon-plus","aria-hidden":"true",style:{position:"absolute",left:r,top:o,transform:"translate(-50%, -50%)",fontSize:n,color:t,lineHeight:1,pointerEvents:"none"}})}var de=__toESM(n(97557));function Line({x1:e,y1:t,x2:n,y2:r,color:o}){return de.createElement("line",{x1:e,y1:t,x2:n,y2:r,stroke:o||"rgba(0, 0, 0, 0.12)",strokeWidth:1,strokeDasharray:"2 2",vectorEffect:"non-scaling-stroke"})}var renderLines=(e,t,n)=>{const{vertical:r,horizontal:o}=function computeGridLines(e,t,n){const{columns:r,rows:o,columnGap:i,rowGap:s,padding:a}=e,l=r.length>0,c=o.length>0;if(!l&&!c)return{vertical:[],horizontal:[]};const u=l?computeTrackSegments(r,i,a.left):[{start:a.left,size:t-a.left-a.right}],d=c?computeTrackSegments(o,s,a.top):[{start:a.top,size:n-a.top-a.bottom}],f=uniqueSorted(u.flatMap(e=>[e.start,e.start+e.size])),m=uniqueSorted(d.flatMap(e=>[e.start,e.start+e.size])),p=m[0],g=m[m.length-1],h=f[0],y=f[f.length-1];return{vertical:f.map(e=>({x1:e,y1:p,x2:e,y2:g})),horizontal:m.map(e=>({x1:h,y1:e,x2:y,y2:e}))}}(e,t,n);return[...r.map((t,n)=>ae.createElement(Line,{key:`v${n}`,x1:snapToHalfPixel(t.x1),y1:Math.round(t.y1),x2:snapToHalfPixel(t.x2),y2:Math.round(t.y2),color:e.borderColor})),...o.map((t,n)=>ae.createElement(Line,{key:`h${n}`,x1:Math.round(t.x1),y1:snapToHalfPixel(t.y1),x2:Math.round(t.x2),y2:snapToHalfPixel(t.y2),color:e.borderColor}))]};function GridOutline({element:e,tracks:t,width:n,height:r}){const o=(0,le.useMemo)(()=>function computeCellRects(e,t,n){const{columns:r,rows:o,columnGap:i,rowGap:s,padding:a}=e,l=r.length>0,c=o.length>0;if(!l&&!c)return[];const u=l?computeTrackSegments(r,i,a.left):[{start:a.left,size:t-a.left-a.right}],d=c?computeTrackSegments(o,s,a.top):[{start:a.top,size:n-a.top-a.bottom}],f=[];for(const e of d)for(const t of u)f.push({x:t.start,y:e.start,width:t.size,height:e.size});return f}(t,n,r),[t,n,r]),i=t.columnGap>0||t.rowGap>0,s=(0,le.useMemo)(()=>findFirstEmptyCell(e,t.columns.length,t.rows.length),[e,t]),a=s&&t.columns.length>0?o[s.row*t.columns.length+s.col]:null;return ae.createElement(ae.Fragment,null,ae.createElement("svg",{width:n,height:r,style:{position:"absolute",inset:0,overflow:"visible"},xmlns:"http://www.w3.org/2000/svg"},i?((e,t)=>e.map((e,n)=>ae.createElement(Cell,{key:n,x:snapToHalfPixel(e.x),y:snapToHalfPixel(e.y),width:Math.round(e.width),height:Math.round(e.height),color:t})))(o,t.borderColor):renderLines(t,n,r)),a&&!(e=>Boolean(e?.querySelector(".e-dragging-over, .elementor-dragging-on-child, .elementor-draggable-over, .elementor-widget-placeholder, .elementor-sortable-placeholder")))(e)&&ae.createElement(FirstEmptyCell,{rect:a,color:t.borderColor}))}var hasGridStyleDisplay=e=>"grid"===e.computedStyleMap().get("display")?.toString(),fe="atomic",me=[{component:OutlineOverlay,shouldRender:()=>!0},{component:({element:e})=>{const t=useElementRect(e),n=useGridTracks(e,t);return(0,N.useEffect)(()=>{if(!e)return;const t=findFirstEmptyCell(e,n.columns.length,n.rows.length);return t?(e.style.setProperty(z,String(t.row+1)),e.style.setProperty(U,String(t.col+1)),e.style.setProperty(H,"visible"),()=>{clearGridEmptyCellStyles(e)}):(e.style.removeProperty(z),e.style.removeProperty(U),e.style.setProperty(H,"hidden"),()=>clearGridEmptyCellStyles(e))},[e,n]),null},shouldRender:({element:e})=>hasGridStyleDisplay(e)},{component:({element:e,id:t,isSelected:n})=>{const r=(0,K.useElementEditorSettings)(t),o=r?.grid_outline,i=useElementRect(e),s=useGridTracks(e,i),{floating:a}=useFloatingOnElement({element:e,isSelected:n});return!1===o||0===s.columns.length&&0===s.rows.length?null:G.createElement(X.FloatingPortal,{id:ie},G.createElement(Y.Box,{ref:a.setRef,style:{...a.styles,pointerEvents:"none"},"data-grid-outline":t,role:"presentation"},G.createElement(GridOutline,{element:e,tracks:s,width:i.width,height:i.height})))},shouldRender:({isSelected:e,element:t})=>e&&hasGridStyleDisplay(t)}];function ElementsOverlays(){const e=(0,L.useSelectedElement)(),t=function useElementsDom(){return(0,M.__privateUseListenTo)([(0,M.windowEvent)("elementor/editor/element-rendered"),(0,M.windowEvent)("elementor/editor/element-destroyed")],()=>(0,L.getElements)().filter(e=>function isV4Element(e){if(!e)return!1;return fe in e||"eType"in e}(e.view?.el?.dataset)).map(e=>({id:e.id,domElement:e.view?.getDomElement?.()?.get?.(0),isGlobal:e.model.get("isGlobal")??!1,widgetType:e.model.get("widgetType")})).filter(e=>!!e.domElement))}(),n="edit"===(0,M.useEditMode)(),r=(0,M.__privateUseIsRouteActive)("panel/global");return n&&!r?t.map(({id:t,domElement:n,isGlobal:r,widgetType:o})=>{const i=e.element?.id===t;return me.map(({shouldRender:e,component:s},a)=>e({id:t,element:n,isSelected:i,widgetType:o})&&P.createElement(s,{key:`${t}-${a}`,id:t,element:n,isSelected:i,isGlobal:r,widgetType:o}))}):null}var pe=__toESM(n(97557)),ge=n(5527),he=n(79513),ye=n(97557),ve=n(87883),be=n(5527),we=n(97557);function useOnMount(e){const t=(0,we.useRef)(!1);(0,we.useEffect)(()=>{t.current||(t.current=!0,e())},[])}function sortByProviderPriority({provider:e},{provider:t}){return e.priority-t.priority}function createProviderSubscriber({provider:e,setInteractionItems:t}){return()=>{try{const n=e.actions.all(),r=e.getKey();t(t=>({...t,[r]:{provider:e,items:n}}))}catch{}}}function InteractionsRenderer(){const e=function usePortalContainer(){return(0,ge.__privateUseListenTo)((0,ge.commandEndEvent)("editor/documents/attach-preview"),()=>(0,ge.getCanvasIframeDocument)()?.head)}(),t=function useInteractionsItems(){const[e,t]=(0,ye.useState)({}),n=(0,ye.useMemo)(()=>{try{return ve.interactionsRepository.getProviders().map(e=>({provider:e,subscriber:createProviderSubscriber({provider:e,setInteractionItems:t})}))}catch{return[]}},[]);return(0,ye.useEffect)(()=>{if(0===n.length)return;const e=n.map(({provider:e,subscriber:t})=>e.subscribe(()=>{try{t()}catch{}}));return()=>{e.forEach(e=>e())}},[n]),useOnMount(()=>{0!==n.length&&(0,be.registerDataHook)("after","editor/documents/attach-preview",async()=>{n.forEach(({subscriber:e})=>{try{e()}catch{}})})}),(0,ye.useMemo)(()=>Object.values(e).sort(sortByProviderPriority).flatMap(({items:e})=>e),[e])}();if(!e)return null;const n=JSON.stringify(Array.isArray(t)?t:[]);return pe.createElement(he.Portal,{container:e},pe.createElement("script",{type:"application/json","data-e-interactions":"true",dangerouslySetInnerHTML:{__html:n}}))}var Ee=__toESM(n(97557)),Te=n(5527),Se=n(79513),xe=n(5527),Ce="data-e-removed",Re="data-elementor-id",_e="elementor-post-",Ae="-css";function useDocumentsCssLinks(){return(0,xe.__privateUseListenTo)((0,xe.commandEndEvent)("editor/documents/attach-preview"),()=>{const e=(0,xe.getCanvasIframeDocument)();if(!e)return[];const t=function getDocumentsIdsInCanvas(e){return[...e.body.querySelectorAll(`[${Re}]`)??[]].map(e=>e.getAttribute(Re)||"")}(e).map(e=>`${_e}${e}${Ae}`),n=function getDocumentsCssLinks(e){return[...e.head.querySelectorAll(`link[rel="stylesheet"][id^=${_e}][id$=${Ae}]`)??[]]}(e).filter(e=>t.includes(e.getAttribute("id")??""));return n.forEach(e=>{e.hasAttribute(Ce)||e.remove()}),n.map(e=>({...getLinkAttrs(e),id:e.getAttribute("id")??"",[Ce]:!0}))})}function getLinkAttrs(e){const t=[...e.attributes].map(e=>[e.name,e.value]);return Object.fromEntries(t)}var ke=n(97557),Oe=n(74518),Ie=n(47290),Pe=n(47182),Le=n(5527);var Me=n(5527),Ne=new Set;function signalizedProcess(e,t=[]){return{then:n=>(t.push(n),signalizedProcess(e,t)),execute:async()=>{let n;for(const r of t){if(e.aborted)break;n=await r(n,e)}}}}var De=n(97557),Fe=n(47290),$e=n(5527),Ve=n(2020),isMultiProps=e=>!!e&&"object"==typeof e&&"$$multi-props"in e&&!0===e["$$multi-props"],createMultiPropsValue=e=>({"$$multi-props":!0,value:e}),getMultiPropsValue=e=>e.value,je=3;function createPropsResolver({transformers:e,schema:t,onPropResolve:n}){async function resolve({props:e,schema:r,signal:o,renderContext:i}){r=r??t;const s=Promise.all(Object.entries(r).map(async([t,r])=>{const s=e[t]??r.default,a=await transform({value:s,key:t,type:r,signal:o,renderContext:i});return n?.({key:t,value:a,propValue:s,propType:r}),isMultiProps(a)?getMultiPropsValue(a):{[t]:a}}));return Object.assign({},...(await s).filter(Boolean))}async function transform({value:t,key:n,type:r,signal:o,depth:i=0,renderContext:s}){if(null==t)return null;if(!(0,Ve.isTransformable)(t))return t;if(i>je)return null;if(!0===t.disabled)return null;let a=r;if("union"===r.kind&&(a=r.prop_types[t.$$type],!a))return null;if(t.$$type!==a.key)return null;let l=t.value;"object"===a.kind&&(l=await resolve({props:l,schema:a.shape,signal:o,renderContext:s})),"array"===a.kind&&(l=await Promise.all(l.map(e=>transform({value:e,key:n,type:a.item_prop_type,depth:i,signal:o,renderContext:s}))));const c=e.get(t.$$type);if(!c)return null;try{return transform({value:await c(l,{key:n,signal:o,renderContext:s,propType:r}),key:n,type:r,signal:o,depth:i+1,renderContext:s})}catch{return null}}return resolve}var We=n(2020),maybeEnqueueFontFromStyleProp=(e,t,n)=>{if(!(0,We.isTransformable)(t)||t.disabled)return;const r="union"===e.kind?t.$$type:e.key,o=(0,We.getPropSchemaFromCache)(r);if(!o||!("getEnqueueFontFamily"in o)||"function"!=typeof o.getEnqueueFontFamily)return;const i=t.value;if("string"!=typeof i)return;const s=o.getEnqueueFontFamily(i);s&&n(s)};function createTransformersRegistry(){const e={};let t=null;return{register(t,n){return e[t]=n,this},registerFallback(e){return t=e,this},get(n){return e[n]??t},all(){return{...e}}}}var Be=createTransformersRegistry(),ze=createTransformersRegistry();var Ue=n(97557),He=n(74518),Ge=n(47290),qe=n(22444),Ke=n(22444),Ye=(0,Ke.createError)({code:"unknown_style_type",message:"Unknown style type"}),Xe=(0,Ke.createError)({code:"unknown_style_state",message:"Unknown style state"}),Je={class:"."},Ze="desktop",Qe="normal";function createStylesRenderer({resolve:e,breakpoints:t,selectorPrefix:n=""}){return async({styles:r,signal:o})=>{const i=new Set,s=r.filter(e=>{const t=function getStyleUniqueKey(e){const t=e.variants[0]?.meta?.breakpoint??Ze,n=e.variants[0]?.meta?.state??Qe;return`${e.id}-${t}-${n}`}(e);return!i.has(t)&&(i.add(t),!0)}).map(async r=>{const i=Object.values(r.variants).map(async i=>{const s=await async function propsToCss({props:e,resolve:t,signal:n}){const r=await t({props:e,signal:n});return Object.entries(r).reduce((e,[t,n])=>(null===n||e.push(t+":"+n+";"),e),[]).join("")}({props:i.props,resolve:e,signal:o}),a=function customCssToString(e){const t=(0,qe.decodeString)(e?.raw||"");if(!t.trim())return"";return t+"\n"}(i.custom_css);return createStyleWrapper().for(r.cssName,r.type).withPrefix(n).withState(i.meta.state).withMediaQuery(i.meta.breakpoint?t[i.meta.breakpoint]:null).wrap(s+a)}),s=await Promise.all(i);return{id:r.id,breakpoint:r?.variants[0]?.meta?.breakpoint||"desktop",value:s.join(""),state:r?.variants[0]?.meta?.state||null}});return await Promise.all(s)}}function createStyleWrapper(e="",t){return{for:(n,r)=>{const o=Je[r];if(!o)throw new Ye({context:{type:r}});return createStyleWrapper(`${e}${o}${n}`,t)},withPrefix:n=>createStyleWrapper([n,e].filter(Boolean).join(" "),t),withState:n=>createStyleWrapper((0,Ge.getSelectorWithState)(e,n),t),withMediaQuery:n=>{if(!n?.type)return createStyleWrapper(e,t);const r=`${n.type}:${n.width}px`;return createStyleWrapper(e,e=>`@media(${r}){${e}}`)},wrap:n=>{const r=`${e}{${n}}`;return t?t(r):r}}}var et=".elementor";function useStyleItems(){const e=function useStyleRenderer(e){const t=(0,He.useBreakpointsMap)();return(0,Ue.useMemo)(()=>createStylesRenderer({selectorPrefix:et,breakpoints:t,resolve:e}),[e,t])}(function useStylePropResolver(){return(0,De.useMemo)(()=>createPropsResolver({transformers:ze,schema:(0,Fe.getStylesSchema)(),onPropResolve:({propValue:e,propType:t})=>{maybeEnqueueFontFromStyleProp(t,e,$e.enqueueFont)}}),[])}()),t=(0,Oe.useBreakpoints)(),[n,r]=(0,ke.useState)({}),o=(0,ke.useRef)(new Map),i=(0,ke.useMemo)(()=>{const createEmptyCache=()=>({orderedIds:[],itemsById:new Map});return Pe.stylesRepository.getProviders().map(t=>({provider:t,subscriber:createProviderSubscriber2({provider:t,renderStyles:e,setStyleItems:r,getCache:()=>(e=>{const t=function safeGetKey(e){try{return e.getKey()}catch{return null}}(e);return t?(o.current.has(t)||o.current.set(t,createEmptyCache()),o.current.get(t)):createEmptyCache()})(t)})}))},[e]);(0,ke.useEffect)(()=>{const e=i.map(({provider:e,subscriber:t})=>e.subscribe(t));return()=>{e.forEach(e=>e())}},[i]),useOnMount(()=>{(0,Le.registerDataHook)("after","editor/documents/attach-preview",async()=>{!function resetRemovedProviders(){Ne.clear()}();const e=i.map(async({subscriber:e})=>e());await Promise.all(e)})});const s=(0,ke.useMemo)(()=>function createBreakpointSorter(e){return({breakpoint:t},{breakpoint:n})=>e.indexOf(t)-e.indexOf(n)}(t.map(e=>e.id)),[t]);return(0,ke.useMemo)(()=>Object.values(n).sort(prioritySorter).flatMap(({items:e})=>e).sort(stateSorter).sort(s),[n,s])}function prioritySorter({provider:e},{provider:t}){return e.priority-t.priority}function stateSorter({state:e},{state:t}){return(0,Ie.isClassState)(e)&&!(0,Ie.isClassState)(t)?-1:!(0,Ie.isClassState)(e)&&(0,Ie.isClassState)(t)?1:0}function createProviderSubscriber2({provider:e,renderStyles:t,setStyleItems:n,getCache:r}){return function abortPreviousRuns(e){let t=null;return(...n)=>(t&&t.abort(),t=new AbortController,e(t,...n))}((o,i,s)=>signalizedProcess(o.signal).then((n,o)=>{const a=r(),l=void 0!==s&&void 0!==i,c=a.orderedIds.length>0;return c&&e.isPregeneratedLink&&function removeProviderPregeneratedLinks(e,t){if(Ne.has(e))return;const n=(0,Me.getCanvasIframeDocument)();if(!n)return;n.head.querySelectorAll('link[rel="stylesheet"]').forEach(e=>{const{id:n,href:r,media:o}=e;t({id:n,href:r,media:o})&&e.remove()}),Ne.add(e)}(e.getKey(),e.isPregeneratedLink),l&&c?async function updateItems(n,r,o,i){const s=function getChangedStyleIds(e,t){const n=[];for(const r of Object.keys(t)){const o=t[r],i=e[r];i&&o===i||n.push(r)}return n}(r,o);if(n.orderedIds=e.actions.all().map(e=>e.id).reverse(),s.length>0){const r=breakToBreakpoints(s.map(t=>e.actions.get(t)).filter(e=>!!e).map(t=>({...t,cssName:e.actions.resolveCssName(t.id)})));return t({styles:r,signal:i}).then(e=>(function updateCacheItems(e,t,n){for(const n of t)e.itemsById.delete(n);for(const t of n){const n=e.itemsById.get(t.id)||[];n.push(t),e.itemsById.set(t.id,n)}}(n,s,e),getOrderedItems(n)))}return getOrderedItems(n)}(a,i,s,o):async function createItems(n,r){const o=e.actions.all(),i=[...o].reverse().map(t=>({...t,cssName:e.actions.resolveCssName(t.id)}));return t({styles:breakToBreakpoints(i),signal:r}).then(e=>(function rebuildCache(e,t,n){e.orderedIds=t.map(e=>e.id).reverse(),e.itemsById.clear();for(const t of n){const n=e.itemsById.get(t.id)||[];n.push(t),e.itemsById.set(t.id,n)}}(n,o,e),getOrderedItems(n)))}(a,o)}).then(t=>{n(n=>({...n,[e.getKey()]:{provider:e,items:t}}))}).execute());function breakToBreakpoints(e){return Object.values(e.reduce((e,t)=>(t.variants.forEach(n=>{const r=n.meta.breakpoint||"desktop";e[t.id]||(e[t.id]={}),e[t.id][r]||(e[t.id][r]={...t,variants:[]}),e[t.id][r].variants.push(n)}),e),{})).flatMap(e=>Object.values(e))}}function getOrderedItems(e){return e.orderedIds.map(t=>e.itemsById.get(t)).filter(e=>void 0!==e).flat()}function StyleRenderer(){const e=function usePortalContainer2(){return(0,Te.__privateUseListenTo)((0,Te.commandEndEvent)("editor/documents/attach-preview"),()=>(0,Te.getCanvasIframeDocument)()?.head)}(),t=useStyleItems(),n=useDocumentsCssLinks();return e?Ee.createElement(Se.Portal,{container:e},function filterUniqueStyleDefinitions(e){const t=new Map;return e.filter(e=>{const n=t.get(e.id);if(n){return!n.find(t=>t.breakpoint===e.breakpoint&&t.state===e.state)&&(n.push(e),!0)}return t.set(e.id,[e]),!0})}(t).map(e=>Ee.createElement("style",{key:`${e.id}-${e.breakpoint}-${e.state??"normal"}`},e.value)),n.map(e=>Ee.createElement("link",{...e,key:e.id}))):null}var tt=n(24778),nt=n(5527),rt=n(27723),ot=n(70975),it="e-form",st=new Set(["e-form-input","e-form-textarea","e-form-label","e-form-checkbox","e-form-submit-button","e-form-select","e-form-radio-button","e-form-file-upload","e-form-date-picker","e-form-time-picker"]);function getArgsElementType(e){return e.model?.widgetType||e.model?.elType}function getElementType(e){return e?.model.get("widgetType")||e?.model.get("elType")}function getClipboardElementType(e){return e?.widgetType||e?.elType}function isWithinForm(e){return function isElementWithinFormSelector(e){return!!e?.view?.el?.closest('form,[data-element_type="e-form"]')}(e)}function hasElementType(e,t){return(0,ot.getAllDescendants)(e).some(e=>getElementType(e)===t)}function hasClipboardElementType(e,t){return e.some(e=>getClipboardElementType(e)===t||!!e.elements&&hasClipboardElementType(e.elements,t))}function hasClipboardElementTypes(e,t){return e.some(e=>{const n=getClipboardElementType(e);return!(!n||!t.has(n))||!!e.elements&&hasClipboardElementTypes(e.elements,t)})}function hasFormAncestor(e){return null!==e.closest(it)}function collectFormAncestorErrors(e){const t=[];for(const n of e.querySelectorAll("*")){if(!st.has(n.tagName.toLowerCase()))continue;if(hasFormAncestor(n))continue;const e=n.getAttribute("configuration-id");t.push(`<${n.tagName}${e?` configuration-id="${e}"`:""}> must be nested inside (any ancestor depth is allowed).`)}return t}function collectSubmitButtonErrors(e){const t=[];for(const n of e.querySelectorAll("e-form")){const e=n.querySelectorAll("e-form-submit-button");0===e.length?t.push(" has no ."):e.length>1&&t.push(` has ${e.length} submit buttons — only 1 is allowed.`)}return t}function collectEmptyMessageErrors(e){const t=[];for(const n of e.querySelectorAll("e-form-success-message, e-form-error-message"))0===n.children.length&&t.push(`<${n.tagName}> must have at least one child element (e.g. ).`);return t}var at={type:"default",message:(0,rt.__)("Form elements must be placed inside a form.","elementor"),id:"form-fields-outside-form-blocked"};function blockFormFieldCreate(e){const t=getArgsElementType(e);if(!t||!st.has(t))return!1;return!!(e.containers??[e.container]).some(e=>!isWithinForm(e))&&(handleBlockedFormField(),!0)}function blockFormFieldMove(e){const{containers:t=[e.container],target:n}=e;return!(!t.some(e=>!!e&&(!hasElementType(e,it)&&function hasElementTypes(e,t){return(0,ot.getAllDescendants)(e).some(e=>{const n=getElementType(e);return!!n&&t.has(n)})}(e,st)))||isWithinForm(n)||function movedContainersIncludeAtomicFormRoot(e){return e.some(e=>getElementType(e)===it)}(t))&&(handleBlockedFormField(),!0)}function blockFormFieldPaste(e){const{storageType:t}=e;if("localstorage"!==t)return!1;const n=window?.elementorCommon?.storage?.get();if(!n?.clipboard?.elements)return!1;return!(!hasClipboardElementTypes(n.clipboard.elements,st)||isWithinForm(e.container)||function clipboardRootsAreAtomicForms(e){return!!e.length&&e.every(e=>getClipboardElementType(e)===it)}(n.clipboard.elements))&&(handleBlockedFormField(),!0)}function handleBlockedFormField(){(0,tt.notify)(at)}var lt=n(24778),ct=n(5527),ut={type:"default",message:(0,n(27723).__)("Forms can't be nested. Create separate forms instead.","elementor"),id:"form-nesting-blocked"};function blockFormCreate(e){const t=getArgsElementType(e);return!!t&&(!(t!==it||!isWithinForm(e.container))&&(handleBlockedFormField2(),!0))}function blockFormMove(e){const{containers:t=[e.container],target:n}=e;return!(!t.some(e=>!!e&&hasElementType(e,it))||!isWithinForm(n))&&(handleBlockedFormField2(),!0)}function blockFormPaste(e){const{storageType:t}=e;if("localstorage"!==t)return!1;const n=window?.elementorCommon?.storage?.get();if(!n?.clipboard?.elements)return!1;return!(!hasClipboardElementType(n.clipboard.elements,it)||!isWithinForm(e.container))&&(handleBlockedFormField2(),!0)}function handleBlockedFormField2(){(0,lt.notify)(ut)}var dt=createTransformersRegistry();function createTransformer(e){return e}var attributesTransformer=()=>"",ft=n(47182);function createClassesTransformer(){const e=new Map;return t=>t.map(t=>function transformClassId(e,t){if(!t.has(e)){const n=ft.stylesRepository.getProviders().find(t=>t.actions.all().find(t=>t.id===e));if(!n)return e;t.set(e,n.getKey())}const n=t.get(e),r=ft.stylesRepository.getProviderByKey(n);return r?.actions.resolveCssName(e)??e}(t,e)).filter(Boolean)}var dateRangeTransformer=e=>e&&0!==Object.keys(e).length?{min:e.min||null,max:e.max||null}:null,dateTimeTransformer=e=>e.map(e=>{const t=(e.date||"").trim(),n=(e.time||"").trim();return t||n?`${t} ${n}`.trim():""}).join(" "),htmlV2Transformer=e=>e?.content??"",htmlV3Transformer=e=>e?.content??"",linkTransformer=({destination:e,isTargetBlank:t,tag:n})=>({href:"number"==typeof e?"#post-id-"+e:e,target:t?"_blank":"_self",tag:n??"a"}),queryTransformer=({id:e})=>e??null,timeRangeTransformer=e=>e&&0!==Object.keys(e).length?{min:e.min||null,max:e.max||null}:null,imageSrcTransformer=e=>({id:e.id??null,url:e.url??null,alt:e.alt??null}),mt=n(84792),imageTransformer=async e=>{const{src:t,size:n}=e;if(!t?.id)return t?.url?{src:t.url,alt:t.alt??""}:null;const r=await(0,mt.getMediaAttachment)({id:t.id}),o=r?.sizes?.[n??""];return o?{src:o.url,height:o.height,width:o.width,alt:r.alt}:r?{src:r.url,height:r.height,width:r.width,alt:r.alt}:null},plainTransformer=e=>e,pt=__toESM(n(25454)),gt=n(84792),ht="width: 100%; height: 100%; overflow: unset;";var svgSrcTransformer=async(e,{signal:t})=>{const n=function resolveSvgSrcId(e){return"number"!=typeof e||e<=0?null:e}(e.id),r="string"==typeof e.url?e.url:null;let o=r;if(n&&!r){const e=await(0,gt.getMediaAttachment)({id:n});o=e?.url??null}const i="string"==typeof o?o:null;if(!i)return{html:null,url:null};const s=await async function fetchSvgContent(e,t){try{const n=await fetch(e,{signal:t});if(!n.ok)return null;const r=n.headers.get("content-type")??"";return r.includes("svg")||r.includes("xml")||e.endsWith(".svg")?await n.text():null}catch{return null}}(i,t),a=s?function processSvgContent(e){const t=pt.default.sanitize(e,{USE_PROFILES:{svg:!0,svgFilters:!0}}),n=(new DOMParser).parseFromString(t,"image/svg+xml").querySelector("svg");if(!n)return null;n.setAttribute("fill","currentColor");const r=(n.getAttribute("style")??"").trim(),o=r?`${r.replace(/;$/,"")}; ${ht}`:ht;return n.setAttribute("style",o),n.outerHTML}(s):null;return{html:a,url:i}},yt=n(84792),videoSrcTransformer=async e=>{const{id:t,url:n}=e;if(!t)return{id:null,url:n};const r=await(0,yt.getMediaAttachment)({id:t});return{id:t,url:r?.url??n}};var backgroundColorOverlayTransformer=e=>{const{color:t=null}=e;return t?`linear-gradient(${t}, ${t})`:null},backgroundGradientOverlayTransformer=e=>"radial"===e.type?`radial-gradient(circle at ${e.positions}, ${e.stops})`:`linear-gradient(${e.angle}deg, ${e.stops})`,backgroundImageOverlayTransformer=e=>{const{image:t,size:n=null,position:r=null,repeat:o=null,attachment:i=null}=e;if(!t)return null;return{src:t.src?`url(${t.src})`:null,repeat:o,attachment:i,size:n,position:r}},backgroundImageSizeScaleTransformer=({width:e,height:t})=>`${e??"auto"} ${t??"auto"}`,backgroundOverlayTransformer=e=>{if(!e||0===e.length)return null;const t=function normalizeOverlayValues(e){return e.map(e=>"string"==typeof e?{src:e,repeat:null,attachment:null,size:null,position:null}:e).filter(e=>e&&!!e.src)}(e);if(0===t.length)return null;return{"background-image":getValuesString(t,"src","none",!0),"background-repeat":getValuesString(t,"repeat","repeat"),"background-attachment":getValuesString(t,"attachment","scroll"),"background-size":getValuesString(t,"size","auto auto"),"background-position":getValuesString(t,"position","0% 0%")}};function getValuesString(e,t,n,r=!1){if(0===e.filter(e=>e?.[t]).length)return n;const o=e.map(e=>e[t]??n);if(!r){if(o.every(e=>e===o[0]))return o[0]}return o.join(",")}var backgroundTransformer=e=>{const{color:t=null,"background-overlay":n=null,clip:r=null}=e;return createMultiPropsValue({...n,"background-color":t,"background-clip":r})},colorStopTransformer=e=>`${e?.color} ${e?.offset??0}%`,createCombineArrayTransformer=e=>t=>t?.length?t.filter(Boolean).join(e):null,createMultiPropsTransformer=(e,t)=>(n,{key:r})=>{const o=e.filter(e=>n[e]).map(e=>[t({propKey:r,key:e}),n[e]]);return createMultiPropsValue(Object.fromEntries(o))},filterTransformer=e=>e?.length<1?null:e.filter(Boolean).map(mapToFilterFunctionString).join(" "),mapToFilterFunctionString=e=>{if("drop-shadow"===e.func){const{xAxis:t,yAxis:n,blur:r,color:o}=e.args;return`drop-shadow(${t||"0px"} ${n||"0px"} ${r||"10px"} ${o||"transparent"})`}const t=e.args?.size;return e.func&&t?`${e.func}(${t})`:""},flexTransformer=e=>{const t=e.flexGrow,n=e.flexShrink,r=e.flexBasis,o=null!=t,i=null!=n,s=null!=r;return o||i||s?o&&i&&s?`${t} ${n} ${"object"==typeof r&&void 0!==r.size?`${r.size}${r.unit||""}`:r}`:o&&i&&!s?`${t} ${n}`:o&&!i&&s?`${t} 1 ${"object"==typeof r&&void 0!==r.size?`${r.size}${r.unit||""}`:r}`:!o&&i&&s?`0 ${n} ${"object"==typeof r&&void 0!==r.size?`${r.size}${r.unit||""}`:r}`:!o||i||s?o||!i||s?o||i||!s?null:`0 1 ${"object"==typeof r&&void 0!==r.size?`${r.size}${r.unit||""}`:r}`:`0 ${n}`:`${t}`:null},fontFamilyTransformer=e=>{if("string"!=typeof e||!e.trim())return null;const t=e.trim();return t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")?t:`"${t}"`},vt=new Set(["grid-template-columns","grid-template-rows"]),isGridTrackProperty=e=>vt.has(e),formatGridTrackRepeat=e=>!Number.isFinite(e)||e<1?null:`repeat(${e}, 1fr)`,gridTrackSizeTransformer=e=>"custom"===e.unit?e.size:"fr"===e.unit?formatGridTrackRepeat(Math.trunc(Number(e.size))):`${e.size}${e.unit}`;function getVal(e){return`${e??"0px"}`}var perspectiveOriginTransformer=e=>`${getVal(e?.x)} ${getVal(e?.y)}`,positionTransformer=({x:e,y:t})=>`${e??"0px"} ${t??"0px"}`,shadowTransformer=e=>[e.hOffset,e.vOffset,e.blur,e.spread,e.color,e.position].filter(Boolean).join(" "),sizeTransformer=e=>"auto"===e.unit?"auto":"custom"===e.unit?e.size:`${e.size}${e.unit}`,spanTransformer=e=>e?.trim()||null,strokeTransformer=e=>{const t={"-webkit-text-stroke":`${e.width} ${e.color}`,stroke:`${e.color}`,"stroke-width":`${e.width}`};return createMultiPropsValue(t)},transformFunctionsTransformer=e=>e?.length<1?null:e.join(" "),bt="0px",transformMoveTransformer=e=>`translate3d(${e.x??bt}, ${e.y??bt}, ${e.z??bt})`;function getVal2(e){return`${e??"0px"}`}var transformOriginTransformer=e=>{const t=getVal2(e.x),n=getVal2(e.y),r=getVal2(e.z);return"50%"===t&&"50%"===n&&"0px"===r?null:`${t} ${n} ${r}`},wt="0deg",transformRotateTransformer=e=>[`rotateX(${e?.x??wt})`,`rotateY(${e?.y??wt})`,`rotateZ(${e?.z??wt})`].join(" "),transformScaleTransformer=e=>`scale3d(${e.x??1}, ${e.y??1}, ${e.z??1})`,Et="0deg",transformSkewTransformer=e=>`skew(${e?.x??Et}, ${e?.y??Et})`,Tt=n(77394),transitionTransformer=e=>{if(e?.length<1)return null;const t=(()=>{const e=new Set;return Tt.transitionProperties.forEach(t=>{t.properties.forEach(t=>{e.add(t.value)})}),e})(),n=e.map(e=>mapToTransitionString(e,t)).filter(Boolean);return 0===n.length?null:n.join(", ")},mapToTransitionString=(e,t)=>{if(!e.selection||!e.size)return"";const n=e.selection.value;return t.has(n)?`${n} ${e.size}`:""};var St=n(70975),xt=n(5527),Ct=n(9854);function createDomRenderer(){const e=(0,Ct.createArrayLoader)({}),t=(0,Ct.createEnvironment)(e);return t.registerEscapingStrategy(escapeHtmlTag,"html_tag"),t.registerEscapingStrategy(escapeURL,"full_url"),{register:e.setTemplate,render:t.render}}function escapeHtmlTag(e){return["a","article","aside","button","div","footer","h1","h2","h3","h4","h5","h6","header","main","nav","p","section","span"].includes(e)?e:"div"}function escapeURL(e){const t=["http:","https:","mailto:","tel:"];try{const n=new URL(e);return t.includes(n.protocol)?e:""}catch{return""}}function createElementViewClassDeclaration(){const e=window;return class extends e.elementor.modules.elements.views.Widget{onRender(...e){super.onRender(...e),this.#e("elementor/preview/atomic-widget/render"),this.#t("elementor/element/render")}onDestroy(...e){super.onDestroy(...e),this.#e("elementor/preview/atomic-widget/destroy"),this.#t("elementor/element/destroy")}attributes(){return{...super.attributes(),"data-atomic":"",style:"display: contents !important;"}}behaviors(){const e=["InlineEditing","Draggable","Resizable"],t=Object.entries(super.behaviors()).filter(([t])=>!e.includes(t));return Object.fromEntries(t)}getDomElement(){return this.$el.find(":first-child")}getHandlesOverlay(){return null}#e(e){window.top?.dispatchEvent(new CustomEvent(e,{detail:{id:this.model.get("id")}}))}#t(t){const n=this.getDomElement().get(0);n&&e.elementor?.$preview?.[0]?.contentWindow.dispatchEvent(new CustomEvent(t,{detail:{id:this.model.get("id"),type:this.model.get("widgetType"),element:n}}))}getContextMenuGroups(){return super.getContextMenuGroups().filter(e=>"save"!==e.name)}}}var Rt=n(70975),_t=n(70975);function createPendingElement(e,t,n={}){const r=e.getContainer(),o={...t};o.id||(o.id=(0,_t.generateElementId)()),o.elements||(o.elements=[]);if(!(0,_t.addModelToParent)(r.id,o,n))return;const i=o.id,s=(0,_t.findModelInDocument)(i);if(!s)return;const a={id:i,settings:{get:()=>({}),set:()=>({}),toJSON:()=>({})},parent:r,model:s,view:void 0,lookup(){return(0,_t.getContainer)(i)??a}};return e.once("render",()=>{e.model?.trigger?.("navigator:add",s,n)}),!1!==n.edit&&function selectChildWhenWrapperRenders(e,t){e.once("render",()=>{const n=(0,_t.getContainer)(t);n?.model?.trigger?n.model.trigger("request:edit"):e.model?.trigger?.("request:edit")})}(e,i),{getContainer:()=>a}}function setupTwigRenderer({renderer:e,element:t}){const n=t.twig_main_template,r=t.base_styles_dictionary;Object.entries(t.twig_templates).forEach(([t,n])=>{e.register(t,n)});return{templateKey:n,baseStylesDictionary:r,resolveProps:createPropsResolver({transformers:dt,schema:t.atomic_props_schema})}}function createBeforeRender(e){e._ensureViewIsIntact(),e._isRendering=!0,e.resetChildViewContainer(),e.triggerMethod("before:render",e)}function createAfterRender(e){e._isRendering=!1,e.isRendered=!0,e.triggerMethod("render",e)}function rerenderExistingChildren(e){e.children?.each(e=>{e.render()})}async function waitForChildrenToComplete(e){const t=[];e.children?.each(e=>{e._currentRenderPromise&&t.push(e._currentRenderPromise)}),t.length>0&&await Promise.all(t)}function canBeTemplated(e){return!!(e.atomic_props_schema&&e.twig_templates&&e.twig_main_template&&e.base_styles_dictionary)}function createTemplatedElementView({type:e,renderer:t,element:n}){const r=createElementViewClassDeclaration(),{templateKey:o,baseStylesDictionary:i,resolveProps:s}=setupTwigRenderer({type:e,renderer:t,element:n});return class extends r{_abortController=null;_lastResolvedSettingsHash=null;_domUpdateWasSkipped=!1;getTemplateType(){return"twig"}getNamespaceKey(){return e}renderOnChange(){this.render()}getRenderContext(){return this._parent?.getRenderContext?.()}getResolverRenderContext(){return this._parent?.getResolverRenderContext?.()}invalidateRenderCache(){this._lastResolvedSettingsHash=null}render(){this._abortController?.abort(),this._abortController=new AbortController;const e=signalizedProcess(this._abortController.signal).then(()=>this._beforeRender()).then(()=>this._renderTemplate()).then(()=>this._renderChildren()).then(()=>this._afterRender());return this._currentRenderPromise=e.execute(),this._currentRenderPromise}async _renderChildren(){this._shouldReuseChildren()?rerenderExistingChildren(this):super._renderChildren(),await waitForChildrenToComplete(this)}_shouldReuseChildren(){return this._domUpdateWasSkipped&&this.children?.length>0}async _renderTemplate(){this.triggerMethod("before:render:template");const n=signalizedProcess(this._abortController?.signal).then((e,t)=>{const n=this.model.get("settings").toJSON();return s({props:n,signal:t,renderContext:this.getResolverRenderContext()})}).then(e=>this.afterSettingsResolve(e)).then(async n=>{const r=JSON.stringify(n);if(!(r!==this._lastResolvedSettingsHash)&&this.isRendered)return this._domUpdateWasSkipped=!0,null;this._domUpdateWasSkipped=!1,this._lastResolvedSettingsHash=r;const s={id:this.model.get("id"),interaction_id:this.getInteractionId(),type:e,settings:n,base_styles:i,...this.getResolverRenderContext?.()??{}};return t.render(o,s)}).then(e=>{null!==e&&this.$el.html(e)});await n.execute(),this.bindUIElements(),this.triggerMethod("render:template")}afterSettingsResolve(e){return e}_beforeRender(){createBeforeRender(this)}_afterRender(){createAfterRender(this)}_doAfterRender(e){this.isRendered?e():this.once("render",e)}_openEditingPanel(e){this._doAfterRender(()=>super._openEditingPanel(e))}getInteractionId(){const e=this.model.get("originId"),t=this.model.get("id");return e??t}}}function canBeNestedTemplated(e){return canBeTemplated(e)&&"support_nesting"in e&&!!e.support_nesting}function createNestedTemplatedElementType({type:e,renderer:t,element:n,modelExtensions:r}){const o=window;return class extends o.elementor.modules.elements.types.Base{getType(){return e}getView(){return createNestedTemplatedElementView({type:e,renderer:t,element:n})}getModel(){const e=o.elementor.modules.elements.models.AtomicElementBase;return r&&Object.keys(r).length>0?e.extend(r):e}}}function buildEditorAttributes(e){const t=e.get("id"),n=e.get("originId"),r={"data-model-cid":e.cid??"","data-interaction-id":n??t,"x-ignore":"true"};return Object.entries(r).map(([e,t])=>`${e}="${t}"`).join(" ")}function buildEditorClasses(e){return["elementor-element","elementor-element-edit-mode",`elementor-element-${e.get("id")}`].join(" ")}function createNestedTemplatedElementView({type:e,renderer:t,element:n}){const r=window,{templateKey:o,baseStylesDictionary:i,resolveProps:s}=setupTwigRenderer({type:e,renderer:t,element:n}),a=r.elementor.modules.elements.views.createAtomicElementBase(e),l=a.prototype._renderChildren,c=a.prototype._openEditingPanel,u=a.prototype.addElement;return a.extend({_abortController:null,_lastResolvedSettingsHash:null,_domUpdateWasSkipped:!1,template:!1,attributes(){return{"data-model-cid":this.model.cid}},getTemplateType(){return"twig"},invalidateRenderCache(){this._lastResolvedSettingsHash=null},renderOnChange(){this.render()},render(){this._abortController?.abort(),this._abortController=new AbortController;const e=signalizedProcess(this._abortController.signal).then(()=>this._beforeRender()).then(()=>this._renderTemplate()).then(()=>this._onTemplateReady()).then(()=>this._renderChildren()).then(()=>this._afterRender());return this._currentRenderPromise=e.execute(),this._currentRenderPromise},_beforeRender(){createBeforeRender(this)},_onTemplateReady(){this.dispatchPreviewEvent("elementor/element/render")},_afterRender(){createAfterRender(this),this.dispatchPreviewEvent("elementor/element/rendered"),requestAnimationFrame(()=>{this._initAlpine()}),this.model.trigger("render:complete"),window.dispatchEvent(new CustomEvent(Rt.ELEMENT_STYLE_CHANGE_EVENT))},async _renderTemplate(){const n=this.model;this.triggerMethod("before:render:template");const r=signalizedProcess(this._abortController?.signal).then((e,t)=>{const r=n.get("settings").toJSON();return s({props:r,signal:t,renderContext:this.getResolverRenderContext?.()})}).then(async r=>{const s=this.afterSettingsResolve(r),a=JSON.stringify(s);if(!(a!==this._lastResolvedSettingsHash)&&this.isRendered)return this._domUpdateWasSkipped=!0,null;this._domUpdateWasSkipped=!1,this._lastResolvedSettingsHash=a;const l={id:n.get("id"),interaction_id:this.getInteractionId(),type:e,settings:s,base_styles:i,editor_attributes:buildEditorAttributes(n),editor_classes:buildEditorClasses(n),...this.getResolverRenderContext?.()??{}};return t.render(o,l)}).then(e=>{null!==e&&this._attachTwigContent(e)});await r.execute(),this.bindUIElements(),this.triggerMethod("render:template")},afterSettingsResolve(e){return e},getRenderContext(){return this._parent?.getRenderContext?.()},getResolverRenderContext(){return this._parent?.getResolverRenderContext?.()},getChildType(){const e=n.allowed_child_types??[];return e&&e.length>0?e:a.prototype.getChildType.call(this)},_attachTwigContent(e){const t=r.jQuery(e),n=this.$el.get(0),o=t.get(0);if(!n||!o)return;this._destroyAlpine();const i=this.getHandlesOverlay()?.get(0)?.outerHTML??"",s=n.tagName!==o.tagName,a=s?(n.ownerDocument??document).createElement(o.tagName):n;Array.from(o.attributes).forEach(e=>{a.setAttribute(e.name,e.value)}),a.innerHTML=i+o.innerHTML,s&&(n.replaceWith(a),this.setElement(r.jQuery(a)))},async _renderChildren(){this._shouldReuseChildren()?rerenderExistingChildren(this):l.call(this),await waitForChildrenToComplete(this),this._removeChildrenPlaceholder()},_shouldReuseChildren(){return this._domUpdateWasSkipped&&this.children?.length>0},_removeChildrenPlaceholder(){const e=this.$el.get(0);if(!e)return;const t=Array.from(e.childNodes).find(e=>e.nodeType===Node.COMMENT_NODE&&"elementor-children-placeholder"===e.nodeValue?.trim());t?.remove()},getChildViewContainer(){return this.childViewContainer="",this.$el},attachBuffer(e,t){const n=this.$el.get(0);if(!n)return;const r=Array.from(n.childNodes).find(e=>e.nodeType===Node.COMMENT_NODE&&"elementor-children-placeholder"===e.nodeValue?.trim());r?(r.parentNode?.insertBefore(t,r),r.remove()):n.append(t)},getDomElement(){return this.$el},onBeforeDestroy(){this._abortController?.abort()},onDestroy(){this.dispatchPreviewEvent("elementor/element/destroy")},_destroyAlpine(){const e=this.$el.get(0);if(!e)return;if(!e.getAttribute("x-data"))return;const t=e.ownerDocument?.defaultView;t?.Alpine?.destroyTree(e)},_initAlpine(){const e=this.$el.get(0);if(!e)return;e.removeAttribute("x-ignore");if(!e.getAttribute("x-data"))return;const t=e.ownerDocument?.defaultView;t?.Alpine?.initTree(e)},_doAfterRender(e){this.isRendered?e():this.once("render",e)},_openEditingPanel(e){this._doAfterRender(()=>c.call(this,e))},addElement(e,t){return this.isRendered?u.call(this,e,t):createPendingElement(this,e,t)},getInteractionId(){const e=this.model.get("originId"),t=this.model.get("id");return e??t}})}function createProPromotionNestedType({type:e,renderer:t,element:n}){if(!canBeNestedTemplated(n))throw new Error(`Element "${e}" is not a valid nested templated element.`);const r=createNestedTemplatedElementType({type:e,renderer:t,element:n});let o=null;return class extends r{getView(){if(!o){const e=(new r).getView();o=function createPromotionView(e){return class extends e{_afterRender(){super._afterRender();const e=".e-pro-promotion-placeholder__remove-btn",t=".e-pro-promotion-placeholder__unlock-btn";this.$el.off("click",e),this.$el.on("click",e,e=>{e.preventDefault(),e.stopPropagation(),window.$e.run("document/elements/delete",{container:this.container})}),this.$el.off("click",t),this.$el.on("click",t,e=>{e.stopPropagation()})}async _renderChildren(){}behaviors(){const e=["InlineEditing","Draggable","Resizable"],t=Object.entries(super.behaviors()).filter(([t])=>!e.includes(t));return Object.fromEntries(t)}getContextMenuGroups(){return super.getContextMenuGroups().filter(e=>"save"!==e.name)}onDestroy(...e){super.onDestroy(...e),this.$el.off("click",".e-pro-promotion-placeholder__remove-btn"),this.$el.off("click",".e-pro-promotion-placeholder__unlock-btn")}}}(e)}return o}}}var At=n(5338),kt=__toESM(n(97557)),Ot=n(70975),It=n(2020),Pt=n(5527),Lt=n(27723),Mt="before",Nt="after",Dt="never",Ft=class{getSetting;setSetting;element;type;id;refreshView;reactRoot;reactContainer;constructor(e){this.getSetting=e.getSetting,this.setSetting=e.setSetting,this.element=e.element,this.type=e.type,this.id=e.id,this.refreshView=e.refreshView,this.reactRoot=e.reactRoot,this.reactContainer=e.reactContainer}static getTypes(){return null}shouldRenderReplacement(){return!0}originalMethodsToTrigger(){return{_beforeRender:Mt,_afterRender:Nt,renderOnChange:Dt,onDestroy:Dt,render:Dt}}},$t=__toESM(n(97557)),Vt=n(97557),jt=n(77394),Wt=n(79513),Bt=n(77422),zt=n(97557),Ut=["#elementor-editor-wrapper-v2","#elementor-navigator","#elementor-panel"],Ht={backgroundColor:"transparent",border:"none",outline:"none",boxShadow:"none",padding:"0",margin:"0",borderRadius:"0",overflow:"hidden",opacity:"0",pointerEvents:"none",position:"absolute",display:"block"},Gt={"e-button":"text","e-form-label":"text","e-heading":"title","e-paragraph":"paragraph","e-form-submit-button":"text"},getInlineEditorElement=(e,t)=>t?e.querySelector(t):null,createAnchorBasedOnSelection=(e,t)=>{const n=e.defaultView,r=n?.getSelection();if(!r)return null;const o=r.getRangeAt(0).getBoundingClientRect(),i=e.body.getBoundingClientRect(),s=e.createElement("span");return styleToolbarAnchor(s,o,i),s.setAttribute("id",getToolbarAnchorId(t)),e.body.appendChild(s),s},removeToolbarAnchor=(e,t)=>{const n=getToolbarAnchor(e,t);n&&e.body.removeChild(n)},getToolbarAnchorId=e=>`inline-editing-toolbar-anchor-${e}`,getToolbarAnchor=(e,t)=>e.getElementById(getToolbarAnchorId(t)),styleToolbarAnchor=(e,t,n)=>{const{width:r,height:o}=t;Object.assign(e.style,{...Ht,top:t.top-n.top+"px",left:t.left-n.left+"px",width:`${r}px`,height:`${o}px`})},qt={name:"horizontalShifter",fn(e){const{x:t,y:n,elements:{reference:r,floating:o}}=e,i={...e,x:t,y:n};if(t<0)return i.x=0,i;const s=r.getBoundingClientRect(),a=t+o.offsetWidth,l=r.ownerDocument.body.offsetWidth;if(a>l&&s.right{const[l,c]=(0,Vt.useState)(!0),[u,d]=(0,Vt.useState)(null),{onSelectionEnd:f,anchor:m,clearAnchor:p}=((e,t)=>{const[n,r]=(0,zt.useState)(null);(0,zt.useEffect)(()=>{n||removeToolbarAnchor(e,t)},[n,e,t]);const o=(0,zt.useCallback)(()=>{r(null)},[]);return{onSelectionEnd:n=>{const o=!n.state.selection.empty;removeToolbarAnchor(e,t),r(o?createAnchorBasedOnSelection(e,t):null)},anchor:n,clearAnchor:o}})(r.ownerDocument,i);(0,Vt.useEffect)(()=>{l||(p(),a())},[l,p,a]);const g=(0,Vt.useCallback)(()=>{d(null),c(!1)},[]);return(e=>{const t=(0,zt.useCallback)(()=>queueMicrotask(e),[e]);(0,zt.useEffect)(()=>(Ut.forEach(e=>document?.querySelector(e)?.addEventListener("mousedown",t)),()=>Ut.forEach(e=>document?.querySelector(e)?.removeEventListener("mousedown",t))),[])})(g),(0,Vt.useEffect)(()=>{const e=o.ownerDocument,handleClickAway=e=>{o.contains(e.target)||g()};return e.addEventListener("mousedown",handleClickAway),()=>e.removeEventListener("mousedown",handleClickAway)},[o,g]),l?$t.createElement(Wt.ThemeProvider,null,$t.createElement(InlineEditingOverlay,{expectedTag:n,rootElement:r,id:i}),$t.createElement(jt.InlineEditor,{onEditorCreate:d,mountElement:o,editorProps:{attributes:{style:"outline: none; display: inherit; justify-content: inherit; align-items: inherit; flex-direction: inherit; text-align: inherit;"}},elementClasses:e,value:t,setValue:s,onBlur:g,autofocus:!0,onSelectionEnd:f}),m&&u&&$t.createElement(InlineEditingToolbar,{anchor:m,editor:u,id:i})):null},InlineEditingOverlay=({expectedTag:e,rootElement:t,id:n})=>{const r=getInlineEditorElement(t,e),[o,i]=(0,Vt.useState)(r);return(0,Vt.useEffect)(()=>{i(getInlineEditorElement(t,e))},[e,t]),o?$t.createElement(OutlineOverlay,{element:o,id:n,isSelected:!0}):null},InlineEditingToolbar=({anchor:e,editor:t,id:n})=>{const{refs:r,floatingStyles:o}=(0,Bt.useFloating)({placement:"top",strategy:"fixed",transform:!1,whileElementsMounted:Bt.autoUpdate,middleware:[qt,(0,Bt.flip)()]});return(0,Vt.useLayoutEffect)(()=>(r.setReference(e),()=>r.setReference(null)),[e,r]),$t.createElement(Bt.FloatingPortal,{id:ie},$t.createElement(Wt.Box,{ref:r.setFloating,role:"presentation",style:{...o,pointerEvents:"none"}},$t.createElement(jt.InlineEditorToolbar,{editor:t,elementId:n})))},Kt=n(2020),Yt=new Set([Kt.htmlV3PropTypeUtil.key,Kt.stringPropTypeUtil.key]),isAllowedBySchema=e=>{return!!e&&(!(!("key"in e)||(t=e.key,!Yt.has(t)))||"union"===e.kind&&[...Yt].some(t=>e.prop_types[t]));var t},Xt=class extends Ft{handlerAttached=!1;editing=!1;getReplacementKey(){return"inline-editing"}static getTypes(){return Object.keys(Gt)}isEditingModeActive(){return this.editing}shouldRenderReplacement(){return this.isInlineEditingEligible()&&"edit"===(0,Pt.getCurrentEditMode)()}handleRenderInlineEditor=()=>{!this.isEditingModeActive()&&this.isInlineEditingEligible()&&this.renderInlineEditor()};renderOnChange(){this.isEditingModeActive()||this.refreshView()}onDestroy(){this.resetInlineEditorRoot()}_beforeRender(){this.resetInlineEditorRoot()}_afterRender(){this.isInlineEditingEligible()&&!this.handlerAttached&&(this.element.addEventListener("click",this.handleRenderInlineEditor),this.handlerAttached=!0)}originalMethodsToTrigger(){const e=this.isEditingModeActive()?Dt:Mt,t=this.isEditingModeActive()?Dt:Nt;return{_beforeRender:e,_afterRender:t,renderOnChange:t,onDestroy:Nt,render:e}}resetInlineEditorRoot(){this.element.removeEventListener("click",this.handleRenderInlineEditor),this.handlerAttached=!1,this.reactRoot.render(null),this.editing=!1}unmountInlineEditor(){this.resetInlineEditorRoot(),this.refreshView()}isInlineEditingEligible(){const e=this.getInlineEditablePropertyName();return(({rawValue:e,propTypeFromSchema:t})=>null==e?isAllowedBySchema(t):Kt.htmlV3PropTypeUtil.isValid(e)||Kt.stringPropTypeUtil.isValid(e))({rawValue:this.getSetting(e),propTypeFromSchema:this.getInlineEditablePropType()})}getInlineEditablePropertyName(){return Gt[this.type]??""}getInlineEditablePropType(){const e=(0,Ot.getElementType)(this.type)?.propsSchema,t=this.getInlineEditablePropertyName();return e?.[t]??null}getInlineEditablePropValue(){const e=this.getInlineEditablePropType(),t=this.getInlineEditablePropertyName();return this.getSetting(t)??e?.default??null}getExtractedContentValue(){const e=this.getInlineEditablePropValue(),t=It.htmlV3PropTypeUtil.extract(e);return It.stringPropTypeUtil.extract(t?.content??null)??""}setContentValue(e){const t=this.getInlineEditablePropertyName(),n=e||"",r=(0,It.parseHtmlChildren)(n),o=It.htmlV3PropTypeUtil.create({content:r.content?It.stringPropTypeUtil.create(r.content):null,children:r.children});(0,Pt.undoable)({do:()=>{const e=this.getInlineEditablePropValue();return this.runCommand(t,o),e},undo:(e,n)=>{this.runCommand(t,n??null)}},{title:(0,Ot.getElementLabel)(this.id),subtitle:(0,Lt.__)("%s edited","elementor").replace("%s",this.getInlineEditablePropTypeKey()??"Inline editing"),debounce:{wait:800}})()}getInlineEditablePropTypeKey(){const e=this.getInlineEditablePropType();if(!e)return null;if("union"===e.kind){const t=[It.htmlV3PropTypeUtil.key,It.stringPropTypeUtil.key];for(const n of t)if(e.prop_types[n])return n;return null}return"key"in e&&"string"==typeof e.key?e.key:null}runCommand(e,t){(0,Pt.__privateRunCommandSync)("document/elements/set-settings",{container:(0,Ot.getContainer)(this.id),settings:{[e]:t}},{internal:!0}),(0,Pt.__privateRunCommandSync)("document/save/set-is-modified",{status:!0},{internal:!0})}getExpectedTag(){const e=this.getTagPropType();return It.stringPropTypeUtil.extract(this.getSetting("tag")??null)??It.stringPropTypeUtil.extract(e?.default??null)??null}getTagPropType(){const e=(0,Ot.getElementType)(this.type)?.propsSchema;if(!e?.tag)return null;const t=e.tag??null;return"union"===t.kind?t.prop_types.string??null:t}renderInlineEditor(){this.isEditingModeActive()&&this.resetInlineEditorRoot();const e=this.element.children?.[0];if(!e)return;const t=e.classList.toString(),n=this.getExtractedContentValue(),r=this.getExpectedTag();e.innerHTML="",this.editing=!0,this.reactRoot.render(kt.createElement(CanvasInlineEditor,{elementClasses:t,initialValue:n,expectedTag:r,rootElement:this.element,contentElement:e,id:this.id,setValue:this.setContentValue.bind(this),requestDestroy:this.unmountInlineEditor.bind(this)}))}},Jt=new Map,initViewReplacements=()=>{registerReplacement(Xt)},registerReplacement=e=>{const t=e.getTypes();t&&t.forEach(t=>{Jt.set(t,e)})},createViewWithReplacements=e=>{const t=createTemplatedElementView(e);return class extends t{#n=null;#r;#o;#i;constructor(...e){super(...e);const t=this.model.get("settings");this.#o=this.el.ownerDocument.createElement("div"),this.#o.style.display="none",this.el.ownerDocument.body.appendChild(this.#o),this.#i=(0,At.createRoot)(this.#o),this.#r={getSetting:t.get.bind(t),setSetting:t.set.bind(t),element:this.el,type:this?.model?.get("widgetType")??this.container?.model?.get("elType")??null,id:this?.model?.get("id")??null,refreshView:this.refreshView.bind(this),reactRoot:this.#i,reactContainer:this.#o}}refreshView(){this.invalidateRenderCache?.(),this.render()}renderOnChange(){this.#s("renderOnChange")}render(){const e=this.#r,t=e.type,n=t?(r=t,Jt.get(r)??null):null;var r;n&&!this.#n&&(this.#n=new n(e)),this.#s("render")}onDestroy(){this.#s("onDestroy"),this.#i.unmount(),this.#o.remove()}_afterRender(){this.#s("_afterRender")}_beforeRender(){this.#s("_beforeRender")}#s(e){const n=t.prototype[e].bind(this),r=this.#n?.shouldRenderReplacement(),o=r&&this.#n?.[e]?.bind(this.#n);if(!o||!r)return n();const i=this.#n?.originalMethodsToTrigger()[e]??"never";"before"===i&&n(),o(),"after"===i&&n()}}},createTemplatedElementTypeWithReplacements=({type:e,renderer:t,element:n})=>{const r=window,o=createViewWithReplacements({type:e,renderer:t,element:n});return class extends r.elementor.modules.elements.types.Widget{getType(){return e}getView(){return o}}},Zt={},Qt={};function registerModelExtensions(e,t){Qt[e]=t}function registerElementType(e,t){Zt[e]=t,(0,xt.__privateIsReady)()&®isterElementInLegacyManager(e,createDomRenderer())}function initLegacyViews(){(0,xt.__privateListenTo)((0,xt.v1ReadyEvent)(),()=>{const e=(0,St.getWidgetsCache)()??{},t=createDomRenderer();!function registerProPromotionTypes(e){Object.entries(e).forEach(([e,t])=>{t.meta?.is_pro_promotion&®isterElementType(e,e=>createProPromotionNestedType(e))})}(e),Object.keys(e).forEach(e=>{registerElementInLegacyManager(e,t)})})}function registerElementInLegacyManager(e,t){const n=((0,St.getWidgetsCache)()??{})[e];if(!n?.atomic)return;const r=window,o=function resolveElementType(e,t,n){if(canBeNestedTemplated(n)){const r=Zt[e];return r?r({type:e,renderer:t,element:n}):function createNestedTemplatedType(e,t,n){return createNestedTemplatedElementType({type:e,renderer:t,element:n,modelExtensions:Qt[e]})}(e,t,n)}if(!canBeTemplated(n))return function createElementType(e){const t=window;return class extends t.elementor.modules.elements.types.Widget{getType(){return e}getView(){return createElementViewClassDeclaration()}}}(e);const r=Zt[e];return r?r({type:e,renderer:t,element:n}):createTemplatedElementTypeWithReplacements({type:e,renderer:t,element:n})}(e,t,n);!function tryRegisterElement(e,t,n,r){const o=canBeTemplated(n)||canBeNestedTemplated(n);if(!o)return;const i=e.elementor.elementsManager,s=Boolean(i.getElementTypeClass(t));try{i.registerElementType(new r)}catch{canBeNestedTemplated(n)&&s&&(i.elementTypes[t]=new r)}}(r,e,n,o)}var en=n(2020),tn={modifyDefaultChildren(e){if(!Array.isArray(e)||0===e.length)return e;const[t]=e,n=this.get("editor_settings")?.initial_position;if(!n||!t||"object"!=typeof t)return e;const r=t;return[{...r,settings:{...r.settings,paragraph:en.htmlV3PropTypeUtil.create({content:en.stringPropTypeUtil.create(`Tab ${n}`),children:[]})}},...e.slice(1)]}};var nn=n(2020),rn=n(5527),on="elementor://context/available-widgets",sn="elementor://context/available-widgets/v4",initAvailableWidgetsResource=e=>{const{resource:t,sendResourceUpdated:n}=e,buildContents=(e,t=()=>!0)=>{const n=getAvailableWidgets().filter(t);return{contents:[{uri:e,mimeType:"application/json",text:JSON.stringify(n,null,2)}]}};t("available-widgets-v4",sn,{description:"All registered v4 version widgets"},async()=>buildContents(sn,e=>"v4"===e.version)),t("available-widgets",on,{description:"All registered widget types with v3/v4 version metadata and description."},async()=>buildContents(on));const r=(0,rn.v1ReadyEvent)().name,onV1Ready=()=>{0!==getAvailableWidgets().length&&(window.removeEventListener(r,onV1Ready),n({uri:on,...buildContents(on)}),n({uri:sn,...buildContents(sn,e=>"v4"===e.version)}))};window.addEventListener(r,onV1Ready),onV1Ready()},an=n(70975),ln=n(5527),cn="elementor://document/structure";function getDocumentStructure(){const e=window,t=e.elementor?.documents?.getCurrent?.();if(!t)return{error:"No active document found"};const n=(t.container?.children||[]).map(e=>extractElementData(e));return{documentId:t.id,documentType:t.config.type,title:t.config.settings?.post_title||"Untitled",elements:n.filter(e=>null!==e)}}function resolveElementVersion(e){if(e.model?.config?.atomic)return"v4";const t=e.model?.attributes?.widgetType;return t&&(0,an.getWidgetsCache)()?.[t]?.atomic_props_schema?"v4":"v3"}function extractElementData(e){if(!e||!e.model)return null;const t=e.model.attributes,n={id:t.id,elType:t.elType,widgetType:t.widgetType||void 0,version:resolveElementVersion(e)},r=t.title||e.model?.editor_settings?.title||e.model.getTitle?.();return r&&(n.title=r),e.children&&e.children.length>0&&(n.children=e.children.map(e=>extractElementData(e)).filter(e=>null!==e)),n}var un=n(2020),dn=n(5527),mn="dynamic",pn=["fallback"],getAtomicDynamicTags=()=>{const e=(0,dn.getElementorConfig)();return e.atomicDynamicTags?.tags??{}},getDynamicTagNamesByCategories=e=>{if(!e.length)return[];const t=new Set(e);return Object.values(getAtomicDynamicTags()).filter(e=>e.categories?.some(e=>t.has(e))).map(e=>e.name)},dynamicTagLLMResolver=e=>{const t=e??{},n=t.name?getAtomicDynamicTags()[t.name]:void 0;return n?{$$type:mn,value:{name:n.name,group:n.group,settings:buildStrictSettings(n.props_schema??{},t.settings??{})}}:{$$type:mn,value:{name:t.name??"",group:"",settings:{}}}},buildStrictSettings=(e,t)=>{const n={};for(const[r,o]of Object.entries(e)){if(pn.includes(r))continue;const e=void 0!==t[r]?wrapSettingValue(t[r],o):defaultSettingValue(o);null!=e&&(n[r]=e)}return n},wrapSettingValue=(e,t)=>null!==e&&"object"==typeof e?e:t.key?{$$type:t.key,value:e}:e,defaultSettingValue=e=>null!==e.initial_value&&void 0!==e.initial_value?e.initial_value:null!==e.default&&void 0!==e.default?wrapSettingValue(e.default,e):void 0,gn="elementor://dynamic-tags",hn=n(5527),yn="elementor://context/editor-state";function getPageContentFromPreview(){try{const e=window.elementor?.$previewContents?.[0];if(!e)return null;const t=[],n=e.cloneNode(!0);n.querySelectorAll(".elementor-editor-element-settings, #elementor-add-new-section").forEach(e=>{e.remove()});const walk=(e,n=!1)=>{const r=e.classList?.contains("elementor-element")||n;if(e.nodeType===Node.TEXT_NODE&&r){const n=e.textContent?.trim().replace(/\s+/g," ");n&&n.length>2&&t.push(n)}else e.childNodes.forEach(e=>{walk(e,r)})};walk(n);const r=t.join(" ");return r.length>500?r.slice(0,500)+"...":r}catch{return null}}function getPageTitle(){try{const e=window,t=e.elementor?.documents?.getCurrent?.(),n=t?.config?.settings?.post_title;if(n)return n;let r=document.title||"Page";r=r.split(/\s*[‹»|–—-]\s*/)[0];return r.trim()||"Page"}catch{return"Page"}}var vn=n(5527),bn="elementor://context/general",initGeneralContextResource=e=>{const{resource:t,sendResourceUpdated:n}=e;let r=null;const buildPayload=()=>{const e=window,t=Intl.DateTimeFormat().resolvedOptions().timeZone,n=new URLSearchParams(location.search).get("post"),r=n?Number(n):null,o=null!==r&&Number.isFinite(r)?r:null,i=(()=>{const e=window,t=e.elementor?.documents?.getCurrent?.()?.config?.settings?.post_title;return t?.trim()?t:null})(),s=new URL(window.location.href),a=s.pathname+s.search,l=i||"Elementor Editor",c=e.angieConfig?.plugins;return{timezone:t,postId:o,currentPage:{pageName:l,pageTitle:i,pageUrl:a},...c&&{plugins:c}}},pushUpdateIfChanged=()=>{const e=JSON.stringify(buildPayload());e!==r&&(r=e,n({uri:bn}))};t("general-context",bn,{description:"General context: timezone, post id, and current page."},async()=>({contents:[{uri:bn,mimeType:"application/json",text:JSON.stringify(buildPayload(),null,2)}]})),(0,vn.__privateListenTo)([(0,vn.commandEndEvent)("editor/documents/switch"),(0,vn.commandEndEvent)("editor/documents/attach-preview"),(0,vn.commandEndEvent)("document/elements/settings")],pushUpdateIfChanged),pushUpdateIfChanged()},wn=n(70975),En=n(5527),Tn="elementor://context/selected-element";function readSelectionFromEditor(){const e=(0,wn.getSelectedElements)();if(1!==e.length)return{elementDisplayName:null,elementType:null,properties:null,selectedElementId:null,selectedParentId:null,version:null,widgetType:null};return buildPayloadFromContainer((0,wn.getContainer)(e[0].id))}function buildPayloadFromContainer(e){if(!e?.id)return{elementDisplayName:null,elementType:null,properties:null,selectedElementId:null,selectedParentId:null,version:null,widgetType:null};const t=e.model.get("widgetType")??null,n=e.type??"widget";return{elementDisplayName:getElementDisplayName(e),elementType:n,properties:getElementProperties(e,t),selectedElementId:e.id,selectedParentId:e.parent?.id??null,version:resolveElementVersion2(e,t),widgetType:t}}function resolveElementVersion2(e,t){return e.model?.config?.atomic||t&&(0,wn.getWidgetsCache)()?.[t]?.atomic_props_schema?"v4":"v3"}function getElementProperties(e,t){const n=e.settings?.toJSON?.();if(!n||"object"!=typeof n)return null;const r=t?(0,wn.getWidgetsCache)()?.[t]:null,o=r?.controls,i={};for(const[e,t]of Object.entries(n)){if(null==t||""===t)continue;const n=o?.[e]?.default;void 0!==n&&JSON.stringify(t)===JSON.stringify(n)||(i[e]=t)}return Object.keys(i).length>0?i:null}function getElementDisplayName(e){try{if(e.label)return e.label;const t=e.model?.get?.("widgetType");if(t){return(t.charAt(0).toUpperCase()+t.slice(1)).replace(/-/g," ")}return"container"===e.type?"Container":"section"===e.type?"Section":`Element ${e.id}`}catch{return`Element ${e.id}`}}var Sn=n(46280),xn=n(70975),Cn=n(55534),Rn=n(70975),_n=n(70975),An=n(2020),kn=n(47290),On=n(5527),mergeCustomCssText=(...e)=>e.map(e=>e?.trim()).filter(e=>!!e).join("\n"),In=n(70975);function buildAliasToCanonicalMap(e){const t={};for(const[n,r]of Object.entries(e)){const e=r.meta?.aliases;if(Array.isArray(e))for(const r of e)"string"==typeof r&&r&&(t[r]=n)}return t}var Pn={breakpoint:"desktop",state:null};function resolvePropValue(e,t){const n=window.elementorV2.editorVariables.Utils;return An.Schema.adjustLlmPropValueSchema(e,{forceKey:t,transformers:{...n.globalVariablesLLMResolvers,[mn]:dynamicTagLLMResolver}})}var doUpdateElementProperty=e=>{const{elementId:t,propertyValue:n,elementType:r,customCssWriteMode:o="replace"}=e,i="_styles"===e.propertyName?e.propertyName:function resolveCanonicalPropName(e,t){const n=(0,In.getWidgetsCache)()?.[e]?.atomic_props_schema;return!n||n[t]?t:buildAliasToCanonicalMap(n)[t]??t}(r,e.propertyName);if("_styles"===i){const e=(0,_n.getElementStyles)(t)||{},r=n,i=(0,kn.getStylesSchema)(),s=Object.fromEntries(Object.entries(r).map(([e,t])=>{if("custom_css"===e)return[e,t];const{key:n,kind:r}=i?.[e]||{};if(!n&&"union"!==r)throw new Error(`_styles property ${e} is not supported.`);return null===t?[e,null]:[e,resolvePropValue(t,n)]})),a=Object.values(e).find(e=>"local"===e.label),l=a?(e=>{if(!e)return"";try{return atob(e)}catch{return""}})((0,kn.getVariantByMeta)(a,Pn)?.custom_css?.raw):"";let c;return Object.keys(r).forEach(e=>{const t=i[e];if("custom_css"===e){let t=r[e];"object"==typeof t&&t&&t.value&&(t=String(t.value)),t||(t="");const n="merge-with-stored"===o?mergeCustomCssText(l,t):String(t);return void(c=n?{raw:btoa(n)}:{raw:btoa("")})}if(!!!t)throw new Error(`Style property ${e} is not supported.`);if("plain"===t.kind&&"object"!=typeof r[e]){const n=(0,An.getPropSchemaFromCache)(t.key);if(n){const t=n.create(r[e]);r[e]=t}}}),delete s.custom_css,void(a?(0,_n.updateElementStyle)({elementId:t,styleId:a.id,meta:{breakpoint:"desktop",state:null},...void 0!==c?{custom_css:c}:{},props:{...s}}):(0,_n.createElementStyle)({elementId:t,...void 0!==c?{custom_css:c}:{},classesProp:"classes",label:"local",meta:{breakpoint:"desktop",state:null},props:{...s}}))}const s=(0,_n.getWidgetsCache)()?.[r]?.atomic_props_schema;if(!s)throw new Error(`No prop schema found for element type: ${r}`);if(!s[i]){const e=Object.keys(s);throw new Error(`Property "${i}" does not exist on element type "${r}". Available properties are: ${e.join(", ")}`)}const a=s[i].key,l=resolvePropValue(n,a),{valid:c,jsonSchema:u}=An.Schema.validatePropValue(s[i],n);if(!c)throw new Error(`Invalid PropValue for elementId: ${t}. PropKey: ${a}, PropValue: ${JSON.stringify(n)}\nExpected Schema: ${u}`);(0,_n.updateElementSettings)({id:t,props:{[i]:l},withHistory:!1}),(0,On.__privateRunCommandSync)("document/save/set-is-modified",{status:!0},{internal:!0})},Ln=class{elementType;requiredTemplates;constructor(e,t){this.elementType=e,this.requiredTemplates=getRequiredDefaultChildTemplates(t[e])}enforce(e){if(0===this.requiredTemplates.length)return;const t=[];for(const n of Array.from(e.children))this.collectMissingRequiredErrors(n,t);if(t.length)throw new Error(`${t.join("\n")}\nUse the widget schema resource; under llm_guidance.required_direct_children for V4 widgets.`)}collectMissingRequiredErrors(e,t){if(e.tagName===this.elementType){const n=new Set(Array.from(e.children).map(e=>e.tagName)),r=this.requiredTemplates.map(e=>e.widgetType??e.elType??"").filter(e=>e&&!n.has(e));if(r.length){const n=e.getAttribute("configuration-id"),o=n?`<${e.tagName} configuration-id="${n}">`:`<${e.tagName}>`;t.push(`${o} Missing required direct child element tag(s): ${r.join(", ")}.`)}}for(const n of Array.from(e.children))this.collectMissingRequiredErrors(n,t)}},Mn=class _CompositionBuilder{elementConfig={};elementStylesConfig={};elementCustomCSS={};rootContainers=[];api={createElement:Rn.createElement,deleteElement:Rn.deleteElement,getWidgetsCache:Rn.getWidgetsCache,generateElementId:Rn.generateElementId,getContainer:Rn.getContainer,doUpdateElementProperty:doUpdateElementProperty};xml;static fromXMLString(e,t={}){const n=(new DOMParser).parseFromString(e,"application/xml"),r=n.querySelector("parsererror");if(r)throw new Error("Failed to parse XML string: "+r.textContent);return new _CompositionBuilder({xml:n,api:t})}constructor(e){const{api:t={},elementConfig:n={},stylesConfig:r={},customCSS:o={},xml:i}=e;this.xml=i,Object.assign(this.api,t),this.setElementConfig(n),this.setStylesConfig(r),this.setCustomCSS(o)}setElementConfig(e){this.elementConfig=e}setStylesConfig(e){this.elementStylesConfig=e}setCustomCSS(e){this.elementCustomCSS=e}getXML(){return this.xml}buildModelTree(e,t){const n=e.tagName,r="widget"===t[n]?.elType,o=this.api.generateElementId(),i=Array.from(e.children).map(e=>this.buildModelTree(e,t));e.setAttribute("id",o);const s={id:o,skipDefaultChildren:!0,elements:i,editor_settings:{title:e.getAttribute("configuration-id")??void 0},elType:"widget"};return r?{...s,elType:"widget",widgetType:n}:{...s,elType:n}}async awaitViewRender(e){const t=e.view;t?._currentRenderPromise instanceof Promise?await t._currentRenderPromise:await Promise.resolve()}validateChildTypes(e,t){const n=[],r=t[e.tagName]?.allowed_child_types;if(r?.length)for(const t of Array.from(e.children))r.includes(t.tagName)||n.push(`"${t.tagName}" is not allowed as a child of "${e.tagName}". Allowed: ${r.join(", ")}`);for(const r of Array.from(e.children))n.push(...this.validateChildTypes(r,t));return n}matchNodeByConfigId(e){const t=this.xml.querySelector(`[configuration-id="${e}"]`);if(!t)throw new Error(`Configuration id "${e}" does not have target node.`);const n=t.getAttribute("id");if(!n)throw new Error(`Node with configuration id "${e}" does not have element id.`);const r=this.api.getContainer(n);if(!r)throw new Error(`Element with id "${n}" not found but should exist.`);return{element:r,node:t}}async applyProperties(){const e=[],t=[],n=new Set([...Object.keys(this.elementConfig),...Object.keys(this.elementStylesConfig),...Object.keys(this.elementCustomCSS)]);for(const r of n){let n,o;try{({element:n,node:o}=this.matchNodeByConfigId(r))}catch(n){const o=n.message;this.elementConfig[r]&&e.push(o),(this.elementStylesConfig[r]||this.elementCustomCSS[r])&&t.push(o);continue}const i=this.elementConfig[r];if(i)for(const[t,r]of Object.entries(i))try{this.api.doUpdateElementProperty({elementId:n.id,propertyName:t,propertyValue:r,elementType:o.tagName})}catch(t){e.push(t.message)}const s=this.elementStylesConfig[r],a=!1;if(s){const e={};for(const[t,n]of Object.entries(s))"$intention"!==t&&(e[t]=n);if(Object.keys(e).length>0)try{this.api.doUpdateElementProperty({elementId:n.id,propertyName:"_styles",propertyValue:e,elementType:o.tagName})}catch(e){t.push(String(e))}}const l="string"==typeof s?.$intention?s.$intention.trim():"",c=a&&l?l:"",u=mergeCustomCssText(this.elementCustomCSS[r],c);if(u)try{this.api.doUpdateElementProperty({elementId:n.id,propertyName:"_styles",propertyValue:{custom_css:u},elementType:o.tagName})}catch(e){t.push(String(e))}await this.awaitViewRender(n)}return{configErrors:e,styleErrors:t}}async build(e){const t=this.api.getWidgetsCache()||{};new Set(this.xml.querySelectorAll("*")).forEach(e=>{if(!t[e.tagName])throw new Error(`Unknown widget type: ${e.tagName}`)});Object.keys(t).filter(e=>getRequiredDefaultChildTemplates(t[e]).length>0).forEach(e=>{new Ln(e,t).enforce(this.xml)});const n=[];for(const e of Array.from(this.xml.children))n.push(...this.validateChildTypes(e,t));if(n.length)throw new Error(`Invalid element structure:\n${n.join("\n")}`);const r=[...collectFormAncestorErrors(this.xml),...collectSubmitButtonErrors(this.xml),...collectEmptyMessageErrors(this.xml)],o=Array.from(this.xml.children);for(const n of o){const r=this.buildModelTree(n,t);try{const t=this.api.createElement({container:e,model:r,options:{useHistory:!1}});if(!t?.model)throw new Error("createElement did not return an element container with a model.");this.rootContainers.push(t),await this.awaitViewRender(t)}catch(e){const t=this.api.getContainer(r.id);throw t&&this.api.deleteElement({container:t}),e}}const{configErrors:i,styleErrors:s}=await this.applyProperties();if("undefined"!=typeof window){(window.top||window).dispatchEvent(new CustomEvent("elementor/composition/built",{detail:{rootContainers:this.rootContainers.map(e=>e.id)}}))}return{configErrors:i,styleErrors:s,formErrors:r,rootContainers:[...this.rootContainers]}}},Nn=n(33176),Dn=n(46280);var Fn=n(55534),$n="elementor://canvas/tools/build-compositions-guide",generatePrompt=()=>{const e=(0,Fn.toolPrompts)("build-compositions");return e.description(`\n# RESOURCES (Read before use)\n- [elementor://global-classes] - Check FIRST for reusable classes\n- [elementor://global-variables] - ONLY use variables defined here\n- [${on}/v4]\n\n# TOOL SUPPORT\nThis tool support v4 elements only\n\n# WORKFLOW\n1. Check/create global classes via "manage-global-classes" tool\n2. Build composition (THIS TOOL) - minimal inline styles\n3. Apply classes via "apply-global-class" tool\n\n# XML STRUCTURE\n- Use widget tags: \`\`\n- Containers: "e-flexbox", "e-div-block", "e-tabs"\n- Every element needs unique "configuration-id"\n- No attributes, classes, IDs, or text nodes in XML\n\n## NESTED ELEMENTS\nSome elements have internal tree structures (nesting). When using these elements, you MUST build the FULL tree in XML.\n- Check \`llm_guidance.nesting\` in widget schemas for structure requirements\n- \`llm_guidance.required_direct_children\` lists element types that must appear as direct child tags in XML (from widget defaults)\n- \`allowed_child_types\` lists which element types can be nested inside\n- \`allowed_parents\` lists which element types this element can be placed inside\n\n# CONFIGURATION\n- Map configuration-id → elementConfig (props) + style (raw CSS declarations)\n- elementConfig PropValues require \`$$type\` matching schema\n- style is raw CSS (property → value strings); the server converts it to native styles and stores any unconvertible declarations as the element custom CSS\n- NO LINKS in configuration\n- Retry on errors up to 10x\n- Check \`llm_guidance.default_settings\` in widget schemas — omit only keys listed there from elementConfig unless the user explicitly asks to change them\n\n# DYNAMIC TAGS\n- A value can be made dynamic wherever its schema exposes a \`"$$type": "dynamic"\` variant. This may be the property root OR a NESTED field (e.g. an image's \`src\`, not the whole \`image\`).\n- Put the dynamic object EXACTLY at that node, in place of the static variant. The variant's \`name\` lists the allowed tags; read [${gn}] for each tag's settings schema.\n- Provide at that node: \`{ "$$type": "dynamic", "value": { "name": "", "settings": { ... } } }\`\n- Example (image): \`{ "$$type": "image", "value": { "src": { "$$type": "dynamic", "value": { "name": "", "settings": { ... } } } } }\`\n- Do NOT send \`group\` (it is resolved automatically). Populate \`settings\` strictly per the tag's schema; use \`{}\` only when it has none.\n\nNote about configuration ids: These names are visible to the end-user, make sure they make sense, related and relevant.\n\n# DESIGN PHILOSOPHY: CONTEXT-DRIVEN CREATIVITY\n\n**Use the user's context aggressively.** Business type, brand personality, target audience, and purpose should drive every design decision. A law firm needs gravitas; a children's app needs playfulness. Don't default to generic.\n\n## SIZING: DEFAULT IS NO SIZE (CRITICAL)\n\n**DO NOT specify height or width unless you have a specific visual reason.**\n\nFlexbox and CSS already handle sizing automatically:\n- Containers grow to fit their content\n- Flex children distribute space via flex properties, not width/height\n- Text elements size to their content\n\nWHEN TO SPECIFY SIZE:\n- min-height on ROOT section for viewport-spanning hero (use min-height, NOT height)\n- max-width for contained content areas (e.g., max-width: 60rem)\n- Explicit aspect ratios for media containers\n\nNEVER SPECIFY:\n- height on nested containers (causes overflow)\n- width on flex children (use flex-basis or gap instead)\n- 100vh on anything except root-level sections\n- Any size "just to be safe" - if unsure, OMIT IT\n\nvh units are VIEWPORT-relative. Nested 100vh inside 100vh = 200vh overflow.\n\nGOOD: \`content naturally sizes\`\nBAD: \`overflow\`\n\n## Layout Variety (Break the Template)\n- AVOID: Full-width 100vh hero → three columns → testimonials → CTA (every AI does this)\n- VARY heights: Use auto-height sections with generous padding (6rem+). Let content breathe\n- VARY widths: Not everything spans full width. Use contained sections (max-width: 960px) mixed with edge-to-edge\n- ASYMMETRIC grids: 2:1, 1:3, offset layouts. Avoid equal column widths\n- Negative space as design element: Large margins create focus and sophistication\n- Break alignment intentionally: Offset headings, overlapping elements, broken grids\n\n## Visual Depth & Effects\n- Layer elements: Overlapping cards, text over images, floating elements\n- Subtle shadows with color tint (not pure black): \`box-shadow: 0 20px 60px rgba(, 0.15)\`\n- Gradient overlays on images for text readability\n- Border radius variation: Mix sharp (0) and soft (1rem+) corners purposefully\n- Backdrop blur for glassmorphism where appropriate\n- Micro-interactions via CSS: hover transforms, transitions (0.3s ease)\n\n## Typography with Character\n- Display fonts for headlines (from user's brand or contextually appropriate)\n- Size contrast: 4rem+ headlines vs 1rem body. Make hierarchy unmistakable\n- Letter-spacing: Tight for large headlines (-0.02em), loose for small caps (0.1em)\n- Line-height: Tight for headlines (1.1), generous for body (1.6-1.8)\n- Text decoration: Underlines, highlights, gradient text for emphasis\n\n## Color with Purpose\n- Extract palette from user context (brand colors, industry norms, mood)\n- 60-30-10 rule: dominant, secondary, accent\n- Tinted neutrals over pure grays: warm (#faf8f5, #2d2a26) or cool (#f5f7fa, #1e2430)\n- Color blocking: Large colored sections create visual rhythm\n- Gradient directions: Diagonal (135deg, 225deg) feel more dynamic than vertical\n\n## Spacing Strategy\n- Section padding: 6rem-10rem vertical, creating breathing room\n- Rhythm variation: Tight groups (2rem) with generous gaps between (6rem)\n- Use rem/em exclusively for responsive scaling\n- Generous padding on CTAs: min 1rem 2.5rem\n\n# HARD CONSTRAINTS\n- Variables ONLY from [elementor://global-variables] (others throw errors)\n- Avoid SVG widgets unless assets are pre-uploaded\n- Check \`llm_guidance\` in widget schemas (\`default_styles\`, nesting, required children)\n\n# PARAMETERS\n- **xmlStructure**: Valid XML with configuration-id attributes\n- **elementConfig**: configuration-id → widget PropValues\n- **style**: configuration-id → raw CSS declarations (property → value strings; no selectors)\n `),e.example('\nSection with heading + button (NO explicit heights - content sizes naturally):\n{\n xmlStructure: "",\n elementConfig: {\n "section1": { "tag": { "$$type": "string", "value": "section" } }\n },\n style: {\n "Section Title": {\n "padding": "6rem 4rem",\n "background": "linear-gradient(135deg, #faf8f5 0%, #f0ebe4 100%)",\n "font-size": "3.5rem",\n "color": "#2d2a26"\n }\n }\n}\nNote: No height/width specified on any element - flexbox handles layout automatically.\n'),e.parameter("xmlStructure","Valid XML structure with custom elementor tags and configuration-id attributes."),e.parameter("elementConfig","Record mapping configuration IDs to widget PropValues."),e.parameter("style","Record mapping configuration IDs to raw CSS declarations (property → value strings)."),e.instruction("Element IDs in the returned XML represent actual widgets. Use these IDs for subsequent styling or configuration changes."),e.prompt()},Vn=n(59618),jn={xmlStructure:Vn.z.string().describe("The XML structure representing the composition to be built"),elementConfig:Vn.z.record(Vn.z.string().describe("The configuration id"),Vn.z.record(Vn.z.string().describe("property name"),Vn.z.any().describe(`The PropValue for the property, refer to ${b}`))).describe("A record mapping element IDs to their configuration objects. REQUIRED"),style:Vn.z.record(Vn.z.string().describe("The configuration id"),Vn.z.record(Vn.z.string().describe('A CSS property name, e.g. "color", "padding".'),Vn.z.string().describe('A CSS value, e.g. "6rem 4rem", "#2d2a26".'))).describe("A record mapping element configuration IDs to their raw CSS declarations (property→value). Converted to native styles server-side; any declaration that cannot be converted is stored as the element custom CSS.").default({})},Wn={errors:Vn.z.string().describe("Error message if the composition building failed").optional(),xmlStructure:Vn.z.string().describe("The built XML structure as a string. Must use this XML after completion of building the composition, it contains real IDs.").optional(),llm_instructions:Vn.z.string().describe("Instructions what to do next, Important to follow these instructions!").optional()},Bn="e-div-block",zn={$$type:"size",value:{size:{$$type:"number",value:0},unit:{$$type:"string",value:"px"}}};function adaptLeafRootParams(e){const t=(new DOMParser).parseFromString(e.xmlStructure,"application/xml"),n=t.documentElement;if(!function isLeafWidget(e,t){return"widget"===t[e]?.elType}(n.tagName,e.widgetsCache))return e;const r=function getDivBlockWrapperConfigId(e){return e[Bn]?.title??Bn}(e.widgetsCache);return{...e,xmlStructure:serializeWrapped(t,n,r),stylesConfig:{...e.stylesConfig,[r]:{margin:zn,padding:zn,...e.stylesConfig[r]}}}}function serializeWrapped(e,t,n){const r=e.createElement(Bn);r.setAttribute("configuration-id",n),r.appendChild(t.cloneNode(!0));const o=(new DOMParser).parseFromString(`<${Bn} />`,"application/xml");return o.replaceChild(r,o.documentElement),(new XMLSerializer).serializeToString(o)}var Un="elementor/canvas/element-added",initBuildCompositionsTool=e=>{const{addTool:t,resource:n}=e;n("build-compositions-guide",$n,{title:"Build Compositions Guide",description:"Detailed guide for using the build-compositions tool",mimeType:"text/plain"},async e=>({contents:[{uri:e.href,mimeType:"text/plain",text:generatePrompt()}]})),t({name:"build-compositions",description:"Build V4 element compositions on the Elementor canvas. Read the guide resource before use.",schema:jn,requiredResources:[{description:"Build compositions guide",uri:$n},{description:"Widgets schema",uri:b},{description:"Global Classes",uri:"elementor://global-classes"},{description:"Global Variables",uri:"elementor://global-variables"},{description:"Styles best practices",uri:E},{description:"Available widgets for this tool",uri:sn},{description:"Dynamic tags catalog",uri:gn}],outputSchema:Wn,handler:async e=>{!function assertCompositionXmlUsesV4WidgetsOnly(e){const t=(new DOMParser).parseFromString(e,"application/xml");if(t.querySelector("parsererror"))throw new Error("Failed to parse XML string: "+t);const n=(0,xn.getWidgetsCache)()??{};for(const e of t.querySelectorAll("*")){const t=e.tagName,r=n[t];if(r&&!("widget"!==r.elType||isWidgetAvailableForLLM(r)&&r.atomic_props_schema))throw new Error(`This tool does not support element type: ${t}`)}}(e.xmlStructure);const{stylesConfig:t,customCSS:n}=await async function convertCompositionStyles(e){const t={},n={};if(!e||0===Object.keys(e).length)return{stylesConfig:t,customCSS:n};const r=await convertStyleBlocksToAtomic(e);for(const[e,{props:o,customCss:i}]of Object.entries(r))t[e]=o,i&&(n[e]=i);return{stylesConfig:t,customCSS:n}}(e.style),{xmlStructure:r,elementConfig:o,stylesConfig:i}=adaptLeafRootParams({...e,stylesConfig:t,widgetsCache:(0,xn.getWidgetsCache)()??{}});let s="";const a=[],l=[],c=(0,xn.getContainer)("document"),u=(0,Sn.getCurrentDocument)(),d=function getCompositionTargetContainer(e,t){const n=e.children?.[0];return t===Dn.COMPONENT_DOCUMENT_TYPE&&n?n:e}(c,u?.type.value);try{const e=Mn.fromXMLString(r,{createElement:xn.createElement,deleteElement:xn.deleteElement,getWidgetsCache:xn.getWidgetsCache});e.setElementConfig(o),e.setStylesConfig(i),e.setCustomCSS(n);const{configErrors:t,formErrors:c,rootContainers:u}=await e.build(d);l.push(...u),s=(new XMLSerializer).serializeToString(e.getXML()),l.forEach(e=>{const t=e.model?.toJSON();t&&onElementAdded(t)}),Object.values(i).forEach(e=>{(0,Cn.dispatchMcpStylesAppliedEvent)({styleValue:e})}),t.length&&a.push(...t.map(e=>new Error(e))),c.length&&a.push(...c.map(e=>new Error(e)))}catch(e){a.push(e)}if(a.length){l.forEach(e=>{(0,xn.deleteElement)({container:e,options:{useHistory:!1}})});const e=a.map(e=>"string"==typeof e?e:e instanceof Error?e.message||String(e):"object"==typeof e&&null!==e?JSON.stringify(e):String(e)).filter(e=>e&&""!==e.trim()&&"{}"!==e&&"null"!==e&&"undefined"!==e);if(0===e.length)throw new Error("Failed to build composition: Unknown error occurred. No error details available.");const t=`Failed to build composition with the following errors:\n\n${e.join("\n\n")}`;throw new Error(t)}return{xmlStructure:s,errors:a?.length?a.map(e=>"string"==typeof e?e:e.message).join("\n\n"):void 0,llm_instructions:'The composition was built successfully with element IDs embedded in the XML.\n\n**CRITICAL NEXT STEPS** (Follow in order):\n1. **Apply Global Classes**: Use "apply-global-class" tool to apply the global classes you created BEFORE building this composition\n - Check the created element IDs in the returned XML\n - Apply semantic classes (heading-primary, button-cta, etc.) to appropriate elements\n\n2. **Fine-tune if needed**: Use "configure-element" tool only for element-specific adjustments that don\'t warrant global classes\n\nRemember: Global classes ensure design consistency and reusability. Don\'t skip applying them!\n'}}})};function onElementAdded(e){const t=e.elType??"",n=e.widgetType??"";var r;r={eventName:"add_element",executed_by:"mcp_tool",element_name:"widget"===t?n:t,element_type:t,widget_type:n},(0,Nn.trackEvent)(r);const o={element:e,executedBy:"mcp_tool"};window.dispatchEvent(new CustomEvent(Un,{detail:o})),e.elements?.length&&e.elements?.forEach(e=>{onElementAdded(e)})}var Hn=n(70975),Gn=n(55534),qn=n(2020),Kn=n(55534),Yn="elementor://canvas/tools/configure-element-guide",generatePrompt2=()=>{const e=(0,Kn.toolPrompts)("configure-element");return e.description(`\nConfigure an existing element on the page.\n\n# **CRITICAL - REQUIRED INFORMATION (Must read before using this tool)**\n1. [${b}] — **Widget properties** (\`propertiesToChange\`): each widgetType (e.g. e-heading, e-button) has its own PropType schema; values must be PropValues with \`$$type\`.\n2. [elementor://global-variables] — **Design tokens for styling**: use labels in CSS as \`var(--label)\` or \`var(--label, fallback)\`; only variables listed here are valid.\n3. **Styling** (\`style\` parameter): flat map of CSS property → value strings — **not** PropValues. The server converts to native styles; unconvertible declarations become custom CSS.\n4. **Current state**: \`get-element-configuration-values\` returns \`properties\` as PropValues and \`style\` in stored form; when writing, send raw CSS in \`style\`, not copied PropValues.\n\nBefore using this tool, read the widget PropType schema at editor-canvas__elementor://widgets/schema/{widgetType}\n\n# When to use this tool\nWhen a user requires to change anything in an element, such as updating text, colors, sizes, or other configurable properties.\nThis tool handles elements of type "widget".\nThis tool handles styling elements, using the "style" parameter (raw CSS as a property → value map).\n\nTo CLEAR a property (i.e., set it to default or none), provide null as a value - example: \`background-color: null\`.\n\nThe element's schema must be known before using this tool.\n\n**PropValue structure (for \`propertiesToChange\` only — not for \`style\`):**\n{\n "$$type": string, // MANDATORY as defined in the PropType schema under the "key" property\n value: unknown // The value according to the PropType schema for kinds of "array", use array with PropValues items inside. For "object", read the shape property of the PropType schema. For "plain", use strings.\n}\n\n\nALWAYS MAKE SURE you have the PropType schemas for the element you are configuring. If you are not sure, retrieve the schema from the resources mentioned above.\n\n\nYou can use multiple property changes at once by providing multiple entries in the propertiesToChange object.\nSome properties are nested, use the root property name, then objects with nested values inside, as the complete schema suggests.\n\nMake sure you have the "widget-schema-by-type" resource available to retrieve the PropType schema for the element type you are configuring.\n\n# How to configure elements\nWe use a dedicated PropType Schema for configuring element properties (propertiesToChange). When you configure an element property, you must use the EXACT PropType Value as defined in the schema.\nFor styling, use the "style" parameter with raw CSS declarations (property → value strings) - e.g. \`color: var(--primary-text, #000); height: 4rem;\`;\nFor all non-primitive entries in \`propertiesToChange\`, provide the schema \`key\` as \`$$type\` in the generated object, as it is MANDATORY for parsing.\n\nUse the EXACT PropType schema given, and ALWAYS include the \`key\` from the schema for every property you are changing in \`propertiesToChange\`.\n\nCheck \`llm_guidance.default_settings\` in the widget schema — include a key in \`propertiesToChange\` only when the user explicitly asks to change it.\n\n# Dynamic tags\nA value can be made dynamic wherever its schema exposes a variant with "$$type": "dynamic". This may be the property root OR a NESTED field: for example an image is made dynamic on its "src" (the root stays "image"), NOT on the whole "image" value.\nPut the dynamic object EXACTLY at the node whose schema offers the "dynamic" variant, in place of the static variant. The variant's "name" enumerates the tags allowed at that node.\n1. Read the [${gn}] resource for each allowed tag's settings schema.\n2. Provide, at that node:\n{\n "$$type": "dynamic",\n "value": {\n "name": "",\n "settings": { /* strictly per the tag's settings schema */ }\n }\n}\nImage example: { "$$type": "image", "value": { "src": { "$$type": "dynamic", "value": { "name": "", "settings": { ... } } } } }\nDo NOT send "group" (it is resolved automatically). Use { "settings": {} } only when the tag has no settings.\n`),e.parameter("elementId","The ID of the element to configure. MANDATORY."),e.parameter("elementType","The type of the element to configure (i.e. e-heading, e-button). MANDATORY."),e.parameter("propertiesToChange","An object containing the properties to change, with their new values. MANDATORY. When updating a style only, provide an empty object."),e.parameter("style",'A flat map of raw CSS declarations (property → value), e.g. { "line-height": "1.25rem", "color": "var(--primary-text, #000)" }. Set a value to null to reset that property to its default. OPTIONAL.'),e.example(`\n\`\`\`json\n{\n propertiesToChange: {\n // List of properties TO CHANGE, following the PropType schema for the element as defined in the resource [${b}]\n title: {\n $$type: 'string',\n value: 'New Title Text'\n },\n border: {\n $$type: 'boolean',\n value: false\n },\n },\n style: {\n 'line-height': '1.25rem',\n 'color': 'var(--primary-text, #000)'\n },\n elementId: 'element-id',\n elementType: 'element-type'\n};\n\`\`\`\n`),e.instruction("The $$type property is MANDATORY for every value in propertiesToChange; it is not used in the style parameter (raw CSS only)."),e.instruction("\nV4 only: If MCP fails, give manual steps using V4 UI.\n\nV4 Editor structure:\nPanel tabs: General (→ Settings section: ID, Tag, Link), Style, Interactions.\nNO Advanced tab. Never mention Advanced tab.\n"),e.prompt()},Xn=(generatePrompt2(),n(59618)),Jn={propertiesToChange:Xn.z.record(Xn.z.string().describe("The property name."),Xn.z.any().describe(`PropValue, refer to [${b}] by correct type, as appears in elementType`),Xn.z.any()).describe("An object record containing property names and their new values to be set on the element"),style:Xn.z.record(Xn.z.string().describe('A CSS property name, e.g. "color", "margin-top".'),Xn.z.string().nullable().describe('A CSS value, e.g. "red", "10px", "1px solid #000". Use null to reset the property to its default.')).describe("Raw CSS declarations as a flat property→value map. Converted to native styles server-side; any declaration that cannot be converted is stored as the element custom CSS. A null value resets that property to its default.").default({}),elementType:Xn.z.string().describe("The type of the element to retrieve the schema"),elementId:Xn.z.string().describe("The unique id of the element to configure")},Zn={success:Xn.z.boolean().describe("Whether the configuration change was successful, only if propertyName and propertyValue are provided")},initConfigureElementTool=e=>{const{addTool:t,resource:n}=e;n("configure-element-guide",Yn,{title:"Configure Element Guide",description:"Detailed guide for using the configure-element tool",mimeType:"text/plain"},async e=>({contents:[{uri:e.href,mimeType:"text/plain",text:generatePrompt2()}]})),t({name:"configure-element",description:"Configure an existing V4 element's properties and styles. Read the guide resource before use.",schema:Jn,outputSchema:Zn,requiredResources:[{description:"Widgets schema",uri:b},{description:"Configure element guide",uri:Yn},{description:"Dynamic tags catalog",uri:gn}],handler:async({elementId:e,propertiesToChange:t,elementType:n,style:r})=>{const o=(0,Hn.getWidgetsCache)()?.[n];if(!o)throw new Error(`Unknown element type: ${n}. Check the available-widgets resource for valid types.`);const i=(0,Hn.getContainer)(e);if(!i)throw new Error(`Element with id ${e} not found`);if(!(i.settings.get("widgetType")===n||i.type===n))throw new Error(`Element with ID ${e} is not of type ${n}`);if(!o.atomic_props_schema)throw new Error(`This tool does not support V3 elements. Please use the elementor-v3-mcp tools instead for element type: ${n}`);const s=function resolveCanonicalPropKeys(e,t){const n=(0,In.getWidgetsCache)()?.[e]?.atomic_props_schema;if(!n)return{...t};const r=buildAliasToCanonicalMap(n),o={};for(const[e,r]of Object.entries(t))n[e]&&(o[e]=r);for(const[e,i]of Object.entries(t)){if(n[e])continue;const t=r[e];t?Object.prototype.hasOwnProperty.call(o,t)||(o[t]=i):o[e]=i}return o}(n,t),a=Object.entries(s);for(const[t,r]of a){if(!qn.Schema.isPropKeyConfigurable(t))throw new Error(`Not allowed to update ${t}`);try{doUpdateElementProperty({elementId:e,elementType:n,propertyName:t,propertyValue:r})}catch(r){const o=createUpdateErrorMessage({propertyName:t,elementId:e,elementType:n,error:r,propertyType:"prop"});throw new Error(o)}}return await async function applyStyleFromCss(e){const{elementId:t,elementType:n,style:r}=e;if(!r||0===Object.keys(r).length)return;const{props:o,customCss:i}=await convertCssToAtomic(r),s={...o};i&&(s.custom_css=i);if(0===Object.keys(s).length)return;try{doUpdateElementProperty({elementId:t,elementType:n,propertyName:"_styles",propertyValue:s,customCssWriteMode:"merge-with-stored"}),(0,Gn.dispatchMcpStylesAppliedEvent)({styleValue:s})}catch(e){throw new Error(createUpdateErrorMessage({propertyName:"(style)",elementId:t,elementType:n,propertyType:"style",error:e}))}}({elementId:e,elementType:n,style:r}),{success:!0}}})};function createUpdateErrorMessage(e){const{propertyName:t,elementId:n,elementType:r,error:o,propertyType:i}=e;return`Failed to update property "${t}" on element "${n}": ${o.message}.\n${"prop"===i?`\nCheck the element's PropType schema at the resource [${b.replace("{widgetType}",r)}] for type "${r}" to ensure the property exists and the value matches the expected PropType.\nNow that you have this information, ensure you have the schema and try again.`:'\nProvide styling as raw CSS via the "style" parameter (a flat map of CSS property → value). Declarations that cannot be converted are stored as the element custom CSS.'};\n}`}var Qn=n(70975),er=n(2020),tr=n(59618),nr={elementId:tr.z.string()},rr={properties:tr.z.record(tr.z.string(),tr.z.any()).describe("A record mapping PropTypes to their corresponding PropValues"),style:tr.z.record(tr.z.string(),tr.z.any()).describe("A record mapping StyleSchema properties to their corresponding PropValues"),childElements:tr.z.array(tr.z.object({id:tr.z.string(),elementType:tr.z.string(),childElements:tr.z.array(tr.z.any()).describe("An array of child element IDs, when applicable, same structure recursively")})).describe("An array of child element IDs, when applicable, with recursive structure")},structuredElements=e=>(e.children||[]).map(e=>({id:e.id,elementType:e.model.get("elType")||e.model.get("widgetType")||"unknown",childElements:structuredElements(e)})),initCanvasMcp=e=>{nn.Schema.setDynamicTagNamesResolver(getDynamicTagNamesByCategories),initWidgetsSchemaResource(e),initAvailableWidgetsResource(e),(e=>{const{resource:t,sendResourceUpdated:n}=e;let r=null;const updateDocumentStructure=()=>{const e=getDocumentStructure(),t=JSON.stringify(e,null,2);t!==r&&(r=t,n({uri:cn}))};(0,ln.__privateListenTo)([(0,ln.commandEndEvent)("document/elements/create"),(0,ln.commandEndEvent)("document/elements/delete"),(0,ln.commandEndEvent)("document/elements/move"),(0,ln.commandEndEvent)("document/elements/copy"),(0,ln.commandEndEvent)("document/elements/paste"),(0,ln.commandEndEvent)("editor/documents/attach-preview"),(0,ln.commandEndEvent)("editor/documents/switch")],updateDocumentStructure),updateDocumentStructure(),t("document-structure",cn,{description:"Document structure."},async()=>({contents:[{uri:cn,text:JSON.stringify(getDocumentStructure(),null,2)}]}))})(e),(e=>{const{resource:t}=e;t("dynamic-tags",gn,{description:'List of available dynamic tags. To bind a property to a dynamic source, set its value to { "$$type": "dynamic", "value": { "name": , "settings": { ... } } } using a tag whose name appears in that property\'s allowed list, and populate "settings" per the tag entry here.',mimeType:"application/json"},async e=>({contents:[{uri:e.href,mimeType:"application/json",text:JSON.stringify(Object.values(getAtomicDynamicTags()).map(e=>{return{name:e.name,label:e.label,categories:e.categories,settings:(t=e.props_schema,Object.fromEntries(Object.entries(t??{}).filter(([e])=>!pn.includes(e)).map(([e,t])=>[e,un.Schema.propTypeToJsonSchema(t)])))};var t}))}]}))})(e),(e=>{const{resource:t,sendResourceUpdated:n}=e;let r=null;const publishIfChanged=e=>{const t=JSON.stringify(e);t!==r&&(r=t,n({uri:Tn}))};(0,En.__privateListenTo)([(0,En.commandEndEvent)("document/elements/select"),(0,En.commandEndEvent)("document/elements/deselect-all"),(0,En.commandEndEvent)("document/elements/settings")],e=>{if("command"!==e.type)return;const t=e;if("document/elements/deselect-all"===t.command)return void publishIfChanged({elementDisplayName:null,elementType:null,properties:null,selectedElementId:null,selectedParentId:null,version:null,widgetType:null});if("document/elements/select"!==t.command&&"document/elements/settings"!==t.command)return;const{container:n}=t.args||{};publishIfChanged(n?.id?buildPayloadFromContainer(n):readSelectionFromEditor())}),publishIfChanged(readSelectionFromEditor()),t("selected-element",Tn,{description:"Currently selected Elementor element context."},async()=>({contents:[{uri:Tn,text:JSON.stringify(readSelectionFromEditor(),null,2)}]}))})(e),(e=>{const{resource:t,sendResourceUpdated:n}=e;let r="";const buildState=()=>({currentlyViewedScreen:"The user is currently viewing the Elementor editor",pageContent:getPageContentFromPreview(),pageTitle:getPageTitle()});(0,hn.__privateListenTo)([(0,hn.commandEndEvent)("editor/documents/switch"),(0,hn.commandEndEvent)("editor/documents/attach-preview")],()=>{const e=JSON.stringify(buildState());e!==r&&(r=e,n({uri:yn}))}),r=JSON.stringify(buildState()),t("editor-state",yn,{description:"Editor page title, preview text snapshot, and viewed screen label."},async()=>({contents:[{uri:yn,text:JSON.stringify(buildState(),null,2)}]}))})(e),initGeneralContextResource(e),initBuildCompositionsTool(e),(e=>{const{addTool:t}=e;t({name:"get-element-configuration-values",description:"Retrieve the element's configuration PropValues for a specific element by unique ID.",schema:nr,outputSchema:rr,handler:async({elementId:e})=>{const t=(0,Qn.getContainer)(e);if(!t)throw new Error(`Element with ID ${e} not found.`);const n=t.model.get("widgetType")||t.model.get("elType")||"",r=(0,Qn.getWidgetsCache)()?.[n];if(!r)throw new Error(`Unknown element type: ${n}. Check the available-widgets resource for valid types.`);if(!r.atomic_props_schema)throw new Error(`This tool does not support V3 elements. Please use the elementor-v3-mcp tools instead for element type: ${n}`);const o=t.settings,i=(0,Qn.getWidgetsCache)()?.[n]?.atomic_props_schema;if(!o||!i)throw new Error(`No settings or prop schema found for element ID: ${e}`);const s={},a={};er.Schema.configurableKeys(i).forEach(e=>{s[e]=structuredClone(o.get(e))});const l=(0,Qn.getElementStyles)(e)||{},c=Object.values(l).find(e=>"local"===e.label);if(c){const e=c.variants.find(e=>"desktop"===e.meta.breakpoint&&!e.meta.state);if(e){const t=e.props||{};Object.keys(t).forEach(e=>{void 0!==t[e]&&(a[e]=structuredClone(t[e]))}),e.custom_css&&(a.custom_css=atob(e.custom_css.raw))}}return{properties:{...s},style:{...a},childElements:structuredElements(t)}}})})(e),initConfigureElementTool(e),(e=>{const{resource:t,sendResourceUpdated:n}=e,getBreakpointsList=()=>{const{breakpoints:e}=window.elementor?.config?.responsive||{};return e?Object.values(e).filter(e=>e.is_enabled).map(e=>{const{direction:t,label:n,value:r}=e;return{label:n,constraint:t,value:r}}):[]},buildResourceResponse=()=>({contents:[{uri:T,mimeType:"application/json",text:JSON.stringify(getBreakpointsList())}]});t("breakpoints ",T,{description:"Breakpoints list."},()=>buildResourceResponse()),window.addEventListener((0,d.v1ReadyEvent)().name,()=>{n({uri:T,...buildResourceResponse()})})})(e)},or=b.replace("{widgetType}","element-schema"),ir=`Elementor Canvas MCP\nThis MCP enables creation, configuration, and styling of elements on the Elementor canvas using the build_composition tool.\n\n# Core Concepts\n\n## PropValues Structure\nAll data in Elementor uses PropValues - a typed wrapper for values:\n\`\`\`json\n{\n "$$type": "the-prop-type-schema-kind",\n "value": "the-actual-value-as-defined-for-the-propType"\n}\n\`\`\`\nThe \`$$type\` defines how Elementor interprets the value. Providing the correct \`$$type\` is critical - incorrect types will be rejected.\n\n## Design System Resources\n- **Global Variables**: Reusable colors, sizes, and fonts (\`elementor://global-variables\`)\n- **Global Classes**: Reusable style sets that can be applied to elements (\`elementor://global-classes\`)\n- **Widget Schemas**: Configuration options for each widget type (\`${b}\`)\n\n# Building Compositions with build_composition\n\nThe \`build_composition\` tool is the primary way to create elements. It accepts structure (XML), configuration, and styling in a single operation.\n\n## Complete Workflow\n\n### 1. Parse User Requirements\nUnderstand what needs to be built: structure, content, and styling.\n\n### 2. Check Global Resources FIRST\nAlways check existing resources before building:\n- List \`elementor://global-variables\` for available variables (colors, sizes, fonts)\n- List \`elementor://global-classes\` for available style sets\n- **Always prefer using existing global resources over creating inline styles**\n\n### 3. Retrieve Widget Schemas\nFor each widget you'll use:\n- List \`${b}\` to see available widgets\n- Retrieve configuration schema from \`${or}\` for each widget\n- Check the \`llm_guidance\` property for container nesting, \`default_styles\`, and \`default_settings\` (omit default_settings from elementConfig unless the user asks to change them)\n\n### 4. Build XML Structure\nCreate valid XML with configuration-ids:\n- Each element must have a unique \`configuration-id\` attribute\n- No text nodes, classes, or IDs in XML - structure only\n- Example:\n\`\`\`xml\n\n \n \n\n\`\`\`\n\n### 5. Create elementConfig\nMap each configuration-id to its widget properties using PropValues:\n- Use correct \`$$type\` matching the widget's schema\n- Use global variables in PropValues where applicable\n- Example:\n\`\`\`json\n{\n "heading-1": {\n "text": { "$$type": "string", "value": "Welcome" },\n "tag": { "$$type": "string", "value": "h1" }\n }\n}\n\`\`\`\n\n### 6. Create style\nMap each configuration-id to raw CSS declarations (property → value strings). The server converts them to native styles and stores any unconvertible declarations as the element custom CSS.\n- Example:\n\`\`\`json\n{\n "heading-1": "color: #1a1a1a; font-size: 2rem;"\n }\n}\n\`\`\`\n\n### 7. Execute build_composition\nCall the tool with your XML structure, elementConfig, and style. The response will contain the created element IDs.\nAt the response you will also find llm_instructions for you to do afterwards, read and follow them!\n\n## Key Points\n\n- **PropValue Types**: Arrays that accept union types are typed as mixed arrays\n- **Visual Sizing**: Widget sizes MUST be defined via the style parameter (raw CSS). Widget properties like image "size" control resolution, not visual appearance\n- **Global Variables**: Reference by label/name: (e.g. var(--card-background-color)\n- **Naming Conventions**: Use meaningful, purpose-based names (e.g., "primary-button", "heading-large"), not value-based names (e.g., "blue-style", "20px-padding")\n\n## Example: e-image PropValue Structure\n\`\`\`json\n{\n "$$type": "image",\n "value": {\n "src": {\n "$$type": "image-src",\n "value": {\n "url": { "$$type": "url", "value": "https://example.com/image.jpg" }\n }\n },\n "size": { "$$type": "string", "value": "full" }\n }\n}\n\`\`\`\nNote: The "size" property controls image resolution/loading, not visual size. Set visual dimensions via the style parameter (raw CSS).\n`,sr=n(70975),ar=n(24778),lr=n(5527),cr=n(27723);var ur={href:"https://go.elementor.com/element-link-inside-link-infotip",target:"_blank",color:"inherit",variant:"text",sx:{marginInlineStart:"20px"},children:"Learn more"};function blockLinkInLinkPaste(e){const{containers:t=[e.container],storageType:n}=e,r=t;if("localstorage"!==n)return!1;const o=window?.elementorCommon?.storage?.get();if(!o?.clipboard?.elements)return!1;const i=o.clipboard.elements,s={type:"default",message:(0,cr.__)("To paste a link to this element, first remove the link from it's parent container.","elementor"),id:"paste-in-link-blocked",additionalActionProps:[ur]},a=shouldBlock(i,r);return a&&(0,ar.notify)(s),a}function blockLinkInLinkMove(e){const{containers:t=[e.container],target:n}=e,r=t,o=n,i={type:"default",message:(0,cr.__)("To drag a link to this element, first remove the link from it's parent container.","elementor"),id:"move-in-link-blocked",additionalActionProps:[ur]},s=shouldBlock(r,[o]);return s&&(0,ar.notify)(i),s}function shouldBlock(e,t){if(!e?.length||!t?.length)return!1;if(!e.some(e=>!!e?.id&&((0,sr.isElementAnchored)(e.id)||!!(0,sr.getAnchoredDescendantId)(e.id))))return!1;return t.some(e=>!!e?.id&&((0,sr.isElementAnchored)(e.id)||!!(0,sr.getAnchoredAncestorId)(e.id)))}var dr=n(70975),fr=n(2020),mr=n(5527),pr=n(70975),gr=n(2020),hr=n(27723);function hasAtomicWidgets(e){const{containers:t=[e.container]}=e;return t.some(isAtomicWidget)}function isAtomicWidget(e){return!!e&&Boolean(getContainerSchema(e))}function getClassesProp(e){const t=getContainerSchema(e);if(!t)return null;const[n]=Object.entries(t).find(([,e])=>"plain"===e.kind&&e.key===gr.CLASSES_PROP_KEY)??[];return n??null}function getContainerSchema(e){const t=e?.model.get("widgetType")||e?.model.get("elType"),n=(0,pr.getWidgetsCache)(),r=n?.[t];return r?.atomic_props_schema??null}function getTitleForContainers(e){return e.length>1?(0,hr.__)("Elements","elementor"):(0,pr.getElementLabel)(e[0].id)}var yr=n(70975),vr=n(47182),br=n(5527),wr=n(27723),undoablePasteElementStyle=()=>(0,br.undoable)({do:({containers:e,newStyle:t})=>e.map(e=>{const n=e.id,r=getClassesProp(e);if(!r)return null;const o=(0,yr.getElementStyles)(e.id),[i,s]=Object.entries(o??{})[0]??[],a=Object.keys(s??{}).length?s:null,l={styleId:i,originalStyle:a};if(i)t.variants.forEach(({meta:e,props:t,custom_css:r})=>{(0,yr.updateElementStyle)({elementId:n,styleId:i,meta:e,props:t,custom_css:r})});else{const[e]=t.variants,o=t.variants.slice(1);l.styleId=(0,yr.createElementStyle)({elementId:n,classesProp:r,label:vr.ELEMENTS_STYLES_RESERVED_LABEL,...e,additionalVariants:o})}return l}),undo:({containers:e},t)=>{e.forEach((e,n)=>{const r=t[n];if(!r)return;if(!r.originalStyle)return void(0,yr.deleteElementStyle)(e.id,r.styleId);const o=getClassesProp(e);if(!o)return;const[i]=r.originalStyle.variants,s=r.originalStyle.variants.slice(1);(0,yr.createElementStyle)({elementId:e.id,classesProp:o,label:vr.ELEMENTS_STYLES_RESERVED_LABEL,styleId:r.styleId,...i,additionalVariants:s})})}},{title:({containers:e})=>getTitleForContainers(e),subtitle:(0,wr.__)("Style Pasted","elementor")});function initPasteStyleCommand(){const e=undoablePasteElementStyle();(0,mr.blockCommand)({command:"document/elements/paste-style",condition:hasAtomicWidgets}),(0,mr.__privateListenTo)((0,mr.commandStartEvent)("document/elements/paste-style"),t=>function pasteStyles(e,t){const{containers:n=[e.container],storageKey:r}=e,o=n.filter(isAtomicWidget);if(!o.length)return;const i=function getClipboardElements(e="clipboard"){try{const t=JSON.parse(localStorage.getItem("elementor")??"{}");return t[e]?.elements}catch{return}}(r),[s]=i??[],a=(0,dr.getContainer)(s.id);if(!s||!a||!isAtomicWidget(a))return;const l=s.styles,c=Object.values(l??{})[0],u=function getClassesWithoutLocalStyle(e,t){const n=getClassesProp(e);if(!n)return[];const r=(0,dr.getElementSetting)(e.id,n);return r?.value.filter(e=>e!==t?.id)??[]}(a,c);u.length&&function pasteClasses(e,t){e.forEach(e=>{const n=getClassesProp(e);if(!n)return;const r=(0,dr.getElementSetting)(e.id,n),o=fr.classesPropTypeUtil.extract(r)??[],i=fr.classesPropTypeUtil.create(Array.from(new Set([...t,...o])));(0,dr.updateElementSettings)({id:e.id,props:{[n]:i}})})}(o,u);c&&t({containers:o,newStyle:c})}(t.args,e))}var Er=n(5527),Tr=n(70975),Sr=n(47182),xr=n(5527),Cr=n(27723),undoableResetElementStyle=()=>(0,xr.undoable)({do:({containers:e})=>e.map(e=>{const t=e.model.get("id"),n=(0,Tr.getElementStyles)(t);return Object.keys(n??{}).forEach(e=>(0,Tr.deleteElementStyle)(t,e)),n}),undo:({containers:e},t)=>{e.forEach((e,n)=>{const r=getClassesProp(e);if(!r)return;const o=e.model.get("id"),i=t[n];Object.entries(i??{}).forEach(([e,t])=>{const[n]=t.variants,i=t.variants.slice(1);(0,Tr.createElementStyle)({elementId:o,classesProp:r,styleId:e,label:Sr.ELEMENTS_STYLES_RESERVED_LABEL,...n,additionalVariants:i})})})}},{title:({containers:e})=>getTitleForContainers(e),subtitle:(0,Cr.__)("Style Reset","elementor")});function initResetStyleCommand(){const e=undoableResetElementStyle();(0,Er.blockCommand)({command:"document/elements/reset-style",condition:hasAtomicWidgets}),(0,Er.__privateListenTo)((0,Er.commandStartEvent)("document/elements/reset-style"),t=>function resetStyles(e,t){const{containers:n=[e.container]}=e,r=n.filter(isAtomicWidget);if(!r.length)return;t({containers:r})}(t.args,e))}function init(){!function initStyleTransformers(){ze.register("font-family",fontFamilyTransformer).register("size",sizeTransformer).register("grid-track-size",gridTrackSizeTransformer).register("shadow",shadowTransformer).register("stroke",strokeTransformer).register("dimensions",createMultiPropsTransformer(["block-start","block-end","inline-start","inline-end"],({propKey:e,key:t})=>`${e}-${t}`)).register("filter",filterTransformer).register("backdrop-filter",filterTransformer).register("box-shadow",createCombineArrayTransformer(",")).register("background",backgroundTransformer).register("background-overlay",backgroundOverlayTransformer).register("background-color-overlay",backgroundColorOverlayTransformer).register("background-image-overlay",backgroundImageOverlayTransformer).register("background-gradient-overlay",backgroundGradientOverlayTransformer).register("gradient-color-stop",createCombineArrayTransformer(",")).register("color-stop",colorStopTransformer).register("background-image-position-offset",positionTransformer).register("background-image-size-scale",backgroundImageSizeScaleTransformer).register("image-src",imageSrcTransformer).register("image",imageTransformer).register("object-position",positionTransformer).register("span",spanTransformer).register("transform-origin",transformOriginTransformer).register("perspective-origin",perspectiveOriginTransformer).register("transform-move",transformMoveTransformer).register("transform-scale",transformScaleTransformer).register("transform-rotate",transformRotateTransformer).register("transform-skew",transformSkewTransformer).register("transform-functions",transformFunctionsTransformer).register("transform",createMultiPropsTransformer(["transform-functions","transform-origin","perspective","perspective-origin"],({key:e})=>"transform-functions"===e?"transform":e)).register("transition",transitionTransformer).register("layout-direction",createMultiPropsTransformer(["row","column"],({propKey:e,key:t})=>`${t}-${e}`)).register("flex",flexTransformer).register("border-width-v2",createMultiPropsTransformer(["block-start","block-end","inline-start","inline-end"],({key:e})=>`border-${e}-width`)).register("border-radius-v2",createMultiPropsTransformer(["start-start","start-end","end-start","end-end"],({key:e})=>`border-${e}-radius`)).registerFallback(plainTransformer)}(),function initStyleCommands(){initPasteStyleCommand(),initResetStyleCommand()}(),function initLinkInLinkPrevention(){(0,lr.blockCommand)({command:"document/elements/paste",condition:blockLinkInLinkPaste}),(0,lr.blockCommand)({command:"document/elements/move",condition:blockLinkInLinkMove})}(),function initFormNestingPrevention(){(0,ct.blockCommand)({command:"document/elements/create",condition:blockFormCreate}),(0,ct.blockCommand)({command:"document/elements/move",condition:blockFormMove}),(0,ct.blockCommand)({command:"document/elements/paste",condition:blockFormPaste})}(),function initFormAncestorEnforcement(){(0,nt.blockCommand)({command:"document/elements/create",condition:blockFormFieldCreate}),(0,nt.blockCommand)({command:"document/elements/move",condition:blockFormFieldMove}),(0,nt.blockCommand)({command:"document/elements/paste",condition:blockFormFieldPaste})}(),initViewReplacements(),initLegacyViews(),function initSettingsTransformers(){dt.register("classes",createClassesTransformer()).register("link",linkTransformer).register("query",queryTransformer).register("image",imageTransformer).register("image-src",imageSrcTransformer).register("svg-src",svgSrcTransformer).register("video-src",videoSrcTransformer).register("attributes",attributesTransformer).register("date-time",dateTimeTransformer).register("html-v2",htmlV2Transformer).register("html-v3",htmlV3Transformer).register("date-range",dateRangeTransformer).register("time-range",timeRangeTransformer).registerFallback(plainTransformer)}(),(0,R.injectIntoTop)({id:"elements-overlays",component:ElementsOverlays}),(0,R.injectIntoTop)({id:"canvas-style-render",component:StyleRenderer}),(0,R.injectIntoTop)({id:"canvas-interactions-render",component:InteractionsRenderer}),(0,R.injectIntoLogic)({id:"classes-rename",component:ClassesRename}),initCanvasMcp((0,_.getMCPByDomain)("canvas",{instructions:"Everything related to V4 ( Atomic ) canvas.\n# Canvas workflow for new compositions\n- Configure elements settings and styles\n- Build compositions/sections out of V4 atomic elements using context aware designs using the website resources\n- Get and retrieve element configuration values\n",docs:ir})),function initTabsModelExtensions(){registerModelExtensions("e-tab",tn)}()}var Rr=["elementor-element"],endDragElementFromPanel=()=>{getElementorChannels()?.panelElements?.trigger("element:drag:end")},startDragElementFromPanel=(e,t)=>{setDragGroups(t);const n=getElementorChannels();n?.editor.reply("element:dragged",null),n?.panelElements.reply("element:selected",getLegacyPanelElementView(e)).trigger("element:drag:start")},setDragGroups=e=>{const t={groups:getDragGroups(e)};e.dataTransfer?.setData(JSON.stringify(t),"true")},getDragGroups=e=>{const t=e.dataTransfer?.getData("text/plain");return t?JSON.parse(t).groups:Rr},getElementorChannels=()=>{const e=window,t=e.elementor?.channels;if(!t)throw new Error("Elementor channels not found: Elementor editor is not initialized or channels are unavailable.");return t},getLegacyPanelElementView=({settings:e,...t})=>{const n=window,r=n.elementor?.modules?.elements?.models?.Element;if(!r)throw new Error("Elementor legacy Element model not found in editor modules");return{model:new r({...t,custom:{isPreset:!!e,preset_settings:e}})}},_r="elementor/global-styles/imported",Ar=__toESM(n(97557));function SpotlightBackdrop({canvas:e,element:t,onExit:n,ariaLabel:r}){const o=useElementRect(t),i=t?function getRectClipPath(e,t){const{x:n,y:r,width:o,height:i}=e,{innerWidth:s,innerHeight:a}=t;return`path(evenodd, 'M 0 0 L ${s} 0 L ${s} ${a} L 0 ${a} Z M ${n} ${r} L ${n+o} ${r} L ${n+o} ${r+i} L ${n} ${r+i} L ${n} ${r} Z')`}(o,e.defaultView):void 0,s={position:"fixed",top:0,left:0,width:"100vw",height:"100vh",backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:999,pointerEvents:"painted",cursor:"pointer",clipPath:i};return Ar.createElement("div",{style:s,onClick:n,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),n())},role:"button",tabIndex:0,"aria-label":r})}var kr=n(5527);function useCanvasDocument(){return(0,kr.__privateUseListenTo)((0,kr.commandEndEvent)("editor/documents/attach-preview"),()=>(0,kr.getCanvasIframeDocument)())}var Or=n(97557);function useEscapeOnCanvas(e,t){(0,Or.useEffect)(()=>{if(!e)return;const handleEsc=e=>{"Escape"===e.key&&t()};return e.body.addEventListener("keydown",handleEsc),()=>{e.body.removeEventListener("keydown",handleEsc)}},[e,t])}var Ir=n(70975);function doAfterRender(e,t){const n=e.map(e=>{const t=(0,Ir.getContainer)(e)?.view;if(t&&function hasDoAfterRender(e){return"function"==typeof e?._doAfterRender}(t))return new Promise(e=>t._doAfterRender(e))}).filter(Boolean);n.length>0?Promise.all(n).then(()=>t(e)):t(e)}},70975:function(e){e.exports=window.elementorV2.editorElements},74518:function(e){e.exports=window.elementorV2.editorResponsive},74848:function(e,t,n){e.exports=n(21020)},77394:function(e){e.exports=window.elementorV2.editorControls},77422:function(e,t,n){n.r(t),n.d(t,{Composite:function(){return he},CompositeItem:function(){return ye},FloatingArrow:function(){return Te},FloatingDelayGroup:function(){return FloatingDelayGroup},FloatingFocusManager:function(){return FloatingFocusManager},FloatingList:function(){return FloatingList},FloatingNode:function(){return FloatingNode},FloatingOverlay:function(){return ze},FloatingPortal:function(){return FloatingPortal},FloatingTree:function(){return FloatingTree},NextFloatingDelayGroup:function(){return NextFloatingDelayGroup},arrow:function(){return floating_ui_react_dom_arrow},autoPlacement:function(){return floating_ui_react_dom_autoPlacement},autoUpdate:function(){return autoUpdate},computePosition:function(){return floating_ui_dom_computePosition},detectOverflow:function(){return ne},flip:function(){return floating_ui_react_dom_flip},getOverflowAncestors:function(){return getOverflowAncestors},hide:function(){return floating_ui_react_dom_hide},inline:function(){return floating_ui_react_dom_inline},inner:function(){return inner},limitShift:function(){return floating_ui_react_dom_limitShift},offset:function(){return floating_ui_react_dom_offset},platform:function(){return te},safePolygon:function(){return safePolygon},shift:function(){return floating_ui_react_dom_shift},size:function(){return floating_ui_react_dom_size},useClick:function(){return useClick},useClientPoint:function(){return useClientPoint},useDelayGroup:function(){return useDelayGroup},useDelayGroupContext:function(){return useDelayGroupContext},useDismiss:function(){return useDismiss},useFloating:function(){return floating_ui_react_esm_useFloating},useFloatingNodeId:function(){return useFloatingNodeId},useFloatingParentNodeId:function(){return useFloatingParentNodeId},useFloatingPortalNode:function(){return useFloatingPortalNode},useFloatingRootContext:function(){return useFloatingRootContext},useFloatingTree:function(){return useFloatingTree},useFocus:function(){return useFocus},useHover:function(){return useHover},useId:function(){return Ee},useInnerOffset:function(){return useInnerOffset},useInteractions:function(){return useInteractions},useListItem:function(){return useListItem},useListNavigation:function(){return useListNavigation},useMergeRefs:function(){return useMergeRefs},useNextDelayGroup:function(){return useNextDelayGroup},useRole:function(){return useRole},useTransitionStatus:function(){return useTransitionStatus},useTransitionStyles:function(){return useTransitionStyles},useTypeahead:function(){return useTypeahead}});var r=n(97557),o=n.t(r,2);function hasWindow(){return"undefined"!=typeof window}function getNodeName(e){return isNode(e)?(e.nodeName||"").toLowerCase():"#document"}function getWindow(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function getDocumentElement(e){var t;return null==(t=(isNode(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function isNode(e){return!!hasWindow()&&(e instanceof Node||e instanceof getWindow(e).Node)}function isElement(e){return!!hasWindow()&&(e instanceof Element||e instanceof getWindow(e).Element)}function isHTMLElement(e){return!!hasWindow()&&(e instanceof HTMLElement||e instanceof getWindow(e).HTMLElement)}function isShadowRoot(e){return!(!hasWindow()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof getWindow(e).ShadowRoot)}function isOverflowElement(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=floating_ui_utils_dom_getComputedStyle(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&"inline"!==o&&"contents"!==o}function isTableElement(e){return/^(table|td|th)$/.test(getNodeName(e))}function isTopLayer(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}const i=/transform|translate|scale|rotate|perspective|filter/,s=/paint|layout|strict|content/,isNotNone=e=>!!e&&"none"!==e;let a;function isContainingBlock(e){const t=isElement(e)?floating_ui_utils_dom_getComputedStyle(e):e;return isNotNone(t.transform)||isNotNone(t.translate)||isNotNone(t.scale)||isNotNone(t.rotate)||isNotNone(t.perspective)||!isWebKit()&&(isNotNone(t.backdropFilter)||isNotNone(t.filter))||i.test(t.willChange||"")||s.test(t.contain||"")}function isWebKit(){return null==a&&(a="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),a}function isLastTraversableNode(e){return/^(html|body|#document)$/.test(getNodeName(e))}function floating_ui_utils_dom_getComputedStyle(e){return getWindow(e).getComputedStyle(e)}function getNodeScroll(e){return isElement(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function getParentNode(e){if("html"===getNodeName(e))return e;const t=e.assignedSlot||e.parentNode||isShadowRoot(e)&&e.host||getDocumentElement(e);return isShadowRoot(t)?t.host:t}function getNearestOverflowAncestor(e){const t=getParentNode(e);return isLastTraversableNode(t)?e.ownerDocument?e.ownerDocument.body:e.body:isHTMLElement(t)&&isOverflowElement(t)?t:getNearestOverflowAncestor(t)}function getOverflowAncestors(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=getNearestOverflowAncestor(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),s=getWindow(o);if(i){const e=getFrameElement(s);return t.concat(s,s.visualViewport||[],isOverflowElement(o)?o:[],e&&n?getOverflowAncestors(e):[])}return t.concat(o,getOverflowAncestors(o,[],n))}function getFrameElement(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const l=["top","right","bottom","left"],c=["start","end"],u=l.reduce((e,t)=>e.concat(t,t+"-"+c[0],t+"-"+c[1]),[]),d=Math.min,f=Math.max,m=Math.round,p=Math.floor,createCoords=e=>({x:e,y:e}),g={left:"right",right:"left",bottom:"top",top:"bottom"};function clamp(e,t,n){return f(e,d(t,n))}function evaluate(e,t){return"function"==typeof e?e(t):e}function getSide(e){return e.split("-")[0]}function getAlignment(e){return e.split("-")[1]}function getOppositeAxis(e){return"x"===e?"y":"x"}function getAxisLength(e){return"y"===e?"height":"width"}function getSideAxis(e){const t=e[0];return"t"===t||"b"===t?"y":"x"}function getAlignmentAxis(e){return getOppositeAxis(getSideAxis(e))}function getAlignmentSides(e,t,n){void 0===n&&(n=!1);const r=getAlignment(e),o=getAlignmentAxis(e),i=getAxisLength(o);let s="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=getOppositePlacement(s)),[s,getOppositePlacement(s)]}function getOppositeAlignmentPlacement(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const h=["left","right"],y=["right","left"],v=["top","bottom"],b=["bottom","top"];function getOppositeAxisPlacements(e,t,n,r){const o=getAlignment(e);let i=function getSideList(e,t,n){switch(e){case"top":case"bottom":return n?t?y:h:t?h:y;case"left":case"right":return t?v:b;default:return[]}}(getSide(e),"start"===n,r);return o&&(i=i.map(e=>e+"-"+o),t&&(i=i.concat(i.map(getOppositeAlignmentPlacement)))),i}function getOppositePlacement(e){const t=getSide(e);return g[t]+e.slice(t.length)}function getPaddingObject(e){return"number"!=typeof e?function expandPaddingObject(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function rectToClientRect(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}var w=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],E=w.join(","),T="undefined"==typeof Element,S=T?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,x=!T&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},C=function isInert(e,t){var n;void 0===t&&(t=!0);var r=null==e||null===(n=e.getAttribute)||void 0===n?void 0:n.call(e,"inert");return""===r||"true"===r||t&&e&&("function"==typeof e.closest?e.closest("[inert]"):C(e.parentNode))},R=function getCandidates(e,t,n){if(C(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(E));return t&&S.call(e,E)&&r.unshift(e),r=r.filter(n)},_=function getCandidatesIteratively(e,t,n){for(var r=[],o=Array.from(e);o.length;){var i=o.shift();if(!C(i,!1))if("SLOT"===i.tagName){var s=i.assignedElements(),a=s.length?s:i.children,l=_(a,!0,n);n.flatten?r.push.apply(r,l):r.push({scopeParent:i,candidates:l})}else{S.call(i,E)&&n.filter(i)&&(t||!e.includes(i))&&r.push(i);var c=i.shadowRoot||"function"==typeof n.getShadowRoot&&n.getShadowRoot(i),u=!C(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(i));if(c&&u){var d=_(!0===c?i.children:c.children,!0,n);n.flatten?r.push.apply(r,d):r.push({scopeParent:i,candidates:d})}else o.unshift.apply(o,i.children)}}return r},A=function hasTabIndex(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},k=function getTabIndex(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function isContentEditable(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!A(e)?0:e.tabIndex},O=function sortOrderedTabbables(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},I=function isInput(e){return"INPUT"===e.tagName},P=function isNonTabbableRadio(e){return function isRadio(e){return I(e)&&"radio"===e.type}(e)&&!function isTabbableRadio(e){if(!e.name)return!0;var t,n=e.form||x(e),r=function queryRadios(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function getCheckedRadio(e,t){for(var n=0;nsummary:first-of-type")?e.parentElement:e;if(S.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"full-native"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return L(e)}else{if("function"==typeof r){for(var i=e;e;){var s=e.parentElement,a=x(e);if(s&&!s.shadowRoot&&!0===r(s))return L(e);e=e.assignedSlot?e.assignedSlot:s||a===e.ownerDocument?s:a.host}e=i}if(function isNodeAttached(e){var t,n,r,o,i=e&&x(e),s=null===(t=i)||void 0===t?void 0:t.host,a=!1;if(i&&i!==e)for(a=!!(null!==(n=s)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(s)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!a&&s;){var l,c,u;a=!(null===(c=s=null===(l=i=x(s))||void 0===l?void 0:l.host)||void 0===c||null===(u=c.ownerDocument)||void 0===u||!u.contains(s))}return a}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},N=function isNodeMatchingSelectorFocusable(e,t){return!(t.disabled||function isHiddenInput(e){return I(e)&&"hidden"===e.type}(t)||M(t,e)||function isDetailsWithSummary(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some(function(e){return"SUMMARY"===e.tagName})}(t)||function isDisabledFromFieldset(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n=0)},$=function sortByOrder(e){var t=[],n=[];return e.forEach(function(e,r){var o=!!e.scopeParent,i=o?e.scopeParent:e,s=function getSortOrderTabIndex(e,t){var n=k(e);return n<0&&t&&!A(e)?0:n}(i,o),a=o?$(e.candidates):i;0===s?o?t.push.apply(t,a):t.push(i):n.push({documentOrder:r,tabIndex:s,item:e,isScope:o,content:a})}),n.sort(O).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},V=function tabbable(e,t){var n;return n=(t=t||{}).getShadowRoot?_([e],t.includeContainer,{filter:D.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:F}):R(e,t.includeContainer,D.bind(null,t)),$(n)},j=function focusable(e,t){return(t=t||{}).getShadowRoot?_([e],t.includeContainer,{filter:N.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):R(e,t.includeContainer,N.bind(null,t))},W=function isTabbable(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==S.call(e,E)&&D(t,e)};function getPlatform(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function getUserAgent(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(e=>{let{brand:t,version:n}=e;return t+"/"+n}).join(" "):navigator.userAgent}function isSafari(){return/apple/i.test(navigator.vendor)}function isAndroid(){const e=/android/i;return e.test(getPlatform())||e.test(getUserAgent())}function isJSDOM(){return getUserAgent().includes("jsdom/")}const B="data-floating-ui-focusable",z="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",U="ArrowLeft",H="ArrowRight",G="ArrowUp",K="ArrowDown";function activeElement(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement}return t}function contains(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&isShadowRoot(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function getTarget(e){return"composedPath"in e?e.composedPath()[0]:e.target}function isEventTargetWithin(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}function getDocument(e){return(null==e?void 0:e.ownerDocument)||document}function isTypeableElement(e){return isHTMLElement(e)&&e.matches(z)}function isTypeableCombobox(e){return!!e&&("combobox"===e.getAttribute("role")&&isTypeableElement(e))}function getFloatingFocusElement(e){return e?e.hasAttribute(B)?e:e.querySelector("["+B+"]")||e:null}function getNodeChildren(e,t,n){void 0===n&&(n=!0);return e.filter(e=>{var r;return e.parentId===t&&(!n||(null==(r=e.context)?void 0:r.open))}).flatMap(t=>[t,...getNodeChildren(e,t.id,n)])}function getNodeAncestors(e,t){var n;let r=[],o=null==(n=e.find(e=>e.id===t))?void 0:n.parentId;for(;o;){const t=e.find(e=>e.id===o);o=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}function stopEvent(e){e.preventDefault(),e.stopPropagation()}function isVirtualClick(e){return!(0!==e.mozInputSource||!e.isTrusted)||(isAndroid()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function isVirtualPointerEvent(e){return!isJSDOM()&&(!isAndroid()&&0===e.width&&0===e.height||isAndroid()&&1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"===e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail&&"touch"===e.pointerType)}function isMouseLikePointerType(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var Y="undefined"!=typeof document?r.useLayoutEffect:function noop(){};function useLatestRef(e){const t=r.useRef(e);return Y(()=>{t.current=e}),t}const X={...o}.useInsertionEffect||(e=>e());function useEffectEvent(e){const t=r.useRef(()=>{0});return X(()=>{t.current=e}),r.useCallback(function(){for(var e=arguments.length,n=new Array(e),r=0;r=e.current.length}function getMinListIndex(e,t){return findNonDisabledListIndex(e,{disabledIndices:t})}function getMaxListIndex(e,t){return findNonDisabledListIndex(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function findNonDisabledListIndex(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:o,amount:i=1}=void 0===t?{}:t,s=n;do{s+=r?-i:i}while(s>=0&&s<=e.current.length-1&&isListIndexDisabled(e,s,o));return s}function getGridNavigatedIndex(e,t){let{event:n,orientation:r,loop:o,rtl:i,cols:s,disabledIndices:a,minIndex:l,maxIndex:c,prevIndex:u,stopEvent:d=!1}=t,f=u;if(n.key===G){if(d&&stopEvent(n),-1===u)f=c;else if(f=findNonDisabledListIndex(e,{startingIndex:f,amount:s,decrement:!0,disabledIndices:a}),o&&(u-se?n:n-s}isIndexOutOfListBounds(e,f)&&(f=u)}if(n.key===K&&(d&&stopEvent(n),-1===u?f=l:(f=findNonDisabledListIndex(e,{startingIndex:u,amount:s,disabledIndices:a}),o&&u+s>c&&(f=findNonDisabledListIndex(e,{startingIndex:u%s-s,amount:s,disabledIndices:a}))),isIndexOutOfListBounds(e,f)&&(f=u)),"both"===r){const t=p(u/s);n.key===(i?U:H)&&(d&&stopEvent(n),u%s!==s-1?(f=findNonDisabledListIndex(e,{startingIndex:u,disabledIndices:a}),o&&isDifferentGridRow(f,s,t)&&(f=findNonDisabledListIndex(e,{startingIndex:u-u%s-1,disabledIndices:a}))):o&&(f=findNonDisabledListIndex(e,{startingIndex:u-u%s-1,disabledIndices:a})),isDifferentGridRow(f,s,t)&&(f=u)),n.key===(i?H:U)&&(d&&stopEvent(n),u%s!==0?(f=findNonDisabledListIndex(e,{startingIndex:u,decrement:!0,disabledIndices:a}),o&&isDifferentGridRow(f,s,t)&&(f=findNonDisabledListIndex(e,{startingIndex:u+(s-u%s),decrement:!0,disabledIndices:a}))):o&&(f=findNonDisabledListIndex(e,{startingIndex:u+(s-u%s),decrement:!0,disabledIndices:a})),isDifferentGridRow(f,s,t)&&(f=u));const r=p(c/s)===t;isIndexOutOfListBounds(e,f)&&(f=o&&r?n.key===(i?H:U)?c:findNonDisabledListIndex(e,{startingIndex:u-u%s-1,disabledIndices:a}):u)}return f}function createGridCellMap(e,t,n){const r=[];let o=0;return e.forEach((e,i)=>{let{width:s,height:a}=e,l=!1;for(n&&(o=0);!l;){const e=[];for(let n=0;nnull==r[e])?(e.forEach(e=>{r[e]=i}),l=!0):o++}}),[...r]}function getGridCellIndexOfCorner(e,t,n,r,o){if(-1===e)return-1;const i=n.indexOf(e),s=t[e];switch(o){case"tl":return i;case"tr":return s?i+s.width-1:i;case"bl":return s?i+(s.height-1)*r:i;case"br":return n.lastIndexOf(e)}}function getGridCellIndices(e,t){return t.flatMap((t,n)=>e.includes(t)?[n]:[])}function isListIndexDisabled(e,t,n){if("function"==typeof n)return n(t);if(n)return n.includes(t);const r=e.current[t];return null==r||r.hasAttribute("disabled")||"true"===r.getAttribute("aria-disabled")}const getTabbableOptions=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function getTabbableIn(e,t){const n=V(e,getTabbableOptions()),r=n.length;if(0===r)return;const o=activeElement(getDocument(e)),i=n.indexOf(o);return n[-1===i?1===t?0:r-1:i+t]}function getNextTabbable(e){return getTabbableIn(getDocument(e).body,1)||e}function getPreviousTabbable(e){return getTabbableIn(getDocument(e).body,-1)||e}function isOutsideEvent(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!contains(n,r)}function disableFocusInside(e){V(e,getTabbableOptions()).forEach(e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")})}function enableFocusInside(e){e.querySelectorAll("[data-tabindex]").forEach(e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")})}var J=n(74848),Z=n(43617);function computeCoordsFromPlacement(e,t,n){let{reference:r,floating:o}=e;const i=getSideAxis(t),s=getAlignmentAxis(t),a=getAxisLength(s),l=getSide(t),c="y"===i,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[a]/2-o[a]/2;let m;switch(l){case"top":m={x:u,y:r.y-o.height};break;case"bottom":m={x:u,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:d};break;case"left":m={x:r.x-o.width,y:d};break;default:m={x:r.x,y:r.y}}switch(getAlignment(t)){case"start":m[s]-=f*(n&&c?-1:1);break;case"end":m[s]+=f*(n&&c?-1:1)}return m}async function detectOverflow(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:m=0}=evaluate(t,e),p=getPaddingObject(m),g=a[f?"floating"===d?"reference":"floating":d],h=rectToClientRect(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(g)))||n?g:g.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),y="floating"===d?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,v=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),b=await(null==i.isElement?void 0:i.isElement(v))&&await(null==i.getScale?void 0:i.getScale(v))||{x:1,y:1},w=rectToClientRect(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:v,strategy:l}):y);return{top:(h.top-w.top+p.top)/b.y,bottom:(w.bottom-h.bottom+p.bottom)/b.y,left:(h.left-w.left+p.left)/b.x,right:(w.right-h.right+p.right)/b.x}}function getSideOffsets(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function isAnySideFullyClipped(e){return l.some(t=>e[t]>=0)}function getBoundingRect(e){const t=d(...e.map(e=>e.left)),n=d(...e.map(e=>e.top));return{x:t,y:n,width:f(...e.map(e=>e.right))-t,height:f(...e.map(e=>e.bottom))-n}}const Q=new Set(["left","top"]);function getCssDimensions(e){const t=floating_ui_utils_dom_getComputedStyle(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=isHTMLElement(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=m(n)!==i||m(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function unwrapElement(e){return isElement(e)?e:e.contextElement}function getScale(e){const t=unwrapElement(e);if(!isHTMLElement(t))return createCoords(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=getCssDimensions(t);let s=(i?m(n.width):n.width)/r,a=(i?m(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const ee=createCoords(0);function getVisualOffsets(e){const t=getWindow(e);return isWebKit()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:ee}function getBoundingClientRect(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=unwrapElement(e);let s=createCoords(1);t&&(r?isElement(r)&&(s=getScale(r)):s=getScale(e));const a=function shouldAddVisualOffsets(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==getWindow(e))&&t}(i,n,r)?getVisualOffsets(i):createCoords(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const e=getWindow(i),t=r&&isElement(r)?getWindow(r):r;let n=e,o=getFrameElement(n);for(;o&&r&&t!==n;){const e=getScale(o),t=o.getBoundingClientRect(),r=floating_ui_utils_dom_getComputedStyle(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,s=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=i,c+=s,n=getWindow(o),o=getFrameElement(n)}}return rectToClientRect({width:u,height:d,x:l,y:c})}function getWindowScrollBarX(e,t){const n=getNodeScroll(e).scrollLeft;return t?t.left+n:getBoundingClientRect(getDocumentElement(e)).left+n}function getHTMLOffset(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-getWindowScrollBarX(e,n),y:n.top+t.scrollTop}}function getClientRectFromClippingAncestor(e,t,n){let r;if("viewport"===t)r=function getViewportRect(e,t){const n=getWindow(e),r=getDocumentElement(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const e=isWebKit();(!e||e&&"fixed"===t)&&(a=o.offsetLeft,l=o.offsetTop)}const c=getWindowScrollBarX(r);if(c<=0){const e=r.ownerDocument,t=e.body,n=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,s=Math.abs(r.clientWidth-t.clientWidth-o);s<=25&&(i-=s)}else c<=25&&(i+=c);return{width:i,height:s,x:a,y:l}}(e,n);else if("document"===t)r=function getDocumentRect(e){const t=getDocumentElement(e),n=getNodeScroll(e),r=e.ownerDocument.body,o=f(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=f(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+getWindowScrollBarX(e);const a=-n.scrollTop;return"rtl"===floating_ui_utils_dom_getComputedStyle(r).direction&&(s+=f(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}(getDocumentElement(e));else if(isElement(t))r=function getInnerBoundingClientRect(e,t){const n=getBoundingClientRect(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=isHTMLElement(e)?getScale(e):createCoords(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=getVisualOffsets(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return rectToClientRect(r)}function hasFixedPositionAncestor(e,t){const n=getParentNode(e);return!(n===t||!isElement(n)||isLastTraversableNode(n))&&("fixed"===floating_ui_utils_dom_getComputedStyle(n).position||hasFixedPositionAncestor(n,t))}function getRectRelativeToOffsetParent(e,t,n){const r=isHTMLElement(t),o=getDocumentElement(t),i="fixed"===n,s=getBoundingClientRect(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=createCoords(0);function setLeftRTLScrollbarOffset(){l.x=getWindowScrollBarX(o)}if(r||!r&&!i)if(("body"!==getNodeName(t)||isOverflowElement(o))&&(a=getNodeScroll(t)),r){const e=getBoundingClientRect(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&setLeftRTLScrollbarOffset();i&&!r&&o&&setLeftRTLScrollbarOffset();const c=!o||r||i?createCoords(0):getHTMLOffset(o,a);return{x:s.left+a.scrollLeft-l.x-c.x,y:s.top+a.scrollTop-l.y-c.y,width:s.width,height:s.height}}function isStaticPositioned(e){return"static"===floating_ui_utils_dom_getComputedStyle(e).position}function getTrueOffsetParent(e,t){if(!isHTMLElement(e)||"fixed"===floating_ui_utils_dom_getComputedStyle(e).position)return null;if(t)return t(e);let n=e.offsetParent;return getDocumentElement(e)===n&&(n=n.ownerDocument.body),n}function getOffsetParent(e,t){const n=getWindow(e);if(isTopLayer(e))return n;if(!isHTMLElement(e)){let t=getParentNode(e);for(;t&&!isLastTraversableNode(t);){if(isElement(t)&&!isStaticPositioned(t))return t;t=getParentNode(t)}return n}let r=getTrueOffsetParent(e,t);for(;r&&isTableElement(r)&&isStaticPositioned(r);)r=getTrueOffsetParent(r,t);return r&&isLastTraversableNode(r)&&isStaticPositioned(r)&&!isContainingBlock(r)?n:r||function getContainingBlock(e){let t=getParentNode(e);for(;isHTMLElement(t)&&!isLastTraversableNode(t);){if(isContainingBlock(t))return t;if(isTopLayer(t))return null;t=getParentNode(t)}return null}(e)||n}const te={convertOffsetParentRelativeRectToViewportRelativeRect:function convertOffsetParentRelativeRectToViewportRelativeRect(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,s=getDocumentElement(r),a=!!t&&isTopLayer(t.floating);if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=createCoords(1);const u=createCoords(0),d=isHTMLElement(r);if((d||!d&&!i)&&(("body"!==getNodeName(r)||isOverflowElement(s))&&(l=getNodeScroll(r)),d)){const e=getBoundingClientRect(r);c=getScale(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const f=!s||d||i?createCoords(0):getHTMLOffset(s,l);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-l.scrollTop*c.y+u.y+f.y}},getDocumentElement:getDocumentElement,getClippingRect:function getClippingRect(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?isTopLayer(t)?[]:function getClippingElementAncestors(e,t){const n=t.get(e);if(n)return n;let r=getOverflowAncestors(e,[],!1).filter(e=>isElement(e)&&"body"!==getNodeName(e)),o=null;const i="fixed"===floating_ui_utils_dom_getComputedStyle(e).position;let s=i?getParentNode(e):e;for(;isElement(s)&&!isLastTraversableNode(s);){const t=floating_ui_utils_dom_getComputedStyle(s),n=isContainingBlock(s);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&("absolute"===o.position||"fixed"===o.position)||isOverflowElement(s)&&!n&&hasFixedPositionAncestor(e,s))?r=r.filter(e=>e!==s):o=t,s=getParentNode(s)}return t.set(e,r),r}(t,this._c):[].concat(n),r],s=getClientRectFromClippingAncestor(t,i[0],o);let a=s.top,l=s.right,c=s.bottom,u=s.left;for(let e=1;e{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)});const m=c&&a?function observeMove(e,t){let n,r=null;const o=getDocumentElement(e);function cleanup(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function refresh(i,s){void 0===i&&(i=!1),void 0===s&&(s=1),cleanup();const a=e.getBoundingClientRect(),{left:l,top:c,width:u,height:m}=a;if(i||t(),!u||!m)return;const g={rootMargin:-p(c)+"px "+-p(o.clientWidth-(l+u))+"px "+-p(o.clientHeight-(c+m))+"px "+-p(l)+"px",threshold:f(0,d(1,s))||1};let h=!0;function handleObserve(t){const r=t[0].intersectionRatio;if(r!==s){if(!h)return refresh();r?refresh(!1,r):n=setTimeout(()=>{refresh(!1,1e-7)},1e3)}1!==r||rectsAreEqual(a,e.getBoundingClientRect())||refresh(),h=!1}try{r=new IntersectionObserver(handleObserve,{...g,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(handleObserve,g)}r.observe(e)}(!0),cleanup}(c,n):null;let g,h=-1,y=null;s&&(y=new ResizeObserver(e=>{let[r]=e;r&&r.target===c&&y&&t&&(y.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var e;null==(e=y)||e.observe(t)})),n()}),c&&!l&&y.observe(c),t&&y.observe(t));let v=l?getBoundingClientRect(e):null;return l&&function frameLoop(){const t=getBoundingClientRect(e);v&&!rectsAreEqual(v,t)&&n();v=t,g=requestAnimationFrame(frameLoop)}(),n(),()=>{var e;u.forEach(e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)}),null==m||m(),null==(e=y)||e.disconnect(),y=null,l&&cancelAnimationFrame(g)}}const ne=detectOverflow,floating_ui_dom_offset=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await async function convertValueToCoords(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),s=getSide(n),a=getAlignment(n),l="y"===getSideAxis(n),c=Q.has(s)?-1:1,u=i&&l?-1:1,d=evaluate(t,e);let{mainAxis:f,crossAxis:m,alignmentAxis:p}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&"number"==typeof p&&(m="end"===a?-1*p:p),l?{x:m*u,y:f*c}:{x:f*c,y:m*u}}(t,e);return s===(null==(n=a.offset)?void 0:n.placement)&&null!=(r=a.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},floating_ui_dom_autoPlacement=function(e){return void 0===e&&(e={}),{name:"autoPlacement",options:e,async fn(t){var n,r,o;const{rects:i,middlewareData:s,placement:a,platform:l,elements:c}=t,{crossAxis:d=!1,alignment:f,allowedPlacements:m=u,autoAlignment:p=!0,...g}=evaluate(e,t),h=void 0!==f||m===u?function getPlacementList(e,t,n){return(e?[...n.filter(t=>getAlignment(t)===e),...n.filter(t=>getAlignment(t)!==e)]:n.filter(e=>getSide(e)===e)).filter(n=>!e||getAlignment(n)===e||!!t&&getOppositeAlignmentPlacement(n)!==n)}(f||null,p,m):m,y=await l.detectOverflow(t,g),v=(null==(n=s.autoPlacement)?void 0:n.index)||0,b=h[v];if(null==b)return{};const w=getAlignmentSides(b,i,await(null==l.isRTL?void 0:l.isRTL(c.floating)));if(a!==b)return{reset:{placement:h[0]}};const E=[y[getSide(b)],y[w[0]],y[w[1]]],T=[...(null==(r=s.autoPlacement)?void 0:r.overflows)||[],{placement:b,overflows:E}],S=h[v+1];if(S)return{data:{index:v+1,overflows:T},reset:{placement:S}};const x=T.map(e=>{const t=getAlignment(e.placement);return[e.placement,t&&d?e.overflows.slice(0,2).reduce((e,t)=>e+t,0):e.overflows[0],e.overflows]}).sort((e,t)=>e[1]-t[1]),C=(null==(o=x.filter(e=>e[2].slice(0,getAlignment(e[0])?2:3).every(e=>e<=0))[0])?void 0:o[0])||x[0][0];return C!==a?{data:{index:v+1,overflows:T},reset:{placement:C}}:{}}}},floating_ui_dom_shift=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=evaluate(e,t),u={x:n,y:r},d=await i.detectOverflow(t,c),f=getSideAxis(getSide(o)),m=getOppositeAxis(f);let p=u[m],g=u[f];if(s){const e="y"===m?"bottom":"right";p=clamp(p+d["y"===m?"top":"left"],p,p-d[e])}if(a){const e="y"===f?"bottom":"right";g=clamp(g+d["y"===f?"top":"left"],g,g-d[e])}const h=l.fn({...t,[m]:p,[f]:g});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[m]:s,[f]:a}}}}}},floating_ui_dom_flip=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=!0,...h}=evaluate(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const y=getSide(o),v=getSideAxis(a),b=getSide(a)===a,w=await(null==l.isRTL?void 0:l.isRTL(c.floating)),E=f||(b||!g?[getOppositePlacement(a)]:function getExpandedPlacements(e){const t=getOppositePlacement(e);return[getOppositeAlignmentPlacement(e),t,getOppositeAlignmentPlacement(t)]}(a)),T="none"!==p;!f&&T&&E.push(...getOppositeAxisPlacements(a,g,p,w));const S=[a,...E],x=await l.detectOverflow(t,h),C=[];let R=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&C.push(x[y]),d){const e=getAlignmentSides(o,s,w);C.push(x[e[0]],x[e[1]])}if(R=[...R,{placement:o,overflows:C}],!C.every(e=>e<=0)){var _,A;const e=((null==(_=i.flip)?void 0:_.index)||0)+1,t=S[e];if(t){if(!("alignment"===d&&v!==getSideAxis(t))||R.every(e=>getSideAxis(e.placement)!==v||e.overflows[0]>0))return{data:{index:e,overflows:R},reset:{placement:t}}}let n=null==(A=R.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:A.placement;if(!n)switch(m){case"bestFit":{var k;const e=null==(k=R.filter(e=>{if(T){const t=getSideAxis(e.placement);return t===v||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:k[0];e&&(n=e);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},floating_ui_dom_size=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=evaluate(e,t),u=await s.detectOverflow(t,c),m=getSide(o),p=getAlignment(o),g="y"===getSideAxis(o),{width:h,height:y}=i.floating;let v,b;"top"===m||"bottom"===m?(v=m,b=p===(await(null==s.isRTL?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(b=m,v="end"===p?"top":"bottom");const w=y-u.top-u.bottom,E=h-u.left-u.right,T=d(y-u[v],w),S=d(h-u[b],E),x=!t.middlewareData.shift;let C=T,R=S;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(R=E),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(C=w),x&&!p){const e=f(u.left,0),t=f(u.right,0),n=f(u.top,0),r=f(u.bottom,0);g?R=h-2*(0!==e||0!==t?e+t:f(u.left,u.right)):C=y-2*(0!==n||0!==r?n+r:f(u.top,u.bottom))}await l({...t,availableWidth:R,availableHeight:C});const _=await s.getDimensions(a.floating);return h!==_.width||y!==_.height?{reset:{rects:!0}}:{}}}},floating_ui_dom_hide=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...i}=evaluate(e,t);switch(o){case"referenceHidden":{const e=getSideOffsets(await r.detectOverflow(t,{...i,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:isAnySideFullyClipped(e)}}}case"escaped":{const e=getSideOffsets(await r.detectOverflow(t,{...i,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:isAnySideFullyClipped(e)}}}default:return{}}}}},floating_ui_dom_arrow=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=evaluate(e,t)||{};if(null==c)return{};const f=getPaddingObject(u),m={x:n,y:r},p=getAlignmentAxis(o),g=getAxisLength(p),h=await s.getDimensions(c),y="y"===p,v=y?"top":"left",b=y?"bottom":"right",w=y?"clientHeight":"clientWidth",E=i.reference[g]+i.reference[p]-m[p]-i.floating[g],T=m[p]-i.reference[p],S=await(null==s.getOffsetParent?void 0:s.getOffsetParent(c));let x=S?S[w]:0;x&&await(null==s.isElement?void 0:s.isElement(S))||(x=a.floating[w]||i.floating[g]);const C=E/2-T/2,R=x/2-h[g]/2-1,_=d(f[v],R),A=d(f[b],R),k=_,O=x-h[g]-A,I=x/2-h[g]/2+C,P=clamp(k,I,O),L=!l.arrow&&null!=getAlignment(o)&&I!==P&&i.reference[g]/2-(Ie.y-t.y),n=[];let r=null;for(let e=0;er.height/2?n.push([o]):n[n.length-1].push(o),r=o}return n.map(e=>rectToClientRect(getBoundingRect(e)))}(u),p=rectToClientRect(getBoundingRect(u)),g=getPaddingObject(a);const h=await i.getElementRects({reference:{getBoundingClientRect:function getBoundingClientRect(){if(2===m.length&&m[0].left>m[1].right&&null!=l&&null!=c)return m.find(e=>l>e.left-g.left&&le.top-g.top&&c=2){if("y"===getSideAxis(n)){const e=m[0],t=m[m.length-1],r="top"===getSide(n),o=e.top,i=t.bottom,s=r?e.left:t.left,a=r?e.right:t.right;return{top:o,bottom:i,left:s,right:a,width:a-s,height:i-o,x:s,y:o}}const e="left"===getSide(n),t=f(...m.map(e=>e.right)),r=d(...m.map(e=>e.left)),o=m.filter(n=>e?n.left===r:n.right===t),i=o[0].top,s=o[o.length-1].bottom;return{top:i,bottom:s,left:r,right:t,width:t-r,height:s-i,x:r,y:i}}return p}},floating:r.floating,strategy:s});return o.reference.x!==h.reference.x||o.reference.y!==h.reference.y||o.reference.width!==h.reference.width||o.reference.height!==h.reference.height?{reset:{rects:h}}:{}}}},floating_ui_dom_limitShift=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=evaluate(e,t),u={x:n,y:r},d=getSideAxis(o),f=getOppositeAxis(d);let m=u[f],p=u[d];const g=evaluate(a,t),h="number"==typeof g?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const e="y"===f?"height":"width",t=i.reference[f]-i.floating[e]+h.mainAxis,n=i.reference[f]+i.reference[e]-h.mainAxis;mn&&(m=n)}if(c){var y,v;const e="y"===f?"width":"height",t=Q.has(getSide(o)),n=i.reference[d]-i.floating[e]+(t&&(null==(y=s.offset)?void 0:y[d])||0)+(t?0:h.crossAxis),r=i.reference[d]+i.reference[e]+(t?0:(null==(v=s.offset)?void 0:v[d])||0)-(t?h.crossAxis:0);pr&&(p=r)}return{[f]:m,[d]:p}}}},floating_ui_dom_computePosition=(e,t,n)=>{const r=new Map,o={platform:te,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=s.detectOverflow?s:{...s,detectOverflow:detectOverflow},l=await(null==s.isRTL?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=computeCoordsFromPlacement(c,r,l),f=r,m=0;const p={};for(let n=0;n{t.current=e}),t}const floating_ui_react_dom_offset=(e,t)=>{const n=floating_ui_dom_offset(e);return{name:n.name,fn:n.fn,options:[e,t]}},floating_ui_react_dom_shift=(e,t)=>{const n=floating_ui_dom_shift(e);return{name:n.name,fn:n.fn,options:[e,t]}},floating_ui_react_dom_limitShift=(e,t)=>({fn:floating_ui_dom_limitShift(e).fn,options:[e,t]}),floating_ui_react_dom_flip=(e,t)=>{const n=floating_ui_dom_flip(e);return{name:n.name,fn:n.fn,options:[e,t]}},floating_ui_react_dom_size=(e,t)=>{const n=floating_ui_dom_size(e);return{name:n.name,fn:n.fn,options:[e,t]}},floating_ui_react_dom_autoPlacement=(e,t)=>{const n=floating_ui_dom_autoPlacement(e);return{name:n.name,fn:n.fn,options:[e,t]}},floating_ui_react_dom_hide=(e,t)=>{const n=floating_ui_dom_hide(e);return{name:n.name,fn:n.fn,options:[e,t]}},floating_ui_react_dom_inline=(e,t)=>{const n=floating_ui_dom_inline(e);return{name:n.name,fn:n.fn,options:[e,t]}},floating_ui_react_dom_arrow=(e,t)=>{const n=(e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&function isRef(e){return{}.hasOwnProperty.call(e,"current")}(n)?null!=n.current?floating_ui_dom_arrow({element:n.current,padding:r}).fn(t):{}:n?floating_ui_dom_arrow({element:n,padding:r}).fn(t):{}}}))(e);return{name:n.name,fn:n.fn,options:[e,t]}};function useMergeRefs(e){const t=r.useRef(void 0),n=r.useCallback(t=>{const n=e.map(e=>{if(null!=e){if("function"==typeof e){const n=e,r=n(t);return"function"==typeof r?r:()=>{n(null)}}return e.current=t,()=>{e.current=null}}});return()=>{n.forEach(e=>null==e?void 0:e())}},e);return r.useMemo(()=>e.every(e=>null==e)?null:e=>{t.current&&(t.current(),t.current=void 0),null!=e&&(t.current=n(e))},e)}function sortByDocumentPosition(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const oe=r.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function FloatingList(e){const{children:t,elementsRef:n,labelsRef:o}=e,[i,s]=r.useState(()=>new Set),a=r.useCallback(e=>{s(t=>new Set(t).add(e))},[]),l=r.useCallback(e=>{s(t=>{const n=new Set(t);return n.delete(e),n})},[]),c=r.useMemo(()=>{const e=new Map;return Array.from(i.keys()).sort(sortByDocumentPosition).forEach((t,n)=>{e.set(t,n)}),e},[i]);return(0,J.jsx)(oe.Provider,{value:r.useMemo(()=>({register:a,unregister:l,map:c,elementsRef:n,labelsRef:o}),[a,l,c,n,o]),children:t})}function useListItem(e){void 0===e&&(e={});const{label:t}=e,{register:n,unregister:o,map:i,elementsRef:s,labelsRef:a}=r.useContext(oe),[l,c]=r.useState(null),u=r.useRef(null),d=r.useCallback(e=>{if(u.current=e,null!==l&&(s.current[l]=e,a)){var n;const r=void 0!==t;a.current[l]=r?t:null!=(n=null==e?void 0:e.textContent)?n:null}},[l,s,a,t]);return Y(()=>{const e=u.current;if(e)return n(e),()=>{o(e)}},[n,o]),Y(()=>{const e=u.current?i.get(u.current):null;null!=e&&c(e)},[i]),r.useMemo(()=>({ref:d,index:null==l?-1:l}),[l,d])}const ie="data-floating-ui-focusable",se="active",ae="selected",le="ArrowLeft",ce="ArrowRight",ue="ArrowUp",de="ArrowDown";function renderJsx(e,t){return"function"==typeof e?e(t):e?r.cloneElement(e,t):(0,J.jsx)("div",{...t})}const fe=r.createContext({activeIndex:0,onNavigate:()=>{}}),me=[le,ce],pe=[ue,de],ge=[...me,...pe],he=r.forwardRef(function Composite(e,t){const{render:n,orientation:o="both",loop:i=!0,rtl:s=!1,cols:a=1,disabledIndices:l,activeIndex:c,onNavigate:u,itemSizes:d,dense:f=!1,...m}=e,[p,g]=r.useState(0),h=null!=c?c:p,y=useEffectEvent(null!=u?u:g),v=r.useRef([]),b=n&&"function"!=typeof n?n.props:{},w=r.useMemo(()=>({activeIndex:h,onNavigate:y}),[h,y]),E=a>1;const T={...m,...b,ref:t,"aria-orientation":"both"===o?void 0:o,onKeyDown(e){null==m.onKeyDown||m.onKeyDown(e),null==b.onKeyDown||b.onKeyDown(e),function handleKeyDown(e){if(!ge.includes(e.key))return;let t=h;const n=getMinListIndex(v,l),r=getMaxListIndex(v,l),c=s?le:ce,u=s?ce:le;if(E){const u=d||Array.from({length:v.current.length},()=>({width:1,height:1})),m=createGridCellMap(u,a,f),p=m.findIndex(e=>null!=e&&!isListIndexDisabled(v,e,l)),g=m.reduce((e,t,n)=>null==t||isListIndexDisabled(v,t,l)?e:n,-1),y=m[getGridNavigatedIndex({current:m.map(e=>e?v.current[e]:null)},{event:e,orientation:o,loop:i,rtl:s,cols:a,disabledIndices:getGridCellIndices([...("function"!=typeof l?l:null)||v.current.map((e,t)=>isListIndexDisabled(v,t,l)?t:void 0),void 0],m),minIndex:p,maxIndex:g,prevIndex:getGridCellIndexOfCorner(h>r?n:h,u,m,a,e.key===de?"bl":e.key===c?"tr":"tl")})];null!=y&&(t=y)}const m={horizontal:[c],vertical:[de],both:[c,de]}[o],p={horizontal:[u],vertical:[ue],both:[u,ue]}[o],g=E?ge:{horizontal:me,vertical:pe,both:ge}[o];var b;t===h&&[...m,...p].includes(e.key)&&(t=i&&t===r&&m.includes(e.key)?n:i&&t===n&&p.includes(e.key)?r:findNonDisabledListIndex(v,{startingIndex:t,decrement:p.includes(e.key),disabledIndices:l})),t===h||isIndexOutOfListBounds(v,t)||(e.stopPropagation(),g.includes(e.key)&&e.preventDefault(),y(t),null==(b=v.current[t])||b.focus())}(e)}};return(0,J.jsx)(fe.Provider,{value:w,children:(0,J.jsx)(FloatingList,{elementsRef:v,children:renderJsx(n,T)})})}),ye=r.forwardRef(function CompositeItem(e,t){const{render:n,...o}=e,i=n&&"function"!=typeof n?n.props:{},{activeIndex:s,onNavigate:a}=r.useContext(fe),{ref:l,index:c}=useListItem(),u=useMergeRefs([l,t,i.ref]),d=s===c;return renderJsx(n,{...o,...i,ref:u,tabIndex:d?0:-1,"data-active":d?"":void 0,onFocus(e){null==o.onFocus||o.onFocus(e),null==i.onFocus||i.onFocus(e),a(c)}})}),ve={...r};let be=!1,we=0;const genId=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+we++;const Ee=ve.useId||function useFloatingId(){const[e,t]=r.useState(()=>be?genId():void 0);return Y(()=>{null==e&&t(genId())},[]),r.useEffect(()=>{be=!0},[]),e};const Te=r.forwardRef(function FloatingArrow(e,t){const{context:{placement:n,elements:{floating:o},middlewareData:{arrow:i,shift:s}},width:a=14,height:l=7,tipRadius:c=0,strokeWidth:u=0,staticOffset:d,stroke:f,d:m,style:{transform:p,...g}={},...h}=e;const y=Ee(),[v,b]=r.useState(!1);if(Y(()=>{if(!o)return;"rtl"===floating_ui_utils_dom_getComputedStyle(o).direction&&b(!0)},[o]),!o)return null;const[w,E]=n.split("-"),T="top"===w||"bottom"===w;let S=d;(T&&null!=s&&s.x||!T&&null!=s&&s.y)&&(S=null);const x=2*u,C=x/2,R=a/2*(c/-8+1),_=l/2*c/4,A=!!m,k=S&&"end"===E?"bottom":"top";let O=S&&"end"===E?"right":"left";S&&v&&(O="end"===E?"left":"right");const I=null!=(null==i?void 0:i.x)?S||i.x:"",P=null!=(null==i?void 0:i.y)?S||i.y:"",L=m||"M0,0 H"+a+" L"+(a-R)+","+(l-_)+" Q"+a/2+","+l+" "+R+","+(l-_)+" Z",M={top:A?"rotate(180deg)":"",left:A?"rotate(90deg)":"rotate(-90deg)",bottom:A?"":"rotate(180deg)",right:A?"rotate(-90deg)":"rotate(90deg)"}[w];return(0,J.jsxs)("svg",{...h,"aria-hidden":!0,ref:t,width:A?a:a+x,height:a,viewBox:"0 0 "+a+" "+(l>a?l:a),style:{position:"absolute",pointerEvents:"none",[O]:I,[k]:P,[w]:T||A?"100%":"calc(100% - "+x/2+"px)",transform:[M,p].filter(e=>!!e).join(" "),...g},children:[x>0&&(0,J.jsx)("path",{clipPath:"url(#"+y+")",fill:"none",stroke:f,strokeWidth:x+(m?0:1),d:L}),(0,J.jsx)("path",{stroke:x&&!m?h.fill:"none",d:L}),(0,J.jsx)("clipPath",{id:y,children:(0,J.jsx)("rect",{x:-C,y:C*(A?-1:1),width:a+x,height:a})})]})});function createEventEmitter(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;null==(r=e.get(t))||r.delete(n)}}}const Se=r.createContext(null),xe=r.createContext(null),useFloatingParentNodeId=()=>{var e;return(null==(e=r.useContext(Se))?void 0:e.id)||null},useFloatingTree=()=>r.useContext(xe);function useFloatingNodeId(e){const t=Ee(),n=useFloatingTree(),r=useFloatingParentNodeId(),o=e||r;return Y(()=>{if(!t)return;const e={id:t,parentId:o};return null==n||n.addNode(e),()=>{null==n||n.removeNode(e)}},[n,t,o]),t}function FloatingNode(e){const{children:t,id:n}=e,o=useFloatingParentNodeId();return(0,J.jsx)(Se.Provider,{value:r.useMemo(()=>({id:n,parentId:o}),[n,o]),children:t})}function FloatingTree(e){const{children:t}=e,n=r.useRef([]),o=r.useCallback(e=>{n.current=[...n.current,e]},[]),i=r.useCallback(e=>{n.current=n.current.filter(t=>t!==e)},[]),[s]=r.useState(()=>createEventEmitter());return(0,J.jsx)(xe.Provider,{value:r.useMemo(()=>({nodesRef:n,addNode:o,removeNode:i,events:s}),[o,i,s]),children:t})}function createAttribute(e){return"data-floating-ui-"+e}function clearTimeoutIfSet(e){-1!==e.current&&(clearTimeout(e.current),e.current=-1)}const Ce=createAttribute("safe-polygon");function getDelay(e,t,n){if(n&&!isMouseLikePointerType(n))return 0;if("number"==typeof e)return e;if("function"==typeof e){const n=e();return"number"==typeof n?n:null==n?void 0:n[t]}return null==e?void 0:e[t]}function getRestMs(e){return"function"==typeof e?e():e}function useHover(e,t){void 0===t&&(t={});const{open:n,onOpenChange:o,dataRef:i,events:s,elements:a}=e,{enabled:l=!0,delay:c=0,handleClose:u=null,mouseOnly:d=!1,restMs:f=0,move:m=!0}=t,p=useFloatingTree(),g=useFloatingParentNodeId(),h=useLatestRef(u),y=useLatestRef(c),v=useLatestRef(n),b=useLatestRef(f),w=r.useRef(),E=r.useRef(-1),T=r.useRef(),S=r.useRef(-1),x=r.useRef(!0),C=r.useRef(!1),R=r.useRef(()=>{}),_=r.useRef(!1),A=useEffectEvent(()=>{var e;const t=null==(e=i.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t});r.useEffect(()=>{if(l)return s.on("openchange",onOpenChange),()=>{s.off("openchange",onOpenChange)};function onOpenChange(e){let{open:t}=e;t||(clearTimeoutIfSet(E),clearTimeoutIfSet(S),x.current=!0,_.current=!1)}},[l,s]),r.useEffect(()=>{if(!l)return;if(!h.current)return;if(!n)return;function onLeave(e){A()&&o(!1,e,"hover")}const e=getDocument(a.floating).documentElement;return e.addEventListener("mouseleave",onLeave),()=>{e.removeEventListener("mouseleave",onLeave)}},[a.floating,n,o,l,h,A]);const k=r.useCallback(function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const r=getDelay(y.current,"close",w.current);r&&!T.current?(clearTimeoutIfSet(E),E.current=window.setTimeout(()=>o(!1,e,n),r)):t&&(clearTimeoutIfSet(E),o(!1,e,n))},[y,o]),O=useEffectEvent(()=>{R.current(),T.current=void 0}),I=useEffectEvent(()=>{if(C.current){const e=getDocument(a.floating).body;e.style.pointerEvents="",e.removeAttribute(Ce),C.current=!1}}),P=useEffectEvent(()=>!!i.current.openEvent&&["click","mousedown"].includes(i.current.openEvent.type));r.useEffect(()=>{if(l&&isElement(a.domReference)){const e=a.domReference,t=a.floating;return n&&e.addEventListener("mouseleave",onScrollMouseLeave),m&&e.addEventListener("mousemove",onReferenceMouseEnter,{once:!0}),e.addEventListener("mouseenter",onReferenceMouseEnter),e.addEventListener("mouseleave",onReferenceMouseLeave),t&&(t.addEventListener("mouseleave",onScrollMouseLeave),t.addEventListener("mouseenter",onFloatingMouseEnter),t.addEventListener("mouseleave",onFloatingMouseLeave)),()=>{n&&e.removeEventListener("mouseleave",onScrollMouseLeave),m&&e.removeEventListener("mousemove",onReferenceMouseEnter),e.removeEventListener("mouseenter",onReferenceMouseEnter),e.removeEventListener("mouseleave",onReferenceMouseLeave),t&&(t.removeEventListener("mouseleave",onScrollMouseLeave),t.removeEventListener("mouseenter",onFloatingMouseEnter),t.removeEventListener("mouseleave",onFloatingMouseLeave))}}function onReferenceMouseEnter(e){if(clearTimeoutIfSet(E),x.current=!1,d&&!isMouseLikePointerType(w.current)||getRestMs(b.current)>0&&!getDelay(y.current,"open"))return;const t=getDelay(y.current,"open",w.current);t?E.current=window.setTimeout(()=>{v.current||o(!0,e,"hover")},t):n||o(!0,e,"hover")}function onReferenceMouseLeave(e){if(P())return void I();R.current();const t=getDocument(a.floating);if(clearTimeoutIfSet(S),_.current=!1,h.current&&i.current.floatingContext){n||clearTimeoutIfSet(E),T.current=h.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){I(),O(),P()||k(e,!0,"safe-polygon")}});const r=T.current;return t.addEventListener("mousemove",r),void(R.current=()=>{t.removeEventListener("mousemove",r)})}("touch"!==w.current||!contains(a.floating,e.relatedTarget))&&k(e)}function onScrollMouseLeave(e){P()||i.current.floatingContext&&(null==h.current||h.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){I(),O(),P()||k(e)}})(e))}function onFloatingMouseEnter(){clearTimeoutIfSet(E)}function onFloatingMouseLeave(e){P()||k(e,!1)}},[a,l,e,d,m,k,O,I,o,n,v,p,y,h,i,P,b]),Y(()=>{var e;if(l&&n&&null!=(e=h.current)&&null!=(e=e.__options)&&e.blockPointerEvents&&A()){C.current=!0;const e=a.floating;if(isElement(a.domReference)&&e){var t;const n=getDocument(a.floating).body;n.setAttribute(Ce,"");const r=a.domReference,o=null==p||null==(t=p.nodesRef.current.find(e=>e.id===g))||null==(t=t.context)?void 0:t.elements.floating;return o&&(o.style.pointerEvents=""),n.style.pointerEvents="none",r.style.pointerEvents="auto",e.style.pointerEvents="auto",()=>{n.style.pointerEvents="",r.style.pointerEvents="",e.style.pointerEvents=""}}}},[l,n,g,a,p,h,A]),Y(()=>{n||(w.current=void 0,_.current=!1,O(),I())},[n,O,I]),r.useEffect(()=>()=>{O(),clearTimeoutIfSet(E),clearTimeoutIfSet(S),I()},[l,a.domReference,O,I]);const L=r.useMemo(()=>{function setPointerRef(e){w.current=e.pointerType}return{onPointerDown:setPointerRef,onPointerEnter:setPointerRef,onMouseMove(e){const{nativeEvent:t}=e;function handleMouseMove(){x.current||v.current||o(!0,t,"hover")}d&&!isMouseLikePointerType(w.current)||n||0===getRestMs(b.current)||_.current&&e.movementX**2+e.movementY**2<2||(clearTimeoutIfSet(S),"touch"===w.current?handleMouseMove():(_.current=!0,S.current=window.setTimeout(handleMouseMove,getRestMs(b.current))))}}},[d,o,n,v,b]);return r.useMemo(()=>l?{reference:L}:{},[l,L])}const NOOP=()=>{},Re=r.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:NOOP,setState:NOOP,isInstantPhase:!1}),useDelayGroupContext=()=>r.useContext(Re);function FloatingDelayGroup(e){const{children:t,delay:n,timeoutMs:o=0}=e,[i,s]=r.useReducer((e,t)=>({...e,...t}),{delay:n,timeoutMs:o,initialDelay:n,currentId:null,isInstantPhase:!1}),a=r.useRef(null),l=r.useCallback(e=>{s({currentId:e})},[]);return Y(()=>{i.currentId?null===a.current?a.current=i.currentId:i.isInstantPhase||s({isInstantPhase:!0}):(i.isInstantPhase&&s({isInstantPhase:!1}),a.current=null)},[i.currentId,i.isInstantPhase]),(0,J.jsx)(Re.Provider,{value:r.useMemo(()=>({...i,setState:s,setCurrentId:l}),[i,l]),children:t})}function useDelayGroup(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,floatingId:o}=e,{id:i,enabled:s=!0}=t,a=null!=i?i:o,l=useDelayGroupContext(),{currentId:c,setCurrentId:u,initialDelay:d,setState:f,timeoutMs:m}=l;return Y(()=>{s&&c&&(f({delay:{open:1,close:getDelay(d,"close")}}),c!==a&&r(!1))},[s,a,r,f,c,d]),Y(()=>{function unset(){r(!1),f({delay:d,currentId:null})}if(s&&c&&!n&&c===a){if(m){const e=window.setTimeout(unset,m);return()=>{clearTimeout(e)}}unset()}},[s,n,f,c,a,r,d,m]),Y(()=>{s&&u!==NOOP&&n&&u(a)},[s,n,u,a]),l}const _e=r.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeoutIdRef:{current:-1},currentIdRef:{current:null},currentContextRef:{current:null}});function NextFloatingDelayGroup(e){const{children:t,delay:n,timeoutMs:o=0}=e,i=r.useRef(n),s=r.useRef(n),a=r.useRef(null),l=r.useRef(null),c=r.useRef(-1);return(0,J.jsx)(_e.Provider,{value:r.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:s,currentIdRef:a,timeoutMs:o,currentContextRef:l,timeoutIdRef:c}),[o]),children:t})}function useNextDelayGroup(e,t){void 0===t&&(t={});const{open:n,onOpenChange:o,floatingId:i}=e,{enabled:s=!0}=t,a=r.useContext(_e),{currentIdRef:l,delayRef:c,timeoutMs:u,initialDelayRef:d,currentContextRef:f,hasProvider:m,timeoutIdRef:p}=a,[g,h]=r.useState(!1);return Y(()=>{function unset(){var e;h(!1),null==(e=f.current)||e.setIsInstantPhase(!1),l.current=null,f.current=null,c.current=d.current}if(s&&l.current&&!n&&l.current===i){if(h(!1),u)return p.current=window.setTimeout(unset,u),()=>{clearTimeout(p.current)};unset()}},[s,n,i,l,c,u,d,f,p]),Y(()=>{if(!s)return;if(!n)return;const e=f.current,t=l.current;f.current={onOpenChange:o,setIsInstantPhase:h},l.current=i,c.current={open:0,close:getDelay(d.current,"close")},null!==t&&t!==i?(clearTimeoutIfSet(p),h(!0),null==e||e.setIsInstantPhase(!0),null==e||e.onOpenChange(!1)):(h(!1),null==e||e.setIsInstantPhase(!1))},[s,n,i,o,l,c,u,d,f,p]),Y(()=>()=>{f.current=null},[f]),r.useMemo(()=>({hasProvider:m,delayRef:c,isInstantPhase:g}),[m,c,g])}let Ae=0;function enqueueFocus(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Ae);const exec=()=>null==e?void 0:e.focus({preventScroll:n});o?exec():Ae=requestAnimationFrame(exec)}function floating_ui_react_esm_contains(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&isShadowRoot(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}const ke={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function getCounterMap(e){return"inert"===e?ke.inert:"aria-hidden"===e?ke["aria-hidden"]:ke.none}let Oe=new WeakSet,Ie={},Pe=0;const supportsInert=()=>"undefined"!=typeof HTMLElement&&"inert"in HTMLElement.prototype;function unwrapHost(e){return e?isShadowRoot(e)?e.host:unwrapHost(e.parentNode):null}const correctElements=(e,t)=>t.map(t=>{if(e.contains(t))return t;const n=unwrapHost(t);return e.contains(n)?n:null}).filter(e=>null!=e);function markOthers(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=function floating_ui_react_esm_getDocument(e){return(null==e?void 0:e.ownerDocument)||document}(e[0]).body;return function applyAttributeToOthers(e,t,n,r){const o="data-floating-ui-inert",i=r?"inert":n?"aria-hidden":null,s=correctElements(t,e),a=new Set,l=new Set(s),c=[];Ie[o]||(Ie[o]=new WeakMap);const u=Ie[o];return s.forEach(function keep(e){e&&!a.has(e)&&(a.add(e),e.parentNode&&keep(e.parentNode))}),function deep(e){e&&!l.has(e)&&[].forEach.call(e.children,e=>{if("script"!==getNodeName(e))if(a.has(e))deep(e);else{const t=i?e.getAttribute(i):null,n=null!==t&&"false"!==t,r=getCounterMap(i),s=(r.get(e)||0)+1,a=(u.get(e)||0)+1;r.set(e,s),u.set(e,a),c.push(e),1===s&&n&&Oe.add(e),1===a&&e.setAttribute(o,""),!n&&i&&e.setAttribute(i,"inert"===i?"":"true")}})}(t),a.clear(),Pe++,()=>{c.forEach(e=>{const t=getCounterMap(i),n=(t.get(e)||0)-1,r=(u.get(e)||0)-1;t.set(e,n),u.set(e,r),n||(!Oe.has(e)&&i&&e.removeAttribute(i),Oe.delete(e)),r||e.removeAttribute(o)}),Pe--,Pe||(ke.inert=new WeakMap,ke["aria-hidden"]=new WeakMap,ke.none=new WeakMap,Oe=new WeakSet,Ie={})}}(e.concat(Array.from(r.querySelectorAll('[aria-live],[role="status"],output'))),r,t,n)}const Le={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},Me=r.forwardRef(function FocusGuard(e,t){const[n,o]=r.useState();Y(()=>{isSafari()&&o("button")},[]);const i={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[createAttribute("focus-guard")]:"",style:Le};return(0,J.jsx)("span",{...e,...i})}),Ne={clipPath:"inset(50%)",position:"fixed",top:0,left:0},De=r.createContext(null),Fe=createAttribute("portal");function useFloatingPortalNode(e){void 0===e&&(e={});const{id:t,root:n}=e,o=Ee(),i=usePortalContext(),[s,a]=r.useState(null),l=r.useRef(null);return Y(()=>()=>{null==s||s.remove(),queueMicrotask(()=>{l.current=null})},[s]),Y(()=>{if(!o)return;if(l.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=o,n.setAttribute(Fe,""),e.appendChild(n),l.current=n,a(n)},[t,o]),Y(()=>{if(null===n)return;if(!o)return;if(l.current)return;let e=n||(null==i?void 0:i.portalNode);e&&!isNode(e)&&(e=e.current),e=e||document.body;let r=null;t&&(r=document.createElement("div"),r.id=t,e.appendChild(r));const s=document.createElement("div");s.id=o,s.setAttribute(Fe,""),e=r||e,e.appendChild(s),l.current=s,a(s)},[t,n,o,i]),s}function FloatingPortal(e){const{children:t,id:n,root:o,preserveTabOrder:i=!0}=e,s=useFloatingPortalNode({id:n,root:o}),[a,l]=r.useState(null),c=r.useRef(null),u=r.useRef(null),d=r.useRef(null),f=r.useRef(null),m=null==a?void 0:a.modal,p=null==a?void 0:a.open,g=!!a&&!a.modal&&a.open&&i&&!(!o&&!s);return r.useEffect(()=>{if(s&&i&&!m)return s.addEventListener("focusin",onFocus,!0),s.addEventListener("focusout",onFocus,!0),()=>{s.removeEventListener("focusin",onFocus,!0),s.removeEventListener("focusout",onFocus,!0)};function onFocus(e){if(s&&isOutsideEvent(e)){("focusin"===e.type?enableFocusInside:disableFocusInside)(s)}}},[s,i,m]),r.useEffect(()=>{s&&(p||enableFocusInside(s))},[p,s]),(0,J.jsxs)(De.Provider,{value:r.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:c,afterOutsideRef:u,beforeInsideRef:d,afterInsideRef:f,portalNode:s,setFocusManagerState:l}),[i,s]),children:[g&&s&&(0,J.jsx)(Me,{"data-type":"outside",ref:c,onFocus:e=>{if(isOutsideEvent(e,s)){var t;null==(t=d.current)||t.focus()}else{const e=getPreviousTabbable(a?a.domReference:null);null==e||e.focus()}}}),g&&s&&(0,J.jsx)("span",{"aria-owns":s.id,style:Ne}),s&&Z.createPortal(t,s),g&&s&&(0,J.jsx)(Me,{"data-type":"outside",ref:u,onFocus:e=>{if(isOutsideEvent(e,s)){var t;null==(t=f.current)||t.focus()}else{const t=getNextTabbable(a?a.domReference:null);null==t||t.focus(),(null==a?void 0:a.closeOnFocusOut)&&(null==a||a.onOpenChange(!1,e.nativeEvent,"focus-out"))}}})]})}const usePortalContext=()=>r.useContext(De);function useLiteMergeRefs(e){return r.useMemo(()=>t=>{e.forEach(e=>{e&&(e.current=t)})},e)}const $e=20;let Ve=[];function clearDisconnectedPreviouslyFocusedElements(){Ve=Ve.filter(e=>{var t;return null==(t=e.deref())?void 0:t.isConnected})}function getPreviouslyFocusedElement(){clearDisconnectedPreviouslyFocusedElements();const e=Ve[Ve.length-1];return null==e?void 0:e.deref()}function handleTabIndex(e,t){var n;if(!(t.current.includes("floating")||null!=(n=e.getAttribute("role"))&&n.includes("dialog")))return;const r=getTabbableOptions(),o=j(e,r).filter(e=>{const t=e.getAttribute("data-tabindex")||"";return W(e,r)||e.hasAttribute("data-tabindex")&&!t.startsWith("-")}),i=e.getAttribute("tabindex");t.current.includes("floating")||0===o.length?"0"!==i&&e.setAttribute("tabindex","0"):("-1"!==i||e.hasAttribute("data-tabindex")&&"-1"!==e.getAttribute("data-tabindex"))&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}const je=r.forwardRef(function VisuallyHiddenDismiss(e,t){return(0,J.jsx)("button",{...e,type:"button",ref:t,tabIndex:-1,style:Le})});function FloatingFocusManager(e){const{context:t,children:n,disabled:o=!1,order:i=["content"],guards:s=!0,initialFocus:a=0,returnFocus:l=!0,restoreFocus:c=!1,modal:u=!0,visuallyHiddenDismiss:d=!1,closeOnFocusOut:f=!0,outsideElementsInert:m=!1,getInsideElements:p=()=>[]}=e,{open:g,onOpenChange:h,events:y,dataRef:v,elements:{domReference:b,floating:w}}=t,E=useEffectEvent(()=>{var e;return null==(e=v.current.floatingContext)?void 0:e.nodeId}),T=useEffectEvent(p),S="number"==typeof a&&a<0,x=isTypeableCombobox(b)&&S,C=supportsInert(),R=!C||s,_=!R||C&&m,A=useLatestRef(i),k=useLatestRef(a),O=useLatestRef(l),I=useFloatingTree(),P=usePortalContext(),L=r.useRef(null),M=r.useRef(null),N=r.useRef(!1),D=r.useRef(!1),F=r.useRef(-1),$=r.useRef(-1),j=null!=P,B=getFloatingFocusElement(w),z=useEffectEvent(function(e){return void 0===e&&(e=B),e?V(e,getTabbableOptions()):[]}),U=useEffectEvent(e=>{const t=z(e);return A.current.map(e=>b&&"reference"===e?b:B&&"floating"===e?B:t).filter(Boolean).flat()});r.useEffect(()=>{if(o)return;if(!u)return;function onKeyDown(e){if("Tab"===e.key){contains(B,activeElement(getDocument(B)))&&0===z().length&&!x&&stopEvent(e);const t=U(),n=getTarget(e);"reference"===A.current[0]&&n===b&&(stopEvent(e),e.shiftKey?enqueueFocus(t[t.length-1]):enqueueFocus(t[1])),"floating"===A.current[1]&&n===B&&e.shiftKey&&(stopEvent(e),enqueueFocus(t[0]))}}const e=getDocument(B);return e.addEventListener("keydown",onKeyDown),()=>{e.removeEventListener("keydown",onKeyDown)}},[o,b,B,u,A,x,z,U]),r.useEffect(()=>{if(!o&&w)return w.addEventListener("focusin",handleFocusIn),()=>{w.removeEventListener("focusin",handleFocusIn)};function handleFocusIn(e){const t=getTarget(e),n=z().indexOf(t);-1!==n&&(F.current=n)}},[o,w,z]),r.useEffect(()=>{if(o)return;if(!f)return;function handlePointerDown(){D.current=!0,setTimeout(()=>{D.current=!1})}function handleFocusOutside(e){const t=e.relatedTarget,n=e.currentTarget,r=getTarget(e);queueMicrotask(()=>{const o=E(),i=!(contains(b,t)||contains(w,t)||contains(t,w)||contains(null==P?void 0:P.portalNode,t)||null!=t&&t.hasAttribute(createAttribute("focus-guard"))||I&&(getNodeChildren(I.nodesRef.current,o).find(e=>{var n,r;return contains(null==(n=e.context)?void 0:n.elements.floating,t)||contains(null==(r=e.context)?void 0:r.elements.domReference,t)})||getNodeAncestors(I.nodesRef.current,o).find(e=>{var n,r,o;return[null==(n=e.context)?void 0:n.elements.floating,getFloatingFocusElement(null==(r=e.context)?void 0:r.elements.floating)].includes(t)||(null==(o=e.context)?void 0:o.elements.domReference)===t})));if(n===b&&B&&handleTabIndex(B,A),c&&n!==b&&(null==r||!r.isConnected)&&activeElement(getDocument(B))===getDocument(B).body){isHTMLElement(B)&&B.focus();const e=F.current,t=z(),n=t[e]||t[t.length-1]||B;isHTMLElement(n)&&n.focus()}v.current.insideReactTree?v.current.insideReactTree=!1:!x&&u||!t||!i||D.current||t===getPreviouslyFocusedElement()||(N.current=!0,h(!1,e,"focus-out"))})}const e=Boolean(!I&&P);function markInsideReactTree(){clearTimeoutIfSet($),v.current.insideReactTree=!0,$.current=window.setTimeout(()=>{v.current.insideReactTree=!1})}return w&&isHTMLElement(b)?(b.addEventListener("focusout",handleFocusOutside),b.addEventListener("pointerdown",handlePointerDown),w.addEventListener("focusout",handleFocusOutside),e&&w.addEventListener("focusout",markInsideReactTree,!0),()=>{b.removeEventListener("focusout",handleFocusOutside),b.removeEventListener("pointerdown",handlePointerDown),w.removeEventListener("focusout",handleFocusOutside),e&&w.removeEventListener("focusout",markInsideReactTree,!0)}):void 0},[o,b,w,B,u,I,P,h,f,c,z,x,E,A,v]);const H=r.useRef(null),G=r.useRef(null),K=useLiteMergeRefs([H,null==P?void 0:P.beforeInsideRef]),X=useLiteMergeRefs([G,null==P?void 0:P.afterInsideRef]);function renderDismissButton(e){return!o&&d&&u?(0,J.jsx)(je,{ref:"start"===e?L:M,onClick:e=>h(!1,e.nativeEvent),children:"string"==typeof d?d:"Dismiss"}):null}r.useEffect(()=>{var e,t;if(o)return;if(!w)return;const n=Array.from((null==P||null==(e=P.portalNode)?void 0:e.querySelectorAll("["+createAttribute("portal")+"]"))||[]),r=null==(t=(I?getNodeAncestors(I.nodesRef.current,E()):[]).find(e=>{var t;return isTypeableCombobox((null==(t=e.context)?void 0:t.elements.domReference)||null)}))||null==(t=t.context)?void 0:t.elements.domReference,i=[w,r,...n,...T(),L.current,M.current,H.current,G.current,null==P?void 0:P.beforeOutsideRef.current,null==P?void 0:P.afterOutsideRef.current,A.current.includes("reference")||x?b:null].filter(e=>null!=e),s=u||x?markOthers(i,!_,_):markOthers(i);return()=>{s()}},[o,b,w,u,A,P,x,R,_,I,E,T]),Y(()=>{if(o||!isHTMLElement(B))return;const e=activeElement(getDocument(B));queueMicrotask(()=>{const t=U(B),n=k.current,r=("number"==typeof n?t[n]:n.current)||B,o=contains(B,e);S||o||!g||enqueueFocus(r,{preventScroll:r===B})})},[o,g,B,S,U,k]),Y(()=>{if(o||!B)return;const e=getDocument(B);function onOpenChange(e){let{reason:t,event:n,nested:r}=e;if(["hover","safe-polygon"].includes(t)&&"mouseleave"===n.type&&(N.current=!0),"outside-press"===t)if(r)N.current=!1;else if(isVirtualClick(n)||isVirtualPointerEvent(n))N.current=!1;else{let e=!1;document.createElement("div").focus({get preventScroll(){return e=!0,!1}}),N.current=!e}}!function addPreviouslyFocusedElement(e){clearDisconnectedPreviouslyFocusedElements(),e&&"body"!==getNodeName(e)&&(Ve.push(new WeakRef(e)),Ve.length>$e&&(Ve=Ve.slice(-$e)))}(activeElement(e)),y.on("openchange",onOpenChange);const t=e.createElement("span");return t.setAttribute("tabindex","-1"),t.setAttribute("aria-hidden","true"),Object.assign(t.style,Le),j&&b&&b.insertAdjacentElement("afterend",t),()=>{y.off("openchange",onOpenChange);const n=activeElement(e),r=contains(w,n)||I&&getNodeChildren(I.nodesRef.current,E(),!1).some(e=>{var t;return contains(null==(t=e.context)?void 0:t.elements.floating,n)}),o=function getReturnElement(){if("boolean"==typeof O.current){const e=b||getPreviouslyFocusedElement();return e&&e.isConnected?e:t}return O.current.current||t}();queueMicrotask(()=>{const i=function getFirstTabbableElement(e){const t=getTabbableOptions();return W(e,t)?e:V(e,t)[0]||e}(o);O.current&&!N.current&&isHTMLElement(i)&&(i===n||n===e.body||r)&&i.focus({preventScroll:!0}),t.remove()})}},[o,w,B,O,v,y,I,j,b,E]),r.useEffect(()=>(queueMicrotask(()=>{N.current=!1}),()=>{queueMicrotask(clearDisconnectedPreviouslyFocusedElements)}),[o]),Y(()=>{if(!o&&P)return P.setFocusManagerState({modal:u,closeOnFocusOut:f,open:g,onOpenChange:h,domReference:b}),()=>{P.setFocusManagerState(null)}},[o,P,u,g,h,f,b]),Y(()=>{o||B&&handleTabIndex(B,A)},[o,B,A]);const Z=!o&&R&&(!u||!x)&&(j||u);return(0,J.jsxs)(J.Fragment,{children:[Z&&(0,J.jsx)(Me,{"data-type":"inside",ref:K,onFocus:e=>{if(u){const e=U();enqueueFocus("reference"===i[0]?e[0]:e[e.length-1])}else if(null!=P&&P.preserveTabOrder&&P.portalNode)if(N.current=!1,isOutsideEvent(e,P.portalNode)){const e=getNextTabbable(b);null==e||e.focus()}else{var t;null==(t=P.beforeOutsideRef.current)||t.focus()}}}),!x&&renderDismissButton("start"),n,renderDismissButton("end"),Z&&(0,J.jsx)(Me,{"data-type":"inside",ref:X,onFocus:e=>{if(u)enqueueFocus(U()[0]);else if(null!=P&&P.preserveTabOrder&&P.portalNode)if(f&&(N.current=!0),isOutsideEvent(e,P.portalNode)){const e=getPreviousTabbable(b);null==e||e.focus()}else{var t;null==(t=P.afterOutsideRef.current)||t.focus()}}})]})}let We=0;const Be="--floating-ui-scrollbar-width";let cleanup=()=>{};const ze=r.forwardRef(function FloatingOverlay(e,t){const{lockScroll:n=!1,...r}=e;return Y(()=>{if(n)return We++,1===We&&(cleanup=function enableScrollLock(){const e=getPlatform(),t=/iP(hone|ad|od)|iOS/.test(e)||"MacIntel"===e&&navigator.maxTouchPoints>1,n=document.body.style,r=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",o=window.innerWidth-document.documentElement.clientWidth,i=n.left?parseFloat(n.left):window.scrollX,s=n.top?parseFloat(n.top):window.scrollY;if(n.overflow="hidden",n.setProperty(Be,o+"px"),o&&(n[r]=o+"px"),t){var a,l;const e=(null==(a=window.visualViewport)?void 0:a.offsetLeft)||0,t=(null==(l=window.visualViewport)?void 0:l.offsetTop)||0;Object.assign(n,{position:"fixed",top:-(s-Math.floor(t))+"px",left:-(i-Math.floor(e))+"px",right:"0"})}return()=>{Object.assign(n,{overflow:"",[r]:""}),n.removeProperty(Be),t&&(Object.assign(n,{position:"",top:"",left:"",right:""}),window.scrollTo(i,s))}}()),()=>{We--,0===We&&cleanup()}},[n]),(0,J.jsx)("div",{ref:t,...r,style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}})});function isButtonTarget(e){return isHTMLElement(e.target)&&"BUTTON"===e.target.tagName}function isSpaceIgnored(e){return isTypeableElement(e)}function useClick(e,t){void 0===t&&(t={});const{open:n,onOpenChange:o,dataRef:i,elements:{domReference:s}}=e,{enabled:a=!0,event:l="click",toggle:c=!0,ignoreMouse:u=!1,keyboardHandlers:d=!0,stickIfOpen:f=!0}=t,m=r.useRef(),p=r.useRef(!1),g=r.useMemo(()=>({onPointerDown(e){m.current=e.pointerType},onMouseDown(e){const t=m.current;0===e.button&&"click"!==l&&(isMouseLikePointerType(t,!0)&&u||(!n||!c||i.current.openEvent&&f&&"mousedown"!==i.current.openEvent.type?(e.preventDefault(),o(!0,e.nativeEvent,"click")):o(!1,e.nativeEvent,"click")))},onClick(e){const t=m.current;"mousedown"===l&&m.current?m.current=void 0:isMouseLikePointerType(t,!0)&&u||(!n||!c||i.current.openEvent&&f&&"click"!==i.current.openEvent.type?o(!0,e.nativeEvent,"click"):o(!1,e.nativeEvent,"click"))},onKeyDown(e){m.current=void 0,e.defaultPrevented||!d||isButtonTarget(e)||(" "!==e.key||isSpaceIgnored(s)||(e.preventDefault(),p.current=!0),function isAnchorTarget(e){return isHTMLElement(e.target)&&"A"===e.target.tagName}(e)||"Enter"===e.key&&o(!n||!c,e.nativeEvent,"click"))},onKeyUp(e){e.defaultPrevented||!d||isButtonTarget(e)||isSpaceIgnored(s)||" "===e.key&&p.current&&(p.current=!1,o(!n||!c,e.nativeEvent,"click"))}}),[i,s,l,u,d,o,n,f,c]);return r.useMemo(()=>a?{reference:g}:{},[a,g])}function isMouseBasedEvent(e){return null!=e&&null!=e.clientX}function useClientPoint(e,t){void 0===t&&(t={});const{open:n,dataRef:o,elements:{floating:i,domReference:s},refs:a}=e,{enabled:l=!0,axis:c="both",x:u=null,y:d=null}=t,f=r.useRef(!1),m=r.useRef(null),[p,g]=r.useState(),[h,y]=r.useState([]),v=useEffectEvent((e,t)=>{f.current||o.current.openEvent&&!isMouseBasedEvent(o.current.openEvent)||a.setPositionReference(function createVirtualElement(e,t){let n=null,r=null,o=!1;return{contextElement:e||void 0,getBoundingClientRect(){var i;const s=(null==e?void 0:e.getBoundingClientRect())||{width:0,height:0,x:0,y:0},a="x"===t.axis||"both"===t.axis,l="y"===t.axis||"both"===t.axis,c=["mouseenter","mousemove"].includes((null==(i=t.dataRef.current.openEvent)?void 0:i.type)||"")&&"touch"!==t.pointerType;let u=s.width,d=s.height,f=s.x,m=s.y;return null==n&&t.x&&a&&(n=s.x-t.x),null==r&&t.y&&l&&(r=s.y-t.y),f-=n||0,m-=r||0,u=0,d=0,!o||c?(u="y"===t.axis?s.width:0,d="x"===t.axis?s.height:0,f=a&&null!=t.x?t.x:f,m=l&&null!=t.y?t.y:m):o&&!c&&(d="x"===t.axis?s.height:d,u="y"===t.axis?s.width:u),o=!0,{width:u,height:d,x:f,y:m,top:m,right:f+u,bottom:m+d,left:f}}}}(s,{x:e,y:t,axis:c,dataRef:o,pointerType:p}))}),b=useEffectEvent(e=>{null==u&&null==d&&(n?m.current||y([]):v(e.clientX,e.clientY))}),w=isMouseLikePointerType(p)?i:n,E=r.useCallback(()=>{if(!w||!l||null!=u||null!=d)return;const e=getWindow(i);function handleMouseMove(t){const n=getTarget(t);contains(i,n)?(e.removeEventListener("mousemove",handleMouseMove),m.current=null):v(t.clientX,t.clientY)}if(!o.current.openEvent||isMouseBasedEvent(o.current.openEvent)){e.addEventListener("mousemove",handleMouseMove);const cleanup=()=>{e.removeEventListener("mousemove",handleMouseMove),m.current=null};return m.current=cleanup,cleanup}a.setPositionReference(s)},[w,l,u,d,i,o,a,s,v]);r.useEffect(()=>E(),[E,h]),r.useEffect(()=>{l&&!i&&(f.current=!1)},[l,i]),r.useEffect(()=>{!l&&n&&(f.current=!0)},[l,n]),Y(()=>{!l||null==u&&null==d||(f.current=!1,v(u,d))},[l,u,d,v]);const T=r.useMemo(()=>{function setPointerTypeRef(e){let{pointerType:t}=e;g(t)}return{onPointerDown:setPointerTypeRef,onPointerEnter:setPointerTypeRef,onMouseMove:b,onMouseEnter:b}},[b]);return r.useMemo(()=>l?{reference:T}:{},[l,T])}const Ue={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},He={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},normalizeProp=e=>{var t,n;return{escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};function useDismiss(e,t){void 0===t&&(t={});const{open:n,onOpenChange:o,elements:i,dataRef:s}=e,{enabled:a=!0,escapeKey:l=!0,outsidePress:c=!0,outsidePressEvent:u="pointerdown",referencePress:d=!1,referencePressEvent:f="pointerdown",ancestorScroll:m=!1,bubbles:p,capture:g}=t,h=useFloatingTree(),y=useEffectEvent("function"==typeof c?c:()=>!1),v="function"==typeof c?y:c,b=r.useRef(!1),{escapeKey:w,outsidePress:E}=normalizeProp(p),{escapeKey:T,outsidePress:S}=normalizeProp(g),x=r.useRef(!1),C=useEffectEvent(e=>{var t;if(!n||!a||!l||"Escape"!==e.key)return;if(x.current)return;const r=null==(t=s.current.floatingContext)?void 0:t.nodeId,i=h?getNodeChildren(h.nodesRef.current,r):[];if(!w&&(e.stopPropagation(),i.length>0)){let e=!0;if(i.forEach(t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)}),!e)return}o(!1,function isReactEvent(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")}),R=useEffectEvent(e=>{var t;const callback=()=>{var t;C(e),null==(t=getTarget(e))||t.removeEventListener("keydown",callback)};null==(t=getTarget(e))||t.addEventListener("keydown",callback)}),_=useEffectEvent(e=>{var t;const n=s.current.insideReactTree;s.current.insideReactTree=!1;const r=b.current;if(b.current=!1,"click"===u&&r)return;if(n)return;if("function"==typeof v&&!v(e))return;const a=getTarget(e),l="["+createAttribute("inert")+"]",c=getDocument(i.floating).querySelectorAll(l);let d=isElement(a)?a:null;for(;d&&!isLastTraversableNode(d);){const e=getParentNode(d);if(isLastTraversableNode(e)||!isElement(e))break;d=e}if(c.length&&isElement(a)&&!function isRootElement(e){return e.matches("html,body")}(a)&&!contains(a,i.floating)&&Array.from(c).every(e=>!contains(d,e)))return;if(isHTMLElement(a)&&O){const t=isLastTraversableNode(a),n=floating_ui_utils_dom_getComputedStyle(a),r=/auto|scroll/,o=t||r.test(n.overflowX),i=t||r.test(n.overflowY),s=o&&a.clientWidth>0&&a.scrollWidth>a.clientWidth,l=i&&a.clientHeight>0&&a.scrollHeight>a.clientHeight,c="rtl"===n.direction,u=l&&(c?e.offsetX<=a.offsetWidth-a.clientWidth:e.offsetX>a.clientWidth),d=s&&e.offsetY>a.clientHeight;if(u||d)return}const f=null==(t=s.current.floatingContext)?void 0:t.nodeId,m=h&&getNodeChildren(h.nodesRef.current,f).some(t=>{var n;return isEventTargetWithin(e,null==(n=t.context)?void 0:n.elements.floating)});if(isEventTargetWithin(e,i.floating)||isEventTargetWithin(e,i.domReference)||m)return;const p=h?getNodeChildren(h.nodesRef.current,f):[];if(p.length>0){let e=!0;if(p.forEach(t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)}),!e)return}o(!1,e,"outside-press")}),A=useEffectEvent(e=>{var t;const callback=()=>{var t;_(e),null==(t=getTarget(e))||t.removeEventListener(u,callback)};null==(t=getTarget(e))||t.addEventListener(u,callback)});r.useEffect(()=>{if(!n||!a)return;s.current.__escapeKeyBubbles=w,s.current.__outsidePressBubbles=E;let e=-1;function onScroll(e){o(!1,e,"ancestor-scroll")}function handleCompositionStart(){window.clearTimeout(e),x.current=!0}function handleCompositionEnd(){e=window.setTimeout(()=>{x.current=!1},isWebKit()?5:0)}const t=getDocument(i.floating);l&&(t.addEventListener("keydown",T?R:C,T),t.addEventListener("compositionstart",handleCompositionStart),t.addEventListener("compositionend",handleCompositionEnd)),v&&t.addEventListener(u,S?A:_,S);let r=[];return m&&(isElement(i.domReference)&&(r=getOverflowAncestors(i.domReference)),isElement(i.floating)&&(r=r.concat(getOverflowAncestors(i.floating))),!isElement(i.reference)&&i.reference&&i.reference.contextElement&&(r=r.concat(getOverflowAncestors(i.reference.contextElement)))),r=r.filter(e=>{var n;return e!==(null==(n=t.defaultView)?void 0:n.visualViewport)}),r.forEach(e=>{e.addEventListener("scroll",onScroll,{passive:!0})}),()=>{l&&(t.removeEventListener("keydown",T?R:C,T),t.removeEventListener("compositionstart",handleCompositionStart),t.removeEventListener("compositionend",handleCompositionEnd)),v&&t.removeEventListener(u,S?A:_,S),r.forEach(e=>{e.removeEventListener("scroll",onScroll)}),window.clearTimeout(e)}},[s,i,l,v,u,n,o,m,a,w,E,C,T,R,_,S,A]),r.useEffect(()=>{s.current.insideReactTree=!1},[s,v,u]);const k=r.useMemo(()=>({onKeyDown:C,...d&&{[Ue[f]]:e=>{o(!1,e.nativeEvent,"reference-press")},..."click"!==f&&{onClick(e){o(!1,e.nativeEvent,"reference-press")}}}}),[C,o,d,f]),O=r.useMemo(()=>{function setMouseDownOrUpInside(e){0===e.button&&(b.current=!0)}return{onKeyDown:C,onMouseDown:setMouseDownOrUpInside,onMouseUp:setMouseDownOrUpInside,[He[u]]:()=>{s.current.insideReactTree=!0}}},[C,u,s]);return r.useMemo(()=>a?{reference:k,floating:O}:{},[a,k,O])}function useFloatingRootContext(e){const{open:t=!1,onOpenChange:n,elements:o}=e,i=Ee(),s=r.useRef({}),[a]=r.useState(()=>createEventEmitter()),l=null!=useFloatingParentNodeId();const[c,u]=r.useState(o.reference),d=useEffectEvent((e,t,r)=>{s.current.openEvent=e?t:void 0,a.emit("openchange",{open:e,event:t,reason:r,nested:l}),null==n||n(e,t,r)}),f=r.useMemo(()=>({setPositionReference:u}),[]),m=r.useMemo(()=>({reference:c||o.reference||null,floating:o.floating||null,domReference:o.reference}),[c,o.reference,o.floating]);return r.useMemo(()=>({dataRef:s,open:t,onOpenChange:d,elements:m,events:a,floatingId:i,refs:f}),[t,d,m,a,i,f])}function floating_ui_react_esm_useFloating(e){void 0===e&&(e={});const{nodeId:t}=e,n=useFloatingRootContext({...e,elements:{reference:null,floating:null,...e.elements}}),o=e.rootContext||n,i=o.elements,[s,a]=r.useState(null),[l,c]=r.useState(null),u=(null==i?void 0:i.domReference)||s,d=r.useRef(null),f=useFloatingTree();Y(()=>{u&&(d.current=u)},[u]);const m=function useFloating(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:i,elements:{reference:s,floating:a}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=r.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,p]=r.useState(o);deepEqual(m,o)||p(o);const[g,h]=r.useState(null),[y,v]=r.useState(null),b=r.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),w=r.useCallback(e=>{e!==x.current&&(x.current=e,v(e))},[]),E=s||g,T=a||y,S=r.useRef(null),x=r.useRef(null),C=r.useRef(d),R=null!=c,_=floating_ui_react_dom_useLatestRef(c),A=floating_ui_react_dom_useLatestRef(i),k=floating_ui_react_dom_useLatestRef(u),O=r.useCallback(()=>{if(!S.current||!x.current)return;const e={placement:t,strategy:n,middleware:m};A.current&&(e.platform=A.current),floating_ui_dom_computePosition(S.current,x.current,e).then(e=>{const t={...e,isPositioned:!1!==k.current};I.current&&!deepEqual(C.current,t)&&(C.current=t,Z.flushSync(()=>{f(t)}))})},[m,t,n,A,k]);re(()=>{!1===u&&C.current.isPositioned&&(C.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[u]);const I=r.useRef(!1);re(()=>(I.current=!0,()=>{I.current=!1}),[]),re(()=>{if(E&&(S.current=E),T&&(x.current=T),E&&T){if(_.current)return _.current(E,T,O);O()}},[E,T,O,_,R]);const P=r.useMemo(()=>({reference:S,floating:x,setReference:b,setFloating:w}),[b,w]),L=r.useMemo(()=>({reference:E,floating:T}),[E,T]),M=r.useMemo(()=>{const e={position:n,left:0,top:0};if(!L.floating)return e;const t=roundByDPR(L.floating,d.x),r=roundByDPR(L.floating,d.y);return l?{...e,transform:"translate("+t+"px, "+r+"px)",...getDPR(L.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,l,L.floating,d.x,d.y]);return r.useMemo(()=>({...d,update:O,refs:P,elements:L,floatingStyles:M}),[d,O,P,L,M])}({...e,elements:{...i,...l&&{reference:l}}}),p=r.useCallback(e=>{const t=isElement(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;c(t),m.refs.setReference(t)},[m.refs]),g=r.useCallback(e=>{(isElement(e)||null===e)&&(d.current=e,a(e)),(isElement(m.refs.reference.current)||null===m.refs.reference.current||null!==e&&!isElement(e))&&m.refs.setReference(e)},[m.refs]),h=r.useMemo(()=>({...m.refs,setReference:g,setPositionReference:p,domReference:d}),[m.refs,g,p]),y=r.useMemo(()=>({...m.elements,domReference:u}),[m.elements,u]),v=r.useMemo(()=>({...m,...o,refs:h,elements:y,nodeId:t}),[m,h,y,t,o]);return Y(()=>{o.dataRef.current.floatingContext=v;const e=null==f?void 0:f.nodesRef.current.find(e=>e.id===t);e&&(e.context=v)}),r.useMemo(()=>({...m,context:v,refs:h,elements:y}),[m,h,y,v])}function isMacSafari(){return function isMac(){return getPlatform().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}()&&isSafari()}function useFocus(e,t){void 0===t&&(t={});const{open:n,onOpenChange:o,events:i,dataRef:s,elements:a}=e,{enabled:l=!0,visibleOnly:c=!0}=t,u=r.useRef(!1),d=r.useRef(-1),f=r.useRef(!0);r.useEffect(()=>{if(!l)return;const e=getWindow(a.domReference);function onBlur(){!n&&isHTMLElement(a.domReference)&&a.domReference===activeElement(getDocument(a.domReference))&&(u.current=!0)}function onKeyDown(){f.current=!0}function onPointerDown(){f.current=!1}return e.addEventListener("blur",onBlur),isMacSafari()&&(e.addEventListener("keydown",onKeyDown,!0),e.addEventListener("pointerdown",onPointerDown,!0)),()=>{e.removeEventListener("blur",onBlur),isMacSafari()&&(e.removeEventListener("keydown",onKeyDown,!0),e.removeEventListener("pointerdown",onPointerDown,!0))}},[a.domReference,n,l]),r.useEffect(()=>{if(l)return i.on("openchange",onOpenChange),()=>{i.off("openchange",onOpenChange)};function onOpenChange(e){let{reason:t}=e;"reference-press"!==t&&"escape-key"!==t||(u.current=!0)}},[i,l]),r.useEffect(()=>()=>{clearTimeoutIfSet(d)},[]);const m=r.useMemo(()=>({onMouseLeave(){u.current=!1},onFocus(e){if(u.current)return;const t=getTarget(e.nativeEvent);if(c&&isElement(t))if(isMacSafari()&&!e.relatedTarget){if(!f.current&&!isTypeableElement(t))return}else if(!function matchesFocusVisible(e){if(!e||isJSDOM())return!0;try{return e.matches(":focus-visible")}catch(e){return!0}}(t))return;o(!0,e.nativeEvent,"focus")},onBlur(e){u.current=!1;const t=e.relatedTarget,n=e.nativeEvent,r=isElement(t)&&t.hasAttribute(createAttribute("focus-guard"))&&"outside"===t.getAttribute("data-type");d.current=window.setTimeout(()=>{var e;const i=activeElement(a.domReference?a.domReference.ownerDocument:document);(t||i!==a.domReference)&&(contains(null==(e=s.current.floatingContext)?void 0:e.refs.floating.current,i)||contains(a.domReference,i)||r||o(!1,n,"focus"))})}}),[s,a.domReference,o,c]);return r.useMemo(()=>l?{reference:m}:{},[l,m])}function mergeProps(e,t,n){const r=new Map,o="item"===n;let i=e;if(o&&e){const{[se]:t,[ae]:n,...r}=e;i=r}return{..."floating"===n&&{tabIndex:-1,[ie]:""},...i,...t.map(t=>{const r=t?t[n]:null;return"function"==typeof r?e?r(e):null:r}).concat(e).reduce((e,t)=>t?(Object.entries(t).forEach(t=>{let[n,i]=t;var s;o&&[se,ae].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof i&&(null==(s=r.get(n))||s.push(i),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),i=0;ie(...o)).find(e=>void 0!==e)})):e[n]=i)}),e):e,{})}}function useInteractions(e){void 0===e&&(e=[]);const t=e.map(e=>null==e?void 0:e.reference),n=e.map(e=>null==e?void 0:e.floating),o=e.map(e=>null==e?void 0:e.item),i=r.useCallback(t=>mergeProps(t,e,"reference"),t),s=r.useCallback(t=>mergeProps(t,e,"floating"),n),a=r.useCallback(t=>mergeProps(t,e,"item"),o);return r.useMemo(()=>({getReferenceProps:i,getFloatingProps:s,getItemProps:a}),[i,s,a])}const Ge="Escape";function doSwitch(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function isMainOrientationKey(e,t){return doSwitch(t,e===ue||e===de,e===le||e===ce)}function isMainOrientationToEndKey(e,t,n){return doSwitch(t,e===de,n?e===le:e===ce)||"Enter"===e||" "===e||""===e}function isCrossOrientationOpenKey(e,t,n){return doSwitch(t,n?e===le:e===ce,e===de)}function isCrossOrientationCloseKey(e,t,n,r){return"both"===t||"horizontal"===t&&r&&r>1?e===Ge:doSwitch(t,n?e===ce:e===le,e===ue)}function useListNavigation(e,t){const{open:n,onOpenChange:o,elements:i,floatingId:s}=e,{listRef:a,activeIndex:l,onNavigate:c=()=>{},enabled:u=!0,selectedIndex:d=null,allowEscape:f=!1,loop:m=!1,nested:p=!1,rtl:g=!1,virtual:h=!1,focusItemOnOpen:y="auto",focusItemOnHover:v=!0,openOnArrowKeyDown:b=!0,disabledIndices:w,orientation:E="vertical",parentOrientation:T,cols:S=1,scrollItemIntoView:x=!0,virtualItemRef:C,itemSizes:R,dense:_=!1}=t;const A=useLatestRef(getFloatingFocusElement(i.floating)),k=useFloatingParentNodeId(),O=useFloatingTree();Y(()=>{e.dataRef.current.orientation=E},[e,E]);const I=useEffectEvent(()=>{c(-1===M.current?null:M.current)}),P=isTypeableCombobox(i.domReference),L=r.useRef(y),M=r.useRef(null!=d?d:-1),N=r.useRef(null),D=r.useRef(!0),F=r.useRef(I),$=r.useRef(!!i.floating),V=r.useRef(n),j=r.useRef(!1),W=r.useRef(!1),B=useLatestRef(w),z=useLatestRef(n),U=useLatestRef(x),H=useLatestRef(d),[G,K]=r.useState(),[X,J]=r.useState(),Z=useEffectEvent(()=>{function runFocus(e){var t;h?(null!=(t=e.id)&&t.endsWith("-fui-option")&&(e.id=s+"-"+Math.random().toString(16).slice(2,10)),K(e.id),null==O||O.events.emit("virtualfocus",e),C&&(C.current=e)):enqueueFocus(e,{sync:j.current,preventScroll:!0})}const e=a.current[M.current],t=W.current;e&&runFocus(e);(j.current?e=>e():requestAnimationFrame)(()=>{const n=a.current[M.current]||e;if(!n)return;e||runFocus(n);const r=U.current;r&&ee&&(t||!D.current)&&(null==n.scrollIntoView||n.scrollIntoView("boolean"==typeof r?{block:"nearest",inline:"nearest"}:r))})});Y(()=>{u&&(n&&i.floating?L.current&&null!=d&&(W.current=!0,M.current=d,I()):$.current&&(M.current=-1,F.current()))},[u,n,i.floating,d,I]),Y(()=>{if(u&&n&&i.floating)if(null==l){if(j.current=!1,null!=H.current)return;if($.current&&(M.current=-1,Z()),(!V.current||!$.current)&&L.current&&(null!=N.current||!0===L.current&&null==N.current)){let e=0;const waitForListPopulated=()=>{if(null==a.current[0]){if(e<2){(e?requestAnimationFrame:queueMicrotask)(waitForListPopulated)}e++}else M.current=null==N.current||isMainOrientationToEndKey(N.current,E,g)||p?getMinListIndex(a,B.current):getMaxListIndex(a,B.current),N.current=null,I()};waitForListPopulated()}}else isIndexOutOfListBounds(a,l)||(M.current=l,Z(),W.current=!1)},[u,n,i.floating,l,H,p,a,E,g,I,Z,B]),Y(()=>{var e;if(!u||i.floating||!O||h||!$.current)return;const t=O.nodesRef.current,n=null==(e=t.find(e=>e.id===k))||null==(e=e.context)?void 0:e.elements.floating,r=activeElement(getDocument(i.floating)),o=t.some(e=>e.context&&contains(e.context.elements.floating,r));n&&!o&&D.current&&n.focus({preventScroll:!0})},[u,i.floating,O,k,h]),Y(()=>{if(u&&O&&h&&!k)return O.events.on("virtualfocus",handleVirtualFocus),()=>{O.events.off("virtualfocus",handleVirtualFocus)};function handleVirtualFocus(e){J(e.id),C&&(C.current=e)}},[u,O,h,k,C]),Y(()=>{F.current=I,V.current=n,$.current=!!i.floating}),Y(()=>{n||(N.current=null,L.current=y)},[n,y]);const Q=null!=l,ee=r.useMemo(()=>{function syncCurrentTarget(e){if(!z.current)return;const t=a.current.indexOf(e);-1!==t&&M.current!==t&&(M.current=t,I())}return{onFocus(e){let{currentTarget:t}=e;j.current=!0,syncCurrentTarget(t)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},onMouseMove(e){let{currentTarget:t}=e;j.current=!0,W.current=!1,v&&syncCurrentTarget(t)},onPointerLeave(e){let{pointerType:t}=e;var n;D.current&&"touch"!==t&&(j.current=!0,v&&(M.current=-1,I(),h||null==(n=A.current)||n.focus({preventScroll:!0})))}}},[z,A,v,a,I,h]),te=r.useCallback(()=>{var e;return null!=T?T:null==O||null==(e=O.nodesRef.current.find(e=>e.id===k))||null==(e=e.context)||null==(e=e.dataRef)?void 0:e.current.orientation},[k,O,T]),ne=useEffectEvent(e=>{if(D.current=!1,j.current=!0,229===e.which)return;if(!z.current&&e.currentTarget===A.current)return;if(p&&isCrossOrientationCloseKey(e.key,E,g,S))return isMainOrientationKey(e.key,te())||stopEvent(e),o(!1,e.nativeEvent,"list-navigation"),void(isHTMLElement(i.domReference)&&(h?null==O||O.events.emit("virtualfocus",i.domReference):i.domReference.focus()));const t=M.current,r=getMinListIndex(a,w),s=getMaxListIndex(a,w);if(P||("Home"===e.key&&(stopEvent(e),M.current=r,I()),"End"===e.key&&(stopEvent(e),M.current=s,I())),S>1){const t=R||Array.from({length:a.current.length},()=>({width:1,height:1})),n=createGridCellMap(t,S,_),o=n.findIndex(e=>null!=e&&!isListIndexDisabled(a,e,w)),i=n.reduce((e,t,n)=>null==t||isListIndexDisabled(a,t,w)?e:n,-1),l=n[getGridNavigatedIndex({current:n.map(e=>null!=e?a.current[e]:null)},{event:e,orientation:E,loop:m,rtl:g,cols:S,disabledIndices:getGridCellIndices([...("function"!=typeof w?w:null)||a.current.map((e,t)=>isListIndexDisabled(a,t,w)?t:void 0),void 0],n),minIndex:o,maxIndex:i,prevIndex:getGridCellIndexOfCorner(M.current>s?r:M.current,t,n,S,e.key===de?"bl":e.key===(g?le:ce)?"tr":"tl"),stopEvent:!0})];if(null!=l&&(M.current=l,I()),"both"===E)return}if(isMainOrientationKey(e.key,E)){if(stopEvent(e),n&&!h&&activeElement(e.currentTarget.ownerDocument)===e.currentTarget)return M.current=isMainOrientationToEndKey(e.key,E,g)?r:s,void I();isMainOrientationToEndKey(e.key,E,g)?M.current=m?t>=s?f&&t!==a.current.length?-1:r:findNonDisabledListIndex(a,{startingIndex:t,disabledIndices:w}):Math.min(s,findNonDisabledListIndex(a,{startingIndex:t,disabledIndices:w})):M.current=m?t<=r?f&&-1!==t?a.current.length:s:findNonDisabledListIndex(a,{startingIndex:t,decrement:!0,disabledIndices:w}):Math.max(r,findNonDisabledListIndex(a,{startingIndex:t,decrement:!0,disabledIndices:w})),isIndexOutOfListBounds(a,M.current)&&(M.current=-1),I()}}),re=r.useMemo(()=>h&&n&&Q&&{"aria-activedescendant":X||G},[h,n,Q,X,G]),oe=r.useMemo(()=>({"aria-orientation":"both"===E?void 0:E,...P?{}:re,onKeyDown:ne,onPointerMove(){D.current=!0}}),[re,ne,E,P]),ie=r.useMemo(()=>{function checkVirtualMouse(e){"auto"===y&&isVirtualClick(e.nativeEvent)&&(L.current=!0)}function checkVirtualPointer(e){L.current=y,"auto"===y&&isVirtualPointerEvent(e.nativeEvent)&&(L.current=!0)}return{...re,onKeyDown(e){D.current=!1;const t=e.key.startsWith("Arrow"),r=["Home","End"].includes(e.key),i=t||r,s=isCrossOrientationOpenKey(e.key,E,g),l=isCrossOrientationCloseKey(e.key,E,g,S),c=isCrossOrientationOpenKey(e.key,te(),g),u=isMainOrientationKey(e.key,E),f=(p?c:u)||"Enter"===e.key||""===e.key.trim();if(h&&n){const t=null==O?void 0:O.nodesRef.current.find(e=>null==e.parentId),n=O&&t?function getDeepestNode(e,t){let n,r=-1;return function findDeepest(t,o){o>r&&(n=t,r=o),getNodeChildren(e,t).forEach(e=>{findDeepest(e.id,o+1)})}(t,0),e.find(e=>e.id===n)}(O.nodesRef.current,t.id):null;if(i&&n&&C){const t=new KeyboardEvent("keydown",{key:e.key,bubbles:!0});if(s||l){var m,y;const r=(null==(m=n.context)?void 0:m.elements.domReference)===e.currentTarget,o=l&&!r?null==(y=n.context)?void 0:y.elements.domReference:s?a.current.find(e=>(null==e?void 0:e.id)===G):null;o&&(stopEvent(e),o.dispatchEvent(t),J(void 0))}var v;if((u||r)&&n.context)if(n.context.open&&n.parentId&&e.currentTarget!==n.context.elements.domReference)return stopEvent(e),void(null==(v=n.context.elements.domReference)||v.dispatchEvent(t))}return ne(e)}if(n||b||!t){if(f){const t=isMainOrientationKey(e.key,te());N.current=p&&t?null:e.key}p?c&&(stopEvent(e),n?(M.current=getMinListIndex(a,B.current),I()):o(!0,e.nativeEvent,"list-navigation")):u&&(null!=d&&(M.current=d),stopEvent(e),!n&&b?o(!0,e.nativeEvent,"list-navigation"):ne(e),n&&I())}},onFocus(){n&&!h&&(M.current=-1,I())},onPointerDown:checkVirtualPointer,onPointerEnter:checkVirtualPointer,onMouseDown:checkVirtualMouse,onClick:checkVirtualMouse}},[G,re,S,ne,B,y,a,p,I,o,n,b,E,te,g,d,O,h,C]);return r.useMemo(()=>u?{reference:ie,floating:oe,item:ee}:{},[u,ie,oe,ee])}const qe=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function useRole(e,t){var n,o;void 0===t&&(t={});const{open:i,elements:s,floatingId:a}=e,{enabled:l=!0,role:c="dialog"}=t,u=Ee(),d=(null==(n=s.domReference)?void 0:n.id)||u,f=r.useMemo(()=>{var e;return(null==(e=getFloatingFocusElement(s.floating))?void 0:e.id)||a},[s.floating,a]),m=null!=(o=qe.get(c))?o:c,p=null!=useFloatingParentNodeId(),g=r.useMemo(()=>"tooltip"===m||"label"===c?{["aria-"+("label"===c?"labelledby":"describedby")]:i?f:void 0}:{"aria-expanded":i?"true":"false","aria-haspopup":"alertdialog"===m?"dialog":m,"aria-controls":i?f:void 0,..."listbox"===m&&{role:"combobox"},..."menu"===m&&{id:d},..."menu"===m&&p&&{role:"menuitem"},..."select"===c&&{"aria-autocomplete":"none"},..."combobox"===c&&{"aria-autocomplete":"list"}},[m,f,p,i,d,c]),h=r.useMemo(()=>{const e={id:f,...m&&{role:m}};return"tooltip"===m||"label"===c?e:{...e,..."menu"===m&&{"aria-labelledby":d}}},[m,f,d,c]),y=r.useCallback(e=>{let{active:t,selected:n}=e;const r={role:"option",...t&&{id:f+"-fui-option"}};switch(c){case"select":case"combobox":return{...r,"aria-selected":n}}return{}},[f,c]);return r.useMemo(()=>l?{reference:g,floating:h,item:y}:{},[l,g,h,y])}const camelCaseToKebabCase=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(e,t)=>(t?"-":"")+e.toLowerCase());function execWithArgsOrReturn(e,t){return"function"==typeof e?e(t):e}function useTransitionStatus(e,t){void 0===t&&(t={});const{open:n,elements:{floating:o}}=e,{duration:i=250}=t,s=("number"==typeof i?i:i.close)||0,[a,l]=r.useState("unmounted"),c=function useDelayUnmount(e,t){const[n,o]=r.useState(e);return e&&!n&&o(!0),r.useEffect(()=>{if(!e&&n){const e=setTimeout(()=>o(!1),t);return()=>clearTimeout(e)}},[e,n,t]),n}(n,s);return c||"close"!==a||l("unmounted"),Y(()=>{if(o){if(n){l("initial");const e=requestAnimationFrame(()=>{Z.flushSync(()=>{l("open")})});return()=>{cancelAnimationFrame(e)}}l("close")}},[n,o]),{isMounted:c,status:a}}function useTransitionStyles(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:o,close:i,common:s,duration:a=250}=t,l=e.placement,c=l.split("-")[0],u=r.useMemo(()=>({side:c,placement:l}),[c,l]),d="number"==typeof a,f=(d?a:a.open)||0,m=(d?a:a.close)||0,[p,g]=r.useState(()=>({...execWithArgsOrReturn(s,u),...execWithArgsOrReturn(n,u)})),{isMounted:h,status:y}=useTransitionStatus(e,{duration:a}),v=useLatestRef(n),b=useLatestRef(o),w=useLatestRef(i),E=useLatestRef(s);return Y(()=>{const e=execWithArgsOrReturn(v.current,u),t=execWithArgsOrReturn(w.current,u),n=execWithArgsOrReturn(E.current,u),r=execWithArgsOrReturn(b.current,u)||Object.keys(e).reduce((e,t)=>(e[t]="",e),{});if("initial"===y&&g(t=>({transitionProperty:t.transitionProperty,...n,...e})),"open"===y&&g({transitionProperty:Object.keys(r).map(camelCaseToKebabCase).join(","),transitionDuration:f+"ms",...n,...r}),"close"===y){const r=t||e;g({transitionProperty:Object.keys(r).map(camelCaseToKebabCase).join(","),transitionDuration:m+"ms",...n,...r})}},[m,w,v,b,E,f,y,u]),{isMounted:h,styles:p}}function useTypeahead(e,t){var n;const{open:o,dataRef:i}=e,{listRef:s,activeIndex:a,onMatch:l,onTypingChange:c,enabled:u=!0,findMatch:d=null,resetMs:f=750,ignoreKeys:m=[],selectedIndex:p=null}=t,g=r.useRef(-1),h=r.useRef(""),y=r.useRef(null!=(n=null!=p?p:a)?n:-1),v=r.useRef(null),b=useEffectEvent(l),w=useEffectEvent(c),E=useLatestRef(d),T=useLatestRef(m);Y(()=>{o&&(clearTimeoutIfSet(g),v.current=null,h.current="")},[o]),Y(()=>{var e;o&&""===h.current&&(y.current=null!=(e=null!=p?p:a)?e:-1)},[o,p,a]);const S=useEffectEvent(e=>{e?i.current.typing||(i.current.typing=e,w(e)):i.current.typing&&(i.current.typing=e,w(e))}),x=useEffectEvent(e=>{function getMatchingIndex(e,t,n){const r=E.current?E.current(t,n):t.find(e=>0===(null==e?void 0:e.toLocaleLowerCase().indexOf(n.toLocaleLowerCase())));return r?e.indexOf(r):-1}const t=s.current;if(h.current.length>0&&" "!==h.current[0]&&(-1===getMatchingIndex(t,t,h.current)?S(!1):" "===e.key&&stopEvent(e)),null==t||T.current.includes(e.key)||1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey)return;o&&" "!==e.key&&(stopEvent(e),S(!0));t.every(e=>{var t,n;return!e||(null==(t=e[0])?void 0:t.toLocaleLowerCase())!==(null==(n=e[1])?void 0:n.toLocaleLowerCase())})&&h.current===e.key&&(h.current="",y.current=v.current),h.current+=e.key,clearTimeoutIfSet(g),g.current=window.setTimeout(()=>{h.current="",y.current=v.current,S(!1)},f);const n=y.current,r=getMatchingIndex(t,[...t.slice((n||0)+1),...t.slice(0,(n||0)+1)],h.current);-1!==r?(b(r),v.current=r):" "!==e.key&&(h.current="",S(!1))}),C=r.useMemo(()=>({onKeyDown:x}),[x]),R=r.useMemo(()=>({onKeyDown:x,onKeyUp(e){" "===e.key&&S(!1)}}),[x,S]);return r.useMemo(()=>u?{reference:C,floating:R}:{},[u,C,R])}function getArgsWithCustomFloatingHeight(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const inner=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:r,onFallbackChange:o,offset:i=0,index:s=0,minItemsVisible:a=4,referenceOverflowThreshold:l=0,scrollRef:c,...u}=evaluate(e,t),{rects:p,platform:g,elements:{floating:h}}=t,y=n.current[s],v=(null==c?void 0:c.current)||h,b=h.clientTop||v.clientTop,w=0!==h.clientTop,E=0!==v.clientTop,T=h===v;if(!y)return{};const S={...t,...await floating_ui_react_dom_offset(-y.offsetTop-h.clientTop-p.reference.height/2-y.offsetHeight/2-i).fn(t)},x=await g.detectOverflow(getArgsWithCustomFloatingHeight(S,v.scrollHeight+b+h.clientTop),u),C=await g.detectOverflow(S,{...u,elementContext:"reference"}),R=f(0,x.top),_=S.y+R,A=(v.scrollHeight>v.clientHeight?e=>e:m)(f(0,v.scrollHeight+(w&&T||E?2*b:0)-R-f(0,x.bottom)));if(v.style.maxHeight=A+"px",v.scrollTop=R,o){const e=v.offsetHeight=-l||C.bottom>=-l;Z.flushSync(()=>o(e))}return r&&(r.current=await g.detectOverflow(getArgsWithCustomFloatingHeight({...S,y:_},v.offsetHeight+b+h.clientTop),u)),{y:_}}});function useInnerOffset(e,t){const{open:n,elements:o}=e,{enabled:i=!0,overflowRef:s,scrollRef:a,onChange:l}=t,c=useEffectEvent(l),u=r.useRef(!1),d=r.useRef(null),f=r.useRef(null);r.useEffect(()=>{if(!i)return;function onWheel(t){if(t.ctrlKey||!e||null==s.current)return;const n=t.deltaY,r=s.current.top>=-.5,o=s.current.bottom>=-.5,i=e.scrollHeight-e.clientHeight,a=n<0?-1:1,l=n<0?"max":"min";e.scrollHeight<=e.clientHeight||(!r&&n>0||!o&&n<0?(t.preventDefault(),Z.flushSync(()=>{c(e=>e+Math[l](n,i*a))})):/firefox/i.test(getUserAgent())&&(e.scrollTop+=n))}const e=(null==a?void 0:a.current)||o.floating;return n&&e?(e.addEventListener("wheel",onWheel),requestAnimationFrame(()=>{d.current=e.scrollTop,null!=s.current&&(f.current={...s.current})}),()=>{d.current=null,f.current=null,e.removeEventListener("wheel",onWheel)}):void 0},[i,n,o.floating,s,a,c]);const m=r.useMemo(()=>({onKeyDown(){u.current=!0},onWheel(){u.current=!1},onPointerMove(){u.current=!1},onScroll(){const e=(null==a?void 0:a.current)||o.floating;if(s.current&&e&&u.current){if(null!==d.current){const t=e.scrollTop-d.current;(s.current.bottom<-.5&&t<-1||s.current.top<-.5&&t>1)&&Z.flushSync(()=>c(e=>e+t))}requestAnimationFrame(()=>{d.current=e.scrollTop})}}}),[o.floating,c,s,a]);return r.useMemo(()=>i?{floating:m}:{},[i,m])}function floating_ui_react_esm_getNodeChildren(e,t,n){void 0===n&&(n=!0);return e.filter(e=>{var r;return e.parentId===t&&(!n||(null==(r=e.context)?void 0:r.open))}).flatMap(t=>[t,...floating_ui_react_esm_getNodeChildren(e,t.id,n)])}function isPointInPolygon(e,t){const[n,r]=e;let o=!1;const i=t.length;for(let e=0,s=i-1;e=r!=c>=r&&n<=(l-i)*(r-a)/(c-a)+i&&(o=!o)}return o}function safePolygon(e){void 0===e&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,o={current:-1};let i=!1,s=null,a=null,l="undefined"!=typeof performance?performance.now():0;const fn=e=>{let{x:n,y:c,placement:u,elements:d,onClose:f,nodeId:m,tree:p}=e;return function onMouseMove(e){function close(){clearTimeoutIfSet(o),f()}if(clearTimeoutIfSet(o),!d.domReference||!d.floating||null==u||null==n||null==c)return;const{clientX:g,clientY:h}=e,y=[g,h],v=function floating_ui_react_esm_getTarget(e){return"composedPath"in e?e.composedPath()[0]:e.target}(e),b="mouseleave"===e.type,w=floating_ui_react_esm_contains(d.floating,v),E=floating_ui_react_esm_contains(d.domReference,v),T=d.domReference.getBoundingClientRect(),S=d.floating.getBoundingClientRect(),x=u.split("-")[0],C=n>S.right-S.width/2,R=c>S.bottom-S.height/2,_=function isInside(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(y,T),A=S.width>T.width,k=S.height>T.height,O=(A?T:S).left,I=(A?T:S).right,P=(k?T:S).top,L=(k?T:S).bottom;if(w&&(i=!0,!b))return;if(E&&(i=!1),E&&!b)return void(i=!0);if(b&&isElement(e.relatedTarget)&&floating_ui_react_esm_contains(d.floating,e.relatedTarget))return;if(p&&floating_ui_react_esm_getNodeChildren(p.nodesRef.current,m).length)return;if("top"===x&&c>=T.bottom-1||"bottom"===x&&c<=T.top+1||"left"===x&&n>=T.right-1||"right"===x&&n<=T.left+1)return close();let M=[];switch(x){case"top":M=[[O,T.top+1],[O,S.bottom-1],[I,S.bottom-1],[I,T.top+1]];break;case"bottom":M=[[O,S.top+1],[O,T.bottom-1],[I,T.bottom-1],[I,S.top+1]];break;case"left":M=[[S.right-1,L],[S.right-1,P],[T.left+1,P],[T.left+1,L]];break;case"right":M=[[T.right-1,L],[T.right-1,P],[S.left+1,P],[S.left+1,L]]}if(!isPointInPolygon([g,h],M)){if(i&&!_)return close();if(!b&&r){const t=function getCursorSpeed(e,t){const n=performance.now(),r=n-l;if(null===s||null===a||0===r)return s=e,a=t,l=n,null;const o=e-s,i=t-a,c=Math.sqrt(o*o+i*i);return s=e,a=t,l=n,c/r}(e.clientX,e.clientY);if(null!==t&&t<.1)return close()}isPointInPolygon([g,h],function getPolygon(e){let[n,r]=e;switch(x){case"top":return[[A?n+t/2:C?n+4*t:n-4*t,r+t+1],[A?n-t/2:C?n+4*t:n-4*t,r+t+1],...[[S.left,C||A?S.bottom-t:S.top],[S.right,C?A?S.bottom-t:S.top:S.bottom-t]]];case"bottom":return[[A?n+t/2:C?n+4*t:n-4*t,r-t],[A?n-t/2:C?n+4*t:n-4*t,r-t],...[[S.left,C||A?S.top+t:S.bottom],[S.right,C?A?S.top+t:S.bottom:S.top+t]]];case"left":{const e=[n+t+1,k?r+t/2:R?r+4*t:r-4*t],o=[n+t+1,k?r-t/2:R?r+4*t:r-4*t];return[...[[R||k?S.right-t:S.left,S.top],[R?k?S.right-t:S.left:S.right-t,S.bottom]],e,o]}case"right":return[[n-t,k?r+t/2:R?r+4*t:r-4*t],[n-t,k?r-t/2:R?r+4*t:r-4*t],...[[R||k?S.left+t:S.right,S.top],[R?k?S.left+t:S.right:S.left+t,S.bottom]]]}}([n,c]))?!i&&r&&(o.current=window.setTimeout(close,40)):close()}}};return fn.__options={blockPointerEvents:n},fn}},79513:function(e){e.exports=window.elementorV2.ui},84792:function(e){e.exports=window.elementorV2.wpMedia},87883:function(e){e.exports=window.elementorV2.editorInteractions},97557:function(e){e.exports=window.React}},r={};function __webpack_require__(e){var t=r[e];if(void 0!==t)return t.exports;var o=r[e]={exports:{}};return n[e](o,o.exports,__webpack_require__),o.exports}t=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},__webpack_require__.t=function(n,r){if(1&r&&(n=this(n)),8&r)return n;if("object"==typeof n&&n){if(4&r&&n.__esModule)return n;if(16&r&&"function"==typeof n.then)return n}var o=Object.create(null);__webpack_require__.r(o);var i={};e=e||[null,t({}),t([]),t(t)];for(var s=2&r&&n;("object"==typeof s||"function"==typeof s)&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach(function(e){i[e]=function(){return n[e]}});return i.default=function(){return n},__webpack_require__.d(o,i),o},__webpack_require__.d=function(e,t){for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o=__webpack_require__(61869);(window.elementorV2=window.elementorV2||{}).editorCanvas=o}(),window.elementorV2.editorCanvas?.init?.();