{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/BBUAbGx22zVBT9dNUfhp/EloIiNVxyGmTu7IVoOOS/CMSCounter.js"],
  "sourcesContent": ["import{jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget,// @ts-ignore\nuseQueryData}from\"framer\";import{getCollectionData}from\"https://framer.com/m/CMSLibrary-09eo.js\";function formatNumber(value,commas){let numberString=value.toFixed(0);if(commas){numberString=numberString.replace(/\\B(?=(\\d{3})+(?!\\d))/g,\",\");}return numberString;}/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function CMSCounter(props){var _props_collectionList,_props_style;const{transform}=props;const isCanvas=RenderTarget.current()===RenderTarget.canvas;const collectionList=(_props_collectionList=props.collectionList)===null||_props_collectionList===void 0?void 0:_props_collectionList[0];const{query}=getCollectionData(collectionList);let items=props.placeholder;// Only display number of CMS items in the preview and live website.\nif(query&&!isCanvas){items=useQueryData(query).length;}let prefix=\"\";let suffix=\"\";if(transform){if(transform.plural){prefix=items==1?transform.singularPrefix:transform.pluralPrefix;suffix=items==1?transform.singularSuffix:transform.pluralSuffix;}else{prefix=transform.prefix;suffix=transform.suffix;}}return /*#__PURE__*/_jsxs(\"div\",{style:{color:props.fontColor,userSelect:props.textSelect?\"auto\":\"none\",margin:0,whiteSpace:((_props_style=props.style)===null||_props_style===void 0?void 0:_props_style.width)?undefined:\"nowrap\",...props.font,...props.style},children:[prefix,formatNumber(items,props.commas),suffix]});}CMSCounter.displayName=\"CMS Item Counter\";addPropertyControls(CMSCounter,{collectionList:{type:ControlType.ComponentInstance},placeholder:{type:ControlType.Number,defaultValue:10,min:0,step:1,description:\"Placeholder number is shown in the editor.\"},commas:{type:ControlType.Boolean,defaultValue:true},fontColor:{type:ControlType.Color,defaultValue:\"#000\"},font:{type:\"font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:14,lineHeight:1}},transform:{type:ControlType.Object,optional:true,controls:{plural:{type:ControlType.Boolean,defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"},prefix:{type:ControlType.String,hidden(props){return props.plural;}},suffix:{type:ControlType.String,hidden(props){return props.plural;}},singularPrefix:{type:ControlType.String,placeholder:\"Singular Prefix\",hidden(props){return!props.plural;}},singularSuffix:{type:ControlType.String,placeholder:\"Singular Suffix\",hidden(props){return!props.plural;}},pluralPrefix:{type:ControlType.String,placeholder:\"Plural Prefix\",hidden(props){return!props.plural;}},pluralSuffix:{type:ControlType.String,placeholder:\"Plural Suffix\",hidden(props){return!props.plural;}}}},textSelect:{type:ControlType.Boolean,defaultValue:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CMSCounter\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any\",\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CMSCounter.map"],
  "mappings": "iJACiG,SAASA,EAAaC,EAAMC,EAAO,CAAC,IAAIC,EAAaF,EAAM,QAAQ,CAAC,EAAE,OAAGC,IAAQC,EAAaA,EAAa,QAAQ,wBAAwB,GAAG,GAAUA,CAAa,CAGpP,SAARC,EAA4BC,EAAM,CAAC,IAAIC,EAAsBC,EAAa,GAAK,CAAC,UAAAC,CAAS,EAAEH,EAAYI,EAASC,EAAa,QAAQ,IAAIA,EAAa,OAAaC,GAAgBL,EAAsBD,EAAM,kBAAkB,MAAMC,IAAwB,OAAO,OAAOA,EAAsB,CAAC,EAAO,CAAC,MAAAM,CAAK,EAAEC,EAAkBF,CAAc,EAAMG,EAAMT,EAAM,YAC5WO,GAAO,CAACH,IAAUK,EAAMC,EAAaH,CAAK,EAAE,QAAQ,IAAII,EAAO,GAAOC,EAAO,GAAG,OAAGT,IAAcA,EAAU,QAAQQ,EAAOF,GAAO,EAAEN,EAAU,eAAeA,EAAU,aAAaS,EAAOH,GAAO,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,EAAE,aAAa,CAAC,KAAKe,EAAY,OAAO,YAAY,gBAAgB,OAAOf,EAAM,CAAC,MAAM,CAACA,EAAM,MAAO,CAAC,EAAE,aAAa,CAAC,KAAKe,EAAY,OAAO,YAAY,gBAAgB,OAAOf,EAAM,CAAC,MAAM,CAACA,EAAM,MAAO,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,KAAKe,EAAY,QAAQ,aAAa,EAAI,CAAC,CAAC",
  "names": ["formatNumber", "value", "commas", "numberString", "CMSCounter", "props", "_props_collectionList", "_props_style", "transform", "isCanvas", "RenderTarget", "collectionList", "query", "getCollectionData", "items", "useQueryData", "prefix", "suffix", "u", "addPropertyControls", "ControlType"]
}
