{"version":3,"file":"FormPageLabel.DIShKOB9.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/CAiPOh5jW8sjhKQGY1KE/c49HDh8hzE6LoUy4Q8Ea/FormPageLabel.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{useEffect,useRef,useState}from\"react\";import{useMultiStepFormStore,useCanvasState,getFormInfo}from\"https://framerusercontent.com/modules/DwWOdDzQZGCuvkNlbUjZ/p64C0n6xNEFY9NovSiJw/FramerFormsShared.js\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n * @framerDisableUnlink\n */export default function FormPageLabel(props){var _props_style;const Tag=props.htmlTag||\"p\";const isCanvas=RenderTarget.current()===RenderTarget.canvas;const ref=useRef(null);const[multiStepFormState,setMultiStepFormState]=useMultiStepFormStore();const canvasState=useCanvasState(ref);const[formId,setFormId]=useState(null);const state=isCanvas?canvasState:multiStepFormState[formId];useEffect(()=>{const newFormId=getFormInfo(ref.current).formId;setFormId(newFormId);if(!multiStepFormState[newFormId]){setMultiStepFormState({});}},[]);var _state_totalPages;return /*#__PURE__*/_jsx(Tag,{\"data-framerforms\":true,ref:ref,style:{color:props.color,userSelect:props.textSelect?\"auto\":\"none\",whiteSpace:((_props_style=props.style)===null||_props_style===void 0?void 0:_props_style.width)?\"pre\":\"nowrap\",margin:0,...props.font,...props.style},children:props.text.replace(/\\[page\\]/g,(state===null||state===void 0?void 0:state.pageHistory)?state.pageHistory.length:1).replace(/\\[totalPages\\]/g,(_state_totalPages=state===null||state===void 0?void 0:state.totalPages)!==null&&_state_totalPages!==void 0?_state_totalPages:1)});}FormPageLabel.displayName=\"Form Page Label\";addPropertyControls(FormPageLabel,{text:{type:ControlType.String,defaultValue:\"Page [page] / [totalPages]\",description:\"*[page]*: current page\\n*[totalPages]*: total number of pages\"},font:{type:\"font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:14,lineHeight:1.4}},color:{type:ControlType.Color,defaultValue:\"#888\"},textSelect:{type:ControlType.Boolean,defaultValue:true},htmlTag:{type:ControlType.Enum,options:[\"p\",\"span\",\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\"],title:\"HTML Tag\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FormPageLabel\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any\",\"framerSupportedLayoutWidth\":\"any\",\"framerDisableUnlink\":\"\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"iQAIG,SAAwB,EAAc,EAAM,CAAkB,IAAM,EAAI,EAAM,SAAS,IAAU,EAAS,EAAa,SAAS,GAAG,EAAa,OAAa,EAAIA,EAAO,KAAK,CAAM,CAAC,EAAmB,GAAuB,GAAuB,CAAO,EAAY,EAAe,EAAI,CAAM,CAAC,EAAO,GAAWC,EAAS,KAAK,CAAO,EAAM,EAAS,EAAY,EAAmB,GAAsL,OAA9K,MAAc,CAAC,IAAM,EAAU,EAAY,EAAI,QAAQ,CAAC,OAAO,EAAU,EAAU,CAAK,EAAmB,IAAY,EAAsB,EAAE,CAAC,EAAI,EAAE,CAAC,CAA2C,EAAK,EAAI,CAAC,mBAAmB,GAAS,MAAI,MAAM,CAAC,MAAM,EAAM,MAAM,WAAW,EAAM,WAAW,OAAO,OAAO,WAA0B,EAAM,OAAyD,MAAO,MAAM,SAAS,OAAO,EAAE,GAAG,EAAM,KAAK,GAAG,EAAM,MAAM,CAAC,SAAS,EAAM,KAAK,QAAQ,YAAa,GAA0C,YAAa,EAAM,YAAY,OAAO,EAAE,CAAC,QAAQ,kBAAqC,GAA0C,YAAiE,EAAE,CAAC,CAAC,kBAJpjC,IAAiE,IAA6C,IAAmK,CAIqyB,EAAc,YAAY,kBAAkB,EAAoB,EAAc,CAAC,KAAK,CAAC,KAAK,EAAY,OAAO,aAAa,6BAA6B,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