{"version":3,"file":"MiddleLayout.jgLvwcOx.mjs","names":["useState","_Fragment","__esmMin","init_npm_react_18_3_1","init_ssg_sandbox_shims","navigator","window","l","_e","p","init_jsx_runtime","ce","Test","data","setData","prizeNumber","setPrizeNumber","visible","setVisible","url","toastStyle","copyToClipboard","text","textArea","codes","c","code","i","init_MiddleLayout"],"sources":["https:/framerusercontent.com/modules/ZkGWTcmJ29Wlqvey9d3L/mIZFue3Xm60aHcuXXnR4/MiddleLayout.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";// Welcome to Code in Framer\n// Get Started: https://www.framer.com/developers/\n/**\n * These annotations control how your component sizes\n * Learn more: https://www.framer.com/developers/#code-components-auto-sizing\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function Test(props){// This is a React component containing an Example component\n// - Replace <Example /> with your own code\n// - Find inspiration: https://www.framer.com/developers/\nconst[data,setData]=useState([]);const[prizeNumber,setPrizeNumber]=useState(\"\");const[visible,setVisible]=useState(false);useEffect(()=>{const url=decodeURIComponent(window.location.href);const urlObj=new URL(url);const params=urlObj.searchParams;const prizeNumber=params.get(\"prizeNumber\");if(prizeNumber)setPrizeNumber(prizeNumber);},[]);const toastStyle={position:\"fixed\",width:\"328px\",bottom:visible?\"16px\":\"-100px\",left:\"50%\",transform:\"translateX(-50%)\",backgroundColor:\"rgba(34, 34, 34, 0.9)\",borderRadius:\"12px\",color:\"white\",padding:\"16px\",opacity:visible?\"1\":\"0\",transition:\"all 0.5s ease\",zIndex:9999};function copyToClipboard(text){// 네비게이터 클립보드 API가 있는지 확인\nif(navigator.clipboard){// 비동기적으로 클립보드에 텍스트 복사 시도\nnavigator.clipboard.writeText(text).then(()=>{setVisible(true);setTimeout(()=>setVisible(false),3e3);}).catch(err=>{alert(\"쿠폰 코드 복사에 실패했어요. 잠시 후 다시 시도해보세요.\");});}else{// 클립보드 API가 없는 경우, textarea를 사용하는 fallback 방식\nlet textArea=document.createElement(\"textarea\");textArea.value=text;// 스타일을 조정하여 뷰포트 내에서 보이지 않도록 설정\ntextArea.style.position=\"fixed\";textArea.style.top=\"0\";textArea.style.left=\"0\";textArea.style.width=\"2em\";textArea.style.height=\"2em\";textArea.style.padding=\"0\";textArea.style.border=\"none\";textArea.style.outline=\"none\";textArea.style.boxShadow=\"none\";textArea.style.background=\"transparent\";document.body.appendChild(textArea);textArea.focus();textArea.select();try{document.execCommand(\"copy\");setVisible(true);setTimeout(()=>setVisible(false),2e3);}catch(err){alert(\"쿠폰 코드 복사에 실패했어요. 잠시 후 다시 시도해보세요.\");}document.body.removeChild(textArea);}}const codes=prizeNumber.split(/[,\\s]+/).map(c=>c.trim()).filter(Boolean);return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",flexDirection:\"column\",alignItems:\"center\",gap:\"16px\"},children:codes.map((code,i)=>/*#__PURE__*/_jsx(\"div\",{onClick:()=>copyToClipboard(code),children:/*#__PURE__*/_jsxs(\"div\",{style:{fontFamily:\"Roboto Mono\",display:\"flex\",position:\"relative\",flexDirection:\"column\",alignItems:\"center\",width:\"328px\",boxShadow:\"0 1px 20px 0 rgba(255, 85, 0, 0.3)\",height:\"150px\",background:\"white\",gap:\"16px\",padding:\"16px\",borderRadius:\"12px\"},children:[/*#__PURE__*/_jsx(\"div\",{style:{marginTop:\"34px\",color:\"black\",fontSize:\"30px\",fontWeight:500,wordBreak:\"break-all\"},children:code}),/*#__PURE__*/_jsx(\"div\",{style:{fontFamily:\"Pretendard Regular\",position:\"absolute\",bottom:\"18px\",color:\"#FF5500\",whiteSpace:\"pre-line\",fontSize:\"14px\",fontWeight:500},children:\"코드 복사하기\"})]})},i))}),/*#__PURE__*/_jsxs(\"div\",{style:toastStyle,children:[/*#__PURE__*/_jsx(\"div\",{style:{fontSize:\"15px\",fontWeight:\"bold\",marginBottom:\"4px\",color:\"white\"},children:\"코드 복사 완료\"}),/*#__PURE__*/_jsx(\"div\",{style:{fontSize:\"15px\",fontWeight:\"regular\",color:\"white\",lineHeight:\"140%\"},children:\"콴다 유저 전용 쿠폰이며, 해당 쿠폰은 오프라인 매장에서 사용이 가능합니다. 쿠폰 번호를 캡쳐해주세요.\"})]})]});}// Styles are written in object syntax\n// Learn more: https://reactjs.org/docs/dom-elements.html#style\n\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Test\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"auto\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./MiddleLayout.map"],"mappings":"A,4JAQG,SAAwBY,EAAK,EAAM,CAGtC,GAAK,CAACC,EAAKC,GAASd,EAAS,CAAC,CAAC,EAAO,CAACe,EAAYC,GAAgBhB,EAAS,EAAE,EAAO,CAACiB,EAAQC,GAAYlB,EAAS,EAAK,EAAEW,MAAc,CAAC,IAAMQ,EAAI,mBAAmBb,EAAO,SAAS,IAAI,EAAmES,EAA1B,IAAtB,IAAII,CAAuB,CAAC,CAAC,aAAsC,IAAI,aAAa,EAAKJ,GAAYC,EAAeD,CAAW,CAAE,EAAE,CAAC,CAAC,EAAE,IAAMK,EAAW,CAAC,SAAS,QAAQ,MAAM,QAAQ,OAAOH,EAAQ,OAAO,SAAS,KAAK,MAAM,UAAU,mBAAmB,gBAAgB,wBAAwB,aAAa,OAAO,MAAM,QAAQ,QAAQ,OAAO,QAAQA,EAAQ,IAAI,IAAI,WAAW,gBAAgB,OAAO,IAAI,EAAE,SAASI,EAAgB,EAAK,CACnoB,GAAGhB,EAAU,UACbA,EAAU,UAAU,UAAUiB,CAAI,CAAC,CAAC,SAAS,CAACJ,EAAW,EAAI,EAAE,eAAeA,EAAW,EAAK,EAAE,GAAG,CAAE,CAAC,CAAC,CAAC,MAAM,GAAK,CAAC,MAA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