"use strict";(self.webpackChunk_genially_view_client=self.webpackChunk_genially_view_client||[]).push([[2991],{3336:(e,t,i)=>{i.d(t,{q:()=>F});var n=i(45992),a=i(37577),o=i(23119),r=i(17588),l=i(68001);const s="4000ms",d=(0,a.i7)({"0%":{transform:"translateX(0)"},"2%":{transform:"translateX(-6px) rotateY(-9deg)"},"5%":{transform:"translateX(5px) rotateY(-7deg)"},"8%":{transform:"translateX(-3px) rotateY(-5deg)"},"11%":{transform:"translateX(-2px) rotateY(-3deg)"},"13%":{transform:"translateX(0)"}}),c=(0,a.i7)({"0%":{transform:"translateY(0)"},"2%":{transform:"translateY(-6px) rotateX(-9deg)"},"5%":{transform:"translateY(5px) rotateX(-7deg)"},"8%":{transform:"translateY(-3px) rotateX(-5deg)"},"11%":{transform:"translateY(-2px) rotateX(-3deg)"},"13%":{transform:"translateY(0)"}});var p=i(17442);const u="100ms",{color:h}=l.iF.themes.newPrimary,g=(e,t,i)=>Object.assign({},t===p.Rh.HORIZONTAL?{left:`${e}%`,top:i?"50%":0}:{top:`calc(100% - ${e}%)`,left:i?"50%":0}),m=a.Ay.div({position:"absolute",width:0,height:0,zIndex:1,touchAction:"none",userSelect:"none",pointerEvents:"none"}),v=a.Ay.div((e=>{let{$variant:t,$sliderValue:i,$withTransition:n,$disabled:o}=e;return a.AH`
    position: absolute;
    z-index: 1;
    ${r=t===p.Rh.HORIZONTAL,{width:r?4:"100%",height:r?"100%":4}};
    ${g(i,t,!1)};
    background-color: white;
    cursor: pointer;
    box-shadow: 0px 1px 4px 0px rgba(0, 15, 51, 0.2);
    ${n&&{transition:`all ${u}`}};
    animation-name: ${t===p.Rh.HORIZONTAL?d:c};
    animation-duration: ${s};
    animation-iteration-count: infinite;
    animation-play-state: ${o?"paused":"running"};
    animation-delay: ${s};

    ${[m]} {
      ${g(i,t,!0)};
    }
  `;var r})),x=a.Ay.svg({position:"absolute",transform:"scale(1)",fill:h.content.reversed.default(),transition:"top 0.2s, left 0.2s",filter:"drop-shadow(0 1px 4px rgba(0, 15, 51, 0.2))"}),f=(0,a.Ay)(x)((e=>{let{$variant:t}=e;return Object.assign({left:-32,top:-16},t===p.Rh.VERTICAL&&{transform:"rotate(90deg)",top:-32,left:-16})})),y=(0,a.Ay)(x)((e=>{let{$variant:t}=e;return Object.assign({left:0,top:-16},t===p.Rh.VERTICAL&&{transform:"rotate(90deg)",top:0,left:-16})})),w=e=>{let{variant:t,sliderValue:i,withTransition:a,disabled:o}=e;return(0,n.jsx)(v,{$variant:t,$sliderValue:i,$withTransition:a,$disabled:o,children:(0,n.jsxs)(m,{$variant:t,$sliderValue:i,children:[(0,n.jsx)(f,{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 16 16",fill:"none",$variant:t,children:(0,n.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.0002 14.0002C9.74425 14.0002 9.48825 13.9022 9.29325 13.7072L4.29325 8.70725C3.90225 8.31625 3.90225 7.68425 4.29325 7.29325L9.29325 2.29325C9.68425 1.90225 10.3163 1.90225 10.7073 2.29325C11.0982 2.68425 11.0982 3.31625 10.7073 3.70725L6.41425 8.00025L10.7073 12.2933C11.0982 12.6842 11.0982 13.3162 10.7073 13.7072C10.5122 13.9022 10.2562 14.0002 10.0002 14.0002Z"})}),(0,n.jsx)(y,{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 16 16",fill:"none",$variant:t,children:(0,n.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.00025 2C6.25625 2 6.51225 2.098 6.70725 2.293L11.7073 7.293C12.0982 7.684 12.0982 8.316 11.7073 8.707L6.70725 13.707C6.31625 14.098 5.68425 14.098 5.29325 13.707C4.90225 13.316 4.90225 12.684 5.29325 12.293L9.58625 8L5.29325 3.707C4.90225 3.316 4.90225 2.684 5.29325 2.293C5.48825 2.098 5.74425 2 6.00025 2Z"})})]})})},b=a.Ay.div((e=>{let{$index:t,$isHorizontal:i,$opacity:n,$withTransition:a}=e;return Object.assign(Object.assign({position:"absolute",bottom:0,left:0,zIndex:111,opacity:n,transition:"opacity 0.2s"+(a?", width 0.2s":""),userSelect:"none"},1===t&&i&&{left:"unset",right:0}),0===t&&!i&&{top:0,bottom:"unset"})})),$=a.Ay.p(Object.assign({color:"white",backgroundColor:"rgba(18,18,18,0.5)",fontSize:16,lineHeight:"20px",fontWeight:"400",overflow:"hidden",textOverflow:"ellipsis",textAlign:"center",wordWrap:"break-word",whiteSpace:"nowrap",pointerEvents:"none",transform:"translate3d(0, 0, 0)",transitionProperty:"opacity, width",transitionDuration:"0.2s",transitionTimingFunction:"linear"},l.iF.mixins.increaseSpecificity({padding:16}))),j=a.Ay.img({width:"100%",height:"100%",objectFit:"cover"}),T=a.Ay.div({position:"relative",width:"100%"}),A=e=>{let{index:t,image:i,sliderValue:a,isHorizontal:o,withTransition:r}=e;const l=o?0===t?`${a}%`:`calc(${100-a}% - 4px)`:"100%",s=((e,t,i)=>{const n={horizontal:[0===e&&t>10,1===e&&t<90],vertical:[0===e&&t<90,1===e&&t>10]};return i?n.horizontal.some(Boolean):n.vertical.some(Boolean)})(t,a,o),d=(0,n.jsx)(b,{$index:t,style:{width:l},$isHorizontal:o,$opacity:s?1:0,$withTransition:r,children:(0,n.jsx)($,{children:i.title})});return(0,n.jsxs)(T,{children:[(0,n.jsx)(j,{src:i.image,alt:i.altText}),i.title&&d]})},R=(0,a.i7)({"0%":{clipPath:"polygon(50% 0%, 100% 0%, 100% 100%, 50% 100%)"},"2%":{clipPath:"polygon(calc(50% - 6px) 0%, 100% 0%, 100% 100%, calc(50% - 6px) 100%)"},"5%":{clipPath:"polygon(calc(50% + 5px) 0%, 100% 0%, 100% 100%, calc(50% + 5px) 100%)"},"8%":{clipPath:"polygon(calc(50% - 3px) 0%, 100% 0%, 100% 100%, calc(50% - 3px) 100%)"},"11%":{clipPath:"polygon(calc(50% - 2px) 0%, 100% 0%, 100% 100%, calc(50% - 2px) 100%)"},"13%":{clipPath:"polygon(50% 0%, 100% 0%, 100% 100%, 50% 100%)"}}),O=(0,a.i7)({"0%":{clipPath:"polygon(0% 100%, 0% 50%, 100% 50%, 100% 100%)"},"2%":{clipPath:"polygon(0% 100%, 0% calc(50% - 6px), 100% calc(50% - 6px), 100% 100%)"},"5%":{clipPath:"polygon(0% 100%, 0% calc(50% + 5px), 100% calc(50% + 5px), 100% 100%)"},"8%":{clipPath:"polygon(0% 100%, 0% calc(50% - 3px), 100% calc(50% - 3px), 100% 100%)"},"11%":{clipPath:"polygon(0% 100%, 0% calc(50% - 2px), 100% calc(50% - 2px), 100% 100%)"},"13%":{clipPath:"polygon(0% 100%, 0% 50%, 100% 50%, 100% 100%)"}}),C=a.Ay.div((e=>{let{$withTransition:t,$variant:i,$disabled:n}=e;return a.AH`
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    ${t&&{transition:`clip-path ${u}`}};

    &:nth-child(2) {
      animation-name: ${i===p.Rh.HORIZONTAL?R:O};
      animation-duration: ${n?"unset":s};
      animation-iteration-count: infinite;
      animation-play-state: ${n?"paused":"running"};
      animation-delay: ${s};
    }

    & > * {
      height: 100%;
    }

    > *:not(style) + * {
      height: unset;
    }
  `})),L=e=>{let{images:t,sliderValue:i,isDragging:a,isHorizontal:o,variant:r,disabled:l}=e;const s=o?`polygon(${i}% 0%, 100% 0%, 100% 100%, ${i}% 100%)`:`polygon(0% 100%, 0% ${100-i}%, 100% ${100-i}%, 100% 100%)`,d=o?`polygon(0% 0%, ${i}% 0%, ${i}% 100%, 0% 100%)`:`polygon(0% 0%, 0% ${100-i}%, 100% ${100-i}%, 100% 0%)`,c=i>50&&!o?0:1,p=!a;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(C,{style:{clipPath:d,zIndex:0===c?1:0},$variant:r,$withTransition:p,children:(0,n.jsx)(A,{index:0,image:t[0],sliderValue:i,isHorizontal:o,withTransition:p})}),(0,n.jsx)(C,{style:{clipPath:s},$withTransition:p,$variant:r,$disabled:l,children:(0,n.jsx)(A,{index:1,image:t[1],sliderValue:i,isHorizontal:o,withTransition:p})})]})};var E=i(82157);const{color:I}=l.iF.themes.newPrimary,N=a.Ay.input((e=>{let{$variant:t,disabled:i}=e;return Object.assign(Object.assign({width:"100%",height:"100%",opacity:0,cursor:"col-resize"},t===p.Rh.VERTICAL&&{writingMode:"vertical-lr",direction:"rtl",verticalAlign:"bottom",cursor:"row-resize"}),i&&Object.assign({},l.iF.mixins.increaseSpecificity({cursor:"move"})))})),V=a.Ay.div((e=>{let{$variant:t,$disabled:i}=e;return Object.assign({position:"relative",height:"100%",overflow:"hidden",borderRadius:8,[N]:{position:"absolute",top:0,left:0,zIndex:E.T}},!i&&{"&:hover":{[v]:{animationPlayState:"paused"},[C]:{animationPlayState:"paused"},[x]:{fill:I.content.reversed.hover()},[f]:Object.assign({left:-37},t===p.Rh.VERTICAL&&{top:-37,left:-16}),[y]:Object.assign({left:5},t===p.Rh.VERTICAL&&{top:5,left:-16})}})})),P=a.Ay.p({position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",border:0}),H=e=>{let{images:t,disabled:i=!1,defaultValue:a=50,variant:l=p.Rh.HORIZONTAL}=e;const[s,d]=(0,r.useState)(a),[c,u]=(0,r.useState)(!1),h=(0,r.useRef)(!1),g=l===p.Rh.HORIZONTAL,{t:m}=(0,r.useContext)(o.i);return(0,n.jsxs)(V,{"data-testid":"aspect-ratio-container",$disabled:i,$variant:l,role:"application","aria-describedby":"juxtapose-instructions","aria-live":"polite",children:[(0,n.jsx)("p",{id:"juxtapose-instructions",style:{display:"none"},hidden:!0,children:m("__new.shared.widget.comparison.accessibilityDescription")}),(0,n.jsx)(P,{id:"juxtapose-status","aria-live":"polite",children:m("__new.shared.widget.comparison.accesibilitySecondImage",{sliderValue:s.toString()})}),(0,n.jsx)(L,{images:t,sliderValue:s,isDragging:h.current,isHorizontal:g,variant:l,disabled:i||c}),(0,n.jsx)(w,{disabled:i||c,variant:l,sliderValue:s,withTransition:!h.current}),!i&&(0,n.jsx)(N,{$variant:l,$sliderValue:s,disabled:i,type:"range",defaultValue:s,"aria-label":m("__new.shared.widget.comparison.accesibilitySlider"),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":s,onMouseDown:()=>{h.current=!1;const e=()=>{c||u(!0),h.current=!0};document.addEventListener("mousemove",e),document.addEventListener("mouseup",(()=>{document.removeEventListener("mousemove",e)}),{once:!0})},onChange:e=>{c||u(!0),d(e.target.valueAsNumber)}})]})},S=e=>{let{images:t,disabled:i=!1}=e;return(0,n.jsx)(H,{disabled:i,variant:p.Rh.HORIZONTAL,images:t})},z=e=>{let{images:t,disabled:i=!1}=e;return(0,n.jsx)(H,{disabled:i,variant:p.Rh.VERTICAL,images:t})},F=e=>{let{images:t,variant:i,disabled:r,theme:l,t:s}=e;const d=i===p.Rh.VERTICAL?z:S;return(0,n.jsx)(o.i.Provider,{value:{t:s},children:(0,n.jsx)(a.NP,{theme:l,children:(0,n.jsx)(d,{images:t,disabled:r})})})}},2991:(e,t,i)=>{i.r(t),i.d(t,{geniallyJuxtaposeViewScript:()=>s});var n=i(45992),a=i(54072),o=i(41381),r=i(3336);const l=e=>null!==e,s=(e,t)=>{(0,o.p)({getTargetNodeItem:()=>e.item,initialState:void 0,renderApp:()=>{const{slideList:i,variant:o}=e.config,s=i.map((e=>null===e.image.source?null:{image:e.image.source,title:e.title,id:(0,a.Ak)(),altText:e.image.altText})).filter(l);return()=>(0,n.jsx)(r.q,{images:s,variant:o,theme:t.theme,t:t.t})}})(e,t)}},41381:(e,t,i)=>{i.d(t,{p:()=>r});var n=i(70377),a=i(66264),o=i(60708);function r(e){let{getTargetNodeItem:t,renderApp:i,renderThumbnailApp:r,initialState:l}=e,s=!1;const d=[],c=e=>{d.push(e)};return e=>{const p=t(e.config),u=null===p||void 0===p?void 0:p.parentSlide;function h(){if(!p)return;let e=null;if("idOfFreeNode"in p)e=document.getElementById(p.idOfFreeNode);else{const t=document.createElement("div");t.innerHTML=p.source;let i=t.getElementsByClassName("genially-widget-app");i.length||(i=t.getElementsByClassName("genially-widget-gallery"));const{id:n}=i[0];if(!n)return;e=document.getElementById(n)}if(e){let t;const a=i=>{s&&t?n.render(t(i),e):console.warn('"rerender" was called when the widget was already unmounted. This is a no-op. Did you forget to dispose of an event handler with "onUnmount"?')};t=i({setState:a,onUnmount:c}),s=!0,a(l),d.push((()=>{n.unmountComponentAtNode(e)}))}}function g(){s=!1,d.forEach((e=>{e()})),d.length=0}p&&"isTransversal"in p&&p.isTransversal?(null===p||void 0===p||p.on(a.q.Mount,(()=>{h()})),null===p||void 0===p||p.on(a.q.Unmount,(()=>{g()}))):(null===u||void 0===u||u.on(o.m.Entering,(()=>{s||h()})),null===u||void 0===u||u.on(o.m.Exited,(()=>{s&&g()}))),null===u||void 0===u||u.on(o.m.ThumbnailMount,(()=>{!function(){if(!r||!p||!("idOfThumbnailFreeNode"in p))return;const e=document.getElementsByClassName(p.idOfThumbnailFreeNode);Array.from(e).forEach((e=>{n.unmountComponentAtNode(e)}))}(),function(){if(!r||!p||!("idOfThumbnailFreeNode"in p))return;const e=document.getElementsByClassName(p.idOfThumbnailFreeNode);Array.from(e).forEach((e=>{n.render(r(),e)}))}()}))}}}}]);
//# sourceMappingURL=https://s3-static-genially.genially.com/view/static/js/2991.d7245a4f.chunk.js.map