{"version":3,"file":"CMSSlideshow.B0bDAeIF.mjs","names":["SlideShow","j","Children"],"sources":["https:/framerusercontent.com/modules/OPJlnSDokJ2eD9lIXljn/mr2QJ5zw4xvkJ1Vbvzgr/CMSLibrary.js","https:/framer.com/m/CMSLibrary-09eo.js","https:/framerusercontent.com/modules/MvMI8rlAwWI6W41vb7x5/Gwq5XNGR2fw3oxqNnFeg/CMSSlideshow.js"],"sourcesContent":["export function getCollectionData(collectionList){var _collectionList_props,_collectionList_props_children_props,_collectionList_props_children,_collectionList_props1,_collectionList_props_children_props_children_props,_collectionList_props_children_props_children,_collectionList_props_children_props1,_collectionList_props_children1,_collectionList_props2,_queryParent_props;let queryParent=null;if(collectionList===null||collectionList===void 0?void 0:(_collectionList_props=collectionList.props)===null||_collectionList_props===void 0?void 0:_collectionList_props.query){queryParent=collectionList;}else if(collectionList===null||collectionList===void 0?void 0:(_collectionList_props1=collectionList.props)===null||_collectionList_props1===void 0?void 0:(_collectionList_props_children=_collectionList_props1.children)===null||_collectionList_props_children===void 0?void 0:(_collectionList_props_children_props=_collectionList_props_children.props)===null||_collectionList_props_children_props===void 0?void 0:_collectionList_props_children_props.query){queryParent=collectionList.props.children;}else if(collectionList===null||collectionList===void 0?void 0:(_collectionList_props2=collectionList.props)===null||_collectionList_props2===void 0?void 0:(_collectionList_props_children1=_collectionList_props2.children)===null||_collectionList_props_children1===void 0?void 0:(_collectionList_props_children_props1=_collectionList_props_children1.props)===null||_collectionList_props_children_props1===void 0?void 0:(_collectionList_props_children_props_children=_collectionList_props_children_props1.children)===null||_collectionList_props_children_props_children===void 0?void 0:(_collectionList_props_children_props_children_props=_collectionList_props_children_props_children.props)===null||_collectionList_props_children_props_children_props===void 0?void 0:_collectionList_props_children_props_children_props.query){queryParent=collectionList.props.children.props.children;}const query=queryParent===null||queryParent===void 0?void 0:(_queryParent_props=queryParent.props)===null||_queryParent_props===void 0?void 0:_queryParent_props.query;let queryData=null;if(query===null||query===void 0?void 0:query.from){if(query.from.data){queryData=query.from.data;}else if(query.from.left){let left=query.from.left;for(let i=0;i<100;i++){if(left.type==\"Collection\"){queryData=left.data;break;}else if(left.left){left=left.left;}else{break;}}}}// Get property controls\nconst propertyControlsById=(queryData===null||queryData===void 0?void 0:queryData.propertyControls)||{};const propertyControlsByName={};for(const id in propertyControlsById){const control=propertyControlsById[id];propertyControlsByName[control.title]={id,...control};}// Get children function\nlet childrenFunction=null;if(collectionList){var _collectionList_props3,_clpc_props,_clpc_props_children_props,_clpc_props_children,_clpc_props1;const clpc=(_collectionList_props3=collectionList.props)===null||_collectionList_props3===void 0?void 0:_collectionList_props3.children;if(typeof clpc==\"function\"){childrenFunction=clpc;}else if(typeof(clpc===null||clpc===void 0?void 0:(_clpc_props=clpc.props)===null||_clpc_props===void 0?void 0:_clpc_props.children)==\"function\"){childrenFunction=clpc.props.children;}else if(typeof(clpc===null||clpc===void 0?void 0:(_clpc_props1=clpc.props)===null||_clpc_props1===void 0?void 0:(_clpc_props_children=_clpc_props1.children)===null||_clpc_props_children===void 0?void 0:(_clpc_props_children_props=_clpc_props_children.props)===null||_clpc_props_children_props===void 0?void 0:_clpc_props_children_props.children)==\"function\"){childrenFunction=clpc.props.children.props.children;}}return{query,queryParent,queryData,propertyControlsById,propertyControlsByName,childrenFunction};}export function addFieldsToSelect(fields,query,propertyControlsByName){const alias=query.alias;const select=Array.isArray(query===null||query===void 0?void 0:query.select)?[...query.select]:[];for(const fieldName of fields){var _propertyControlsByName_fieldName;const fieldId=(_propertyControlsByName_fieldName=propertyControlsByName[fieldName])===null||_propertyControlsByName_fieldName===void 0?void 0:_propertyControlsByName_fieldName.id;if(!fieldId){continue;}let matchFound=false;for(const item of select){if(item.name===fieldId&&item.type===\"Identifier\"&&item.collection===alias){matchFound=true;continue;}}if(matchFound){continue;}select.push({collection:alias,name:fieldId,type:\"Identifier\"});}return select;}\nexport const __FramerMetadata__ = {\"exports\":{\"getCollectionData\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"addFieldsToSelect\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CMSLibrary.map","/*\n * CMSLibrary\n *\n * Learn More: https://www.framer.com/asset-urls\n */\n\nexport * from \"https://framerusercontent.com/modules/OPJlnSDokJ2eD9lIXljn/mr2QJ5zw4xvkJ1Vbvzgr/CMSLibrary.js\"\n","import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,// @ts-ignore\ngetPropertyControls,// @ts-ignore\nuseQueryData,ControlType,RenderTarget}from\"framer\";import{cloneElement,Children}from\"react\";import{motion}from\"framer-motion\";import SlideShow from\"https://framer.com/m/SlideShow-07du.js\";import{getCollectionData}from\"https://framer.com/m/CMSLibrary-09eo.js\";const slideshowProps=getComponentProps(SlideShow);/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n * @framerIntrinsicWidth 400\n * @framerIntrinsicHeight 200\n */export default function CMSSlideshow(props){var _props_collectionList;const{startLayers,endLayers,...otherProps}=props;const isCanvas=RenderTarget.current()===RenderTarget.canvas;const items=isCanvas?[]:getCollectionListItems((_props_collectionList=props.collectionList)===null||_props_collectionList===void 0?void 0:_props_collectionList[0]);let layers=[];if(startLayers){layers=layers.concat(startLayers);}if(!isCanvas){for(let i=0;i<items.length;i++){const layer=/*#__PURE__*/cloneElement(items[i].props.children.props.children,{style:{width:\"100%\",height:\"100%\"}});layers.push(/*#__PURE__*/_jsx(motion.div,{style:{width:\"100%\",height:\"100%\"},children:layer}));}if(props.randomize){layers=shuffleArray(layers);}}else{for(let i=0;i<props.itemAmount;i++){layers.push(/*#__PURE__*/_jsx(CanvasPlaceholder,{title:\"Run project to view slideshow content\",subtitle:\"Collection List content is not accessible to the slideshow component in the editor. Run your project orvisit the live website to view the slideshow with CMS content.\"}));}}if(endLayers){layers=layers.concat(endLayers);}return /*#__PURE__*/_jsx(SlideShow,{...otherProps,slots:layers});}CMSSlideshow.displayName=\"CMS Slideshow\";addPropertyControls(CMSSlideshow,{collectionList:{type:ControlType.ComponentInstance},startLayers:{type:ControlType.Array,control:{type:ControlType.ComponentInstance},title:\"Start\"},endLayers:{type:ControlType.Array,control:{type:ControlType.ComponentInstance},title:\"End\"},randomize:{type:ControlType.Boolean,defaultValue:false,description:\"Shuffle order of CMS items\"},...slideshowProps,arrowOptions:{...slideshowProps.arrowOptions,controls:{...slideshowProps.arrowOptions.controls,arrowPadding:{...slideshowProps.arrowOptions.controls.arrowPadding,max:Infinity,min:Infinity}}}});function getComponentProps(component){const{slots,...otherProps}=getPropertyControls(component);return otherProps;}export function CanvasPlaceholder({title,subtitle}){return /*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",width:\"100%\",height:\"100%\",placeContent:\"center\",placeItems:\"center\",flexDirection:\"column\",backgroundColor:\"rgba(136, 85, 255, 0.1)\",borderRadius:6,border:\"1px dashed rgb(136, 85, 255)\",color:\"rgb(136, 85, 255)\",fontSize:12,padding:24},children:[/*#__PURE__*/_jsx(\"p\",{style:{margin:0,marginBottom:10,fontWeight:600,textAlign:\"center\"},children:title}),/*#__PURE__*/_jsx(\"p\",{style:{margin:0,opacity:.7,maxWidth:500,lineHeight:1.5,textAlign:\"center\"},children:subtitle})]});}function shuffleArray(array){for(let i=array.length-1;i>0;i--){const j=Math.floor(Math.random()*(i+1));[array[i],array[j]]=[array[j],array[i]];}return array;}export function getCollectionListItems(collectionList){const{query,childrenFunction}=getCollectionData(collectionList);if(query&&childrenFunction){var _clChildren_props_children,_clChildren_props,_clChildren_props1;const data=useQueryData(query);let children=[];let clChildren=childrenFunction(data);if(Array.isArray(clChildren)){children=clChildren;}else if(Array.isArray(clChildren===null||clChildren===void 0?void 0:(_clChildren_props=clChildren.props)===null||_clChildren_props===void 0?void 0:(_clChildren_props_children=_clChildren_props.children)===null||_clChildren_props_children===void 0?void 0:_clChildren_props_children[0])){children=clChildren.props.children[0];}else if(Array.isArray(clChildren===null||clChildren===void 0?void 0:(_clChildren_props1=clChildren.props)===null||_clChildren_props1===void 0?void 0:_clChildren_props1.children)){children=clChildren.props.children;}if(children){return Children.toArray(children);}}return[];}\nexport const __FramerMetadata__ = {\"exports\":{\"getCollectionListItems\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"CanvasPlaceholder\":{\"type\":\"reactComponent\",\"name\":\"CanvasPlaceholder\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"default\":{\"type\":\"reactComponent\",\"name\":\"CMSSlideshow\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"400\",\"framerIntrinsicHeight\":\"200\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerSupportedLayoutWidth\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CMSSlideshow.map"],"mappings":"+eAAA,SAAgB,EAAkB,EAAe,CAAC,IAA+D,EAA+B,EAA2E,EAA8C,EAAsC,EAAgC,EAA0C,IAAI,EAAY,KAAQ,GAAiB,MAA4D,EAAe,OAA2E,MAAO,EAAY,EAAwB,KAAiB,OAAsC,EAAuB,EAAe,QAAS,OAA8C,EAA+B,EAAuB,WAAY,OAA2F,EAA+B,OAAyG,MAAO,EAAY,EAAe,MAAM,SAAkB,KAAiB,OAAsC,EAAuB,EAAe,QAAS,OAA8C,EAAgC,EAAuB,WAAY,OAAuD,EAAsC,EAAgC,QAAS,OAA6D,EAA8C,EAAsC,WAAY,OAAyH,EAA8C,OAAuI,QAAO,EAAY,EAAe,MAAM,SAAS,MAAM,UAAU,IAAM,EAAM,GAAgF,OAAqE,MAAU,EAAU,KAAK,GAAG,GAA0C,SAAS,EAAM,KAAK,KAAM,EAAU,EAAM,KAAK,aAAc,EAAM,KAAK,KAAK,CAAC,IAAI,EAAK,EAAM,KAAK,KAAK,IAAI,IAAI,EAAE,EAAE,EAAE,IAAI,IAAK,GAAG,EAAK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