@claspo/components 1.8.1 → 1.8.2-dd.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- const t="cl-";function e(e){return t+e}function n(t){return"cl-"+t}const o="VIEW",r="MODULE",i="CONTAINER",s="INPUT",a="BUTTON",l="CONSENT",c="COLUMN";var u,h;(h=u||(u={})).SUBSCRIBE_CONTACT="SUBSCRIBE_CONTACT",h.REQUEST="REQUEST",h.DISPATCH_EVENT="DISPATCH_EVENT",h.GO_TO_VIEW="GO_TO_VIEW",h.GO_TO_PREVIOUS_VIEW="GO_TO_PREVIOUS_VIEW",h.GO_TO_NEXT_VIEW="GO_TO_NEXT_VIEW",h.SHOW_WIDGET="SHOW_WIDGET",h.OPEN_LINK="OPEN_LINK",h.CLOSE_WIDGET="CLOSE_WIDGET",h.CLICK="CLICK";const p=u;var d,m;class g{static sortActions(t){const e={[p.CLOSE_WIDGET]:-1,[p.OPEN_LINK]:-2,[p.SHOW_WIDGET]:1,[p.SUBSCRIBE_CONTACT]:2,[p.REQUEST]:3},n=t=>void 0!==e[t.type]?e[t.type]:0;return[...t].sort(((t,e)=>n(t)>n(e)?-1:n(t)<n(e)?1:0))}constructor(t,e){this.config=t,this.actions=g.sortActions(e),this.listener=null,this.targetElements=[],this.eventsQueue=[],this.state=null,this.postponed=!1}activate(t,e,o){this.state=t;const r=o(),i=r.getAttribute(n("id"));this.listener=t=>{const e=t.composedPath().filter((t=>t instanceof HTMLElement&&t.getAttribute(n("type"))));let o=0;for(;e[o]&&e[o].getAttribute(n("id"))!==i;){let t=e[o].getAttribute(n("type"));if(g.IGNORING_VIEW_ENTRY_TYPES.includes(t))return;o++}this.eventsQueue.push({event:t}),this.postponed||this.execute()},this.targetElements=this.config.relativeSelector?Array.from((r.shadowRoot||r).querySelectorAll(this.config.relativeSelector)):[r],this.targetElements.forEach((t=>{t.addEventListener("click",this.listener)}))}async execute(){var t,e,n,o;try{for(var r,i=!0,s=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t="function"==typeof __values?__values(t):t[Symbol.iterator](),e={},o("next"),o("throw"),o("return"),e[Symbol.asyncIterator]=function(){return this},e);function o(n){e[n]=t[n]&&function(e){return new Promise((function(o,r){!function(t,e,n,o){Promise.resolve(o).then((function(e){t({value:e,done:n})}),e)}(o,r,(e=t[n](e)).done,e.value)}))}}}(this.eventsQueue);!(t=(r=await s.next()).done);i=!0){o=r.value,i=!1;const{event:t}=o;for(const e of this.actions)if(!await e.execute(this.state.getState(),t))break}}catch(t){e={error:t}}finally{try{i||t||!(n=s.return)||await n.call(s)}finally{if(e)throw e.error}}this.eventsQueue=[]}postpone(){this.postponed=!0}release(){this.postponed=!1,this.execute()}destroy(){this.listener&&this.targetElements.length&&(this.targetElements.forEach((t=>{t.removeEventListener("click",this.listener)})),this.targetElements=[])}}g.IGNORING_VIEW_ENTRY_TYPES=[a,l,s],(m=d||(d={})).CLICK="CLICK",m.COMPONENT_EVENT="COMPONENT_EVENT";class f{constructor(t,e){this.config=t,this.actions=e,this.componentEmitterListener=null}activate(t,e,n){this.componentEmitterListener=e.on(this.config.eventName,(()=>{this.actions.forEach((e=>e.execute(t.getState(),this.config.params)))}))}destroy(){this.componentEmitterListener&&this.componentEmitterListener.off()}}class y{constructor(t,e){this.actionFactory=t,this.actionRegister=e}get(t){const e=t.actions.map((t=>this.actionFactory.get(t)));switch(e.forEach((t=>this.actionRegister.register(t))),t.type){case d.CLICK:return new g(t,e);case d.COMPONENT_EVENT:return new f(t,e);default:throw new Error(`Not supported handler type ${t.type}`)}}}class E{static generate(){let t,e="";for(let n=0;n<32;n++)8!==n&&12!==n&&16!==n&&20!==n||(e+="-"),t=Math.floor(16*Math.random()).toString(16).toUpperCase(),e+=t;return e}}class b{constructor(){this.listeners=b.createDefaultListenersState()}emit(t,e,n=null){const o=this.listeners[t];o&&Object.values(o).forEach((o=>o(e,t,n))),Object.values(this.listeners["*"]).forEach((o=>o(e,t,n)))}on(t,e){const n=E.generate(),o=this.listeners[t];return o?o[n]=e:this.listeners[t]={[n]:e},{off:()=>{var e,o;(null===(o=null===(e=this.listeners)||void 0===e?void 0:e[t])||void 0===o?void 0:o[n])&&delete this.listeners[t][n]}}}destroy(){this.listeners=b.createDefaultListenersState()}}b.createDefaultListenersState=()=>({"*":{}});const v=b,O=(t,e,n,o)=>{const r=EventTarget.prototype,{addEventListenerBase:i,addEventListener:s}=r;(i||s).call(t,e,n,o)};class S{constructor(t){this.state=t||{}}getState(){return this.state}setState(t){this.state=Object.assign(Object.assign({},this.state),t)}destroy(){}}class T{static extract(t){const e=t.views.map((t=>{const e=t.children.map((t=>t.type===r?Object.assign(Object.assign({},t),T.moduleToContainerParams):t));return Object.assign(Object.assign({},t),{children:e})}));return Object.assign(Object.assign({},t),{views:e})}static sort(t,e){return t.index>e.index?1:-1}static reIndex(t,e){return Object.assign(Object.assign({},t),{index:e+t.index})}}var C,_,A,N,I,L,P,R,M,w,U,j,k;T.moduleToContainerParams={name:"SysContainerComponent",version:"1.0.0"},(_=C||(C={})).VIEW="VIEW",_.CONTAINER="CONTAINER",_.TEXT="TEXT",_.INPUT="INPUT",_.BUTTON="BUTTON",_.IMAGE="IMAGE",_.CONSENT="CONSENT",_.COUNTDOWN_TIMER="COUNTDOWN_TIMER",_.PROMO_CODE="PROMO_CODE",_.MULTIPLE_INPUT="MULTIPLE_INPUT",_.VIDEO="VIDEO",_.SLIDER="SLIDER",_.SLIDE="SLIDE",_.SOCIAL="SOCIAL",_.COLUMNS="COLUMNS",_.COLUMN="COLUMN",_.PRIZE_BASED_GAMING="PRIZE_BASED_GAMING",(A||(A={})).CLICK="CLICK",function(t){t.SHOW_WIDGET="SHOW_WIDGET",t.OPEN_LINK="OPEN_LINK",t.SUBSCRIBE_CONTACT="SUBSCRIBE_CONTACT",t.REQUEST="REQUEST",t.CLOSE_WIDGET="CLOSE_WIDGET",t.GO_TO_VIEW="GO_TO_VIEW",t.GO_TO_PREVIOUS_VIEW="GO_TO_PREVIOUS_VIEW",t.GO_TO_NEXT_VIEW="GO_TO_NEXT_VIEW",t.CLICK="CLICK"}(N||(N={})),function(t){t.SELF="_self",t.BLANK="_blank"}(I||(I={})),(L||(L={})).ACCENT="accent",function(t){t.TOP="TOP",t.CENTER="CENTER",t.BOTTOM="BOTTOM"}(P||(P={})),function(t){t.LEFT="LEFT",t.CENTER="CENTER",t.RIGHT="RIGHT"}(R||(R={})),function(t){t.SLIDE_TO_TOP="SLIDE_TO_TOP",t.SLIDE_TO_BOTTOM="SLIDE_TO_BOTTOM",t.SLIDE_TO_LEFT="SLIDE_TO_LEFT",t.SLIDE_TO_RIGHT="SLIDE_TO_RIGHT"}(M||(M={})),function(t){t.PULSE="PULSE",t.VIBRATE="VIBRATE",t.WOBBLE="WOBBLE",t.SHAKE="SHAKE",t.JELLO="JELLO",t.BOUNCE="BOUNCE",t.BLINK="BLINK",t.FLICKER="FLICKER",t.PING="PING"}(w||(w={})),function(t){t.LEFT="LEFT",t.RIGHT="RIGHT"}(U||(U={})),(k=j||(j={})).BEFORE="BEFORE",k.AFTER="AFTER",k.INSIDE="INSIDE",k.INSTEAD="INSTEAD";class D extends v{constructor(t,e){super(),this.config=e,this.handleMobileBreakpoint(t.getShared().mobileBreakpointWidth),t.on("ENVIRONMENT_UPDATE",(({isMobileEnv:t})=>{this._isMobile=t,this.emit(D.changeEventName,this._isMobile)}))}handleMobileBreakpoint(t){this.mobileBreakpointWidth=t;const e=Number.isInteger(this.mobileBreakpointWidth)?`${this.mobileBreakpointWidth}px`:this.mobileBreakpointWidth;this.mediaQueryList=window.matchMedia(`(max-width: ${e})`),this.mediaQueryList.addListener(this.listener.bind(this)),this._isMobile=this.mediaQueryList.matches,this.emit(D.changeEventName,this._isMobile)}isMobile(){return this.config.forceMobileEnv||this._isMobile}listener(t){this._isMobile=t.matches,this.emit(D.changeEventName,this._isMobile)}destroy(){super.destroy(),this.mediaQueryList.removeListener(this.listener.bind(this))}}D.changeEventName="CHANGE";const x=D;class F{static set(t,e){const n=t[F.accumulatorPropertyName]||{};t[F.accumulatorPropertyName]=Object.assign(Object.assign({},n),e.styleAttributes),Object.keys(t[F.accumulatorPropertyName]).forEach((n=>{n.includes("--")?t.style.setProperty(n,e.styleAttributes[n]||""):t.style[n]=e.styleAttributes[n]?e.styleAttributes[n]:""}))}}F.accumulatorPropertyName="clStyleAttributes";const W=F;var B;!function(t){t.BUILT_IN="BUILT_IN",t.DETACHED="DETACHED",t.FLOATING_BOX="FLOATING_BOX",t.FLOATING_BAR="FLOATING_BAR",t.LAUNCHER="LAUNCHER",t.CONTENT_LOCKER="CONTENT_LOCKER"}(B||(B={}));class H{static applyHostStyles(t,e,n=null,r){var s,a,l;const u=null===(a=null===(s=null==n?void 0:n.props)||void 0===s?void 0:s.handlers)||void 0===a?void 0:a.find((t=>"CLICK"===t.type));u&&(null===(l=u.actions)||void 0===l?void 0:l.length)&&(e.style.cursor="pointer"),t!==o&&t!==i&&t!==c||(e.style.display=r===B.CONTENT_LOCKER&&t===o?"flex":"inline-flex",e.style.position="relative"),e.style.boxSizing="border-box"}constructor(){this.styles="/* common styles */ *, *:before, *:after { box-sizing: border-box; font-family: inherit; }"}setStyles(t=""){this.styles=`${this.styles} ${t}`}getStyles(){return this.styles}}class G{static log(t){window.scriptLog09u8y9?scriptLog09u8y9("ERROR","RUNTIME_ERROR",new Error(t)):console.error(t)}}class V{constructor(t,e,n,o,r,i){this.hostElement=e,this.documentModel=t,this.getSharedCb=n,this.getPropsCb=o,this.getEnvCb=r,this.httpClient=i,this.schemaSubscription=null,this.themeSubscription=null,this.envUrlMaps={desktop:new Map,mobile:new Map}}parseBackground(t){const e=String(t||"");if(e.includes("url")){const[t,n]=e.split("(")[1].split(")");return{url:t.replace(/['"]+/g,""),positionOptions:n.replace(";","")}}return{url:null,positionOptions:null}}apply(t){const e=this.getPropsCb();return e.backgroundDynamicInlineSVGElements[t].forEach((n=>{var o,r,i,s,a;const l=null===(r=null===(o=e.adaptiveStyles)||void 0===o?void 0:o[t])||void 0===r?void 0:r.find((t=>t.element===n)),c=(null===(i=e.styles)||void 0===i?void 0:i.find((t=>t.element===n)))||{},u=(null===(s=null==c?void 0:c.styleAttributes)||void 0===s?void 0:s.background)||(null===(a=null==l?void 0:l.styleAttributes)||void 0===a?void 0:a.background),h=this.parseBackground(u);h.url&&this.envUrlMaps[t].set(n,{originalSVGResourceURL:h.url,inlineSvgString:null,positionOptions:h.positionOptions})})),Promise.all([...this.envUrlMaps[t].entries()].map((([e,n])=>this.httpClient.execute(n.originalSVGResourceURL).then((t=>t.text())).then((o=>{this.envUrlMaps[t].set(e,Object.assign(Object.assign({},n),{inlineSvgString:o}))}))))).then((()=>{var e;const n=this.getSharedCb();return Object.keys((null===(e=n.theme)||void 0===e?void 0:e.schema)||{}).length>0?this._applyHostElementBackgroundFromTheme(this.envUrlMaps[t].get("host"),n.theme.schema):this._applyHostElementBackgroundFromCssVars(this.envUrlMaps[t].get("host"),n.cssVars)})).catch((t=>{console.error(t),G.log(`Failed to load/apply backgroundDynamicInlineSVGElements[${this.getPropsCb().backgroundDynamicInlineSVGElements}] ${t}`)}))}on(){return this.schemaSubscription=this.documentModel.on("COLOR_SCHEMA_UPDATE",(t=>{this._applyHostElementBackgroundFromCssVars(this.envUrlMaps[this.getEnvCb()].get("host"),t)})),this.themeSubscription=this.documentModel.on("THEME_UPDATE",(t=>{this._applyHostElementBackgroundFromTheme(this.envUrlMaps[this.getEnvCb()].get("host"),t.schema)})),this}_applyHostElementBackgroundFromCssVars(t,e){t&&e&&(this.hostElement.style.background=this._buildBackgroundUrlFromCssVars(t,e))}_applyHostElementBackgroundFromTheme(t,e){t&&e&&(this.hostElement.style.background=this._buildBackgroundUrlFromTheme(t,e))}_buildBackgroundUrlFromCssVars(t,e){const n=t.inlineSvgString.trim().replace("var(--cl-schema-accent)",e["cl-schema-accent"]);return`url('data:image/svg+xml,${encodeURIComponent(n)}')${t.positionOptions}`}_buildBackgroundUrlFromTheme(t,e){const n=t.inlineSvgString.trim();let o=n;return[...n.matchAll(/var\(--cl-schema-([^)]+)\)/g)].forEach((t=>{const n=function(t=""){return t.replace(/var\(\s*(--[^,\s)]+).*\)/,"$1").replace("--cl-schema-","")}(t[1]);var r;o=o.replace(`var(--${r=n,`cl-schema-${r}`})`,e[n])})),`url('data:image/svg+xml,${encodeURIComponent(o)}')${t.positionOptions}`}off(){var t,e;null===(t=this.schemaSubscription)||void 0===t||t.off(),null===(e=this.themeSubscription)||void 0===e||e.off()}}const $=new class{execute(t,e="GET",n=null,o,r){const i={method:e,headers:Object.assign({"Content-Type":"text/plain"},o||{}),credentials:"same-origin",body:null,signal:r};return n&&(i.body="string"==typeof n?n:JSON.stringify(n)),fetch(t,i)}};function K(t,e){return Object.keys(t).filter((t=>!e.includes(t))).reduce(((e,n)=>Object.assign(Object.assign({},e),{[n]:t[n]})),{})}class z{static camelCaseToDashCase(t){return t.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))}static camelCaseToUpperSnakeCase(t){return t.replace(/[A-Z]/g,(t=>"_"+t)).toUpperCase()}}class Q{constructor(t){this._count=0,this.onUpdateCb=t}increment(){this._count++,this.onUpdateCb(this.count())}decrement(){this._count>0&&this._count--,this.onUpdateCb(this.count())}count(){return this._count}}var q;!function(t){t.TOO_MANY_REQUESTS="TOO_MANY_REQUESTS",t.COMPONENT_RESOURCES_LOADED="COMPONENT_RESOURCES_LOADED",t.FAILED_TO_LOAD_COMPONENT_RESOURCE="FAILED_TO_LOAD_COMPONENT_RESOURCE",t.SUBMIT_REQUEST_STARTED="SUBMIT_REQUEST_STARTED",t.SUBMIT_REQUEST_FINISHED="SUBMIT_REQUEST_FINISHED",t.PROMO_CODE_SHOWN="PROMO_CODE_SHOWN"}(q||(q={}));const Y=q;class Z{constructor(t,e,n){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=t=>{0===t&&this.systemEventEmitter.emit(Y.COMPONENT_RESOURCES_LOADED,this.componentId)},this.onResourceLoadFailure=t=>{this.isStaticEntryModule?this.systemEventEmitter.emit(Y.FAILED_TO_LOAD_COMPONENT_RESOURCE,`Failed to load: ${t}`):this.counters.pending.decrement()},this.componentId=t,this.systemEventEmitter=e,this.isStaticEntryModule=n,this.counters={pending:new Q(this.onCounterStateUpdate)}}}const J=(...t)=>{let e=t.reduce(((t,e)=>Object.assign(Object.assign({},t),{[e]:[]})),{});return{get:t=>e[t],clear:()=>J(...t)}},X=J,tt="props",et="shared",nt="environment";function ot(t,e,n,o){const r=t=>{let i=t instanceof DocumentFragment||(null==t?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?t.host:t;return i&&(o&&"function"==typeof o?o(i.getAttribute(e)):(null===(s=null==i?void 0:i.getAttribute)||void 0===s?void 0:s.call(i,e))===n)?i:i&&i.parentNode&&r(i.parentNode)||null;var s};return r(t)}const rt="SUBMIT";function it(t,e){return e?(t.classes=`${t.classes||""} ${e.classes||""}`.trim(),Object.keys(e).forEach((n=>{if("element"===n||"classes"===n)return;const o=e[n];o&&"object"==typeof o&&!Array.isArray(o)?t[n]=Object.assign(Object.assign({},t[n]||{}),o):t[n]=o})),t):t}const st={DESKTOP:"desktop",MOBILE:"mobile"};function at(t,e,n){var o;return null===(o=null==t?void 0:t[e])||void 0===o?void 0:o.find((t=>t.element===n))}function lt(t){const{element:e,html:n,appendHtml:o}=t,r=function(t){if(null==t)return"";if("string"!=typeof t)return String(t);if(""===t)return"";if(!/<\/?([a-zA-Z][a-zA-Z0-9]*)\b[^>]*>/.test(t))return t;const e=(new DOMParser).parseFromString(t,"text/html");return e.querySelectorAll('script, style, link[rel="stylesheet"], meta[http-equiv]').forEach((t=>t.remove())),e.querySelectorAll("*").forEach((t=>{if(["onclick","onload","onerror","onmouseover","onfocus","onblur","onkeyup","onkeydown","onchange","onsubmit","onmouseenter","onmouseleave","onmouseout","oncontextmenu","ondrag","ondrop"].forEach((e=>t.removeAttribute(e))),Array.from(t.attributes).forEach((e=>{e.name.startsWith("on")&&t.removeAttribute(e.name)})),"A"===t.tagName||"AREA"===t.tagName){const e=t.getAttribute("href");e&&(e.startsWith("javascript:")||e.startsWith("data:"))&&t.removeAttribute("href")}if("IMG"===t.tagName||"IFRAME"===t.tagName){const e=t.getAttribute("src");e&&(e.startsWith("javascript:")||e.startsWith("data:text/html"))&&t.removeAttribute("src")}if("FORM"===t.tagName){const e=t.getAttribute("action");e&&e.startsWith("javascript:")&&t.removeAttribute("action")}})),e.body.innerHTML}(n);o?e.innerHTML+=r:e.innerHTML=r}class ct extends Event{constructor(t,e,n){super(t,n),this.detail={},Object.defineProperty(this,"detail",{value:e})}}var ut;!function(t){t.STATIC="STATIC",t.UPDATING="UPDATING"}(ut||(ut={}));class ht extends HTMLElement{constructor(){var o;super(),this.skipGameBlur=!0,this.construct=()=>{let t;const e=this.getAttribute(n("id")),o=this.getWidgetContainerNode();if(!o)throw new Error("Widget container not found in construct");const r=o.closest(`[${n("widget-id")}]`);let i;r&&(i=r.getAttribute(n("widget-id")));let s=new ct("cl-props-request",{nodeName:this.nodeName,path:this.getAttribute(n("path")),id:e,widgetId:i},{bubbles:!0,composed:!0});this.dispatchEvent(s),t=s.detail.props,Object.assign(this,t),this.observers=X(tt,et,nt),this.subscriptions=new class{constructor(){this.subscriptions=[]}push(t){this.subscriptions.push(t)}off(){this.subscriptions.forEach((t=>null==t?void 0:t.off()))}},this.state=new S({}),this.componentEventEmitter=new v,this.componentResourceManager=new Z(this.model.id,this.services.eventEmitter,this.isStaticRenderMode()),this.mergeTagsProcessor=this.services.mergeTagsProcessorFactory.create(),this._actionFactory=this.services.actionFactory,this._handlerFactory=new y(this._actionFactory,this.services.actionRegister),this.prevProps=this.model.props,this.prevEnvironment=this.getEnvironment(),this.documentModel.on(`COMPONENT_PROPS_UPDATE_${this.model.id}`,(t=>{this.model.props=t,this.observers.get(tt).forEach((e=>e(this.prevProps,t))),this.prevProps=t;const e=this.getHostElement(),o=n("floating");t.floating&&!e.getAttribute(o)?e.setAttribute(o,"true"):!t.floating&&e.getAttribute(o)&&e.removeAttribute(o)})),this.documentModel.on(`COMPONENT_UPDATE_${this.model.id}`,(t=>{Object.assign(this.model,t)})),this.documentModel.on("SHARED_UPDATE_ALL",(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles),this.observers.get(et).forEach((t=>t(this.getShared())))})),this.model.props.backgroundDynamicInlineSVGElements&&(this.colorSchemaListener=new V(this.documentModel,this.getHostElement(),(()=>this.getShared()),(()=>this.model.props),(()=>this.getEnvironment()),$),this.colorSchemaListener.apply(this.getEnvironment()).then((()=>{this.subscriptions.push(this.colorSchemaListener.on())}))),this.prevProps.adaptiveStyles&&this.subscriptions.push(this.resizeListener.on(x.changeEventName,(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles);const t=this.getEnvironment();this.observers.get(nt).forEach((e=>e(this.prevEnvironment,t))),this.prevEnvironment=t}))),this.subscriptions.push(this.services.eventEmitter.on("GAME_PHASE_READY_TO_PLAY",(()=>{this.skipGameBlur||this.getHostElement().classList.add("cl-game-spotlight-component")}))),this.subscriptions.push(this.services.eventEmitter.on("GAME_PHASE_COMPLETED",(()=>{this.skipGameBlur||this.getHostElement().classList.remove("cl-game-spotlight-component")})))},this.attachHandlers=()=>{this.getHandlers().map((t=>this._handlerFactory.get(t))).map((t=>()=>t.activate(this.state,this.componentEventEmitter,this.getHostElement.bind(this)))).forEach((t=>t()))},this.postponeHandlers=()=>{var t;null===(t=this.handlers)||void 0===t||t.forEach((t=>t.postpone()))},this.releaseHandlers=()=>{var t;null===(t=this.handlers)||void 0===t||t.forEach((t=>t.release()))},this.getProps=()=>{var t;return null===(t=this.getModel())||void 0===t?void 0:t.props},this.getShared=()=>this.documentModel.getShared(),this.getEnvironment=()=>this.resizeListener.isMobile()?"mobile":"desktop",this.isStaticRenderMode=()=>this.services.config.getConfig("renderMode")===ut.STATIC,this.isUpdatingRenderMode=()=>this.services.config.getConfig("renderMode")===ut.UPDATING,this.getRootElement=()=>this.shadowRoot?this.shadowRoot:this,this.getHostElement=()=>this,this.observeProps=t=>{this.observers.get(tt).push(t),t(null,this.prevProps)},this.observeShared=t=>{this.observers.get(et).push(t),t(this.getShared())},this.observeEnvironment=t=>{this.observers.get(nt).push(t),t(null,this.getEnvironment())},this.getElements=()=>[this.getHostElement(),...Array.from(this.getRootElement().querySelectorAll(`[${n("element")}]`)).filter((t=>!t.hasAttribute(n("component"))))],this.getElement=(t,e)=>this.getElements().find((o=>e?o.getAttribute(n("element"))===t&&o.id===e:o.getAttribute(n("element"))===t)),this.applyAutoAdaptiveStyles=(t,e)=>{if(!t&&!e)return;const o=this.getElements();if(!o.length)return;const r=function(t,e){if(!e)return t||{desktop:[],mobile:[]};const n=JSON.parse(JSON.stringify(t||{desktop:[],mobile:[]}));return e.forEach((t=>{const e=t.element;let o=!1,r=!1;n.desktop&&n.desktop.forEach((n=>{n.element===e&&(it(n,t),o=!0)})),n.mobile&&n.mobile.forEach((n=>{n.element===e&&(it(n,t),r=!0)})),!o&&n.desktop&&n.desktop.push(JSON.parse(JSON.stringify(t))),!r&&n.mobile&&n.mobile.push(JSON.parse(JSON.stringify(t)))})),n}(t,e),i=n("type"),s="element-styles";let a=this.getRootElement().querySelector(`style[${i}="${s}"]`);a||(a=document.createElement("style"),a.setAttribute(i,s),this.getRootElement().appendChild(a)),lt({element:a,html:""}),o.forEach((t=>{let e=t.getAttribute(n("element"));const o=this.getEnvironment();let i=at(r,o,e);if(i){if(this.resizeListener.isMobile()){const t=at(r,"desktop",e);t&&(i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},t.styleAttributes),i.styleAttributes)}))}this.applyStylesToElement(t,this.applySharedClassesToElementModel(i),a)}})),this._addLinkColor(a,this.getShared())},this.registerComponentResourceManagement=()=>{this.viewResourceManager.registerComponent(this.model.id,this.componentResourceManager)},this.applyStyles=(t,e={})=>{if(!t||!t.style)return!1;for(const[n,o]of Object.entries(e))t.style[n]=o;return!0},this.applyStylesToElement=(t,e,o)=>{var r,i;const s=[];"host"===(e=ht._resolveTogglableStylesForElementModel(e)).element&&(H.applyHostStyles(this.model.type,t,null,this.layoutType),("desktop"===this.getEnvironment()&&(null===(r=this.model.props.backgroundDynamicInlineSVGElements)||void 0===r?void 0:r.desktop)||"mobile"===this.getEnvironment()&&(null===(i=this.model.props.backgroundDynamicInlineSVGElements)||void 0===i?void 0:i.mobile))&&(this.colorSchemaListener.apply(this.getEnvironment()),s.push("background")));let a=e.styleAttributes.background,l=a&&a.match(/url\("([^"]*)"\)/);if(this.manifest.waitForResourcesLoad&&l){this.componentResourceManager.getPending().increment();const t=new Image;t.src=l[1],O(t,"load",(()=>{this.componentResourceManager.getPending().decrement()})),O(t,"error",(()=>{this.componentResourceManager.onResourceLoadFailure(t.src),this.isUpdatingRenderMode&&this.componentResourceManager.getPending().decrement()}))}const c=Object.assign(Object.assign({},e),{styleAttributes:K(e.styleAttributes,s)});if(W.set(t,c),this._setClassAttributes(t,e),o){if(e.hoverStyleAttributes){let r=Object.assign({},e.hoverStyleAttributes);if("FILL_UP"===e.hoverAnimationType){t.style.boxShadow="inset 0px 0px 0px 0px rgb(0, 0, 0, 0)",t.style.overflow="hidden";const n=t.tagName.toLowerCase(),o=`flip-up-animation-${e.element}`;let i=this.getRootElement().querySelector(`#${o}`);i||(i=document.createElement("style"),i.id=o,t.appendChild(i)),lt({element:i,html:`\n ${n}::before {\n content: '';\n background: ${r.background};\n position: absolute;\n left: 0;\n top: ${t.getBoundingClientRect().height}px;\n height: ${t.getBoundingClientRect().height}px;\n width: 100%;\n z-index: -10;\n }\n ${n}:hover::before {\n top: 0;\n transition: 0.3s;\n }\n `}),r=Object.assign(Object.assign({},e.hoverStyleAttributes),{background:"transparent",position:"relative"})}r.borderTopWidth&&"0px"!==r.borderTopWidth||delete r.borderTopColor,r.borderBottomWidth&&"0px"!==r.borderBottomWidth||delete r.borderBottomColor,r.borderLeftWidth&&"0px"!==r.borderLeftWidth||delete r.borderLeftColor,r.borderRightWidth&&"0px"!==r.borderRightWidth||delete r.borderRightColor,this._addStylesToStyleElement(o,e.element,r,`:not(.${n("no-hover")}):hover`,!0)}e.placeholderStyleAttributes&&this._addStylesToStyleElement(o,e.element,e.placeholderStyleAttributes,"::placeholder"),this._addFontStylesToStyleElement(o,this.getShared()),this.stylesAppliedToElement(t,e,o)}},this.applySharedClassesToElementModel=e=>function(e,n){let o=e;return(o.classes||"").split(" ").filter((e=>e.startsWith(t))).forEach((t=>{var e;let r=null===(e=n.textClasses)||void 0===e?void 0:e[t];r&&(r.styleAttributes.fontFamily||(r.isHeader&&n.headerFontFamily&&(r=Object.assign(Object.assign({},r),{styleAttributes:Object.assign(Object.assign({},r.styleAttributes),{fontFamily:n.headerFontFamily})})),!r.isHeader&&n.textFontFamily&&(r=Object.assign(Object.assign({},r),{styleAttributes:Object.assign(Object.assign({},r.styleAttributes),{fontFamily:n.textFontFamily})}))),o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},o.styleAttributes),r.styleAttributes),placeholderStyleAttributes:Object.assign(Object.assign({},o.placeholderStyleAttributes),r.placeholderStyleAttributes)}))})),o.styleAttributes.fontFamily||(o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},o.styleAttributes),{fontFamily:n.textFontFamily})})),o}(e,this.documentModel.getShared()),this.getModel=()=>this.model,this._addStylesToStyleElement=(t,e,o,r="",i)=>{const s=Object.keys(o).reduce(((t,e)=>t+` ${z.camelCaseToDashCase(e)}: ${o[e]}${i?" !important;":";"}`),"");lt({element:t,html:`[${n("element")}="${e}"]${r} { ${s} }`,appendHtml:!0})},this._addFontStylesToStyleElement=(t,e)=>{lt({element:t,html:`[cl-type] {font-family:${e.textFontFamily||"inherit"}}`,appendHtml:!0})},this._addLinkColor=(t,e)=>{var n,o,r,i;e.linkColor&&lt({element:t,html:`a {color: ${e.linkColor}}, a:visited {color: ${e.linkColor}}`,appendHtml:!0}),(null===(n=e.linkParams)||void 0===n?void 0:n.color)&&lt({element:t,html:`a {color: ${null===(o=e.linkParams)||void 0===o?void 0:o.color}}, a:visited {color: ${null===(r=e.linkParams)||void 0===r?void 0:r.color}}`,appendHtml:!0}),(null===(i=e.linkParams)||void 0===i?void 0:i.removeUnderline)&&lt({element:t,html:"a {text-decoration: none}, a:visited {text-decoration: none}",appendHtml:!0})},this._setClassAttributes=(n,o)=>{Array.from(n.classList).filter((t=>t!==e("hovered")&&t!==e("focused"))).forEach((e=>{e.startsWith(t)&&n.classList.remove(e)}));const r=((n.getAttribute("class")||"")+" "+o.classes).trim();n.setAttribute("class",r)},this.getParentComponent=()=>ot(this.parentNode,n("element"),"host"),this.getWidgetContainerNode=()=>{const t=null==this?void 0:this.getAttribute(n("path"));return 1===(null==t?void 0:t.split(",").length)?this.parentNode:ot(this.parentNode,n("path"),void 0,(t=>1===(null==t?void 0:t.split(",").length)))},this.getWidgetLanguages=()=>function(t){return[t.getConfig("appearanceLanguage"),t.getConfig("browserLanguage"),"en"].filter((t=>!!t))}(this.services.config),this.getPreferredWidgetLanguage=()=>this.getWidgetLanguages()[0],this.getTranslationsMap=t=>function(t,e){return e.reduce(((e,n)=>{if(e)return e;const o=function(t,e){if(!t)return null;if(e[t])return{translations:e[t],language:t};const n=function(t){return t.includes("-")?t.split("-")[0].toLowerCase():t.includes("_")?t.split("_")[0].toLowerCase():t}(t);return e[n]?{translations:e[n],language:n}:null}(n,t);return o||null}),null)}(t,this.getWidgetLanguages()),this.stylesAppliedToElement=(t,e,n)=>{},this.updateContext=()=>{var t;const e=this.getModel();this.services.context.updateRecord(e.id,{label:this.getContextRecordLabel(e.props),viewIndex:null===(t=e.path)||void 0===t?void 0:t[0]})},this.addContextRecord=()=>{var t;const e=this.getModel();this.services.context.addRecord(e.id,{recordKey:e.id,id:e.props.control.name,label:this.getContextRecordLabel(e.props),value:e.props.control.defaultValue||"",viewIndex:null===(t=e.path)||void 0===t?void 0:t[0],sourceId:"FORM",initialData:{fallbackValue:"",exampleValue:this.getContextRecordExampleValue(e.props)}})},this.getContextRecordLabel=t=>{var e,n,o,r,i,s;const a=t.control.name;if(["email","first_name","last_name"].includes(a))return a.toUpperCase();if((null===(e=t.content)||void 0===e?void 0:e.label)&&(null===(r=null===(o=null===(n=t.adaptiveStyles)||void 0===n?void 0:n.desktop.find((t=>"label"===t.element)))||void 0===o?void 0:o.params)||void 0===r?void 0:r.enabled)){const e=(new DOMParser).parseFromString(t.content.label,"text/html");return this.capitalizeFirstLetter(e.body.textContent||"")}return(null===(i=t.content)||void 0===i?void 0:i.placeholder)?this.capitalizeFirstLetter(t.content.placeholder):(null===(s=t.control)||void 0===s?void 0:s.integrationName)?this.capitalizeFirstLetter(t.control.integrationName).replace(new RegExp("_","g")," "):void 0},this.capitalizeFirstLetter=t=>t.charAt(0).toUpperCase()+t.slice(1),this.getContextRecordExampleValue=t=>{var e;switch(null===(e=t.control)||void 0===e?void 0:e.name){case"email":return"myemail@example.com";case"first_name":return"Maria";case"last_name":return"Taylor";default:return this.getContextRecordLabel(t)}},this.completeSubmitAction=t=>{const e=t||{},n=this.services.actionRegister.getRegisteredActions().find((t=>t.category===rt));n?null==n||n.execute(void 0,void 0,!0,e):this.services.actionFactory.get({type:p.REQUEST}).execute(void 0,void 0,!0,e)},this.getHandlers=()=>{var t;return(null===(t=this.getProps())||void 0===t?void 0:t.handlers)&&this.getProps().handlers.length?[...this.getProps().handlers]:[]},this.assets=(t="")=>`${this.services.config.getConfig("staticResourcesUrl").replace(/\/$/,"")}/${this.manifest.name}/assets${t?`/${t}`:""}`,this.attachShadow({mode:"open"}),this.manifest=this.manifest||(null===(o=this.constructor.define)||void 0===o?void 0:o.manifest)}connectedCallback(){this.construct(),this.registerComponentResourceManagement(),Promise.resolve().then((()=>{this.attachHandlers()}));const t=document.createElement("style");t.textContent='\n :host(.cl-game-spotlight-component)::after {\n content: "";\n position: absolute;\n background-size: 100% 100%;\n background-repeat: no-repeat;\n overflow: visible;\n \n backdrop-filter: blur(4px);\n \n inset: -30px;\n mask-image: \n linear-gradient(to bottom, transparent, grey 30px, grey calc(100% - 30px), transparent),\n linear-gradient(to right, transparent, grey 30px, grey calc(100% - 30px), transparent);\n mask-composite: intersect;\n -webkit-mask-composite: source-in; /* for Chrome/Safari */\n \n transition: opacity 0.35s ease;\n pointer-events: auto;\n }\n ',this.getRootElement().prepend(t)}disconnectedCallback(){var t;this.observers.clear(),this.subscriptions.off(),this.state.destroy(),this.componentEventEmitter.destroy(),null===(t=this.mergeTagsProcessor)||void 0===t||t.destroy()}}ht._resolveTogglableStylesForElementModel=t=>{const e=Object.assign({},t);return Object.keys(e).forEach((t=>{t.toLowerCase().includes("styleattributes")&&(e[t]=ht._resolveTogglableStyles(e[t]))})),e},ht._resolveTogglableStyles=t=>{const e=Object.assign({},t),n=(t,n,o)=>{n in e&&(t.forEach((t=>{t in e&&(e[t]=e[n]?e[t]:o)})),delete e[n])};return n(["marginTop","marginBottom","marginLeft","marginRight"],"_marginEnabled","0px"),n(["paddingTop","paddingBottom","paddingLeft","paddingRight"],"_paddingEnabled","0px"),e};const pt=ht;var dt={FOLLOW:"FOLLOW",SHARE:"SHARE"},mt={FACEBOOK:"FACEBOOK",INSTAGRAM:"INSTAGRAM",LINKEDIN:"LINKEDIN",TWITTER:"TWITTER",CUSTOM:"CUSTOM",EMAIL:"EMAIL",PINTEREST:"PINTEREST",WHATSAPP:"WHATSAPP"},gt={ROUNDED:"ROUNDED"};function ft(t){return ft="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ft(t)}function yt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,Et(o.key),o)}}function Et(t){var e=function(t){if("object"!=ft(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ft(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ft(e)?e:e+""}var bt=function(){return function(t,e){return e&&yt(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.imgPath="".concat(e.replace(/\/$/,""),"/img")}),[{key:"getValidPlatformName",value:function(t){return mt[t.type]?t.type:mt.CUSTOM}},{key:"getValidIconMode",value:function(t){return(gt[t.mode]?t.mode:gt.ROUNDED).toLowerCase()}},{key:"getDefaultImage",value:function(){return"".concat(this.imgPath,"/image-placeholder.svg")}},{key:"getPlatformImageUrl",value:function(t){if(t.image)return t.image;var e=this.getValidPlatformName(t);if(e===mt.CUSTOM)return this.getDefaultImage();var n="".concat(e.toLowerCase(),"-logo"),o=this.getValidIconMode(t),r=o?"-".concat(o):"";return"".concat(this.imgPath,"/").concat(n).concat(r,".svg")}}])}();const vt={name:"SysSocialComponent",componentType:"SOCIAL",version:"1.0.0",events:{dispatch:[],listen:[]},contextMenuModel:function(t){return Object.values(st).map((e=>({type:"GROUP",propPath:["adaptiveStyles",e],children:t})))}([{type:"CONTROL",name:"COMPONENT_OPERATIONS"},{type:"CONTROL",name:"BRING_BACK_FORWARD",element:"host",elementProp:"styleAttributes",elementSubProp:"zIndex"},{type:"CONTROL",name:"FOCUS_PARENT_COMPONENT"}]),propertyPaneModel:{content:[{type:"GROUP",propPath:["adaptiveStyles","desktop"],children:[{type:"CONTROL",name:"SOCIAL_ICON_SIZE",propPath:["control","size","desktop"]},{type:"CONTROL",name:"SOCIAL_TYPE_AND_ICON_SELECT",propPath:["control"]}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"SOCIAL_ICON_SIZE",propPath:["control","size","mobile"]},{type:"CONTROL",name:"SOCIAL_TYPE_AND_ICON_SELECT",propPath:["control"]}]}],general:[{type:"CONTROL",name:"ACTIONS",propPath:["handlers"],params:{origin:!0}}]},i18nPropertyPaneModel:{content:[{type:"CONTROL",name:"ACTIONS",propPath:["handlers"],params:{origin:!1}}]},i18nPropPaths:["content,text","handlers,[id],actions,[id],params,link","handlers,[id],actions,[id],params,customData"],props:{control:{options:[{type:"FACEBOOK",order:0},{type:"INSTAGRAM",order:1},{type:"LINKEDIN",order:2},{type:"TWITTER",order:3}],mode:"FOLLOW",size:{desktop:32,mobile:32}},adaptiveStyles:{desktop:[{element:"host",styleAttributes:{}}],mobile:[{element:"host",styleAttributes:{}}]}},metaDescription:{icon:"/SysSocialComponent/assets/img/social-component-icon.svg",label:{en:"Social",ru:"Социальные сети",uk:"Соціальні мережі",es:"Social",de:"Social",fr:"Social",it:"Social",pt:"Social",ro:"Social",bg:"Social",cs:"Social",el:"Social",nl:"Social",pl:"Social",sv:"Social",tr:"Social",ar:"Social",zh:"社群媒体",da:"Social",he:"Social",fi:"Social",hi:"Social",hr:"Social",hu:"Social",id:"Social",ja:"Social",ko:"Social",no:"Social",sk:"Social",sl:"Social",sr:"Social"}},syncEnabled:!0,stylesImitationEnabled:!0};function Ot(t){return Ot="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ot(t)}function St(t,e,n){return(e=function(t){var e=function(t){if("object"!=Ot(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ot(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ot(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Tt(t){var e=t&&t.type;return Boolean(e)}function Ct(t){return Ct="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ct(t)}function _t(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function At(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?_t(Object(n),!0).forEach((function(e){Nt(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):_t(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Nt(t,e,n){return(e=function(t){var e=function(t){if("object"!=Ct(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ct(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ct(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function It(t){var e,n,o,r,i=function(t){Array.isArray(t.options)||(console.warn("SysSocial: options should be an array, setting default value"),t.options=[]);var e=t.options.filter(Tt);return e.length!==t.options.length&&(console.error("SysSocial: options contain invalid platforms, filtering them out"),t.options=e),Object.values(dt).includes(t.mode)||(console.error("SysSocial: mode is invalid, setting default value"),t.mode=dt.FOLLOW),"object"!==Ct(t.size)&&Number.isNaN(Number(t.size))&&(console.error("SysSocial: size should be a number, setting default value"),t.size=32),"string"!=typeof t.size&&"number"!=typeof t.size||(console.warn("SysSocial: migrating size from primitive to object"),t.size={desktop:t.size,mobile:t.size}),t}(At({},null==t?void 0:t.control));return i.mode===dt.SHARE&&(i.options=(n=(e=i).options,o=e.shareUrl,r="INTERNAL"===e.shareUrlType?window.location.href:o,n.reduce((function(t,e){var n=function(t){return t?St(St(St(St(St(St({},mt.FACEBOOK,(function(t){var e=t.url;return"https://www.facebook.com/sharer/sharer.php?u=".concat(e)})),mt.LINKEDIN,(function(t){var e=t.url;return"https://www.linkedin.com/sharing/share-offsite/?url=".concat(e)})),mt.TWITTER,(function(t){var e=t.url;return"https://twitter.com/intent/tweet?url=".concat(e)})),mt.PINTEREST,(function(t){var e=t.url;return"https://www.pinterest.com/pin/create/button/?url=".concat(e)})),mt.WHATSAPP,(function(t){var e=t.url;return"https://wa.me/?text=".concat(e)})),mt.EMAIL,(function(t){var e=t.url,n=t.subject,o=void 0===n?"":n;return"mailto:?body=".concat(e,"&subject=").concat(o)}))[t.type]:null}(e);return n&&t.push(At(At({},e),{},{url:n(At({url:r},e.props))})),t}),[]))),i}function Lt(t){const{element:e,html:n,appendHtml:o}=t,r=function(t){if(null==t)return"";if("string"!=typeof t)return String(t);if(""===t)return"";if(!/<\/?([a-zA-Z][a-zA-Z0-9]*)\b[^>]*>/.test(t))return t;const e=(new DOMParser).parseFromString(t,"text/html");return e.querySelectorAll('script, style, link[rel="stylesheet"], meta[http-equiv]').forEach((t=>t.remove())),e.querySelectorAll("*").forEach((t=>{if(["onclick","onload","onerror","onmouseover","onfocus","onblur","onkeyup","onkeydown","onchange","onsubmit","onmouseenter","onmouseleave","onmouseout","oncontextmenu","ondrag","ondrop"].forEach((e=>t.removeAttribute(e))),Array.from(t.attributes).forEach((e=>{e.name.startsWith("on")&&t.removeAttribute(e.name)})),"A"===t.tagName||"AREA"===t.tagName){const e=t.getAttribute("href");e&&(e.startsWith("javascript:")||e.startsWith("data:"))&&t.removeAttribute("href")}if("IMG"===t.tagName||"IFRAME"===t.tagName){const e=t.getAttribute("src");e&&(e.startsWith("javascript:")||e.startsWith("data:text/html"))&&t.removeAttribute("src")}if("FORM"===t.tagName){const e=t.getAttribute("action");e&&e.startsWith("javascript:")&&t.removeAttribute("action")}})),e.body.innerHTML}(n);o?e.innerHTML+=r:e.innerHTML=r}function Pt(t){return Pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pt(t)}function Rt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=Array(e);n<e;n++)o[n]=t[n];return o}function Mt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,xt(o.key),o)}}function wt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(wt=function(){return!!t})()}function Ut(){return Ut="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var o=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=jt(t)););return t}(t,e);if(o){var r=Object.getOwnPropertyDescriptor(o,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},Ut.apply(null,arguments)}function jt(t){return jt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},jt(t)}function kt(t,e){return kt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},kt(t,e)}function Dt(t,e,n){return(e=xt(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function xt(t){var e=function(t){if("object"!=Pt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Pt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Pt(e)?e:e+""}var Ft=function(){function t(){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Dt(e=function(t,e,n){return e=jt(e),function(t,e){if(e&&("object"==Pt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,wt()?Reflect.construct(e,n||[],jt(t).constructor):e.apply(t,n))}(this,t),"createContent",(function(t){var n=e.getElement("social"),o=It(t),r=n.querySelector(".items-wrapper");r?e._renderItemsForExistingComponent(r,o):e._renderItemsForEmptyComponent(n,o)})),Dt(e,"_renderItemsForEmptyComponent",(function(t,n){var o=document.createElement("div");o.classList.add("items-wrapper"),e.addItemsContent(o,n),Lt({element:t,html:""}),t.append(o)})),Dt(e,"_renderItemsForExistingComponent",(function(t,n){var o={};n.options.forEach((function(r){var i=e.getPlatformKey(r),s=t.querySelector('[key="'.concat(i,'"]'));o[i]=s?e._updatePlatformComponent(s,r,n):e._createNewPlatformComponent(t,r,n),e._setPlatformStyles(o[i],r)}));var r,i=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Rt(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Rt(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var o=0,r=function(){};return{s:r,n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){a=!0,i=t},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw i}}}}(t.children);try{for(i.s();!(r=i.n()).done;){var s=r.value,a=s.getAttribute("key");o[a]||t.removeChild(s)}}catch(t){i.e(t)}finally{i.f()}})),Dt(e,"_updatePlatformComponent",(function(t,n,o){var r=t.querySelector("img"),i=e.urlManager.getPlatformImageUrl(n);r.src!==i&&(r.src=i);var s=o.size[e.getEnvironment()];return s!==r.width&&(r.height=s,r.width=s),t})),Dt(e,"_createNewPlatformComponent",(function(t,n,o){var r=e.createPlatformComponent(n,o);return t.append(r),r})),Dt(e,"addItemsContent",(function(t,n){return t.classList.add("social-list"),n.options.forEach((function(o){t.append(e.createPlatformComponent(o,n))})),t})),Dt(e,"createPlatformComponent",(function(t,n){var o,r=n.size,i=t.url;i?((o=document.createElement("a")).setAttribute("href",i||"#"),o.setAttribute("target","_blank")):o=document.createElement("div"),o.classList.add("social-list-item"),o.setAttribute("key",e.getPlatformKey(t)),e._setPlatformStyles(o,t);var s=e.urlManager.getPlatformImageUrl(t),a=r[e.getEnvironment()],l=document.createElement("img");return l.src=s,l.height=a,l.width=a,Lt({element:o,html:""}),o.appendChild(l),o})),Dt(e,"getPlatformKey",(function(t){return"".concat(t.type,"-").concat(t.order)})),Dt(e,"_setPlatformStyles",(function(t,e){t.setAttribute("style","order:".concat(e.order))})),Dt(e,"manifest",vt),e.getRootElement().innerHTML="\n <style>".concat(t.componentStyle,"</style>\n ").concat(t.componentTemplate,"\n "),e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&kt(t,e)}(t,pt),function(t,e){return e&&Mt(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(t,[{key:"connectedCallback",value:function(){var e=this;!function(t,e,n){var o=Ut(jt(t.prototype),"connectedCallback",n);return"function"==typeof o?function(t){return o.apply(n,t)}:o}(t,0,this)([]),this.urlManager=new bt(this.assets()),this.observeProps((function(t,n){e.createContent(n),e.applyAutoAdaptiveStyles(n.adaptiveStyles)})),this.observeEnvironment((function(){var t=e.getProps();e.createContent(t),e.applyAutoAdaptiveStyles(t.adaptiveStyles)}))}}])}();Dt(Ft,"define",{name:"sys-social",model:vt.name,manifest:vt}),Dt(Ft,"componentStyle","\n .social-list {\n display: flex;\n gap: 10px;\n }\n \n .social-list-item {\n display: flex;\n }\n"),Dt(Ft,"componentTemplate",'\n <div class="social-container">\n <div cl-element="social" class="social-list-content">\n </div>\n </div>\n');export{Ft as default};window.clComponentClass_SysSocialComponent=Ft;
1
+ const t="cl-";function e(e){return t+e}function n(t){return"cl-"+t}const o="VIEW",r="MODULE",i="CONTAINER",s="INPUT",a="BUTTON",l="CONSENT",c="COLUMN";var u,h;(h=u||(u={})).SUBSCRIBE_CONTACT="SUBSCRIBE_CONTACT",h.REQUEST="REQUEST",h.DISPATCH_EVENT="DISPATCH_EVENT",h.GO_TO_VIEW="GO_TO_VIEW",h.GO_TO_PREVIOUS_VIEW="GO_TO_PREVIOUS_VIEW",h.GO_TO_NEXT_VIEW="GO_TO_NEXT_VIEW",h.SHOW_WIDGET="SHOW_WIDGET",h.OPEN_LINK="OPEN_LINK",h.CLOSE_WIDGET="CLOSE_WIDGET",h.CLICK="CLICK";const p=u;var d,m;class g{static sortActions(t){const e={[p.CLOSE_WIDGET]:-1,[p.OPEN_LINK]:-2,[p.SHOW_WIDGET]:1,[p.SUBSCRIBE_CONTACT]:2,[p.REQUEST]:3},n=t=>void 0!==e[t.type]?e[t.type]:0;return[...t].sort(((t,e)=>n(t)>n(e)?-1:n(t)<n(e)?1:0))}constructor(t,e){this.config=t,this.actions=g.sortActions(e),this.listener=null,this.targetElements=[],this.eventsQueue=[],this.state=null,this.postponed=!1}activate(t,e,o){this.state=t;const r=o(),i=r.getAttribute(n("id"));this.listener=t=>{const e=t.composedPath().filter((t=>t instanceof HTMLElement&&t.getAttribute(n("type"))));let o=0;for(;e[o]&&e[o].getAttribute(n("id"))!==i;){let t=e[o].getAttribute(n("type"));if(g.IGNORING_VIEW_ENTRY_TYPES.includes(t))return;o++}this.eventsQueue.push({event:t}),this.postponed||this.execute()},this.targetElements=this.config.relativeSelector?Array.from((r.shadowRoot||r).querySelectorAll(this.config.relativeSelector)):[r],this.targetElements.forEach((t=>{t.addEventListener("click",this.listener)}))}async execute(){var t,e,n,o;try{for(var r,i=!0,s=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t="function"==typeof __values?__values(t):t[Symbol.iterator](),e={},o("next"),o("throw"),o("return"),e[Symbol.asyncIterator]=function(){return this},e);function o(n){e[n]=t[n]&&function(e){return new Promise((function(o,r){!function(t,e,n,o){Promise.resolve(o).then((function(e){t({value:e,done:n})}),e)}(o,r,(e=t[n](e)).done,e.value)}))}}}(this.eventsQueue);!(t=(r=await s.next()).done);i=!0){o=r.value,i=!1;const{event:t}=o;for(const e of this.actions)if(!await e.execute(this.state.getState(),t))break}}catch(t){e={error:t}}finally{try{i||t||!(n=s.return)||await n.call(s)}finally{if(e)throw e.error}}this.eventsQueue=[]}postpone(){this.postponed=!0}release(){this.postponed=!1,this.execute()}destroy(){this.listener&&this.targetElements.length&&(this.targetElements.forEach((t=>{t.removeEventListener("click",this.listener)})),this.targetElements=[])}}g.IGNORING_VIEW_ENTRY_TYPES=[a,l,s],(m=d||(d={})).CLICK="CLICK",m.COMPONENT_EVENT="COMPONENT_EVENT";class f{constructor(t,e){this.config=t,this.actions=e,this.componentEmitterListener=null}activate(t,e,n){this.componentEmitterListener=e.on(this.config.eventName,(()=>{this.actions.forEach((e=>e.execute(t.getState(),this.config.params)))}))}destroy(){this.componentEmitterListener&&this.componentEmitterListener.off()}}class E{constructor(t,e){this.actionFactory=t,this.actionRegister=e}get(t){const e=t.actions.map((t=>this.actionFactory.get(t)));switch(e.forEach((t=>this.actionRegister.register(t))),t.type){case d.CLICK:return new g(t,e);case d.COMPONENT_EVENT:return new f(t,e);default:throw new Error(`Not supported handler type ${t.type}`)}}}class b{static generate(){let t,e="";for(let n=0;n<32;n++)8!==n&&12!==n&&16!==n&&20!==n||(e+="-"),t=Math.floor(16*Math.random()).toString(16).toUpperCase(),e+=t;return e}}class y{constructor(){this.listeners=y.createDefaultListenersState()}emit(t,e,n=null){const o=this.listeners[t];o&&Object.values(o).forEach((o=>o(e,t,n))),Object.values(this.listeners["*"]).forEach((o=>o(e,t,n)))}on(t,e){const n=b.generate(),o=this.listeners[t];return o?o[n]=e:this.listeners[t]={[n]:e},{off:()=>{var e,o;(null===(o=null===(e=this.listeners)||void 0===e?void 0:e[t])||void 0===o?void 0:o[n])&&delete this.listeners[t][n]}}}destroy(){this.listeners=y.createDefaultListenersState()}}y.createDefaultListenersState=()=>({"*":{}});const v=y,O=(t,e,n,o)=>{const r=EventTarget.prototype,{addEventListenerBase:i,addEventListener:s}=r;(i||s).call(t,e,n,o)};class S{constructor(t){this.state=t||{}}getState(){return this.state}setState(t){this.state=Object.assign(Object.assign({},this.state),t)}destroy(){}}class T{static extract(t){const e=t.views.map((t=>{const e=t.children.map((t=>t.type===r?Object.assign(Object.assign({},t),T.moduleToContainerParams):t));return Object.assign(Object.assign({},t),{children:e})}));return Object.assign(Object.assign({},t),{views:e})}static sort(t,e){return t.index>e.index?1:-1}static reIndex(t,e){return Object.assign(Object.assign({},t),{index:e+t.index})}}var A,C,_,I,N,L,P,R,M,w,U,k,j;T.moduleToContainerParams={name:"SysContainerComponent",version:"1.0.0"},(C=A||(A={})).VIEW="VIEW",C.CONTAINER="CONTAINER",C.TEXT="TEXT",C.INPUT="INPUT",C.BUTTON="BUTTON",C.IMAGE="IMAGE",C.CONSENT="CONSENT",C.COUNTDOWN_TIMER="COUNTDOWN_TIMER",C.PROMO_CODE="PROMO_CODE",C.MULTIPLE_INPUT="MULTIPLE_INPUT",C.VIDEO="VIDEO",C.SLIDER="SLIDER",C.SLIDE="SLIDE",C.SOCIAL="SOCIAL",C.COLUMNS="COLUMNS",C.COLUMN="COLUMN",C.PRIZE_BASED_GAMING="PRIZE_BASED_GAMING",(_||(_={})).CLICK="CLICK",function(t){t.SHOW_WIDGET="SHOW_WIDGET",t.OPEN_LINK="OPEN_LINK",t.SUBSCRIBE_CONTACT="SUBSCRIBE_CONTACT",t.REQUEST="REQUEST",t.CLOSE_WIDGET="CLOSE_WIDGET",t.GO_TO_VIEW="GO_TO_VIEW",t.GO_TO_PREVIOUS_VIEW="GO_TO_PREVIOUS_VIEW",t.GO_TO_NEXT_VIEW="GO_TO_NEXT_VIEW",t.CLICK="CLICK"}(I||(I={})),function(t){t.SELF="_self",t.BLANK="_blank"}(N||(N={})),(L||(L={})).ACCENT="accent",function(t){t.TOP="TOP",t.CENTER="CENTER",t.BOTTOM="BOTTOM"}(P||(P={})),function(t){t.LEFT="LEFT",t.CENTER="CENTER",t.RIGHT="RIGHT"}(R||(R={})),function(t){t.SLIDE_TO_TOP="SLIDE_TO_TOP",t.SLIDE_TO_BOTTOM="SLIDE_TO_BOTTOM",t.SLIDE_TO_LEFT="SLIDE_TO_LEFT",t.SLIDE_TO_RIGHT="SLIDE_TO_RIGHT"}(M||(M={})),function(t){t.PULSE="PULSE",t.VIBRATE="VIBRATE",t.WOBBLE="WOBBLE",t.SHAKE="SHAKE",t.JELLO="JELLO",t.BOUNCE="BOUNCE",t.BLINK="BLINK",t.FLICKER="FLICKER",t.PING="PING"}(w||(w={})),function(t){t.LEFT="LEFT",t.RIGHT="RIGHT"}(U||(U={})),(j=k||(k={})).BEFORE="BEFORE",j.AFTER="AFTER",j.INSIDE="INSIDE",j.INSTEAD="INSTEAD";class D extends v{constructor(t,e){super(),this.config=e,this.handleMobileBreakpoint(t.getShared().mobileBreakpointWidth),t.on("ENVIRONMENT_UPDATE",(({isMobileEnv:t})=>{this._isMobile=t,this.emit(D.changeEventName,this._isMobile)}))}handleMobileBreakpoint(t){this.mobileBreakpointWidth=t;const e=Number.isInteger(this.mobileBreakpointWidth)?`${this.mobileBreakpointWidth}px`:this.mobileBreakpointWidth;this.mediaQueryList=window.matchMedia(`(max-width: ${e})`),this.mediaQueryList.addListener(this.listener.bind(this)),this._isMobile=this.mediaQueryList.matches,this.emit(D.changeEventName,this._isMobile)}isMobile(){return this.config.forceMobileEnv||this._isMobile}listener(t){this._isMobile=t.matches,this.emit(D.changeEventName,this._isMobile)}destroy(){super.destroy(),this.mediaQueryList.removeListener(this.listener.bind(this))}}D.changeEventName="CHANGE";const F=D;class x{static set(t,e){const n=t[x.accumulatorPropertyName]||{};t[x.accumulatorPropertyName]=Object.assign(Object.assign({},n),e.styleAttributes),Object.keys(t[x.accumulatorPropertyName]).forEach((n=>{n.includes("--")?t.style.setProperty(n,e.styleAttributes[n]||""):t.style[n]=e.styleAttributes[n]?e.styleAttributes[n]:""}))}}x.accumulatorPropertyName="clStyleAttributes";const W=x;var B;!function(t){t.BUILT_IN="BUILT_IN",t.DETACHED="DETACHED",t.FLOATING_BOX="FLOATING_BOX",t.FLOATING_BAR="FLOATING_BAR",t.LAUNCHER="LAUNCHER",t.CONTENT_LOCKER="CONTENT_LOCKER"}(B||(B={}));class H{static applyHostStyles(t,e,n=null,r){var s,a,l;const u=null===(a=null===(s=null==n?void 0:n.props)||void 0===s?void 0:s.handlers)||void 0===a?void 0:a.find((t=>"CLICK"===t.type));u&&(null===(l=u.actions)||void 0===l?void 0:l.length)&&(e.style.cursor="pointer"),t!==o&&t!==i&&t!==c||(e.style.display=r===B.CONTENT_LOCKER&&t===o?"flex":"inline-flex",e.style.position="relative"),e.style.boxSizing="border-box"}constructor(){this.styles="/* common styles */ *, *:before, *:after { box-sizing: border-box; font-family: inherit; }"}setStyles(t=""){this.styles=`${this.styles} ${t}`}getStyles(){return this.styles}}class G{static log(t){window.scriptLog09u8y9?scriptLog09u8y9("ERROR","RUNTIME_ERROR",new Error(t)):console.error(t)}}class V{constructor(t,e,n,o,r,i){this.hostElement=e,this.documentModel=t,this.getSharedCb=n,this.getPropsCb=o,this.getEnvCb=r,this.httpClient=i,this.schemaSubscription=null,this.themeSubscription=null,this.envUrlMaps={desktop:new Map,mobile:new Map}}parseBackground(t){const e=String(t||"");if(e.includes("url")){const[t,n]=e.split("(")[1].split(")");return{url:t.replace(/['"]+/g,""),positionOptions:n.replace(";","")}}return{url:null,positionOptions:null}}apply(t){const e=this.getPropsCb();return e.backgroundDynamicInlineSVGElements[t].forEach((n=>{var o,r,i,s,a;const l=null===(r=null===(o=e.adaptiveStyles)||void 0===o?void 0:o[t])||void 0===r?void 0:r.find((t=>t.element===n)),c=(null===(i=e.styles)||void 0===i?void 0:i.find((t=>t.element===n)))||{},u=(null===(s=null==c?void 0:c.styleAttributes)||void 0===s?void 0:s.background)||(null===(a=null==l?void 0:l.styleAttributes)||void 0===a?void 0:a.background),h=this.parseBackground(u);h.url&&this.envUrlMaps[t].set(n,{originalSVGResourceURL:h.url,inlineSvgString:null,positionOptions:h.positionOptions})})),Promise.all([...this.envUrlMaps[t].entries()].map((([e,n])=>this.httpClient.execute(n.originalSVGResourceURL).then((t=>t.text())).then((o=>{this.envUrlMaps[t].set(e,Object.assign(Object.assign({},n),{inlineSvgString:o}))}))))).then((()=>{var e;const n=this.getSharedCb();return Object.keys((null===(e=n.theme)||void 0===e?void 0:e.schema)||{}).length>0?this._applyHostElementBackgroundFromTheme(this.envUrlMaps[t].get("host"),n.theme.schema):this._applyHostElementBackgroundFromCssVars(this.envUrlMaps[t].get("host"),n.cssVars)})).catch((t=>{console.error(t),G.log(`Failed to load/apply backgroundDynamicInlineSVGElements[${this.getPropsCb().backgroundDynamicInlineSVGElements}] ${t}`)}))}on(){return this.schemaSubscription=this.documentModel.on("COLOR_SCHEMA_UPDATE",(t=>{this._applyHostElementBackgroundFromCssVars(this.envUrlMaps[this.getEnvCb()].get("host"),t)})),this.themeSubscription=this.documentModel.on("THEME_UPDATE",(t=>{this._applyHostElementBackgroundFromTheme(this.envUrlMaps[this.getEnvCb()].get("host"),t.schema)})),this}_applyHostElementBackgroundFromCssVars(t,e){t&&e&&(this.hostElement.style.background=this._buildBackgroundUrlFromCssVars(t,e))}_applyHostElementBackgroundFromTheme(t,e){t&&e&&(this.hostElement.style.background=this._buildBackgroundUrlFromTheme(t,e))}_buildBackgroundUrlFromCssVars(t,e){const n=t.inlineSvgString.trim().replace("var(--cl-schema-accent)",e["cl-schema-accent"]);return`url('data:image/svg+xml,${encodeURIComponent(n)}')${t.positionOptions}`}_buildBackgroundUrlFromTheme(t,e){const n=t.inlineSvgString.trim();let o=n;return[...n.matchAll(/var\(--cl-schema-([^)]+)\)/g)].forEach((t=>{const n=function(t=""){return t.replace(/var\(\s*(--[^,\s)]+).*\)/,"$1").replace("--cl-schema-","")}(t[1]);var r;o=o.replace(`var(--${r=n,`cl-schema-${r}`})`,e[n])})),`url('data:image/svg+xml,${encodeURIComponent(o)}')${t.positionOptions}`}off(){var t,e;null===(t=this.schemaSubscription)||void 0===t||t.off(),null===(e=this.themeSubscription)||void 0===e||e.off()}}const $=new class{execute(t,e="GET",n=null,o,r){const i={method:e,headers:Object.assign({"Content-Type":"text/plain"},o||{}),credentials:"same-origin",body:null,signal:r};return n&&(i.body="string"==typeof n?n:JSON.stringify(n)),fetch(t,i)}};function K(t,e){return Object.keys(t).filter((t=>!e.includes(t))).reduce(((e,n)=>Object.assign(Object.assign({},e),{[n]:t[n]})),{})}class z{static camelCaseToDashCase(t){return t.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))}static camelCaseToUpperSnakeCase(t){return t.replace(/[A-Z]/g,(t=>"_"+t)).toUpperCase()}}class Q{constructor(t){this._count=0,this.onUpdateCb=t}increment(){this._count++,this.onUpdateCb(this.count())}decrement(){this._count>0&&this._count--,this.onUpdateCb(this.count())}count(){return this._count}}var q;!function(t){t.TOO_MANY_REQUESTS="TOO_MANY_REQUESTS",t.COMPONENT_RESOURCES_LOADED="COMPONENT_RESOURCES_LOADED",t.FAILED_TO_LOAD_COMPONENT_RESOURCE="FAILED_TO_LOAD_COMPONENT_RESOURCE",t.SUBMIT_REQUEST_STARTED="SUBMIT_REQUEST_STARTED",t.SUBMIT_REQUEST_FINISHED="SUBMIT_REQUEST_FINISHED",t.PROMO_CODE_SHOWN="PROMO_CODE_SHOWN"}(q||(q={}));const Y=q;class Z{constructor(t,e,n){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=t=>{0===t&&this.systemEventEmitter.emit(Y.COMPONENT_RESOURCES_LOADED,this.componentId)},this.onResourceLoadFailure=t=>{this.isStaticEntryModule?this.systemEventEmitter.emit(Y.FAILED_TO_LOAD_COMPONENT_RESOURCE,`Failed to load: ${t}`):this.counters.pending.decrement()},this.componentId=t,this.systemEventEmitter=e,this.isStaticEntryModule=n,this.counters={pending:new Q(this.onCounterStateUpdate)}}}const J=(...t)=>{let e=t.reduce(((t,e)=>Object.assign(Object.assign({},t),{[e]:[]})),{});return{get:t=>e[t],clear:()=>J(...t)}},X=J,tt="props",et="shared",nt="environment";function ot(t,e,n,o){const r=t=>{let i=t instanceof DocumentFragment||(null==t?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?t.host:t;return i&&(o&&"function"==typeof o?o(i.getAttribute(e)):(null===(s=null==i?void 0:i.getAttribute)||void 0===s?void 0:s.call(i,e))===n)?i:i&&i.parentNode&&r(i.parentNode)||null;var s};return r(t)}const rt="SUBMIT";function it(t,e){return e?(t.classes=`${t.classes||""} ${e.classes||""}`.trim(),Object.keys(e).forEach((n=>{if("element"===n||"classes"===n)return;const o=e[n];o&&"object"==typeof o&&!Array.isArray(o)?t[n]=Object.assign(Object.assign({},t[n]||{}),o):t[n]=o})),t):t}const st={DESKTOP:"desktop",MOBILE:"mobile"};function at(t,e,n){var o;return null===(o=null==t?void 0:t[e])||void 0===o?void 0:o.find((t=>t.element===n))}function lt(t){const{element:e,html:n,appendHtml:o}=t,r=function(t){if(null==t)return"";if("string"!=typeof t)return String(t);if(""===t)return"";if(!/<\/?([a-zA-Z][a-zA-Z0-9]*)\b[^>]*>/.test(t))return t;const e=(new DOMParser).parseFromString(t,"text/html");return e.querySelectorAll('script, style, link[rel="stylesheet"], meta[http-equiv]').forEach((t=>t.remove())),e.querySelectorAll("*").forEach((t=>{if(["onclick","onload","onerror","onmouseover","onfocus","onblur","onkeyup","onkeydown","onchange","onsubmit","onmouseenter","onmouseleave","onmouseout","oncontextmenu","ondrag","ondrop"].forEach((e=>t.removeAttribute(e))),Array.from(t.attributes).forEach((e=>{e.name.startsWith("on")&&t.removeAttribute(e.name)})),"A"===t.tagName||"AREA"===t.tagName){const e=t.getAttribute("href");e&&(e.startsWith("javascript:")||e.startsWith("data:"))&&t.removeAttribute("href")}if("IMG"===t.tagName||"IFRAME"===t.tagName){const e=t.getAttribute("src");e&&(e.startsWith("javascript:")||e.startsWith("data:text/html"))&&t.removeAttribute("src")}if("FORM"===t.tagName){const e=t.getAttribute("action");e&&e.startsWith("javascript:")&&t.removeAttribute("action")}})),e.body.innerHTML}(n);o?e.innerHTML+=r:e.innerHTML=r}class ct extends Event{constructor(t,e,n){super(t,n),this.detail={},Object.defineProperty(this,"detail",{value:e})}}var ut;!function(t){t.STATIC="STATIC",t.UPDATING="UPDATING"}(ut||(ut={}));class ht extends HTMLElement{constructor(){var o;super(),this.skipGameBlur=!0,this.construct=()=>{let t;const e=this.getAttribute(n("id")),o=this.getWidgetContainerNode();if(!o)throw new Error("Widget container not found in construct");const r=o.closest(`[${n("widget-id")}]`);let i;r&&(i=r.getAttribute(n("widget-id")));let s=new ct("cl-props-request",{nodeName:this.nodeName,path:this.getAttribute(n("path")),id:e,widgetId:i},{bubbles:!0,composed:!0});this.dispatchEvent(s),t=s.detail.props,Object.assign(this,t),this.observers=X(tt,et,nt),this.subscriptions=new class{constructor(){this.subscriptions=[]}push(t){this.subscriptions.push(t)}off(){this.subscriptions.forEach((t=>null==t?void 0:t.off()))}},this.state=new S({}),this.componentEventEmitter=new v,this.componentResourceManager=new Z(this.model.id,this.services.eventEmitter,this.isStaticRenderMode()),this.mergeTagsProcessor=this.services.mergeTagsProcessorFactory.create(),this._actionFactory=this.services.actionFactory,this._handlerFactory=new E(this._actionFactory,this.services.actionRegister),this.prevProps=this.model.props,this.prevEnvironment=this.getEnvironment(),this.documentModel.on(`COMPONENT_PROPS_UPDATE_${this.model.id}`,(t=>{this.model.props=t,this.observers.get(tt).forEach((e=>e(this.prevProps,t))),this.prevProps=t;const e=this.getHostElement(),o=n("floating");t.floating&&!e.getAttribute(o)?e.setAttribute(o,"true"):!t.floating&&e.getAttribute(o)&&e.removeAttribute(o)})),this.documentModel.on(`COMPONENT_UPDATE_${this.model.id}`,(t=>{Object.assign(this.model,t)})),this.documentModel.on("SHARED_UPDATE_ALL",(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles),this.observers.get(et).forEach((t=>t(this.getShared())))})),this.model.props.backgroundDynamicInlineSVGElements&&(this.colorSchemaListener=new V(this.documentModel,this.getHostElement(),(()=>this.getShared()),(()=>this.model.props),(()=>this.getEnvironment()),$),this.colorSchemaListener.apply(this.getEnvironment()).then((()=>{this.subscriptions.push(this.colorSchemaListener.on())}))),this.prevProps.adaptiveStyles&&this.subscriptions.push(this.resizeListener.on(F.changeEventName,(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles);const t=this.getEnvironment();this.observers.get(nt).forEach((e=>e(this.prevEnvironment,t))),this.prevEnvironment=t}))),this.subscriptions.push(this.services.eventEmitter.on("GAME_PHASE_READY_TO_PLAY",(()=>{this.skipGameBlur||this.getHostElement().classList.add("cl-game-spotlight-component")}))),this.subscriptions.push(this.services.eventEmitter.on("GAME_PHASE_COMPLETED",(()=>{this.skipGameBlur||this.getHostElement().classList.remove("cl-game-spotlight-component")})))},this.attachHandlers=()=>{this.getHandlers().map((t=>this._handlerFactory.get(t))).map((t=>()=>t.activate(this.state,this.componentEventEmitter,this.getHostElement.bind(this)))).forEach((t=>t()))},this.postponeHandlers=()=>{var t;null===(t=this.handlers)||void 0===t||t.forEach((t=>t.postpone()))},this.releaseHandlers=()=>{var t;null===(t=this.handlers)||void 0===t||t.forEach((t=>t.release()))},this.getProps=()=>{var t;return null===(t=this.getModel())||void 0===t?void 0:t.props},this.getShared=()=>this.documentModel.getShared(),this.getEnvironment=()=>this.resizeListener.isMobile()?"mobile":"desktop",this.isStaticRenderMode=()=>this.services.config.getConfig("renderMode")===ut.STATIC,this.isUpdatingRenderMode=()=>this.services.config.getConfig("renderMode")===ut.UPDATING,this.getRootElement=()=>this.shadowRoot?this.shadowRoot:this,this.getHostElement=()=>this,this.observeProps=t=>{this.observers.get(tt).push(t),t(null,this.prevProps)},this.observeShared=t=>{this.observers.get(et).push(t),t(this.getShared())},this.observeEnvironment=t=>{this.observers.get(nt).push(t),t(null,this.getEnvironment())},this.getElements=()=>[this.getHostElement(),...Array.from(this.getRootElement().querySelectorAll(`[${n("element")}]`)).filter((t=>!t.hasAttribute(n("component"))))],this.getElement=(t,e)=>this.getElements().find((o=>e?o.getAttribute(n("element"))===t&&o.id===e:o.getAttribute(n("element"))===t)),this.applyAutoAdaptiveStyles=(t,e)=>{if(!t&&!e)return;const o=this.getElements();if(!o.length)return;const r=function(t,e){if(!e)return t||{desktop:[],mobile:[]};const n=JSON.parse(JSON.stringify(t||{desktop:[],mobile:[]}));return e.forEach((t=>{const e=t.element;let o=!1,r=!1;n.desktop&&n.desktop.forEach((n=>{n.element===e&&(it(n,t),o=!0)})),n.mobile&&n.mobile.forEach((n=>{n.element===e&&(it(n,t),r=!0)})),!o&&n.desktop&&n.desktop.push(JSON.parse(JSON.stringify(t))),!r&&n.mobile&&n.mobile.push(JSON.parse(JSON.stringify(t)))})),n}(t,e),i=n("type"),s="element-styles";let a=this.getRootElement().querySelector(`style[${i}="${s}"]`);a||(a=document.createElement("style"),a.setAttribute(i,s),this.getRootElement().appendChild(a)),lt({element:a,html:""}),o.forEach((t=>{let e=t.getAttribute(n("element"));const o=this.getEnvironment();let i=at(r,o,e);if(i){if(this.resizeListener.isMobile()){const t=at(r,"desktop",e);t&&(i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},t.styleAttributes),i.styleAttributes)}))}this.applyStylesToElement(t,this.applySharedClassesToElementModel(i),a)}})),this._addLinkColor(a,this.getShared())},this.registerComponentResourceManagement=()=>{this.viewResourceManager.registerComponent(this.model.id,this.componentResourceManager)},this.applyStyles=(t,e={})=>{if(!t||!t.style)return!1;for(const[n,o]of Object.entries(e))t.style[n]=o;return!0},this.applyStylesToElement=(t,e,o)=>{var r,i;const s=[];"host"===(e=ht._resolveTogglableStylesForElementModel(e)).element&&(H.applyHostStyles(this.model.type,t,null,this.layoutType),("desktop"===this.getEnvironment()&&(null===(r=this.model.props.backgroundDynamicInlineSVGElements)||void 0===r?void 0:r.desktop)||"mobile"===this.getEnvironment()&&(null===(i=this.model.props.backgroundDynamicInlineSVGElements)||void 0===i?void 0:i.mobile))&&(this.colorSchemaListener.apply(this.getEnvironment()),s.push("background")));let a=e.styleAttributes.background,l=a&&a.match(/url\("([^"]*)"\)/);if(this.manifest.waitForResourcesLoad&&l){this.componentResourceManager.getPending().increment();const t=new Image;t.src=l[1],O(t,"load",(()=>{this.componentResourceManager.getPending().decrement()})),O(t,"error",(()=>{this.componentResourceManager.onResourceLoadFailure(t.src),this.isUpdatingRenderMode&&this.componentResourceManager.getPending().decrement()}))}const c=Object.assign(Object.assign({},e),{styleAttributes:K(e.styleAttributes,s)});if(W.set(t,c),this._setClassAttributes(t,e),o){if(e.hoverStyleAttributes){let r=Object.assign({},e.hoverStyleAttributes);if("FILL_UP"===e.hoverAnimationType){t.style.boxShadow="inset 0px 0px 0px 0px rgb(0, 0, 0, 0)",t.style.overflow="hidden";const n=t.tagName.toLowerCase(),o=`flip-up-animation-${e.element}`;let i=this.getRootElement().querySelector(`#${o}`);i||(i=document.createElement("style"),i.id=o,t.appendChild(i)),lt({element:i,html:`\n ${n}::before {\n content: '';\n background: ${r.background};\n position: absolute;\n left: 0;\n top: ${t.getBoundingClientRect().height}px;\n height: ${t.getBoundingClientRect().height}px;\n width: 100%;\n z-index: -10;\n }\n ${n}:hover::before {\n top: 0;\n transition: 0.3s;\n }\n `}),r=Object.assign(Object.assign({},e.hoverStyleAttributes),{background:"transparent",position:"relative"})}r.borderTopWidth&&"0px"!==r.borderTopWidth||delete r.borderTopColor,r.borderBottomWidth&&"0px"!==r.borderBottomWidth||delete r.borderBottomColor,r.borderLeftWidth&&"0px"!==r.borderLeftWidth||delete r.borderLeftColor,r.borderRightWidth&&"0px"!==r.borderRightWidth||delete r.borderRightColor,this._addStylesToStyleElement(o,e.element,r,`:not(.${n("no-hover")}):hover`,!0)}e.placeholderStyleAttributes&&this._addStylesToStyleElement(o,e.element,e.placeholderStyleAttributes,"::placeholder"),this._addFontStylesToStyleElement(o,this.getShared()),this.stylesAppliedToElement(t,e,o)}},this.applySharedClassesToElementModel=e=>function(e,n){let o=e;return(o.classes||"").split(" ").filter((e=>e.startsWith(t))).forEach((t=>{var e;let r=null===(e=n.textClasses)||void 0===e?void 0:e[t];r&&(r.styleAttributes.fontFamily||(r.isHeader&&n.headerFontFamily&&(r=Object.assign(Object.assign({},r),{styleAttributes:Object.assign(Object.assign({},r.styleAttributes),{fontFamily:n.headerFontFamily})})),!r.isHeader&&n.textFontFamily&&(r=Object.assign(Object.assign({},r),{styleAttributes:Object.assign(Object.assign({},r.styleAttributes),{fontFamily:n.textFontFamily})}))),o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},o.styleAttributes),r.styleAttributes),placeholderStyleAttributes:Object.assign(Object.assign({},o.placeholderStyleAttributes),r.placeholderStyleAttributes)}))})),o.styleAttributes.fontFamily||(o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},o.styleAttributes),{fontFamily:n.textFontFamily})})),o}(e,this.documentModel.getShared()),this.getModel=()=>this.model,this._addStylesToStyleElement=(t,e,o,r="",i)=>{const s=Object.keys(o).reduce(((t,e)=>t+` ${z.camelCaseToDashCase(e)}: ${o[e]}${i?" !important;":";"}`),"");lt({element:t,html:`[${n("element")}="${e}"]${r} { ${s} }`,appendHtml:!0})},this._addFontStylesToStyleElement=(t,e)=>{lt({element:t,html:`[cl-type] {font-family:${e.textFontFamily||"inherit"}}`,appendHtml:!0})},this._addLinkColor=(t,e)=>{var n,o,r,i;e.linkColor&&lt({element:t,html:`a {color: ${e.linkColor}}, a:visited {color: ${e.linkColor}}`,appendHtml:!0}),(null===(n=e.linkParams)||void 0===n?void 0:n.color)&&lt({element:t,html:`a {color: ${null===(o=e.linkParams)||void 0===o?void 0:o.color}}, a:visited {color: ${null===(r=e.linkParams)||void 0===r?void 0:r.color}}`,appendHtml:!0}),(null===(i=e.linkParams)||void 0===i?void 0:i.removeUnderline)&&lt({element:t,html:"a {text-decoration: none}, a:visited {text-decoration: none}",appendHtml:!0})},this._setClassAttributes=(n,o)=>{Array.from(n.classList).filter((t=>t!==e("hovered")&&t!==e("focused"))).forEach((e=>{e.startsWith(t)&&n.classList.remove(e)}));const r=((n.getAttribute("class")||"")+" "+o.classes).trim();n.setAttribute("class",r)},this.getParentComponent=()=>ot(this.parentNode,n("element"),"host"),this.getWidgetContainerNode=()=>{const t=null==this?void 0:this.getAttribute(n("path"));return 1===(null==t?void 0:t.split(",").length)?this.parentNode:ot(this.parentNode,n("path"),void 0,(t=>1===(null==t?void 0:t.split(",").length)))},this.getWidgetLanguages=()=>function(t){return[t.getConfig("appearanceLanguage"),t.getConfig("browserLanguage"),"en"].filter((t=>!!t))}(this.services.config),this.getPreferredWidgetLanguage=()=>this.getWidgetLanguages()[0],this.getTranslationsMap=t=>function(t,e){return e.reduce(((e,n)=>{if(e)return e;const o=function(t,e){if(!t)return null;if(e[t])return{translations:e[t],language:t};const n=function(t){return t.includes("-")?t.split("-")[0].toLowerCase():t.includes("_")?t.split("_")[0].toLowerCase():t}(t);return e[n]?{translations:e[n],language:n}:null}(n,t);return o||null}),null)}(t,this.getWidgetLanguages()),this.stylesAppliedToElement=(t,e,n)=>{},this.updateContext=()=>{var t;const e=this.getModel();this.services.context.updateRecord(e.id,{label:this.getContextRecordLabel(e.props),viewIndex:null===(t=e.path)||void 0===t?void 0:t[0]})},this.addContextRecord=()=>{var t;const e=this.getModel();this.services.context.addRecord(e.id,{recordKey:e.id,id:e.props.control.name,label:this.getContextRecordLabel(e.props),value:e.props.control.defaultValue||"",viewIndex:null===(t=e.path)||void 0===t?void 0:t[0],sourceId:"FORM",initialData:{fallbackValue:"",exampleValue:this.getContextRecordExampleValue(e.props)}})},this.getContextRecordLabel=t=>{var e,n,o,r,i,s;const a=t.control.name;if(["email","first_name","last_name"].includes(a))return a.toUpperCase();if((null===(e=t.content)||void 0===e?void 0:e.label)&&(null===(r=null===(o=null===(n=t.adaptiveStyles)||void 0===n?void 0:n.desktop.find((t=>"label"===t.element)))||void 0===o?void 0:o.params)||void 0===r?void 0:r.enabled)){const e=(new DOMParser).parseFromString(t.content.label,"text/html");return this.capitalizeFirstLetter(e.body.textContent||"")}return(null===(i=t.content)||void 0===i?void 0:i.placeholder)?this.capitalizeFirstLetter(t.content.placeholder):(null===(s=t.control)||void 0===s?void 0:s.integrationName)?this.capitalizeFirstLetter(t.control.integrationName).replace(new RegExp("_","g")," "):void 0},this.capitalizeFirstLetter=t=>t.charAt(0).toUpperCase()+t.slice(1),this.getContextRecordExampleValue=t=>{var e;switch(null===(e=t.control)||void 0===e?void 0:e.name){case"email":return"myemail@example.com";case"first_name":return"Maria";case"last_name":return"Taylor";default:return this.getContextRecordLabel(t)}},this.completeSubmitAction=t=>{const e=t||{},n=this.services.actionRegister.getRegisteredActions().find((t=>t.category===rt));n?null==n||n.execute(void 0,void 0,!0,e):this.services.actionFactory.get({type:p.REQUEST}).execute(void 0,void 0,!0,e)},this.getHandlers=()=>{var t;return(null===(t=this.getProps())||void 0===t?void 0:t.handlers)&&this.getProps().handlers.length?[...this.getProps().handlers]:[]},this.assets=(t="")=>`${this.services.config.getConfig("staticResourcesUrl").replace(/\/$/,"")}/${this.manifest.name}/assets${t?`/${t}`:""}`,this.attachShadow({mode:"open"}),this.manifest=this.manifest||(null===(o=this.constructor.define)||void 0===o?void 0:o.manifest)}connectedCallback(){this.construct(),this.registerComponentResourceManagement(),Promise.resolve().then((()=>{this.attachHandlers()}));const t=document.createElement("style");t.textContent='\n :host(.cl-game-spotlight-component)::after {\n content: "";\n position: absolute;\n background-size: 100% 100%;\n background-repeat: no-repeat;\n overflow: visible;\n \n backdrop-filter: blur(4px);\n \n inset: -30px;\n mask-image: \n linear-gradient(to bottom, transparent, grey 30px, grey calc(100% - 30px), transparent),\n linear-gradient(to right, transparent, grey 30px, grey calc(100% - 30px), transparent);\n mask-composite: intersect;\n -webkit-mask-composite: source-in; /* for Chrome/Safari */\n \n transition: opacity 0.35s ease;\n pointer-events: auto;\n }\n ',this.getRootElement().prepend(t)}disconnectedCallback(){var t;this.observers.clear(),this.subscriptions.off(),this.state.destroy(),this.componentEventEmitter.destroy(),null===(t=this.mergeTagsProcessor)||void 0===t||t.destroy()}}ht._resolveTogglableStylesForElementModel=t=>{const e=Object.assign({},t);return Object.keys(e).forEach((t=>{t.toLowerCase().includes("styleattributes")&&(e[t]=ht._resolveTogglableStyles(e[t]))})),e},ht._resolveTogglableStyles=t=>{const e=Object.assign({},t),n=(t,n,o)=>{n in e&&(t.forEach((t=>{t in e&&(e[t]=e[n]?e[t]:o)})),delete e[n])};return n(["marginTop","marginBottom","marginLeft","marginRight"],"_marginEnabled","0px"),n(["paddingTop","paddingBottom","paddingLeft","paddingRight"],"_paddingEnabled","0px"),e};const pt=ht;var dt={FOLLOW:"FOLLOW",SHARE:"SHARE"},mt={FACEBOOK:"FACEBOOK",INSTAGRAM:"INSTAGRAM",LINKEDIN:"LINKEDIN",TWITTER:"TWITTER",CUSTOM:"CUSTOM",EMAIL:"EMAIL",PINTEREST:"PINTEREST",WHATSAPP:"WHATSAPP"},gt={ROUNDED:"ROUNDED"};function ft(t){return ft="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ft(t)}function Et(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,bt(o.key),o)}}function bt(t){var e=function(t){if("object"!=ft(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ft(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ft(e)?e:e+""}var yt=function(){return function(t,e){return e&&Et(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.imgPath="".concat(e.replace(/\/$/,""),"/img")}),[{key:"getValidPlatformName",value:function(t){return mt[t.type]?t.type:mt.CUSTOM}},{key:"getValidIconMode",value:function(t){return(gt[t.mode]?t.mode:gt.ROUNDED).toLowerCase()}},{key:"getDefaultImage",value:function(){return"".concat(this.imgPath,"/image-placeholder.svg")}},{key:"getPlatformImageUrl",value:function(t){if(t.image)return t.image;var e=this.getValidPlatformName(t);if(e===mt.CUSTOM)return this.getDefaultImage();var n="".concat(e.toLowerCase(),"-logo"),o=this.getValidIconMode(t),r=o?"-".concat(o):"";return"".concat(this.imgPath,"/").concat(n).concat(r,".svg")}}])}();const vt={name:"SysSocialComponent",componentType:"SOCIAL",version:"1.0.0",events:{dispatch:[],listen:[]},contextMenuModel:function(t){return Object.values(st).map((e=>({type:"GROUP",propPath:["adaptiveStyles",e],children:t})))}([{type:"CONTROL",name:"COMPONENT_OPERATIONS"},{type:"CONTROL",name:"BRING_BACK_FORWARD",element:"host",elementProp:"styleAttributes",elementSubProp:"zIndex"},{type:"CONTROL",name:"FOCUS_PARENT_COMPONENT"}]),propertyPaneModel:{content:[{type:"GROUP",propPath:["adaptiveStyles","desktop"],children:[{type:"CONTROL",name:"SOCIAL_ICON_SIZE",propPath:["control","size","desktop"]},{type:"CONTROL",name:"SOCIAL_TYPE_AND_ICON_SELECT",propPath:["control"]}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"SOCIAL_ICON_SIZE",propPath:["control","size","mobile"]},{type:"CONTROL",name:"SOCIAL_TYPE_AND_ICON_SELECT",propPath:["control"]}]}],general:[{type:"CONTROL",name:"ACTIONS",propPath:["handlers"],params:{origin:!0}}]},i18nPropertyPaneModel:{content:[{type:"CONTROL",name:"ACTIONS",propPath:["handlers"],params:{origin:!1}}]},i18nPropPaths:["content,text","handlers,[id],actions,[id],params,link","handlers,[id],actions,[id],params,customData"],props:{control:{options:[{type:"FACEBOOK",order:0},{type:"INSTAGRAM",order:1},{type:"LINKEDIN",order:2},{type:"TWITTER",order:3}],mode:"FOLLOW",size:{desktop:32,mobile:32}},adaptiveStyles:{desktop:[{element:"host",styleAttributes:{}}],mobile:[{element:"host",styleAttributes:{}}]}},metaDescription:{icon:"/SysSocialComponent/assets/img/social-component-icon.svg",label:{en:"Social",ru:"Социальные сети",uk:"Соціальні мережі",es:"Social",de:"Social",fr:"Social",it:"Social",pt:"Social",ro:"Social",bg:"Social",cs:"Social",el:"Social",nl:"Social",pl:"Social",sv:"Social",tr:"Social",ar:"Social",zh:"社群媒体",da:"Social",he:"Social",fi:"Social",hi:"Social",hr:"Social",hu:"Social",id:"Social",ja:"Social",ko:"Social",no:"Social",sk:"Social",sl:"Social",sr:"Social"}},syncEnabled:!0,stylesImitationEnabled:!0};function Ot(t){return Ot="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ot(t)}function St(t,e,n){return(e=function(t){var e=function(t){if("object"!=Ot(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ot(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ot(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Tt(t){var e=t&&t.type;return Boolean(e)}function At(t){return At="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},At(t)}function Ct(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function _t(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ct(Object(n),!0).forEach((function(e){It(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ct(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function It(t,e,n){return(e=function(t){var e=function(t){if("object"!=At(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=At(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==At(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Nt(t){var e,n,o,r,i=function(t){Array.isArray(t.options)||(console.warn("SysSocial: options should be an array, setting default value"),t.options=[]);var e=t.options.filter(Tt);return e.length!==t.options.length&&(console.error("SysSocial: options contain invalid platforms, filtering them out"),t.options=e),Object.values(dt).includes(t.mode)||(console.error("SysSocial: mode is invalid, setting default value"),t.mode=dt.FOLLOW),"object"!==At(t.size)&&Number.isNaN(Number(t.size))&&(console.error("SysSocial: size should be a number, setting default value"),t.size=32),"string"!=typeof t.size&&"number"!=typeof t.size||(console.warn("SysSocial: migrating size from primitive to object"),t.size={desktop:t.size,mobile:t.size}),t}(_t({},null==t?void 0:t.control));return i.mode===dt.SHARE&&(i.options=(n=(e=i).options,o=e.shareUrl,r="INTERNAL"===e.shareUrlType?window.location.href:o,n.reduce((function(t,e){var n=function(t){return t?St(St(St(St(St(St({},mt.FACEBOOK,(function(t){var e=t.url;return"https://www.facebook.com/sharer/sharer.php?u=".concat(e)})),mt.LINKEDIN,(function(t){var e=t.url;return"https://www.linkedin.com/sharing/share-offsite/?url=".concat(e)})),mt.TWITTER,(function(t){var e=t.url;return"https://twitter.com/intent/tweet?url=".concat(e)})),mt.PINTEREST,(function(t){var e=t.url;return"https://www.pinterest.com/pin/create/button/?url=".concat(e)})),mt.WHATSAPP,(function(t){var e=t.url;return"https://wa.me/?text=".concat(e)})),mt.EMAIL,(function(t){var e=t.url,n=t.subject,o=void 0===n?"":n;return"mailto:?body=".concat(e,"&subject=").concat(o)}))[t.type]:null}(e);return n&&t.push(_t(_t({},e),{},{url:n(_t({url:r},e.props))})),t}),[]))),i}function Lt(t){const{element:e,html:n,appendHtml:o}=t,r=function(t){if(null==t)return"";if("string"!=typeof t)return String(t);if(""===t)return"";if(!/<\/?([a-zA-Z][a-zA-Z0-9]*)\b[^>]*>/.test(t))return t;const e=(new DOMParser).parseFromString(t,"text/html");return e.querySelectorAll('script, style, link[rel="stylesheet"], meta[http-equiv]').forEach((t=>t.remove())),e.querySelectorAll("*").forEach((t=>{if(["onclick","onload","onerror","onmouseover","onfocus","onblur","onkeyup","onkeydown","onchange","onsubmit","onmouseenter","onmouseleave","onmouseout","oncontextmenu","ondrag","ondrop"].forEach((e=>t.removeAttribute(e))),Array.from(t.attributes).forEach((e=>{e.name.startsWith("on")&&t.removeAttribute(e.name)})),"A"===t.tagName||"AREA"===t.tagName){const e=t.getAttribute("href");e&&(e.startsWith("javascript:")||e.startsWith("data:"))&&t.removeAttribute("href")}if("IMG"===t.tagName||"IFRAME"===t.tagName){const e=t.getAttribute("src");e&&(e.startsWith("javascript:")||e.startsWith("data:text/html"))&&t.removeAttribute("src")}if("FORM"===t.tagName){const e=t.getAttribute("action");e&&e.startsWith("javascript:")&&t.removeAttribute("action")}})),e.body.innerHTML}(n);o?e.innerHTML+=r:e.innerHTML=r}function Pt(t){return Pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pt(t)}function Rt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=Array(e);n<e;n++)o[n]=t[n];return o}function Mt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,Ft(o.key),o)}}function wt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(wt=function(){return!!t})()}function Ut(){return Ut="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var o=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=kt(t)););return t}(t,e);if(o){var r=Object.getOwnPropertyDescriptor(o,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},Ut.apply(null,arguments)}function kt(t){return kt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},kt(t)}function jt(t,e){return jt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},jt(t,e)}function Dt(t,e,n){return(e=Ft(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ft(t){var e=function(t){if("object"!=Pt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Pt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Pt(e)?e:e+""}var xt=function(){function t(){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Dt(e=function(t,e,n){return e=kt(e),function(t,e){if(e&&("object"==Pt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,wt()?Reflect.construct(e,n||[],kt(t).constructor):e.apply(t,n))}(this,t),"createContent",(function(t){var n=e.getElement("social"),o=Nt(t),r=n.querySelector(".items-wrapper");r?e._renderItemsForExistingComponent(r,o):e._renderItemsForEmptyComponent(n,o)})),Dt(e,"_renderItemsForEmptyComponent",(function(t,n){var o=document.createElement("div");o.classList.add("items-wrapper"),e.addItemsContent(o,n),Lt({element:t,html:""}),t.append(o)})),Dt(e,"_renderItemsForExistingComponent",(function(t,n){var o={};n.options.forEach((function(r){var i=e.getPlatformKey(r),s=t.querySelector('[key="'.concat(i,'"]'));o[i]=s?e._updatePlatformComponent(s,r,n):e._createNewPlatformComponent(t,r,n),e._setPlatformStyles(o[i],r)}));var r,i=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Rt(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Rt(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var o=0,r=function(){};return{s:r,n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){a=!0,i=t},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw i}}}}(t.children);try{for(i.s();!(r=i.n()).done;){var s=r.value,a=s.getAttribute("key");o[a]||t.removeChild(s)}}catch(t){i.e(t)}finally{i.f()}})),Dt(e,"_updatePlatformComponent",(function(t,n,o){var r=t.querySelector("img"),i=e.urlManager.getPlatformImageUrl(n);r.src!==i&&(r.src=i);var s=o.size[e.getEnvironment()];return s!==r.width&&(r.height=s,r.width=s),t})),Dt(e,"_createNewPlatformComponent",(function(t,n,o){var r=e.createPlatformComponent(n,o);return t.append(r),r})),Dt(e,"addItemsContent",(function(t,n){return t.classList.add("social-list"),t.setAttribute("role","list"),n.options.forEach((function(o){t.append(e.createPlatformComponent(o,n))})),t})),Dt(e,"createPlatformComponent",(function(t,n){var o,r=n.size,i=t.url;i?((o=document.createElement("a")).setAttribute("href",i||"#"),o.setAttribute("target","_blank"),o.setAttribute("rel","noopener noreferrer"),o.setAttribute("aria-label",e.getPlatformAccessibleLabel(t))):((o=document.createElement("div")).setAttribute("role","img"),o.setAttribute("aria-label",e.getPlatformAccessibleLabel(t))),o.classList.add("social-list-item"),o.setAttribute("key",e.getPlatformKey(t)),e._setPlatformStyles(o,t);var s=e.urlManager.getPlatformImageUrl(t),a=r[e.getEnvironment()],l=document.createElement("img");return l.src=s,l.height=a,l.width=a,l.alt="",l.setAttribute("aria-hidden","true"),Lt({element:o,html:""}),o.appendChild(l),o})),Dt(e,"getPlatformKey",(function(t){return"".concat(t.type,"-").concat(t.order)})),Dt(e,"_setPlatformStyles",(function(t,e){t.setAttribute("style","order:".concat(e.order))})),Dt(e,"getPlatformAccessibleLabel",(function(t){var e={FACEBOOK:"Facebook",INSTAGRAM:"Instagram",LINKEDIN:"LinkedIn",TWITTER:"Twitter",CUSTOM:"Custom social link",EMAIL:"Email",PINTEREST:"Pinterest",WHATSAPP:"WhatsApp"};return e[t.type]||e.CUSTOM})),Dt(e,"manifest",vt),e.getRootElement().innerHTML="\n <style>".concat(t.componentStyle,"</style>\n ").concat(t.componentTemplate,"\n "),e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&jt(t,e)}(t,pt),function(t,e){return e&&Mt(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(t,[{key:"connectedCallback",value:function(){var e=this;!function(t,e,n){var o=Ut(kt(t.prototype),"connectedCallback",n);return"function"==typeof o?function(t){return o.apply(n,t)}:o}(t,0,this)([]),this.urlManager=new yt(this.assets()),this.observeProps((function(t,n){e.createContent(n),e.applyAutoAdaptiveStyles(n.adaptiveStyles)})),this.observeEnvironment((function(){var t=e.getProps();e.createContent(t),e.applyAutoAdaptiveStyles(t.adaptiveStyles)}))}}])}();Dt(xt,"define",{name:"sys-social",model:vt.name,manifest:vt}),Dt(xt,"componentStyle","\n .social-list {\n display: flex;\n gap: 10px;\n }\n \n .social-list-item {\n display: flex;\n }\n"),Dt(xt,"componentTemplate",'\n <div class="social-container">\n <div cl-element="social" class="social-list-content">\n </div>\n </div>\n');export{xt as default};window.clComponentClass_SysSocialComponent=xt;
@@ -1 +1 @@
1
- const e="cl-";function t(t){return e+t}function n(e){return"cl-"+e}const i="VIEW",o="MODULE",s="CONTAINER",r="INPUT",a="BUTTON",l="CONSENT",c="COLUMN";var d,h;(h=d||(d={})).SUBSCRIBE_CONTACT="SUBSCRIBE_CONTACT",h.REQUEST="REQUEST",h.DISPATCH_EVENT="DISPATCH_EVENT",h.GO_TO_VIEW="GO_TO_VIEW",h.GO_TO_PREVIOUS_VIEW="GO_TO_PREVIOUS_VIEW",h.GO_TO_NEXT_VIEW="GO_TO_NEXT_VIEW",h.SHOW_WIDGET="SHOW_WIDGET",h.OPEN_LINK="OPEN_LINK",h.CLOSE_WIDGET="CLOSE_WIDGET",h.CLICK="CLICK";const u=d;var p,m;class g{static sortActions(e){const t={[u.CLOSE_WIDGET]:-1,[u.OPEN_LINK]:-2,[u.SHOW_WIDGET]:1,[u.SUBSCRIBE_CONTACT]:2,[u.REQUEST]:3},n=e=>void 0!==t[e.type]?t[e.type]:0;return[...e].sort(((e,t)=>n(e)>n(t)?-1:n(e)<n(t)?1:0))}constructor(e,t){this.config=e,this.actions=g.sortActions(t),this.listener=null,this.targetElements=[],this.eventsQueue=[],this.state=null,this.postponed=!1}activate(e,t,i){this.state=e;const o=i(),s=o.getAttribute(n("id"));this.listener=e=>{const t=e.composedPath().filter((e=>e instanceof HTMLElement&&e.getAttribute(n("type"))));let i=0;for(;t[i]&&t[i].getAttribute(n("id"))!==s;){let e=t[i].getAttribute(n("type"));if(g.IGNORING_VIEW_ENTRY_TYPES.includes(e))return;i++}this.eventsQueue.push({event:e}),this.postponed||this.execute()},this.targetElements=this.config.relativeSelector?Array.from((o.shadowRoot||o).querySelectorAll(this.config.relativeSelector)):[o],this.targetElements.forEach((e=>{e.addEventListener("click",this.listener)}))}async execute(){var e,t,n,i;try{for(var o,s=!0,r=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(n){t[n]=e[n]&&function(t){return new Promise((function(i,o){!function(e,t,n,i){Promise.resolve(i).then((function(t){e({value:t,done:n})}),t)}(i,o,(t=e[n](t)).done,t.value)}))}}}(this.eventsQueue);!(e=(o=await r.next()).done);s=!0){i=o.value,s=!1;const{event:e}=i;for(const t of this.actions)if(!await t.execute(this.state.getState(),e))break}}catch(e){t={error:e}}finally{try{s||e||!(n=r.return)||await n.call(r)}finally{if(t)throw t.error}}this.eventsQueue=[]}postpone(){this.postponed=!0}release(){this.postponed=!1,this.execute()}destroy(){this.listener&&this.targetElements.length&&(this.targetElements.forEach((e=>{e.removeEventListener("click",this.listener)})),this.targetElements=[])}}g.IGNORING_VIEW_ENTRY_TYPES=[a,l,r],(m=p||(p={})).CLICK="CLICK",m.COMPONENT_EVENT="COMPONENT_EVENT";class y{constructor(e,t){this.config=e,this.actions=t,this.componentEmitterListener=null}activate(e,t,n){this.componentEmitterListener=t.on(this.config.eventName,(()=>{this.actions.forEach((t=>t.execute(e.getState(),this.config.params)))}))}destroy(){this.componentEmitterListener&&this.componentEmitterListener.off()}}class b{constructor(e,t){this.actionFactory=e,this.actionRegister=t}get(e){const t=e.actions.map((e=>this.actionFactory.get(e)));switch(t.forEach((e=>this.actionRegister.register(e))),e.type){case p.CLICK:return new g(e,t);case p.COMPONENT_EVENT:return new y(e,t);default:throw new Error(`Not supported handler type ${e.type}`)}}}class v{static generate(){let e,t="";for(let n=0;n<32;n++)8!==n&&12!==n&&16!==n&&20!==n||(t+="-"),e=Math.floor(16*Math.random()).toString(16).toUpperCase(),t+=e;return t}}class E{constructor(){this.listeners=E.createDefaultListenersState()}emit(e,t,n=null){const i=this.listeners[e];i&&Object.values(i).forEach((i=>i(t,e,n))),Object.values(this.listeners["*"]).forEach((i=>i(t,e,n)))}on(e,t){const n=v.generate(),i=this.listeners[e];return i?i[n]=t:this.listeners[e]={[n]:t},{off:()=>{var t,i;(null===(i=null===(t=this.listeners)||void 0===t?void 0:t[e])||void 0===i?void 0:i[n])&&delete this.listeners[e][n]}}}destroy(){this.listeners=E.createDefaultListenersState()}}E.createDefaultListenersState=()=>({"*":{}});const f=E,O=(e,t,n,i)=>{const o=EventTarget.prototype,{addEventListenerBase:s,addEventListener:r}=o;(s||r).call(e,t,n,i)};class T{constructor(e){this.state=e||{}}getState(){return this.state}setState(e){this.state=Object.assign(Object.assign({},this.state),e)}destroy(){}}class S{static extract(e){const t=e.views.map((e=>{const t=e.children.map((e=>e.type===o?Object.assign(Object.assign({},e),S.moduleToContainerParams):e));return Object.assign(Object.assign({},e),{children:t})}));return Object.assign(Object.assign({},e),{views:t})}static sort(e,t){return e.index>t.index?1:-1}static reIndex(e,t){return Object.assign(Object.assign({},e),{index:t+e.index})}}var C,_,R,A,I,L,N,P,M,w,U,x,D;S.moduleToContainerParams={name:"SysContainerComponent",version:"1.0.0"},(_=C||(C={})).VIEW="VIEW",_.CONTAINER="CONTAINER",_.TEXT="TEXT",_.INPUT="INPUT",_.BUTTON="BUTTON",_.IMAGE="IMAGE",_.CONSENT="CONSENT",_.COUNTDOWN_TIMER="COUNTDOWN_TIMER",_.PROMO_CODE="PROMO_CODE",_.MULTIPLE_INPUT="MULTIPLE_INPUT",_.VIDEO="VIDEO",_.SLIDER="SLIDER",_.SLIDE="SLIDE",_.SOCIAL="SOCIAL",_.COLUMNS="COLUMNS",_.COLUMN="COLUMN",_.PRIZE_BASED_GAMING="PRIZE_BASED_GAMING",(R||(R={})).CLICK="CLICK",function(e){e.SHOW_WIDGET="SHOW_WIDGET",e.OPEN_LINK="OPEN_LINK",e.SUBSCRIBE_CONTACT="SUBSCRIBE_CONTACT",e.REQUEST="REQUEST",e.CLOSE_WIDGET="CLOSE_WIDGET",e.GO_TO_VIEW="GO_TO_VIEW",e.GO_TO_PREVIOUS_VIEW="GO_TO_PREVIOUS_VIEW",e.GO_TO_NEXT_VIEW="GO_TO_NEXT_VIEW",e.CLICK="CLICK"}(A||(A={})),function(e){e.SELF="_self",e.BLANK="_blank"}(I||(I={})),(L||(L={})).ACCENT="accent",function(e){e.TOP="TOP",e.CENTER="CENTER",e.BOTTOM="BOTTOM"}(N||(N={})),function(e){e.LEFT="LEFT",e.CENTER="CENTER",e.RIGHT="RIGHT"}(P||(P={})),function(e){e.SLIDE_TO_TOP="SLIDE_TO_TOP",e.SLIDE_TO_BOTTOM="SLIDE_TO_BOTTOM",e.SLIDE_TO_LEFT="SLIDE_TO_LEFT",e.SLIDE_TO_RIGHT="SLIDE_TO_RIGHT"}(M||(M={})),function(e){e.PULSE="PULSE",e.VIBRATE="VIBRATE",e.WOBBLE="WOBBLE",e.SHAKE="SHAKE",e.JELLO="JELLO",e.BOUNCE="BOUNCE",e.BLINK="BLINK",e.FLICKER="FLICKER",e.PING="PING"}(w||(w={})),function(e){e.LEFT="LEFT",e.RIGHT="RIGHT"}(U||(U={})),(D=x||(x={})).BEFORE="BEFORE",D.AFTER="AFTER",D.INSIDE="INSIDE",D.INSTEAD="INSTEAD";class k extends f{constructor(e,t){super(),this.config=t,this.handleMobileBreakpoint(e.getShared().mobileBreakpointWidth),e.on("ENVIRONMENT_UPDATE",(({isMobileEnv:e})=>{this._isMobile=e,this.emit(k.changeEventName,this._isMobile)}))}handleMobileBreakpoint(e){this.mobileBreakpointWidth=e;const t=Number.isInteger(this.mobileBreakpointWidth)?`${this.mobileBreakpointWidth}px`:this.mobileBreakpointWidth;this.mediaQueryList=window.matchMedia(`(max-width: ${t})`),this.mediaQueryList.addListener(this.listener.bind(this)),this._isMobile=this.mediaQueryList.matches,this.emit(k.changeEventName,this._isMobile)}isMobile(){return this.config.forceMobileEnv||this._isMobile}listener(e){this._isMobile=e.matches,this.emit(k.changeEventName,this._isMobile)}destroy(){super.destroy(),this.mediaQueryList.removeListener(this.listener.bind(this))}}k.changeEventName="CHANGE";const B=k;class F{static set(e,t){const n=e[F.accumulatorPropertyName]||{};e[F.accumulatorPropertyName]=Object.assign(Object.assign({},n),t.styleAttributes),Object.keys(e[F.accumulatorPropertyName]).forEach((n=>{n.includes("--")?e.style.setProperty(n,t.styleAttributes[n]||""):e.style[n]=t.styleAttributes[n]?t.styleAttributes[n]:""}))}}F.accumulatorPropertyName="clStyleAttributes";const j=F;var V;!function(e){e.BUILT_IN="BUILT_IN",e.DETACHED="DETACHED",e.FLOATING_BOX="FLOATING_BOX",e.FLOATING_BAR="FLOATING_BAR",e.LAUNCHER="LAUNCHER",e.CONTENT_LOCKER="CONTENT_LOCKER"}(V||(V={}));class W{static applyHostStyles(e,t,n=null,o){var r,a,l;const d=null===(a=null===(r=null==n?void 0:n.props)||void 0===r?void 0:r.handlers)||void 0===a?void 0:a.find((e=>"CLICK"===e.type));d&&(null===(l=d.actions)||void 0===l?void 0:l.length)&&(t.style.cursor="pointer"),e!==i&&e!==s&&e!==c||(t.style.display=o===V.CONTENT_LOCKER&&e===i?"flex":"inline-flex",t.style.position="relative"),t.style.boxSizing="border-box"}constructor(){this.styles="/* common styles */ *, *:before, *:after { box-sizing: border-box; font-family: inherit; }"}setStyles(e=""){this.styles=`${this.styles} ${e}`}getStyles(){return this.styles}}class H{static log(e){window.scriptLog09u8y9?scriptLog09u8y9("ERROR","RUNTIME_ERROR",new Error(e)):console.error(e)}}class G{constructor(e,t,n,i,o,s){this.hostElement=t,this.documentModel=e,this.getSharedCb=n,this.getPropsCb=i,this.getEnvCb=o,this.httpClient=s,this.schemaSubscription=null,this.themeSubscription=null,this.envUrlMaps={desktop:new Map,mobile:new Map}}parseBackground(e){const t=String(e||"");if(t.includes("url")){const[e,n]=t.split("(")[1].split(")");return{url:e.replace(/['"]+/g,""),positionOptions:n.replace(";","")}}return{url:null,positionOptions:null}}apply(e){const t=this.getPropsCb();return t.backgroundDynamicInlineSVGElements[e].forEach((n=>{var i,o,s,r,a;const l=null===(o=null===(i=t.adaptiveStyles)||void 0===i?void 0:i[e])||void 0===o?void 0:o.find((e=>e.element===n)),c=(null===(s=t.styles)||void 0===s?void 0:s.find((e=>e.element===n)))||{},d=(null===(r=null==c?void 0:c.styleAttributes)||void 0===r?void 0:r.background)||(null===(a=null==l?void 0:l.styleAttributes)||void 0===a?void 0:a.background),h=this.parseBackground(d);h.url&&this.envUrlMaps[e].set(n,{originalSVGResourceURL:h.url,inlineSvgString:null,positionOptions:h.positionOptions})})),Promise.all([...this.envUrlMaps[e].entries()].map((([t,n])=>this.httpClient.execute(n.originalSVGResourceURL).then((e=>e.text())).then((i=>{this.envUrlMaps[e].set(t,Object.assign(Object.assign({},n),{inlineSvgString:i}))}))))).then((()=>{var t;const n=this.getSharedCb();return Object.keys((null===(t=n.theme)||void 0===t?void 0:t.schema)||{}).length>0?this._applyHostElementBackgroundFromTheme(this.envUrlMaps[e].get("host"),n.theme.schema):this._applyHostElementBackgroundFromCssVars(this.envUrlMaps[e].get("host"),n.cssVars)})).catch((e=>{console.error(e),H.log(`Failed to load/apply backgroundDynamicInlineSVGElements[${this.getPropsCb().backgroundDynamicInlineSVGElements}] ${e}`)}))}on(){return this.schemaSubscription=this.documentModel.on("COLOR_SCHEMA_UPDATE",(e=>{this._applyHostElementBackgroundFromCssVars(this.envUrlMaps[this.getEnvCb()].get("host"),e)})),this.themeSubscription=this.documentModel.on("THEME_UPDATE",(e=>{this._applyHostElementBackgroundFromTheme(this.envUrlMaps[this.getEnvCb()].get("host"),e.schema)})),this}_applyHostElementBackgroundFromCssVars(e,t){e&&t&&(this.hostElement.style.background=this._buildBackgroundUrlFromCssVars(e,t))}_applyHostElementBackgroundFromTheme(e,t){e&&t&&(this.hostElement.style.background=this._buildBackgroundUrlFromTheme(e,t))}_buildBackgroundUrlFromCssVars(e,t){const n=e.inlineSvgString.trim().replace("var(--cl-schema-accent)",t["cl-schema-accent"]);return`url('data:image/svg+xml,${encodeURIComponent(n)}')${e.positionOptions}`}_buildBackgroundUrlFromTheme(e,t){const n=e.inlineSvgString.trim();let i=n;return[...n.matchAll(/var\(--cl-schema-([^)]+)\)/g)].forEach((e=>{const n=function(e=""){return e.replace(/var\(\s*(--[^,\s)]+).*\)/,"$1").replace("--cl-schema-","")}(e[1]);var o;i=i.replace(`var(--${o=n,`cl-schema-${o}`})`,t[n])})),`url('data:image/svg+xml,${encodeURIComponent(i)}')${e.positionOptions}`}off(){var e,t;null===(e=this.schemaSubscription)||void 0===e||e.off(),null===(t=this.themeSubscription)||void 0===t||t.off()}}const $=new class{execute(e,t="GET",n=null,i,o){const s={method:t,headers:Object.assign({"Content-Type":"text/plain"},i||{}),credentials:"same-origin",body:null,signal:o};return n&&(s.body="string"==typeof n?n:JSON.stringify(n)),fetch(e,s)}};function K(e,t){return Object.keys(e).filter((e=>!t.includes(e))).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:e[n]})),{})}class z{static camelCaseToDashCase(e){return e.replace(/[A-Z]/g,(e=>"-"+e.toLowerCase()))}static camelCaseToUpperSnakeCase(e){return e.replace(/[A-Z]/g,(e=>"_"+e)).toUpperCase()}}class q{constructor(e){this._count=0,this.onUpdateCb=e}increment(){this._count++,this.onUpdateCb(this.count())}decrement(){this._count>0&&this._count--,this.onUpdateCb(this.count())}count(){return this._count}}var Q;!function(e){e.TOO_MANY_REQUESTS="TOO_MANY_REQUESTS",e.COMPONENT_RESOURCES_LOADED="COMPONENT_RESOURCES_LOADED",e.FAILED_TO_LOAD_COMPONENT_RESOURCE="FAILED_TO_LOAD_COMPONENT_RESOURCE",e.SUBMIT_REQUEST_STARTED="SUBMIT_REQUEST_STARTED",e.SUBMIT_REQUEST_FINISHED="SUBMIT_REQUEST_FINISHED",e.PROMO_CODE_SHOWN="PROMO_CODE_SHOWN"}(Q||(Q={}));const Y=Q;class Z{constructor(e,t,n){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=e=>{0===e&&this.systemEventEmitter.emit(Y.COMPONENT_RESOURCES_LOADED,this.componentId)},this.onResourceLoadFailure=e=>{this.isStaticEntryModule?this.systemEventEmitter.emit(Y.FAILED_TO_LOAD_COMPONENT_RESOURCE,`Failed to load: ${e}`):this.counters.pending.decrement()},this.componentId=e,this.systemEventEmitter=t,this.isStaticEntryModule=n,this.counters={pending:new q(this.onCounterStateUpdate)}}}const J=(...e)=>{let t=e.reduce(((e,t)=>Object.assign(Object.assign({},e),{[t]:[]})),{});return{get:e=>t[e],clear:()=>J(...e)}},X=J,ee="props",te="shared",ne="environment";function ie(e,t,n,i){const o=e=>{let s=e instanceof DocumentFragment||(null==e?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?e.host:e;return s&&(i&&"function"==typeof i?i(s.getAttribute(t)):(null===(r=null==s?void 0:s.getAttribute)||void 0===r?void 0:r.call(s,t))===n)?s:s&&s.parentNode&&o(s.parentNode)||null;var r};return o(e)}const oe="SUBMIT";function se(e,t){return t?(e.classes=`${e.classes||""} ${t.classes||""}`.trim(),Object.keys(t).forEach((n=>{if("element"===n||"classes"===n)return;const i=t[n];i&&"object"==typeof i&&!Array.isArray(i)?e[n]=Object.assign(Object.assign({},e[n]||{}),i):e[n]=i})),e):e}const re={DESKTOP:"desktop",MOBILE:"mobile"};function ae(e,t,n){var i;return null===(i=null==e?void 0:e[t])||void 0===i?void 0:i.find((e=>e.element===n))}function le(e){const{element:t,html:n,appendHtml:i}=e,o=function(e){if(null==e)return"";if("string"!=typeof e)return String(e);if(""===e)return"";if(!/<\/?([a-zA-Z][a-zA-Z0-9]*)\b[^>]*>/.test(e))return e;const t=(new DOMParser).parseFromString(e,"text/html");return t.querySelectorAll('script, style, link[rel="stylesheet"], meta[http-equiv]').forEach((e=>e.remove())),t.querySelectorAll("*").forEach((e=>{if(["onclick","onload","onerror","onmouseover","onfocus","onblur","onkeyup","onkeydown","onchange","onsubmit","onmouseenter","onmouseleave","onmouseout","oncontextmenu","ondrag","ondrop"].forEach((t=>e.removeAttribute(t))),Array.from(e.attributes).forEach((t=>{t.name.startsWith("on")&&e.removeAttribute(t.name)})),"A"===e.tagName||"AREA"===e.tagName){const t=e.getAttribute("href");t&&(t.startsWith("javascript:")||t.startsWith("data:"))&&e.removeAttribute("href")}if("IMG"===e.tagName||"IFRAME"===e.tagName){const t=e.getAttribute("src");t&&(t.startsWith("javascript:")||t.startsWith("data:text/html"))&&e.removeAttribute("src")}if("FORM"===e.tagName){const t=e.getAttribute("action");t&&t.startsWith("javascript:")&&e.removeAttribute("action")}})),t.body.innerHTML}(n);i?t.innerHTML+=o:t.innerHTML=o}class ce extends Event{constructor(e,t,n){super(e,n),this.detail={},Object.defineProperty(this,"detail",{value:t})}}var de;!function(e){e.STATIC="STATIC",e.UPDATING="UPDATING"}(de||(de={}));class he extends HTMLElement{constructor(){var i;super(),this.skipGameBlur=!0,this.construct=()=>{let e;const t=this.getAttribute(n("id")),i=this.getWidgetContainerNode();if(!i)throw new Error("Widget container not found in construct");const o=i.closest(`[${n("widget-id")}]`);let s;o&&(s=o.getAttribute(n("widget-id")));let r=new ce("cl-props-request",{nodeName:this.nodeName,path:this.getAttribute(n("path")),id:t,widgetId:s},{bubbles:!0,composed:!0});this.dispatchEvent(r),e=r.detail.props,Object.assign(this,e),this.observers=X(ee,te,ne),this.subscriptions=new class{constructor(){this.subscriptions=[]}push(e){this.subscriptions.push(e)}off(){this.subscriptions.forEach((e=>null==e?void 0:e.off()))}},this.state=new T({}),this.componentEventEmitter=new f,this.componentResourceManager=new Z(this.model.id,this.services.eventEmitter,this.isStaticRenderMode()),this.mergeTagsProcessor=this.services.mergeTagsProcessorFactory.create(),this._actionFactory=this.services.actionFactory,this._handlerFactory=new b(this._actionFactory,this.services.actionRegister),this.prevProps=this.model.props,this.prevEnvironment=this.getEnvironment(),this.documentModel.on(`COMPONENT_PROPS_UPDATE_${this.model.id}`,(e=>{this.model.props=e,this.observers.get(ee).forEach((t=>t(this.prevProps,e))),this.prevProps=e;const t=this.getHostElement(),i=n("floating");e.floating&&!t.getAttribute(i)?t.setAttribute(i,"true"):!e.floating&&t.getAttribute(i)&&t.removeAttribute(i)})),this.documentModel.on(`COMPONENT_UPDATE_${this.model.id}`,(e=>{Object.assign(this.model,e)})),this.documentModel.on("SHARED_UPDATE_ALL",(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles),this.observers.get(te).forEach((e=>e(this.getShared())))})),this.model.props.backgroundDynamicInlineSVGElements&&(this.colorSchemaListener=new G(this.documentModel,this.getHostElement(),(()=>this.getShared()),(()=>this.model.props),(()=>this.getEnvironment()),$),this.colorSchemaListener.apply(this.getEnvironment()).then((()=>{this.subscriptions.push(this.colorSchemaListener.on())}))),this.prevProps.adaptiveStyles&&this.subscriptions.push(this.resizeListener.on(B.changeEventName,(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles);const e=this.getEnvironment();this.observers.get(ne).forEach((t=>t(this.prevEnvironment,e))),this.prevEnvironment=e}))),this.subscriptions.push(this.services.eventEmitter.on("GAME_PHASE_READY_TO_PLAY",(()=>{this.skipGameBlur||this.getHostElement().classList.add("cl-game-spotlight-component")}))),this.subscriptions.push(this.services.eventEmitter.on("GAME_PHASE_COMPLETED",(()=>{this.skipGameBlur||this.getHostElement().classList.remove("cl-game-spotlight-component")})))},this.attachHandlers=()=>{this.getHandlers().map((e=>this._handlerFactory.get(e))).map((e=>()=>e.activate(this.state,this.componentEventEmitter,this.getHostElement.bind(this)))).forEach((e=>e()))},this.postponeHandlers=()=>{var e;null===(e=this.handlers)||void 0===e||e.forEach((e=>e.postpone()))},this.releaseHandlers=()=>{var e;null===(e=this.handlers)||void 0===e||e.forEach((e=>e.release()))},this.getProps=()=>{var e;return null===(e=this.getModel())||void 0===e?void 0:e.props},this.getShared=()=>this.documentModel.getShared(),this.getEnvironment=()=>this.resizeListener.isMobile()?"mobile":"desktop",this.isStaticRenderMode=()=>this.services.config.getConfig("renderMode")===de.STATIC,this.isUpdatingRenderMode=()=>this.services.config.getConfig("renderMode")===de.UPDATING,this.getRootElement=()=>this.shadowRoot?this.shadowRoot:this,this.getHostElement=()=>this,this.observeProps=e=>{this.observers.get(ee).push(e),e(null,this.prevProps)},this.observeShared=e=>{this.observers.get(te).push(e),e(this.getShared())},this.observeEnvironment=e=>{this.observers.get(ne).push(e),e(null,this.getEnvironment())},this.getElements=()=>[this.getHostElement(),...Array.from(this.getRootElement().querySelectorAll(`[${n("element")}]`)).filter((e=>!e.hasAttribute(n("component"))))],this.getElement=(e,t)=>this.getElements().find((i=>t?i.getAttribute(n("element"))===e&&i.id===t:i.getAttribute(n("element"))===e)),this.applyAutoAdaptiveStyles=(e,t)=>{if(!e&&!t)return;const i=this.getElements();if(!i.length)return;const o=function(e,t){if(!t)return e||{desktop:[],mobile:[]};const n=JSON.parse(JSON.stringify(e||{desktop:[],mobile:[]}));return t.forEach((e=>{const t=e.element;let i=!1,o=!1;n.desktop&&n.desktop.forEach((n=>{n.element===t&&(se(n,e),i=!0)})),n.mobile&&n.mobile.forEach((n=>{n.element===t&&(se(n,e),o=!0)})),!i&&n.desktop&&n.desktop.push(JSON.parse(JSON.stringify(e))),!o&&n.mobile&&n.mobile.push(JSON.parse(JSON.stringify(e)))})),n}(e,t),s=n("type"),r="element-styles";let a=this.getRootElement().querySelector(`style[${s}="${r}"]`);a||(a=document.createElement("style"),a.setAttribute(s,r),this.getRootElement().appendChild(a)),le({element:a,html:""}),i.forEach((e=>{let t=e.getAttribute(n("element"));const i=this.getEnvironment();let s=ae(o,i,t);if(s){if(this.resizeListener.isMobile()){const e=ae(o,"desktop",t);e&&(s=Object.assign(Object.assign({},s),{styleAttributes:Object.assign(Object.assign({},e.styleAttributes),s.styleAttributes)}))}this.applyStylesToElement(e,this.applySharedClassesToElementModel(s),a)}})),this._addLinkColor(a,this.getShared())},this.registerComponentResourceManagement=()=>{this.viewResourceManager.registerComponent(this.model.id,this.componentResourceManager)},this.applyStyles=(e,t={})=>{if(!e||!e.style)return!1;for(const[n,i]of Object.entries(t))e.style[n]=i;return!0},this.applyStylesToElement=(e,t,i)=>{var o,s;const r=[];"host"===(t=he._resolveTogglableStylesForElementModel(t)).element&&(W.applyHostStyles(this.model.type,e,null,this.layoutType),("desktop"===this.getEnvironment()&&(null===(o=this.model.props.backgroundDynamicInlineSVGElements)||void 0===o?void 0:o.desktop)||"mobile"===this.getEnvironment()&&(null===(s=this.model.props.backgroundDynamicInlineSVGElements)||void 0===s?void 0:s.mobile))&&(this.colorSchemaListener.apply(this.getEnvironment()),r.push("background")));let a=t.styleAttributes.background,l=a&&a.match(/url\("([^"]*)"\)/);if(this.manifest.waitForResourcesLoad&&l){this.componentResourceManager.getPending().increment();const e=new Image;e.src=l[1],O(e,"load",(()=>{this.componentResourceManager.getPending().decrement()})),O(e,"error",(()=>{this.componentResourceManager.onResourceLoadFailure(e.src),this.isUpdatingRenderMode&&this.componentResourceManager.getPending().decrement()}))}const c=Object.assign(Object.assign({},t),{styleAttributes:K(t.styleAttributes,r)});if(j.set(e,c),this._setClassAttributes(e,t),i){if(t.hoverStyleAttributes){let o=Object.assign({},t.hoverStyleAttributes);if("FILL_UP"===t.hoverAnimationType){e.style.boxShadow="inset 0px 0px 0px 0px rgb(0, 0, 0, 0)",e.style.overflow="hidden";const n=e.tagName.toLowerCase(),i=`flip-up-animation-${t.element}`;let s=this.getRootElement().querySelector(`#${i}`);s||(s=document.createElement("style"),s.id=i,e.appendChild(s)),le({element:s,html:`\n ${n}::before {\n content: '';\n background: ${o.background};\n position: absolute;\n left: 0;\n top: ${e.getBoundingClientRect().height}px;\n height: ${e.getBoundingClientRect().height}px;\n width: 100%;\n z-index: -10;\n }\n ${n}:hover::before {\n top: 0;\n transition: 0.3s;\n }\n `}),o=Object.assign(Object.assign({},t.hoverStyleAttributes),{background:"transparent",position:"relative"})}o.borderTopWidth&&"0px"!==o.borderTopWidth||delete o.borderTopColor,o.borderBottomWidth&&"0px"!==o.borderBottomWidth||delete o.borderBottomColor,o.borderLeftWidth&&"0px"!==o.borderLeftWidth||delete o.borderLeftColor,o.borderRightWidth&&"0px"!==o.borderRightWidth||delete o.borderRightColor,this._addStylesToStyleElement(i,t.element,o,`:not(.${n("no-hover")}):hover`,!0)}t.placeholderStyleAttributes&&this._addStylesToStyleElement(i,t.element,t.placeholderStyleAttributes,"::placeholder"),this._addFontStylesToStyleElement(i,this.getShared()),this.stylesAppliedToElement(e,t,i)}},this.applySharedClassesToElementModel=t=>function(t,n){let i=t;return(i.classes||"").split(" ").filter((t=>t.startsWith(e))).forEach((e=>{var t;let o=null===(t=n.textClasses)||void 0===t?void 0:t[e];o&&(o.styleAttributes.fontFamily||(o.isHeader&&n.headerFontFamily&&(o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},o.styleAttributes),{fontFamily:n.headerFontFamily})})),!o.isHeader&&n.textFontFamily&&(o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},o.styleAttributes),{fontFamily:n.textFontFamily})}))),i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},i.styleAttributes),o.styleAttributes),placeholderStyleAttributes:Object.assign(Object.assign({},i.placeholderStyleAttributes),o.placeholderStyleAttributes)}))})),i.styleAttributes.fontFamily||(i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},i.styleAttributes),{fontFamily:n.textFontFamily})})),i}(t,this.documentModel.getShared()),this.getModel=()=>this.model,this._addStylesToStyleElement=(e,t,i,o="",s)=>{const r=Object.keys(i).reduce(((e,t)=>e+` ${z.camelCaseToDashCase(t)}: ${i[t]}${s?" !important;":";"}`),"");le({element:e,html:`[${n("element")}="${t}"]${o} { ${r} }`,appendHtml:!0})},this._addFontStylesToStyleElement=(e,t)=>{le({element:e,html:`[cl-type] {font-family:${t.textFontFamily||"inherit"}}`,appendHtml:!0})},this._addLinkColor=(e,t)=>{var n,i,o,s;t.linkColor&&le({element:e,html:`a {color: ${t.linkColor}}, a:visited {color: ${t.linkColor}}`,appendHtml:!0}),(null===(n=t.linkParams)||void 0===n?void 0:n.color)&&le({element:e,html:`a {color: ${null===(i=t.linkParams)||void 0===i?void 0:i.color}}, a:visited {color: ${null===(o=t.linkParams)||void 0===o?void 0:o.color}}`,appendHtml:!0}),(null===(s=t.linkParams)||void 0===s?void 0:s.removeUnderline)&&le({element:e,html:"a {text-decoration: none}, a:visited {text-decoration: none}",appendHtml:!0})},this._setClassAttributes=(n,i)=>{Array.from(n.classList).filter((e=>e!==t("hovered")&&e!==t("focused"))).forEach((t=>{t.startsWith(e)&&n.classList.remove(t)}));const o=((n.getAttribute("class")||"")+" "+i.classes).trim();n.setAttribute("class",o)},this.getParentComponent=()=>ie(this.parentNode,n("element"),"host"),this.getWidgetContainerNode=()=>{const e=null==this?void 0:this.getAttribute(n("path"));return 1===(null==e?void 0:e.split(",").length)?this.parentNode:ie(this.parentNode,n("path"),void 0,(e=>1===(null==e?void 0:e.split(",").length)))},this.getWidgetLanguages=()=>function(e){return[e.getConfig("appearanceLanguage"),e.getConfig("browserLanguage"),"en"].filter((e=>!!e))}(this.services.config),this.getPreferredWidgetLanguage=()=>this.getWidgetLanguages()[0],this.getTranslationsMap=e=>function(e,t){return t.reduce(((t,n)=>{if(t)return t;const i=function(e,t){if(!e)return null;if(t[e])return{translations:t[e],language:e};const n=function(e){return e.includes("-")?e.split("-")[0].toLowerCase():e.includes("_")?e.split("_")[0].toLowerCase():e}(e);return t[n]?{translations:t[n],language:n}:null}(n,e);return i||null}),null)}(e,this.getWidgetLanguages()),this.stylesAppliedToElement=(e,t,n)=>{},this.updateContext=()=>{var e;const t=this.getModel();this.services.context.updateRecord(t.id,{label:this.getContextRecordLabel(t.props),viewIndex:null===(e=t.path)||void 0===e?void 0:e[0]})},this.addContextRecord=()=>{var e;const t=this.getModel();this.services.context.addRecord(t.id,{recordKey:t.id,id:t.props.control.name,label:this.getContextRecordLabel(t.props),value:t.props.control.defaultValue||"",viewIndex:null===(e=t.path)||void 0===e?void 0:e[0],sourceId:"FORM",initialData:{fallbackValue:"",exampleValue:this.getContextRecordExampleValue(t.props)}})},this.getContextRecordLabel=e=>{var t,n,i,o,s,r;const a=e.control.name;if(["email","first_name","last_name"].includes(a))return a.toUpperCase();if((null===(t=e.content)||void 0===t?void 0:t.label)&&(null===(o=null===(i=null===(n=e.adaptiveStyles)||void 0===n?void 0:n.desktop.find((e=>"label"===e.element)))||void 0===i?void 0:i.params)||void 0===o?void 0:o.enabled)){const t=(new DOMParser).parseFromString(e.content.label,"text/html");return this.capitalizeFirstLetter(t.body.textContent||"")}return(null===(s=e.content)||void 0===s?void 0:s.placeholder)?this.capitalizeFirstLetter(e.content.placeholder):(null===(r=e.control)||void 0===r?void 0:r.integrationName)?this.capitalizeFirstLetter(e.control.integrationName).replace(new RegExp("_","g")," "):void 0},this.capitalizeFirstLetter=e=>e.charAt(0).toUpperCase()+e.slice(1),this.getContextRecordExampleValue=e=>{var t;switch(null===(t=e.control)||void 0===t?void 0:t.name){case"email":return"myemail@example.com";case"first_name":return"Maria";case"last_name":return"Taylor";default:return this.getContextRecordLabel(e)}},this.completeSubmitAction=e=>{const t=e||{},n=this.services.actionRegister.getRegisteredActions().find((e=>e.category===oe));n?null==n||n.execute(void 0,void 0,!0,t):this.services.actionFactory.get({type:u.REQUEST}).execute(void 0,void 0,!0,t)},this.getHandlers=()=>{var e;return(null===(e=this.getProps())||void 0===e?void 0:e.handlers)&&this.getProps().handlers.length?[...this.getProps().handlers]:[]},this.assets=(e="")=>`${this.services.config.getConfig("staticResourcesUrl").replace(/\/$/,"")}/${this.manifest.name}/assets${e?`/${e}`:""}`,this.attachShadow({mode:"open"}),this.manifest=this.manifest||(null===(i=this.constructor.define)||void 0===i?void 0:i.manifest)}connectedCallback(){this.construct(),this.registerComponentResourceManagement(),Promise.resolve().then((()=>{this.attachHandlers()}));const e=document.createElement("style");e.textContent='\n :host(.cl-game-spotlight-component)::after {\n content: "";\n position: absolute;\n background-size: 100% 100%;\n background-repeat: no-repeat;\n overflow: visible;\n \n backdrop-filter: blur(4px);\n \n inset: -30px;\n mask-image: \n linear-gradient(to bottom, transparent, grey 30px, grey calc(100% - 30px), transparent),\n linear-gradient(to right, transparent, grey 30px, grey calc(100% - 30px), transparent);\n mask-composite: intersect;\n -webkit-mask-composite: source-in; /* for Chrome/Safari */\n \n transition: opacity 0.35s ease;\n pointer-events: auto;\n }\n ',this.getRootElement().prepend(e)}disconnectedCallback(){var e;this.observers.clear(),this.subscriptions.off(),this.state.destroy(),this.componentEventEmitter.destroy(),null===(e=this.mergeTagsProcessor)||void 0===e||e.destroy()}}he._resolveTogglableStylesForElementModel=e=>{const t=Object.assign({},e);return Object.keys(t).forEach((e=>{e.toLowerCase().includes("styleattributes")&&(t[e]=he._resolveTogglableStyles(t[e]))})),t},he._resolveTogglableStyles=e=>{const t=Object.assign({},e),n=(e,n,i)=>{n in t&&(e.forEach((e=>{e in t&&(t[e]=t[n]?t[e]:i)})),delete t[n])};return n(["marginTop","marginBottom","marginLeft","marginRight"],"_marginEnabled","0px"),n(["paddingTop","paddingBottom","paddingLeft","paddingRight"],"_paddingEnabled","0px"),t};const ue=he;function pe(e){return Object.values(re).map((t=>({type:"GROUP",propPath:["adaptiveStyles",t],children:e})))}const me={name:"SysVideoComponent",componentType:"VIDEO",version:"1.0.0",contextMenuModel:pe([{type:"CONTROL",name:"COMPONENT_OPERATIONS"},{type:"CONTROL",name:"BRING_BACK_FORWARD",element:"host",elementProp:"styleAttributes",elementSubProp:"zIndex"},{type:"CONTROL",name:"FOCUS_PARENT_COMPONENT"}]),floatingControlsModel:pe([{type:"CONTROL",name:"SIZE",elementProp:"styleAttributes",element:"host",params:{height:{hide:!0}}},{type:"CONTROL",name:"MARGIN",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"CONTAINER_PADDING",elementProp:"styleAttributes",element:"host"}]),propertyPaneModel:{content:pe([{type:"CONTROL",name:"SIZE",element:"host",elementProp:"styleAttributes",params:{width:{options:["fixed","fill"]}}},{type:"CONTROL",name:"BORDERS",propPath:["styles","[element=host]","styleAttributes"]},{type:"CONTROL",name:"BOX_SHADOW",propPath:["styles","[element=host]","styleAttributes"]},{type:"CONTROL",name:"BORDER_RADIUS",propPath:["styles","[element=host]","styleAttributes"]},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"MARGIN"}}]),general:[{type:"CONTROL",name:"VIDEO_URL",propPath:["control","youtubeUrl"],params:{label:"DOCUMENT_YOUTUBE_URL",placeholder:"https://www.youtube.com/watch..."}},{type:"CONTROL",name:"SWITCH",propPath:["content","autoplay"],params:{label:"DOCUMENT_AUTOPLAY",boldLabel:!0,description:"DOCUMENT_AUTOPLAY_DESCRIPTION"}},{type:"CONTROL",name:"VIDEO_CUSTOM_COVER",elementProp:"styleAttributes",element:"overlay",params:{aspectRatioPropPath:["content","aspectRatio"],showPlayButtonPropPath:["content","showPlayButton"]}}]},events:{dispatch:[],listen:[]},i18nPropertyPaneModel:{content:[{type:"CONTROL",name:"VIDEO_URL",propPath:["control","youtubeUrl"],params:{label:"DOCUMENT_YOUTUBE_URL",placeholder:"https://www.youtube.com/watch..."}}]},i18nPropPaths:["control,youtubeUrl","content,videoId","content,aspectRatio"],i18n:{},props:{content:{videoId:null,autoplay:!1,aspectRatio:1.7777777777777777,videoPreviewImageUrl:null,showPlayButton:!0},control:{},styles:[{element:"host",styleAttributes:{borderTopStyle:"solid",borderRightStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"solid",borderTopWidth:"0px",borderTopColor:"rgb(0, 0, 0)",borderBottomWidth:"0px",borderBottomColor:"rgb(0, 0, 0)",borderLeftWidth:"0px",borderLeftColor:"rgb(0, 0, 0)",borderRightWidth:"0px",borderRightColor:"rgb(0, 0, 0)",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",boxShadow:"none"},classes:""}],adaptiveStyles:{desktop:[{element:"host",styleAttributes:{width:"350px",minWidth:"350px",height:"197px",minHeight:"197px",marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1,overflow:"hidden"},classes:""},{element:"overlay",styleAttributes:{background:null},classes:""}],mobile:[{element:"host",styleAttributes:{width:"350px",minWidth:"350px",height:"197px",minHeight:"197px",marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1,overflow:"hidden"},classes:""},{element:"overlay",styleAttributes:{background:null},classes:""}]}},metaDescription:{icon:"/SysVideoComponent/assets/img/component-icon.svg",label:{en:"Video",ru:"Видео",uk:"Вiдео",es:"Video",de:"Video",fr:"Vidéo",it:"Video",pt:"Vídeo",ro:"Video",bg:"Видео",cs:"Rádio",el:"Ραδιόφωνο",nl:"Radio",pl:"Radio",sv:"Radio",tr:"Video",ar:"الفيديو",zh:"视频",da:"Video",he:"וידאו",fi:"Video",hi:"वीडियो",hr:"Video",hu:"Videó",id:"Video",ja:"ビデオ",ko:"비디오",no:"Video",sk:"Video",sl:"Video",sr:"Video zapis"}},syncEnabled:!0,stylesImitationEnabled:!0};function ge(e){return ge="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ge(e)}function ye(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,Se(i.key),i)}}function be(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(be=function(){return!!e})()}function ve(e,t,n,i){var o=Ee(fe(1&i?e.prototype:e),t,n);return 2&i&&"function"==typeof o?function(e){return o.apply(n,e)}:o}function Ee(){return Ee="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=fe(e)););return e}(e,t);if(i){var o=Object.getOwnPropertyDescriptor(i,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},Ee.apply(null,arguments)}function fe(e){return fe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},fe(e)}function Oe(e,t){return Oe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Oe(e,t)}function Te(e,t,n){return(t=Se(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Se(e){var t=function(e){if("object"!=ge(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=ge(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ge(t)?t:t+""}var Ce=function(){function e(){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Te(t=function(e,t,n){return t=fe(t),function(e,t){if(t&&("object"==ge(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,be()?Reflect.construct(t,n||[],fe(e).constructor):t.apply(e,n))}(this,e),"adjustVideoHeight",(function(e,n){if(e){var i=t.getHostElement(),o=n||i.getBoundingClientRect().width,s="".concat(o/e,"px");i.style.height=s,i.style.minHeight=s}})),Te(t,"updatePlayButtonVisibility",(function(e,n,i){var o=t.getRootElement().querySelector(".video-overlay"),s="--cl-video-component-play-btn-visibility";return i&&!n?o.style.setProperty(s,"visible"):n?void(e.content.showPlayButton?o.style.setProperty(s,"visible"):o.style.setProperty(s,"hidden")):o.style.setProperty(s,"hidden")})),Te(t,"preloadImage",(function(e,t){var n=new Image;n.src=e,n.onload=function(){return t()},n.onerror=function(){return t()}})),Te(t,"displayPreviewImageAfterImageLoaded",(function(e,n,i){if(n||i){var o=t.isUpdatingRenderMode(),s=e.querySelector("#youtube-player");if(i){var r=i.split(")")[0].slice(5,-1);!o&&s&&(s.style.opacity="0"),t.preloadImage(r,(function(){t.displayPreviewImage(e,n,i),!o&&s&&(s.style.opacity="1")}))}else t.displayPreviewImage(e,n,i)}})),Te(t,"displayPreviewImage",(function(e,n,i){var o=e.querySelector(".video-overlay"),s=e.querySelector("#youtube-player");o.style.setProperty("--cl-video-component-overlay-visibility","visible"),i||setTimeout((function(){return o.style.backgroundImage="url(".concat(n,")")})),s&&(o.onclick=function(){s.src=s.src+"&autoplay=1",s.onload=function(){return t.hidePreviewImage(e)}})})),Te(t,"hidePreviewImage",(function(e){var t=e.querySelector(".video-overlay");t.style.setProperty("--cl-video-component-overlay-visibility","hidden"),t.style.setProperty("--cl-video-component-play-btn-visibility","hidden"),t.style.backgroundImage="none"})),Te(t,"createUpdatedIFrame",(function(e){var t=document.createElement("iframe");return t.src=e,t.id="youtube-player",t.allow="autoplay",t.setAttribute("frameborder","0"),t})),Te(t,"manifest",me),Te(t,"resizeObserver",void 0),t.getRootElement().innerHTML="\n ".concat("\n <style>\n .main-container {\n height: 100%;\n overflow: hidden;\n position: relative;\n box-shadow: 0 0 0 3px inset #a1a1a1;\n background: #515151;\n background-repeat: no-repeat;\n background-position: center;\n background-image: url(\"data:image/svg+xml,%3Csvg%20width%3D%2244%22%20height%3D%2231%22%20viewBox%3D%220%200%2044%2031%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M19.4898%2010.6062C20.1401%2010.2582%2020.9292%2010.2963%2021.5429%2010.7055L26.2391%2013.8363C26.7955%2014.2072%2027.1297%2014.8317%2027.1297%2015.5004C27.1297%2016.1691%2026.7955%2016.7936%2026.2391%2017.1645L21.5429%2020.2953C20.9292%2020.7044%2020.1401%2020.7426%2019.4898%2020.3946C18.8395%2020.0465%2018.4335%2019.3688%2018.4335%2018.6312V12.3696C18.4335%2011.632%2018.8395%2010.9543%2019.4898%2010.6062ZM6.3803%203.05351C4.68417%203.18398%203.32052%204.50218%203.13266%206.19292C2.44536%2012.3786%202.44536%2018.6214%203.13266%2024.8071C3.32052%2026.4978%204.68417%2027.816%206.3803%2027.9465L14.4857%2028.57C19.4891%2028.9549%2024.5147%2028.9549%2029.5182%2028.57L37.6235%2027.9465C39.3197%2027.816%2040.6833%2026.4978%2040.8712%2024.8071C41.5585%2018.6214%2041.5585%2012.3786%2040.8712%206.19292C40.6833%204.50218%2039.3197%203.18398%2037.6235%203.05351L29.5182%202.43002C24.5147%202.04514%2019.4891%202.04514%2014.4857%202.43002L6.3803%203.05351ZM20.4335%2012.3696V18.6312L25.1297%2015.5004L20.4335%2012.3696ZM1.14489%205.97206C1.43886%203.32634%203.57274%201.26357%206.2269%201.0594L14.3323%200.435909C19.4378%200.0431735%2024.566%200.0431736%2029.6716%200.435909L37.7769%201.0594C40.4311%201.26357%2042.565%203.32633%2042.8589%205.97206C43.5626%2012.3045%2043.5626%2018.6955%2042.8589%2025.0279C42.565%2027.6737%2040.4311%2029.7364%2037.7769%2029.9406L29.6716%2030.5641C24.566%2030.9568%2019.4378%2030.9568%2014.3323%2030.5641L6.2269%2029.9406C3.57274%2029.7364%201.43886%2027.6737%201.14489%2025.0279C0.441285%2018.6955%200.441285%2012.3045%201.14489%205.97206Z%22%20fill%3D%22%23a1a1a1%22%2F%3E%0A%3C%2Fsvg%3E%0A\");\n }\n \n .video-overlay {\n visibility: var(--cl-video-component-overlay-visibility, hidden);\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background-size: cover;\n background-repeat: no-repeat;\n background-position: center;\n cursor: pointer;\n }\n \n .video-overlay:after {\n content: '';\n visibility: var(--cl-video-component-play-btn-visibility, hidden);\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background-repeat: no-repeat;\n background-position: center;\n background-size: 64px 48px;\n background-image: url(\"data:image/svg+xml,%3Csvg width='159' height='110' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m154 17.5c-1.82-6.73-7.07-12-13.8-13.8-9.04-3.49-96.6-5.2-122 0.1-6.73 1.82-12 7.07-13.8 13.8-4.08 17.9-4.39 56.6 0.1 74.9 1.82 6.73 7.07 12 13.8 13.8 17.9 4.12 103 4.7 122 0 6.73-1.82 12-7.07 13.8-13.8 4.35-19.5 4.66-55.8-0.1-75z' fill='%23f00'/%3E%3Cpath d='m105 55-40.8-23.4v46.8z' fill='%23fff'/%3E%3C/svg%3E%0A\");\n }\n \n #youtube-player {\n width: 100%;\n height: 100%;\n }\n </style>\n ",'\n <div class="main-container" cl-element="main">\n <div class="video-overlay" cl-element="overlay"></div>\n <iframe\n id="youtube-player"\n src=""\n allow="autoplay"\n frameborder="0">\n </iframe>\n </div>\n '),t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Oe(e,t)}(e,ue),function(e,t){return t&&ye(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(e,[{key:"connectedCallback",value:function(){var t=this;ve(e,"connectedCallback",this,3)([]);var n=this.getRootElement(),i=this.isUpdatingRenderMode(),o=this.services.config.getConfig("previewMode");window.ResizeObserver&&(this.resizeObserver=new ResizeObserver((function(e){window.requestAnimationFrame((function(){if(Array.isArray(e)&&e.length){var n=e[0].contentRect;t.adjustVideoHeight(t.getProps().content.aspectRatio,n.width)}}))})),this.resizeObserver.observe(n.querySelector(".main-container")));var s=function(e){return!i&&!o&&e},r=function(e,i){var o=n.querySelector("#youtube-player");if(e){var r="https://www.youtube.com/embed/".concat(e,"?controls=1").concat(s(i)?"&autoplay=1&mute=1":"");if(!o||o.src!==r){var a,l=t.createUpdatedIFrame(r);null===(a=n.querySelector("#youtube-player"))||void 0===a||a.remove(),n.querySelector(".main-container").appendChild(l),s(i)&&(l.onload=function(){t.hidePreviewImage(n)})}}else{var c;null===(c=n.querySelector("#youtube-player"))||void 0===c||c.remove()}};this.observeProps((function(e,i){var s,a=t.getEnvironment(),l=null===(s=i.adaptiveStyles[a])||void 0===s||null===(s=s.find((function(e){return"overlay"===e.element})))||void 0===s?void 0:s.styleAttributes.background;t.applyAutoAdaptiveStyles(i.adaptiveStyles,i.styles),o||r(i.content.videoId,i.content.autoplay),(o||l)&&t.displayPreviewImageAfterImageLoaded(n,i.content.videoPreviewImageUrl,l,r),t.updatePlayButtonVisibility(i,l,o),t.adjustVideoHeight(i.content.aspectRatio)}))}},{key:"disconnectedCallback",value:function(){var t;ve(e,"disconnectedCallback",this,3)([]),window.ResizeObserver&&(null===(t=this.resizeObserver)||void 0===t||t.unobserve(this.getRootElement().querySelector(".main-container")))}}])}();Te(Ce,"define",{name:"sys-video",model:me.name,manifest:me});export{Ce as default};window.clComponentClass_SysVideoComponent=Ce;
1
+ const e="cl-";function t(t){return e+t}function n(e){return"cl-"+e}const i="VIEW",o="MODULE",s="CONTAINER",r="INPUT",a="BUTTON",l="CONSENT",c="COLUMN";var d,u;(u=d||(d={})).SUBSCRIBE_CONTACT="SUBSCRIBE_CONTACT",u.REQUEST="REQUEST",u.DISPATCH_EVENT="DISPATCH_EVENT",u.GO_TO_VIEW="GO_TO_VIEW",u.GO_TO_PREVIOUS_VIEW="GO_TO_PREVIOUS_VIEW",u.GO_TO_NEXT_VIEW="GO_TO_NEXT_VIEW",u.SHOW_WIDGET="SHOW_WIDGET",u.OPEN_LINK="OPEN_LINK",u.CLOSE_WIDGET="CLOSE_WIDGET",u.CLICK="CLICK";const h=d;var p,m;class g{static sortActions(e){const t={[h.CLOSE_WIDGET]:-1,[h.OPEN_LINK]:-2,[h.SHOW_WIDGET]:1,[h.SUBSCRIBE_CONTACT]:2,[h.REQUEST]:3},n=e=>void 0!==t[e.type]?t[e.type]:0;return[...e].sort(((e,t)=>n(e)>n(t)?-1:n(e)<n(t)?1:0))}constructor(e,t){this.config=e,this.actions=g.sortActions(t),this.listener=null,this.targetElements=[],this.eventsQueue=[],this.state=null,this.postponed=!1}activate(e,t,i){this.state=e;const o=i(),s=o.getAttribute(n("id"));this.listener=e=>{const t=e.composedPath().filter((e=>e instanceof HTMLElement&&e.getAttribute(n("type"))));let i=0;for(;t[i]&&t[i].getAttribute(n("id"))!==s;){let e=t[i].getAttribute(n("type"));if(g.IGNORING_VIEW_ENTRY_TYPES.includes(e))return;i++}this.eventsQueue.push({event:e}),this.postponed||this.execute()},this.targetElements=this.config.relativeSelector?Array.from((o.shadowRoot||o).querySelectorAll(this.config.relativeSelector)):[o],this.targetElements.forEach((e=>{e.addEventListener("click",this.listener)}))}async execute(){var e,t,n,i;try{for(var o,s=!0,r=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(n){t[n]=e[n]&&function(t){return new Promise((function(i,o){!function(e,t,n,i){Promise.resolve(i).then((function(t){e({value:t,done:n})}),t)}(i,o,(t=e[n](t)).done,t.value)}))}}}(this.eventsQueue);!(e=(o=await r.next()).done);s=!0){i=o.value,s=!1;const{event:e}=i;for(const t of this.actions)if(!await t.execute(this.state.getState(),e))break}}catch(e){t={error:e}}finally{try{s||e||!(n=r.return)||await n.call(r)}finally{if(t)throw t.error}}this.eventsQueue=[]}postpone(){this.postponed=!0}release(){this.postponed=!1,this.execute()}destroy(){this.listener&&this.targetElements.length&&(this.targetElements.forEach((e=>{e.removeEventListener("click",this.listener)})),this.targetElements=[])}}g.IGNORING_VIEW_ENTRY_TYPES=[a,l,r],(m=p||(p={})).CLICK="CLICK",m.COMPONENT_EVENT="COMPONENT_EVENT";class y{constructor(e,t){this.config=e,this.actions=t,this.componentEmitterListener=null}activate(e,t,n){this.componentEmitterListener=t.on(this.config.eventName,(()=>{this.actions.forEach((t=>t.execute(e.getState(),this.config.params)))}))}destroy(){this.componentEmitterListener&&this.componentEmitterListener.off()}}class b{constructor(e,t){this.actionFactory=e,this.actionRegister=t}get(e){const t=e.actions.map((e=>this.actionFactory.get(e)));switch(t.forEach((e=>this.actionRegister.register(e))),e.type){case p.CLICK:return new g(e,t);case p.COMPONENT_EVENT:return new y(e,t);default:throw new Error(`Not supported handler type ${e.type}`)}}}class v{static generate(){let e,t="";for(let n=0;n<32;n++)8!==n&&12!==n&&16!==n&&20!==n||(t+="-"),e=Math.floor(16*Math.random()).toString(16).toUpperCase(),t+=e;return t}}class E{constructor(){this.listeners=E.createDefaultListenersState()}emit(e,t,n=null){const i=this.listeners[e];i&&Object.values(i).forEach((i=>i(t,e,n))),Object.values(this.listeners["*"]).forEach((i=>i(t,e,n)))}on(e,t){const n=v.generate(),i=this.listeners[e];return i?i[n]=t:this.listeners[e]={[n]:t},{off:()=>{var t,i;(null===(i=null===(t=this.listeners)||void 0===t?void 0:t[e])||void 0===i?void 0:i[n])&&delete this.listeners[e][n]}}}destroy(){this.listeners=E.createDefaultListenersState()}}E.createDefaultListenersState=()=>({"*":{}});const f=E,O=(e,t,n,i)=>{const o=EventTarget.prototype,{addEventListenerBase:s,addEventListener:r}=o;(s||r).call(e,t,n,i)};class T{constructor(e){this.state=e||{}}getState(){return this.state}setState(e){this.state=Object.assign(Object.assign({},this.state),e)}destroy(){}}class S{static extract(e){const t=e.views.map((e=>{const t=e.children.map((e=>e.type===o?Object.assign(Object.assign({},e),S.moduleToContainerParams):e));return Object.assign(Object.assign({},e),{children:t})}));return Object.assign(Object.assign({},e),{views:t})}static sort(e,t){return e.index>t.index?1:-1}static reIndex(e,t){return Object.assign(Object.assign({},e),{index:t+e.index})}}var C,_,R,A,I,L,N,P,M,w,U,x,D;S.moduleToContainerParams={name:"SysContainerComponent",version:"1.0.0"},(_=C||(C={})).VIEW="VIEW",_.CONTAINER="CONTAINER",_.TEXT="TEXT",_.INPUT="INPUT",_.BUTTON="BUTTON",_.IMAGE="IMAGE",_.CONSENT="CONSENT",_.COUNTDOWN_TIMER="COUNTDOWN_TIMER",_.PROMO_CODE="PROMO_CODE",_.MULTIPLE_INPUT="MULTIPLE_INPUT",_.VIDEO="VIDEO",_.SLIDER="SLIDER",_.SLIDE="SLIDE",_.SOCIAL="SOCIAL",_.COLUMNS="COLUMNS",_.COLUMN="COLUMN",_.PRIZE_BASED_GAMING="PRIZE_BASED_GAMING",(R||(R={})).CLICK="CLICK",function(e){e.SHOW_WIDGET="SHOW_WIDGET",e.OPEN_LINK="OPEN_LINK",e.SUBSCRIBE_CONTACT="SUBSCRIBE_CONTACT",e.REQUEST="REQUEST",e.CLOSE_WIDGET="CLOSE_WIDGET",e.GO_TO_VIEW="GO_TO_VIEW",e.GO_TO_PREVIOUS_VIEW="GO_TO_PREVIOUS_VIEW",e.GO_TO_NEXT_VIEW="GO_TO_NEXT_VIEW",e.CLICK="CLICK"}(A||(A={})),function(e){e.SELF="_self",e.BLANK="_blank"}(I||(I={})),(L||(L={})).ACCENT="accent",function(e){e.TOP="TOP",e.CENTER="CENTER",e.BOTTOM="BOTTOM"}(N||(N={})),function(e){e.LEFT="LEFT",e.CENTER="CENTER",e.RIGHT="RIGHT"}(P||(P={})),function(e){e.SLIDE_TO_TOP="SLIDE_TO_TOP",e.SLIDE_TO_BOTTOM="SLIDE_TO_BOTTOM",e.SLIDE_TO_LEFT="SLIDE_TO_LEFT",e.SLIDE_TO_RIGHT="SLIDE_TO_RIGHT"}(M||(M={})),function(e){e.PULSE="PULSE",e.VIBRATE="VIBRATE",e.WOBBLE="WOBBLE",e.SHAKE="SHAKE",e.JELLO="JELLO",e.BOUNCE="BOUNCE",e.BLINK="BLINK",e.FLICKER="FLICKER",e.PING="PING"}(w||(w={})),function(e){e.LEFT="LEFT",e.RIGHT="RIGHT"}(U||(U={})),(D=x||(x={})).BEFORE="BEFORE",D.AFTER="AFTER",D.INSIDE="INSIDE",D.INSTEAD="INSTEAD";class k extends f{constructor(e,t){super(),this.config=t,this.handleMobileBreakpoint(e.getShared().mobileBreakpointWidth),e.on("ENVIRONMENT_UPDATE",(({isMobileEnv:e})=>{this._isMobile=e,this.emit(k.changeEventName,this._isMobile)}))}handleMobileBreakpoint(e){this.mobileBreakpointWidth=e;const t=Number.isInteger(this.mobileBreakpointWidth)?`${this.mobileBreakpointWidth}px`:this.mobileBreakpointWidth;this.mediaQueryList=window.matchMedia(`(max-width: ${t})`),this.mediaQueryList.addListener(this.listener.bind(this)),this._isMobile=this.mediaQueryList.matches,this.emit(k.changeEventName,this._isMobile)}isMobile(){return this.config.forceMobileEnv||this._isMobile}listener(e){this._isMobile=e.matches,this.emit(k.changeEventName,this._isMobile)}destroy(){super.destroy(),this.mediaQueryList.removeListener(this.listener.bind(this))}}k.changeEventName="CHANGE";const B=k;class F{static set(e,t){const n=e[F.accumulatorPropertyName]||{};e[F.accumulatorPropertyName]=Object.assign(Object.assign({},n),t.styleAttributes),Object.keys(e[F.accumulatorPropertyName]).forEach((n=>{n.includes("--")?e.style.setProperty(n,t.styleAttributes[n]||""):e.style[n]=t.styleAttributes[n]?t.styleAttributes[n]:""}))}}F.accumulatorPropertyName="clStyleAttributes";const j=F;var V;!function(e){e.BUILT_IN="BUILT_IN",e.DETACHED="DETACHED",e.FLOATING_BOX="FLOATING_BOX",e.FLOATING_BAR="FLOATING_BAR",e.LAUNCHER="LAUNCHER",e.CONTENT_LOCKER="CONTENT_LOCKER"}(V||(V={}));class W{static applyHostStyles(e,t,n=null,o){var r,a,l;const d=null===(a=null===(r=null==n?void 0:n.props)||void 0===r?void 0:r.handlers)||void 0===a?void 0:a.find((e=>"CLICK"===e.type));d&&(null===(l=d.actions)||void 0===l?void 0:l.length)&&(t.style.cursor="pointer"),e!==i&&e!==s&&e!==c||(t.style.display=o===V.CONTENT_LOCKER&&e===i?"flex":"inline-flex",t.style.position="relative"),t.style.boxSizing="border-box"}constructor(){this.styles="/* common styles */ *, *:before, *:after { box-sizing: border-box; font-family: inherit; }"}setStyles(e=""){this.styles=`${this.styles} ${e}`}getStyles(){return this.styles}}class H{static log(e){window.scriptLog09u8y9?scriptLog09u8y9("ERROR","RUNTIME_ERROR",new Error(e)):console.error(e)}}class G{constructor(e,t,n,i,o,s){this.hostElement=t,this.documentModel=e,this.getSharedCb=n,this.getPropsCb=i,this.getEnvCb=o,this.httpClient=s,this.schemaSubscription=null,this.themeSubscription=null,this.envUrlMaps={desktop:new Map,mobile:new Map}}parseBackground(e){const t=String(e||"");if(t.includes("url")){const[e,n]=t.split("(")[1].split(")");return{url:e.replace(/['"]+/g,""),positionOptions:n.replace(";","")}}return{url:null,positionOptions:null}}apply(e){const t=this.getPropsCb();return t.backgroundDynamicInlineSVGElements[e].forEach((n=>{var i,o,s,r,a;const l=null===(o=null===(i=t.adaptiveStyles)||void 0===i?void 0:i[e])||void 0===o?void 0:o.find((e=>e.element===n)),c=(null===(s=t.styles)||void 0===s?void 0:s.find((e=>e.element===n)))||{},d=(null===(r=null==c?void 0:c.styleAttributes)||void 0===r?void 0:r.background)||(null===(a=null==l?void 0:l.styleAttributes)||void 0===a?void 0:a.background),u=this.parseBackground(d);u.url&&this.envUrlMaps[e].set(n,{originalSVGResourceURL:u.url,inlineSvgString:null,positionOptions:u.positionOptions})})),Promise.all([...this.envUrlMaps[e].entries()].map((([t,n])=>this.httpClient.execute(n.originalSVGResourceURL).then((e=>e.text())).then((i=>{this.envUrlMaps[e].set(t,Object.assign(Object.assign({},n),{inlineSvgString:i}))}))))).then((()=>{var t;const n=this.getSharedCb();return Object.keys((null===(t=n.theme)||void 0===t?void 0:t.schema)||{}).length>0?this._applyHostElementBackgroundFromTheme(this.envUrlMaps[e].get("host"),n.theme.schema):this._applyHostElementBackgroundFromCssVars(this.envUrlMaps[e].get("host"),n.cssVars)})).catch((e=>{console.error(e),H.log(`Failed to load/apply backgroundDynamicInlineSVGElements[${this.getPropsCb().backgroundDynamicInlineSVGElements}] ${e}`)}))}on(){return this.schemaSubscription=this.documentModel.on("COLOR_SCHEMA_UPDATE",(e=>{this._applyHostElementBackgroundFromCssVars(this.envUrlMaps[this.getEnvCb()].get("host"),e)})),this.themeSubscription=this.documentModel.on("THEME_UPDATE",(e=>{this._applyHostElementBackgroundFromTheme(this.envUrlMaps[this.getEnvCb()].get("host"),e.schema)})),this}_applyHostElementBackgroundFromCssVars(e,t){e&&t&&(this.hostElement.style.background=this._buildBackgroundUrlFromCssVars(e,t))}_applyHostElementBackgroundFromTheme(e,t){e&&t&&(this.hostElement.style.background=this._buildBackgroundUrlFromTheme(e,t))}_buildBackgroundUrlFromCssVars(e,t){const n=e.inlineSvgString.trim().replace("var(--cl-schema-accent)",t["cl-schema-accent"]);return`url('data:image/svg+xml,${encodeURIComponent(n)}')${e.positionOptions}`}_buildBackgroundUrlFromTheme(e,t){const n=e.inlineSvgString.trim();let i=n;return[...n.matchAll(/var\(--cl-schema-([^)]+)\)/g)].forEach((e=>{const n=function(e=""){return e.replace(/var\(\s*(--[^,\s)]+).*\)/,"$1").replace("--cl-schema-","")}(e[1]);var o;i=i.replace(`var(--${o=n,`cl-schema-${o}`})`,t[n])})),`url('data:image/svg+xml,${encodeURIComponent(i)}')${e.positionOptions}`}off(){var e,t;null===(e=this.schemaSubscription)||void 0===e||e.off(),null===(t=this.themeSubscription)||void 0===t||t.off()}}const $=new class{execute(e,t="GET",n=null,i,o){const s={method:t,headers:Object.assign({"Content-Type":"text/plain"},i||{}),credentials:"same-origin",body:null,signal:o};return n&&(s.body="string"==typeof n?n:JSON.stringify(n)),fetch(e,s)}};function K(e,t){return Object.keys(e).filter((e=>!t.includes(e))).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:e[n]})),{})}class z{static camelCaseToDashCase(e){return e.replace(/[A-Z]/g,(e=>"-"+e.toLowerCase()))}static camelCaseToUpperSnakeCase(e){return e.replace(/[A-Z]/g,(e=>"_"+e)).toUpperCase()}}class q{constructor(e){this._count=0,this.onUpdateCb=e}increment(){this._count++,this.onUpdateCb(this.count())}decrement(){this._count>0&&this._count--,this.onUpdateCb(this.count())}count(){return this._count}}var Q;!function(e){e.TOO_MANY_REQUESTS="TOO_MANY_REQUESTS",e.COMPONENT_RESOURCES_LOADED="COMPONENT_RESOURCES_LOADED",e.FAILED_TO_LOAD_COMPONENT_RESOURCE="FAILED_TO_LOAD_COMPONENT_RESOURCE",e.SUBMIT_REQUEST_STARTED="SUBMIT_REQUEST_STARTED",e.SUBMIT_REQUEST_FINISHED="SUBMIT_REQUEST_FINISHED",e.PROMO_CODE_SHOWN="PROMO_CODE_SHOWN"}(Q||(Q={}));const Y=Q;class Z{constructor(e,t,n){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=e=>{0===e&&this.systemEventEmitter.emit(Y.COMPONENT_RESOURCES_LOADED,this.componentId)},this.onResourceLoadFailure=e=>{this.isStaticEntryModule?this.systemEventEmitter.emit(Y.FAILED_TO_LOAD_COMPONENT_RESOURCE,`Failed to load: ${e}`):this.counters.pending.decrement()},this.componentId=e,this.systemEventEmitter=t,this.isStaticEntryModule=n,this.counters={pending:new q(this.onCounterStateUpdate)}}}const J=(...e)=>{let t=e.reduce(((e,t)=>Object.assign(Object.assign({},e),{[t]:[]})),{});return{get:e=>t[e],clear:()=>J(...e)}},X=J,ee="props",te="shared",ne="environment";function ie(e,t,n,i){const o=e=>{let s=e instanceof DocumentFragment||(null==e?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?e.host:e;return s&&(i&&"function"==typeof i?i(s.getAttribute(t)):(null===(r=null==s?void 0:s.getAttribute)||void 0===r?void 0:r.call(s,t))===n)?s:s&&s.parentNode&&o(s.parentNode)||null;var r};return o(e)}const oe="SUBMIT";function se(e,t){return t?(e.classes=`${e.classes||""} ${t.classes||""}`.trim(),Object.keys(t).forEach((n=>{if("element"===n||"classes"===n)return;const i=t[n];i&&"object"==typeof i&&!Array.isArray(i)?e[n]=Object.assign(Object.assign({},e[n]||{}),i):e[n]=i})),e):e}const re={DESKTOP:"desktop",MOBILE:"mobile"};function ae(e,t,n){var i;return null===(i=null==e?void 0:e[t])||void 0===i?void 0:i.find((e=>e.element===n))}function le(e){const{element:t,html:n,appendHtml:i}=e,o=function(e){if(null==e)return"";if("string"!=typeof e)return String(e);if(""===e)return"";if(!/<\/?([a-zA-Z][a-zA-Z0-9]*)\b[^>]*>/.test(e))return e;const t=(new DOMParser).parseFromString(e,"text/html");return t.querySelectorAll('script, style, link[rel="stylesheet"], meta[http-equiv]').forEach((e=>e.remove())),t.querySelectorAll("*").forEach((e=>{if(["onclick","onload","onerror","onmouseover","onfocus","onblur","onkeyup","onkeydown","onchange","onsubmit","onmouseenter","onmouseleave","onmouseout","oncontextmenu","ondrag","ondrop"].forEach((t=>e.removeAttribute(t))),Array.from(e.attributes).forEach((t=>{t.name.startsWith("on")&&e.removeAttribute(t.name)})),"A"===e.tagName||"AREA"===e.tagName){const t=e.getAttribute("href");t&&(t.startsWith("javascript:")||t.startsWith("data:"))&&e.removeAttribute("href")}if("IMG"===e.tagName||"IFRAME"===e.tagName){const t=e.getAttribute("src");t&&(t.startsWith("javascript:")||t.startsWith("data:text/html"))&&e.removeAttribute("src")}if("FORM"===e.tagName){const t=e.getAttribute("action");t&&t.startsWith("javascript:")&&e.removeAttribute("action")}})),t.body.innerHTML}(n);i?t.innerHTML+=o:t.innerHTML=o}class ce extends Event{constructor(e,t,n){super(e,n),this.detail={},Object.defineProperty(this,"detail",{value:t})}}var de;!function(e){e.STATIC="STATIC",e.UPDATING="UPDATING"}(de||(de={}));class ue extends HTMLElement{constructor(){var i;super(),this.skipGameBlur=!0,this.construct=()=>{let e;const t=this.getAttribute(n("id")),i=this.getWidgetContainerNode();if(!i)throw new Error("Widget container not found in construct");const o=i.closest(`[${n("widget-id")}]`);let s;o&&(s=o.getAttribute(n("widget-id")));let r=new ce("cl-props-request",{nodeName:this.nodeName,path:this.getAttribute(n("path")),id:t,widgetId:s},{bubbles:!0,composed:!0});this.dispatchEvent(r),e=r.detail.props,Object.assign(this,e),this.observers=X(ee,te,ne),this.subscriptions=new class{constructor(){this.subscriptions=[]}push(e){this.subscriptions.push(e)}off(){this.subscriptions.forEach((e=>null==e?void 0:e.off()))}},this.state=new T({}),this.componentEventEmitter=new f,this.componentResourceManager=new Z(this.model.id,this.services.eventEmitter,this.isStaticRenderMode()),this.mergeTagsProcessor=this.services.mergeTagsProcessorFactory.create(),this._actionFactory=this.services.actionFactory,this._handlerFactory=new b(this._actionFactory,this.services.actionRegister),this.prevProps=this.model.props,this.prevEnvironment=this.getEnvironment(),this.documentModel.on(`COMPONENT_PROPS_UPDATE_${this.model.id}`,(e=>{this.model.props=e,this.observers.get(ee).forEach((t=>t(this.prevProps,e))),this.prevProps=e;const t=this.getHostElement(),i=n("floating");e.floating&&!t.getAttribute(i)?t.setAttribute(i,"true"):!e.floating&&t.getAttribute(i)&&t.removeAttribute(i)})),this.documentModel.on(`COMPONENT_UPDATE_${this.model.id}`,(e=>{Object.assign(this.model,e)})),this.documentModel.on("SHARED_UPDATE_ALL",(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles),this.observers.get(te).forEach((e=>e(this.getShared())))})),this.model.props.backgroundDynamicInlineSVGElements&&(this.colorSchemaListener=new G(this.documentModel,this.getHostElement(),(()=>this.getShared()),(()=>this.model.props),(()=>this.getEnvironment()),$),this.colorSchemaListener.apply(this.getEnvironment()).then((()=>{this.subscriptions.push(this.colorSchemaListener.on())}))),this.prevProps.adaptiveStyles&&this.subscriptions.push(this.resizeListener.on(B.changeEventName,(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles);const e=this.getEnvironment();this.observers.get(ne).forEach((t=>t(this.prevEnvironment,e))),this.prevEnvironment=e}))),this.subscriptions.push(this.services.eventEmitter.on("GAME_PHASE_READY_TO_PLAY",(()=>{this.skipGameBlur||this.getHostElement().classList.add("cl-game-spotlight-component")}))),this.subscriptions.push(this.services.eventEmitter.on("GAME_PHASE_COMPLETED",(()=>{this.skipGameBlur||this.getHostElement().classList.remove("cl-game-spotlight-component")})))},this.attachHandlers=()=>{this.getHandlers().map((e=>this._handlerFactory.get(e))).map((e=>()=>e.activate(this.state,this.componentEventEmitter,this.getHostElement.bind(this)))).forEach((e=>e()))},this.postponeHandlers=()=>{var e;null===(e=this.handlers)||void 0===e||e.forEach((e=>e.postpone()))},this.releaseHandlers=()=>{var e;null===(e=this.handlers)||void 0===e||e.forEach((e=>e.release()))},this.getProps=()=>{var e;return null===(e=this.getModel())||void 0===e?void 0:e.props},this.getShared=()=>this.documentModel.getShared(),this.getEnvironment=()=>this.resizeListener.isMobile()?"mobile":"desktop",this.isStaticRenderMode=()=>this.services.config.getConfig("renderMode")===de.STATIC,this.isUpdatingRenderMode=()=>this.services.config.getConfig("renderMode")===de.UPDATING,this.getRootElement=()=>this.shadowRoot?this.shadowRoot:this,this.getHostElement=()=>this,this.observeProps=e=>{this.observers.get(ee).push(e),e(null,this.prevProps)},this.observeShared=e=>{this.observers.get(te).push(e),e(this.getShared())},this.observeEnvironment=e=>{this.observers.get(ne).push(e),e(null,this.getEnvironment())},this.getElements=()=>[this.getHostElement(),...Array.from(this.getRootElement().querySelectorAll(`[${n("element")}]`)).filter((e=>!e.hasAttribute(n("component"))))],this.getElement=(e,t)=>this.getElements().find((i=>t?i.getAttribute(n("element"))===e&&i.id===t:i.getAttribute(n("element"))===e)),this.applyAutoAdaptiveStyles=(e,t)=>{if(!e&&!t)return;const i=this.getElements();if(!i.length)return;const o=function(e,t){if(!t)return e||{desktop:[],mobile:[]};const n=JSON.parse(JSON.stringify(e||{desktop:[],mobile:[]}));return t.forEach((e=>{const t=e.element;let i=!1,o=!1;n.desktop&&n.desktop.forEach((n=>{n.element===t&&(se(n,e),i=!0)})),n.mobile&&n.mobile.forEach((n=>{n.element===t&&(se(n,e),o=!0)})),!i&&n.desktop&&n.desktop.push(JSON.parse(JSON.stringify(e))),!o&&n.mobile&&n.mobile.push(JSON.parse(JSON.stringify(e)))})),n}(e,t),s=n("type"),r="element-styles";let a=this.getRootElement().querySelector(`style[${s}="${r}"]`);a||(a=document.createElement("style"),a.setAttribute(s,r),this.getRootElement().appendChild(a)),le({element:a,html:""}),i.forEach((e=>{let t=e.getAttribute(n("element"));const i=this.getEnvironment();let s=ae(o,i,t);if(s){if(this.resizeListener.isMobile()){const e=ae(o,"desktop",t);e&&(s=Object.assign(Object.assign({},s),{styleAttributes:Object.assign(Object.assign({},e.styleAttributes),s.styleAttributes)}))}this.applyStylesToElement(e,this.applySharedClassesToElementModel(s),a)}})),this._addLinkColor(a,this.getShared())},this.registerComponentResourceManagement=()=>{this.viewResourceManager.registerComponent(this.model.id,this.componentResourceManager)},this.applyStyles=(e,t={})=>{if(!e||!e.style)return!1;for(const[n,i]of Object.entries(t))e.style[n]=i;return!0},this.applyStylesToElement=(e,t,i)=>{var o,s;const r=[];"host"===(t=ue._resolveTogglableStylesForElementModel(t)).element&&(W.applyHostStyles(this.model.type,e,null,this.layoutType),("desktop"===this.getEnvironment()&&(null===(o=this.model.props.backgroundDynamicInlineSVGElements)||void 0===o?void 0:o.desktop)||"mobile"===this.getEnvironment()&&(null===(s=this.model.props.backgroundDynamicInlineSVGElements)||void 0===s?void 0:s.mobile))&&(this.colorSchemaListener.apply(this.getEnvironment()),r.push("background")));let a=t.styleAttributes.background,l=a&&a.match(/url\("([^"]*)"\)/);if(this.manifest.waitForResourcesLoad&&l){this.componentResourceManager.getPending().increment();const e=new Image;e.src=l[1],O(e,"load",(()=>{this.componentResourceManager.getPending().decrement()})),O(e,"error",(()=>{this.componentResourceManager.onResourceLoadFailure(e.src),this.isUpdatingRenderMode&&this.componentResourceManager.getPending().decrement()}))}const c=Object.assign(Object.assign({},t),{styleAttributes:K(t.styleAttributes,r)});if(j.set(e,c),this._setClassAttributes(e,t),i){if(t.hoverStyleAttributes){let o=Object.assign({},t.hoverStyleAttributes);if("FILL_UP"===t.hoverAnimationType){e.style.boxShadow="inset 0px 0px 0px 0px rgb(0, 0, 0, 0)",e.style.overflow="hidden";const n=e.tagName.toLowerCase(),i=`flip-up-animation-${t.element}`;let s=this.getRootElement().querySelector(`#${i}`);s||(s=document.createElement("style"),s.id=i,e.appendChild(s)),le({element:s,html:`\n ${n}::before {\n content: '';\n background: ${o.background};\n position: absolute;\n left: 0;\n top: ${e.getBoundingClientRect().height}px;\n height: ${e.getBoundingClientRect().height}px;\n width: 100%;\n z-index: -10;\n }\n ${n}:hover::before {\n top: 0;\n transition: 0.3s;\n }\n `}),o=Object.assign(Object.assign({},t.hoverStyleAttributes),{background:"transparent",position:"relative"})}o.borderTopWidth&&"0px"!==o.borderTopWidth||delete o.borderTopColor,o.borderBottomWidth&&"0px"!==o.borderBottomWidth||delete o.borderBottomColor,o.borderLeftWidth&&"0px"!==o.borderLeftWidth||delete o.borderLeftColor,o.borderRightWidth&&"0px"!==o.borderRightWidth||delete o.borderRightColor,this._addStylesToStyleElement(i,t.element,o,`:not(.${n("no-hover")}):hover`,!0)}t.placeholderStyleAttributes&&this._addStylesToStyleElement(i,t.element,t.placeholderStyleAttributes,"::placeholder"),this._addFontStylesToStyleElement(i,this.getShared()),this.stylesAppliedToElement(e,t,i)}},this.applySharedClassesToElementModel=t=>function(t,n){let i=t;return(i.classes||"").split(" ").filter((t=>t.startsWith(e))).forEach((e=>{var t;let o=null===(t=n.textClasses)||void 0===t?void 0:t[e];o&&(o.styleAttributes.fontFamily||(o.isHeader&&n.headerFontFamily&&(o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},o.styleAttributes),{fontFamily:n.headerFontFamily})})),!o.isHeader&&n.textFontFamily&&(o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},o.styleAttributes),{fontFamily:n.textFontFamily})}))),i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},i.styleAttributes),o.styleAttributes),placeholderStyleAttributes:Object.assign(Object.assign({},i.placeholderStyleAttributes),o.placeholderStyleAttributes)}))})),i.styleAttributes.fontFamily||(i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},i.styleAttributes),{fontFamily:n.textFontFamily})})),i}(t,this.documentModel.getShared()),this.getModel=()=>this.model,this._addStylesToStyleElement=(e,t,i,o="",s)=>{const r=Object.keys(i).reduce(((e,t)=>e+` ${z.camelCaseToDashCase(t)}: ${i[t]}${s?" !important;":";"}`),"");le({element:e,html:`[${n("element")}="${t}"]${o} { ${r} }`,appendHtml:!0})},this._addFontStylesToStyleElement=(e,t)=>{le({element:e,html:`[cl-type] {font-family:${t.textFontFamily||"inherit"}}`,appendHtml:!0})},this._addLinkColor=(e,t)=>{var n,i,o,s;t.linkColor&&le({element:e,html:`a {color: ${t.linkColor}}, a:visited {color: ${t.linkColor}}`,appendHtml:!0}),(null===(n=t.linkParams)||void 0===n?void 0:n.color)&&le({element:e,html:`a {color: ${null===(i=t.linkParams)||void 0===i?void 0:i.color}}, a:visited {color: ${null===(o=t.linkParams)||void 0===o?void 0:o.color}}`,appendHtml:!0}),(null===(s=t.linkParams)||void 0===s?void 0:s.removeUnderline)&&le({element:e,html:"a {text-decoration: none}, a:visited {text-decoration: none}",appendHtml:!0})},this._setClassAttributes=(n,i)=>{Array.from(n.classList).filter((e=>e!==t("hovered")&&e!==t("focused"))).forEach((t=>{t.startsWith(e)&&n.classList.remove(t)}));const o=((n.getAttribute("class")||"")+" "+i.classes).trim();n.setAttribute("class",o)},this.getParentComponent=()=>ie(this.parentNode,n("element"),"host"),this.getWidgetContainerNode=()=>{const e=null==this?void 0:this.getAttribute(n("path"));return 1===(null==e?void 0:e.split(",").length)?this.parentNode:ie(this.parentNode,n("path"),void 0,(e=>1===(null==e?void 0:e.split(",").length)))},this.getWidgetLanguages=()=>function(e){return[e.getConfig("appearanceLanguage"),e.getConfig("browserLanguage"),"en"].filter((e=>!!e))}(this.services.config),this.getPreferredWidgetLanguage=()=>this.getWidgetLanguages()[0],this.getTranslationsMap=e=>function(e,t){return t.reduce(((t,n)=>{if(t)return t;const i=function(e,t){if(!e)return null;if(t[e])return{translations:t[e],language:e};const n=function(e){return e.includes("-")?e.split("-")[0].toLowerCase():e.includes("_")?e.split("_")[0].toLowerCase():e}(e);return t[n]?{translations:t[n],language:n}:null}(n,e);return i||null}),null)}(e,this.getWidgetLanguages()),this.stylesAppliedToElement=(e,t,n)=>{},this.updateContext=()=>{var e;const t=this.getModel();this.services.context.updateRecord(t.id,{label:this.getContextRecordLabel(t.props),viewIndex:null===(e=t.path)||void 0===e?void 0:e[0]})},this.addContextRecord=()=>{var e;const t=this.getModel();this.services.context.addRecord(t.id,{recordKey:t.id,id:t.props.control.name,label:this.getContextRecordLabel(t.props),value:t.props.control.defaultValue||"",viewIndex:null===(e=t.path)||void 0===e?void 0:e[0],sourceId:"FORM",initialData:{fallbackValue:"",exampleValue:this.getContextRecordExampleValue(t.props)}})},this.getContextRecordLabel=e=>{var t,n,i,o,s,r;const a=e.control.name;if(["email","first_name","last_name"].includes(a))return a.toUpperCase();if((null===(t=e.content)||void 0===t?void 0:t.label)&&(null===(o=null===(i=null===(n=e.adaptiveStyles)||void 0===n?void 0:n.desktop.find((e=>"label"===e.element)))||void 0===i?void 0:i.params)||void 0===o?void 0:o.enabled)){const t=(new DOMParser).parseFromString(e.content.label,"text/html");return this.capitalizeFirstLetter(t.body.textContent||"")}return(null===(s=e.content)||void 0===s?void 0:s.placeholder)?this.capitalizeFirstLetter(e.content.placeholder):(null===(r=e.control)||void 0===r?void 0:r.integrationName)?this.capitalizeFirstLetter(e.control.integrationName).replace(new RegExp("_","g")," "):void 0},this.capitalizeFirstLetter=e=>e.charAt(0).toUpperCase()+e.slice(1),this.getContextRecordExampleValue=e=>{var t;switch(null===(t=e.control)||void 0===t?void 0:t.name){case"email":return"myemail@example.com";case"first_name":return"Maria";case"last_name":return"Taylor";default:return this.getContextRecordLabel(e)}},this.completeSubmitAction=e=>{const t=e||{},n=this.services.actionRegister.getRegisteredActions().find((e=>e.category===oe));n?null==n||n.execute(void 0,void 0,!0,t):this.services.actionFactory.get({type:h.REQUEST}).execute(void 0,void 0,!0,t)},this.getHandlers=()=>{var e;return(null===(e=this.getProps())||void 0===e?void 0:e.handlers)&&this.getProps().handlers.length?[...this.getProps().handlers]:[]},this.assets=(e="")=>`${this.services.config.getConfig("staticResourcesUrl").replace(/\/$/,"")}/${this.manifest.name}/assets${e?`/${e}`:""}`,this.attachShadow({mode:"open"}),this.manifest=this.manifest||(null===(i=this.constructor.define)||void 0===i?void 0:i.manifest)}connectedCallback(){this.construct(),this.registerComponentResourceManagement(),Promise.resolve().then((()=>{this.attachHandlers()}));const e=document.createElement("style");e.textContent='\n :host(.cl-game-spotlight-component)::after {\n content: "";\n position: absolute;\n background-size: 100% 100%;\n background-repeat: no-repeat;\n overflow: visible;\n \n backdrop-filter: blur(4px);\n \n inset: -30px;\n mask-image: \n linear-gradient(to bottom, transparent, grey 30px, grey calc(100% - 30px), transparent),\n linear-gradient(to right, transparent, grey 30px, grey calc(100% - 30px), transparent);\n mask-composite: intersect;\n -webkit-mask-composite: source-in; /* for Chrome/Safari */\n \n transition: opacity 0.35s ease;\n pointer-events: auto;\n }\n ',this.getRootElement().prepend(e)}disconnectedCallback(){var e;this.observers.clear(),this.subscriptions.off(),this.state.destroy(),this.componentEventEmitter.destroy(),null===(e=this.mergeTagsProcessor)||void 0===e||e.destroy()}}ue._resolveTogglableStylesForElementModel=e=>{const t=Object.assign({},e);return Object.keys(t).forEach((e=>{e.toLowerCase().includes("styleattributes")&&(t[e]=ue._resolveTogglableStyles(t[e]))})),t},ue._resolveTogglableStyles=e=>{const t=Object.assign({},e),n=(e,n,i)=>{n in t&&(e.forEach((e=>{e in t&&(t[e]=t[n]?t[e]:i)})),delete t[n])};return n(["marginTop","marginBottom","marginLeft","marginRight"],"_marginEnabled","0px"),n(["paddingTop","paddingBottom","paddingLeft","paddingRight"],"_paddingEnabled","0px"),t};const he=ue;function pe(e){return Object.values(re).map((t=>({type:"GROUP",propPath:["adaptiveStyles",t],children:e})))}const me={name:"SysVideoComponent",componentType:"VIDEO",version:"1.0.0",contextMenuModel:pe([{type:"CONTROL",name:"COMPONENT_OPERATIONS"},{type:"CONTROL",name:"BRING_BACK_FORWARD",element:"host",elementProp:"styleAttributes",elementSubProp:"zIndex"},{type:"CONTROL",name:"FOCUS_PARENT_COMPONENT"}]),floatingControlsModel:pe([{type:"CONTROL",name:"SIZE",elementProp:"styleAttributes",element:"host",params:{height:{hide:!0}}},{type:"CONTROL",name:"MARGIN",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"CONTAINER_PADDING",elementProp:"styleAttributes",element:"host"}]),propertyPaneModel:{content:pe([{type:"CONTROL",name:"SIZE",element:"host",elementProp:"styleAttributes",params:{width:{options:["fixed","fill"]}}},{type:"CONTROL",name:"BORDERS",propPath:["styles","[element=host]","styleAttributes"]},{type:"CONTROL",name:"BOX_SHADOW",propPath:["styles","[element=host]","styleAttributes"]},{type:"CONTROL",name:"BORDER_RADIUS",propPath:["styles","[element=host]","styleAttributes"]},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"MARGIN"}}]),general:[{type:"CONTROL",name:"VIDEO_URL",propPath:["control","youtubeUrl"],params:{label:"DOCUMENT_YOUTUBE_URL",placeholder:"https://www.youtube.com/watch..."}},{type:"CONTROL",name:"SWITCH",propPath:["content","autoplay"],params:{label:"DOCUMENT_AUTOPLAY",boldLabel:!0,description:"DOCUMENT_AUTOPLAY_DESCRIPTION"}},{type:"CONTROL",name:"VIDEO_CUSTOM_COVER",elementProp:"styleAttributes",element:"overlay",params:{aspectRatioPropPath:["content","aspectRatio"],showPlayButtonPropPath:["content","showPlayButton"]}}]},events:{dispatch:[],listen:[]},i18nPropertyPaneModel:{content:[{type:"CONTROL",name:"VIDEO_URL",propPath:["control","youtubeUrl"],params:{label:"DOCUMENT_YOUTUBE_URL",placeholder:"https://www.youtube.com/watch..."}}]},i18nPropPaths:["control,youtubeUrl","content,videoId","content,aspectRatio"],i18n:{},props:{content:{videoId:null,autoplay:!1,aspectRatio:1.7777777777777777,videoPreviewImageUrl:null,showPlayButton:!0},control:{},styles:[{element:"host",styleAttributes:{borderTopStyle:"solid",borderRightStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"solid",borderTopWidth:"0px",borderTopColor:"rgb(0, 0, 0)",borderBottomWidth:"0px",borderBottomColor:"rgb(0, 0, 0)",borderLeftWidth:"0px",borderLeftColor:"rgb(0, 0, 0)",borderRightWidth:"0px",borderRightColor:"rgb(0, 0, 0)",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",boxShadow:"none"},classes:""}],adaptiveStyles:{desktop:[{element:"host",styleAttributes:{width:"350px",minWidth:"350px",height:"197px",minHeight:"197px",marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1,overflow:"hidden"},classes:""},{element:"overlay",styleAttributes:{background:null},classes:""}],mobile:[{element:"host",styleAttributes:{width:"350px",minWidth:"350px",height:"197px",minHeight:"197px",marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1,overflow:"hidden"},classes:""},{element:"overlay",styleAttributes:{background:null},classes:""}]}},metaDescription:{icon:"/SysVideoComponent/assets/img/component-icon.svg",label:{en:"Video",ru:"Видео",uk:"Вiдео",es:"Video",de:"Video",fr:"Vidéo",it:"Video",pt:"Vídeo",ro:"Video",bg:"Видео",cs:"Rádio",el:"Ραδιόφωνο",nl:"Radio",pl:"Radio",sv:"Radio",tr:"Video",ar:"الفيديو",zh:"视频",da:"Video",he:"וידאו",fi:"Video",hi:"वीडियो",hr:"Video",hu:"Videó",id:"Video",ja:"ビデオ",ko:"비디오",no:"Video",sk:"Video",sl:"Video",sr:"Video zapis"}},syncEnabled:!0,stylesImitationEnabled:!0};function ge(e){return ge="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ge(e)}function ye(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,Se(i.key),i)}}function be(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(be=function(){return!!e})()}function ve(e,t,n,i){var o=Ee(fe(1&i?e.prototype:e),t,n);return 2&i&&"function"==typeof o?function(e){return o.apply(n,e)}:o}function Ee(){return Ee="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=fe(e)););return e}(e,t);if(i){var o=Object.getOwnPropertyDescriptor(i,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},Ee.apply(null,arguments)}function fe(e){return fe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},fe(e)}function Oe(e,t){return Oe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Oe(e,t)}function Te(e,t,n){return(t=Se(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Se(e){var t=function(e){if("object"!=ge(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=ge(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ge(t)?t:t+""}var Ce=function(){function e(){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Te(t=function(e,t,n){return t=fe(t),function(e,t){if(t&&("object"==ge(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,be()?Reflect.construct(t,n||[],fe(e).constructor):t.apply(e,n))}(this,e),"adjustVideoHeight",(function(e,n){if(e){var i=t.getHostElement(),o=n||i.getBoundingClientRect().width,s="".concat(o/e,"px");i.style.height=s,i.style.minHeight=s}})),Te(t,"updatePlayButtonVisibility",(function(e,n,i){var o=t.getRootElement().querySelector(".video-overlay"),s="--cl-video-component-play-btn-visibility";return i&&!n?o.style.setProperty(s,"visible"):n?void(e.content.showPlayButton?o.style.setProperty(s,"visible"):o.style.setProperty(s,"hidden")):o.style.setProperty(s,"hidden")})),Te(t,"preloadImage",(function(e,t){var n=new Image;n.src=e,n.onload=function(){return t()},n.onerror=function(){return t()}})),Te(t,"displayPreviewImageAfterImageLoaded",(function(e,n,i){if(n||i){var o=t.isUpdatingRenderMode(),s=e.querySelector("#youtube-player");if(i){var r=i.split(")")[0].slice(5,-1);!o&&s&&(s.style.opacity="0"),t.preloadImage(r,(function(){t.displayPreviewImage(e,n,i),!o&&s&&(s.style.opacity="1")}))}else t.displayPreviewImage(e,n,i)}})),Te(t,"displayPreviewImage",(function(e,n,i){var o=e.querySelector(".video-overlay"),s=e.querySelector("#youtube-player");o.style.setProperty("--cl-video-component-overlay-visibility","visible"),o.setAttribute("role","button"),o.setAttribute("tabindex","0"),o.setAttribute("aria-label","Play video"),i||setTimeout((function(){return o.style.backgroundImage="url(".concat(n,")")})),s&&(o.onclick=function(){s.src=s.src+"&autoplay=1",s.onload=function(){return t.hidePreviewImage(e)}},o.onkeydown=t.handleOverlayKeydown)})),Te(t,"hidePreviewImage",(function(e){var t=e.querySelector(".video-overlay");t.style.setProperty("--cl-video-component-overlay-visibility","hidden"),t.style.setProperty("--cl-video-component-play-btn-visibility","hidden"),t.style.backgroundImage="none",t.removeAttribute("tabindex"),t.removeAttribute("role"),t.removeAttribute("aria-label"),t.onkeydown=null})),Te(t,"createUpdatedIFrame",(function(e){var t=document.createElement("iframe");return t.src=e,t.id="youtube-player",t.allow="autoplay",t.setAttribute("frameborder","0"),t})),Te(t,"manifest",me),Te(t,"resizeObserver",void 0),Te(t,"handleOverlayKeydown",(function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),e.currentTarget.click())})),t.getRootElement().innerHTML="\n ".concat("\n <style>\n .main-container {\n height: 100%;\n overflow: hidden;\n position: relative;\n box-shadow: 0 0 0 3px inset #a1a1a1;\n background: #515151;\n background-repeat: no-repeat;\n background-position: center;\n background-image: url(\"data:image/svg+xml,%3Csvg%20width%3D%2244%22%20height%3D%2231%22%20viewBox%3D%220%200%2044%2031%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M19.4898%2010.6062C20.1401%2010.2582%2020.9292%2010.2963%2021.5429%2010.7055L26.2391%2013.8363C26.7955%2014.2072%2027.1297%2014.8317%2027.1297%2015.5004C27.1297%2016.1691%2026.7955%2016.7936%2026.2391%2017.1645L21.5429%2020.2953C20.9292%2020.7044%2020.1401%2020.7426%2019.4898%2020.3946C18.8395%2020.0465%2018.4335%2019.3688%2018.4335%2018.6312V12.3696C18.4335%2011.632%2018.8395%2010.9543%2019.4898%2010.6062ZM6.3803%203.05351C4.68417%203.18398%203.32052%204.50218%203.13266%206.19292C2.44536%2012.3786%202.44536%2018.6214%203.13266%2024.8071C3.32052%2026.4978%204.68417%2027.816%206.3803%2027.9465L14.4857%2028.57C19.4891%2028.9549%2024.5147%2028.9549%2029.5182%2028.57L37.6235%2027.9465C39.3197%2027.816%2040.6833%2026.4978%2040.8712%2024.8071C41.5585%2018.6214%2041.5585%2012.3786%2040.8712%206.19292C40.6833%204.50218%2039.3197%203.18398%2037.6235%203.05351L29.5182%202.43002C24.5147%202.04514%2019.4891%202.04514%2014.4857%202.43002L6.3803%203.05351ZM20.4335%2012.3696V18.6312L25.1297%2015.5004L20.4335%2012.3696ZM1.14489%205.97206C1.43886%203.32634%203.57274%201.26357%206.2269%201.0594L14.3323%200.435909C19.4378%200.0431735%2024.566%200.0431736%2029.6716%200.435909L37.7769%201.0594C40.4311%201.26357%2042.565%203.32633%2042.8589%205.97206C43.5626%2012.3045%2043.5626%2018.6955%2042.8589%2025.0279C42.565%2027.6737%2040.4311%2029.7364%2037.7769%2029.9406L29.6716%2030.5641C24.566%2030.9568%2019.4378%2030.9568%2014.3323%2030.5641L6.2269%2029.9406C3.57274%2029.7364%201.43886%2027.6737%201.14489%2025.0279C0.441285%2018.6955%200.441285%2012.3045%201.14489%205.97206Z%22%20fill%3D%22%23a1a1a1%22%2F%3E%0A%3C%2Fsvg%3E%0A\");\n }\n \n .video-overlay {\n visibility: var(--cl-video-component-overlay-visibility, hidden);\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background-size: cover;\n background-repeat: no-repeat;\n background-position: center;\n cursor: pointer;\n }\n \n .video-overlay:after {\n content: '';\n visibility: var(--cl-video-component-play-btn-visibility, hidden);\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background-repeat: no-repeat;\n background-position: center;\n background-size: 64px 48px;\n background-image: url(\"data:image/svg+xml,%3Csvg width='159' height='110' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m154 17.5c-1.82-6.73-7.07-12-13.8-13.8-9.04-3.49-96.6-5.2-122 0.1-6.73 1.82-12 7.07-13.8 13.8-4.08 17.9-4.39 56.6 0.1 74.9 1.82 6.73 7.07 12 13.8 13.8 17.9 4.12 103 4.7 122 0 6.73-1.82 12-7.07 13.8-13.8 4.35-19.5 4.66-55.8-0.1-75z' fill='%23f00'/%3E%3Cpath d='m105 55-40.8-23.4v46.8z' fill='%23fff'/%3E%3C/svg%3E%0A\");\n }\n \n #youtube-player {\n width: 100%;\n height: 100%;\n }\n </style>\n ",'\n <div class="main-container" cl-element="main">\n <div class="video-overlay" cl-element="overlay"></div>\n <iframe\n id="youtube-player"\n src=""\n allow="autoplay"\n frameborder="0">\n </iframe>\n </div>\n '),t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Oe(e,t)}(e,he),function(e,t){return t&&ye(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(e,[{key:"connectedCallback",value:function(){var t=this;ve(e,"connectedCallback",this,3)([]);var n=this.getRootElement(),i=this.isUpdatingRenderMode(),o=this.services.config.getConfig("previewMode");window.ResizeObserver&&(this.resizeObserver=new ResizeObserver((function(e){window.requestAnimationFrame((function(){if(Array.isArray(e)&&e.length){var n=e[0].contentRect;t.adjustVideoHeight(t.getProps().content.aspectRatio,n.width)}}))})),this.resizeObserver.observe(n.querySelector(".main-container")));var s=function(e){return!i&&!o&&e},r=function(e,i){var o=n.querySelector("#youtube-player");if(e){var r="https://www.youtube.com/embed/".concat(e,"?controls=1").concat(s(i)?"&autoplay=1&mute=1":"");if(!o||o.src!==r){var a,l=t.createUpdatedIFrame(r);null===(a=n.querySelector("#youtube-player"))||void 0===a||a.remove(),n.querySelector(".main-container").appendChild(l),s(i)&&(l.onload=function(){t.hidePreviewImage(n)})}}else{var c;null===(c=n.querySelector("#youtube-player"))||void 0===c||c.remove()}};this.observeProps((function(e,i){var s,a=t.getEnvironment(),l=null===(s=i.adaptiveStyles[a])||void 0===s||null===(s=s.find((function(e){return"overlay"===e.element})))||void 0===s?void 0:s.styleAttributes.background;t.applyAutoAdaptiveStyles(i.adaptiveStyles,i.styles),o||r(i.content.videoId,i.content.autoplay),(o||l)&&t.displayPreviewImageAfterImageLoaded(n,i.content.videoPreviewImageUrl,l,r),t.updatePlayButtonVisibility(i,l,o),t.adjustVideoHeight(i.content.aspectRatio)}))}},{key:"disconnectedCallback",value:function(){var t;ve(e,"disconnectedCallback",this,3)([]),window.ResizeObserver&&(null===(t=this.resizeObserver)||void 0===t||t.unobserve(this.getRootElement().querySelector(".main-container")))}}])}();Te(Ce,"define",{name:"sys-video",model:me.name,manifest:me});export{Ce as default};window.clComponentClass_SysVideoComponent=Ce;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@claspo/components",
3
- "version": "1.8.1",
3
+ "version": "1.8.2-dd.1",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "prebuild": "rm -rf out",