@chem-po/react-native 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react from 'react';
2
2
  import react__default, { PropsWithChildren, FC, ReactNode, JSX } from 'react';
3
- import { ViewProps, View, StyleProp, ViewStyle, ActivityIndicatorProps, DimensionValue, TextProps } from 'react-native';
3
+ import { ViewProps, View, StyleProp, ViewStyle, TextStyle, ActivityIndicatorProps, DimensionValue, TextProps } from 'react-native';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
5
  import { Ionicons } from '@expo/vector-icons';
6
6
  import { AnyObject, WithId, InputRef, FileValue, BackendAdapterInterface, Theme, ColorMode } from '@chem-po/core';
@@ -85,7 +85,7 @@ interface LoadingButtonProps {
85
85
  onPress: (() => Promise<any>) | (() => void);
86
86
  children: ReactNode;
87
87
  style?: ViewStyle;
88
- textStyle?: ViewStyle;
88
+ textStyle?: TextStyle;
89
89
  color?: string;
90
90
  icon?: {
91
91
  name: react__default.ComponentProps<typeof Ionicons>['name'];
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react from 'react';
2
2
  import react__default, { PropsWithChildren, FC, ReactNode, JSX } from 'react';
3
- import { ViewProps, View, StyleProp, ViewStyle, ActivityIndicatorProps, DimensionValue, TextProps } from 'react-native';
3
+ import { ViewProps, View, StyleProp, ViewStyle, TextStyle, ActivityIndicatorProps, DimensionValue, TextProps } from 'react-native';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
5
  import { Ionicons } from '@expo/vector-icons';
6
6
  import { AnyObject, WithId, InputRef, FileValue, BackendAdapterInterface, Theme, ColorMode } from '@chem-po/core';
@@ -85,7 +85,7 @@ interface LoadingButtonProps {
85
85
  onPress: (() => Promise<any>) | (() => void);
86
86
  children: ReactNode;
87
87
  style?: ViewStyle;
88
- textStyle?: ViewStyle;
88
+ textStyle?: TextStyle;
89
89
  color?: string;
90
90
  icon?: {
91
91
  name: react__default.ComponentProps<typeof Ionicons>['name'];
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- 'use strict';var Vi=require('react'),reactNative=require('react-native'),jsxRuntime=require('react/jsx-runtime'),react=require('@chem-po/react'),vectorIcons=require('@expo/vector-icons'),ro=require('react-native-toast-message'),reactNativeGestureHandler=require('react-native-gesture-handler'),aa=require('lottie-react-native'),qa=require('@expo/vector-icons/MaterialCommunityIcons'),core=require('@chem-po/core'),reactHookForm=require('react-hook-form'),Cl=require('@react-native-community/slider'),reactNativePaper=require('react-native-paper'),reactNativePaperDates=require('react-native-paper-dates'),dr=require('expo-document-picker'),ur=require('expo-image-picker'),reactNativeNotifier=require('react-native-notifier');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var Vi__default=/*#__PURE__*/_interopDefault(Vi);var ro__default=/*#__PURE__*/_interopDefault(ro);var aa__default=/*#__PURE__*/_interopDefault(aa);var qa__default=/*#__PURE__*/_interopDefault(qa);var Cl__default=/*#__PURE__*/_interopDefault(Cl);var dr__namespace=/*#__PURE__*/_interopNamespace(dr);var ur__namespace=/*#__PURE__*/_interopNamespace(ur);var ue=Vi.forwardRef(({style:e,...t},o)=>jsxRuntime.jsx(reactNative.View,{ref:o,style:[Wo.center,e],...t})),at=Vi.forwardRef(({style:e,...t},o)=>jsxRuntime.jsx(reactNative.Animated.View,{ref:o,style:[Wo.center,e],...t})),Wo=reactNative.StyleSheet.create({center:{flex:1,justifyContent:"center",alignItems:"center"}});var Iu=({width:e,children:t,active:o,duration:n=400,style:r,...i})=>{let a=Vi.useRef(new reactNative.Animated.Value(o?e:0)).current,s=Vi.useRef(new reactNative.Animated.Value(o?1:0)).current;Vi.useEffect(()=>{reactNative.Animated.parallel([reactNative.Animated.timing(a,{toValue:o?e:0,duration:n,useNativeDriver:false}),reactNative.Animated.timing(s,{toValue:o?1:0,duration:n,useNativeDriver:true})]).start();},[o,a,s,e,n]);let l=Vi.useMemo(()=>({width:a,opacity:s,overflow:"hidden"}),[a,s]);return jsxRuntime.jsx(at,{style:[l,r],...i,children:t})};var fi=(e,t)=>jsxRuntime.jsx(reactNative.View,{ref:t,style:[gi.container,e.style],...e}),gi=reactNative.StyleSheet.create({container:{backgroundColor:"#FFFFFF",padding:12,borderRadius:6,shadowColor:"#000000",shadowOffset:{width:1,height:1},shadowOpacity:.4,shadowRadius:4,elevation:4}}),Ou=Vi.forwardRef(fi);var jt=({children:e,style:t})=>jsxRuntime.jsx(reactNative.View,{style:[{...reactNative.Platform.select({ios:{shadowColor:"#000",shadowOffset:{width:0,height:2},shadowOpacity:.25,shadowRadius:3.84},android:{elevation:5}})},t],children:e});var G=({children:e,...t})=>{let o=react.useTextColor();return jsxRuntime.jsx(reactNative.Text,{...t,style:[{color:o},t.style],children:e})};var Yt=({header:e,children:t,initExpanded:o=false,nested:n,alwaysExpanded:r,iconColor:i="#000",footer:a,isOpen:s,onClose:l,onOpen:p,style:c})=>{let[d,u]=Vi__default.default.useState(r??o),f=Vi.useRef(new reactNative.Animated.Value(0)).current,h=Vi.useRef(new reactNative.Animated.Value(0)).current;Vi.useEffect(()=>{typeof s<"u"&&u(s);},[s]);let m=Vi.useCallback(()=>{u(false),l?.();},[l]),g=Vi.useCallback(()=>{u(true),p?.();},[p]),y=Vi.useCallback(()=>{r||(d?m():g());},[r,g,m,d]);Vi.useEffect(()=>{reactNative.Animated.parallel([reactNative.Animated.timing(f,{toValue:d?1:0,duration:300,useNativeDriver:false}),reactNative.Animated.timing(h,{toValue:d?1:0,duration:300,useNativeDriver:true})]).start();},[d,f,h]);let V=h.interpolate({inputRange:[0,1],outputRange:["0deg","180deg"]});return jsxRuntime.jsxs(reactNative.View,{style:[pe.container,c],children:[jsxRuntime.jsxs(reactNative.Pressable,{onPress:y,style:pe.header,children:[jsxRuntime.jsx(reactNative.View,{style:pe.headerContent,children:typeof e=="string"?jsxRuntime.jsx(G,{style:pe.headerText,children:e}):e({isOpen:d,onClose:m})}),!r&&jsxRuntime.jsx(reactNative.Animated.Text,{style:[pe.arrow,{transform:[{rotate:V}],color:i}],children:"\u25BC"})]}),jsxRuntime.jsx(at,{style:[pe.content,n&&pe.nested,{maxHeight:f.interpolate({inputRange:[0,1],outputRange:[0,1e3]})}],children:t}),a?.({isOpen:d,onClose:m})]})},pe=reactNative.StyleSheet.create({container:{width:"100%"},header:{flexDirection:"row",padding:8,alignItems:"center"},headerContent:{flex:1},headerText:{fontWeight:"600",color:"#666"},arrow:{fontSize:12,marginLeft:8},content:{width:"100%",overflow:"hidden"},nested:{borderLeftWidth:4,borderLeftColor:"rgba(0,0,0,0.2)"}});var np=({animateOpacity:e,duration:t=300,children:o,in:n=true,onExited:r,style:i,...a})=>{let[s,l]=Vi.useState(false);Vi.useEffect(()=>{l(true);},[]);let[p,c]=Vi.useState(0),d=Vi.useRef(null),u=Vi.useMemo(()=>s&&n,[n,s]),f=Vi.useRef(new reactNative.Animated.Value(0)).current,h=Vi.useRef(new reactNative.Animated.Value(0)).current;return Vi.useEffect(()=>{d.current&&d.current.measure((m,g,y,V)=>{c(V);});},[o]),Vi.useEffect(()=>{let m=[reactNative.Animated.timing(f,{toValue:u?p:0,duration:t,useNativeDriver:false})];e&&m.push(reactNative.Animated.timing(h,{toValue:u?1:0,duration:t,delay:u?t:0,useNativeDriver:true})),reactNative.Animated.parallel(m).start(()=>{!u&&r&&r();});},[u,p,t,f,h,e,r]),jsxRuntime.jsx(reactNative.Animated.View,{style:[{overflow:"hidden",width:"100%",height:f},i],...a,children:jsxRuntime.jsx(reactNative.View,{ref:d,style:[{width:"100%"},e&&{opacity:h},i],...a,children:o})})};var dp=({children:e,...t})=>{let[o,n]=Vi.useState(0),[r,i]=Vi.useState(0),a=Vi.useRef(null),s=Vi.useCallback(l=>{let{width:p,height:c}=l.nativeEvent.layout;n(p),i(c);},[]);return jsxRuntime.jsx(reactNative.View,{ref:a,...t,style:[{width:"100%",height:"100%"},t.style],onLayout:s,children:e({width:o,height:r})})},Zo=Vi.createContext({width:0,height:0}),up=({children:e,...t})=>{let[o,n]=Vi.useState(0),[r,i]=Vi.useState(0),a=Vi.useRef(null),s=Vi.useCallback(p=>{let{width:c,height:d}=p.nativeEvent.layout;n(c),i(d);},[]),l=Vi.useMemo(()=>({width:o,height:r}),[o,r]);return jsxRuntime.jsx(reactNative.View,{ref:a,...t,style:[{width:"100%",height:"100%"},t.style],onLayout:s,children:jsxRuntime.jsx(Zo.Provider,{value:l,children:e})})},pp=()=>Vi.useContext(Zo);var Bi="Are you sure? You can't undo this action afterwards.",Ei=({confirmActive:e,onCancel:t,onConfirm:o,body:n=Bi,actionName:r="Delete",actionLoading:i,itemName:a})=>jsxRuntime.jsx(reactNative.Modal,{transparent:true,visible:e,onRequestClose:t,animationType:"fade",children:jsxRuntime.jsx(reactNative.View,{style:O.overlay,children:jsxRuntime.jsxs(reactNative.View,{style:O.alertContainer,children:[jsxRuntime.jsxs(G,{style:O.alertTitle,children:[r," ",a,"?"]}),typeof n=="string"?jsxRuntime.jsx(G,{style:O.alertBody,children:n}):n,jsxRuntime.jsxs(reactNative.View,{style:O.buttonContainer,children:[jsxRuntime.jsx(reactNative.TouchableOpacity,{style:O.cancelButton,onPress:t,children:jsxRuntime.jsx(G,{style:O.cancelText,children:"Cancel"})}),jsxRuntime.jsx(reactNative.TouchableOpacity,{style:O.confirmButton,onPress:o,disabled:i,children:i?jsxRuntime.jsx(reactNative.ActivityIndicator,{color:"#fff"}):jsxRuntime.jsx(G,{style:[O.buttonText,O.confirmButtonText],children:r})})]})]})})}),Xt=({onDelete:e,itemName:t,noConfirm:o,alertBody:n,text:r,actionName:i="Delete",style:a})=>{let[s,l]=Vi.useState(false),[p,c]=Vi.useState(false),d=Vi.useRef(),u=Vi.useRef(true),f=Vi.useRef(new reactNative.Animated.Value(1)).current,h=Vi.useRef(new reactNative.Animated.Value(0)).current;Vi.useEffect(()=>(u.current=true,()=>{u.current=false;}),[]);let m=Vi.useCallback(y=>{reactNative.Animated.parallel([reactNative.Animated.timing(f,{toValue:y?0:1,duration:200,useNativeDriver:true}),reactNative.Animated.timing(h,{toValue:y?1:0,duration:200,useNativeDriver:true})]).start();},[f,h]),g=Vi.useCallback(async()=>{if(d.current&&clearTimeout(d.current),c(false),e){l(true),m(true);try{await e();}catch(y){console.error(y),ro__default.default.show({text1:y.message??"An error occurred",type:"error"});}u.current&&(l(false),m(false));}else console.error("No delete function");},[e,m]);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[r?jsxRuntime.jsx(reactNative.TouchableOpacity,{style:[O.button,a],onPress:y=>{y.stopPropagation(),o?g():c(true);},disabled:s,children:jsxRuntime.jsxs(reactNative.View,{style:O.buttonContent,children:[jsxRuntime.jsxs(reactNative.Animated.View,{style:[O.contentContainer,{opacity:f}],children:[jsxRuntime.jsx(vectorIcons.Ionicons,{name:"trash",size:20,color:"red"}),jsxRuntime.jsx(reactNative.Text,{style:O.buttonText,children:r})]}),jsxRuntime.jsx(reactNative.Animated.View,{style:[O.loaderContainer,{opacity:h}],children:jsxRuntime.jsx(reactNative.ActivityIndicator,{color:"#ff0000",size:"small"})})]})}):jsxRuntime.jsx(reactNative.TouchableOpacity,{style:[O.iconButton,a],onPress:y=>{y.stopPropagation(),o?g():c(true);},disabled:s,children:jsxRuntime.jsxs(reactNative.View,{style:O.buttonContent,children:[jsxRuntime.jsx(reactNative.Animated.View,{style:[O.contentContainer,{opacity:f}],children:jsxRuntime.jsx(vectorIcons.Ionicons,{name:"trash",size:24,color:"#ee0000"})}),jsxRuntime.jsx(reactNative.Animated.View,{style:[O.loaderContainer,{opacity:h}],children:jsxRuntime.jsx(reactNative.ActivityIndicator,{color:"#ff0000",size:"small"})})]})}),o?null:jsxRuntime.jsx(Ei,{confirmActive:p,onCancel:()=>c(false),actionLoading:s,onConfirm:()=>{g();},actionName:i,body:n,itemName:t})]})},O=reactNative.StyleSheet.create({overlay:{flex:1,justifyContent:"center",alignItems:"center",backgroundColor:"rgba(0, 0, 0, 0.5)"},alertContainer:{width:"80%",maxWidth:400,backgroundColor:"white",borderRadius:10,padding:20,alignItems:"center"},alertTitle:{fontSize:18,fontWeight:"bold",marginBottom:10},alertBody:{fontSize:16,marginBottom:20},buttonContainer:{flexDirection:"row",justifyContent:"space-between",width:"100%"},cancelButton:{padding:10,borderColor:"gray",borderWidth:1,borderRadius:5,flex:1,marginRight:5,alignItems:"center"},cancelText:{color:"gray",fontWeight:"bold"},confirmButton:{padding:10,backgroundColor:"red",borderRadius:5,flex:1,marginLeft:5,alignItems:"center"},buttonText:{color:"red",fontWeight:"bold"},confirmButtonText:{color:"white",textShadowColor:"rgba(0, 0, 0, 0.5)",textShadowOffset:{width:1,height:1},textShadowRadius:3},button:{flexDirection:"row",alignItems:"center",padding:10,backgroundColor:"transparent"},buttonContent:{flexDirection:"row",gap:3,borderWidth:1,borderColor:"red",paddingHorizontal:13,paddingVertical:5,borderRadius:4,alignItems:"center",justifyContent:"center",minHeight:34,position:"relative"},contentContainer:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:3},loaderContainer:{...reactNative.StyleSheet.absoluteFillObject,alignItems:"center",justifyContent:"center"},iconButton:{padding:10,backgroundColor:"transparent"},loading:{position:"absolute",top:0,left:0,justifyContent:"center",alignItems:"center",height:24,width:24}});var kp=({onPress:e,children:t,style:o,textStyle:n,color:r,icon:i,disabled:a=false})=>{let[s,l]=Vi.useState(false),p=Vi.useRef(true),c=Vi.useRef(new reactNative.Animated.Value(1)).current,d=Vi.useRef(new reactNative.Animated.Value(0)).current;Vi.useEffect(()=>(p.current=true,()=>{p.current=false;}),[]);let u=Vi.useCallback(g=>{reactNative.Animated.parallel([reactNative.Animated.timing(c,{toValue:g?0:1,duration:200,useNativeDriver:true}),reactNative.Animated.timing(d,{toValue:g?1:0,duration:200,useNativeDriver:true})]).start();},[c,d]),f=Vi.useCallback(async()=>{if(e){l(true),u(true);try{await e();}catch(g){console.error(g),ro__default.default.show({text1:g.message??"An error occurred",type:"error"});}p.current&&(l(false),u(false));}},[e,u]),h=react.useTextColor(),m=Vi.useMemo(()=>r??h,[r,h]);return jsxRuntime.jsx(reactNative.TouchableOpacity,{style:[Ne.button,{borderColor:m,backgroundColor:a?"#f0f0f0":"transparent"},o],onPress:g=>{g.stopPropagation(),f();},disabled:s||a,children:jsxRuntime.jsxs(reactNative.View,{style:[Ne.buttonContent,{borderColor:a?"#ccc":m}],children:[jsxRuntime.jsxs(reactNative.Animated.View,{style:[Ne.contentContainer,{opacity:c}],children:[i&&jsxRuntime.jsx(vectorIcons.Ionicons,{name:i.name,size:i.size??20,color:a?"#ccc":m}),typeof t=="string"?jsxRuntime.jsx(reactNative.Text,{style:[Ne.buttonText,{color:a?"#ccc":m},n],children:t}):t]}),jsxRuntime.jsx(reactNative.Animated.View,{style:[Ne.loaderContainer,{opacity:d}],children:jsxRuntime.jsx(reactNative.ActivityIndicator,{color:m,size:"small"})})]})})},Ne=reactNative.StyleSheet.create({button:{flexDirection:"row",alignItems:"center",backgroundColor:"transparent"},buttonContent:{flexDirection:"row",gap:8,borderWidth:1,paddingHorizontal:16,paddingVertical:8,borderRadius:4,alignItems:"center",justifyContent:"center",minHeight:40,position:"relative"},contentContainer:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:8},loaderContainer:{...reactNative.StyleSheet.absoluteFillObject,alignItems:"center",justifyContent:"center"},buttonText:{fontWeight:"bold"}});var Zi=({selected:e,option:{Render:t,disabledMessage:o},size:n,onPress:r})=>{let i=Vi.useCallback(()=>{o?ro__default.default.show({type:"error",text1:o}):r();},[r,o]);return jsxRuntime.jsx(reactNative.View,{style:[Zt.buttonContainer,{width:n,height:n,opacity:o?.6:1}],children:jsxRuntime.jsx(reactNative.TouchableOpacity,{style:[Zt.button,{backgroundColor:e?"rgba(255, 255, 255, 0.5)":"rgba(0, 0, 0, 0.1)",pointerEvents:e?"none":"auto"}],onPress:i,disabled:!!o,children:t(e)})})},Wp=({value:e,onChange:t,size:o=28,options:n})=>{let{theme:{colors:{background:r}}}=react.useTheme();return jsxRuntime.jsx(reactNative.View,{style:[Zt.container,{borderColor:r[300]}],children:n.map(i=>jsxRuntime.jsx(Zi,{onPress:()=>{t(i.id);},option:i,size:o,selected:i.id===e},i.id))})},Zt=reactNative.StyleSheet.create({container:{flexDirection:"row",borderWidth:1,borderRadius:3},buttonContainer:{justifyContent:"center",alignItems:"center"},button:{justifyContent:"center",alignItems:"center",borderRadius:3}});var cn=Vi.createContext({}),dn=({curr:e,children:t})=>{let o=Vi.useMemo(()=>({curr:e}),[e]);return jsxRuntime.jsx(cn.Provider,{value:o,children:t})},na=()=>Vi.useContext(cn);var un={top:0,left:0,right:0,bottom:0,display:"flex"},ae=reactNative.StyleSheet.create({absolute:{...un,position:"absolute"},relative:{...un,position:"relative"}});var fn=({size:e=30,isLoading:t,speed:o=2,inFeed:n,asset:r})=>{let{colorMode:i}=react.useTheme(),a=Vi.useMemo(()=>n||i==="dark"?r.dark??r.default:r.default,[r,n,i]),s=Vi.useMemo(()=>({width:e,height:e,opacity:t?.85:0}),[e,t]);return jsxRuntime.jsx(aa__default.default,{source:a,autoPlay:t,loop:true,speed:o,style:s})},gn=({size:e=30,isLoading:t,asset:o,inFeed:n})=>{let{colorMode:r}=react.useTheme(),i=Vi.useMemo(()=>n||r==="dark"?o.dark??o.default:o.default,[o,n,r]),a=Vi.useMemo(()=>({width:e,height:e,opacity:t?.85:0}),[e,t]);return jsxRuntime.jsx(reactNative.Image,{source:{uri:i},style:a})},ca=({isLoading:e,size:t})=>{let{loading:o}=react.useAppAssets();return o.lottieJson?jsxRuntime.jsx(fn,{isLoading:e,size:t,asset:o.lottieJson}):o.svg?jsxRuntime.jsx(gn,{isLoading:e,size:t,asset:o.svg}):null},ge=({isLoading:e,size:t,inFeed:o})=>{let{loading:n}=react.useAppAssets();return n.lottieJson?jsxRuntime.jsx(fn,{inFeed:o,isLoading:e,size:t,asset:n.lottieJson}):n.svg?jsxRuntime.jsx(gn,{inFeed:o,isLoading:e,size:t,asset:n.svg}):jsxRuntime.jsx(reactNative.Text,{style:Ue.errorText,children:"ERROR: No loading animation found"})},oo=({text:e="Loading...",inBox:t,containerStyle:o})=>{let n=jsxRuntime.jsxs(reactNative.View,{style:[Ue.loadingContainer,o],children:[jsxRuntime.jsx(ca,{isLoading:true}),jsxRuntime.jsx(reactNative.Text,{style:Ue.loadingText,children:e})]});return t?jsxRuntime.jsx(reactNative.View,{style:Ue.boxContainer,children:n}):n},mt=({isLoading:e,text:t,inFeed:o,style:n})=>{let{colorMode:r}=react.useTheme(),i=r==="dark"?"rgba(0, 0, 0, 0.53)":"rgba(255, 255, 255, 0.67)";return jsxRuntime.jsx(reactNative.View,{style:[Ue.overlay,{backgroundColor:i},{opacity:e?1:0},n],children:t?jsxRuntime.jsx(oo,{text:t}):jsxRuntime.jsx(ge,{inFeed:o,size:100,isLoading:e})})},Ue=reactNative.StyleSheet.create({loadingContainer:{flexDirection:"row",alignItems:"center",padding:8},loadingText:{opacity:.8,fontSize:14,marginLeft:8},boxContainer:{padding:16,borderRadius:8,backgroundColor:"rgba(0, 0, 0, 0.05)"},overlay:{position:"absolute",top:0,left:0,right:0,bottom:0,justifyContent:"center",alignItems:"center"},errorText:{color:"red"}});var fa=e=>e==="current"?1:0,wn=(e,t)=>{let{height:o}=t;return e==="current"?0:e==="next"?o*1.1:e==="prev"?-o*1.1:0},bn=({id:e,collectionPath:t,onItemLoad:o,RenderItem:n,status:r,offsetY:i,enterStatus:a})=>{let{height:s,width:l}=react.useScreen(),p=Vi.useMemo(()=>({height:s,width:l}),[s,l]),c=Vi.useRef(new reactNative.Animated.Value(0)).current,d=Vi.useRef(new reactNative.Animated.Value(wn(a??"next",p))).current,u=reactNative.Animated.add(d,i),f=Vi.useMemo(()=>`${t}/${e}`,[t,e]),{data:h}=react.useDocument(f,o);return Vi.useEffect(()=>{let m=fa(r),g=wn(r,p);d.setValue(g),c.setValue(m);},[r,d,c,p]),jsxRuntime.jsx(reactNative.Animated.View,{style:{position:"absolute",top:0,left:0,transform:[{translateY:u},{scale:c}],display:"flex",alignItems:"center",justifyContent:"center",height:"100%",opacity:c,width:"100%"},children:h?n(h):null})};var wa=10,xn=(e,t,o=wa,n=false)=>{let[r,i]=Vi.useState([null,null,null]),[a,s]=Vi.useState(0),l=react.useAuth(x=>x.user),[p,c]=Vi.useState(false),[d,u]=Vi.useState(false),[f,h]=Vi.useState(null),[m,g]=Vi.useState(false),[y,V]=Vi.useState(null),S=Vi.useRef(null),b=Vi.useRef({prev:null,curr:null,next:null}),v=Vi.useCallback(x=>{x&&(b.current.prev===x&&(b.current.prev=null),b.current.next===x&&(b.current.next=null)),b.current.curr=x,t({...b.current});},[t]),T=Vi.useCallback(x=>{x&&(b.current.prev===x&&(b.current.prev=null),b.current.curr===x&&(b.current.curr=null)),b.current.next=x,t({...b.current});},[t]),D=Vi.useCallback(x=>{x&&(b.current.curr===x&&(b.current.curr=null),b.current.next===x&&(b.current.next=null)),b.current.prev=x,t({...b.current});},[t]),k=Vi.useCallback(async(x,M,B)=>{if(!l&&n)return [];B||c(true);try{let C=await e({limit:o,startAfter:M,startBefore:x});if(B)M?i(P=>[P[0],P[1],C.ids]):x&&i(P=>[C.ids,P[1],P[2]]);else {let P=C.ids[0],re=C.ids[1]||null;v(P),T(re),D(M),i(M?j=>[j[1],C.ids,null]:x?j=>[null,C.ids,j[1]]:[null,C.ids,null]);let F=C.ids[C.ids.length-1];F&&k(null,F,!0);}return c(!1),C.ids||[]}catch(C){h(C.message),ro__default.default.show({text1:"Error fetching feed",text2:C.message,type:"error",visibilityTime:5e3});}return c(false),[]},[e,l,n,v,T,D,o]),_=Vi.useCallback(async(x,M)=>{let B=r[1]??[],C=r[2]??[],P=x+1;if(P<B.length)return {id:B[P],idx:P};if(C[0]){let j=C[C.length-1];return M||(i(ie=>[ie[1],ie[2],null]),k(null,j,true)),{id:C[0],idx:0}}let F=(await k(null,B[B.length-1],M))[0];return F?{id:F,idx:0}:null},[r,k]),H=Vi.useCallback(async(x,M)=>{let B=r[1]??[],C=r[0]??[],P=x-1;if(P>=0)return {id:B[P],idx:P};if(C[C.length-1]){let j=C[0];return M||(i([null,r[0],r[1]]),k(j,null,true)),{id:C[C.length-1],idx:C.length-1}}let re=await k(B[0],null,M),F=re[re.length-1];return F?{id:F,idx:re.length-1}:null},[r,k]),I=Vi.useCallback(async()=>{if(m)return;let x=b.current.curr;g(true);let M=await _(a,false);if(V("next"),M){let{id:B,idx:C}=M;S.current=B,s(C),v(B),T(null),D(x),_(C,true).then(P=>T(P?.id??null));}else ro__default.default.show({text1:"No more items",type:"info",visibilityTime:3e3});g(false);},[a,_,v,T,D,m]),E=Vi.useCallback(async()=>{if(m)return;let x=b.current.curr;V("prev"),g(true);let M=await H(a,false);if(M){let{id:B,idx:C}=M;S.current=B,s(C),v(B),D(null),T(x),H(C,true).then(P=>D(P?.id??null));}else ro__default.default.show({text1:"No more items",type:"info",visibilityTime:3e3});g(false);},[a,H,v,T,D,m]),L=Vi.useCallback(async()=>{c(true),u(true),i([null,null,null]),v(null),T(null),D(null),V(null),s(0),await k(null,null,false),u(false);},[k,v,T,D]),[q]=Vi.useState(()=>k);Vi.useEffect(()=>{q(null,null,false);},[q]);let Se=Vi.useMemo(()=>a>0&&!!r[1]?.length||!!r[0]?.length,[r,a]),Ve=Vi.useMemo(()=>(r[1]&&a<r[1].length)??!!r[2]?.length,[r,a]);return Vi.useMemo(()=>({ids:r,goNext:I,goPrev:E,error:f,refresh:L,refreshing:d,loading:p,canGoNext:Ve,direction:y,canGoPrev:Se,itemLoading:m}),[r,I,E,p,f,m,Ve,Se,L,d,y])};var In=({color:e,trackColor:t,animating:o,visible:n=true,viewStyle:r,...i})=>{let a=react.useColorModeValue("#959595","#575757"),s=Vi.useRef(new reactNative.Animated.Value(n?1:0)).current;return Vi.useEffect(()=>{reactNative.Animated.timing(s,{toValue:n?1:0,duration:300,useNativeDriver:true}).start();},[n,s]),jsxRuntime.jsxs(reactNative.Animated.View,{style:[Sa.container,{opacity:s},r],children:[jsxRuntime.jsx(reactNative.ActivityIndicator,{color:t??a,style:reactNative.StyleSheet.absoluteFill,animating:false,...i}),jsxRuntime.jsx(reactNative.ActivityIndicator,{animating:o,color:e??"#575757",...i})]})},Sa=reactNative.StyleSheet.create({container:{alignItems:"center",justifyContent:"center"}});var An=({src:e,onClose:t})=>{let[o,n]=Vi.useState(true),r=react.useScreen(u=>u.width),i=react.useScreen(u=>u.height),[a,s]=Vi.useState({width:r/2,height:i/2}),{height:l,width:p}=Vi.useMemo(()=>{if(o)return a;let u=a.width/a.height,f=Math.min(a.height,i*.9),h=f*u;return h>r*.9&&(h=Math.min(a.width,r*.9),f=h/u),{height:f,width:h}},[i,r,a,o]),c=Vi.useCallback(()=>n(true),[]),d=Vi.useCallback(u=>{let{width:f,height:h}=u.nativeEvent.source;s({width:f,height:h}),n(false);},[]);return jsxRuntime.jsx(reactNative.Modal,{visible:true,transparent:true,animationType:"fade",onRequestClose:t,children:jsxRuntime.jsx(reactNative.View,{style:Pe.modalOverlay,children:jsxRuntime.jsxs(reactNative.View,{style:Pe.contentContainer,children:[jsxRuntime.jsx(reactNative.View,{style:[Pe.imageContainer,{width:p,height:l,opacity:o?0:1}],children:jsxRuntime.jsx(reactNative.Image,{source:{uri:e},style:Pe.image,onLoadStart:c,onLoad:d,resizeMode:"contain"})}),jsxRuntime.jsx(reactNative.TouchableOpacity,{style:Pe.closeButton,onPress:t,children:jsxRuntime.jsx(vectorIcons.Ionicons,{name:"close",size:24,color:"white"})}),o&&jsxRuntime.jsx(reactNative.View,{style:Pe.loadingContainer,children:jsxRuntime.jsx(ge,{isLoading:o,size:70})})]})})})},Pe=reactNative.StyleSheet.create({modalOverlay:{flex:1,backgroundColor:"rgba(0, 0, 0, 0.7)"},contentContainer:{flex:1,justifyContent:"center",alignItems:"center",padding:16},imageContainer:{overflow:"hidden",borderRadius:4},image:{width:"100%",height:"100%"},closeButton:{position:"absolute",top:16,right:16,width:40,height:40,borderRadius:20,backgroundColor:"rgba(0, 0, 0, 0.5)",justifyContent:"center",alignItems:"center"},loadingContainer:{...reactNative.StyleSheet.absoluteFillObject,justifyContent:"center",alignItems:"center"}});var Mn="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkAAIAAAoAAv/lxKUAAAAASUVORK5CYII=",Bn=({src:e,loadingOverride:t,onLoad:o,width:n,height:r,noFullView:i,buttonFullView:a,style:s})=>{let[l,p]=Vi.useState(!!e),c=Vi.useRef(null),[d,u]=Vi.useState(false),f=react.useMounted(100),h=Vi.useCallback(S=>{o&&o(S);},[o]),[m,g]=Vi.useState(e);Vi.useEffect(()=>{e&&g(e);},[e,m]);let y=Vi.useMemo(()=>l||!!t,[l,t]),V=jsxRuntime.jsx(reactNative.Image,{ref:c,source:{uri:e??Mn},style:[ve.image,{opacity:e&&!y?1:0}],onLoadEnd:()=>p(false),onLoad:h,resizeMode:e?"cover":"contain"});return jsxRuntime.jsxs(reactNative.View,{style:[ve.container,{width:n??"100%",height:r??"100%",opacity:f?1:0},s],children:[i||a?V:jsxRuntime.jsx(reactNative.TouchableOpacity,{activeOpacity:.9,onPress:()=>u(true),style:ve.imageContainer,children:V}),a&&jsxRuntime.jsx(reactNative.TouchableOpacity,{style:ve.fullViewButton,onPress:()=>u(true),activeOpacity:.7,children:jsxRuntime.jsx(vectorIcons.Ionicons,{name:"expand",size:20,color:"white",style:ve.fullViewIcon})}),jsxRuntime.jsx(reactNative.View,{style:[ve.loadingContainer,{opacity:y?1:0}],children:jsxRuntime.jsx(ge,{isLoading:y,size:10})}),d&&jsxRuntime.jsx(An,{src:e??Mn,onClose:()=>u(false)})]})},ve=reactNative.StyleSheet.create({container:{overflow:"hidden",position:"relative"},imageContainer:{width:"100%",height:"100%"},image:{width:"100%",height:"100%"},loadingContainer:{...reactNative.StyleSheet.absoluteFillObject,justifyContent:"center",alignItems:"center"},fullViewButton:{position:"absolute",top:8,right:8,width:28,height:28,borderRadius:14,backgroundColor:"rgba(0, 0, 0, 0.5)",justifyContent:"center",alignItems:"center"},fullViewIcon:{opacity:.8}});var Ym=({value:e,label:t,onChange:o})=>{let[n,r]=Vi.useState(false),i=Vi.useState(new reactNative.Animated.Value(1))[0],a=Vi.useCallback(l=>{let p=Math.max(0,1e3-(Date.now()-l));setTimeout(()=>{r(false),reactNative.Animated.timing(i,{toValue:1,duration:300,useNativeDriver:true}).start();},p);},[i]),s=l=>{r(true),reactNative.Animated.timing(i,{toValue:0,duration:300,useNativeDriver:true}).start();let p=Date.now();o(l).catch(c=>{console.error(c);}),a(p);};return jsxRuntime.jsxs(reactNative.View,{style:yt.container,children:[jsxRuntime.jsxs(reactNative.Animated.View,{style:[yt.content,{opacity:i}],children:[jsxRuntime.jsx(reactNative.Text,{style:yt.label,children:t}),jsxRuntime.jsx(reactNative.Switch,{value:e,onValueChange:s})]}),n&&jsxRuntime.jsx(reactNative.View,{style:yt.loadingContainer,children:jsxRuntime.jsx(oo,{})})]})},yt=reactNative.StyleSheet.create({container:{paddingVertical:4,paddingHorizontal:12,backgroundColor:"#2D3748",borderRadius:12,shadowColor:"#000",shadowOffset:{width:0,height:0},shadowOpacity:.25,shadowRadius:4,elevation:5,position:"relative",flexDirection:"row",alignItems:"center"},content:{flexDirection:"row",alignItems:"center",gap:8},label:{fontSize:20,height:24,color:"#FFFFFF"},loadingContainer:{position:"absolute",top:"-10%",left:"-10%",width:"120%",height:"120%",borderRadius:8,padding:4,justifyContent:"center",alignItems:"center"}});var Ya="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkAAIAAAoAAv/lxKUAAAAASUVORK5CYII=",_a=reactNative.StyleSheet.create({imageBackground:{flex:1,transform:[{scale:1.075}]}}),bt=({background:e,opacity:t=.7,style:o,...n})=>jsxRuntime.jsx(reactNative.View,{style:[ae.absolute,o],...n,children:jsxRuntime.jsx(reactNative.ImageBackground,{source:{uri:e??Ya},style:[_a.imageBackground,{opacity:t}],resizeMode:"cover"})}),Ja=({getBackgroundValue:e,item:t})=>{let o=Vi.useMemo(()=>t?e(t):null,[e,t]),{loading:n,url:r}=react.useObjectUrl(o),i=Vi.useRef(0),[a,s]=Vi.useState(0),[l,p]=Vi.useState(null),[c,d]=Vi.useState(null);return Vi.useEffect(()=>{i.current===0?(p(r),i.current=1,s(0)):(d(r),i.current=0,s(1));},[r]),jsxRuntime.jsxs(ue,{style:ae.absolute,children:[jsxRuntime.jsx(bt,{opacity:a===0?1:0,background:l}),jsxRuntime.jsx(bt,{opacity:a===1?1:0,background:c}),jsxRuntime.jsx(ge,{isLoading:n})]})},Ka=({getBackgroundUrl:e,item:t})=>{let o=Vi.useMemo(()=>t?e(t):null,[e,t]),n=Vi.useRef(0),[r,i]=Vi.useState(0),[a,s]=Vi.useState(null),[l,p]=Vi.useState(null);return Vi.useEffect(()=>{o&&(n.current===0?(s(o),n.current=1,i(0)):(p(o),n.current=0,i(1)));},[o]),jsxRuntime.jsxs(ue,{style:ae.absolute,children:[jsxRuntime.jsx(bt,{opacity:r===0?1:0,background:a}),jsxRuntime.jsx(bt,{opacity:r===1?1:0,background:l})]})},Un=({getBackgroundValue:e,getBackgroundUrl:t,...o})=>e?jsxRuntime.jsx(Ja,{getBackgroundValue:e,...o}):t?jsxRuntime.jsx(Ka,{getBackgroundUrl:t,...o}):null;var Za=25,_n=({offsetY:e,refreshing:t,canRefresh:o})=>{let n=Vi.useRef(new reactNative.Animated.Value(0)).current,r=Vi.useRef(new reactNative.Animated.Value(0)).current,i=reactNative.Animated.subtract(e,75),a=reactNative.Animated.divide(i,Za),s=reactNative.Animated.diffClamp(a,0,1);Vi.useEffect(()=>{reactNative.Animated.spring(n,{toValue:t?50:0,useNativeDriver:true}).start();},[t,n]),Vi.useEffect(()=>{reactNative.Animated.spring(r,{toValue:o?1:0,useNativeDriver:true}).start();},[o,r]);let l=s.interpolate({inputRange:[0,1],outputRange:[0,Math.sqrt(1)*20]}),c=reactNative.Animated.add(n,l).interpolate({inputRange:[0,20],outputRange:[0,20],extrapolate:"clamp"}),d=reactNative.Animated.multiply(r,c),u=d.interpolate({inputRange:[0,30],outputRange:[0,1],extrapolate:"clamp"}),f=reactNative.Animated.multiply(r,u),h=s.interpolate({inputRange:[0,1],outputRange:["0deg","180deg"]});return jsxRuntime.jsx(reactNative.Animated.View,{style:[Yn.container,{opacity:f,transform:[{translateY:d},{scale:f},{rotate:h}]}],children:jsxRuntime.jsxs(reactNative.View,{style:Yn.centerContainer,children:[jsxRuntime.jsx(jt,{style:[{opacity:t?0:1}],children:jsxRuntime.jsx(qa__default.default,{name:"refresh",size:32,color:"white"})}),jsxRuntime.jsx(jt,{style:{opacity:t?1:0},children:jsxRuntime.jsx(In,{animating:true,size:"large",color:"white"})})]})})},Yn=reactNative.StyleSheet.create({container:{position:"absolute",top:0,left:0,right:0,pointerEvents:"none"},centerContainer:{alignItems:"center",justifyContent:"center",width:"100%"}});var sl=e=>Vi.useCallback(t=>{let o=[];t.prev&&o.push({status:"prev",id:t.prev}),t.curr&&o.push({status:"current",id:t.curr}),t.next&&o.push({status:"next",id:t.next}),e(o);},[e]),Hf=({fetch:e,collection:t,RenderItem:o,authRequired:n,getBackgroundUrl:r,getBackgroundValue:i,limit:a,defaultBackground:s,swipeDisabled:l,children:p})=>{let{width:c,height:d}=react.useScreen(),{theme:u}=react.useTheme(),f=Vi.useRef(null),h=Vi.useRef(null),[m,g]=Vi.useState(null),[y,V]=Vi.useState([]),S=Vi.useRef(new reactNative.Animated.Value(0)).current,b=sl(V),v=Vi.useRef(null),{goNext:T,goPrev:D,loading:k,canGoNext:_,canGoPrev:H,refresh:I,refreshing:E}=xn(e,b,a,n),L=Vi.useRef(false),q=Vi.useRef({x:0,y:0}),Se=Vi.useCallback(F=>{l||(L.current=true,q.current={x:F.x,y:F.y});},[l]),Ve=Vi.useCallback(F=>{if(!L.current)return;let j=H?75:100,ie=_?-75:-100,Te=Math.max(ie,Math.min(j,F.y-q.current.y));_&&Te<-65?(g("next"),T()):H&&Te>65?(g("prev"),D()):(Te>90||Te<-90)&&(I(),v.current&&v.current.onNewData(null)),S.setValue(0),L.current=false;},[S,T,D,_,H,I]),x=Vi.useCallback(F=>{if(!L.current)return;let j=Math.max(-10,Math.min(10,F.x-q.current.x)),ie=H?75:100,Te=_?-75:-100,Ho=Math.max(Te,Math.min(ie,F.y-q.current.y));Math.sqrt(j**2+Ho**2)>10&&f.current,S.setValue(Ho);},[S,_,H]),M=reactNativeGestureHandler.Gesture.Pan().onStart(Se).onUpdate(x).onEnd(Ve),B=Vi.useMemo(()=>({height:`${d}px`,width:`${c}px`,overflow:"hidden",pointerEvents:l?"none":"auto"}),[c,d,l]),[C,P]=Vi.useState(null),re=Vi.useCallback(F=>{y.find(ie=>ie.status==="current")?.id===F?._id&&P(F);},[y]);return jsxRuntime.jsx(dn,{curr:C,children:jsxRuntime.jsx(reactNativeGestureHandler.GestureDetector,{gesture:M,children:jsxRuntime.jsxs(ue,{style:[cl.container,{backgroundColor:s??u.colors.background[100]}],children:[jsxRuntime.jsx(Un,{item:C,getBackgroundValue:i,getBackgroundUrl:r}),jsxRuntime.jsx("div",{ref:h,style:B,children:jsxRuntime.jsx(ue,{style:ae.relative,ref:f,children:y.map(F=>jsxRuntime.jsx(bn,{id:F.id,collectionPath:t,RenderItem:o,onItemLoad:re,status:F.status,enterStatus:m,offsetY:S},F.id))})}),jsxRuntime.jsx(_n,{canRefresh:!H,refreshing:E,offsetY:S}),jsxRuntime.jsx(mt,{inFeed:true,isLoading:k}),p?jsxRuntime.jsx(ue,{style:[ae.absolute,{zIndex:3}],children:p}):null]})})})},cl=reactNative.StyleSheet.create({container:{...ae.relative,overflow:"hidden"}});var Ct=({path:e,condition:t,children:o})=>{let n=reactHookForm.useWatch({exact:true,name:e});return Vi.useMemo(()=>t(n),[n,t])?jsxRuntime.jsx(reactNative.Animated.View,{style:{paddingVertical:3,opacity:1},children:o}):null};var gl=({field:e,input:{onChange:t,value:o,...n}},r)=>{let{placeholder:i}=e;return Vi.useImperativeHandle(r,()=>({focus:()=>{},blur:()=>{}})),jsxRuntime.jsxs(reactNative.View,{style:{flexDirection:"row",alignItems:"center"},children:[jsxRuntime.jsx(reactNative.Switch,{value:o,onValueChange:t,...n}),jsxRuntime.jsx(reactNative.Text,{style:{marginLeft:8,fontWeight:"600",opacity:o?.9:.6},children:i})]})},hl=Vi.forwardRef(gl),yl=({field:e,input:{onChange:t,value:o,...n}},r)=>{let{placeholder:i}=e;return Vi.useImperativeHandle(r,()=>({focus:()=>{},blur:()=>{}})),jsxRuntime.jsxs(reactNative.View,{style:{flexDirection:"row",alignItems:"center"},children:[jsxRuntime.jsx(reactNative.Switch,{value:o,onValueChange:t,...n}),jsxRuntime.jsx(reactNative.Text,{style:{marginLeft:8,fontWeight:"600",opacity:o?.9:.6},children:i})]})},wl=Vi.forwardRef(yl),bl=(e,t)=>e.field.type==="switch"?jsxRuntime.jsx(wl,{ref:t,...e}):jsxRuntime.jsx(hl,{ref:t,...e}),Qn=Vi.forwardRef(bl);var St=({label:e,gradient:t,value:o,minimumValue:n,maximumValue:r,...i})=>jsxRuntime.jsx(reactNative.View,{style:[we.container,{opacity:o!==void 0?1:.5}],children:jsxRuntime.jsxs(reactNative.View,{style:we.sliderContainer,children:[n!==void 0?jsxRuntime.jsx(reactNative.Text,{style:[we.label,t?we.gradientText:null],children:typeof n=="number"?n.toFixed((i?.step??1)<1?2:0):""}):null,jsxRuntime.jsx(Cl__default.default,{style:we.slider,minimumValue:n,maximumValue:r,step:1,...i}),r!==void 0?jsxRuntime.jsx(reactNative.Text,{style:[we.label,t?we.gradientText:null],children:typeof r=="number"?r.toFixed((i?.step??1)<1?2:0):""}):null]})}),we=reactNative.StyleSheet.create({container:{width:"100%",paddingVertical:8},sliderContainer:{flexDirection:"row",alignItems:"center",width:"100%"},slider:{flex:1,height:40},label:{fontSize:14,marginHorizontal:8},gradientText:{color:"#007AFF"}});var Vt=e=>{let t=Vi.useRef(null);return Vi.useImperativeHandle(e,()=>({focus:()=>{t.current?.focus();},blur:()=>{t.current?.blur();}}),[]),t};var It=({label:e,gradient:t,value:o,...n})=>jsxRuntime.jsx(St,{label:e,value:o,minimumValue:0,maximumValue:255,step:1,gradient:t,...n}),rr=Vi.forwardRef(({input:{onChange:e,value:t},field:o,meta:n},r)=>{let{withAlpha:i,defaultValue:a}=o,{active:s}=n||{};Vt(r);let l=Vi.useCallback((d,u)=>{e(i?{r:0,g:0,b:0,a:1,...t,[d]:u}:{r:0,g:0,b:0,...t,[d]:u});},[t,e,i]),p=Vi.useMemo(()=>({...a,...t}),[a,t]),c=Vi.useMemo(()=>core.colorValueToHex(!!i,p),[p,i]);return jsxRuntime.jsxs(reactNative.View,{style:Ge.container,children:[jsxRuntime.jsx(reactNative.View,{style:[Ge.colorPreview,{backgroundColor:c}],children:jsxRuntime.jsx(reactNative.Text,{style:Ge.hexText,children:c})}),jsxRuntime.jsxs(reactNative.View,{style:[Ge.slidersContainer,s&&Ge.activeContainer],children:[jsxRuntime.jsx(It,{label:"R",gradient:core.gradients.red,value:t?.r,onValueChange:d=>l("r",d)}),jsxRuntime.jsx(It,{label:"G",gradient:core.gradients.green,value:t?.g,onValueChange:d=>l("g",d)}),jsxRuntime.jsx(It,{label:"B",gradient:core.gradients.blue,value:t?.b,onValueChange:d=>l("b",d)}),i?jsxRuntime.jsx(It,{label:"A",gradient:core.gradients.midnight,value:t?.a,onValueChange:d=>l("a",d)}):null]})]})}),Ge=reactNative.StyleSheet.create({container:{width:"100%",flexDirection:"row",alignItems:"center",gap:8},colorPreview:{width:80,height:80,borderRadius:40,justifyContent:"center",alignItems:"center",shadowColor:"#000",shadowOffset:{width:0,height:2},shadowOpacity:.25,shadowRadius:3.84,elevation:5},hexText:{fontSize:16,color:"#fff",textShadowColor:"rgba(0, 0, 0, 0.75)",textShadowOffset:{width:0,height:1},textShadowRadius:2},slidersContainer:{flex:1,padding:8,borderRadius:6},activeContainer:{shadowColor:"#fff",shadowOffset:{width:0,height:0},shadowOpacity:.5,shadowRadius:5,elevation:5}});var po=({onPress:e,isActive:t,marginRight:o})=>{let n=react.useIconColor(),r=react.useBorderColor();return jsxRuntime.jsx(reactNative.TouchableOpacity,{onPress:e,style:[Bl.closeButton,{opacity:t?1:0,marginRight:o,borderColor:r}],hitSlop:{top:10,bottom:10,left:10,right:10},disabled:!t,children:jsxRuntime.jsx(vectorIcons.Ionicons,{name:"close",size:14,color:n,style:{alignSelf:"center"}})})},ke=({onPress:e,isActive:t})=>jsxRuntime.jsx(po,{marginRight:0,onPress:e,isActive:t}),Bl=reactNative.StyleSheet.create({closeButton:{padding:3,borderRadius:100,display:"flex",alignItems:"center",justifyContent:"center",borderWidth:1}});var Me=e=>{let t=react.useTextColor(),o=react.usePlaceholderColor();return e!=null&&e!==""?t:o};var mo=Vi.forwardRef(({input:{onChange:e,value:t,onFocus:o,onBlur:n},field:{placeholder:r,minDate:i,maxDate:a,optional:s},meta:{active:l}},p)=>{let c=Vi.useMemo(()=>t?new Date(`${t}T00:00:00.000`):void 0,[t]);Vi.useImperativeHandle(p,()=>({focus:()=>{o();},blur:()=>{n();}}));let d=()=>{o();},u=react.useIconColor(),f=Me(t),h=i==="now"?new Date:i?new Date(i):void 0,m=a==="now"?new Date:a?new Date(a):void 0;return jsxRuntime.jsxs(reactNative.View,{style:Ft.container,children:[jsxRuntime.jsxs(reactNative.TouchableOpacity,{style:Ft.button,onPress:d,children:[jsxRuntime.jsx(reactNative.Text,{style:[Ft.text,{color:f}],children:t?core.getDateString(t,"short"):r}),jsxRuntime.jsx(vectorIcons.Ionicons,{name:"calendar",size:20,color:u,style:Ft.icon}),s&&t?jsxRuntime.jsx(ke,{onPress:()=>e(null),isActive:!!t}):null]}),jsxRuntime.jsx(reactNativePaper.Portal,{children:jsxRuntime.jsx(reactNativePaperDates.DatePickerModal,{locale:"en",label:"Date",date:c,startYear:h?.getFullYear(),endYear:m?.getFullYear(),mode:"single",onConfirm:g=>{e(g?.date?.toISOString()?.split("T")[0]??null),n();},onDismiss:n,visible:l})})]})});mo.displayName="DateInput";var Ft=reactNative.StyleSheet.create({container:{width:"100%"},button:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",width:"100%",height:40,paddingHorizontal:12,paddingVertical:8},text:{fontSize:16,flex:1},icon:{marginRight:10}});var ho=Vi.forwardRef(({input:{value:e,onBlur:t,onChange:o,onFocus:n},field:r,meta:{active:i}},a)=>{let{placeholder:s,optional:l}=r,[p,c]=Vi.useState(true),[d,u]=Vi.useState(false),f=Vi.useMemo(()=>e?new Date(e):new Date,[e]);Vi.useImperativeHandle(a,()=>({focus:()=>{n();},blur:()=>{t();}}));let h=Vi.useCallback(T=>{if(T){let D=new Date(T);o(D.toISOString()),u(true);}else t();c(false);},[o,t]),m=Vi.useCallback(({hours:T,minutes:D})=>{let k=f?new Date(f):new Date;k.setHours(T),k.setMinutes(D),o(k.toISOString()),u(false),t();},[o,t,f]),g=Vi.useCallback(()=>{c(true),u(false),t();},[t]),y=Vi.useMemo(()=>e?new Date(e):void 0,[e]),V=Vi.useMemo(()=>e?core.getDateTimeString(e):null,[e]),S=Vi.useMemo(()=>y?{hours:y.getHours(),minutes:y.getMinutes()}:{hours:0,minutes:0},[y]),b=react.useIconColor(),v=Me(e);return jsxRuntime.jsxs(reactNative.View,{style:_e.container,children:[jsxRuntime.jsxs(reactNative.TouchableOpacity,{style:_e.button,onPress:()=>{c(true),n();},children:[jsxRuntime.jsx(reactNative.Text,{style:[_e.text,{color:v}],children:V??s}),jsxRuntime.jsx(vectorIcons.Ionicons,{name:"calendar",size:20,color:b,style:_e.icon}),jsxRuntime.jsx(vectorIcons.Ionicons,{name:"time",size:20,color:b,style:_e.icon}),l&&e?jsxRuntime.jsx(ke,{onPress:()=>o(null),isActive:!!e}):null]}),jsxRuntime.jsxs(reactNativePaper.Portal,{children:[p&&jsxRuntime.jsx(reactNativePaperDates.DatePickerModal,{locale:"en",label:"Date",date:y,mode:"single",onConfirm:T=>{h(T?.date?.toISOString()?.split("T")[0]??null);},onDismiss:g,visible:i&&p}),d&&jsxRuntime.jsx(reactNativePaperDates.TimePickerModal,{visible:i&&d,onDismiss:g,locale:"en-US",onConfirm:m,hours:S.hours,minutes:S.minutes})]})]})});ho.displayName="DateTimeInput";var _e=reactNative.StyleSheet.create({container:{width:"100%"},button:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",width:"100%",height:40,paddingHorizontal:12,paddingVertical:8},text:{fontSize:16,flex:1},icon:{marginRight:10}});var ms=e=>{if(!e.accept)return;let t=[];return e.accept.includes("image")&&t.push("image/jpg","image/jpeg","image/png","image/svg","image/gif"),e.accept.includes("pdf")&&t.push("application/pdf"),e.accept.includes("audio")&&t.push("audio/mp3","audio/wav","audio/x-wav","audio/webm","audio/ogg"),t.join(",")},fs=({hasUpload:e})=>jsxRuntime.jsxs(reactNative.View,{style:ce.noFileContainer,children:[jsxRuntime.jsx(reactNative.Text,{style:ce.noFileText,children:e?"Tap to upload file":"No file uploaded"}),jsxRuntime.jsx(vectorIcons.Ionicons,{name:"cloud-upload",size:24,color:"#666"})]}),vt=({value:e,hasUpload:t,imageOptions:o})=>{let{storagePath:n,dataUrl:r}=e??{};return !e||!r&&!n?jsxRuntime.jsx(fs,{hasUpload:t}):e.type?.startsWith("image/")?jsxRuntime.jsx(Bn,{src:r,width:o?.width??120,height:o?.height??120,style:ce.image}):jsxRuntime.jsxs(reactNative.View,{style:ce.fileContainer,children:[jsxRuntime.jsx(vectorIcons.Ionicons,{name:"document",size:24,color:"#666"}),jsxRuntime.jsx(reactNative.Text,{style:ce.filename,children:e.filename})]})},bo=Vi.forwardRef(({input:{value:e,onChange:t},field:o},n)=>{let[r,i]=Vi.useState(false),{imageOptions:a}=o||{},s=Vi.useCallback(async()=>{try{i(!0);let c;if(o.accept?.includes("image")){if(c=await ur__namespace.launchImageLibraryAsync({mediaTypes:["images"],allowsEditing:!0,quality:1,base64:!0}),!c.canceled&&c.assets[0]){let d=c.assets[0],u=d.uri.split(".").pop()??"jpeg",f=d.uri.split("/").pop()??"image";t({...e,dataUrl:d.uri,type:`image/${u}`,filename:f});}}else c=await dr__namespace.getDocumentAsync({type:ms(o)}),c.canceled||t({...e,dataUrl:c.assets[0].uri,type:c.assets[0].mimeType,filename:c.assets[0].name});}catch(c){c instanceof Error&&console.error("Error picking file:",c.message);}finally{i(false);}},[o,t,e]);Vi.useImperativeHandle(n,()=>({focus:()=>{s();},blur:()=>{}}));let l=Vi.useMemo(()=>o.accept&&o.accept.length===1&&o.accept[0]==="image",[o]),p=Vi.useMemo(()=>l||e?.type?.startsWith("image/")?{height:120,...a}:void 0,[a,l,e]);return jsxRuntime.jsxs(reactNative.View,{style:ce.container,children:[jsxRuntime.jsx(reactNative.Text,{style:ce.placeholder,children:o.placeholder}),jsxRuntime.jsx(reactNative.TouchableOpacity,{style:ce.contentContainer,onPress:()=>void s(),disabled:r,children:jsxRuntime.jsx(vt,{hasUpload:true,imageOptions:p,value:e})})]})});bo.displayName="FileComponent";var ce=reactNative.StyleSheet.create({container:{width:"100%",alignItems:"center",justifyContent:"center"},placeholder:{fontSize:14,opacity:.8,marginBottom:4},contentContainer:{width:"100%",position:"relative",alignItems:"center",justifyContent:"center",padding:8,overflow:"hidden"},noFileContainer:{flexDirection:"row",alignItems:"center",justifyContent:"center",padding:16,borderWidth:1,borderColor:"#e2e8f0",borderRadius:4,borderStyle:"dashed"},noFileText:{fontSize:14,textAlign:"center",opacity:.8,marginRight:8},fileContainer:{flexDirection:"row",alignItems:"center",padding:8,borderWidth:1,borderColor:"#e2e8f0",borderRadius:4},filename:{fontSize:14,marginLeft:8},image:{borderRadius:4,overflow:"hidden"}});var mr=Vi.forwardRef(({field:e,input:t,inEditable:o},n)=>{let{options:r,renderOption:i,getOptionKey:a}=e,{onChange:s,value:l,onFocus:p,onBlur:c}=t,d=react.useColorMode(),u=react.usePlaceholderColor();Vi.useImperativeHandle(n,()=>({focus:()=>{p();},blur:()=>{c();}}));let f=m=>{s(l?.includes(m)?l.filter(g=>g!==m):[...l??[],m]);},h=jsxRuntime.jsx(reactNative.View,{style:Je.container,children:r.map(m=>jsxRuntime.jsx(reactNative.TouchableOpacity,{style:[Je.option,l?.includes(m)&&Je.selectedOption],onPress:()=>f(m),children:i(m,d,!!l?.includes(m))},a?a(m):m))});return o?jsxRuntime.jsxs(reactNative.View,{style:Je.editableContainer,children:[jsxRuntime.jsx(reactNative.Text,{style:[Je.placeholder,{color:u}],children:e.placeholder}),h]}):h}),Je=reactNative.StyleSheet.create({container:{width:"100%",flexDirection:"row",flexWrap:"wrap",gap:4},editableContainer:{width:"100%",paddingVertical:2},placeholder:{fontSize:14,fontWeight:"600",opacity:.8,paddingHorizontal:8,marginBottom:4},option:{padding:4,opacity:.7},selectedOption:{opacity:1}});var Is={xs:4,sm:6,md:8,lg:8,xl:8},Fs={xs:8,sm:12,md:12,lg:12,xl:12},Ps={xs:12,sm:14,md:16,lg:18,xl:20},fr=e=>Vi.useMemo(()=>reactNative.StyleSheet.create({style:{paddingVertical:Is[e??"md"],paddingHorizontal:Fs[e??"md"],fontSize:Ps[e??"md"]}}),[e]);var Vo=Vi.forwardRef(({input:{onChange:e,value:t,...o},field:n,size:r,prefix:i,inEditable:a,...s},l)=>{let{type:p,defaultValue:c,placeholder:d}=n,u=react.useTextColor(),{style:f}=fr(r),h=Vt(l),[m,g]=Vi.useState(""),y=typeof t=="number"&&!Number.isNaN(t)?`${t}${m}`:"",V=react.usePlaceholderColor();return p==="slider"?jsxRuntime.jsx(St,{label:d,onValueChange:e,value:t,minimumValue:c}):jsxRuntime.jsxs(reactNative.View,{style:So.container,children:[i&&jsxRuntime.jsx(reactNative.Text,{style:So.prefix,children:i}),jsxRuntime.jsx(reactNative.TextInput,{ref:h,style:[So.input,f,{color:u}],placeholder:n.placeholder,placeholderTextColor:V,keyboardType:"numeric",value:y,onChangeText:S=>{S.endsWith(".")?g("."):S.includes(".")&&S.endsWith("0")?g("0"):g("");let b=parseFloat(S);e(isNaN(b)?void 0:b);},...o})]})}),zs=({field:e,...t},o)=>{let n=Vi.useRef(null);return Vi.useImperativeHandle(o,()=>({focus:()=>{n.current?.focus();},blur:()=>{n.current?.blur();}})),jsxRuntime.jsx(Vo,{prefix:"$",field:{...e,_type:"number"},...t})},hr=Vi.forwardRef(zs),So=reactNative.StyleSheet.create({container:{flexDirection:"row",alignItems:"center",width:"100%"},input:{flex:1,height:40,paddingHorizontal:12,paddingVertical:8,backgroundColor:"transparent"},prefix:{marginRight:4,fontSize:16}});var Qs=({field:e,input:t,meta:o},n)=>{let{placeholder:r,options:i,renderOption:a,getOptionKey:s,optional:l}=e,{onChange:p,value:c,onFocus:d,onBlur:u}=t,{active:f}=o,[h,m]=Vi.useState({x:0,y:0,width:0,height:0}),g=Vi.useRef(null),y=Vi.useMemo(()=>{if(c)return i.find(I=>{if(s){let E=s(I),L=s(c);return E===L}return I===c})},[c,i,s]);Vi.useImperativeHandle(n,()=>({focus:()=>{d();},blur:()=>{u();}}));let V=()=>{g.current?.measure((I,E,L,q,Se,Ve)=>{m({x:Se,y:Ve,width:L,height:q});});},S=(I,E)=>typeof a=="function"?a(I,"light",E):typeof I=="object"?jsxRuntime.jsx(G,{children:JSON.stringify(I)}):jsxRuntime.jsx(G,{children:String(I)}),b=I=>{if(s){let E=s(I);return typeof E=="object"?JSON.stringify(E):String(E)}return typeof I=="object"?JSON.stringify(I):String(I)},v=I=>{p(I),u();},T=react.useIconColor(),D=react.usePlaceholderColor(),k=react.useBackgroundColor(200),_=react.useBackgroundColor(300),H=react.useBorderColor();return jsxRuntime.jsxs(reactNative.View,{style:oe.wrapper,children:[jsxRuntime.jsx(reactNative.View,{ref:g,onLayout:V,style:oe.container,children:jsxRuntime.jsxs(reactNative.TouchableOpacity,{style:[oe.button],onPress:()=>{f?u():d();},children:[jsxRuntime.jsx(reactNative.View,{children:y?S(y,true):jsxRuntime.jsx(reactNative.Text,{style:[oe.placeholder,{color:D}],children:r})}),jsxRuntime.jsxs(reactNative.View,{style:oe.iconsContainer,children:[l?jsxRuntime.jsx(po,{onPress:()=>p(null),isActive:!!c}):null,jsxRuntime.jsx(vectorIcons.Ionicons,{name:f?"chevron-up":"chevron-down",size:20,color:T})]})]})}),jsxRuntime.jsx(reactNative.Modal,{visible:f,transparent:true,animationType:"fade",onRequestClose:()=>u(),children:jsxRuntime.jsx(reactNative.TouchableOpacity,{style:oe.modalOverlay,activeOpacity:1,onPress:()=>u(),children:jsxRuntime.jsx(reactNative.View,{style:[oe.dropdownContainer,{position:"absolute",top:h.y+h.height+4,left:h.x,width:h.width,backgroundColor:k,borderColor:H}],children:jsxRuntime.jsx(reactNative.ScrollView,{style:oe.dropdown,children:i.map(I=>{let E=b(I),L=I===y;return jsxRuntime.jsx(reactNative.TouchableOpacity,{style:[oe.option,{borderColor:H},L&&{backgroundColor:_}],onPress:()=>v(I),children:jsxRuntime.jsx(reactNative.View,{children:S(I,L)})},E)})})})})})]})},wr=Vi.forwardRef(Qs),oe=reactNative.StyleSheet.create({wrapper:{width:"100%"},container:{width:"100%"},button:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",width:"100%",height:40,paddingHorizontal:12,paddingVertical:8,backgroundColor:"transparent",borderRadius:4},buttonText:{fontSize:16,flex:1},modalOverlay:{flex:1,backgroundColor:"rgba(0, 0, 0, 0.5)"},dropdownContainer:{backgroundColor:"white",borderWidth:1,borderColor:"#ddd",borderRadius:4,maxHeight:200,elevation:3,shadowColor:"#000",shadowOffset:{width:0,height:2},shadowOpacity:.1,shadowRadius:2,padding:0},dropdown:{maxHeight:200},option:{paddingVertical:12,paddingHorizontal:16,borderBottomWidth:1},optionText:{fontSize:16},iconsContainer:{flexDirection:"row",alignItems:"center",gap:8},placeholder:{color:"#666"}});var lc={facebook:"facebook",instagram:"instagram",twitter:"twitter",youtube:"youtube",soundcloud:"soundcloud"},Ke=({site:e,value:t,onChange:o,isModalVisible:n,onModalClose:r})=>{let{handle:i,error:a}=Vi.useMemo(()=>{try{return {handle:core.getHandle(e,t)}}catch(l){return {error:l?.message??"Error parsing handle"}}},[t,e]),s=Vi.useMemo(()=>i?`${e.toUpperCase()}: ${i}`:e.toUpperCase(),[e,i]);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(reactNative.TouchableOpacity,{style:[U.iconButton,!i&&U.iconButtonInactive],onPress:()=>r(),children:jsxRuntime.jsx(reactNative.Text,{style:U.iconText,children:lc[e]})}),jsxRuntime.jsx(reactNative.Modal,{visible:n,transparent:true,animationType:"slide",onRequestClose:r,children:jsxRuntime.jsx(reactNative.View,{style:U.modalContainer,children:jsxRuntime.jsxs(reactNative.View,{style:U.modalContent,children:[jsxRuntime.jsx(reactNative.Text,{style:U.modalTitle,children:s}),a&&jsxRuntime.jsx(reactNative.Text,{style:U.errorText,children:a}),jsxRuntime.jsx(reactNative.TextInput,{style:U.modalInput,onChangeText:o,placeholder:"Handle or URL",value:t,autoCapitalize:"none",autoCorrect:false}),jsxRuntime.jsx(reactNative.TouchableOpacity,{style:U.closeButton,onPress:r,children:jsxRuntime.jsx(reactNative.Text,{style:U.closeButtonText,children:"Close"})})]})})})]})},xr=Vi.forwardRef((e,t)=>{let{input:{value:o,onChange:n},field:{sites:r}}=e,[i,a]=Vi.useState(null),s=Vi.useCallback((l,p)=>{let{[l]:c,...d}=o??{};!p&&Object.keys(d).length===0&&n({target:{value:void 0}}),p||n(d),n({...d,[l]:p});},[n,o]);return Vi.useImperativeHandle(t,()=>({blur:()=>{},focus:()=>{}})),jsxRuntime.jsxs(reactNative.View,{style:U.container,children:[jsxRuntime.jsx(reactNative.Text,{style:U.title,children:"Links"}),jsxRuntime.jsxs(reactNative.View,{style:U.iconsContainer,children:[(!r||r.facebook)&&jsxRuntime.jsx(Ke,{onChange:l=>s("facebook",l),site:"facebook",value:o?.facebook,isModalVisible:i==="facebook",onModalClose:()=>a(null)}),(!r||r.instagram)&&jsxRuntime.jsx(Ke,{onChange:l=>s("instagram",l),site:"instagram",value:o?.instagram,isModalVisible:i==="instagram",onModalClose:()=>a(null)}),(!r||r.twitter)&&jsxRuntime.jsx(Ke,{onChange:l=>s("twitter",l),site:"twitter",value:o?.twitter,isModalVisible:i==="twitter",onModalClose:()=>a(null)}),(!r||r.youtube)&&jsxRuntime.jsx(Ke,{onChange:l=>s("youtube",l),site:"youtube",value:o?.youtube,isModalVisible:i==="youtube",onModalClose:()=>a(null)}),(!r||r.soundcloud)&&jsxRuntime.jsx(Ke,{onChange:l=>s("soundcloud",l),site:"soundcloud",value:o?.soundcloud,isModalVisible:i==="soundcloud",onModalClose:()=>a(null)})]})]})}),U=reactNative.StyleSheet.create({container:{flex:1,padding:8},title:{fontSize:16,fontWeight:"bold",marginBottom:8,color:"#1A202C"},iconsContainer:{flexDirection:"row",flexWrap:"wrap",gap:8},iconButton:{width:34,height:34,borderRadius:17,backgroundColor:"#EDF2F7",justifyContent:"center",alignItems:"center"},iconButtonInactive:{opacity:.6},iconText:{fontSize:12,color:"#1A202C"},modalContainer:{flex:1,justifyContent:"center",alignItems:"center",backgroundColor:"rgba(0, 0, 0, 0.5)"},modalContent:{backgroundColor:"white",borderRadius:8,padding:16,width:"80%",maxWidth:300},modalTitle:{fontSize:16,fontWeight:"bold",marginBottom:8,color:"#1A202C"},errorText:{color:"#E53E3E",fontSize:14,marginBottom:8,padding:4,backgroundColor:"#FFF5F5"},modalInput:{borderWidth:1,borderColor:"#E2E8F0",borderRadius:4,padding:8,marginBottom:16,fontSize:16},closeButton:{backgroundColor:"#EDF2F7",padding:8,borderRadius:4,alignItems:"center"},closeButtonText:{color:"#1A202C",fontSize:16}});var Fo=Vi.forwardRef(({input:e,field:t,inEditable:o},n)=>{let r=Vi.useRef(null),{value:i,onChange:a,...s}=e;Vi.useImperativeHandle(n,()=>({focus:()=>{r.current?.focus();},blur:()=>{r.current?.blur();}}));let l=react.usePlaceholderColor(),p=react.useTextColor();return jsxRuntime.jsx(reactNative.TextInput,{ref:r,style:[Sr.textarea,o&&Sr.inEditable,{color:p}],placeholder:t.placeholder,placeholderTextColor:l,multiline:true,numberOfLines:2,maxLength:200,textAlignVertical:"top",value:i??"",onChangeText:a,...s})});Fo.displayName="TextAreaComponent";var Sr=reactNative.StyleSheet.create({textarea:{width:"100%",minHeight:80,paddingHorizontal:12,paddingVertical:8,backgroundColor:"transparent",textAlignVertical:"top"},inEditable:{paddingHorizontal:0,paddingVertical:0}});var Po=Vi.forwardRef(({input:e,inEditable:t,meta:o,field:n},r)=>{let{placeholder:i,type:a}=n,[s,l]=Vi.useState(a==="password"),{value:p,onChange:c,...d}=e,u=Vi.useRef(null);Vi.useImperativeHandle(r,()=>({focus:()=>{u.current?.focus();},blur:()=>{u.current?.blur();}}));let f=react.usePlaceholderColor(),h=react.useTextColor(),m=a==="textarea"?jsxRuntime.jsx(Fo,{inEditable:t,field:n,input:e,meta:o}):jsxRuntime.jsx(reactNative.TextInput,{ref:u,style:[Xe.input,t&&Xe.inEditable,a==="password"&&Xe.passwordInput,{color:h}],secureTextEntry:s,placeholderTextColor:f,placeholder:i,value:p??"",onChangeText:c,...d});return a==="password"?jsxRuntime.jsxs(reactNative.View,{style:Xe.passwordContainer,children:[m,jsxRuntime.jsx(reactNative.TouchableOpacity,{style:Xe.eyeIcon,onPress:()=>l(!s),children:jsxRuntime.jsx(vectorIcons.Ionicons,{name:s?"eye":"eye-off",size:20,color:"#666"})})]}):m});Po.displayName="TextComponent";var Xe=reactNative.StyleSheet.create({input:{width:"100%",height:40,paddingHorizontal:12,paddingVertical:8},inEditable:{paddingHorizontal:0,paddingVertical:0,height:"auto"},passwordInput:{paddingRight:40},passwordContainer:{width:"100%",flexDirection:"row",alignItems:"center",position:"relative"},eyeIcon:{position:"absolute",right:12,padding:4}});var Ro=Vi.forwardRef(({input:{onChange:e,value:t,onFocus:o,onBlur:n},field:{placeholder:r,optional:i}},a)=>{let[s,l]=Vi.useState(false);Vi.useImperativeHandle(a,()=>({focus:()=>{l(true),o();},blur:()=>{l(false),n();}}));let p=({hours:g,minutes:y})=>{l(false);let V=`${core.padZeros(g)}:${core.padZeros(y)}`;e(V),n();},c=()=>{l(false),n();},d=Vi.useMemo(()=>{if(!t)return null;let[g,y]=t.split(":").map(Number),V=g>=12?"PM":"AM";return `${g%12===0?12:g%12}:${core.padZeros(y)} ${V}`},[t]),{hours:u,minutes:f}=Vi.useMemo(()=>{if(!t)return {hours:0,minutes:0};let[g,y]=t.split(":").map(Number);return {hours:g,minutes:y}},[t]),h=react.useIconColor(),m=Me(t);return jsxRuntime.jsxs(reactNative.View,{style:kt.container,children:[jsxRuntime.jsxs(reactNative.TouchableOpacity,{style:kt.button,onPress:()=>{l(true),o();},children:[jsxRuntime.jsx(reactNative.Text,{style:[kt.text,{color:m}],children:d??r}),jsxRuntime.jsx(vectorIcons.Ionicons,{name:"time",size:20,color:h,style:kt.icon}),i&&t?jsxRuntime.jsx(ke,{onPress:()=>e(null),isActive:!!t}):null]}),jsxRuntime.jsx(reactNativePaper.Portal,{children:jsxRuntime.jsx(reactNativePaperDates.TimePickerModal,{visible:s,onDismiss:c,onConfirm:p,hours:u,minutes:f})})]})});Ro.displayName="TimeInput";var kt=reactNative.StyleSheet.create({container:{width:"100%"},button:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",width:"100%",height:40,paddingHorizontal:12,paddingVertical:8},text:{fontSize:16,flex:1},icon:{marginRight:10}});var Gc={text:Po,file:bo,boolean:Qn,select:wr,multipleSelect:mr,currency:hr,number:Vo,date:mo,datetime:ho,time:Ro,socialMedia:xr,color:rr},Yc=(e,t)=>{let{field:o,meta:{error:n,active:r,touched:i},input:a,inEditable:s}=e,{value:l}=a,p=react.useThemeValue("colors.text.500"),c=react.useThemeValue("colors.accent.400"),d=react.useThemeValue("colors.error.200"),u=Vi.useMemo(()=>new reactNative.Animated.Value(0),[]),f=Vi.useMemo(()=>n&&i?n:null,[n,i]),h=Vi.useMemo(()=>f?"#ff7777":c,[f,c]);Vi.useEffect(()=>{reactNative.Animated.timing(u,{toValue:r||f?1:0,duration:300,useNativeDriver:false}).start();},[r,f,u]);let m=u.interpolate({inputRange:[0,1],outputRange:[p,h]}),{_type:g,label:y}=o,V=Vi.useMemo(()=>g==="multipleSelect"||!!l&&g!=="file"&&g!=="boolean",[l,g]),S=react.useBackgroundColor(150),b=Vi.useMemo(()=>{if(s)return {};switch(g){case "text":case "number":case "currency":case "select":case "datetime":case "date":case "time":return {shadowColor:m,shadowOffset:{width:0,height:0},shadowOpacity:1,shadowRadius:7,elevation:10,backgroundColor:S};default:return {}}},[g,m,s,S]),v=Vi.useMemo(()=>Gc[g],[g]),T=Vi.useMemo(()=>s?0:n&&i?24:8,[s,n,i]);return jsxRuntime.jsxs(reactNative.View,{style:[Ze.container,{paddingBottom:T}],children:[y&&!s?jsxRuntime.jsx(reactNative.Text,{style:Ze.label,children:y}):null,jsxRuntime.jsx(reactNative.Animated.View,{style:[Ze.inputContainer,b],children:jsxRuntime.jsx(v,{ref:t,...e})}),!s&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(reactNative.Text,{style:[Ze.errorText,{opacity:n&&i?1:0,color:d}],children:n}),jsxRuntime.jsx(reactNative.Text,{style:[Ze.placeholder,{opacity:V?1:0}],children:o.placeholder??""})]})]})},Ze=reactNative.StyleSheet.create({container:{position:"relative",width:"100%",paddingVertical:4,paddingHorizontal:4},label:{color:"#1A202C",fontSize:14,paddingHorizontal:8},inputContainer:{width:"100%",borderRadius:4,paddingVertical:1,overflow:"hidden"},errorText:{position:"absolute",bottom:0,fontSize:14,paddingHorizontal:4,color:"#E53E3E"},placeholder:{position:"absolute",top:-16,fontSize:14,paddingHorizontal:4,color:"rgba(0,0,0,0.6)"}}),Mt=Vi.forwardRef(Yc);var Xc=({field:e,name:t},o)=>{let{control:n,getOnChange:r,meta:i,onFocus:a,onBlur:s}=react.useField(t,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:n,name:t,render:({field:{name:l,ref:p,onBlur:c,...d}})=>jsxRuntime.jsx(Mt,{ref:o,field:e,input:{...d,onFocus:a,onBlur:()=>{s(),c();},onChange:r(d.onChange)},meta:i})})},Pr=Vi.forwardRef(Xc);var tt=reactNative.StyleSheet.create({container:{width:"100%",flexDirection:"column"},progressContainer:{paddingHorizontal:8,height:26,width:"100%",justifyContent:"center",alignItems:"center"},progressBar:{height:"100%",width:"100%",borderRadius:13,backgroundColor:"rgba(0, 0, 0, 0.1)",overflow:"hidden"},progressFill:{height:"100%",backgroundColor:"#3182CE"},label:{position:"absolute",color:"white",fontSize:12,fontWeight:"500",textTransform:"uppercase",textShadowColor:"rgba(0, 0, 0, 0.67)",textShadowOffset:{width:1,height:1},textShadowRadius:3}}),Et=({uploads:e})=>{let t=Vi.useMemo(()=>Object.values(e),[e]);return jsxRuntime.jsx(reactNative.View,{style:tt.container,children:t.map(o=>jsxRuntime.jsxs(reactNative.Animated.View,{style:tt.progressContainer,children:[jsxRuntime.jsx(reactNative.View,{style:tt.progressBar,children:jsxRuntime.jsx(reactNative.Animated.View,{style:[tt.progressFill,{width:`${o.percent*100}%`}]})}),jsxRuntime.jsx(reactNative.Text,{style:tt.label,children:o.label})]},o.label))})};var ne=reactNative.StyleSheet.create({container:{width:"100%"},progressContainer:{height:5,width:"100%"},footerContainer:{flexDirection:"row",paddingVertical:8,borderTopWidth:1,borderTopColor:core.palette.gray.light,paddingHorizontal:12,width:"100%"},cancelButton:{flex:1,paddingVertical:8,paddingHorizontal:16,borderWidth:1,borderColor:"#cdcdcd",borderRadius:4,marginRight:8},cancelButtonText:{color:"#777",textAlign:"center"},submitButton:{flex:1,paddingVertical:8,paddingHorizontal:16,borderRadius:4,backgroundColor:core.palette.cyan.light},submitButtonText:{color:"#fff",textAlign:"center"},errorText:{color:"red",paddingHorizontal:12,paddingVertical:4},disabledButton:{opacity:.5}}),id=({onBack:e,children:t})=>jsxRuntime.jsx(reactNative.TouchableOpacity,{style:ne.cancelButton,onPress:e,children:jsxRuntime.jsx(reactNative.Text,{style:ne.cancelButtonText,children:t})}),ad=({onSubmitClick:e,submitting:t,children:o})=>jsxRuntime.jsx(reactNative.TouchableOpacity,{style:[ne.submitButton,t&&ne.disabledButton],onPress:e,disabled:t,children:t?jsxRuntime.jsx(reactNative.ActivityIndicator,{color:"#fff"}):jsxRuntime.jsx(reactNative.Text,{style:ne.submitButtonText,children:o})}),ld=()=>{let{formError:e}=react.useChempoForm();return e?jsxRuntime.jsx(reactNative.Text,{style:ne.errorText,children:e}):null},Mr=({isLoading:e,uploads:t,onSubmit:o,renderFooter:n,onBack:r,buttonText:i})=>{let{isSubmitting:a,isValid:s}=reactHookForm.useFormState();return jsxRuntime.jsxs(reactNative.View,{style:ne.container,children:[e&&jsxRuntime.jsx(reactNative.View,{style:ne.progressContainer,children:jsxRuntime.jsx(reactNative.ActivityIndicator,{})}),jsxRuntime.jsx(Et,{uploads:t}),jsxRuntime.jsx(ld,{}),n?n({}):jsxRuntime.jsxs(reactNative.View,{style:ne.footerContainer,children:[r&&jsxRuntime.jsx(id,{onBack:r,children:"Cancel"}),jsxRuntime.jsx(ad,{onSubmitClick:o,submitting:a||!s,children:i})]})]})};var ot=reactNative.StyleSheet.create({container:{flexDirection:"column"},rowContainer:{flexDirection:"row"},label:{paddingRight:8,opacity:.7,fontWeight:"600"},emptyText:{opacity:.7},fileContainer:{padding:4}}),zr=({field:e,value:t,noLabel:o,style:n})=>{let{imageOptions:r,placeholder:i}=e,a=Vi.useMemo(()=>({height:150,...r}),[r]);return jsxRuntime.jsxs(reactNative.View,{style:[t?ot.container:ot.rowContainer,n],children:[!o&&jsxRuntime.jsx(reactNative.Text,{style:ot.label,children:i}),t?jsxRuntime.jsx(reactNative.View,{style:ot.fileContainer,children:jsxRuntime.jsx(vt,{imageOptions:a,value:t})}):jsxRuntime.jsx(reactNative.Text,{style:ot.emptyText,children:"None"})]})};var Lt=reactNative.StyleSheet.create({container:{flexDirection:"row",flexWrap:"wrap",alignItems:"center",maxWidth:"100%"},label:{paddingRight:8,opacity:.7,fontWeight:"600"},optionContainer:{padding:2},emptyText:{opacity:.6}}),Nr=({field:e,value:t,noLabel:o,style:n})=>{let{placeholder:r,renderOption:i,getOptionKey:a}=e,s=reactNative.useColorScheme()??"light";return jsxRuntime.jsxs(reactNative.View,{style:[Lt.container,n],children:[!o&&jsxRuntime.jsx(reactNative.Text,{style:Lt.label,children:r}),t?t.map(l=>jsxRuntime.jsx(reactNative.View,{style:Lt.optionContainer,children:i(l,s,true)},a?a(l):l)):jsxRuntime.jsx(reactNative.Text,{style:Lt.emptyText,children:"None"})]})};var Wr=reactNative.StyleSheet.create({container:{flexDirection:"row",alignItems:"center"},label:{paddingRight:8,opacity:.7,fontWeight:"600"}}),bd=e=>jsxRuntime.jsx(G,{children:typeof e=="string"?e:JSON.stringify(e)}),Ur=({field:e,value:t,noLabel:o,style:n})=>{let{placeholder:r,renderOption:i}=e,a=reactNative.useColorScheme()??"light",s=react.usePlaceholderColor(),l=i??bd;return jsxRuntime.jsxs(reactNative.View,{style:[Wr.container,n],children:[!o&&jsxRuntime.jsx(reactNative.Text,{style:[Wr.label,{color:s}],children:r}),t?l(t,a,true):"None"]})};var Ht=reactNative.StyleSheet.create({container:{flexDirection:"row",alignItems:"center"},label:{paddingRight:8,opacity:.7,fontWeight:"600"},value:{opacity:1},valueEmpty:{opacity:.6}}),Id=({field:e,value:t,noLabel:o,style:n})=>{let{placeholder:r}=e,i=Vi.useMemo(()=>{let a=core.formatField[e._type];return a?a(e,t):t},[t,e]);return jsxRuntime.jsxs(reactNative.View,{style:[Ht.container,n],children:[!o&&jsxRuntime.jsx(reactNative.Text,{style:Ht.label,children:r}),jsxRuntime.jsx(reactNative.Text,{style:t!=null?Ht.value:Ht.valueEmpty,children:i??"None"})]})},Nt=({field:e,value:t,noLabel:o,style:n})=>{switch(e._type){case "select":return jsxRuntime.jsx(Ur,{style:n,field:e,value:t,noLabel:o});case "multipleSelect":return jsxRuntime.jsx(Nr,{style:n,field:e,value:t,noLabel:o});case "file":return jsxRuntime.jsx(zr,{style:n,field:e,value:t,noLabel:o});default:return jsxRuntime.jsx(Id,{style:n,field:e,value:t,noLabel:o})}};var Rd=({onChange:e,value:t,field:o,onBlur:n,inEditable:r,onFocus:i,style:a},s)=>{let{inputProps:l,meta:p}=react.useStandaloneInput(o,t,e,i,n);return jsxRuntime.jsx(Mt,{ref:s,field:o,inEditable:r,style:a,input:l,meta:p})},Gr=Vi.forwardRef(Rd);var Kr=({value:e,field:t,onSubmit:o,storagePath:n,style:r,onEditClose:i,onEditOpen:a})=>{let{formattedValue:s,inputRef:l,setValue:p,isLoading:c,uploads:d,editHovered:u,handleEditOpen:f,handleEditClose:h,isEditing:m,value:g,setEditHovered:y,submit:V,parse:S}=react.useEditable({value:e,field:t,onSubmit:o,storagePath:n,onEditOpen:a,onEditClose:i}),b=Vi.useMemo(()=>t._type==="file"||t._type==="boolean",[t]);Vi.useEffect(()=>{m&&l.current?.focus();},[m,l]);let v=react.useColorModeValue("#00000055","#ffffff55");return jsxRuntime.jsxs(reactNative.View,{style:[xe.container,{borderColor:u&&!m?v:"transparent"},r],children:[jsxRuntime.jsxs(reactNative.View,{style:xe.contentContainer,children:[jsxRuntime.jsx(reactNative.View,{style:[xe.inputContainer,{opacity:c?0:1,borderColor:m?v:"transparent"}],children:m||b?jsxRuntime.jsx(Gr,{ref:l,value:s,inEditable:true,field:t,style:[xe.input,r],onChange:b?T=>V(S(T)):T=>p(S(T))}):jsxRuntime.jsx(Nt,{style:r,field:t,value:g})}),!b&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(reactNative.TouchableOpacity,{style:xe.editButton,onPress:()=>{m?(p(g),h()):f();},onPressIn:()=>y(true),onPressOut:()=>y(false),children:jsxRuntime.jsx(vectorIcons.Ionicons,{name:m?"close":"create-outline",size:20,color:core.palette.gray.medium})}),jsxRuntime.jsx(reactNative.View,{style:[xe.submitButtonContainer,{width:m?30:0,opacity:m?1:0}],children:jsxRuntime.jsx(reactNative.TouchableOpacity,{style:[xe.submitButton,{backgroundColor:core.palette.cyan.light}],onPress:()=>void V(g),children:jsxRuntime.jsx(vectorIcons.Ionicons,{name:"checkmark",size:20,color:"#fff"})})})]}),jsxRuntime.jsx(mt,{isLoading:c})]}),jsxRuntime.jsx(Et,{uploads:d})]})},xe=reactNative.StyleSheet.create({container:{borderRadius:4,borderWidth:1,borderStyle:"dashed",width:"100%"},contentContainer:{flexDirection:"row",alignItems:"center",paddingHorizontal:4,position:"relative",width:"100%"},inputContainer:{flex:1,minWidth:0,borderWidth:1,borderStyle:"dashed"},input:{padding:0},editButton:{padding:4,marginLeft:4},submitButtonContainer:{justifyContent:"flex-end",overflow:"hidden"},submitButton:{padding:4,borderRadius:4}});var R=reactNative.StyleSheet.create({container:{width:"100%"},listContainer:{width:"100%",paddingHorizontal:8,paddingVertical:4,gap:8},listHeader:{fontSize:14,opacity:.7,lineHeight:1},listContent:{gap:8,paddingVertical:4,minHeight:30},listItem:{paddingTop:8,paddingHorizontal:8,borderWidth:1,borderColor:"#e2e8f0",borderRadius:4},listItemContent:{flexDirection:"row",alignItems:"center",gap:4,width:"100%"},listItemInput:{flex:1,minWidth:0},emptyListText:{fontSize:14,opacity:.7,paddingVertical:4,paddingHorizontal:8},newButton:{alignSelf:"flex-start",paddingVertical:4,paddingHorizontal:8,borderRadius:4,backgroundColor:"#f7fafc"},newButtonText:{fontSize:14,color:"#4a5568"},formElementContainer:{width:"100%",gap:4},dataViewHeader:{flexDirection:"row",alignItems:"center",paddingHorizontal:8,width:"100%"},dataViewTitle:{fontSize:18,fontFamily:"System",paddingVertical:8},dataViewActions:{flexDirection:"row",alignItems:"center",gap:8,marginLeft:"auto"},dataViewContent:{paddingHorizontal:16,paddingVertical:8}}),Yd=({field:e,name:t})=>{let o=Vi.useMemo(()=>core.isField(e.itemField)?"":core.isListField(e.itemField)?[]:{},[e]),{control:n}=reactHookForm.useFormContext(),{fields:r,append:i,remove:a}=reactHookForm.useFieldArray({control:n,name:t});return jsxRuntime.jsxs(reactNative.View,{style:R.listContainer,children:[jsxRuntime.jsx(reactNative.Text,{style:R.listHeader,children:e.placeholder}),jsxRuntime.jsx(reactNative.View,{style:R.listContent,children:r.length?r.map((s,l)=>jsxRuntime.jsx(reactNative.View,{style:R.listItem,children:jsxRuntime.jsxs(reactNative.View,{style:R.listItemContent,children:[jsxRuntime.jsx(reactNative.View,{style:R.listItemInput,children:jsxRuntime.jsx(Lo,{name:s.id,field:e.itemField})}),jsxRuntime.jsx(Xt,{onDelete:()=>a(l),itemName:`${e.placeholder} ${l+1}`})]})},s.id)):jsxRuntime.jsx(reactNative.Text,{style:R.emptyListText,children:"No items"})}),jsxRuntime.jsx(reactNative.TouchableOpacity,{style:R.newButton,onPress:()=>i(o),children:jsxRuntime.jsx(reactNative.Text,{style:R.newButtonText,children:"+ NEW"})})]})},Lo=({field:e,name:t})=>{let o=Vi.useMemo(()=>core.isField(e)||core.isListField(e)?[{name:"value",field:e}]:Object.entries(e.children).map(([n,r])=>({name:`${t?`${t}.`:""}${n}`,field:r})),[e,t]);return jsxRuntime.jsx(reactNative.View,{style:R.formElementContainer,children:o.map(n=>{if(core.isListField(n.field)){let i=jsxRuntime.jsx(Yd,{name:n.name,field:n.field},n.name);return n.field.condition?jsxRuntime.jsx(Ct,{path:t,condition:n.field.condition,children:i},n.name):i}if(core.isField(n.field)){let i=jsxRuntime.jsx(Pr,{name:n.name,field:n.field},n.name);return n.field.condition?jsxRuntime.jsx(Ct,{path:t,condition:n.field.condition,children:i},n.name):i}let r=jsxRuntime.jsx(Lo,{name:n.name,field:n.field},n.name);return n.field.condition?jsxRuntime.jsx(Ct,{path:t,condition:n.field.condition,children:r},n.name):r})})},_d=({field:e,value:t,path:o})=>{let{itemField:n,placeholder:r}=e;return jsxRuntime.jsx(reactNative.View,{style:R.listContainer,children:jsxRuntime.jsx(Yt,{header:()=>jsxRuntime.jsx(reactNative.Text,{style:R.listHeader,children:r}),initExpanded:true,children:jsxRuntime.jsx(reactNative.View,{style:R.listContent,children:t?.length?t.map((i,a)=>jsxRuntime.jsx(reactNative.View,{style:R.listItem,children:jsxRuntime.jsx(qr,{path:`${o}.${a}`,field:{...n,placeholder:`${r} ${a+1}`},value:i})},`${o}.${a}`)):jsxRuntime.jsx(reactNative.Text,{style:R.emptyListText,children:"No items"})})})})},qr=({field:e,value:t,path:o,storagePath:n})=>{let{updateField:r}=react.useDataView();return core.isField(e)?r?jsxRuntime.jsx(Kr,{storagePath:n,field:e,value:t,onSubmit:i=>r(o,i)}):jsxRuntime.jsx(Nt,{field:e,value:t}):core.isListField(e)?jsxRuntime.jsx(_d,{path:o,field:e,value:t}):jsxRuntime.jsx(Jd,{storagePath:n?`${n}.${o}`:void 0,path:o,field:e})},Jd=({field:e,value:t,onClose:o,onDelete:n,onSubmit:r,itemName:i,storagePath:a,path:s=""})=>{let{name:l,children:p}=e,[c,d]=Vi.useState(false);return jsxRuntime.jsx(react.DataViewProvider,{value:t,onSubmit:r,children:jsxRuntime.jsx(Yt,{alwaysExpanded:true,header:()=>jsxRuntime.jsxs(reactNative.View,{style:R.dataViewHeader,children:[jsxRuntime.jsx(reactNative.Text,{style:R.dataViewTitle,children:l}),jsxRuntime.jsxs(reactNative.View,{style:R.dataViewActions,children:[n&&jsxRuntime.jsx(Xt,{onDelete:n,itemName:i??"item"}),r&&jsxRuntime.jsx(reactNative.TouchableOpacity,{onPress:()=>d(true),children:jsxRuntime.jsx(reactNative.Text,{children:"Edit"})}),o&&jsxRuntime.jsx(reactNative.TouchableOpacity,{onPress:o,children:jsxRuntime.jsx(reactNative.Text,{children:"Close"})})]})]}),children:c&&r?jsxRuntime.jsx(qd,{storagePath:a,field:e,value:t,onSubmit:r,onBack:()=>d(false)}):jsxRuntime.jsx(reactNative.View,{style:R.dataViewContent,children:Object.entries(p).map(([u,f])=>jsxRuntime.jsx(qr,{storagePath:a?`${a}/${u}`:void 0,path:s?`${s}.${u}`:u,field:f,value:t?.[u]},u))})})})},Xr=({onSubmit:e,onBack:t,field:o,value:n,buttonText:r="SUBMIT",renderFooter:i,storagePath:a})=>{let s=Vi.useMemo(()=>({field:o,value:n,onSubmit:e,storagePath:a}),[o,n,e,a]),{submit:l,uploads:p,isLoading:c}=react.useSubmitData(s),d=react.useFormSubmit(o,l);return jsxRuntime.jsxs(reactNative.View,{style:R.container,children:[jsxRuntime.jsx(Lo,{name:"",field:o}),jsxRuntime.jsx(Mr,{isLoading:c,uploads:p,onSubmit:d,renderFooter:i,onBack:t,buttonText:r})]})},Kd=({onSubmit:e,field:t,value:o,...n})=>{let r=Vi.useMemo(()=>({children:{value:t}}),[t]);return jsxRuntime.jsx(Xr,{field:r,value:{value:o},onSubmit:i=>e(i),...n})},qd=({field:e,...t})=>{let o=core.isField(e)||core.isListField(e)?jsxRuntime.jsx(Kd,{field:e,...t}):jsxRuntime.jsx(Xr,{field:e,...t});return jsxRuntime.jsx(react.ChempoFormProvider,{children:o})};var ru=()=>{let{colorMode:e,toggleColorMode:t}=react.useTheme(),o=e==="dark",n=react.useIconColor(),r=o?"moon":"sunny",i=react.useBackgroundColor(100);return jsxRuntime.jsx(reactNative.TouchableOpacity,{onPress:t,style:[Qr.button,{backgroundColor:i}],children:jsxRuntime.jsx(vectorIcons.Ionicons,{name:r,size:16,color:n})})},vw=()=>jsxRuntime.jsx(reactNative.View,{style:Qr.container,children:jsxRuntime.jsx(ru,{})}),Qr=reactNative.StyleSheet.create({container:{position:"absolute",bottom:12,right:12},button:{width:25,height:25,borderRadius:16,justifyContent:"center",alignItems:"center"}});var ti={closeMessage:()=>reactNativeNotifier.Notifier.hideNotification(),showMessage:({title:e,type:t,duration:o,message:n})=>{let r=t==="info"?reactNativeNotifier.NotifierComponents.Notification:reactNativeNotifier.NotifierComponents.Alert,i={alertType:t==="error"?"error":"success"};return reactNativeNotifier.Notifier.showNotification({title:e,description:n,duration:o,Component:r,componentProps:i}),"root"}};var oi=e=>{let{initialColorMode:t,theme:o}=e??{},[n,r]=Vi.useState(t??"light");return Vi.useMemo(()=>({colorMode:n,setColorMode:r,theme:o}),[n,r,o])};var ri=()=>{let e=()=>{let{width:o,height:n}=reactNative.Dimensions.get("window");react.useScreen.setState({width:o,height:n,isMobile:true,isPortrait:o<n});};e();let t=reactNative.Dimensions.addEventListener("change",e);return ()=>{t.remove();}};reactNativePaperDates.registerTranslation("en",reactNativePaperDates.en);var Yw=({theme:e,initialColorMode:t,...o})=>{let n=Vi.useMemo(()=>({theme:e,initialColorMode:t}),[e,t]),r=oi(n);return jsxRuntime.jsx(react.ChempoProvider,{toast:ti,theme:r,initializeScreen:ri,...o})};exports.AbsoluteDarkModeToggle=vw;exports.AnimatedCenter=at;exports.Center=ue;exports.ChempoNativeProvider=Yw;exports.CircularProgress=In;exports.CollapseHorizontal=Iu;exports.ContentBox=Ou;exports.DarkModeToggle=ru;exports.DataView=Jd;exports.DeleteButton=Xt;exports.DeleteConfirmAlert=Ei;exports.DropShadow=jt;exports.Editable=Kr;exports.ExpandOnMount=np;exports.Expandable=Yt;exports.FieldForm=Kd;exports.FieldMapForm=Xr;exports.FileView=vt;exports.Form=qd;exports.FormElement=Lo;exports.FullSizeContainer=dp;exports.FullSizeProvider=up;exports.ImageViewOverlay=An;exports.ListFieldInput=Yd;exports.Loading=oo;exports.LoadingButton=kp;exports.LoadingImage=Bn;exports.LoadingLogo=ge;exports.LoadingOverlay=mt;exports.LoadingSwitch=Ym;exports.LottieLoadingLogo=fn;exports.MediaFeed=Hf;exports.StandaloneInput=Gr;exports.Toggle=Wp;exports.Txt=G;exports.initializeScreen=ri;exports.nativeToast=ti;exports.useFullSize=pp;exports.useMediaFeed=na;exports.useThemeState=oi;//# sourceMappingURL=index.js.map
1
+ 'use strict';var Vi=require('react'),reactNative=require('react-native'),jsxRuntime=require('react/jsx-runtime'),react=require('@chem-po/react'),vectorIcons=require('@expo/vector-icons'),ro=require('react-native-toast-message'),reactNativeGestureHandler=require('react-native-gesture-handler'),aa=require('lottie-react-native'),qa=require('@expo/vector-icons/MaterialCommunityIcons'),core=require('@chem-po/core'),reactHookForm=require('react-hook-form'),Cl=require('@react-native-community/slider'),reactNativePaper=require('react-native-paper'),reactNativePaperDates=require('react-native-paper-dates'),dr=require('expo-document-picker'),ur=require('expo-image-picker'),reactNativeNotifier=require('react-native-notifier');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var Vi__default=/*#__PURE__*/_interopDefault(Vi);var ro__default=/*#__PURE__*/_interopDefault(ro);var aa__default=/*#__PURE__*/_interopDefault(aa);var qa__default=/*#__PURE__*/_interopDefault(qa);var Cl__default=/*#__PURE__*/_interopDefault(Cl);var dr__namespace=/*#__PURE__*/_interopNamespace(dr);var ur__namespace=/*#__PURE__*/_interopNamespace(ur);var ue=Vi.forwardRef(({style:e,...t},o)=>jsxRuntime.jsx(reactNative.View,{ref:o,style:[Wo.center,e],...t})),at=Vi.forwardRef(({style:e,...t},o)=>jsxRuntime.jsx(reactNative.Animated.View,{ref:o,style:[Wo.center,e],...t})),Wo=reactNative.StyleSheet.create({center:{flex:1,justifyContent:"center",alignItems:"center"}});var Iu=({width:e,children:t,active:o,duration:n=400,style:r,...i})=>{let a=Vi.useRef(new reactNative.Animated.Value(o?e:0)).current,s=Vi.useRef(new reactNative.Animated.Value(o?1:0)).current;Vi.useEffect(()=>{reactNative.Animated.parallel([reactNative.Animated.timing(a,{toValue:o?e:0,duration:n,useNativeDriver:false}),reactNative.Animated.timing(s,{toValue:o?1:0,duration:n,useNativeDriver:true})]).start();},[o,a,s,e,n]);let l=Vi.useMemo(()=>({width:a,opacity:s,overflow:"hidden"}),[a,s]);return jsxRuntime.jsx(at,{style:[l,r],...i,children:t})};var fi=(e,t)=>jsxRuntime.jsx(reactNative.View,{ref:t,style:[gi.container,e.style],...e}),gi=reactNative.StyleSheet.create({container:{backgroundColor:"#FFFFFF",padding:12,borderRadius:6,shadowColor:"#000000",shadowOffset:{width:1,height:1},shadowOpacity:.4,shadowRadius:4,elevation:4}}),Ou=Vi.forwardRef(fi);var jt=({children:e,style:t})=>jsxRuntime.jsx(reactNative.View,{style:[{...reactNative.Platform.select({ios:{shadowColor:"#000",shadowOffset:{width:0,height:2},shadowOpacity:.25,shadowRadius:3.84},android:{elevation:5}})},t],children:e});var G=({children:e,...t})=>{let o=react.useTextColor();return jsxRuntime.jsx(reactNative.Text,{...t,style:[{color:o},t.style],children:e})};var Yt=({header:e,children:t,initExpanded:o=false,nested:n,alwaysExpanded:r,iconColor:i="#000",footer:a,isOpen:s,onClose:l,onOpen:p,style:c})=>{let[d,u]=Vi__default.default.useState(r??o),f=Vi.useRef(new reactNative.Animated.Value(0)).current,h=Vi.useRef(new reactNative.Animated.Value(0)).current;Vi.useEffect(()=>{typeof s<"u"&&u(s);},[s]);let m=Vi.useCallback(()=>{u(false),l?.();},[l]),g=Vi.useCallback(()=>{u(true),p?.();},[p]),y=Vi.useCallback(()=>{r||(d?m():g());},[r,g,m,d]);Vi.useEffect(()=>{reactNative.Animated.parallel([reactNative.Animated.timing(f,{toValue:d?1:0,duration:300,useNativeDriver:false}),reactNative.Animated.timing(h,{toValue:d?1:0,duration:300,useNativeDriver:true})]).start();},[d,f,h]);let V=h.interpolate({inputRange:[0,1],outputRange:["0deg","180deg"]});return jsxRuntime.jsxs(reactNative.View,{style:[pe.container,c],children:[jsxRuntime.jsxs(reactNative.Pressable,{onPress:y,style:pe.header,children:[jsxRuntime.jsx(reactNative.View,{style:pe.headerContent,children:typeof e=="string"?jsxRuntime.jsx(G,{style:pe.headerText,children:e}):e({isOpen:d,onClose:m})}),!r&&jsxRuntime.jsx(reactNative.Animated.Text,{style:[pe.arrow,{transform:[{rotate:V}],color:i}],children:"\u25BC"})]}),jsxRuntime.jsx(at,{style:[pe.content,n&&pe.nested,{maxHeight:f.interpolate({inputRange:[0,1],outputRange:[0,1e3]})}],children:t}),a?.({isOpen:d,onClose:m})]})},pe=reactNative.StyleSheet.create({container:{width:"100%"},header:{flexDirection:"row",padding:8,alignItems:"center"},headerContent:{flex:1},headerText:{fontWeight:"600",color:"#666"},arrow:{fontSize:12,marginLeft:8},content:{width:"100%",overflow:"hidden"},nested:{borderLeftWidth:4,borderLeftColor:"rgba(0,0,0,0.2)"}});var np=({animateOpacity:e,duration:t=300,children:o,in:n=true,onExited:r,style:i,...a})=>{let[s,l]=Vi.useState(false);Vi.useEffect(()=>{l(true);},[]);let[p,c]=Vi.useState(0),d=Vi.useRef(null),u=Vi.useMemo(()=>s&&n,[n,s]),f=Vi.useRef(new reactNative.Animated.Value(0)).current,h=Vi.useRef(new reactNative.Animated.Value(0)).current;return Vi.useEffect(()=>{d.current&&d.current.measure((m,g,y,V)=>{c(V);});},[o]),Vi.useEffect(()=>{let m=[reactNative.Animated.timing(f,{toValue:u?p:0,duration:t,useNativeDriver:false})];e&&m.push(reactNative.Animated.timing(h,{toValue:u?1:0,duration:t,delay:u?t:0,useNativeDriver:true})),reactNative.Animated.parallel(m).start(()=>{!u&&r&&r();});},[u,p,t,f,h,e,r]),jsxRuntime.jsx(reactNative.Animated.View,{style:[{overflow:"hidden",width:"100%",height:f},i],...a,children:jsxRuntime.jsx(reactNative.View,{ref:d,style:[{width:"100%"},e&&{opacity:h},i],...a,children:o})})};var dp=({children:e,...t})=>{let[o,n]=Vi.useState(0),[r,i]=Vi.useState(0),a=Vi.useRef(null),s=Vi.useCallback(l=>{let{width:p,height:c}=l.nativeEvent.layout;n(p),i(c);},[]);return jsxRuntime.jsx(reactNative.View,{ref:a,...t,style:[{width:"100%",height:"100%"},t.style],onLayout:s,children:e({width:o,height:r})})},Zo=Vi.createContext({width:0,height:0}),up=({children:e,...t})=>{let[o,n]=Vi.useState(0),[r,i]=Vi.useState(0),a=Vi.useRef(null),s=Vi.useCallback(p=>{let{width:c,height:d}=p.nativeEvent.layout;n(c),i(d);},[]),l=Vi.useMemo(()=>({width:o,height:r}),[o,r]);return jsxRuntime.jsx(reactNative.View,{ref:a,...t,style:[{width:"100%",height:"100%"},t.style],onLayout:s,children:jsxRuntime.jsx(Zo.Provider,{value:l,children:e})})},pp=()=>Vi.useContext(Zo);var Bi="Are you sure? You can't undo this action afterwards.",Ei=({confirmActive:e,onCancel:t,onConfirm:o,body:n=Bi,actionName:r="Delete",actionLoading:i,itemName:a})=>jsxRuntime.jsx(reactNative.Modal,{transparent:true,visible:e,onRequestClose:t,animationType:"fade",children:jsxRuntime.jsx(reactNative.View,{style:O.overlay,children:jsxRuntime.jsxs(reactNative.View,{style:O.alertContainer,children:[jsxRuntime.jsxs(G,{style:O.alertTitle,children:[r," ",a,"?"]}),typeof n=="string"?jsxRuntime.jsx(G,{style:O.alertBody,children:n}):n,jsxRuntime.jsxs(reactNative.View,{style:O.buttonContainer,children:[jsxRuntime.jsx(reactNative.TouchableOpacity,{style:O.cancelButton,onPress:t,children:jsxRuntime.jsx(G,{style:O.cancelText,children:"Cancel"})}),jsxRuntime.jsx(reactNative.TouchableOpacity,{style:O.confirmButton,onPress:o,disabled:i,children:i?jsxRuntime.jsx(reactNative.ActivityIndicator,{color:"#fff"}):jsxRuntime.jsx(G,{style:[O.buttonText,O.confirmButtonText],children:r})})]})]})})}),Xt=({onDelete:e,itemName:t,noConfirm:o,alertBody:n,text:r,actionName:i="Delete",style:a})=>{let[s,l]=Vi.useState(false),[p,c]=Vi.useState(false),d=Vi.useRef(),u=Vi.useRef(true),f=Vi.useRef(new reactNative.Animated.Value(1)).current,h=Vi.useRef(new reactNative.Animated.Value(0)).current;Vi.useEffect(()=>(u.current=true,()=>{u.current=false;}),[]);let m=Vi.useCallback(y=>{reactNative.Animated.parallel([reactNative.Animated.timing(f,{toValue:y?0:1,duration:200,useNativeDriver:true}),reactNative.Animated.timing(h,{toValue:y?1:0,duration:200,useNativeDriver:true})]).start();},[f,h]),g=Vi.useCallback(async()=>{if(d.current&&clearTimeout(d.current),c(false),e){l(true),m(true);try{await e();}catch(y){console.error(y),ro__default.default.show({text1:y.message??"An error occurred",type:"error"});}u.current&&(l(false),m(false));}else console.error("No delete function");},[e,m]);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[r?jsxRuntime.jsx(reactNative.TouchableOpacity,{style:[O.button,a],onPress:y=>{y.stopPropagation(),o?g():c(true);},disabled:s,children:jsxRuntime.jsxs(reactNative.View,{style:O.buttonContent,children:[jsxRuntime.jsxs(reactNative.Animated.View,{style:[O.contentContainer,{opacity:f}],children:[jsxRuntime.jsx(vectorIcons.Ionicons,{name:"trash",size:20,color:"red"}),jsxRuntime.jsx(reactNative.Text,{style:O.buttonText,children:r})]}),jsxRuntime.jsx(reactNative.Animated.View,{style:[O.loaderContainer,{opacity:h}],children:jsxRuntime.jsx(reactNative.ActivityIndicator,{color:"#ff0000",size:"small"})})]})}):jsxRuntime.jsx(reactNative.TouchableOpacity,{style:[O.iconButton,a],onPress:y=>{y.stopPropagation(),o?g():c(true);},disabled:s,children:jsxRuntime.jsxs(reactNative.View,{style:O.buttonContent,children:[jsxRuntime.jsx(reactNative.Animated.View,{style:[O.contentContainer,{opacity:f}],children:jsxRuntime.jsx(vectorIcons.Ionicons,{name:"trash",size:24,color:"#ee0000"})}),jsxRuntime.jsx(reactNative.Animated.View,{style:[O.loaderContainer,{opacity:h}],children:jsxRuntime.jsx(reactNative.ActivityIndicator,{color:"#ff0000",size:"small"})})]})}),o?null:jsxRuntime.jsx(Ei,{confirmActive:p,onCancel:()=>c(false),actionLoading:s,onConfirm:()=>{g();},actionName:i,body:n,itemName:t})]})},O=reactNative.StyleSheet.create({overlay:{flex:1,justifyContent:"center",alignItems:"center",backgroundColor:"rgba(0, 0, 0, 0.5)"},alertContainer:{width:"80%",maxWidth:400,backgroundColor:"white",borderRadius:10,padding:20,alignItems:"center"},alertTitle:{fontSize:18,fontWeight:"bold",marginBottom:10},alertBody:{fontSize:16,marginBottom:20},buttonContainer:{flexDirection:"row",justifyContent:"space-between",width:"100%"},cancelButton:{padding:10,borderColor:"gray",borderWidth:1,borderRadius:5,flex:1,marginRight:5,alignItems:"center"},cancelText:{color:"gray",fontWeight:"bold"},confirmButton:{padding:10,backgroundColor:"red",borderRadius:5,flex:1,marginLeft:5,alignItems:"center"},buttonText:{color:"red",fontWeight:"bold"},confirmButtonText:{color:"white",textShadowColor:"rgba(0, 0, 0, 0.5)",textShadowOffset:{width:1,height:1},textShadowRadius:3},button:{flexDirection:"row",alignItems:"center",padding:10,backgroundColor:"transparent"},buttonContent:{flexDirection:"row",gap:3,borderWidth:1,borderColor:"red",paddingHorizontal:13,paddingVertical:5,borderRadius:4,alignItems:"center",justifyContent:"center",minHeight:34,position:"relative"},contentContainer:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:3},loaderContainer:{...reactNative.StyleSheet.absoluteFillObject,alignItems:"center",justifyContent:"center"},iconButton:{padding:10,backgroundColor:"transparent"},loading:{position:"absolute",top:0,left:0,justifyContent:"center",alignItems:"center",height:24,width:24}});var Mp=({onPress:e,children:t,style:o,textStyle:n,color:r,icon:i,disabled:a=false})=>{let[s,l]=Vi.useState(false),p=Vi.useRef(true),c=Vi.useRef(new reactNative.Animated.Value(1)).current,d=Vi.useRef(new reactNative.Animated.Value(0)).current;Vi.useEffect(()=>(p.current=true,()=>{p.current=false;}),[]);let u=Vi.useCallback(g=>{reactNative.Animated.parallel([reactNative.Animated.timing(c,{toValue:g?0:1,duration:200,useNativeDriver:true}),reactNative.Animated.timing(d,{toValue:g?1:0,duration:200,useNativeDriver:true})]).start();},[c,d]),f=Vi.useCallback(async()=>{if(e){l(true),u(true);try{await e();}catch(g){console.error(g),ro__default.default.show({text1:g.message??"An error occurred",type:"error"});}p.current&&(l(false),u(false));}},[e,u]),h=react.useTextColor(),m=Vi.useMemo(()=>r??h,[r,h]);return jsxRuntime.jsx(reactNative.TouchableOpacity,{style:[Ne.button,{borderColor:m,backgroundColor:a?"#f0f0f0":"transparent"},o],onPress:g=>{g.stopPropagation(),f();},disabled:s||a,children:jsxRuntime.jsxs(reactNative.View,{style:[Ne.buttonContent,{borderColor:a?"#ccc":m}],children:[jsxRuntime.jsxs(reactNative.Animated.View,{style:[Ne.contentContainer,{opacity:c}],children:[i&&jsxRuntime.jsx(vectorIcons.Ionicons,{name:i.name,size:i.size??20,color:a?"#ccc":m}),typeof t=="string"?jsxRuntime.jsx(reactNative.Text,{style:[Ne.buttonText,{color:a?"#ccc":m},n],children:t}):t]}),jsxRuntime.jsx(reactNative.Animated.View,{style:[Ne.loaderContainer,{opacity:d}],children:jsxRuntime.jsx(reactNative.ActivityIndicator,{color:m,size:"small"})})]})})},Ne=reactNative.StyleSheet.create({button:{flexDirection:"row",alignItems:"center",backgroundColor:"transparent"},buttonContent:{flexDirection:"row",gap:8,borderWidth:1,paddingHorizontal:16,paddingVertical:8,borderRadius:4,alignItems:"center",justifyContent:"center",minHeight:40,position:"relative"},contentContainer:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:8},loaderContainer:{...reactNative.StyleSheet.absoluteFillObject,alignItems:"center",justifyContent:"center"},buttonText:{fontWeight:"bold"}});var Zi=({selected:e,option:{Render:t,disabledMessage:o},size:n,onPress:r})=>{let i=Vi.useCallback(()=>{o?ro__default.default.show({type:"error",text1:o}):r();},[r,o]);return jsxRuntime.jsx(reactNative.View,{style:[Zt.buttonContainer,{width:n,height:n,opacity:o?.6:1}],children:jsxRuntime.jsx(reactNative.TouchableOpacity,{style:[Zt.button,{backgroundColor:e?"rgba(255, 255, 255, 0.5)":"rgba(0, 0, 0, 0.1)",pointerEvents:e?"none":"auto"}],onPress:i,disabled:!!o,children:t(e)})})},Up=({value:e,onChange:t,size:o=28,options:n})=>{let{theme:{colors:{background:r}}}=react.useTheme();return jsxRuntime.jsx(reactNative.View,{style:[Zt.container,{borderColor:r[300]}],children:n.map(i=>jsxRuntime.jsx(Zi,{onPress:()=>{t(i.id);},option:i,size:o,selected:i.id===e},i.id))})},Zt=reactNative.StyleSheet.create({container:{flexDirection:"row",borderWidth:1,borderRadius:3},buttonContainer:{justifyContent:"center",alignItems:"center"},button:{justifyContent:"center",alignItems:"center",borderRadius:3}});var cn=Vi.createContext({}),dn=({curr:e,children:t})=>{let o=Vi.useMemo(()=>({curr:e}),[e]);return jsxRuntime.jsx(cn.Provider,{value:o,children:t})},na=()=>Vi.useContext(cn);var un={top:0,left:0,right:0,bottom:0,display:"flex"},ae=reactNative.StyleSheet.create({absolute:{...un,position:"absolute"},relative:{...un,position:"relative"}});var fn=({size:e=30,isLoading:t,speed:o=2,inFeed:n,asset:r})=>{let{colorMode:i}=react.useTheme(),a=Vi.useMemo(()=>n||i==="dark"?r.dark??r.default:r.default,[r,n,i]),s=Vi.useMemo(()=>({width:e,height:e,opacity:t?.85:0}),[e,t]);return jsxRuntime.jsx(aa__default.default,{source:a,autoPlay:t,loop:true,speed:o,style:s})},gn=({size:e=30,isLoading:t,asset:o,inFeed:n})=>{let{colorMode:r}=react.useTheme(),i=Vi.useMemo(()=>n||r==="dark"?o.dark??o.default:o.default,[o,n,r]),a=Vi.useMemo(()=>({width:e,height:e,opacity:t?.85:0}),[e,t]);return jsxRuntime.jsx(reactNative.Image,{source:{uri:i},style:a})},ca=({isLoading:e,size:t})=>{let{loading:o}=react.useAppAssets();return o.lottieJson?jsxRuntime.jsx(fn,{isLoading:e,size:t,asset:o.lottieJson}):o.svg?jsxRuntime.jsx(gn,{isLoading:e,size:t,asset:o.svg}):null},ge=({isLoading:e,size:t,inFeed:o})=>{let{loading:n}=react.useAppAssets();return n.lottieJson?jsxRuntime.jsx(fn,{inFeed:o,isLoading:e,size:t,asset:n.lottieJson}):n.svg?jsxRuntime.jsx(gn,{inFeed:o,isLoading:e,size:t,asset:n.svg}):jsxRuntime.jsx(reactNative.Text,{style:Ue.errorText,children:"ERROR: No loading animation found"})},oo=({text:e="Loading...",inBox:t,containerStyle:o})=>{let n=jsxRuntime.jsxs(reactNative.View,{style:[Ue.loadingContainer,o],children:[jsxRuntime.jsx(ca,{isLoading:true}),jsxRuntime.jsx(reactNative.Text,{style:Ue.loadingText,children:e})]});return t?jsxRuntime.jsx(reactNative.View,{style:Ue.boxContainer,children:n}):n},mt=({isLoading:e,text:t,inFeed:o,style:n})=>{let{colorMode:r}=react.useTheme(),i=r==="dark"?"rgba(0, 0, 0, 0.53)":"rgba(255, 255, 255, 0.67)";return jsxRuntime.jsx(reactNative.View,{style:[Ue.overlay,{backgroundColor:i},{opacity:e?1:0},n],children:t?jsxRuntime.jsx(oo,{text:t}):jsxRuntime.jsx(ge,{inFeed:o,size:100,isLoading:e})})},Ue=reactNative.StyleSheet.create({loadingContainer:{flexDirection:"row",alignItems:"center",padding:8},loadingText:{opacity:.8,fontSize:14,marginLeft:8},boxContainer:{padding:16,borderRadius:8,backgroundColor:"rgba(0, 0, 0, 0.05)"},overlay:{position:"absolute",top:0,left:0,right:0,bottom:0,justifyContent:"center",alignItems:"center"},errorText:{color:"red"}});var fa=e=>e==="current"?1:0,wn=(e,t)=>{let{height:o}=t;return e==="current"?0:e==="next"?o*1.1:e==="prev"?-o*1.1:0},bn=({id:e,collectionPath:t,onItemLoad:o,RenderItem:n,status:r,offsetY:i,enterStatus:a})=>{let{height:s,width:l}=react.useScreen(),p=Vi.useMemo(()=>({height:s,width:l}),[s,l]),c=Vi.useRef(new reactNative.Animated.Value(0)).current,d=Vi.useRef(new reactNative.Animated.Value(wn(a??"next",p))).current,u=reactNative.Animated.add(d,i),f=Vi.useMemo(()=>`${t}/${e}`,[t,e]),{data:h}=react.useDocument(f,o);return Vi.useEffect(()=>{let m=fa(r),g=wn(r,p);d.setValue(g),c.setValue(m);},[r,d,c,p]),jsxRuntime.jsx(reactNative.Animated.View,{style:{position:"absolute",top:0,left:0,transform:[{translateY:u},{scale:c}],display:"flex",alignItems:"center",justifyContent:"center",height:"100%",opacity:c,width:"100%"},children:h?n(h):null})};var wa=10,xn=(e,t,o=wa,n=false)=>{let[r,i]=Vi.useState([null,null,null]),[a,s]=Vi.useState(0),l=react.useAuth(x=>x.user),[p,c]=Vi.useState(false),[d,u]=Vi.useState(false),[f,h]=Vi.useState(null),[m,g]=Vi.useState(false),[y,V]=Vi.useState(null),S=Vi.useRef(null),b=Vi.useRef({prev:null,curr:null,next:null}),v=Vi.useCallback(x=>{x&&(b.current.prev===x&&(b.current.prev=null),b.current.next===x&&(b.current.next=null)),b.current.curr=x,t({...b.current});},[t]),T=Vi.useCallback(x=>{x&&(b.current.prev===x&&(b.current.prev=null),b.current.curr===x&&(b.current.curr=null)),b.current.next=x,t({...b.current});},[t]),D=Vi.useCallback(x=>{x&&(b.current.curr===x&&(b.current.curr=null),b.current.next===x&&(b.current.next=null)),b.current.prev=x,t({...b.current});},[t]),k=Vi.useCallback(async(x,M,B)=>{if(!l&&n)return [];B||c(true);try{let C=await e({limit:o,startAfter:M,startBefore:x});if(B)M?i(P=>[P[0],P[1],C.ids]):x&&i(P=>[C.ids,P[1],P[2]]);else {let P=C.ids[0],re=C.ids[1]||null;v(P),T(re),D(M),i(M?j=>[j[1],C.ids,null]:x?j=>[null,C.ids,j[1]]:[null,C.ids,null]);let F=C.ids[C.ids.length-1];F&&k(null,F,!0);}return c(!1),C.ids||[]}catch(C){h(C.message),ro__default.default.show({text1:"Error fetching feed",text2:C.message,type:"error",visibilityTime:5e3});}return c(false),[]},[e,l,n,v,T,D,o]),_=Vi.useCallback(async(x,M)=>{let B=r[1]??[],C=r[2]??[],P=x+1;if(P<B.length)return {id:B[P],idx:P};if(C[0]){let j=C[C.length-1];return M||(i(ie=>[ie[1],ie[2],null]),k(null,j,true)),{id:C[0],idx:0}}let F=(await k(null,B[B.length-1],M))[0];return F?{id:F,idx:0}:null},[r,k]),H=Vi.useCallback(async(x,M)=>{let B=r[1]??[],C=r[0]??[],P=x-1;if(P>=0)return {id:B[P],idx:P};if(C[C.length-1]){let j=C[0];return M||(i([null,r[0],r[1]]),k(j,null,true)),{id:C[C.length-1],idx:C.length-1}}let re=await k(B[0],null,M),F=re[re.length-1];return F?{id:F,idx:re.length-1}:null},[r,k]),I=Vi.useCallback(async()=>{if(m)return;let x=b.current.curr;g(true);let M=await _(a,false);if(V("next"),M){let{id:B,idx:C}=M;S.current=B,s(C),v(B),T(null),D(x),_(C,true).then(P=>T(P?.id??null));}else ro__default.default.show({text1:"No more items",type:"info",visibilityTime:3e3});g(false);},[a,_,v,T,D,m]),E=Vi.useCallback(async()=>{if(m)return;let x=b.current.curr;V("prev"),g(true);let M=await H(a,false);if(M){let{id:B,idx:C}=M;S.current=B,s(C),v(B),D(null),T(x),H(C,true).then(P=>D(P?.id??null));}else ro__default.default.show({text1:"No more items",type:"info",visibilityTime:3e3});g(false);},[a,H,v,T,D,m]),L=Vi.useCallback(async()=>{c(true),u(true),i([null,null,null]),v(null),T(null),D(null),V(null),s(0),await k(null,null,false),u(false);},[k,v,T,D]),[q]=Vi.useState(()=>k);Vi.useEffect(()=>{q(null,null,false);},[q]);let Se=Vi.useMemo(()=>a>0&&!!r[1]?.length||!!r[0]?.length,[r,a]),Ve=Vi.useMemo(()=>(r[1]&&a<r[1].length)??!!r[2]?.length,[r,a]);return Vi.useMemo(()=>({ids:r,goNext:I,goPrev:E,error:f,refresh:L,refreshing:d,loading:p,canGoNext:Ve,direction:y,canGoPrev:Se,itemLoading:m}),[r,I,E,p,f,m,Ve,Se,L,d,y])};var In=({color:e,trackColor:t,animating:o,visible:n=true,viewStyle:r,...i})=>{let a=react.useColorModeValue("#959595","#575757"),s=Vi.useRef(new reactNative.Animated.Value(n?1:0)).current;return Vi.useEffect(()=>{reactNative.Animated.timing(s,{toValue:n?1:0,duration:300,useNativeDriver:true}).start();},[n,s]),jsxRuntime.jsxs(reactNative.Animated.View,{style:[Sa.container,{opacity:s},r],children:[jsxRuntime.jsx(reactNative.ActivityIndicator,{color:t??a,style:reactNative.StyleSheet.absoluteFill,animating:false,...i}),jsxRuntime.jsx(reactNative.ActivityIndicator,{animating:o,color:e??"#575757",...i})]})},Sa=reactNative.StyleSheet.create({container:{alignItems:"center",justifyContent:"center"}});var An=({src:e,onClose:t})=>{let[o,n]=Vi.useState(true),r=react.useScreen(u=>u.width),i=react.useScreen(u=>u.height),[a,s]=Vi.useState({width:r/2,height:i/2}),{height:l,width:p}=Vi.useMemo(()=>{if(o)return a;let u=a.width/a.height,f=Math.min(a.height,i*.9),h=f*u;return h>r*.9&&(h=Math.min(a.width,r*.9),f=h/u),{height:f,width:h}},[i,r,a,o]),c=Vi.useCallback(()=>n(true),[]),d=Vi.useCallback(u=>{let{width:f,height:h}=u.nativeEvent.source;s({width:f,height:h}),n(false);},[]);return jsxRuntime.jsx(reactNative.Modal,{visible:true,transparent:true,animationType:"fade",onRequestClose:t,children:jsxRuntime.jsx(reactNative.View,{style:Pe.modalOverlay,children:jsxRuntime.jsxs(reactNative.View,{style:Pe.contentContainer,children:[jsxRuntime.jsx(reactNative.View,{style:[Pe.imageContainer,{width:p,height:l,opacity:o?0:1}],children:jsxRuntime.jsx(reactNative.Image,{source:{uri:e},style:Pe.image,onLoadStart:c,onLoad:d,resizeMode:"contain"})}),jsxRuntime.jsx(reactNative.TouchableOpacity,{style:Pe.closeButton,onPress:t,children:jsxRuntime.jsx(vectorIcons.Ionicons,{name:"close",size:24,color:"white"})}),o&&jsxRuntime.jsx(reactNative.View,{style:Pe.loadingContainer,children:jsxRuntime.jsx(ge,{isLoading:o,size:70})})]})})})},Pe=reactNative.StyleSheet.create({modalOverlay:{flex:1,backgroundColor:"rgba(0, 0, 0, 0.7)"},contentContainer:{flex:1,justifyContent:"center",alignItems:"center",padding:16},imageContainer:{overflow:"hidden",borderRadius:4},image:{width:"100%",height:"100%"},closeButton:{position:"absolute",top:16,right:16,width:40,height:40,borderRadius:20,backgroundColor:"rgba(0, 0, 0, 0.5)",justifyContent:"center",alignItems:"center"},loadingContainer:{...reactNative.StyleSheet.absoluteFillObject,justifyContent:"center",alignItems:"center"}});var Mn="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkAAIAAAoAAv/lxKUAAAAASUVORK5CYII=",Bn=({src:e,loadingOverride:t,onLoad:o,width:n,height:r,noFullView:i,buttonFullView:a,style:s})=>{let[l,p]=Vi.useState(!!e),c=Vi.useRef(null),[d,u]=Vi.useState(false),f=react.useMounted(100),h=Vi.useCallback(S=>{o&&o(S);},[o]),[m,g]=Vi.useState(e);Vi.useEffect(()=>{e&&g(e);},[e,m]);let y=Vi.useMemo(()=>l||!!t,[l,t]),V=jsxRuntime.jsx(reactNative.Image,{ref:c,source:{uri:e??Mn},style:[ve.image,{opacity:e&&!y?1:0}],onLoadEnd:()=>p(false),onLoad:h,resizeMode:e?"cover":"contain"});return jsxRuntime.jsxs(reactNative.View,{style:[ve.container,{width:n??"100%",height:r??"100%",opacity:f?1:0},s],children:[i||a?V:jsxRuntime.jsx(reactNative.TouchableOpacity,{activeOpacity:.9,onPress:()=>u(true),style:ve.imageContainer,children:V}),a&&jsxRuntime.jsx(reactNative.TouchableOpacity,{style:ve.fullViewButton,onPress:()=>u(true),activeOpacity:.7,children:jsxRuntime.jsx(vectorIcons.Ionicons,{name:"expand",size:20,color:"white",style:ve.fullViewIcon})}),jsxRuntime.jsx(reactNative.View,{style:[ve.loadingContainer,{opacity:y?1:0}],children:jsxRuntime.jsx(ge,{isLoading:y,size:10})}),d&&jsxRuntime.jsx(An,{src:e??Mn,onClose:()=>u(false)})]})},ve=reactNative.StyleSheet.create({container:{overflow:"hidden",position:"relative"},imageContainer:{width:"100%",height:"100%"},image:{width:"100%",height:"100%"},loadingContainer:{...reactNative.StyleSheet.absoluteFillObject,justifyContent:"center",alignItems:"center"},fullViewButton:{position:"absolute",top:8,right:8,width:28,height:28,borderRadius:14,backgroundColor:"rgba(0, 0, 0, 0.5)",justifyContent:"center",alignItems:"center"},fullViewIcon:{opacity:.8}});var _m=({value:e,label:t,onChange:o})=>{let[n,r]=Vi.useState(false),i=Vi.useState(new reactNative.Animated.Value(1))[0],a=Vi.useCallback(l=>{let p=Math.max(0,1e3-(Date.now()-l));setTimeout(()=>{r(false),reactNative.Animated.timing(i,{toValue:1,duration:300,useNativeDriver:true}).start();},p);},[i]),s=l=>{r(true),reactNative.Animated.timing(i,{toValue:0,duration:300,useNativeDriver:true}).start();let p=Date.now();o(l).catch(c=>{console.error(c);}),a(p);};return jsxRuntime.jsxs(reactNative.View,{style:yt.container,children:[jsxRuntime.jsxs(reactNative.Animated.View,{style:[yt.content,{opacity:i}],children:[jsxRuntime.jsx(reactNative.Text,{style:yt.label,children:t}),jsxRuntime.jsx(reactNative.Switch,{value:e,onValueChange:s})]}),n&&jsxRuntime.jsx(reactNative.View,{style:yt.loadingContainer,children:jsxRuntime.jsx(oo,{})})]})},yt=reactNative.StyleSheet.create({container:{paddingVertical:4,paddingHorizontal:12,backgroundColor:"#2D3748",borderRadius:12,shadowColor:"#000",shadowOffset:{width:0,height:0},shadowOpacity:.25,shadowRadius:4,elevation:5,position:"relative",flexDirection:"row",alignItems:"center"},content:{flexDirection:"row",alignItems:"center",gap:8},label:{fontSize:20,height:24,color:"#FFFFFF"},loadingContainer:{position:"absolute",top:"-10%",left:"-10%",width:"120%",height:"120%",borderRadius:8,padding:4,justifyContent:"center",alignItems:"center"}});var Ya="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkAAIAAAoAAv/lxKUAAAAASUVORK5CYII=",_a=reactNative.StyleSheet.create({imageBackground:{flex:1,transform:[{scale:1.075}]}}),bt=({background:e,opacity:t=.7,style:o,...n})=>jsxRuntime.jsx(reactNative.View,{style:[ae.absolute,o],...n,children:jsxRuntime.jsx(reactNative.ImageBackground,{source:{uri:e??Ya},style:[_a.imageBackground,{opacity:t}],resizeMode:"cover"})}),Ja=({getBackgroundValue:e,item:t})=>{let o=Vi.useMemo(()=>t?e(t):null,[e,t]),{loading:n,url:r}=react.useObjectUrl(o),i=Vi.useRef(0),[a,s]=Vi.useState(0),[l,p]=Vi.useState(null),[c,d]=Vi.useState(null);return Vi.useEffect(()=>{i.current===0?(p(r),i.current=1,s(0)):(d(r),i.current=0,s(1));},[r]),jsxRuntime.jsxs(ue,{style:ae.absolute,children:[jsxRuntime.jsx(bt,{opacity:a===0?1:0,background:l}),jsxRuntime.jsx(bt,{opacity:a===1?1:0,background:c}),jsxRuntime.jsx(ge,{isLoading:n})]})},Ka=({getBackgroundUrl:e,item:t})=>{let o=Vi.useMemo(()=>t?e(t):null,[e,t]),n=Vi.useRef(0),[r,i]=Vi.useState(0),[a,s]=Vi.useState(null),[l,p]=Vi.useState(null);return Vi.useEffect(()=>{o&&(n.current===0?(s(o),n.current=1,i(0)):(p(o),n.current=0,i(1)));},[o]),jsxRuntime.jsxs(ue,{style:ae.absolute,children:[jsxRuntime.jsx(bt,{opacity:r===0?1:0,background:a}),jsxRuntime.jsx(bt,{opacity:r===1?1:0,background:l})]})},Un=({getBackgroundValue:e,getBackgroundUrl:t,...o})=>e?jsxRuntime.jsx(Ja,{getBackgroundValue:e,...o}):t?jsxRuntime.jsx(Ka,{getBackgroundUrl:t,...o}):null;var Za=25,_n=({offsetY:e,refreshing:t,canRefresh:o})=>{let n=Vi.useRef(new reactNative.Animated.Value(0)).current,r=Vi.useRef(new reactNative.Animated.Value(0)).current,i=reactNative.Animated.subtract(e,75),a=reactNative.Animated.divide(i,Za),s=reactNative.Animated.diffClamp(a,0,1);Vi.useEffect(()=>{reactNative.Animated.spring(n,{toValue:t?50:0,useNativeDriver:true}).start();},[t,n]),Vi.useEffect(()=>{reactNative.Animated.spring(r,{toValue:o?1:0,useNativeDriver:true}).start();},[o,r]);let l=s.interpolate({inputRange:[0,1],outputRange:[0,Math.sqrt(1)*20]}),c=reactNative.Animated.add(n,l).interpolate({inputRange:[0,20],outputRange:[0,20],extrapolate:"clamp"}),d=reactNative.Animated.multiply(r,c),u=d.interpolate({inputRange:[0,30],outputRange:[0,1],extrapolate:"clamp"}),f=reactNative.Animated.multiply(r,u),h=s.interpolate({inputRange:[0,1],outputRange:["0deg","180deg"]});return jsxRuntime.jsx(reactNative.Animated.View,{style:[Yn.container,{opacity:f,transform:[{translateY:d},{scale:f},{rotate:h}]}],children:jsxRuntime.jsxs(reactNative.View,{style:Yn.centerContainer,children:[jsxRuntime.jsx(jt,{style:[{opacity:t?0:1}],children:jsxRuntime.jsx(qa__default.default,{name:"refresh",size:32,color:"white"})}),jsxRuntime.jsx(jt,{style:{opacity:t?1:0},children:jsxRuntime.jsx(In,{animating:true,size:"large",color:"white"})})]})})},Yn=reactNative.StyleSheet.create({container:{position:"absolute",top:0,left:0,right:0,pointerEvents:"none"},centerContainer:{alignItems:"center",justifyContent:"center",width:"100%"}});var sl=e=>Vi.useCallback(t=>{let o=[];t.prev&&o.push({status:"prev",id:t.prev}),t.curr&&o.push({status:"current",id:t.curr}),t.next&&o.push({status:"next",id:t.next}),e(o);},[e]),Nf=({fetch:e,collection:t,RenderItem:o,authRequired:n,getBackgroundUrl:r,getBackgroundValue:i,limit:a,defaultBackground:s,swipeDisabled:l,children:p})=>{let{width:c,height:d}=react.useScreen(),{theme:u}=react.useTheme(),f=Vi.useRef(null),h=Vi.useRef(null),[m,g]=Vi.useState(null),[y,V]=Vi.useState([]),S=Vi.useRef(new reactNative.Animated.Value(0)).current,b=sl(V),v=Vi.useRef(null),{goNext:T,goPrev:D,loading:k,canGoNext:_,canGoPrev:H,refresh:I,refreshing:E}=xn(e,b,a,n),L=Vi.useRef(false),q=Vi.useRef({x:0,y:0}),Se=Vi.useCallback(F=>{l||(L.current=true,q.current={x:F.x,y:F.y});},[l]),Ve=Vi.useCallback(F=>{if(!L.current)return;let j=H?75:100,ie=_?-75:-100,Te=Math.max(ie,Math.min(j,F.y-q.current.y));_&&Te<-65?(g("next"),T()):H&&Te>65?(g("prev"),D()):(Te>90||Te<-90)&&(I(),v.current&&v.current.onNewData(null)),S.setValue(0),L.current=false;},[S,T,D,_,H,I]),x=Vi.useCallback(F=>{if(!L.current)return;let j=Math.max(-10,Math.min(10,F.x-q.current.x)),ie=H?75:100,Te=_?-75:-100,Ho=Math.max(Te,Math.min(ie,F.y-q.current.y));Math.sqrt(j**2+Ho**2)>10&&f.current,S.setValue(Ho);},[S,_,H]),M=reactNativeGestureHandler.Gesture.Pan().onStart(Se).onUpdate(x).onEnd(Ve),B=Vi.useMemo(()=>({height:`${d}px`,width:`${c}px`,overflow:"hidden",pointerEvents:l?"none":"auto"}),[c,d,l]),[C,P]=Vi.useState(null),re=Vi.useCallback(F=>{y.find(ie=>ie.status==="current")?.id===F?._id&&P(F);},[y]);return jsxRuntime.jsx(dn,{curr:C,children:jsxRuntime.jsx(reactNativeGestureHandler.GestureDetector,{gesture:M,children:jsxRuntime.jsxs(ue,{style:[cl.container,{backgroundColor:s??u.colors.background[100]}],children:[jsxRuntime.jsx(Un,{item:C,getBackgroundValue:i,getBackgroundUrl:r}),jsxRuntime.jsx("div",{ref:h,style:B,children:jsxRuntime.jsx(ue,{style:ae.relative,ref:f,children:y.map(F=>jsxRuntime.jsx(bn,{id:F.id,collectionPath:t,RenderItem:o,onItemLoad:re,status:F.status,enterStatus:m,offsetY:S},F.id))})}),jsxRuntime.jsx(_n,{canRefresh:!H,refreshing:E,offsetY:S}),jsxRuntime.jsx(mt,{inFeed:true,isLoading:k}),p?jsxRuntime.jsx(ue,{style:[ae.absolute,{zIndex:3}],children:p}):null]})})})},cl=reactNative.StyleSheet.create({container:{...ae.relative,overflow:"hidden"}});var Ct=({path:e,condition:t,children:o})=>{let n=reactHookForm.useWatch({exact:true,name:e});return Vi.useMemo(()=>t(n),[n,t])?jsxRuntime.jsx(reactNative.Animated.View,{style:{paddingVertical:3,opacity:1},children:o}):null};var gl=({field:e,input:{onChange:t,value:o,...n}},r)=>{let{placeholder:i}=e;return Vi.useImperativeHandle(r,()=>({focus:()=>{},blur:()=>{}})),jsxRuntime.jsxs(reactNative.View,{style:{flexDirection:"row",alignItems:"center"},children:[jsxRuntime.jsx(reactNative.Switch,{value:o,onValueChange:t,...n}),jsxRuntime.jsx(reactNative.Text,{style:{marginLeft:8,fontWeight:"600",opacity:o?.9:.6},children:i})]})},hl=Vi.forwardRef(gl),yl=({field:e,input:{onChange:t,value:o,...n}},r)=>{let{placeholder:i}=e;return Vi.useImperativeHandle(r,()=>({focus:()=>{},blur:()=>{}})),jsxRuntime.jsxs(reactNative.View,{style:{flexDirection:"row",alignItems:"center"},children:[jsxRuntime.jsx(reactNative.Switch,{value:o,onValueChange:t,...n}),jsxRuntime.jsx(reactNative.Text,{style:{marginLeft:8,fontWeight:"600",opacity:o?.9:.6},children:i})]})},wl=Vi.forwardRef(yl),bl=(e,t)=>e.field.type==="switch"?jsxRuntime.jsx(wl,{ref:t,...e}):jsxRuntime.jsx(hl,{ref:t,...e}),Qn=Vi.forwardRef(bl);var St=({label:e,gradient:t,value:o,minimumValue:n,maximumValue:r,...i})=>jsxRuntime.jsx(reactNative.View,{style:[we.container,{opacity:o!==void 0?1:.5}],children:jsxRuntime.jsxs(reactNative.View,{style:we.sliderContainer,children:[n!==void 0?jsxRuntime.jsx(reactNative.Text,{style:[we.label,t?we.gradientText:null],children:typeof n=="number"?n.toFixed((i?.step??1)<1?2:0):""}):null,jsxRuntime.jsx(Cl__default.default,{style:we.slider,minimumValue:n,maximumValue:r,step:1,...i}),r!==void 0?jsxRuntime.jsx(reactNative.Text,{style:[we.label,t?we.gradientText:null],children:typeof r=="number"?r.toFixed((i?.step??1)<1?2:0):""}):null]})}),we=reactNative.StyleSheet.create({container:{width:"100%",paddingVertical:8},sliderContainer:{flexDirection:"row",alignItems:"center",width:"100%"},slider:{flex:1,height:40},label:{fontSize:14,marginHorizontal:8},gradientText:{color:"#007AFF"}});var Vt=e=>{let t=Vi.useRef(null);return Vi.useImperativeHandle(e,()=>({focus:()=>{t.current?.focus();},blur:()=>{t.current?.blur();}}),[]),t};var It=({label:e,gradient:t,value:o,...n})=>jsxRuntime.jsx(St,{label:e,value:o,minimumValue:0,maximumValue:255,step:1,gradient:t,...n}),rr=Vi.forwardRef(({input:{onChange:e,value:t},field:o,meta:n},r)=>{let{withAlpha:i,defaultValue:a}=o,{active:s}=n||{};Vt(r);let l=Vi.useCallback((d,u)=>{e(i?{r:0,g:0,b:0,a:1,...t,[d]:u}:{r:0,g:0,b:0,...t,[d]:u});},[t,e,i]),p=Vi.useMemo(()=>({...a,...t}),[a,t]),c=Vi.useMemo(()=>core.colorValueToHex(!!i,p),[p,i]);return jsxRuntime.jsxs(reactNative.View,{style:Ge.container,children:[jsxRuntime.jsx(reactNative.View,{style:[Ge.colorPreview,{backgroundColor:c}],children:jsxRuntime.jsx(reactNative.Text,{style:Ge.hexText,children:c})}),jsxRuntime.jsxs(reactNative.View,{style:[Ge.slidersContainer,s&&Ge.activeContainer],children:[jsxRuntime.jsx(It,{label:"R",gradient:core.gradients.red,value:t?.r,onValueChange:d=>l("r",d)}),jsxRuntime.jsx(It,{label:"G",gradient:core.gradients.green,value:t?.g,onValueChange:d=>l("g",d)}),jsxRuntime.jsx(It,{label:"B",gradient:core.gradients.blue,value:t?.b,onValueChange:d=>l("b",d)}),i?jsxRuntime.jsx(It,{label:"A",gradient:core.gradients.midnight,value:t?.a,onValueChange:d=>l("a",d)}):null]})]})}),Ge=reactNative.StyleSheet.create({container:{width:"100%",flexDirection:"row",alignItems:"center",gap:8},colorPreview:{width:80,height:80,borderRadius:40,justifyContent:"center",alignItems:"center",shadowColor:"#000",shadowOffset:{width:0,height:2},shadowOpacity:.25,shadowRadius:3.84,elevation:5},hexText:{fontSize:16,color:"#fff",textShadowColor:"rgba(0, 0, 0, 0.75)",textShadowOffset:{width:0,height:1},textShadowRadius:2},slidersContainer:{flex:1,padding:8,borderRadius:6},activeContainer:{shadowColor:"#fff",shadowOffset:{width:0,height:0},shadowOpacity:.5,shadowRadius:5,elevation:5}});var po=({onPress:e,isActive:t,marginRight:o})=>{let n=react.useIconColor(),r=react.useBorderColor();return jsxRuntime.jsx(reactNative.TouchableOpacity,{onPress:e,style:[Bl.closeButton,{opacity:t?1:0,marginRight:o,borderColor:r}],hitSlop:{top:10,bottom:10,left:10,right:10},disabled:!t,children:jsxRuntime.jsx(vectorIcons.Ionicons,{name:"close",size:14,color:n,style:{alignSelf:"center"}})})},ke=({onPress:e,isActive:t})=>jsxRuntime.jsx(po,{marginRight:0,onPress:e,isActive:t}),Bl=reactNative.StyleSheet.create({closeButton:{padding:3,borderRadius:100,display:"flex",alignItems:"center",justifyContent:"center",borderWidth:1}});var Me=e=>{let t=react.useTextColor(),o=react.usePlaceholderColor();return e!=null&&e!==""?t:o};var mo=Vi.forwardRef(({input:{onChange:e,value:t,onFocus:o,onBlur:n},field:{placeholder:r,minDate:i,maxDate:a,optional:s},meta:{active:l}},p)=>{let c=Vi.useMemo(()=>t?new Date(`${t}T00:00:00.000`):void 0,[t]);Vi.useImperativeHandle(p,()=>({focus:()=>{o();},blur:()=>{n();}}));let d=()=>{o();},u=react.useIconColor(),f=Me(t),h=i==="now"?new Date:i?new Date(i):void 0,m=a==="now"?new Date:a?new Date(a):void 0;return jsxRuntime.jsxs(reactNative.View,{style:Ft.container,children:[jsxRuntime.jsxs(reactNative.TouchableOpacity,{style:Ft.button,onPress:d,children:[jsxRuntime.jsx(reactNative.Text,{style:[Ft.text,{color:f}],children:t?core.getDateString(t,"short"):r}),jsxRuntime.jsx(vectorIcons.Ionicons,{name:"calendar",size:20,color:u,style:Ft.icon}),s&&t?jsxRuntime.jsx(ke,{onPress:()=>e(null),isActive:!!t}):null]}),jsxRuntime.jsx(reactNativePaper.Portal,{children:jsxRuntime.jsx(reactNativePaperDates.DatePickerModal,{locale:"en",label:"Date",date:c,startYear:h?.getFullYear(),endYear:m?.getFullYear(),mode:"single",onConfirm:g=>{e(g?.date?.toISOString()?.split("T")[0]??null),n();},onDismiss:n,visible:l})})]})});mo.displayName="DateInput";var Ft=reactNative.StyleSheet.create({container:{width:"100%"},button:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",width:"100%",height:40,paddingHorizontal:12,paddingVertical:8},text:{fontSize:16,flex:1},icon:{marginRight:10}});var ho=Vi.forwardRef(({input:{value:e,onBlur:t,onChange:o,onFocus:n},field:r,meta:{active:i}},a)=>{let{placeholder:s,optional:l}=r,[p,c]=Vi.useState(true),[d,u]=Vi.useState(false),f=Vi.useMemo(()=>e?new Date(e):new Date,[e]);Vi.useImperativeHandle(a,()=>({focus:()=>{n();},blur:()=>{t();}}));let h=Vi.useCallback(T=>{if(T){let D=new Date(T);o(D.toISOString()),u(true);}else t();c(false);},[o,t]),m=Vi.useCallback(({hours:T,minutes:D})=>{let k=f?new Date(f):new Date;k.setHours(T),k.setMinutes(D),o(k.toISOString()),u(false),t();},[o,t,f]),g=Vi.useCallback(()=>{c(true),u(false),t();},[t]),y=Vi.useMemo(()=>e?new Date(e):void 0,[e]),V=Vi.useMemo(()=>e?core.getDateTimeString(e):null,[e]),S=Vi.useMemo(()=>y?{hours:y.getHours(),minutes:y.getMinutes()}:{hours:0,minutes:0},[y]),b=react.useIconColor(),v=Me(e);return jsxRuntime.jsxs(reactNative.View,{style:_e.container,children:[jsxRuntime.jsxs(reactNative.TouchableOpacity,{style:_e.button,onPress:()=>{c(true),n();},children:[jsxRuntime.jsx(reactNative.Text,{style:[_e.text,{color:v}],children:V??s}),jsxRuntime.jsx(vectorIcons.Ionicons,{name:"calendar",size:20,color:b,style:_e.icon}),jsxRuntime.jsx(vectorIcons.Ionicons,{name:"time",size:20,color:b,style:_e.icon}),l&&e?jsxRuntime.jsx(ke,{onPress:()=>o(null),isActive:!!e}):null]}),jsxRuntime.jsxs(reactNativePaper.Portal,{children:[p&&jsxRuntime.jsx(reactNativePaperDates.DatePickerModal,{locale:"en",label:"Date",date:y,mode:"single",onConfirm:T=>{h(T?.date?.toISOString()?.split("T")[0]??null);},onDismiss:g,visible:i&&p}),d&&jsxRuntime.jsx(reactNativePaperDates.TimePickerModal,{visible:i&&d,onDismiss:g,locale:"en-US",onConfirm:m,hours:S.hours,minutes:S.minutes})]})]})});ho.displayName="DateTimeInput";var _e=reactNative.StyleSheet.create({container:{width:"100%"},button:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",width:"100%",height:40,paddingHorizontal:12,paddingVertical:8},text:{fontSize:16,flex:1},icon:{marginRight:10}});var ms=e=>{if(!e.accept)return;let t=[];return e.accept.includes("image")&&t.push("image/jpg","image/jpeg","image/png","image/svg","image/gif"),e.accept.includes("pdf")&&t.push("application/pdf"),e.accept.includes("audio")&&t.push("audio/mp3","audio/wav","audio/x-wav","audio/webm","audio/ogg"),t.join(",")},fs=({hasUpload:e})=>jsxRuntime.jsxs(reactNative.View,{style:ce.noFileContainer,children:[jsxRuntime.jsx(reactNative.Text,{style:ce.noFileText,children:e?"Tap to upload file":"No file uploaded"}),jsxRuntime.jsx(vectorIcons.Ionicons,{name:"cloud-upload",size:24,color:"#666"})]}),vt=({value:e,hasUpload:t,imageOptions:o})=>{let{storagePath:n,dataUrl:r}=e??{};return !e||!r&&!n?jsxRuntime.jsx(fs,{hasUpload:t}):e.type?.startsWith("image/")?jsxRuntime.jsx(Bn,{src:r,width:o?.width??120,height:o?.height??120,style:ce.image}):jsxRuntime.jsxs(reactNative.View,{style:ce.fileContainer,children:[jsxRuntime.jsx(vectorIcons.Ionicons,{name:"document",size:24,color:"#666"}),jsxRuntime.jsx(reactNative.Text,{style:ce.filename,children:e.filename})]})},bo=Vi.forwardRef(({input:{value:e,onChange:t},field:o},n)=>{let[r,i]=Vi.useState(false),{imageOptions:a}=o||{},s=Vi.useCallback(async()=>{try{i(!0);let c;if(o.accept?.includes("image")){if(c=await ur__namespace.launchImageLibraryAsync({mediaTypes:["images"],allowsEditing:!0,quality:1,base64:!0}),!c.canceled&&c.assets[0]){let d=c.assets[0],u=d.uri.split(".").pop()??"jpeg",f=d.uri.split("/").pop()??"image";t({...e,dataUrl:d.uri,type:`image/${u}`,filename:f});}}else c=await dr__namespace.getDocumentAsync({type:ms(o)}),c.canceled||t({...e,dataUrl:c.assets[0].uri,type:c.assets[0].mimeType,filename:c.assets[0].name});}catch(c){c instanceof Error&&console.error("Error picking file:",c.message);}finally{i(false);}},[o,t,e]);Vi.useImperativeHandle(n,()=>({focus:()=>{s();},blur:()=>{}}));let l=Vi.useMemo(()=>o.accept&&o.accept.length===1&&o.accept[0]==="image",[o]),p=Vi.useMemo(()=>l||e?.type?.startsWith("image/")?{height:120,...a}:void 0,[a,l,e]);return jsxRuntime.jsxs(reactNative.View,{style:ce.container,children:[jsxRuntime.jsx(reactNative.Text,{style:ce.placeholder,children:o.placeholder}),jsxRuntime.jsx(reactNative.TouchableOpacity,{style:ce.contentContainer,onPress:()=>void s(),disabled:r,children:jsxRuntime.jsx(vt,{hasUpload:true,imageOptions:p,value:e})})]})});bo.displayName="FileComponent";var ce=reactNative.StyleSheet.create({container:{width:"100%",alignItems:"center",justifyContent:"center"},placeholder:{fontSize:14,opacity:.8,marginBottom:4},contentContainer:{width:"100%",position:"relative",alignItems:"center",justifyContent:"center",padding:8,overflow:"hidden"},noFileContainer:{flexDirection:"row",alignItems:"center",justifyContent:"center",padding:16,borderWidth:1,borderColor:"#e2e8f0",borderRadius:4,borderStyle:"dashed"},noFileText:{fontSize:14,textAlign:"center",opacity:.8,marginRight:8},fileContainer:{flexDirection:"row",alignItems:"center",padding:8,borderWidth:1,borderColor:"#e2e8f0",borderRadius:4},filename:{fontSize:14,marginLeft:8},image:{borderRadius:4,overflow:"hidden"}});var mr=Vi.forwardRef(({field:e,input:t,inEditable:o},n)=>{let{options:r,renderOption:i,getOptionKey:a}=e,{onChange:s,value:l,onFocus:p,onBlur:c}=t,d=react.useColorMode(),u=react.usePlaceholderColor();Vi.useImperativeHandle(n,()=>({focus:()=>{p();},blur:()=>{c();}}));let f=m=>{s(l?.includes(m)?l.filter(g=>g!==m):[...l??[],m]);},h=jsxRuntime.jsx(reactNative.View,{style:Je.container,children:r.map(m=>jsxRuntime.jsx(reactNative.TouchableOpacity,{style:[Je.option,l?.includes(m)&&Je.selectedOption],onPress:()=>f(m),children:i(m,d,!!l?.includes(m))},a?a(m):m))});return o?jsxRuntime.jsxs(reactNative.View,{style:Je.editableContainer,children:[jsxRuntime.jsx(reactNative.Text,{style:[Je.placeholder,{color:u}],children:e.placeholder}),h]}):h}),Je=reactNative.StyleSheet.create({container:{width:"100%",flexDirection:"row",flexWrap:"wrap",gap:4},editableContainer:{width:"100%",paddingVertical:2},placeholder:{fontSize:14,fontWeight:"600",opacity:.8,paddingHorizontal:8,marginBottom:4},option:{padding:4,opacity:.7},selectedOption:{opacity:1}});var Is={xs:4,sm:6,md:8,lg:8,xl:8},Fs={xs:8,sm:12,md:12,lg:12,xl:12},Ps={xs:12,sm:14,md:16,lg:18,xl:20},fr=e=>Vi.useMemo(()=>reactNative.StyleSheet.create({style:{paddingVertical:Is[e??"md"],paddingHorizontal:Fs[e??"md"],fontSize:Ps[e??"md"]}}),[e]);var Vo=Vi.forwardRef(({input:{onChange:e,value:t,...o},field:n,size:r,prefix:i,inEditable:a,...s},l)=>{let{type:p,defaultValue:c,placeholder:d}=n,u=react.useTextColor(),{style:f}=fr(r),h=Vt(l),[m,g]=Vi.useState(""),y=typeof t=="number"&&!Number.isNaN(t)?`${t}${m}`:"",V=react.usePlaceholderColor();return p==="slider"?jsxRuntime.jsx(St,{label:d,onValueChange:e,value:t,minimumValue:c}):jsxRuntime.jsxs(reactNative.View,{style:So.container,children:[i&&jsxRuntime.jsx(reactNative.Text,{style:So.prefix,children:i}),jsxRuntime.jsx(reactNative.TextInput,{ref:h,style:[So.input,f,{color:u}],placeholder:n.placeholder,placeholderTextColor:V,keyboardType:"numeric",value:y,onChangeText:S=>{S.endsWith(".")?g("."):S.includes(".")&&S.endsWith("0")?g("0"):g("");let b=parseFloat(S);e(isNaN(b)?void 0:b);},...o})]})}),zs=({field:e,...t},o)=>{let n=Vi.useRef(null);return Vi.useImperativeHandle(o,()=>({focus:()=>{n.current?.focus();},blur:()=>{n.current?.blur();}})),jsxRuntime.jsx(Vo,{prefix:"$",field:{...e,_type:"number"},...t})},hr=Vi.forwardRef(zs),So=reactNative.StyleSheet.create({container:{flexDirection:"row",alignItems:"center",width:"100%"},input:{flex:1,height:40,paddingHorizontal:12,paddingVertical:8,backgroundColor:"transparent"},prefix:{marginRight:4,fontSize:16}});var Qs=({field:e,input:t,meta:o},n)=>{let{placeholder:r,options:i,renderOption:a,getOptionKey:s,optional:l}=e,{onChange:p,value:c,onFocus:d,onBlur:u}=t,{active:f}=o,[h,m]=Vi.useState({x:0,y:0,width:0,height:0}),g=Vi.useRef(null),y=Vi.useMemo(()=>{if(c)return i.find(I=>{if(s){let E=s(I),L=s(c);return E===L}return I===c})},[c,i,s]);Vi.useImperativeHandle(n,()=>({focus:()=>{d();},blur:()=>{u();}}));let V=()=>{g.current?.measure((I,E,L,q,Se,Ve)=>{m({x:Se,y:Ve,width:L,height:q});});},S=(I,E)=>typeof a=="function"?a(I,"light",E):typeof I=="object"?jsxRuntime.jsx(G,{children:JSON.stringify(I)}):jsxRuntime.jsx(G,{children:String(I)}),b=I=>{if(s){let E=s(I);return typeof E=="object"?JSON.stringify(E):String(E)}return typeof I=="object"?JSON.stringify(I):String(I)},v=I=>{p(I),u();},T=react.useIconColor(),D=react.usePlaceholderColor(),k=react.useBackgroundColor(200),_=react.useBackgroundColor(300),H=react.useBorderColor();return jsxRuntime.jsxs(reactNative.View,{style:oe.wrapper,children:[jsxRuntime.jsx(reactNative.View,{ref:g,onLayout:V,style:oe.container,children:jsxRuntime.jsxs(reactNative.TouchableOpacity,{style:[oe.button],onPress:()=>{f?u():d();},children:[jsxRuntime.jsx(reactNative.View,{children:y?S(y,true):jsxRuntime.jsx(reactNative.Text,{style:[oe.placeholder,{color:D}],children:r})}),jsxRuntime.jsxs(reactNative.View,{style:oe.iconsContainer,children:[l?jsxRuntime.jsx(po,{onPress:()=>p(null),isActive:!!c}):null,jsxRuntime.jsx(vectorIcons.Ionicons,{name:f?"chevron-up":"chevron-down",size:20,color:T})]})]})}),jsxRuntime.jsx(reactNative.Modal,{visible:f,transparent:true,animationType:"fade",onRequestClose:()=>u(),children:jsxRuntime.jsx(reactNative.TouchableOpacity,{style:oe.modalOverlay,activeOpacity:1,onPress:()=>u(),children:jsxRuntime.jsx(reactNative.View,{style:[oe.dropdownContainer,{position:"absolute",top:h.y+h.height+4,left:h.x,width:h.width,backgroundColor:k,borderColor:H}],children:jsxRuntime.jsx(reactNative.ScrollView,{style:oe.dropdown,children:i.map(I=>{let E=b(I),L=I===y;return jsxRuntime.jsx(reactNative.TouchableOpacity,{style:[oe.option,{borderColor:H},L&&{backgroundColor:_}],onPress:()=>v(I),children:jsxRuntime.jsx(reactNative.View,{children:S(I,L)})},E)})})})})})]})},wr=Vi.forwardRef(Qs),oe=reactNative.StyleSheet.create({wrapper:{width:"100%"},container:{width:"100%"},button:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",width:"100%",height:40,paddingHorizontal:12,paddingVertical:8,backgroundColor:"transparent",borderRadius:4},buttonText:{fontSize:16,flex:1},modalOverlay:{flex:1,backgroundColor:"rgba(0, 0, 0, 0.5)"},dropdownContainer:{backgroundColor:"white",borderWidth:1,borderColor:"#ddd",borderRadius:4,maxHeight:200,elevation:3,shadowColor:"#000",shadowOffset:{width:0,height:2},shadowOpacity:.1,shadowRadius:2,padding:0},dropdown:{maxHeight:200},option:{paddingVertical:12,paddingHorizontal:16,borderBottomWidth:1},optionText:{fontSize:16},iconsContainer:{flexDirection:"row",alignItems:"center",gap:8},placeholder:{color:"#666"}});var lc={facebook:"facebook",instagram:"instagram",twitter:"twitter",youtube:"youtube",soundcloud:"soundcloud"},Ke=({site:e,value:t,onChange:o,isModalVisible:n,onModalClose:r})=>{let{handle:i,error:a}=Vi.useMemo(()=>{try{return {handle:core.getHandle(e,t)}}catch(l){return {error:l?.message??"Error parsing handle"}}},[t,e]),s=Vi.useMemo(()=>i?`${e.toUpperCase()}: ${i}`:e.toUpperCase(),[e,i]);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(reactNative.TouchableOpacity,{style:[U.iconButton,!i&&U.iconButtonInactive],onPress:()=>r(),children:jsxRuntime.jsx(reactNative.Text,{style:U.iconText,children:lc[e]})}),jsxRuntime.jsx(reactNative.Modal,{visible:n,transparent:true,animationType:"slide",onRequestClose:r,children:jsxRuntime.jsx(reactNative.View,{style:U.modalContainer,children:jsxRuntime.jsxs(reactNative.View,{style:U.modalContent,children:[jsxRuntime.jsx(reactNative.Text,{style:U.modalTitle,children:s}),a&&jsxRuntime.jsx(reactNative.Text,{style:U.errorText,children:a}),jsxRuntime.jsx(reactNative.TextInput,{style:U.modalInput,onChangeText:o,placeholder:"Handle or URL",value:t,autoCapitalize:"none",autoCorrect:false}),jsxRuntime.jsx(reactNative.TouchableOpacity,{style:U.closeButton,onPress:r,children:jsxRuntime.jsx(reactNative.Text,{style:U.closeButtonText,children:"Close"})})]})})})]})},xr=Vi.forwardRef((e,t)=>{let{input:{value:o,onChange:n},field:{sites:r}}=e,[i,a]=Vi.useState(null),s=Vi.useCallback((l,p)=>{let{[l]:c,...d}=o??{};!p&&Object.keys(d).length===0&&n({target:{value:void 0}}),p||n(d),n({...d,[l]:p});},[n,o]);return Vi.useImperativeHandle(t,()=>({blur:()=>{},focus:()=>{}})),jsxRuntime.jsxs(reactNative.View,{style:U.container,children:[jsxRuntime.jsx(reactNative.Text,{style:U.title,children:"Links"}),jsxRuntime.jsxs(reactNative.View,{style:U.iconsContainer,children:[(!r||r.facebook)&&jsxRuntime.jsx(Ke,{onChange:l=>s("facebook",l),site:"facebook",value:o?.facebook,isModalVisible:i==="facebook",onModalClose:()=>a(null)}),(!r||r.instagram)&&jsxRuntime.jsx(Ke,{onChange:l=>s("instagram",l),site:"instagram",value:o?.instagram,isModalVisible:i==="instagram",onModalClose:()=>a(null)}),(!r||r.twitter)&&jsxRuntime.jsx(Ke,{onChange:l=>s("twitter",l),site:"twitter",value:o?.twitter,isModalVisible:i==="twitter",onModalClose:()=>a(null)}),(!r||r.youtube)&&jsxRuntime.jsx(Ke,{onChange:l=>s("youtube",l),site:"youtube",value:o?.youtube,isModalVisible:i==="youtube",onModalClose:()=>a(null)}),(!r||r.soundcloud)&&jsxRuntime.jsx(Ke,{onChange:l=>s("soundcloud",l),site:"soundcloud",value:o?.soundcloud,isModalVisible:i==="soundcloud",onModalClose:()=>a(null)})]})]})}),U=reactNative.StyleSheet.create({container:{flex:1,padding:8},title:{fontSize:16,fontWeight:"bold",marginBottom:8,color:"#1A202C"},iconsContainer:{flexDirection:"row",flexWrap:"wrap",gap:8},iconButton:{width:34,height:34,borderRadius:17,backgroundColor:"#EDF2F7",justifyContent:"center",alignItems:"center"},iconButtonInactive:{opacity:.6},iconText:{fontSize:12,color:"#1A202C"},modalContainer:{flex:1,justifyContent:"center",alignItems:"center",backgroundColor:"rgba(0, 0, 0, 0.5)"},modalContent:{backgroundColor:"white",borderRadius:8,padding:16,width:"80%",maxWidth:300},modalTitle:{fontSize:16,fontWeight:"bold",marginBottom:8,color:"#1A202C"},errorText:{color:"#E53E3E",fontSize:14,marginBottom:8,padding:4,backgroundColor:"#FFF5F5"},modalInput:{borderWidth:1,borderColor:"#E2E8F0",borderRadius:4,padding:8,marginBottom:16,fontSize:16},closeButton:{backgroundColor:"#EDF2F7",padding:8,borderRadius:4,alignItems:"center"},closeButtonText:{color:"#1A202C",fontSize:16}});var Fo=Vi.forwardRef(({input:e,field:t,inEditable:o},n)=>{let r=Vi.useRef(null),{value:i,onChange:a,...s}=e;Vi.useImperativeHandle(n,()=>({focus:()=>{r.current?.focus();},blur:()=>{r.current?.blur();}}));let l=react.usePlaceholderColor(),p=react.useTextColor();return jsxRuntime.jsx(reactNative.TextInput,{ref:r,style:[Sr.textarea,o&&Sr.inEditable,{color:p}],placeholder:t.placeholder,placeholderTextColor:l,multiline:true,numberOfLines:2,maxLength:200,textAlignVertical:"top",value:i??"",onChangeText:a,...s})});Fo.displayName="TextAreaComponent";var Sr=reactNative.StyleSheet.create({textarea:{width:"100%",minHeight:80,paddingHorizontal:12,paddingVertical:8,backgroundColor:"transparent",textAlignVertical:"top"},inEditable:{paddingHorizontal:0,paddingVertical:0}});var Po=Vi.forwardRef(({input:e,inEditable:t,meta:o,field:n},r)=>{let{placeholder:i,type:a}=n,[s,l]=Vi.useState(a==="password"),{value:p,onChange:c,...d}=e,u=Vi.useRef(null);Vi.useImperativeHandle(r,()=>({focus:()=>{u.current?.focus();},blur:()=>{u.current?.blur();}}));let f=react.usePlaceholderColor(),h=react.useTextColor(),m=a==="textarea"?jsxRuntime.jsx(Fo,{inEditable:t,field:n,input:e,meta:o}):jsxRuntime.jsx(reactNative.TextInput,{ref:u,style:[Xe.input,t&&Xe.inEditable,a==="password"&&Xe.passwordInput,{color:h}],secureTextEntry:s,placeholderTextColor:f,placeholder:i,value:p??"",onChangeText:c,...d});return a==="password"?jsxRuntime.jsxs(reactNative.View,{style:Xe.passwordContainer,children:[m,jsxRuntime.jsx(reactNative.TouchableOpacity,{style:Xe.eyeIcon,onPress:()=>l(!s),children:jsxRuntime.jsx(vectorIcons.Ionicons,{name:s?"eye":"eye-off",size:20,color:"#666"})})]}):m});Po.displayName="TextComponent";var Xe=reactNative.StyleSheet.create({input:{width:"100%",height:40,paddingHorizontal:12,paddingVertical:8},inEditable:{paddingHorizontal:0,paddingVertical:0,height:"auto"},passwordInput:{paddingRight:40},passwordContainer:{width:"100%",flexDirection:"row",alignItems:"center",position:"relative"},eyeIcon:{position:"absolute",right:12,padding:4}});var Ro=Vi.forwardRef(({input:{onChange:e,value:t,onFocus:o,onBlur:n},field:{placeholder:r,optional:i}},a)=>{let[s,l]=Vi.useState(false);Vi.useImperativeHandle(a,()=>({focus:()=>{l(true),o();},blur:()=>{l(false),n();}}));let p=({hours:g,minutes:y})=>{l(false);let V=`${core.padZeros(g)}:${core.padZeros(y)}`;e(V),n();},c=()=>{l(false),n();},d=Vi.useMemo(()=>{if(!t)return null;let[g,y]=t.split(":").map(Number),V=g>=12?"PM":"AM";return `${g%12===0?12:g%12}:${core.padZeros(y)} ${V}`},[t]),{hours:u,minutes:f}=Vi.useMemo(()=>{if(!t)return {hours:0,minutes:0};let[g,y]=t.split(":").map(Number);return {hours:g,minutes:y}},[t]),h=react.useIconColor(),m=Me(t);return jsxRuntime.jsxs(reactNative.View,{style:kt.container,children:[jsxRuntime.jsxs(reactNative.TouchableOpacity,{style:kt.button,onPress:()=>{l(true),o();},children:[jsxRuntime.jsx(reactNative.Text,{style:[kt.text,{color:m}],children:d??r}),jsxRuntime.jsx(vectorIcons.Ionicons,{name:"time",size:20,color:h,style:kt.icon}),i&&t?jsxRuntime.jsx(ke,{onPress:()=>e(null),isActive:!!t}):null]}),jsxRuntime.jsx(reactNativePaper.Portal,{children:jsxRuntime.jsx(reactNativePaperDates.TimePickerModal,{visible:s,onDismiss:c,onConfirm:p,hours:u,minutes:f})})]})});Ro.displayName="TimeInput";var kt=reactNative.StyleSheet.create({container:{width:"100%"},button:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",width:"100%",height:40,paddingHorizontal:12,paddingVertical:8},text:{fontSize:16,flex:1},icon:{marginRight:10}});var Gc={text:Po,file:bo,boolean:Qn,select:wr,multipleSelect:mr,currency:hr,number:Vo,date:mo,datetime:ho,time:Ro,socialMedia:xr,color:rr},Yc=(e,t)=>{let{field:o,meta:{error:n,active:r,touched:i},input:a,inEditable:s}=e,{value:l}=a,p=react.useThemeValue("colors.text.500"),c=react.useThemeValue("colors.accent.400"),d=react.useThemeValue("colors.error.200"),u=Vi.useMemo(()=>new reactNative.Animated.Value(0),[]),f=Vi.useMemo(()=>n&&i?n:null,[n,i]),h=Vi.useMemo(()=>f?"#ff7777":c,[f,c]);Vi.useEffect(()=>{reactNative.Animated.timing(u,{toValue:r||f?1:0,duration:300,useNativeDriver:false}).start();},[r,f,u]);let m=u.interpolate({inputRange:[0,1],outputRange:[p,h]}),{_type:g,label:y}=o,V=Vi.useMemo(()=>g==="multipleSelect"||!!l&&g!=="file"&&g!=="boolean",[l,g]),S=react.useBackgroundColor(150),b=Vi.useMemo(()=>{if(s)return {};switch(g){case "text":case "number":case "currency":case "select":case "datetime":case "date":case "time":return {shadowColor:m,shadowOffset:{width:0,height:0},shadowOpacity:1,shadowRadius:7,elevation:10,backgroundColor:S};default:return {}}},[g,m,s,S]),v=Vi.useMemo(()=>Gc[g],[g]),T=Vi.useMemo(()=>s?0:n&&i?24:8,[s,n,i]);return jsxRuntime.jsxs(reactNative.View,{style:[Ze.container,{paddingBottom:T}],children:[y&&!s?jsxRuntime.jsx(reactNative.Text,{style:Ze.label,children:y}):null,jsxRuntime.jsx(reactNative.Animated.View,{style:[Ze.inputContainer,b],children:jsxRuntime.jsx(v,{ref:t,...e})}),!s&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(reactNative.Text,{style:[Ze.errorText,{opacity:n&&i?1:0,color:d}],children:n}),jsxRuntime.jsx(reactNative.Text,{style:[Ze.placeholder,{opacity:V?1:0}],children:o.placeholder??""})]})]})},Ze=reactNative.StyleSheet.create({container:{position:"relative",width:"100%",paddingVertical:4,paddingHorizontal:4},label:{color:"#1A202C",fontSize:14,paddingHorizontal:8},inputContainer:{width:"100%",borderRadius:4,paddingVertical:1,overflow:"hidden"},errorText:{position:"absolute",bottom:0,fontSize:14,paddingHorizontal:4,color:"#E53E3E"},placeholder:{position:"absolute",top:-16,fontSize:14,paddingHorizontal:4,color:"rgba(0,0,0,0.6)"}}),Mt=Vi.forwardRef(Yc);var Xc=({field:e,name:t},o)=>{let{control:n,getOnChange:r,meta:i,onFocus:a,onBlur:s}=react.useField(t,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:n,name:t,render:({field:{name:l,ref:p,onBlur:c,...d}})=>jsxRuntime.jsx(Mt,{ref:o,field:e,input:{...d,onFocus:a,onBlur:()=>{s(),c();},onChange:r(d.onChange)},meta:i})})},Pr=Vi.forwardRef(Xc);var tt=reactNative.StyleSheet.create({container:{width:"100%",flexDirection:"column"},progressContainer:{paddingHorizontal:8,height:26,width:"100%",justifyContent:"center",alignItems:"center"},progressBar:{height:"100%",width:"100%",borderRadius:13,backgroundColor:"rgba(0, 0, 0, 0.1)",overflow:"hidden"},progressFill:{height:"100%",backgroundColor:"#3182CE"},label:{position:"absolute",color:"white",fontSize:12,fontWeight:"500",textTransform:"uppercase",textShadowColor:"rgba(0, 0, 0, 0.67)",textShadowOffset:{width:1,height:1},textShadowRadius:3}}),Et=({uploads:e})=>{let t=Vi.useMemo(()=>Object.values(e),[e]);return jsxRuntime.jsx(reactNative.View,{style:tt.container,children:t.map(o=>jsxRuntime.jsxs(reactNative.Animated.View,{style:tt.progressContainer,children:[jsxRuntime.jsx(reactNative.View,{style:tt.progressBar,children:jsxRuntime.jsx(reactNative.Animated.View,{style:[tt.progressFill,{width:`${o.percent*100}%`}]})}),jsxRuntime.jsx(reactNative.Text,{style:tt.label,children:o.label})]},o.label))})};var ne=reactNative.StyleSheet.create({container:{width:"100%"},progressContainer:{height:5,width:"100%"},footerContainer:{flexDirection:"row",paddingVertical:8,borderTopWidth:1,borderTopColor:core.palette.gray.light,paddingHorizontal:12,width:"100%"},cancelButton:{flex:1,paddingVertical:8,paddingHorizontal:16,borderWidth:1,borderColor:"#cdcdcd",borderRadius:4,marginRight:8},cancelButtonText:{color:"#777",textAlign:"center"},submitButton:{flex:1,paddingVertical:8,paddingHorizontal:16,borderRadius:4,backgroundColor:core.palette.cyan.light},submitButtonText:{color:"#fff",textAlign:"center"},errorText:{color:"red",paddingHorizontal:12,paddingVertical:4},disabledButton:{opacity:.5}}),id=({onBack:e,children:t})=>jsxRuntime.jsx(reactNative.TouchableOpacity,{style:ne.cancelButton,onPress:e,children:jsxRuntime.jsx(reactNative.Text,{style:ne.cancelButtonText,children:t})}),ad=({onSubmitClick:e,submitting:t,children:o})=>jsxRuntime.jsx(reactNative.TouchableOpacity,{style:[ne.submitButton,t&&ne.disabledButton],onPress:e,disabled:t,children:t?jsxRuntime.jsx(reactNative.ActivityIndicator,{color:"#fff"}):jsxRuntime.jsx(reactNative.Text,{style:ne.submitButtonText,children:o})}),ld=()=>{let{formError:e}=react.useChempoForm();return e?jsxRuntime.jsx(reactNative.Text,{style:ne.errorText,children:e}):null},Mr=({isLoading:e,uploads:t,onSubmit:o,renderFooter:n,onBack:r,buttonText:i})=>{let{isSubmitting:a,isValid:s}=reactHookForm.useFormState();return jsxRuntime.jsxs(reactNative.View,{style:ne.container,children:[e&&jsxRuntime.jsx(reactNative.View,{style:ne.progressContainer,children:jsxRuntime.jsx(reactNative.ActivityIndicator,{})}),jsxRuntime.jsx(Et,{uploads:t}),jsxRuntime.jsx(ld,{}),n?n({}):jsxRuntime.jsxs(reactNative.View,{style:ne.footerContainer,children:[r&&jsxRuntime.jsx(id,{onBack:r,children:"Cancel"}),jsxRuntime.jsx(ad,{onSubmitClick:o,submitting:a||!s,children:i})]})]})};var ot=reactNative.StyleSheet.create({container:{flexDirection:"column"},rowContainer:{flexDirection:"row"},label:{paddingRight:8,opacity:.7,fontWeight:"600"},emptyText:{opacity:.7},fileContainer:{padding:4}}),zr=({field:e,value:t,noLabel:o,style:n})=>{let{imageOptions:r,placeholder:i}=e,a=Vi.useMemo(()=>({height:150,...r}),[r]);return jsxRuntime.jsxs(reactNative.View,{style:[t?ot.container:ot.rowContainer,n],children:[!o&&jsxRuntime.jsx(reactNative.Text,{style:ot.label,children:i}),t?jsxRuntime.jsx(reactNative.View,{style:ot.fileContainer,children:jsxRuntime.jsx(vt,{imageOptions:a,value:t})}):jsxRuntime.jsx(reactNative.Text,{style:ot.emptyText,children:"None"})]})};var Lt=reactNative.StyleSheet.create({container:{flexDirection:"row",flexWrap:"wrap",alignItems:"center",maxWidth:"100%"},label:{paddingRight:8,opacity:.7,fontWeight:"600"},optionContainer:{padding:2},emptyText:{opacity:.6}}),Nr=({field:e,value:t,noLabel:o,style:n})=>{let{placeholder:r,renderOption:i,getOptionKey:a}=e,s=reactNative.useColorScheme()??"light";return jsxRuntime.jsxs(reactNative.View,{style:[Lt.container,n],children:[!o&&jsxRuntime.jsx(reactNative.Text,{style:Lt.label,children:r}),t?t.map(l=>jsxRuntime.jsx(reactNative.View,{style:Lt.optionContainer,children:i(l,s,true)},a?a(l):l)):jsxRuntime.jsx(reactNative.Text,{style:Lt.emptyText,children:"None"})]})};var Wr=reactNative.StyleSheet.create({container:{flexDirection:"row",alignItems:"center"},label:{paddingRight:8,opacity:.7,fontWeight:"600"}}),bd=e=>jsxRuntime.jsx(G,{children:typeof e=="string"?e:JSON.stringify(e)}),Ur=({field:e,value:t,noLabel:o,style:n})=>{let{placeholder:r,renderOption:i}=e,a=reactNative.useColorScheme()??"light",s=react.usePlaceholderColor(),l=i??bd;return jsxRuntime.jsxs(reactNative.View,{style:[Wr.container,n],children:[!o&&jsxRuntime.jsx(reactNative.Text,{style:[Wr.label,{color:s}],children:r}),t?l(t,a,true):"None"]})};var Ht=reactNative.StyleSheet.create({container:{flexDirection:"row",alignItems:"center"},label:{paddingRight:8,opacity:.7,fontWeight:"600"},value:{opacity:1},valueEmpty:{opacity:.6}}),Id=({field:e,value:t,noLabel:o,style:n})=>{let{placeholder:r}=e,i=Vi.useMemo(()=>{let a=core.formatField[e._type];return a?a(e,t):t},[t,e]);return jsxRuntime.jsxs(reactNative.View,{style:[Ht.container,n],children:[!o&&jsxRuntime.jsx(reactNative.Text,{style:Ht.label,children:r}),jsxRuntime.jsx(reactNative.Text,{style:t!=null?Ht.value:Ht.valueEmpty,children:i??"None"})]})},Nt=({field:e,value:t,noLabel:o,style:n})=>{switch(e._type){case "select":return jsxRuntime.jsx(Ur,{style:n,field:e,value:t,noLabel:o});case "multipleSelect":return jsxRuntime.jsx(Nr,{style:n,field:e,value:t,noLabel:o});case "file":return jsxRuntime.jsx(zr,{style:n,field:e,value:t,noLabel:o});default:return jsxRuntime.jsx(Id,{style:n,field:e,value:t,noLabel:o})}};var Rd=({onChange:e,value:t,field:o,onBlur:n,inEditable:r,onFocus:i,style:a},s)=>{let{inputProps:l,meta:p}=react.useStandaloneInput(o,t,e,i,n);return jsxRuntime.jsx(Mt,{ref:s,field:o,inEditable:r,style:a,input:l,meta:p})},Gr=Vi.forwardRef(Rd);var Kr=({value:e,field:t,onSubmit:o,storagePath:n,style:r,onEditClose:i,onEditOpen:a})=>{let{formattedValue:s,inputRef:l,setValue:p,isLoading:c,uploads:d,editHovered:u,handleEditOpen:f,handleEditClose:h,isEditing:m,value:g,setEditHovered:y,submit:V,parse:S}=react.useEditable({value:e,field:t,onSubmit:o,storagePath:n,onEditOpen:a,onEditClose:i}),b=Vi.useMemo(()=>t._type==="file"||t._type==="boolean",[t]);Vi.useEffect(()=>{m&&l.current?.focus();},[m,l]);let v=react.useColorModeValue("#00000055","#ffffff55");return jsxRuntime.jsxs(reactNative.View,{style:[xe.container,{borderColor:u&&!m?v:"transparent"},r],children:[jsxRuntime.jsxs(reactNative.View,{style:xe.contentContainer,children:[jsxRuntime.jsx(reactNative.View,{style:[xe.inputContainer,{opacity:c?0:1,borderColor:m?v:"transparent"}],children:m||b?jsxRuntime.jsx(Gr,{ref:l,value:s,inEditable:true,field:t,style:[xe.input,r],onChange:b?T=>V(S(T)):T=>p(S(T))}):jsxRuntime.jsx(Nt,{style:r,field:t,value:g})}),!b&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(reactNative.TouchableOpacity,{style:xe.editButton,onPress:()=>{m?(p(g),h()):f();},onPressIn:()=>y(true),onPressOut:()=>y(false),children:jsxRuntime.jsx(vectorIcons.Ionicons,{name:m?"close":"create-outline",size:20,color:core.palette.gray.medium})}),jsxRuntime.jsx(reactNative.View,{style:[xe.submitButtonContainer,{width:m?30:0,opacity:m?1:0}],children:jsxRuntime.jsx(reactNative.TouchableOpacity,{style:[xe.submitButton,{backgroundColor:core.palette.cyan.light}],onPress:()=>void V(g),children:jsxRuntime.jsx(vectorIcons.Ionicons,{name:"checkmark",size:20,color:"#fff"})})})]}),jsxRuntime.jsx(mt,{isLoading:c})]}),jsxRuntime.jsx(Et,{uploads:d})]})},xe=reactNative.StyleSheet.create({container:{borderRadius:4,borderWidth:1,borderStyle:"dashed",width:"100%"},contentContainer:{flexDirection:"row",alignItems:"center",paddingHorizontal:4,position:"relative",width:"100%"},inputContainer:{flex:1,minWidth:0,borderWidth:1,borderStyle:"dashed"},input:{padding:0},editButton:{padding:4,marginLeft:4},submitButtonContainer:{justifyContent:"flex-end",overflow:"hidden"},submitButton:{padding:4,borderRadius:4}});var R=reactNative.StyleSheet.create({container:{width:"100%"},listContainer:{width:"100%",paddingHorizontal:8,paddingVertical:4,gap:8},listHeader:{fontSize:14,opacity:.7,lineHeight:1},listContent:{gap:8,paddingVertical:4,minHeight:30},listItem:{paddingTop:8,paddingHorizontal:8,borderWidth:1,borderColor:"#e2e8f0",borderRadius:4},listItemContent:{flexDirection:"row",alignItems:"center",gap:4,width:"100%"},listItemInput:{flex:1,minWidth:0},emptyListText:{fontSize:14,opacity:.7,paddingVertical:4,paddingHorizontal:8},newButton:{alignSelf:"flex-start",paddingVertical:4,paddingHorizontal:8,borderRadius:4,backgroundColor:"#f7fafc"},newButtonText:{fontSize:14,color:"#4a5568"},formElementContainer:{width:"100%",gap:4},dataViewHeader:{flexDirection:"row",alignItems:"center",paddingHorizontal:8,width:"100%"},dataViewTitle:{fontSize:18,fontFamily:"System",paddingVertical:8},dataViewActions:{flexDirection:"row",alignItems:"center",gap:8,marginLeft:"auto"},dataViewContent:{paddingHorizontal:16,paddingVertical:8}}),Yd=({field:e,name:t})=>{let o=Vi.useMemo(()=>core.isField(e.itemField)?"":core.isListField(e.itemField)?[]:{},[e]),{control:n}=reactHookForm.useFormContext(),{fields:r,append:i,remove:a}=reactHookForm.useFieldArray({control:n,name:t});return jsxRuntime.jsxs(reactNative.View,{style:R.listContainer,children:[jsxRuntime.jsx(reactNative.Text,{style:R.listHeader,children:e.placeholder}),jsxRuntime.jsx(reactNative.View,{style:R.listContent,children:r.length?r.map((s,l)=>jsxRuntime.jsx(reactNative.View,{style:R.listItem,children:jsxRuntime.jsxs(reactNative.View,{style:R.listItemContent,children:[jsxRuntime.jsx(reactNative.View,{style:R.listItemInput,children:jsxRuntime.jsx(Lo,{name:s.id,field:e.itemField})}),jsxRuntime.jsx(Xt,{onDelete:()=>a(l),itemName:`${e.placeholder} ${l+1}`})]})},s.id)):jsxRuntime.jsx(reactNative.Text,{style:R.emptyListText,children:"No items"})}),jsxRuntime.jsx(reactNative.TouchableOpacity,{style:R.newButton,onPress:()=>i(o),children:jsxRuntime.jsx(reactNative.Text,{style:R.newButtonText,children:"+ NEW"})})]})},Lo=({field:e,name:t})=>{let o=Vi.useMemo(()=>core.isField(e)||core.isListField(e)?[{name:"value",field:e}]:Object.entries(e.children).map(([n,r])=>({name:`${t?`${t}.`:""}${n}`,field:r})),[e,t]);return jsxRuntime.jsx(reactNative.View,{style:R.formElementContainer,children:o.map(n=>{if(core.isListField(n.field)){let i=jsxRuntime.jsx(Yd,{name:n.name,field:n.field},n.name);return n.field.condition?jsxRuntime.jsx(Ct,{path:t,condition:n.field.condition,children:i},n.name):i}if(core.isField(n.field)){let i=jsxRuntime.jsx(Pr,{name:n.name,field:n.field},n.name);return n.field.condition?jsxRuntime.jsx(Ct,{path:t,condition:n.field.condition,children:i},n.name):i}let r=jsxRuntime.jsx(Lo,{name:n.name,field:n.field},n.name);return n.field.condition?jsxRuntime.jsx(Ct,{path:t,condition:n.field.condition,children:r},n.name):r})})},_d=({field:e,value:t,path:o})=>{let{itemField:n,placeholder:r}=e;return jsxRuntime.jsx(reactNative.View,{style:R.listContainer,children:jsxRuntime.jsx(Yt,{header:()=>jsxRuntime.jsx(reactNative.Text,{style:R.listHeader,children:r}),initExpanded:true,children:jsxRuntime.jsx(reactNative.View,{style:R.listContent,children:t?.length?t.map((i,a)=>jsxRuntime.jsx(reactNative.View,{style:R.listItem,children:jsxRuntime.jsx(qr,{path:`${o}.${a}`,field:{...n,placeholder:`${r} ${a+1}`},value:i})},`${o}.${a}`)):jsxRuntime.jsx(reactNative.Text,{style:R.emptyListText,children:"No items"})})})})},qr=({field:e,value:t,path:o,storagePath:n})=>{let{updateField:r}=react.useDataView();return core.isField(e)?r?jsxRuntime.jsx(Kr,{storagePath:n,field:e,value:t,onSubmit:i=>r(o,i)}):jsxRuntime.jsx(Nt,{field:e,value:t}):core.isListField(e)?jsxRuntime.jsx(_d,{path:o,field:e,value:t}):jsxRuntime.jsx(Jd,{storagePath:n?`${n}.${o}`:void 0,path:o,field:e})},Jd=({field:e,value:t,onClose:o,onDelete:n,onSubmit:r,itemName:i,storagePath:a,path:s=""})=>{let{name:l,children:p}=e,[c,d]=Vi.useState(false);return jsxRuntime.jsx(react.DataViewProvider,{value:t,onSubmit:r,children:jsxRuntime.jsx(Yt,{alwaysExpanded:true,header:()=>jsxRuntime.jsxs(reactNative.View,{style:R.dataViewHeader,children:[jsxRuntime.jsx(reactNative.Text,{style:R.dataViewTitle,children:l}),jsxRuntime.jsxs(reactNative.View,{style:R.dataViewActions,children:[n&&jsxRuntime.jsx(Xt,{onDelete:n,itemName:i??"item"}),r&&jsxRuntime.jsx(reactNative.TouchableOpacity,{onPress:()=>d(true),children:jsxRuntime.jsx(reactNative.Text,{children:"Edit"})}),o&&jsxRuntime.jsx(reactNative.TouchableOpacity,{onPress:o,children:jsxRuntime.jsx(reactNative.Text,{children:"Close"})})]})]}),children:c&&r?jsxRuntime.jsx(qd,{storagePath:a,field:e,value:t,onSubmit:r,onBack:()=>d(false)}):jsxRuntime.jsx(reactNative.View,{style:R.dataViewContent,children:Object.entries(p).map(([u,f])=>jsxRuntime.jsx(qr,{storagePath:a?`${a}/${u}`:void 0,path:s?`${s}.${u}`:u,field:f,value:t?.[u]},u))})})})},Xr=({onSubmit:e,onBack:t,field:o,value:n,buttonText:r="SUBMIT",renderFooter:i,storagePath:a})=>{let s=Vi.useMemo(()=>({field:o,value:n,onSubmit:e,storagePath:a}),[o,n,e,a]),{submit:l,uploads:p,isLoading:c}=react.useSubmitData(s),d=react.useFormSubmit(o,l);return jsxRuntime.jsxs(reactNative.View,{style:R.container,children:[jsxRuntime.jsx(Lo,{name:"",field:o}),jsxRuntime.jsx(Mr,{isLoading:c,uploads:p,onSubmit:d,renderFooter:i,onBack:t,buttonText:r})]})},Kd=({onSubmit:e,field:t,value:o,...n})=>{let r=Vi.useMemo(()=>({children:{value:t}}),[t]);return jsxRuntime.jsx(Xr,{field:r,value:{value:o},onSubmit:i=>e(i),...n})},qd=({field:e,...t})=>{let o=core.isField(e)||core.isListField(e)?jsxRuntime.jsx(Kd,{field:e,...t}):jsxRuntime.jsx(Xr,{field:e,...t});return jsxRuntime.jsx(react.ChempoFormProvider,{children:o})};var ru=()=>{let{colorMode:e,toggleColorMode:t}=react.useTheme(),o=e==="dark",n=react.useIconColor(),r=o?"moon":"sunny",i=react.useBackgroundColor(100);return jsxRuntime.jsx(reactNative.TouchableOpacity,{onPress:t,style:[Qr.button,{backgroundColor:i}],children:jsxRuntime.jsx(vectorIcons.Ionicons,{name:r,size:16,color:n})})},Rw=()=>jsxRuntime.jsx(reactNative.View,{style:Qr.container,children:jsxRuntime.jsx(ru,{})}),Qr=reactNative.StyleSheet.create({container:{position:"absolute",bottom:12,right:12},button:{width:25,height:25,borderRadius:16,justifyContent:"center",alignItems:"center"}});var ti={closeMessage:()=>reactNativeNotifier.Notifier.hideNotification(),showMessage:({title:e,type:t,duration:o,message:n})=>{let r=t==="info"?reactNativeNotifier.NotifierComponents.Notification:reactNativeNotifier.NotifierComponents.Alert,i={alertType:t==="error"?"error":"success"};return reactNativeNotifier.Notifier.showNotification({title:e,description:n,duration:o,Component:r,componentProps:i}),"root"}};var oi=e=>{let{initialColorMode:t,theme:o}=e??{},[n,r]=Vi.useState(t??"light");return Vi.useMemo(()=>({colorMode:n,setColorMode:r,theme:o}),[n,r,o])};var ri=()=>{let e=()=>{let{width:o,height:n}=reactNative.Dimensions.get("window");react.useScreen.setState({width:o,height:n,isMobile:true,isPortrait:o<n});};e();let t=reactNative.Dimensions.addEventListener("change",e);return ()=>{t.remove();}};reactNativePaperDates.registerTranslation("en",reactNativePaperDates.en);var _w=({theme:e,initialColorMode:t,...o})=>{let n=Vi.useMemo(()=>({theme:e,initialColorMode:t}),[e,t]),r=oi(n);return jsxRuntime.jsx(react.ChempoProvider,{toast:ti,theme:r,initializeScreen:ri,...o})};exports.AbsoluteDarkModeToggle=Rw;exports.AnimatedCenter=at;exports.Center=ue;exports.ChempoNativeProvider=_w;exports.CircularProgress=In;exports.CollapseHorizontal=Iu;exports.ContentBox=Ou;exports.DarkModeToggle=ru;exports.DataView=Jd;exports.DeleteButton=Xt;exports.DeleteConfirmAlert=Ei;exports.DropShadow=jt;exports.Editable=Kr;exports.ExpandOnMount=np;exports.Expandable=Yt;exports.FieldForm=Kd;exports.FieldMapForm=Xr;exports.FileView=vt;exports.Form=qd;exports.FormElement=Lo;exports.FullSizeContainer=dp;exports.FullSizeProvider=up;exports.ImageViewOverlay=An;exports.ListFieldInput=Yd;exports.Loading=oo;exports.LoadingButton=Mp;exports.LoadingImage=Bn;exports.LoadingLogo=ge;exports.LoadingOverlay=mt;exports.LoadingSwitch=_m;exports.LottieLoadingLogo=fn;exports.MediaFeed=Nf;exports.StandaloneInput=Gr;exports.Toggle=Up;exports.Txt=G;exports.initializeScreen=ri;exports.nativeToast=ti;exports.useFullSize=pp;exports.useMediaFeed=na;exports.useThemeState=oi;//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map