{"version":3,"file":"Rezero_AuthStateGate.8abeHtk-.mjs","names":["useState","React"],"sources":["https:/framerusercontent.com/modules/0gqkSR5CekYbpdK8z6St/hblhmu3dP9oLtxgUHqLK/Rezero_AuthStateGate.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import React,{useEffect,useState}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";const renderSlotTree=(slotNode,shouldApplyWidth=true)=>{return React.Children.map(slotNode,child=>{if(!/*#__PURE__*/React.isValidElement(child))return child;const element=child;const childProps=element.props??{};const isFragment=element.type===React.Fragment;const nextProps={};if(isFragment){if(childProps.children!==undefined){const nextChildren=renderSlotTree(childProps.children,shouldApplyWidth);if(nextChildren!==childProps.children){nextProps.children=nextChildren;}}}if(shouldApplyWidth&&!isFragment){nextProps.style={...childProps.style,width:\"100%\",height:\"100%\"};}if(Object.keys(nextProps).length===0)return child;return /*#__PURE__*/React.cloneElement(element,nextProps);});};const fillSlot=slot=>{if(!slot)return undefined;return renderSlotTree(slot);};/** @framerDisableUnlink */export default function ReZero_AuthStateGate({loggedIn,loggedOut,canvasPreview}){const isCanvas=RenderTarget.current()===RenderTarget.canvas;const[isLoggedIn,setIsLoggedIn]=useState(null);useEffect(()=>{const existing=window.__rzUserData;if(existing){setIsLoggedIn(existing.isLoggedIn??false);}const handler=e=>{const detail=e.detail;setIsLoggedIn(detail?.isLoggedIn??false);};window.addEventListener(\"rzUserDataLoaded\",handler);return()=>window.removeEventListener(\"rzUserDataLoaded\",handler);},[]);if(isCanvas){if(canvasPreview===\"ghost\"){return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\",backgroundColor:\"rgba(16, 185, 129, 0.08)\",color:\"#10b981\",fontSize:11,fontWeight:\"bold\",border:\"1px dashed #10b981\",borderRadius:8,whiteSpace:\"nowrap\",minWidth:\"max-content\",padding:\"0 12px\",boxSizing:\"border-box\"},children:\"Auth State Gate\"});}return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\"},children:fillSlot(canvasPreview===\"loggedIn\"?loggedIn:loggedOut)});}if(isLoggedIn===null)return null;return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\"},children:fillSlot(isLoggedIn?loggedIn:loggedOut)});}addPropertyControls(ReZero_AuthStateGate,{canvasPreview:{type:ControlType.Enum,title:\"캔버스 미리보기\",options:[\"loggedIn\",\"loggedOut\",\"ghost\"],optionTitles:[\"로그인 상태\",\"로그아웃 상태\",\"고스트 박스\"],defaultValue:\"ghost\"},loggedIn:{type:ControlType.Slot,title:\"로그인 상태\"},loggedOut:{type:ControlType.Slot,title:\"로그아웃 상태\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ReZero_AuthStateGate\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Rezero_AuthStateGate.map"],"mappings":"6MAAk7B,SAAwB,EAAqB,CAAC,WAAS,YAAU,iBAAe,CAAC,IAAM,EAAS,EAAa,QAAQ,IAAI,EAAa,OAAY,CAAC,EAAW,GAAeA,EAAS,IAAI,EAA83B,OAA53B,MAAc,CAAC,IAAM,EAAS,EAAO,aAAgB,GAAU,EAAc,EAAS,YAAY,EAAK,EAAG,IAAM,EAAQ,GAAG,CAAC,IAAM,EAAO,EAAE,OAAO,EAAc,GAAQ,YAAY,EAAK,CAAE,EAAsD,OAApD,EAAO,iBAAiB,mBAAmB,CAAO,MAAY,EAAO,oBAAoB,mBAAmB,CAAO,CAAE,EAAE,CAAC,CAAC,EAAK,EAAa,IAAgB,QAA6B,EAAK,MAAM,CAAC,MAAM,CAAC,MAAM,OAAO,OAAO,OAAO,QAAQ,OAAO,eAAe,SAAS,WAAW,SAAS,gBAAgB,2BAA2B,MAAM,UAAU,SAAS,GAAG,WAAW,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