/*! For license information please see editor-styles-repository.js.LICENSE.txt */
!function(){"use strict";var e={react:function(e){e.exports=window.React},"@elementor/editor-elements":function(e){e.exports=window.elementorV2.editorElements},"@elementor/editor-v1-adapters":function(e){e.exports=window.elementorV2.editorV1Adapters}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,r),s.exports}r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};!function(){r.r(n),r.d(n,{ELEMENTS_STYLES_PROVIDER_KEY:function(){return l},stylesRepository:function(){return s},useAllStylesByProvider:function(){return i}});var e=r("react"),t=r("@elementor/editor-elements"),o=r("@elementor/editor-v1-adapters"),s=(()=>{const e=new Map;return{all:(t={})=>Array.from(e.values()).flatMap((e=>Object.values(e.get(t)))),allByProvider:(t={})=>Array.from(e.entries()).map((([e,r])=>[e,Object.values(r.get(t))])),register:(t,r)=>{e.set(t,r)},subscribe:t=>{const r=Array.from(e.values()).map((e=>e.subscribe(t)));return()=>{r.forEach((e=>e()))}}}})();function i(t={}){const[,r]=(0,e.useReducer)((e=>!e),!1);return(0,e.useEffect)((()=>s.subscribe(r)),[]),s.allByProvider(t)}var l="elements",a={get:(e={})=>{let r=(0,t.getElements)();"elementId"in e&&e.elementId&&(r=r.filter((t=>t.id===e.elementId)));const n=r.flatMap((e=>{const t=e.model.get("styles");return t?Object.entries(t):[]}));return Object.fromEntries(n)},subscribe:e=>(0,o.__privateListenTo)([(0,o.commandEndEvent)("editor/documents/attach-preview"),(0,o.commandEndEvent)("document/atomic-widgets/styles")],e)};s.register("elements",a)}(),(window.elementorV2=window.elementorV2||{}).editorStylesRepository=n}();