{"version":3,"file":"Message.DkbXObH0.mjs","names":[],"sources":["https:/framer.com/m/CMSLibrary-vH7O.js","https:/framerusercontent.com/modules/bWuIUhIQLpjdL0ydQqRy/3nMJlk7029Qui8lmEzG8/Message.js"],"sourcesContent":["export function getCollectionData(collectionList){let queryParent=null;if(collectionList?.props?.query){queryParent=collectionList;}else if(collectionList?.props?.children?.props?.query){queryParent=collectionList.props.children;}else if(collectionList?.props?.children?.props?.children?.props?.query){queryParent=collectionList.props.children.props.children;}const query=queryParent?.props?.query;const from=query?.from;let collections=[];if(from){if(from.type===\"Collection\"){collections.push(from);}else if(from.type===\"LeftJoin\"){processJoin(from.left,collections);processJoin(from.right,collections);}}const select=query?.select;if(collections.length>1&&Array.isArray(select)){for(const field of select){if(field.type==\"Identifier\"&&field.name==\"id\"&&!field.alias){const mainCollection=collections.find(c=>c.alias==field.collection);if(mainCollection){collections=[mainCollection,...collections.filter(c=>c!==mainCollection)];}break;}}}const multiReferenceQueries={};const multiReferenceIdMap={};// Get collections from multi-reference fields\nif(Array.isArray(select)){for(const field of select){if(field.type===\"FunctionCall\"&&(field.functionName===\"ARRAY\"||field.functionName===\"FLAT_ARRAY\")&&Array.isArray(field.arguments)){for(const argument of field.arguments){if(argument.from?.type===\"Collection\"){const alias=argument.from.alias;let fieldId=alias;const right=argument.where?.right;if(right&&right.type===\"Identifier\"&&right.name){fieldId=right.name;}collections.push({...argument.from,fieldId});multiReferenceIdMap[fieldId]=alias;multiReferenceIdMap[alias]=alias;multiReferenceQueries[alias]=argument;}}}}}let queryData=collections[0]?.data;const propertyControlsById={};const propertyControlsByTitle={};for(const collection of collections){const byId={};const byName={};propertyControlsById[collection.alias]=byId;propertyControlsByTitle[collection.alias]=byName;const propertyControls=collection.data?.propertyControls;for(const id of Object.keys(propertyControls)){const control={id,...propertyControls[id]};byId[id]=control;byName[control.title]=control;}}// Get children function\nlet childrenFunction=null;if(collectionList){const clpc=collectionList.props?.children;if(typeof clpc==\"function\"){childrenFunction=clpc;}else if(typeof clpc?.props?.children==\"function\"){childrenFunction=clpc.props.children;}else if(typeof clpc?.props?.children?.props?.children==\"function\"){childrenFunction=clpc.props.children.props.children;}}return{query,queryParent,queryData,collections,propertyControlsById,propertyControlsByTitle,childrenFunction,multiReferenceQueries,multiReferenceIdMap};}function processJoin(join,collections){if(join&&typeof join===\"object\"){if(join.type===\"Collection\"){collections.push(join);}else if(join.type===\"LeftJoin\"){processJoin(join.left,collections);processJoin(join.right,collections);}}}// field: { name: string, referenceFieldName: string }\nexport function addFieldsToSelect(fields,query,propertyControlsByTitle,collections){const select=Array.isArray(query?.select)?[...query.select]:[];for(const field of fields){const selectItem=getSelectItemForField(field.name,field.referenceFieldName,query,propertyControlsByTitle,collections,select);if(selectItem){select.push(selectItem);}}return select;}export function getSelectItemForField(name,referenceFieldName,query,propertyControlsByTitle,collections,select=null// When there is a select, check for a matching existing select item\n){// const mainAlias = query?.from?.alias || \"\"\nconst mainAlias=collections[0]?.alias||\"\";const propertyControl=propertyControlsByTitle[mainAlias]?.[name];if(!propertyControl){return null;}const fieldId=propertyControl?.id;const alias=referenceFieldName?fieldId:mainAlias;const referencedField=referenceFieldName?propertyControlsByTitle[fieldId]?.[referenceFieldName]:null;if(select){let matchFound=false;for(const item of select){if(item.type===\"Identifier\"){if(referenceFieldName){if(referencedField&&item.alias===`${fieldId}.${referencedField.id}`&&item.collection===fieldId&&item.name===referencedField.id){matchFound=true;break;}}else{if(item.name===fieldId&&item.collection===alias){matchFound=true;break;}}}else if(item.type===\"FunctionCall\"){if(item.alias===fieldId){matchFound=true;break;}}}if(matchFound){return null;}}if(referenceFieldName){if(referencedField){return{alias:`${fieldId}.${referencedField.id}`,collection:fieldId,name:referencedField.id,type:\"Identifier\"};}}else{return{collection:alias,name:fieldId,type:\"Identifier\"};}}\nexport const __FramerMetadata__ = {\"exports\":{\"getSelectItemForField\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getCollectionData\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"addFieldsToSelect\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CMSLibrary.map","import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";export function Message({title,subtitle}){return /*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",width:\"100%\",height:\"100%\",placeContent:\"center\",placeItems:\"center\",flexDirection:\"column\",gap:16,backgroundColor:\"rgba(136, 85, 255, 0.1)\",borderRadius:6,border:\"1px dashed rgb(136, 85, 255)\",color:\"rgb(136, 85, 255)\",fontSize:16,padding:20,minHeight:200,// @ts-ignore\ntextWrap:\"balance\"},children:[/*#__PURE__*/_jsx(\"p\",{style:{margin:0,fontWeight:600,textAlign:\"center\"},children:title}),/*#__PURE__*/_jsx(\"p\",{style:{margin:0,opacity:.7,lineHeight:1.5,textAlign:\"center\"},children:subtitle})]});}\nexport const __FramerMetadata__ = {\"exports\":{\"Message\":{\"type\":\"reactComponent\",\"name\":\"Message\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Message.map"],"mappings":"iIAAA,SAAgB,EAAkB,EAAe,CAAC,IAAI,EAAY,KAAK,AAAG,GAAgB,OAAO,MAAO,EAAY,EAAwB,GAAgB,OAAO,UAAU,OAAO,MAAO,EAAY,EAAe,MAAM,SAAkB,GAAgB,OAAO,UAAU,OAAO,UAAU,OAAO,QAAO,EAAY,EAAe,MAAM,SAAS,MAAM,UAAU,IAAM,EAAM,GAAa,OAAO,MAAY,EAAK,GAAO,KAAS,EAAY,CAAE,EAAC,AAAG,IAAS,EAAK,OAAO,aAAc,EAAY,KAAK,EAAK,CAAU,EAAK,OAAO,aAAY,EAAY,EAAK,KAAK,EAAY,CAAC,EAAY,EAAK,MAAM,EAAY,GAAG,IAAM,EAAO,GAAO,OAAO,GAAG,EA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