/
home
/
rekodeb
/
photobooth
/
wp-content
/
plugins
/
elementor
/
assets
/
js
/
packages
/
editor-interactions
/
Upload File
HOME
!function(){"use strict";var e={d:function(t,n){for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{ELEMENTS_INTERACTIONS_PROVIDER_KEY_PREFIX:function(){return A},EmptyState:function(){return a},InteractionsTab:function(){return x},createInteractionsProvider:function(){return z},getInteractionsConfig:function(){return E},init:function(){return L},interactionsRepository:function(){return T}});var n=window.React,r=window.elementorV2.icons,o=window.elementorV2.ui,i=window.wp.i18n;const a=({onCreateInteraction:e})=>n.createElement(o.Stack,{alignItems:"center",justifyContent:"center",height:"100%",color:"text.secondary",sx:{p:2.5,pt:8,pb:5.5},gap:1.5},n.createElement(r.SwipeIcon,{fontSize:"large"}),n.createElement(o.Typography,{align:"center",variant:"subtitle2"},(0,i.__)("Animate elements with Interactions","elementor")),n.createElement(o.Typography,{align:"center",variant:"caption",maxWidth:"170px"},(0,i.__)("Add entrance animations and effects triggered by user interactions such as page load or scroll.","elementor")),n.createElement(o.Button,{variant:"outlined",color:"secondary",size:"small",sx:{mt:1},onClick:e},(0,i.__)("Create an interaction","elementor")));var l=window.elementorV2.editorElements,c=window.elementorV2.session;const s=(0,n.createContext)(null),m=({children:e,elementId:t})=>{const r=(0,l.useElementInteractions)(t);(0,n.useEffect)(()=>{window.dispatchEvent(new CustomEvent("elementor/element/update_interactions"))},[]);const o={interactions:r,setInteractions:e=>{(0,l.updateElementInteractions)({elementId:t,interactions:e})},playInteractions:e=>{(0,l.playElementInteractions)(t,e)}};return n.createElement(s.Provider,{value:o},e)},u=(0,n.createContext)(void 0),d=({children:e})=>{const[t,r]=(0,n.useState)(!1),o=(0,n.useCallback)(()=>{r(!0)},[]),i=(0,n.useCallback)(()=>{r(!1)},[]);return n.createElement(u.Provider,{value:{openByDefault:t,triggerDefaultOpen:o,resetDefaultOpen:i}},e)};var f=window.elementorV2.editorControls;const p={constants:{defaultDuration:300,defaultDelay:0,slideDistance:100,scaleStart:.5,easing:"linear"},animationOptions:[]};function E(){return window.ElementorInteractionsConfig||p}function g({value:e,onChange:t,interactionType:a}){const l=(0,n.useMemo)(()=>{const e="in"===a;return[{value:"top",label:e?(0,i.__)("From top","elementor"):(0,i.__)("To top","elementor"),renderContent:({size:t})=>e?n.createElement(r.ArrowDownSmallIcon,{fontSize:t}):n.createElement(r.ArrowUpSmallIcon,{fontSize:t}),showTooltip:!0},{value:"bottom",label:"in"===a?(0,i.__)("From bottom","elementor"):(0,i.__)("To bottom","elementor"),renderContent:({size:t})=>e?n.createElement(r.ArrowUpSmallIcon,{fontSize:t}):n.createElement(r.ArrowDownSmallIcon,{fontSize:t}),showTooltip:!0},{value:"left",label:"in"===a?(0,i.__)("From left","elementor"):(0,i.__)("To left","elementor"),renderContent:({size:t})=>e?n.createElement(r.ArrowRightIcon,{fontSize:t}):n.createElement(r.ArrowLeftIcon,{fontSize:t}),showTooltip:!0},{value:"right",label:"in"===a?(0,i.__)("From right","elementor"):(0,i.__)("To right","elementor"),renderContent:({size:t})=>e?n.createElement(r.ArrowLeftIcon,{fontSize:t}):n.createElement(r.ArrowRightIcon,{fontSize:t}),showTooltip:!0}]},[a]);return n.createElement(o.Grid,{item:!0,xs:12},n.createElement(f.PopoverGridContainer,null,n.createElement(o.Grid,{item:!0,xs:6},n.createElement(f.ControlFormLabel,null," ",(0,i.__)("Direction","elementor"))),n.createElement(o.Grid,{item:!0,xs:6},n.createElement(f.ToggleButtonGroupUi,{items:l,exclusive:!0,onChange:t,value:e}))))}var y=window.elementorV2.editorUi;function _({value:e,onChange:t}){const r=[{key:"fade",label:(0,i.__)("Fade","elementor")},{key:"slide",label:(0,i.__)("Slide","elementor")},{key:"scale",label:(0,i.__)("Scale","elementor")}];return n.createElement(o.Grid,{item:!0,xs:12},n.createElement(f.PopoverGridContainer,null,n.createElement(o.Grid,{item:!0,xs:6},n.createElement(f.ControlFormLabel,null,(0,i.__)("Effect","elementor"))),n.createElement(o.Grid,{item:!0,xs:6},n.createElement(o.Select,{fullWidth:!0,displayEmpty:!0,size:"tiny",value:e,onChange:e=>t(e.target.value)},r.map(e=>n.createElement(y.MenuListItem,{key:e.key,value:e.key},e.label))))))}function v({value:e,onChange:t}){const r=[{value:"in",label:(0,i.__)("In","elementor"),renderContent:()=>(0,i.__)("In","elementor")},{value:"out",label:(0,i.__)("Out","elementor"),renderContent:()=>(0,i.__)("Out","elementor")}];return n.createElement(n.Fragment,null,n.createElement(o.Grid,{item:!0,xs:12},n.createElement(f.PopoverGridContainer,null,n.createElement(o.Grid,{item:!0,xs:6},n.createElement(f.ControlFormLabel,null,(0,i.__)("Type","elementor"))),n.createElement(o.Grid,{item:!0,xs:6},n.createElement(f.ToggleButtonGroupUi,{items:r,exclusive:!0,onChange:t,value:e})))))}function I({value:e,onChange:t,label:r}){const a=["0","100","200","300","400","500","750","1000","1250","1500"].map(e=>({key:e,label:(0,i.__)("%s MS","elementor").replace("%s",e)}));return n.createElement(o.Grid,{item:!0,xs:12},n.createElement(f.PopoverGridContainer,null,n.createElement(o.Grid,{item:!0,xs:6},n.createElement(f.ControlFormLabel,null,r)),n.createElement(o.Grid,{item:!0,xs:6},n.createElement(o.Select,{fullWidth:!0,displayEmpty:!0,size:"tiny",value:e,onChange:e=>t(e.target.value)},a.map(e=>n.createElement(y.MenuListItem,{key:e.key,value:e.key},e.label))))))}function h({value:e,onChange:t}){const r=Object.entries({load:(0,i.__)("Page load","elementor"),scrollIn:(0,i.__)("Scroll into view","elementor")}).map(([e,t])=>({key:e,label:t}));return n.createElement(o.Grid,{item:!0,xs:12},n.createElement(f.PopoverGridContainer,null,n.createElement(o.Grid,{item:!0,xs:6},n.createElement(f.ControlFormLabel,null,(0,i.__)("Trigger","elementor"))),n.createElement(o.Grid,{item:!0,xs:6},n.createElement(o.Select,{fullWidth:!0,displayEmpty:!0,size:"tiny",onChange:e=>t(e.target.value),value:e},r.map(e=>n.createElement(y.MenuListItem,{key:e.key,value:e.key},e.label))))))}const C="load-fade-in--300-0",b=()=>{const[e,t,n,r,o,i]=C.split("-");return{trigger:e,effect:t,type:n,direction:r,duration:o,delay:i}},w=({interaction:e,onChange:t})=>{const r=n.useMemo(()=>(e=>{const[t,n,r,o,i,a]=e.split("-"),l=b(),c=o||l.direction,s="slide"===n&&!c;return{trigger:t||l.trigger,effect:n||l.effect,type:r||l.type,direction:s?"top":c,duration:i||l.duration,delay:a||l.delay}})(e),[e]),a=(e,n)=>{null===n&&(n=b()[e]);const o={...r,[e]:n};if("effect"===e&&"slide"===n){const e=o.direction;e&&""!==e||(o.direction="top")}t(Object.values(o).join("-"))};return n.createElement(f.PopoverContent,{p:1.5},n.createElement(o.Grid,{container:!0,spacing:1.5},n.createElement(h,{value:r.trigger,onChange:e=>a("trigger",e)})),n.createElement(o.Divider,{sx:{mx:1.5}}),n.createElement(o.Grid,{container:!0,spacing:1.5},n.createElement(_,{value:r.effect,onChange:e=>a("effect",e)}),n.createElement(v,{value:r.type,onChange:e=>a("type",e)}),n.createElement(g,{value:"slide"!==r.effect||r.direction?r.direction:"top",onChange:e=>{const t="slide"!==r.effect||e&&""!==e?e:"top";a("direction",t)},interactionType:r.type}),n.createElement(I,{value:r.duration,onChange:e=>a("duration",e),label:(0,i.__)("Duration","elementor")}),n.createElement(I,{value:r.delay,onChange:e=>a("delay",e),label:(0,i.__)("Delay","elementor")})))};function S(e){const{interactions:t,onSelectInteractions:a,onPlayInteraction:l,triggerCreateOnShowEmpty:c}=e,[s,m]=(0,n.useState)(t);(0,n.useEffect)(()=>{JSON.stringify(t)!==JSON.stringify(s)&&a(s)},[t,s,a]);const u=(0,n.useMemo)(()=>s.items?.length>=5,[s.items]);!c||s.items&&0!==s.items?.length||m({version:1,items:[{animation:{animation_id:C,animation_type:"full-preset"}}]});const d=u?n.createElement(o.Alert,{color:"secondary",icon:n.createElement(r.InfoCircleFilledIcon,null),size:"small"},n.createElement(o.AlertTitle,null,(0,i.__)("Interactions","elementor")),n.createElement(o.Box,{component:"span"},(0,i.__)("You've reached the limit of 5 interactions for this element. Please remove an interaction before creating a new one.","elementor"))):void 0;return n.createElement(f.Repeater,{openOnAdd:!0,openItem:c?0:void 0,label:(0,i.__)("Interactions","elementor"),values:s.items,setValues:e=>{m({...s,items:e})},showDuplicate:!1,showToggle:!1,isSortable:!1,disableAddItemButton:u,addButtonInfotipContent:d,itemSettings:{initialValues:{animation:{animation_id:C,animation_type:"full-preset"}},Label:({value:e})=>(e=>{if(!e)return"";const t=E()?.animationOptions,n=t.find(t=>t.value===e);return n?.label||e})(e.animation.animation_id),Icon:()=>null,Content:({index:e,value:t})=>n.createElement(w,{key:e,interaction:t.animation.animation_id,onChange:t=>{const n={...s,items:structuredClone(s.items)};n.items[e]={...n.items[e],animation:{...n.items[e].animation,animation_id:t}},m({...s,items:n.items})}}),actions:e=>n.createElement(n.Fragment,null,n.createElement(o.IconButton,{"aria-label":(0,i.__)("Play interaction","elementor"),size:"tiny",onClick:()=>l(e.animation.animation_id)},n.createElement(r.PlayerPlayIcon,{fontSize:"tiny"})))}})}const x=({elementId:e})=>n.createElement(d,null,n.createElement(P,{elementId:e}));function P({elementId:e}){const t=(0,l.useElementInteractions)(e),r=(0,n.useState)(!1),o=t?.items?.length||r[0];return n.createElement(c.SessionStorageProvider,{prefix:e},o?n.createElement(m,{elementId:e},n.createElement(k,{firstInteractionState:r})):n.createElement(a,{onCreateInteraction:()=>{r[1](!0)}}))}function k({firstInteractionState:e}){const{interactions:t,setInteractions:r,playInteractions:i}=(()=>{const e=(0,n.useContext)(s);if(!e)throw new Error("useInteractionsContext must be used within InteractionsProvider");return e})(),a=(0,n.useCallback)(t=>{e[1](!1),r(t||void 0)},[r,e]);return n.createElement(o.Stack,{sx:{m:1,p:1.5},gap:2},n.createElement(S,{triggerCreateOnShowEmpty:e[0],interactions:t,onSelectInteractions:a,onPlayInteraction:i}))}const T=(()=>{const e=[],t=()=>e.slice(0).sort((e,t)=>e.priority>t.priority?-1:1);return{all:()=>t().flatMap(e=>e.actions.all()),register:t=>{e.push(t)},subscribe:t=>{const n=e.map(e=>e.subscribe(t));return()=>{n.forEach(e=>e())}},getProviders:t,getProviderByKey:t=>e.find(e=>{try{return e.getKey()===t}catch{return!1}})}})(),G=10;function z({key:e,priority:t=G,subscribe:n=()=>()=>{},actions:r}){return{getKey:"string"==typeof e?()=>e:e,priority:t,subscribe:n,actions:{all:r.all}}}var O=window.elementorV2.editorV1Adapters;const A="document-elements-interactions-",D=z({key:()=>{const e=(0,l.getCurrentDocumentId)();return e?`${A}${e}`:`${A}pending`},priority:50,subscribe:e=>(0,O.__privateListenTo)([(0,O.windowEvent)("elementor/element/update_interactions")],()=>e()),actions:{all:()=>(0,l.getElements)().filter(e=>{const t=(0,l.getElementInteractions)(e.id);return!!t&&t?.items?.length>0}).map(e=>{const t=(0,l.getElementInteractions)(e.id);return{elementId:e.id,dataId:e.id,interactions:t||{version:1,items:[]}}})}});function F(){(0,O.registerDataHook)("after","document/elements/duplicate",(e,t)=>{(Array.isArray(t)?t:[t]).forEach(e=>{!function(e){const t=(0,l.getContainer)(e);t&&V(t).forEach(e=>{!function(e){const t=(0,l.getContainer)(e);if(!t)return;const n=t.model.get("interactions");if(!n||!n.items)return;const r=structuredClone(n);r?.items?.forEach(e=>{e.interaction_id&&delete e.interaction_id}),t.model.set("interactions",r)}(e.id)})}(e.id)})})}function V(e){return[e,...(e.children??[]).flatMap(e=>V(e))??[]]}function L(){try{T.register(D),F()}catch(e){throw e}}(window.elementorV2=window.elementorV2||{}).editorInteractions=t}(),window.elementorV2.editorInteractions?.init?.();