File "editor-elements.min.js"

Full Path: /home/diablzlo/glucosebalnce.com/wp-content/plugins/elementor/assets/js/packages/editor-elements/editor-elements.min.js
File size: 7.1 KB
MIME-type: text/plain
Charset: utf-8

!function(){"use strict";var e={d:function(t,n){for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{ELEMENT_STYLE_CHANGE_EVENT:function(){return T},createElementStyle:function(){return V},deleteElementStyle:function(){return P},getAnchoredAncestorId:function(){return x},getAnchoredDescendantId:function(){return R},getContainer:function(){return r},getCurrentDocumentId:function(){return S},getElementLabel:function(){return _},getElementSetting:function(){return s},getElementSettings:function(){return c},getElementStyles:function(){return p},getElements:function(){return h},getLinkInLinkRestriction:function(){return A},getSelectedElements:function(){return m},getWidgetsCache:function(){return u},isElementAnchored:function(){return k},selectElement:function(){return o},styleRerenderEvents:function(){return I},updateElementSettings:function(){return b},updateElementStyle:function(){return L},useElementSetting:function(){return l},useElementSettings:function(){return i},useElementType:function(){return d},useParentElement:function(){return f},useSelectedElement:function(){return a}});var n=window.elementorV2.editorV1Adapters;function r(e){const t=window,n=t.elementor?.getContainer?.(e);return n??null}const o=e=>{try{const t=r(e);(0,n.__privateRunCommand)("document/elements/select",{container:t})}catch{}},s=(e,t)=>{const n=r(e);return n?.settings?.get(t)??null},c=(e,t)=>Object.fromEntries(t.map(t=>[t,s(e,t)])),l=(e,t)=>(0,n.__privateUseListenTo)((0,n.commandEndEvent)("document/elements/set-settings"),()=>s(e,t),[e,t]),i=(e,t)=>(0,n.__privateUseListenTo)((0,n.commandEndEvent)("document/elements/set-settings"),()=>t.reduce((t,n)=>{const r=s(e,n);return null!==r&&(t[n]=r),t},{}),[e,...t]);function u(){const e=window;return e?.elementor?.widgetsCache||null}function d(e){return(0,n.__privateUseListenTo)((0,n.commandEndEvent)("editor/documents/load"),()=>{if(!e)return null;const t=u(),n=t?.[e];return n?.atomic_controls&&n?.atomic_props_schema?{key:e,controls:n.atomic_controls,propsSchema:n.atomic_props_schema,dependenciesPerTargetMapping:n.dependencies_per_target_mapping??{},title:n.title}:null},[e])}function m(){const e=window;return(e.elementor?.selection?.getElements?.()??[]).reduce((e,t)=>{const n=t.model.get("widgetType")||t.model.get("elType");return n&&e.push({id:t.model.get("id"),type:n}),e},[])}function a(){const e=(0,n.__privateUseListenTo)([(0,n.commandEndEvent)("document/elements/select"),(0,n.commandEndEvent)("document/elements/deselect"),(0,n.commandEndEvent)("document/elements/select-all"),(0,n.commandEndEvent)("document/elements/deselect-all")],m),[t]=e,r=d(t?.type);return 1===e.length&&r?{element:t,elementType:r}:{element:null,elementType:null}}function f(e){return(0,n.__privateUseListenTo)([(0,n.commandEndEvent)("document/elements/create")],()=>{if(!e)return null;const t=window,n=t?.elementor?.getContainer?.(e);return n?n.parent:null},[e])}const p=e=>{const t=r(e);return t?.model.get("styles")||null};var E=window.elementorV2.utils;const g=(0,E.createError)({code:"element_not_found",message:"Element not found."}),y=(0,E.createError)({code:"style_not_found",message:"Style not found."}),w=(0,E.createError)({code:"element_type_not_exists",message:"Element type does not exist."}),v=(0,E.createError)({code:"element_label_not_exists",message:"Element label does not exist."});function _(e){const t=r(e),n=t?.model.get("widgetType")||t?.model.get("elType");if(!n)throw new w({context:{elementId:e}});const o=u()?.[n]?.title;if(!o)throw new v({context:{elementType:n}});return o}function h(e){const t=e?r(e):function(){const e=window;return e.elementor?.documents?.getCurrent?.()?.container??null}();if(!t)return[];const n=[...t.model.get("elements")??[]].flatMap(e=>h(e.get("id")));return[t,...n]}function S(){const e=window;return e.elementor?.documents?.getCurrentId?.()??null}const b=({id:e,props:t,withHistory:o=!0})=>{const s={container:r(e),settings:{...t}};o?(0,n.__privateRunCommandSync)("document/elements/settings",s):(0,n.__privateRunCommandSync)("document/elements/set-settings",s,{internal:!0})},T="elementor/editor-v2/editor-elements/style",I=[(0,n.commandEndEvent)("document/elements/create"),(0,n.commandEndEvent)("document/elements/duplicate"),(0,n.commandEndEvent)("document/elements/import"),(0,n.commandEndEvent)("document/elements/paste"),(0,n.windowEvent)(T)];var C=window.elementorV2.editorProps,O=window.elementorV2.editorStyles;function j(e,t){const o=r(e);if(!o)throw new g({context:{elementId:e}});const s=Object.keys(o.model.get("styles")??{}),c=function(e,t){const n=structuredClone(e.model.get("styles"))??{},r=Object.entries(t(n)).map(([e,t])=>(t.variants=function(e){return e.variants.filter(({props:e})=>Object.keys(e).length>0)}(t),[e,t])).filter(([,e])=>!function(e){return 0===e.variants.length}(e)),o=Object.fromEntries(r);return e.model.set("styles",o),o}(o,t);return function(e,{oldIds:t,newIds:n}){const r=t.filter(e=>!n.includes(e)),o=structuredClone(function(e){return Object.entries(e.settings.toJSON()).filter(e=>{const[,t]=e;return C.classesPropTypeUtil.isValid(t)})}(e));o.forEach(([,e])=>{e.value=e.value.filter(e=>!r.includes(e))}),b({id:e.id,props:Object.fromEntries(o),withHistory:!1})}(o,{oldIds:s,newIds:Object.keys(c)}),window.dispatchEvent(new CustomEvent(T)),(0,n.__privateRunCommandSync)("document/save/set-is-modified",{status:!0},{internal:!0}),c}function V({styleId:e,elementId:t,classesProp:n,label:r,meta:o,props:c,additionalVariants:l=[]}){let i=e;return j(t,e=>{i??=(0,O.generateId)(`e-${t}-`,Object.keys(e));const u=[{meta:o,props:c},...l];return e[i]={id:i,label:r,type:"class",variants:u},function(e,t,n){const r=s(e,t),o=C.classesPropTypeUtil.create(e=>[...e??[],n],{base:r});b({id:e,props:{[t]:o},withHistory:!1})}(t,n,i),e}),i}function L(e){j(e.elementId,t=>{const n=t[e.styleId];if(!n)throw new y({context:{styleId:e.styleId}});const r=(0,O.getVariantByMeta)(n,e.meta);return r?r.props=(0,C.mergeProps)(r.props,e.props):n.variants.push({meta:e.meta,props:e.props}),t})}function P(e,t){j(e,e=>(delete e[t],e))}function A(e){const t=R(e);if(t)return{shouldRestrict:!0,reason:"descendant",elementId:t};const n=x(e);return n?{shouldRestrict:!0,reason:"ancestor",elementId:n}:{shouldRestrict:!1}}function R(e){const t=N(e);if(!t)return null;for(const n of Array.from(t.querySelectorAll("a"))){const t=M(n);if(t!==e)return t}return null}function x(e){const t=N(e);if(!t||null===t.parentElement)return null;const n=t.parentElement.closest("a");return n?M(n):null}function k(e){const t=N(e);return!!t&&(!!H(t.tagName)||U(t))}function U(e){for(const t of e.children)if(!D(t)){if(H(t.tagName))return!0;if(U(t))return!0}return!1}function M(e){return e.closest("[data-id]")?.dataset.id||null}function N(e){try{return r(e)?.view?.el||null}catch{return null}}function H(e){return"a"===e.toLowerCase()}function D(e){return e.hasAttribute("data-id")}(window.elementorV2=window.elementorV2||{}).editorElements=t}(),window.elementorV2.editorElements?.init?.();