{"version":3,"file":"IFramePostMessage.D--9Vi7P.mjs","names":["useRef","Component"],"sources":["https:/framerusercontent.com/modules/9d4pjjqPg3XCDO8so83u/rcwBL9v9NcrW7U4bhHeN/VneboCvP0.js","https:/framerusercontent.com/modules/5ILHmaYn6QETDDAaofny/HFLW0A1jcbmIsP7yN3Lc/IFramePostMessage.js"],"sourcesContent":["// Generated by Framer (85113c0)\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addFonts,addPropertyControls,ComponentViewportProvider,ControlType,cx,getFonts,SmartComponentScopedContainer,useComponentViewport,useLocaleInfo,useVariantState,withCSS}from\"framer\";import{LayoutGroup,motion,MotionConfigContext}from\"framer-motion\";import*as React from\"react\";import{useRef}from\"react\";import Embed from\"https://framerusercontent.com/modules/o1PI5S8YtkA5bP5g4dFz/s801VqobGI0Gkh3K9b41/Embed.js\";const EmbedFonts=getFonts(Embed);const serializationHash=\"framer-Ck11P\";const variantClassNames={zIW8AXvHz:\"framer-v-1oqmml0\"};function addPropertyOverrides(overrides,...variants){const nextOverrides={};variants?.forEach(variant=>variant&&Object.assign(nextOverrides,overrides[variant]));return nextOverrides;}const transition1={bounce:.2,delay:0,duration:.4,type:\"spring\"};const Transition=({value,children})=>{const config=React.useContext(MotionConfigContext);const transition=value??config.transition;const contextValue=React.useMemo(()=>({...config,transition}),[JSON.stringify(transition)]);return /*#__PURE__*/_jsx(MotionConfigContext.Provider,{value:contextValue,children:children});};const Variants=motion.create(React.Fragment);const getProps=({height,id,uRL,width,...props})=>{return{...props,aUMKbDOj8:uRL??props.aUMKbDOj8??\"https://kpi-crm.digienskampus.com/iframe/form\"};};const createLayoutDependency=(props,variants)=>{if(props.layoutDependency)return variants.join(\"-\")+props.layoutDependency;return variants.join(\"-\");};const Component=/*#__PURE__*/React.forwardRef(function(props,ref){const fallbackRef=useRef(null);const refBinding=ref??fallbackRef;const defaultLayoutId=React.useId();const{activeLocale,setLocale}=useLocaleInfo();const componentViewport=useComponentViewport();const{style,className,layoutId,variant,aUMKbDOj8,...restProps}=getProps(props);const{baseVariant,classNames,clearLoadingGesture,gestureHandlers,gestureVariant,isLoading,setGestureState,setVariant,variants}=useVariantState({defaultVariant:\"zIW8AXvHz\",ref:refBinding,variant,variantClassNames});const layoutDependency=createLayoutDependency(props,variants);const sharedStyleClassNames=[];const scopingClassNames=cx(serializationHash,...sharedStyleClassNames);return /*#__PURE__*/_jsx(LayoutGroup,{id:layoutId??defaultLayoutId,children:/*#__PURE__*/_jsx(Variants,{animate:variants,initial:false,children:/*#__PURE__*/_jsx(Transition,{value:transition1,children:/*#__PURE__*/_jsx(motion.div,{...restProps,...gestureHandlers,className:cx(scopingClassNames,\"framer-1oqmml0\",className,classNames),\"data-framer-name\":\"Variant 1\",layoutDependency:layoutDependency,layoutId:\"zIW8AXvHz\",ref:refBinding,style:{...style},children:/*#__PURE__*/_jsx(ComponentViewportProvider,{children:/*#__PURE__*/_jsx(SmartComponentScopedContainer,{className:\"framer-cmomnj-container\",isAuthoredByUser:true,isModuleExternal:true,layoutDependency:layoutDependency,layoutId:\"SV7Txw8qz-container\",nodeId:\"SV7Txw8qz\",rendersWithMotion:true,scopeId:\"VneboCvP0\",children:/*#__PURE__*/_jsx(Embed,{height:\"100%\",html:'<iframe\\nsrc=\"https://kpi-crm.digienskampus.com/iframe/form\" \\nframeBorder={0}\\nstyle=\"width:100%; height:100%;border-radius:10px;\"\\n/>',id:\"SV7Txw8qz\",layoutId:\"SV7Txw8qz\",radius:\"10px\",style:{height:\"100%\",width:\"100%\"},type:\"url\",url:aUMKbDOj8,width:\"100%\",zoom:1})})})})})})});});const css=[\"@supports (aspect-ratio: 1) { body { --framer-aspect-ratio-supported: auto; } }\",\".framer-Ck11P.framer-1go3xyk, .framer-Ck11P .framer-1go3xyk { display: block; }\",\".framer-Ck11P.framer-1oqmml0 { align-content: center; align-items: center; display: flex; flex-direction: column; flex-wrap: nowrap; gap: 10px; height: 428px; justify-content: center; overflow: hidden; padding: 0px; position: relative; width: 500px; }\",\".framer-Ck11P .framer-cmomnj-container { flex: 1 0 0px; height: 1px; position: relative; width: 100%; }\"];/**\n * This is a generated Framer component.\n * @framerIntrinsicHeight 428\n * @framerIntrinsicWidth 500\n * @framerCanvasComponentVariantDetails {\"propertyName\":\"variant\",\"data\":{\"default\":{\"layout\":[\"fixed\",\"fixed\"]}}}\n * @framerVariables {\"aUMKbDOj8\":\"uRL\"}\n * @framerImmutableVariables true\n * @framerDisplayContentsDiv false\n * @framerAutoSizeImages true\n * @framerComponentViewportWidth true\n * @framerColorSyntax true\n */const FramerVneboCvP0=withCSS(Component,css,\"framer-Ck11P\");export default FramerVneboCvP0;FramerVneboCvP0.displayName=\"IframeForm\";FramerVneboCvP0.defaultProps={height:428,width:500};addPropertyControls(FramerVneboCvP0,{aUMKbDOj8:{defaultValue:\"https://kpi-crm.digienskampus.com/iframe/form\",description:\"\",displayTextArea:true,title:\"URL\",type:ControlType.String}});addFonts(FramerVneboCvP0,[{explicitInter:true,fonts:[]},...EmbedFonts],{supportsExplicitInterCodegen:true});\nexport const __FramerMetadata__ = {\"exports\":{\"Props\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"default\":{\"type\":\"reactComponent\",\"name\":\"FramerVneboCvP0\",\"slots\":[],\"annotations\":{\"framerDisplayContentsDiv\":\"false\",\"framerImmutableVariables\":\"true\",\"framerCanvasComponentVariantDetails\":\"{\\\"propertyName\\\":\\\"variant\\\",\\\"data\\\":{\\\"default\\\":{\\\"layout\\\":[\\\"fixed\\\",\\\"fixed\\\"]}}}\",\"framerContractVersion\":\"1\",\"framerComponentViewportWidth\":\"true\",\"framerColorSyntax\":\"true\",\"framerIntrinsicWidth\":\"500\",\"framerAutoSizeImages\":\"true\",\"framerVariables\":\"{\\\"aUMKbDOj8\\\":\\\"uRL\\\"}\",\"framerIntrinsicHeight\":\"428\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./VneboCvP0.map","import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useEffect}from\"react\";import{store}from\"https://framerusercontent.com/modules/pGygucfRW4kaaHDPasoe/MkWUHybQ3PYZmic4mjZd/store.js\";function getQueryParams(){const params=new URLSearchParams(window.location.search);return{utm_source:params.get(\"utm_source\")||\"\",utm_medium:params.get(\"utm_medium\")||\"\",utm_campaign:params.get(\"utm_campaign\")||\"\",utm_content:params.get(\"utm_content\")||\"\",utm_term:params.get(\"utm_term\")||\"\"};}export function withPostMessage(Component){const Wrapped=/*#__PURE__*/forwardRef((props,ref)=>{const[state,setState]=store();console.log(state);useEffect(()=>{const listener=event=>{console.log(event);if(event.data?.type===\"REDIRECT\"&&typeof event.data.url===\"string\"){window.location.href=event.data.url;}};window.addEventListener(\"message\",listener);return()=>window.removeEventListener(\"message\",listener);},[]);useEffect(()=>{const iframe=document.querySelectorAll(\"iframe\")[0];console.log(iframe);if(iframe){console.log(\"test\");iframe.onload=()=>{setTimeout(()=>{const params=getQueryParams();const tag_id=state.tag_id??localStorage.getItem(\"tag_id\");const delay=state.delay??localStorage.getItem(\"delay\");const redirect=state.redirect??localStorage.getItem(\"redirect\");console.log(iframe.contentWindow);iframe.contentWindow?.postMessage({type:\"UPDATE_TAG_AND_DELAY\",tagId:tag_id,delay,redirect,...params},\"https://kpi-crm.digienskampus.com\");},2e3)// veya 500ms gibi\n;};}},[]);return /*#__PURE__*/_jsx(Component,{ref:ref,...props});});Wrapped.displayName=`WithPostMessage(${Component.displayName||Component.name||\"Component\"})`;return Wrapped;}\nexport const __FramerMetadata__ = {\"exports\":{\"withPostMessage\":{\"type\":\"reactHoc\",\"name\":\"withPostMessage\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"g4BACid,EAAW,EAAS,GAAa,EAAkB,eAAqB,EAAkB,CAAC,UAAU,mBAAmB,CAA8L,EAAY,CAAC,OAAO,GAAG,MAAM,EAAE,SAAS,GAAG,KAAK,SAAS,CAAO,GAAY,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