{"version":3,"file":"WithNameInput.DKYSR70R.mjs","names":[],"sources":["https:/framerusercontent.com/modules/28rXvpPsrum7FH6cMELS/1jCAazZw1EGHjrG5Nu5D/Utils.js","https:/framer.com/m/framer/utils.js@^0.9.0","https:/framerusercontent.com/modules/TLJSrxdVYRFcr3Mm08MC/30xyRccnhy9KeoxvLo0G/WithNameInput.js"],"sourcesContent":["export const centerContent = {\n    display: \"flex\",\n    justifyContent: \"center\",\n    alignItems: \"center\"\n};\nexport const autoSizingText = {\n    width: \"max-content\",\n    wordBreak: \"break-word\",\n    overflowWrap: \"break-word\",\n    overflow: \"hidden\",\n    whiteSpace: \"pre-wrap\",\n    flexShrink: 0\n};\nexport const defaultContainerStyles = {\n    ...centerContent,\n    overflow: \"hidden\"\n};\nexport const containerStyles = defaultContainerStyles;\nexport const randomColor = ()=>\"#\" + Math.floor(Math.random() * 16777215).toString(16)\n;\n\nexport const __FramerMetadata__ = {\"exports\":{\"centerContent\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"containerStyles\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"autoSizingText\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"defaultContainerStyles\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"randomColor\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}}}}\n//# sourceMappingURL=./Utils.map","/*\n * Utils (framer/utils@0.9.0)\n *\n * Learn More: https://www.framer.com/asset-urls\n */\n\nexport * from \"https://framerusercontent.com/modules/28rXvpPsrum7FH6cMELS/1jCAazZw1EGHjrG5Nu5D/Utils.js\"\n","import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef}from\"react\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";import{randomColor}from\"https://framer.com/m/framer/utils.js@^0.9.0\";// Learn more: https://www.framer.com/developers/overrides/\nconst useStore=createStore({background:\"#0099FF\"});export function withRotate(Component){return /*#__PURE__*/forwardRef((props,ref)=>{return /*#__PURE__*/_jsx(Component,{ref:ref,...props,animate:{rotate:90},transition:{duration:2}});});}export function withHover(Component){return /*#__PURE__*/forwardRef((props,ref)=>{return /*#__PURE__*/_jsx(Component,{ref:ref,...props,whileHover:{scale:1.05}});});}export function withRandomColor(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[store,setStore]=useStore();return /*#__PURE__*/_jsx(Component,{ref:ref,...props,animate:{background:store.background},onClick:()=>{setStore({background:randomColor()});}});});}// ---------- ADD BELOW YOUR EXISTING OVERRIDES (do not edit them) ----------\n/**\n * Minimal shared store for the user's name.\n * Uses the same createStore you already imported.\n */const useUserStore=createStore({userName:\"\"});/** Attach this to your NAME INPUT layer on page 1 */export function withNameInput(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[state,setState]=useUserStore();// accept either onValueChange(string) or onChange(event)\nconst setName=v=>{const next=typeof v===\"string\"?v:v?.target?.value??\"\";setState({userName:String(next)});try{localStorage.setItem(\"G_NAME\",String(next));}catch{}};return /*#__PURE__*/_jsx(Component,{ref:ref,...props,value:state.userName,onValueChange:v=>setName(v),onChange:e=>setName(e)});});}/** Attach this to a TEXT layer on page 2 to display just the name */export function withNameText(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[state]=useUserStore();// get plain string from store or localStorage\nconst name=(state?.userName??localStorage.getItem(\"G_NAME\")??\"\").toString().trim();// Only show the raw name (empty string if nothing entered)\nconst output=name||\"\";const childIsString=typeof props.children===\"string\";return /*#__PURE__*/_jsx(Component,{ref:ref,...props,text:output,children:childIsString?output:props.children});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withRotate\":{\"type\":\"reactHoc\",\"name\":\"withRotate\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRandomColor\":{\"type\":\"reactHoc\",\"name\":\"withRandomColor\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withNameInput\":{\"type\":\"reactHoc\",\"name\":\"withNameInput\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHover\":{\"type\":\"reactHoc\",\"name\":\"withHover\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withNameText\":{\"type\":\"reactHoc\",\"name\":\"withNameText\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./WithNameInput.map"],"mappings":"0LAAa,EAAgB,CACzB,QAAS,OACT,eAAgB,SAChB,WAAY,SACf,CAWG,CADA,GAAG,EACO,qBEVwF,SAAgB,EAAc,EAAU,CAAC,OAAoB,GAAY,EAAM,IAAM,CAAC,GAAK,CAAC,EAAM,GAAU,GAAc,CAC1N,EAAQ,GAAG,CAAC,IAAM,EAAK,OAAO,GAAI,SAAS,EAAE,GAAG,QAAQ,OAAO,GAAG,EAAS,CAAC,SAAS,OAAO,EAAK,CAAC,CAAC,CAAC,GAAG,CAAC,aAAa,QAAQ,SAAS,OAAO,EAAK,CAAC,MAAO,IAAI,OAAoB,EAAK,EAAU,CAAK,MAAI,GAAG,EAAM,MAAM,EAAM,SAAS,cAAc,GAAG,EAAQ,EAAE,CAAC,SAAS,GAAG,EAAQ,EAAE,CAAC,CAAC,EAAG,CAAuE,SAAgB,EAAa,EAAU,CAAC,OAAoB,GAAY,EAAM,IAAM,CAAC,GAAK,CAAC,GAAO,GAAc,CAEtd,GADM,GAAO,UAAU,aAAa,QAAQ,SAAS,EAAE,IAAI,UAAU,CAAC,MAAM,EAC/D,GAAS,EAAc,OAAO,EAAM,UAAW,SAAS,OAAoB,EAAK,EAAU,CAAK,MAAI,GAAG,EAAM,KAAK,EAAO,SAAS,EAAc,EAAO,EAAM,SAAS,CAAC,EAAG,oBARlJ,IAA8B,IAAqE,IAAqE,CACpM,EAAY,CAAC,WAAW,UAAU,CAAC,CAIzC,EAAa,EAAY,CAAC,SAAS,GAAG,CAAC"}