Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

poon-ui

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

poon-ui - npm Package Compare versions

Comparing version 1.0.8 to 1.0.9

741

dist/index.js

@@ -1,90 +0,5 @@

import React, { useMemo, forwardRef, useState, useRef, useEffect, Fragment, useImperativeHandle, Children, memo, createElement } from 'react';
import React, { forwardRef, useState, useRef, useEffect, useMemo, Fragment, useImperativeHandle, Children, memo, createElement } from 'react';
import { randomId, createBus, useBus } from 'poon-router/util.js';
import { navigation } from 'poon-router';
const array = new Array(12).fill(0);
const ActivityIndicator = ({
size = 16,
color = '#fff'
}) => {
const renderSegment = (x, i) => {
const style = {
'width': 1.7,
'borderRadius': 1,
'left': size / 2 - 1,
'height': size / 4,
'animationDelay': (-1.1 + .1 * i).toFixed(1) + 's',
'transform': `rotate(${30 * i}deg)`,
'backgroundColor': color,
'transformOrigin': `50% ${size / 2}px`
};
return /*#__PURE__*/React.createElement("div", {
key: i,
style: style
});
};
return /*#__PURE__*/React.createElement("div", {
className: "activity-indicator",
style: {
width: size,
height: size
},
children: array.map(renderSegment)
});
};
const clamp = (num, min, max) => Math.min(Math.max(num, min), max);
const bounce = (num, min, max) => {
if (num > max) return max + (max + num) / 50;
if (num < min) return min - (min - num) / 50;
return num;
};
const easeOutCubic = t => --t * t * t + 1;
class AnimatedValue {
constructor(initialValue) {
this.listeners = [];
this.value = initialValue;
this.oldValue = initialValue;
}
setValue = (value, force = true) => {
if (force) {
// Stop animations and set the checkpoint
delete this.id;
this.oldValue = value;
}
this.value = value;
this.listeners.forEach(fn => fn(value));
};
spring = (finalValue, duration = AnimatedValue.defaultAnimationDuration) => new Promise(resolve => {
if (finalValue === this.value) return; // cancel unnecessary animation
const t0 = this.id = performance.now(); // a unique id for this animation lifecycle
const oldValue = this.value;
const animate = t => {
if (t0 !== this.id) return;
const elapsed = Math.max(0, t - t0); // time hack
if (elapsed >= duration) {
this.setValue(finalValue, true);
resolve();
} else {
const d = (finalValue - oldValue) * easeOutCubic(elapsed / duration);
this.setValue(oldValue + d, false);
requestAnimationFrame(animate);
}
};
animate(t0);
});
on = fn => {
this.listeners.push(fn);
return () => this.listeners = this.listeners.filter(i => i !== fn);
};
stop = () => {
delete this.id;
};
}
AnimatedValue.defaultAnimationDuration = 300;
const useAnimatedValue = initialValue => useMemo(() => {
return new AnimatedValue(initialValue);
}, []);
const c = (...rest) => rest.filter(Boolean).join(' ');

@@ -147,70 +62,2 @@ const toPercent = val => `${val * 100}%`;

const iOS = /iPad|iPhone|iPod/.test(navigator.platform);
const iconMap = {
'os:back': iOS ? 'arrow_back_ios' : 'arrow_back',
'os:share': iOS ? 'ios_share' : 'share',
'os:close': iOS ? 'keyboard_arrow_down' : 'close'
};
const Icon = ({
icon,
className,
color,
title,
size,
onClick
}) => /*#__PURE__*/React.createElement("i", {
className: c('material-icons', className),
style: {
color,
fontSize: size
},
title: title,
onClick: onClick,
children: iconMap[icon] || icon
});
const TouchableRow = ({
title,
meta,
leftIcon,
href,
onClick,
onPressMore,
target,
children,
caret,
disabled,
RightComponent,
className,
active
}) => /*#__PURE__*/React.createElement(Touchable, {
className: c('touchable-highlight touchable-row', disabled && 'disabled', className),
onClick: onClick,
href: href,
target: target,
active: active
}, /*#__PURE__*/React.createElement("div", {
className: "touchable-row-left"
}, typeof leftIcon === 'string' ? /*#__PURE__*/React.createElement("div", {
className: "touchable-row-icon"
}, /*#__PURE__*/React.createElement(Icon, {
icon: leftIcon
})) : null, typeof leftIcon === 'object' ? /*#__PURE__*/React.createElement("div", {
className: "touchable-row-icon"
}, leftIcon) : null, /*#__PURE__*/React.createElement("div", {
className: "touchable-row-content"
}, title ? /*#__PURE__*/React.createElement("div", {
className: "touchable-row-title",
children: title
}) : null, meta ? /*#__PURE__*/React.createElement("div", {
className: "meta",
children: meta
}) : null, children)), RightComponent, onPressMore ? /*#__PURE__*/React.createElement(Touchable, {
onClick: onPressMore
}, /*#__PURE__*/React.createElement(Icon, {
icon: "more_vert"
})) : null, caret ? /*#__PURE__*/React.createElement(Icon, {
icon: "chevron_right"
}) : null);
const FLICK_SPEED = .25; // pixels per ms

@@ -401,8 +248,2 @@ const CUTOFF_INTERVAL = 50; // ms

el.current.addEventListener('wheel', handlers.onWheel, listenerOptions);
// if (opts.enablePointerControls) {
// el.current.addEventListener('pointerdown', handlers.onTouchStart, listenerOptions);
// el.current.addEventListener('pointermove', handlers.onTouchMove, listenerOptions);
// el.current.addEventListener('pointerup', handlers.onTouchEnd, listenerOptions);
// }
return () => {

@@ -414,7 +255,2 @@ if (!el.current) return;

el.current.removeEventListener('wheel', handlers.onWheel);
// if (opts.enablePointerControls) {
// el.current.removeEventListener('pointerdown', handlers.onTouchStart);
// el.current.removeEventListener('pointermove', handlers.onTouchMove);
// el.current.removeEventListener('pointerup', handlers.onTouchEnd);
// }
};

@@ -427,102 +263,79 @@ }, [handlers, deps]);

};
document.addEventListener('touchstart', function (e) {
// is not near edge of view, exit.
if (e.pageX > 10 && e.pageX < window.innerWidth - 10) return;
// prevent swipe to navigate gesture.
e.preventDefault();
});
const BottomSheet = /*#__PURE__*/forwardRef(({
className,
visible,
pan,
children,
onClose,
onPress,
showShade,
showHandle
}, ref) => {
const shadeEl = useRef();
const sheetEl = useRef();
const {
height
} = usePanGestures(sheetEl, {
onMove: e => {
pan.setValue(e.height - Math.max(e.d.y / 100, e.d.y));
},
onUp: e => {
if (e.flick.y === 1 || e.d.y > e.height / 2) {
close();
const clamp = (num, min, max) => Math.min(Math.max(num, min), max);
const bounce = (num, min, max) => {
if (num > max) return max + (max + num) / 50;
if (num < min) return min - (min - num) / 50;
return num;
};
const easeOutCubic = t => --t * t * t + 1;
class AnimatedValue {
constructor(initialValue) {
this.listeners = [];
this.value = initialValue;
this.oldValue = initialValue;
}
setValue = (value, force = true) => {
if (force) {
// Stop animations and set the checkpoint
delete this.id;
this.oldValue = value;
}
this.value = value;
this.listeners.forEach(fn => fn(value));
};
spring = (finalValue, duration = AnimatedValue.defaultAnimationDuration) => new Promise(resolve => {
if (finalValue === this.value) return; // cancel unnecessary animation
const t0 = this.id = performance.now(); // a unique id for this animation lifecycle
const oldValue = this.value;
const animate = t => {
if (t0 !== this.id) return;
const elapsed = Math.max(0, t - t0); // time hack
if (elapsed >= duration) {
this.setValue(finalValue, true);
resolve();
} else {
pan.spring(e.height);
const d = (finalValue - oldValue) * easeOutCubic(elapsed / duration);
this.setValue(oldValue + d, false);
requestAnimationFrame(animate);
}
}
};
animate(t0);
});
const close = () => pan.spring(0).then(onClose);
useEffect(() => {
if (!height) return;
return pan.on(value => {
sheetEl.current.style.transform = `translateY(-${value}px)`;
if (shadeEl.current) shadeEl.current.style.opacity = value / height;
});
}, [height]);
useEffect(() => {
if (!height) return;
if (visible) {
// show
pan.spring(height);
} else {
// hide
pan.spring(0).then(onClose);
}
}, [visible, height, onClose]);
return /*#__PURE__*/React.createElement("div", {
className: "layer"
}, visible && showShade ? /*#__PURE__*/React.createElement("div", {
className: "shade shade-bottom-sheet",
ref: shadeEl,
onClick: close
}) : null, /*#__PURE__*/React.createElement("div", {
ref: sheetEl,
className: c('sheet', className),
onClick: onPress
}, showHandle ? /*#__PURE__*/React.createElement("div", {
className: "handle"
}) : null, children));
});
on = fn => {
this.listeners.push(fn);
return () => this.listeners = this.listeners.filter(i => i !== fn);
};
stop = () => {
delete this.id;
};
}
AnimatedValue.defaultAnimationDuration = 300;
const useAnimatedValue = initialValue => useMemo(() => {
return new AnimatedValue(initialValue);
}, []);
const bus = createBus(null);
const pan = new AnimatedValue(0);
const ActionSheet = () => {
const sheet = useBus(bus);
const renderOption = (option, i) => {
const clickOption = e => {
if (option.onClick) option.onClick();
if (sheet.callback) sheet.callback(option.value);
pan.spring(0).then(() => bus.update(0));
};
return /*#__PURE__*/React.createElement(TouchableRow, {
key: i,
title: option.name,
leftIcon: option.icon,
onClick: clickOption,
disabled: option.disabled,
target: option.target,
href: option.href
});
};
if (!sheet) return null;
return /*#__PURE__*/React.createElement(BottomSheet, {
pan: pan,
visible: !!sheet,
onClose: () => bus.update(null),
showShade: true
}, /*#__PURE__*/React.createElement("div", {
className: "action-sheet-title"
}, sheet && sheet.title), /*#__PURE__*/React.createElement("hr", null), sheet.options.map(renderOption));
const iOS = /iPad|iPhone|iPod/.test(navigator.platform);
const iconMap = {
'os:back': iOS ? 'arrow_back_ios' : 'arrow_back',
'os:share': iOS ? 'ios_share' : 'share',
'os:close': iOS ? 'keyboard_arrow_down' : 'close'
};
const showActionSheet = (title, options, callback) => bus.update({
const Icon = ({
icon,
className,
color,
title,
options,
callback
size,
onClick
}) => /*#__PURE__*/React.createElement("i", {
className: c('material-icons', className),
style: {
color,
fontSize: size
},
title: title,
onClick: onClick,
children: iconMap[icon] || icon
});

@@ -639,2 +452,33 @@

const array = new Array(12).fill(0);
const ActivityIndicator = ({
size = 16,
color = '#fff'
}) => {
const renderSegment = (x, i) => {
const style = {
'width': 1.7,
'borderRadius': 1,
'left': size / 2 - 1,
'height': size / 4,
'animationDelay': (-1.1 + .1 * i).toFixed(1) + 's',
'transform': `rotate(${30 * i}deg)`,
'backgroundColor': color,
'transformOrigin': `50% ${size / 2}px`
};
return /*#__PURE__*/React.createElement("div", {
key: i,
style: style
});
};
return /*#__PURE__*/React.createElement("div", {
className: "activity-indicator",
style: {
width: size,
height: size
},
children: array.map(renderSegment)
});
};
const Button = ({

@@ -654,3 +498,4 @@ className,

submit,
fullWidth
fullWidth,
target
}) => {

@@ -677,3 +522,4 @@ const cn = c('btn', className, disabled && 'disabled', fullWidth && 'full-width', color && `btn-${color}`);

tabIndex: tabIndex,
children: renderInner()
children: renderInner(),
target: target
});

@@ -760,2 +606,141 @@ };

const TouchableRow = ({
title,
meta,
leftIcon,
href,
onClick,
onPressMore,
target,
children,
caret,
disabled,
RightComponent,
className,
active
}) => /*#__PURE__*/React.createElement(Touchable, {
className: c('touchable-highlight touchable-row', disabled && 'disabled', className),
onClick: onClick,
href: href,
target: target,
active: active
}, /*#__PURE__*/React.createElement("div", {
className: "touchable-row-left"
}, typeof leftIcon === 'string' ? /*#__PURE__*/React.createElement("div", {
className: "touchable-row-icon"
}, /*#__PURE__*/React.createElement(Icon, {
icon: leftIcon
})) : null, typeof leftIcon === 'object' ? /*#__PURE__*/React.createElement("div", {
className: "touchable-row-icon"
}, leftIcon) : null, /*#__PURE__*/React.createElement("div", {
className: "touchable-row-content"
}, title ? /*#__PURE__*/React.createElement("div", {
className: "touchable-row-title",
children: title
}) : null, meta ? /*#__PURE__*/React.createElement("div", {
className: "meta",
children: meta
}) : null, children)), RightComponent, onPressMore ? /*#__PURE__*/React.createElement(Touchable, {
onClick: onPressMore
}, /*#__PURE__*/React.createElement(Icon, {
icon: "more_vert"
})) : null, caret ? /*#__PURE__*/React.createElement(Icon, {
icon: "chevron_right"
}) : null);
const BottomSheet = /*#__PURE__*/forwardRef(({
className,
visible,
pan,
children,
onClose,
onPress,
showShade,
showHandle
}, ref) => {
const shadeEl = useRef();
const sheetEl = useRef();
const {
height
} = usePanGestures(sheetEl, {
onMove: e => {
pan.setValue(e.height - Math.max(e.d.y / 100, e.d.y));
},
onUp: e => {
if (e.flick.y === 1 || e.d.y > e.height / 2) {
close();
} else {
pan.spring(e.height);
}
}
});
const close = () => pan.spring(0).then(onClose);
useEffect(() => {
if (!height) return;
return pan.on(value => {
sheetEl.current.style.transform = `translateY(-${value}px)`;
if (shadeEl.current) shadeEl.current.style.opacity = value / height;
});
}, [height]);
useEffect(() => {
if (!height) return;
if (visible) {
// show
pan.spring(height);
} else {
// hide
pan.spring(0).then(onClose);
}
}, [visible, height, onClose]);
return /*#__PURE__*/React.createElement("div", {
className: "layer"
}, visible && showShade ? /*#__PURE__*/React.createElement("div", {
className: "shade shade-bottom-sheet",
ref: shadeEl,
onClick: close
}) : null, /*#__PURE__*/React.createElement("div", {
ref: sheetEl,
className: c('sheet', className),
onClick: onPress
}, showHandle ? /*#__PURE__*/React.createElement("div", {
className: "handle"
}) : null, children));
});
const bus = createBus(null);
const pan = new AnimatedValue(0);
const ActionSheet = () => {
const sheet = useBus(bus);
const renderOption = (option, i) => {
const clickOption = e => {
if (option.onClick) option.onClick();
if (sheet.callback) sheet.callback(option.value);
pan.spring(0).then(() => bus.update(0));
};
return /*#__PURE__*/React.createElement(TouchableRow, {
key: i,
title: option.name,
leftIcon: option.icon,
onClick: clickOption,
disabled: option.disabled,
target: option.target,
href: option.href
});
};
if (!sheet) return null;
return /*#__PURE__*/React.createElement(BottomSheet, {
pan: pan,
visible: !!sheet,
onClose: () => bus.update(null),
showShade: true
}, /*#__PURE__*/React.createElement("div", {
className: "action-sheet-title"
}, sheet && sheet.title), /*#__PURE__*/React.createElement("hr", null), sheet.options.map(renderOption));
};
const showActionSheet = (title, options, callback) => bus.update({
title,
options,
callback
});
const Avatar = ({

@@ -803,2 +788,11 @@ imageId,

const CheckBox = ({
active,
undetermined
}) => /*#__PURE__*/React.createElement("div", {
className: c('toggle-check', active && 'active', undetermined && 'undetermined')
}, /*#__PURE__*/React.createElement(Icon, {
icon: undetermined ? 'horizontal_rule' : active ? 'check' : null
}));
const closeImage = {

@@ -982,11 +976,2 @@ 'card': 'os:back',

const CheckBox = ({
active,
undetermined
}) => /*#__PURE__*/React.createElement("div", {
className: c('toggle-check', active && 'active', undetermined && 'undetermined')
}, /*#__PURE__*/React.createElement(Icon, {
icon: undetermined ? 'horizontal_rule' : active ? 'check' : null
}));
const CircleCheck = ({

@@ -1155,2 +1140,9 @@ active

const Emoji = ({
emoji
}) => /*#__PURE__*/React.createElement("span", {
className: "emoji",
children: emoji
});
const DropdownItem = ({

@@ -1175,9 +1167,2 @@ title,

const Emoji = ({
emoji
}) => /*#__PURE__*/React.createElement("span", {
className: "emoji",
children: emoji
});
const Fab = ({

@@ -1238,23 +1223,32 @@ icon,

const HeaderButton = ({
icon,
const List = ({
title,
badge,
items = [],
keyExtractor = r => r._id,
renderItem,
loading,
disabled,
onClick,
active,
href
}) => /*#__PURE__*/React.createElement(Touchable, {
className: c('header-button center', title === 'Cancel' && 'header-cancel'),
onClick: onClick,
loading: loading,
disabled: disabled,
active: active,
href: href
}, icon ? /*#__PURE__*/React.createElement(Icon, {
icon: icon
}) : null, title ? /*#__PURE__*/React.createElement("span", null, title) : null, badge ? /*#__PURE__*/React.createElement("span", {
className: "badge"
}, badge) : null);
className,
ListEmptyComponent,
HeaderComponent,
children,
showSeparators = true
}) => {
const renderList = () => {
if (loading || !items) return null;
if (ListEmptyComponent && items.length === 0) return ListEmptyComponent;
return items.map((item, i) => /*#__PURE__*/React.createElement(Fragment, {
key: keyExtractor(item)
}, renderItem(item, i), showSeparators && i < items.length - 1 && /*#__PURE__*/React.createElement("hr", null)));
};
const renderChild = (child, i) => /*#__PURE__*/React.createElement(Fragment, {
key: i
}, child, i < children.length - 1 && /*#__PURE__*/React.createElement("hr", null));
return /*#__PURE__*/React.createElement("div", {
className: c('list', className)
}, title ? /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
className: "list-title"
}, title), /*#__PURE__*/React.createElement("hr", null)) : null, HeaderComponent, items.length || children ? /*#__PURE__*/React.createElement("div", {
className: "list-body"
}, renderList(), Children.map(children, renderChild)) : ListEmptyComponent);
};

@@ -1296,33 +1290,35 @@ const Image = ({

const List = ({
const HeaderButton = ({
icon,
title,
items = [],
keyExtractor = r => r._id,
renderItem,
badge,
loading,
className,
ListEmptyComponent,
HeaderComponent,
children,
showSeparators = true
}) => {
const renderList = () => {
if (loading || !items) return null;
if (ListEmptyComponent && items.length === 0) return ListEmptyComponent;
return items.map((item, i) => /*#__PURE__*/React.createElement(Fragment, {
key: keyExtractor(item)
}, renderItem(item, i), showSeparators && i < items.length - 1 && /*#__PURE__*/React.createElement("hr", null)));
};
const renderChild = (child, i) => /*#__PURE__*/React.createElement(Fragment, {
key: i
}, child, i < children.length - 1 && /*#__PURE__*/React.createElement("hr", null));
return /*#__PURE__*/React.createElement("div", {
className: c('list', className)
}, title ? /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
className: "list-title"
}, title), /*#__PURE__*/React.createElement("hr", null)) : null, HeaderComponent, items.length || children ? /*#__PURE__*/React.createElement("div", {
className: "list-body"
}, renderList(), Children.map(children, renderChild)) : ListEmptyComponent);
};
disabled,
onClick,
active,
href
}) => /*#__PURE__*/React.createElement(Touchable, {
className: c('header-button center', title === 'Cancel' && 'header-cancel'),
onClick: onClick,
loading: loading,
disabled: disabled,
active: active,
href: href
}, icon ? /*#__PURE__*/React.createElement(Icon, {
icon: icon
}) : null, title ? /*#__PURE__*/React.createElement("span", null, title) : null, badge ? /*#__PURE__*/React.createElement("span", {
className: "badge"
}, badge) : null);
const PercentBar = ({
percent
}) => /*#__PURE__*/React.createElement("div", {
className: "percent-bar"
}, /*#__PURE__*/React.createElement("div", {
className: "percent-bar-inner",
style: {
width: `${percent * 100}%`
}
}));
const modalState = createBus([]);

@@ -1343,12 +1339,13 @@ const renderModal = modal => /*#__PURE__*/React.createElement("div", {

const PercentBar = ({
percent
}) => /*#__PURE__*/React.createElement("div", {
className: "percent-bar"
}, /*#__PURE__*/React.createElement("div", {
className: "percent-bar-inner",
const Pill = ({
title,
color,
onClick
}) => /*#__PURE__*/React.createElement(Touchable, {
className: "pill",
onClick: onClick,
style: {
width: `${percent * 100}%`
backgroundColor: color
}
}));
}, title);

@@ -1378,14 +1375,2 @@ const FilterButton = ({

const Pill = ({
title,
color,
onClick
}) => /*#__PURE__*/React.createElement(Touchable, {
className: "pill",
onClick: onClick,
style: {
backgroundColor: color
}
}, title);
const state = createBus();

@@ -1748,15 +1733,2 @@ const Toast = () => {

const TouchableHighlight = ({
href,
onClick,
children,
disabled,
className
}) => /*#__PURE__*/React.createElement(Touchable, {
className: c('touchable-highlight', disabled && 'disabled', className),
onClick: onClick,
href: href,
children: children
});
const PagerDot = ({

@@ -2042,2 +2014,37 @@ pan,

const TouchableHighlight = ({
href,
onClick,
children,
disabled,
className
}) => /*#__PURE__*/React.createElement(Touchable, {
className: c('touchable-highlight', disabled && 'disabled', className),
onClick: onClick,
href: href,
children: children
});
const cache = new Map();
const memoize = func => function (...args) {
const key = args[0];
if (!cache.has(key)) cache.set(key, func.apply(this, args));
return cache.get(key);
};
const loadCss = memoize(url => new Promise(resolve => {
const el = document.createElement('link');
el.setAttribute('rel', 'stylesheet');
el.setAttribute('href', url);
el.onload = () => resolve();
document.head.appendChild(el);
}));
const loadScript = memoize((url, windowKey) => new Promise(resolve => {
const script = document.createElement('script');
script.type = 'text/javascript';
script.async = true;
script.src = url;
script.onload = () => resolve(window[windowKey]);
document.head.appendChild(script);
}));
// Sync Viewport Size

@@ -2067,24 +2074,2 @@ const syncSize = ({

const cache = new Map();
const memoize = func => function (...args) {
const key = args[0];
if (!cache.has(key)) cache.set(key, func.apply(this, args));
return cache.get(key);
};
const loadCss = memoize(url => new Promise(resolve => {
const el = document.createElement('link');
el.setAttribute('rel', 'stylesheet');
el.setAttribute('href', url);
el.onload = () => resolve();
document.head.appendChild(el);
}));
const loadScript = memoize((url, windowKey) => new Promise(resolve => {
const script = document.createElement('script');
script.type = 'text/javascript';
script.async = true;
script.src = url;
script.onload = () => resolve(window[windowKey]);
document.head.appendChild(script);
}));
export { ActionSheet, ActivityIndicator, Alert, AnimatedValue, Avatar, BottomSheet, BreadCrumbs, Button, Card, CheckBox, CircleCheck, ConnectionIndicator, CornerDialog, DashboardIcon, Dropdown, DropdownItem, Emoji, FLICK_SPEED, Fab, FilterButton, FullScreen, HeaderButton, Icon, Image, List, Modal, PercentBar, Pill, Placeholder, PoonOverlays, ProgressIndicator, ProgressRing, PullIndicator, RadioButton, Reveal, ScreenHeader, ScrollView, SegmentedController, Select, Shade, TabularRow, Tag, TextInput, Toast, Touchable, TouchableHighlight, TouchableRow, ViewPager, Window, bounce, c, clamp, cyrb53, easeOutCubic, hideModal, loadCss, loadScript, memoize, modalState, setRevealOrigin, showActionSheet, showAlert, showModal, toPercent, toast, useAnimatedValue, usePanGestures, useSize, useVirtualKeyboard };

@@ -1,1 +0,1 @@

import e,{useMemo as t,forwardRef as n,useState as l,useRef as a,useEffect as r,Fragment as c,useImperativeHandle as i,Children as s,memo as o,createElement as d}from"react";import{randomId as m,createBus as u,useBus as h}from"poon-router/util.js";import{navigation as p}from"poon-router";const v=new Array(12).fill(0),g=({size:t=16,color:n="#fff"})=>e.createElement("div",{className:"activity-indicator",style:{width:t,height:t},children:v.map(((l,a)=>{const r={width:1.7,borderRadius:1,left:t/2-1,height:t/4,animationDelay:(.1*a-1.1).toFixed(1)+"s",transform:`rotate(${30*a}deg)`,backgroundColor:n,transformOrigin:`50% ${t/2}px`};return e.createElement("div",{key:a,style:r})}))}),E=(e,t,n)=>Math.min(Math.max(e,t),n),f=(e,t,n)=>e>n?n+(n+e)/50:e<t?t-(t-e)/50:e,y=e=>--e*e*e+1;class b{constructor(e){this.listeners=[],this.value=e,this.oldValue=e}setValue=(e,t=!0)=>{t&&(delete this.id,this.oldValue=e),this.value=e,this.listeners.forEach((t=>t(e)))};spring=(e,t=b.defaultAnimationDuration)=>new Promise((n=>{if(e===this.value)return;const l=this.id=performance.now(),a=this.value,r=c=>{if(l!==this.id)return;const i=Math.max(0,c-l);if(i>=t)this.setValue(e,!0),n();else{const n=(e-a)*y(i/t);this.setValue(a+n,!1),requestAnimationFrame(r)}};r(l)}));on=e=>(this.listeners.push(e),()=>this.listeners=this.listeners.filter((t=>t!==e)));stop=()=>{delete this.id}}b.defaultAnimationDuration=300;const N=e=>t((()=>new b(e)),[]),k=(...e)=>e.filter(Boolean).join(" "),C=e=>100*e+"%",x=n((({href:t,onClick:n,className:r,active:c,target:i,children:s,style:o,disableMenu:d},m)=>{const[u,h]=l(!1),p=a(!1),v=e=>{e.button&&0!==e.button||(e.stopPropagation(),p.current=!1,h(!0))},g=()=>{h(!1)};return e.createElement(t?"a":"button",{href:t,onTouchStart:v,onTouchMove:g,onTouchEnd:g,onMouseDown:v,onMouseUp:g,onMouseLeave:g,onClick:e=>{if(p.current)return e.preventDefault();n&&(t||e.preventDefault(),n(e))},className:k("touchable",r,u&&"touched",d&&"disable-menu",c&&"active"),target:i,draggable:!1,onContextMenu:d?e=>(e.preventDefault(),!1):void 0,style:o,type:"button",ref:m},s)})),w=/iPad|iPhone|iPod/.test(navigator.platform),M={"os:back":w?"arrow_back_ios":"arrow_back","os:share":w?"ios_share":"share","os:close":w?"keyboard_arrow_down":"close"},P=({icon:t,className:n,color:l,title:a,size:r,onClick:c})=>e.createElement("i",{className:k("material-icons",n),style:{color:l,fontSize:r},title:a,onClick:c,children:M[t]||t}),S=({title:t,meta:n,leftIcon:l,href:a,onClick:r,onPressMore:c,target:i,children:s,caret:o,disabled:d,RightComponent:m,className:u,active:h})=>e.createElement(x,{className:k("touchable-highlight touchable-row",d&&"disabled",u),onClick:r,href:a,target:i,active:h},e.createElement("div",{className:"touchable-row-left"},"string"==typeof l?e.createElement("div",{className:"touchable-row-icon"},e.createElement(P,{icon:l})):null,"object"==typeof l?e.createElement("div",{className:"touchable-row-icon"},l):null,e.createElement("div",{className:"touchable-row-content"},t?e.createElement("div",{className:"touchable-row-title",children:t}):null,n?e.createElement("div",{className:"meta",children:n}):null,s)),m,c?e.createElement(x,{onClick:c},e.createElement(P,{icon:"more_vert"})):null,o?e.createElement(P,{icon:"chevron_right"}):null),T=.25,L={capture:!1,passive:!1},D=(e=0,t,n)=>{const l=Math.min(n,50)/50;return e*(1-l)+t*l},V=e=>{const[t,n]=l({width:e.current?.clientWidth,height:e.current?.clientHeight});return r((()=>{if(!e.current)return;const t=new ResizeObserver((e=>{const t=e[0].borderBoxSize[0];n({height:t.blockSize,width:t.inlineSize})}));return t.observe(e.current),()=>t.disconnect()}),[e.current]),t};let $;const z=(e,n={},l)=>{const{width:c,height:i}=V(e),s=a({id:m()}).current,o=t((()=>{if(!e.current)return{};const t=()=>{const e=Date.now(),t=e-s.last.ts;if(t>0){const n=(s.x-s.last.x)/t,l=(s.y-s.last.y)/t;s.v={x:D(s.v.x,n,t),y:D(s.v.y,l,t)},s.last={x:s.x,y:s.y,ts:e}}};return{onTouchStart:e=>{if($=null,e.touches.length>1){const t=e.touches[0].clientX-e.touches[1].clientX,n=e.touches[0].clientY-e.touches[1].clientY;return void(s.pinch={d0:Math.sqrt(Math.pow(t,2)+Math.pow(n,2))})}const t=e.touches?e.touches[0].clientX:e.clientX,l=e.touches?e.touches[0].clientY:e.clientY;Object.assign(s,{width:c,height:i,current:{x:t,y:l},touch:!0,origin:{x:t,y:l},locked:!1,v:{x:0,y:0},s:{x:0,y:0},d:{x:0,y:0},flick:null,last:{ts:Date.now(),x:t,y:l}}),n.onDown&&n.onDown(s)},onTouchMove:l=>{if($&&$!==e.current)$.className.includes("scroller")||l.preventDefault();else{if(s.pinch)if(2===l.touches.length){const e=l.touches[0].clientX-l.touches[1].clientX,t=l.touches[0].clientY-l.touches[1].clientY;s.pinch.d=Math.sqrt(Math.pow(e,2)+Math.pow(t,2)),s.pinch.ratio=s.pinch.d/s.pinch.d0}else delete s.pinch;if(s.x=l.touches?l.touches[0].clientX:l.clientX,s.y=l.touches?l.touches[0].clientY:l.clientY,t(),s.d={x:s.x-s.origin.x,y:s.y-s.origin.y},s.abs={x:Math.abs(s.d.x),y:Math.abs(s.d.y)},!s.locked&&(s.abs.y>10||s.abs.x>10)&&(s.locked=s.abs.y>s.abs.x?"v":"h"),s.locked){if(s.touch=(e=>!n.onCapture||n.onCapture(s,e))(l),!s.touch)return;$=e.current,n.onMove&&n.onMove(s,l)}}},onTouchEnd:()=>{$&&$!==e.current||s.touch&&s.locked&&(t(),s.s={x:Math.abs(s.v.x),y:Math.abs(s.v.y)},s.flick={x:"h"===s.locked&&s.s.x>=T&&Math.sign(s.v.x),y:"v"===s.locked&&s.s.y>=T&&Math.sign(s.v.y)},n.onUp&&n.onUp(s))},onWheel:t=>{e.current.scrollTop+=t.deltaY,n.onPan&&n.onPan({d:{x:t.deltaX,y:t.deltaY}})}}}),[e,i,c,l]);return r((()=>{if(e.current)return e.current.addEventListener("touchstart",o.onTouchStart,L),e.current.addEventListener("touchmove",o.onTouchMove,L),e.current.addEventListener("touchend",o.onTouchEnd,L),e.current.addEventListener("wheel",o.onWheel,L),()=>{e.current&&(e.current.removeEventListener("touchstart",o.onTouchStart),e.current.removeEventListener("touchmove",o.onTouchMove),e.current.removeEventListener("touchend",o.onTouchEnd),e.current.removeEventListener("wheel",o.onWheel))}}),[o,l]),{height:i,width:c}};document.addEventListener("touchstart",(function(e){e.pageX>10&&e.pageX<window.innerWidth-10||e.preventDefault()}));const R=n((({className:t,visible:n,pan:l,children:c,onClose:i,onPress:s,showShade:o,showHandle:d},m)=>{const u=a(),h=a(),{height:p}=z(h,{onMove:e=>{l.setValue(e.height-Math.max(e.d.y/100,e.d.y))},onUp:e=>{1===e.flick.y||e.d.y>e.height/2?v():l.spring(e.height)}}),v=()=>l.spring(0).then(i);return r((()=>{if(p)return l.on((e=>{h.current.style.transform=`translateY(-${e}px)`,u.current&&(u.current.style.opacity=e/p)}))}),[p]),r((()=>{p&&(n?l.spring(p):l.spring(0).then(i))}),[n,p,i]),e.createElement("div",{className:"layer"},n&&o?e.createElement("div",{className:"shade shade-bottom-sheet",ref:u,onClick:v}):null,e.createElement("div",{ref:h,className:k("sheet",t),onClick:s},d?e.createElement("div",{className:"handle"}):null,c))})),X=u(null),W=new b(0),Y=()=>{const t=h(X);return t?e.createElement(R,{pan:W,visible:!!t,onClose:()=>X.update(null),showShade:!0},e.createElement("div",{className:"action-sheet-title"},t&&t.title),e.createElement("hr",null),t.options.map(((n,l)=>e.createElement(S,{key:l,title:n.name,leftIcon:n.icon,onClick:e=>{n.onClick&&n.onClick(),t.callback&&t.callback(n.value),W.spring(0).then((()=>X.update(0)))},disabled:n.disabled,target:n.target,href:n.href})))):null},U=(e,t,n)=>X.update({title:e,options:t,callback:n}),_=n((({pull:t},n)=>e.createElement("div",{className:"pull-indicator center",ref:n},e.createElement(P,{icon:"refresh",color:"#000"})))),I=n((({children:t,className:n,onRefresh:l,horizontal:i},s)=>{const o=s||a(),d=a(),m=a({}).current,u=N(0),h=N(0),p=N(0);z(o,{onDown:()=>{m.canScrollVertical=o.current.scrollHeight>o.current.clientHeight,m.canScrollHorizontal=o.current.scrollWidth>o.current.clientWidth,m.initScrollTop=o.current.scrollTop,m.initScrollLeft=o.current.scrollLeft,h.stop(),p.stop()},onCapture:e=>"v"===e.locked?!!(l&&0===o.current.scrollTop&&e.d.y>0)||!!m.canScrollVertical&&(0===m.initScrollTop&&e.d.y<0||m.initScrollTop>0):"h"===e.locked?!!m.canScrollHorizontal:void 0,onMove:e=>{"v"===e.locked?h.setValue(m.initScrollTop-e.d.y):"h"===e.locked&&p.setValue(m.initScrollLeft-e.d.x),l&&0===m.initScrollTop&&u.setValue(Math.min(70,e.d.y))},onUp:e=>{"v"===e.locked?e.v.y&&h.spring(h.value-2e3*e.v.y,2e3):"h"===e.locked&&e.v.x&&p.spring(p.value-2e3*e.v.x,2e3),l&&0===m.initScrollTop&&(e.d.y>70?u.spring(0).then(l):u.spring(0))}}),r((()=>h.on((e=>{o.current.scrollTop=e}))),[]),r((()=>p.on((e=>o.current.scrollLeft=e))),[]),r((()=>{if(l)return u.on((e=>{const t=e/70;d.current.style.transform=`translateY(${e}px) rotate(${360*t}deg)`,d.current.style.opacity=t}))}),[]);return e.createElement(c,null,l?e.createElement("div",{className:"list-pull"},e.createElement(_,{pull:u,ref:d})):null,e.createElement("div",{className:k("scroller",n,i?"horizontal":"vertical"),ref:o,onScroll:()=>{navigator.virtualKeyboard?.hide(),document.activeElement.blur()},children:t}))})),j=({className:t,title:n,onClick:l,onDown:a,icon:r,href:i,tabIndex:s,color:o,disabled:d,download:m,iconImageUrl:u,loading:h,submit:p,fullWidth:v})=>{const E=k("btn",t,d&&"disabled",v&&"full-width",o&&`btn-${o}`);return e.createElement(x,{type:p?"submit":"button",className:E,onClick:e=>{m&&e.stopPropagation(),l&&l(e)},href:i,onTouchStart:a,tabIndex:s,children:h?e.createElement(g,null):e.createElement(c,null,u?e.createElement("img",{src:u,alt:n}):null,r?e.createElement(P,{icon:r}):null,n?e.createElement("span",null,n):null)})},A=u([]),B=(e,t)=>{A.update(A.state.map((t=>(t===e&&(t.visible=!1),t)))),setTimeout((()=>{e.callback(t),A.update(A.state.filter((t=>t!==e)))}),300)},H=({alert:t,isLast:n})=>e.createElement("div",{className:k("alert-container",n&&t.visible&&t.className)},e.createElement("div",{className:k("alert",n&&t.visible&&"visible"),onClick:e=>e.stopPropagation()},e.createElement("div",{className:"alert-top"},t.title?e.createElement("div",{className:"alert-title"},t.title):null,t.message?e.createElement("div",{className:"alert-message"},t.message):null),t.options?e.createElement(I,{className:k("alert-buttons",t.options.length<=2&&"alert-buttons-horizontal"),children:t.options.map(((n,l)=>e.createElement(x,{key:l,className:k("alert-button",n.destructive&&"destructive"),onClick:()=>{n.onPress&&n.onPress(),B(t,n._id||n.value)},children:n.name,disableMenu:!0})))}):e.createElement("div",{className:"alert-bottom"},e.createElement(j,{color:"white",fullWidth:!0,title:"Close",onClick:()=>B(t)})))),O=()=>{const t=h(A),n=t.filter((e=>e.visible)).pop();return 0===t.length?null:e.createElement("div",{className:k("layer alert-backdrop",t.some((e=>e.visible))&&"visible"),onClick:()=>B(n),children:t.map((t=>e.createElement(H,{key:t.key,alert:t,isLast:n===t})))})},F=(e,t)=>new Promise((n=>{A.update([...A.state,{key:m(),callback:n,visible:!0,options:t,...e}])})),q=({imageId:t,className:n,variant:l,getUrl:a})=>t?e.createElement("img",{draggable:!1,className:k("avatar",n),src:a(t,l)}):e.createElement("div",{draggable:!1,className:k("avatar",n)});q.defaultProps={variant:"normal",getUrl:()=>null};const K=({path:t,onClickPath:n})=>{const l=t.split("/").filter(Boolean);return 0===l.length?null:e.createElement(I,{horizontal:!0,className:"breadcrumbs"},e.createElement(P,{icon:"home",onClick:()=>n("/")}),e.createElement("span",null," / "),l.map(((t,a)=>e.createElement(c,{key:t+"_"+a},e.createElement(x,{onClick:()=>n(),children:t}),a<l.length-1?e.createElement("span",null," / "):null))))},G={card:"os:back",modal:"os:close"},J=({title:t,subtitle:n,presentation:l="card",onClose:a,headerRight:r,SearchComponent:i})=>{const s=G[l];return e.createElement(c,null,e.createElement("div",{className:"header"},e.createElement("div",{className:"header-spacer"},s&&e.createElement(x,{className:"header-close",onClick:e=>{e.stopPropagation(),e.preventDefault(),a()},children:e.createElement(P,{icon:s})})),e.createElement("div",{className:"header-middle"},e.createElement("div",{className:"header-title"},t),n?e.createElement("div",{className:"header-subtitle"},n):null),e.createElement("div",{className:"header-spacer"},r)),i)},Q=({className:t,icon:n,title:l,message:a,children:r})=>e.createElement("div",{className:k("placeholder",t)},n?e.createElement(P,{icon:n}):null,l?e.createElement("div",{className:"title"},l):null,a?e.createElement("div",{className:"placeholder-message"},a):null,r),Z=n((({},t)=>{const n=a();return i(t,(()=>({progress:(e,t)=>{n.current&&(n.current.style.opacity=1-e/t)}}))),e.createElement("div",{className:"shade shade-card",ref:n})})),ee=n((({title:t,subtitle:n,children:c,footer:i,headerRight:s,hasScrollView:o=!0,SearchComponent:d,scrollerRef:m,disableGestures:u,onDrop:h,isVisible:v=!0,animateIn:g=!0,ShadeComponent:E=Z,HeaderComponent:f,className:y},b)=>{b=b||a();const C=a(history.length>1).current,[x,w]=l(!1),M=a(),P=N(g?document.body.clientWidth:0),S=()=>P.spring(T).then((()=>{C&&p.goBack()})),{width:T}=z(b,{onCapture:e=>{if(C&&!u)return"h"===e.locked&&e.d.x>0},onMove:e=>{P.setValue(Math.max(0,e.d.x))},onUp:e=>{1===e.flick.x||e.d.x>e.width/2?S():P.spring(0)}});r((()=>{T&&g&&(v?P.spring(0):P.spring(T))}),[g,v,T]),r((()=>P.on((e=>{b.current&&(b.current.style.transform=`translateX(${e}px)`),M.current&&M.current.progress(e,T)}))),[T]);return e.createElement("div",{className:"layer"},E?e.createElement(E,{ref:M}):null,e.createElement("div",{className:k("card",g&&"animate",y),ref:b,onDragOver:h&&(e=>{e.preventDefault()}),onDragEnter:h&&(e=>{w(!0)}),onDragLeave:h&&(e=>{w(!1)}),onDrop:h&&(e=>{w(!1),h(e)})},null===f?null:f||e.createElement(J,{title:t,subtitle:n,presentation:"card",SearchComponent:d,onClose:S,headerRight:s}),o?e.createElement(I,{className:"card-body",ref:m,children:c}):e.createElement("div",{className:"card-body",children:c}),i,x?e.createElement(Q,{className:"drop-zone",icon:"upload",title:"Upload"}):null))})),te=({active:t,undetermined:n})=>e.createElement("div",{className:k("toggle-check",t&&"active",n&&"undetermined")},e.createElement(P,{icon:n?"horizontal_rule":t?"check":null})),ne=({active:t})=>e.createElement("div",{className:k("circle-check",t&&"active")},e.createElement(P,{icon:"check"})),le=({status:t})=>"connected"===t?null:e.createElement("div",{className:"connection-indicator"},e.createElement("div",{className:"bubble"},e.createElement(g,null),t)),ae=({title:t,children:n,isVisible:l,onClose:a})=>l?e.createElement("div",{className:"corner-dialog"},e.createElement("div",{className:"corner-dialog-title"},t,e.createElement(P,{icon:"close",onClick:a})),n):null,re=({position:t,button:n,content:a})=>{const[c,i]=l(!1);return r((()=>{if(!c)return;const e=e=>{e.composedPath().some((e=>e.classList&&e.classList.contains("dropdown-content")))||i(!1)};return setTimeout((()=>{window.addEventListener("click",e,{passive:!1})}),0),()=>window.removeEventListener("click",e)}),[c]),e.createElement("div",null,e.createElement("span",{className:"dropdown"},e.createElement("div",{children:n,className:"dropdown-button",onClick:()=>{console.log("show"),i(!0)}}),e.createElement("div",{className:k("dropdown-content",t||"top-right",c?"visible":"hidden"),children:a})))};let ce={};const ie=n((({children:t,title:n,headerRight:l,onClose:c,isVisible:s,className:o,screen:d},m)=>{const u=a(),h=a(),v=N(0),g=()=>p.goBack(1);i(m,(()=>({close:g})));const{width:E,height:f}=z(u,{onMove:e=>{},onUp:e=>{}});return r((()=>{s?v.spring(1):v.spring(0)}),[s]),r((()=>v.on((e=>{const t=1-e,n=ce.x*t,l=ce.y*t;u.current&&(u.current.style.transform=`translate(${n}px, ${l}px)`,u.current.style.width=C(e),u.current.style.height=C(e)),h.current&&(h.current.style.transform=`translate(${-1*n}px, ${-1*l}px)`)}))),[E,f]),e.createElement("div",{className:"layer reveal",ref:u},e.createElement("div",{className:k("card reveal-content",o),ref:h},e.createElement(J,{title:n,onClose:g,headerRight:l,presentation:"card"}),e.createElement("div",{className:"card-body",children:t})))})),se=(e,t)=>Object.assign(ce,{x:e,y:t}),oe=e=>{const t=e.currentTarget.getBoundingClientRect();se((t.left+t.right)/2,(t.top+t.bottom)/2)},de=({title:t,icon:n,href:l})=>e.createElement(x,{href:l,className:"springboard-icon",onClick:oe},e.createElement("div",{className:"icon-frame"},e.createElement(P,{icon:n})),e.createElement("div",{className:"springboard-icon-name"},t)),me=({title:t,icon:n,onClick:l,href:a,disabled:r,children:c,active:i})=>e.createElement(S,{className:"dropdown-item",onClick:l,disabled:r,active:i,children:c,href:a,leftIcon:n,title:t}),ue=({emoji:t})=>e.createElement("span",{className:"emoji",children:t}),he=({icon:t,title:n,loading:l,disabled:a,active:r=!0,href:i,onPress:s})=>e.createElement(x,{className:k("fab",!n&&"round"),loading:l,disabled:a,active:r,onClick:s,href:i},l?e.createElement(g,{color:"#000"}):e.createElement(c,null,e.createElement(P,{icon:t}),n&&e.createElement("div",{className:"fab-title"},n))),pe=({title:t,children:n,footer:l,headerRight:c,SearchComponent:i})=>{const s=a(),o=N(0);return r((()=>(o.spring(1),o.on((e=>{s.current.style.opacity=e})))),[]),e.createElement("div",{className:"fullscreen",ref:s},e.createElement(J,{title:t,presentation:"full",onClose:()=>{o.spring(0).then((()=>p.goBack()))},headerRight:c,SearchComponent:i}),e.createElement(I,{className:"card-body"},n),l)},ve=({icon:t,title:n,badge:l,loading:a,disabled:r,onClick:c,active:i,href:s})=>e.createElement(x,{className:k("header-button center","Cancel"===n&&"header-cancel"),onClick:c,loading:a,disabled:r,active:i,href:s},t?e.createElement(P,{icon:t}):null,n?e.createElement("span",null,n):null,l?e.createElement("span",{className:"badge"},l):null),ge=({ar:t,url:n,alt:l,className:a,children:r,base64Png:c})=>e.createElement("div",{className:k("img",a)},e.createElement("div",{style:{paddingTop:100*(t||1)+"%"}}),n?e.createElement("img",{src:n,className:"img-real",alt:l,draggable:!1}):c?e.createElement("img",{src:`data:image/png;base64,${c}`}):e.createElement("div",{className:"img-real",alt:l,draggable:!1}),r?e.createElement("div",{className:"img-inside"},r):null),Ee=({title:t,items:n=[],keyExtractor:l=(e=>e._id),renderItem:a,loading:r,className:i,ListEmptyComponent:o,HeaderComponent:d,children:m,showSeparators:u=!0})=>e.createElement("div",{className:k("list",i)},t?e.createElement(c,null,e.createElement("div",{className:"list-title"},t),e.createElement("hr",null)):null,d,n.length||m?e.createElement("div",{className:"list-body"},r||!n?null:o&&0===n.length?o:n.map(((t,r)=>e.createElement(c,{key:l(t)},a(t,r),u&&r<n.length-1&&e.createElement("hr",null)))),s.map(m,((t,n)=>e.createElement(c,{key:n},t,n<m.length-1&&e.createElement("hr",null))))):o),fe=u([]),ye=t=>e.createElement("div",{key:t.id,className:"layer",children:t.children}),be=()=>h(fe).map(ye),Ne=e=>fe.update([...fe.state,{id:Math.random(),children:e}]),ke=()=>{fe.update([])},Ce=({percent:t})=>e.createElement("div",{className:"percent-bar"},e.createElement("div",{className:"percent-bar-inner",style:{width:100*t+"%"}})),xe=({title:t,LeftComponent:n,caret:l=!0,checked:a,active:r,href:c,onPress:i})=>e.createElement(x,{className:"filter-button",onClick:i,active:r,interactive:!0,href:c},n,t?e.createElement("div",{className:"filter-button-title"},t):null,l?e.createElement(P,{className:"filter-button-caret",icon:"expand_more"}):e.createElement(te,{active:a})),we=({title:t,color:n,onClick:l})=>e.createElement(x,{className:"pill",onClick:l,style:{backgroundColor:n}},t),Me=u(),Pe=()=>{const t=h(Me);return r((()=>{if(!t)return;const e=setTimeout((()=>Me.update(null)),2e3);return()=>clearTimeout(e)}),[t]),t?e.createElement("div",{className:"toast-container"},e.createElement("div",{className:"toast",children:t})):null},Se=Me.update,Te=()=>e.createElement(c,null,e.createElement(be,null),e.createElement(Y,null),e.createElement(O,null),e.createElement(Pe,null)),Le=()=>e.createElement("div",{className:"progress-indicator"}),De=({color:t="#fff",size:n=20,percent:l,spinning:a,completedIcon:r="check"})=>{if(a||!l)return e.createElement(Le,null);if(1===l)return e.createElement(P,{icon:r});const c=n/2,i=c-1,s=2*i*Math.PI,o=s-l*s;return e.createElement("svg",{height:n,width:n},e.createElement("circle",{stroke:t,opacity:.3,fill:"transparent",strokeWidth:2,r:i,cx:c,cy:c}),e.createElement("circle",{strokeDasharray:s+" "+s,style:{strokeDashoffset:o,transform:"rotate(-90deg)",transformOrigin:"50% 50%"},stroke:t,fill:"transparent",strokeWidth:2,r:i,cx:c,cy:c}))},Ve=({active:t,icon:n,title:l,elaboration:a,subtitle:r,value:c,disabled:i,onClick:s,children:o})=>e.createElement(S,{onClick:()=>{s(c)},disabled:i,className:"radio-btn",active:t},e.createElement("div",{className:"radio-top"},e.createElement("div",{className:"dot"},e.createElement("div",{className:"dot-inside"})),n&&e.createElement(P,{icon:n}),e.createElement("div",{className:"radio-title"},l)),o&&e.createElement("div",{className:"radio-subtitle"},o),r&&e.createElement("div",{className:"radio-subtitle"},r),t&&a&&e.createElement("div",{className:"radio-subtitle",children:a})),$e=n((({item:t,isLast:n,active:l,onChange:a,index:r},i)=>e.createElement(c,null,e.createElement(x,{children:t.name,onClick:()=>a(t.value),active:l,ref:i}),n?null:e.createElement("div",{className:"separator"})))),ze=({options:t,value:n,onChange:l})=>{const c=a([]),i=a(),s=t.findIndex((e=>e.value===n)),o=N(0),d=N(0);return r((()=>{o.on((e=>i.current.style.transform=`translateX(${e}px)`)),d.on((e=>i.current.style.width=`${e}px`))}),[]),r((()=>{const e=c.current[s];0===d.value?(o.setValue(e.offsetLeft),d.setValue(e.offsetWidth)):(o.spring(e.offsetLeft),d.spring(e.offsetWidth))}),[s]),e.createElement("div",{className:"segmented"},e.createElement("div",{className:"segmented-indicator",ref:i}),t.map(((n,a)=>e.createElement($e,{key:n.value,item:n,index:a,isLast:a===t.length-1,active:s===a,onChange:l,ref:e=>c.current[a]=e}))))},Re=({options:t,value:n,disabled:l,autoComplete:a,onChangeValue:r})=>e.createElement("select",{className:k("text select",l&&"disabled"),onChange:e=>r(e.target.value),value:n,disabled:l,autoComplete:a},(()=>{if(t instanceof Array)return t.map((t=>e.createElement("option",{key:t.value,value:t.value,children:t.name})));Object.keys(t).map((n=>e.createElement("option",{key:n,value:n,children:t[n]})))})()),Xe=({leftText:t,rightText:n})=>e.createElement("div",{className:"tabular-row"},e.createElement("div",{className:"tabular-row-left"},t),e.createElement("div",{className:"tabular-row-right"},n)),We=(e,t=0)=>{let n=3735928559^t,l=1103547991^t;for(let t,a=0;a<e.length;a++)t=e.charCodeAt(a),n=Math.imul(n^t,2654435761),l=Math.imul(l^t,1597334677);return n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(l^l>>>13,3266489909),l=Math.imul(l^l>>>16,2246822507),l^=Math.imul(n^n>>>13,3266489909),4294967296*(2097151&l)+(n>>>0)},Ye=360/Math.pow(2,53),Ue=o((({tag:t,count:n})=>{const l=(e=>`hsl(${180-Ye*We(e)}, 100%, 50%)`)(t);return e.createElement("div",{className:"tag",style:{borderColor:l,color:l},children:`${t} ${n||""}`})})),_e={code:"one-time-code"},Ie={phone:"tel",code:"tel"},je=n((({placeholder:t,value:n="",icon:a,type:r="text",dnt:c,disabled:i,rows:s=0,className:o,onFocus:m,autoComplete:u,onClick:h,maxLength:p,id:v,onChangeText:E=(()=>null),autoFocus:f,loading:y,RightComponent:b,countryCode:N,onChangePhone:C,lowerCase:w,min:M,max:S,onPressCountry:T,countries:L},D)=>{const[V,$]=l(n);return e.createElement("div",{className:"text-input"},"phone"===r&&(()=>{const t=L?L.find((e=>e.code===N)):null;return t?e.createElement(x,{className:"text-input-country",onClick:T},e.createElement("span",{className:"emoji"},t.flag),t.prefix):null})(),a?e.createElement(P,{className:"text-input-icon",icon:a}):"username"===r?e.createElement("span",{className:"text-input-icon"},"@"):"search"===r?e.createElement(P,{className:"text-input-icon",icon:"search"}):void 0,d("textarea"===r||s?"textarea":"input",{type:Ie[r]||r,autoComplete:_e[r],maxLength:p,className:k("text",i&&"disabled",c&&"fs-hide",o),readOnly:i,onChange:e=>{let t=e.target.value;$(t),"phone"===r?t=t.replace(/[^0-9]/g,""):(w&&(t=t.toLowerCase()),p&&(t=t.slice(0,p)),"username"===r&&(t=t.replace(/\s/g,""))),E(t)},value:(e=>{if("phone"===r&&N){const t=L.find((e=>e.code===N)),n=e.split("");return t.example.split("").map((e=>{if(n.length)return"X"===e?n.shift():e})).filter(Boolean).join("")}return e})(n),autoCapitalize:w&&"none",placeholder:t,rows:s,onFocus:m,onClick:h,id:v,autoFocus:f,ref:D,min:M,max:S}),a?e.createElement("img",{className:"text-input-icon",src:a}):null,b,y?e.createElement("div",{className:"text-input-spinner"},e.createElement(g,{size:18})):null,"search"!==r?null:n?e.createElement(x,{onClick:()=>E("")},e.createElement(P,{icon:"cancel",className:"text-input-clear"})):void 0)})),Ae=({href:t,onClick:n,children:l,disabled:a,className:r})=>e.createElement(x,{className:k("touchable-highlight",a&&"disabled",r),onClick:n,href:t,children:l}),Be=({pan:t,i:n,width:l})=>{const c=a();return r((()=>{if(!l)return;const e=n*l,a=l/3;return t.on((t=>{const n=Math.min(Math.abs(e-t),a);c.current.style.opacity=Math.min(1,1.5-n/a)}))}),[l]),e.createElement("div",{className:"pager-dot",ref:c,style:{opacity:t.value===n?1:.5}})},He=({title:t,i:n,pan:l,width:c,onPress:i})=>{const s=a();return r((()=>{if(!c)return;const e=n*c,t=c/3;return l.on((n=>{const l=Math.min(Math.abs(e-n),t);s.current.style.opacity=1.5-l/t}))}),[c]),e.createElement("div",{children:t,className:"pager-tabs-title",onClick:()=>i(n),ref:s,style:{opacity:l.value===n?1:.5}})},Oe=n((({titles:t,children:n,vertical:l,dots:c,className:s},o)=>{const d=N(0),m=a(),u=a(),h=a({}).current;i(o,(()=>({scrollToPage:e=>{l?d.spring(e*v):d.spring(e*p)}})));const{width:p,height:v}=z(u,{enablePointerControls:!0,onCapture:e=>{if(l){if("v"===e.locked)return e.d.y<0||h.initPan-e.d.y>0}else if("h"===e.locked)return e.d.x<0||h.initPan-e.d.x>0},onDown:e=>{l?(h.currentPage=Math.round(d.value/e.height),h.initPan=d.value):(h.currentPage=Math.round(d.value/e.width),h.initPan=d.value)},onMove:e=>{if(l){const t=E(h.initPan-e.d.y,0,e.height*(n.length-1));d.setValue(t)}else{const t=E(h.initPan-e.d.x,0,e.width*(n.length-1));d.setValue(t)}},onUp:e=>{if(l)if(e.flick.y<0)d.spring(v*E(h.currentPage+1,0,n.length-1));else if(e.flick.y>0)d.spring(v*E(h.currentPage-1,0,n.length-1));else{const t=E(Math.round(d.value/e.height),0,n.length-1);d.spring(t*v)}else if(e.flick.x<0)d.spring(p*E(h.currentPage+1,0,n.length-1));else if(e.flick.x>0)d.spring(p*E(h.currentPage-1,0,n.length-1));else{const t=E(Math.round(d.value/e.width),0,n.length-1);d.spring(t*p)}},onPan:e=>{console.log("Pan:",e.d.x,e.d.y),d.setValue(E(d.value+e.d.x,0,p*(n.length-1)))}},[n]);r((()=>d.on((e=>{u.current.style.transform=`translate${l?"Y":"X"}(-${e}px)`,m.current&&(m.current.style.transform=`translateX(${e/n.length}px)`)}))),[p]);const g=e=>{d.spring(e*p)};return e.createElement("div",{className:k("pager",l?"vertical":"horizontal",s)},t?e.createElement("div",{className:"pager-tabs"},t.map(((t,n)=>e.createElement(He,{key:n,title:t,pan:d,i:n,width:p,onPress:g}))),p?e.createElement("div",{className:"pager-tabs-indicator",ref:m,style:{width:p/t.length}}):null):null,e.createElement("div",{className:"pager-scroller"},e.createElement("div",{className:"pager-canvas",ref:u,style:{transform:l?"translateX(0px)":"translateY(0px)"}},e.Children.map(n,((t,n)=>e.createElement("div",{key:n,className:"pager-page",children:t}))))),c?e.createElement("div",{className:"pager-dots"},e.Children.map(n,((t,n)=>e.createElement(Be,{key:n,pan:d,width:p,i:n})))):null)})),Fe=n((({children:t,title:n,search:l,onChangeSearch:c,searchLoading:s,hasScrollView:o=!0,headerRight:d,onClose:m,isVisible:u},h)=>{const v=a(),g=a(),E=N(0),f=()=>{console.log("close window"),m?E.spring(0).then(m):p.goBack(1)};i(h,(()=>({close:f})));const{height:y}=z(g,{onMove:e=>{E.setValue(y-Math.max(0,e.d.y))},onUp:e=>{1===e.flick.y||e.d.y>e.height/2?f():E.spring(e.height)}});return r((()=>{y&&(u||m?E.spring(y):E.spring(0))}),[u,y]),r((()=>{const e=document.querySelectorAll(".card");return E.on((t=>{const n=t/y;g.current&&(g.current.style.transform=`translateY(-${t}px)`),v.current&&(v.current.style.display=t?"block":"none",v.current.style.opacity=t/y*.8),[...e].forEach((e=>{e.style.transform=`scale(${1-.04*n})`}))}))}),[y]),e.createElement("div",{className:"layer"},e.createElement("div",{className:"shade",ref:v}),e.createElement("div",{className:"window",ref:g},e.createElement("div",{className:"window-content"},e.createElement(J,{title:n,presentation:"modal",onClose:f,SearchComponent:c?e.createElement("div",{className:"header-search"},e.createElement(je,{placeholder:"Search",type:"search",value:l,onChangeText:c,loading:s})):null,headerRight:d}),o?e.createElement(I,{className:"card-body",children:t}):e.createElement("div",{className:"card-body",children:t}))))})),qe=({width:e,height:t})=>{document.documentElement.style.setProperty("--viewport-width",`${e}px`),document.documentElement.style.setProperty("--viewport-height",`${t}px`)};qe({width:document.documentElement.clientWidth,height:document.documentElement.clientHeight}),new ResizeObserver((e=>{qe(e[0].contentRect)})).observe(document.documentElement);const Ke=navigator.virtualKeyboard,Ge=()=>r((()=>{if(Ke)return Ke.overlaysContent=!0,()=>Ke.overlaysContent=!1}),[]),Je=new Map,Qe=e=>function(...t){const n=t[0];return Je.has(n)||Je.set(n,e.apply(this,t)),Je.get(n)},Ze=Qe((e=>new Promise((t=>{const n=document.createElement("link");n.setAttribute("rel","stylesheet"),n.setAttribute("href",e),n.onload=()=>t(),document.head.appendChild(n)})))),et=Qe(((e,t)=>new Promise((n=>{const l=document.createElement("script");l.type="text/javascript",l.async=!0,l.src=e,l.onload=()=>n(window[t]),document.head.appendChild(l)}))));export{Y as ActionSheet,g as ActivityIndicator,O as Alert,b as AnimatedValue,q as Avatar,R as BottomSheet,K as BreadCrumbs,j as Button,ee as Card,te as CheckBox,ne as CircleCheck,le as ConnectionIndicator,ae as CornerDialog,de as DashboardIcon,re as Dropdown,me as DropdownItem,ue as Emoji,T as FLICK_SPEED,he as Fab,xe as FilterButton,pe as FullScreen,ve as HeaderButton,P as Icon,ge as Image,Ee as List,be as Modal,Ce as PercentBar,we as Pill,Q as Placeholder,Te as PoonOverlays,Le as ProgressIndicator,De as ProgressRing,_ as PullIndicator,Ve as RadioButton,ie as Reveal,J as ScreenHeader,I as ScrollView,ze as SegmentedController,Re as Select,Z as Shade,Xe as TabularRow,Ue as Tag,je as TextInput,Pe as Toast,x as Touchable,Ae as TouchableHighlight,S as TouchableRow,Oe as ViewPager,Fe as Window,f as bounce,k as c,E as clamp,We as cyrb53,y as easeOutCubic,ke as hideModal,Ze as loadCss,et as loadScript,Qe as memoize,fe as modalState,se as setRevealOrigin,U as showActionSheet,F as showAlert,Ne as showModal,C as toPercent,Se as toast,N as useAnimatedValue,z as usePanGestures,V as useSize,Ge as useVirtualKeyboard};
import e,{forwardRef as t,useState as n,useRef as l,useEffect as a,useMemo as r,Fragment as c,useImperativeHandle as i,Children as s,memo as o,createElement as d}from"react";import{randomId as m,createBus as u,useBus as h}from"poon-router/util.js";import{navigation as p}from"poon-router";const v=(...e)=>e.filter(Boolean).join(" "),g=e=>100*e+"%",E=t((({href:t,onClick:a,className:r,active:c,target:i,children:s,style:o,disableMenu:d},m)=>{const[u,h]=n(!1),p=l(!1),g=e=>{e.button&&0!==e.button||(e.stopPropagation(),p.current=!1,h(!0))},E=()=>{h(!1)};return e.createElement(t?"a":"button",{href:t,onTouchStart:g,onTouchMove:E,onTouchEnd:E,onMouseDown:g,onMouseUp:E,onMouseLeave:E,onClick:e=>{if(p.current)return e.preventDefault();a&&(t||e.preventDefault(),a(e))},className:v("touchable",r,u&&"touched",d&&"disable-menu",c&&"active"),target:i,draggable:!1,onContextMenu:d?e=>(e.preventDefault(),!1):void 0,style:o,type:"button",ref:m},s)})),f=.25,y={capture:!1,passive:!1},b=(e=0,t,n)=>{const l=Math.min(n,50)/50;return e*(1-l)+t*l},N=e=>{const[t,l]=n({width:e.current?.clientWidth,height:e.current?.clientHeight});return a((()=>{if(!e.current)return;const t=new ResizeObserver((e=>{const t=e[0].borderBoxSize[0];l({height:t.blockSize,width:t.inlineSize})}));return t.observe(e.current),()=>t.disconnect()}),[e.current]),t};let k;const C=(e,t={},n)=>{const{width:c,height:i}=N(e),s=l({id:m()}).current,o=r((()=>{if(!e.current)return{};const n=()=>{const e=Date.now(),t=e-s.last.ts;if(t>0){const n=(s.x-s.last.x)/t,l=(s.y-s.last.y)/t;s.v={x:b(s.v.x,n,t),y:b(s.v.y,l,t)},s.last={x:s.x,y:s.y,ts:e}}};return{onTouchStart:e=>{if(k=null,e.touches.length>1){const t=e.touches[0].clientX-e.touches[1].clientX,n=e.touches[0].clientY-e.touches[1].clientY;return void(s.pinch={d0:Math.sqrt(Math.pow(t,2)+Math.pow(n,2))})}const n=e.touches?e.touches[0].clientX:e.clientX,l=e.touches?e.touches[0].clientY:e.clientY;Object.assign(s,{width:c,height:i,current:{x:n,y:l},touch:!0,origin:{x:n,y:l},locked:!1,v:{x:0,y:0},s:{x:0,y:0},d:{x:0,y:0},flick:null,last:{ts:Date.now(),x:n,y:l}}),t.onDown&&t.onDown(s)},onTouchMove:l=>{if(k&&k!==e.current)k.className.includes("scroller")||l.preventDefault();else{if(s.pinch)if(2===l.touches.length){const e=l.touches[0].clientX-l.touches[1].clientX,t=l.touches[0].clientY-l.touches[1].clientY;s.pinch.d=Math.sqrt(Math.pow(e,2)+Math.pow(t,2)),s.pinch.ratio=s.pinch.d/s.pinch.d0}else delete s.pinch;if(s.x=l.touches?l.touches[0].clientX:l.clientX,s.y=l.touches?l.touches[0].clientY:l.clientY,n(),s.d={x:s.x-s.origin.x,y:s.y-s.origin.y},s.abs={x:Math.abs(s.d.x),y:Math.abs(s.d.y)},!s.locked&&(s.abs.y>10||s.abs.x>10)&&(s.locked=s.abs.y>s.abs.x?"v":"h"),s.locked){if(s.touch=(e=>!t.onCapture||t.onCapture(s,e))(l),!s.touch)return;k=e.current,t.onMove&&t.onMove(s,l)}}},onTouchEnd:()=>{k&&k!==e.current||s.touch&&s.locked&&(n(),s.s={x:Math.abs(s.v.x),y:Math.abs(s.v.y)},s.flick={x:"h"===s.locked&&s.s.x>=f&&Math.sign(s.v.x),y:"v"===s.locked&&s.s.y>=f&&Math.sign(s.v.y)},t.onUp&&t.onUp(s))},onWheel:n=>{e.current.scrollTop+=n.deltaY,t.onPan&&t.onPan({d:{x:n.deltaX,y:n.deltaY}})}}}),[e,i,c,n]);return a((()=>{if(e.current)return e.current.addEventListener("touchstart",o.onTouchStart,y),e.current.addEventListener("touchmove",o.onTouchMove,y),e.current.addEventListener("touchend",o.onTouchEnd,y),e.current.addEventListener("wheel",o.onWheel,y),()=>{e.current&&(e.current.removeEventListener("touchstart",o.onTouchStart),e.current.removeEventListener("touchmove",o.onTouchMove),e.current.removeEventListener("touchend",o.onTouchEnd),e.current.removeEventListener("wheel",o.onWheel))}}),[o,n]),{height:i,width:c}},x=(e,t,n)=>Math.min(Math.max(e,t),n),w=(e,t,n)=>e>n?n+(n+e)/50:e<t?t-(t-e)/50:e,M=e=>--e*e*e+1;class P{constructor(e){this.listeners=[],this.value=e,this.oldValue=e}setValue=(e,t=!0)=>{t&&(delete this.id,this.oldValue=e),this.value=e,this.listeners.forEach((t=>t(e)))};spring=(e,t=P.defaultAnimationDuration)=>new Promise((n=>{if(e===this.value)return;const l=this.id=performance.now(),a=this.value,r=c=>{if(l!==this.id)return;const i=Math.max(0,c-l);if(i>=t)this.setValue(e,!0),n();else{const n=(e-a)*M(i/t);this.setValue(a+n,!1),requestAnimationFrame(r)}};r(l)}));on=e=>(this.listeners.push(e),()=>this.listeners=this.listeners.filter((t=>t!==e)));stop=()=>{delete this.id}}P.defaultAnimationDuration=300;const S=e=>r((()=>new P(e)),[]),T=/iPad|iPhone|iPod/.test(navigator.platform),L={"os:back":T?"arrow_back_ios":"arrow_back","os:share":T?"ios_share":"share","os:close":T?"keyboard_arrow_down":"close"},V=({icon:t,className:n,color:l,title:a,size:r,onClick:c})=>e.createElement("i",{className:v("material-icons",n),style:{color:l,fontSize:r},title:a,onClick:c,children:L[t]||t}),D=t((({pull:t},n)=>e.createElement("div",{className:"pull-indicator center",ref:n},e.createElement(V,{icon:"refresh",color:"#000"})))),$=t((({children:t,className:n,onRefresh:r,horizontal:i},s)=>{const o=s||l(),d=l(),m=l({}).current,u=S(0),h=S(0),p=S(0);C(o,{onDown:()=>{m.canScrollVertical=o.current.scrollHeight>o.current.clientHeight,m.canScrollHorizontal=o.current.scrollWidth>o.current.clientWidth,m.initScrollTop=o.current.scrollTop,m.initScrollLeft=o.current.scrollLeft,h.stop(),p.stop()},onCapture:e=>"v"===e.locked?!!(r&&0===o.current.scrollTop&&e.d.y>0)||!!m.canScrollVertical&&(0===m.initScrollTop&&e.d.y<0||m.initScrollTop>0):"h"===e.locked?!!m.canScrollHorizontal:void 0,onMove:e=>{"v"===e.locked?h.setValue(m.initScrollTop-e.d.y):"h"===e.locked&&p.setValue(m.initScrollLeft-e.d.x),r&&0===m.initScrollTop&&u.setValue(Math.min(70,e.d.y))},onUp:e=>{"v"===e.locked?e.v.y&&h.spring(h.value-2e3*e.v.y,2e3):"h"===e.locked&&e.v.x&&p.spring(p.value-2e3*e.v.x,2e3),r&&0===m.initScrollTop&&(e.d.y>70?u.spring(0).then(r):u.spring(0))}}),a((()=>h.on((e=>{o.current.scrollTop=e}))),[]),a((()=>p.on((e=>o.current.scrollLeft=e))),[]),a((()=>{if(r)return u.on((e=>{const t=e/70;d.current.style.transform=`translateY(${e}px) rotate(${360*t}deg)`,d.current.style.opacity=t}))}),[]);return e.createElement(c,null,r?e.createElement("div",{className:"list-pull"},e.createElement(D,{pull:u,ref:d})):null,e.createElement("div",{className:v("scroller",n,i?"horizontal":"vertical"),ref:o,onScroll:()=>{navigator.virtualKeyboard?.hide(),document.activeElement.blur()},children:t}))})),z=new Array(12).fill(0),R=({size:t=16,color:n="#fff"})=>e.createElement("div",{className:"activity-indicator",style:{width:t,height:t},children:z.map(((l,a)=>{const r={width:1.7,borderRadius:1,left:t/2-1,height:t/4,animationDelay:(.1*a-1.1).toFixed(1)+"s",transform:`rotate(${30*a}deg)`,backgroundColor:n,transformOrigin:`50% ${t/2}px`};return e.createElement("div",{key:a,style:r})}))}),X=({className:t,title:n,onClick:l,onDown:a,icon:r,href:i,tabIndex:s,color:o,disabled:d,download:m,iconImageUrl:u,loading:h,submit:p,fullWidth:g,target:f})=>{const y=v("btn",t,d&&"disabled",g&&"full-width",o&&`btn-${o}`);return e.createElement(E,{type:p?"submit":"button",className:y,onClick:e=>{m&&e.stopPropagation(),l&&l(e)},href:i,onTouchStart:a,tabIndex:s,children:h?e.createElement(R,null):e.createElement(c,null,u?e.createElement("img",{src:u,alt:n}):null,r?e.createElement(V,{icon:r}):null,n?e.createElement("span",null,n):null),target:f})},Y=u([]),W=(e,t)=>{Y.update(Y.state.map((t=>(t===e&&(t.visible=!1),t)))),setTimeout((()=>{e.callback(t),Y.update(Y.state.filter((t=>t!==e)))}),300)},U=({alert:t,isLast:n})=>e.createElement("div",{className:v("alert-container",n&&t.visible&&t.className)},e.createElement("div",{className:v("alert",n&&t.visible&&"visible"),onClick:e=>e.stopPropagation()},e.createElement("div",{className:"alert-top"},t.title?e.createElement("div",{className:"alert-title"},t.title):null,t.message?e.createElement("div",{className:"alert-message"},t.message):null),t.options?e.createElement($,{className:v("alert-buttons",t.options.length<=2&&"alert-buttons-horizontal"),children:t.options.map(((n,l)=>e.createElement(E,{key:l,className:v("alert-button",n.destructive&&"destructive"),onClick:()=>{n.onPress&&n.onPress(),W(t,n._id||n.value)},children:n.name,disableMenu:!0})))}):e.createElement("div",{className:"alert-bottom"},e.createElement(X,{color:"white",fullWidth:!0,title:"Close",onClick:()=>W(t)})))),_=()=>{const t=h(Y),n=t.filter((e=>e.visible)).pop();return 0===t.length?null:e.createElement("div",{className:v("layer alert-backdrop",t.some((e=>e.visible))&&"visible"),onClick:()=>W(n),children:t.map((t=>e.createElement(U,{key:t.key,alert:t,isLast:n===t})))})},I=(e,t)=>new Promise((n=>{Y.update([...Y.state,{key:m(),callback:n,visible:!0,options:t,...e}])})),j=({title:t,meta:n,leftIcon:l,href:a,onClick:r,onPressMore:c,target:i,children:s,caret:o,disabled:d,RightComponent:m,className:u,active:h})=>e.createElement(E,{className:v("touchable-highlight touchable-row",d&&"disabled",u),onClick:r,href:a,target:i,active:h},e.createElement("div",{className:"touchable-row-left"},"string"==typeof l?e.createElement("div",{className:"touchable-row-icon"},e.createElement(V,{icon:l})):null,"object"==typeof l?e.createElement("div",{className:"touchable-row-icon"},l):null,e.createElement("div",{className:"touchable-row-content"},t?e.createElement("div",{className:"touchable-row-title",children:t}):null,n?e.createElement("div",{className:"meta",children:n}):null,s)),m,c?e.createElement(E,{onClick:c},e.createElement(V,{icon:"more_vert"})):null,o?e.createElement(V,{icon:"chevron_right"}):null),A=t((({className:t,visible:n,pan:r,children:c,onClose:i,onPress:s,showShade:o,showHandle:d},m)=>{const u=l(),h=l(),{height:p}=C(h,{onMove:e=>{r.setValue(e.height-Math.max(e.d.y/100,e.d.y))},onUp:e=>{1===e.flick.y||e.d.y>e.height/2?g():r.spring(e.height)}}),g=()=>r.spring(0).then(i);return a((()=>{if(p)return r.on((e=>{h.current.style.transform=`translateY(-${e}px)`,u.current&&(u.current.style.opacity=e/p)}))}),[p]),a((()=>{p&&(n?r.spring(p):r.spring(0).then(i))}),[n,p,i]),e.createElement("div",{className:"layer"},n&&o?e.createElement("div",{className:"shade shade-bottom-sheet",ref:u,onClick:g}):null,e.createElement("div",{ref:h,className:v("sheet",t),onClick:s},d?e.createElement("div",{className:"handle"}):null,c))})),B=u(null),H=new P(0),O=()=>{const t=h(B);return t?e.createElement(A,{pan:H,visible:!!t,onClose:()=>B.update(null),showShade:!0},e.createElement("div",{className:"action-sheet-title"},t&&t.title),e.createElement("hr",null),t.options.map(((n,l)=>e.createElement(j,{key:l,title:n.name,leftIcon:n.icon,onClick:e=>{n.onClick&&n.onClick(),t.callback&&t.callback(n.value),H.spring(0).then((()=>B.update(0)))},disabled:n.disabled,target:n.target,href:n.href})))):null},F=(e,t,n)=>B.update({title:e,options:t,callback:n}),q=({imageId:t,className:n,variant:l,getUrl:a})=>t?e.createElement("img",{draggable:!1,className:v("avatar",n),src:a(t,l)}):e.createElement("div",{draggable:!1,className:v("avatar",n)});q.defaultProps={variant:"normal",getUrl:()=>null};const K=({path:t,onClickPath:n})=>{const l=t.split("/").filter(Boolean);return 0===l.length?null:e.createElement($,{horizontal:!0,className:"breadcrumbs"},e.createElement(V,{icon:"home",onClick:()=>n("/")}),e.createElement("span",null," / "),l.map(((t,a)=>e.createElement(c,{key:t+"_"+a},e.createElement(E,{onClick:()=>n(),children:t}),a<l.length-1?e.createElement("span",null," / "):null))))},G=({active:t,undetermined:n})=>e.createElement("div",{className:v("toggle-check",t&&"active",n&&"undetermined")},e.createElement(V,{icon:n?"horizontal_rule":t?"check":null})),J={card:"os:back",modal:"os:close"},Q=({title:t,subtitle:n,presentation:l="card",onClose:a,headerRight:r,SearchComponent:i})=>{const s=J[l];return e.createElement(c,null,e.createElement("div",{className:"header"},e.createElement("div",{className:"header-spacer"},s&&e.createElement(E,{className:"header-close",onClick:e=>{e.stopPropagation(),e.preventDefault(),a()},children:e.createElement(V,{icon:s})})),e.createElement("div",{className:"header-middle"},e.createElement("div",{className:"header-title"},t),n?e.createElement("div",{className:"header-subtitle"},n):null),e.createElement("div",{className:"header-spacer"},r)),i)},Z=({className:t,icon:n,title:l,message:a,children:r})=>e.createElement("div",{className:v("placeholder",t)},n?e.createElement(V,{icon:n}):null,l?e.createElement("div",{className:"title"},l):null,a?e.createElement("div",{className:"placeholder-message"},a):null,r),ee=t((({},t)=>{const n=l();return i(t,(()=>({progress:(e,t)=>{n.current&&(n.current.style.opacity=1-e/t)}}))),e.createElement("div",{className:"shade shade-card",ref:n})})),te=t((({title:t,subtitle:r,children:c,footer:i,headerRight:s,hasScrollView:o=!0,SearchComponent:d,scrollerRef:m,disableGestures:u,onDrop:h,isVisible:g=!0,animateIn:E=!0,ShadeComponent:f=ee,HeaderComponent:y,className:b},N)=>{N=N||l();const k=l(history.length>1).current,[x,w]=n(!1),M=l(),P=S(E?document.body.clientWidth:0),T=()=>P.spring(L).then((()=>{k&&p.goBack()})),{width:L}=C(N,{onCapture:e=>{if(k&&!u)return"h"===e.locked&&e.d.x>0},onMove:e=>{P.setValue(Math.max(0,e.d.x))},onUp:e=>{1===e.flick.x||e.d.x>e.width/2?T():P.spring(0)}});a((()=>{L&&E&&(g?P.spring(0):P.spring(L))}),[E,g,L]),a((()=>P.on((e=>{N.current&&(N.current.style.transform=`translateX(${e}px)`),M.current&&M.current.progress(e,L)}))),[L]);return e.createElement("div",{className:"layer"},f?e.createElement(f,{ref:M}):null,e.createElement("div",{className:v("card",E&&"animate",b),ref:N,onDragOver:h&&(e=>{e.preventDefault()}),onDragEnter:h&&(e=>{w(!0)}),onDragLeave:h&&(e=>{w(!1)}),onDrop:h&&(e=>{w(!1),h(e)})},null===y?null:y||e.createElement(Q,{title:t,subtitle:r,presentation:"card",SearchComponent:d,onClose:T,headerRight:s}),o?e.createElement($,{className:"card-body",ref:m,children:c}):e.createElement("div",{className:"card-body",children:c}),i,x?e.createElement(Z,{className:"drop-zone",icon:"upload",title:"Upload"}):null))})),ne=({active:t})=>e.createElement("div",{className:v("circle-check",t&&"active")},e.createElement(V,{icon:"check"})),le=({status:t})=>"connected"===t?null:e.createElement("div",{className:"connection-indicator"},e.createElement("div",{className:"bubble"},e.createElement(R,null),t)),ae=({title:t,children:n,isVisible:l,onClose:a})=>l?e.createElement("div",{className:"corner-dialog"},e.createElement("div",{className:"corner-dialog-title"},t,e.createElement(V,{icon:"close",onClick:a})),n):null,re=({position:t,button:l,content:r})=>{const[c,i]=n(!1);return a((()=>{if(!c)return;const e=e=>{e.composedPath().some((e=>e.classList&&e.classList.contains("dropdown-content")))||i(!1)};return setTimeout((()=>{window.addEventListener("click",e,{passive:!1})}),0),()=>window.removeEventListener("click",e)}),[c]),e.createElement("div",null,e.createElement("span",{className:"dropdown"},e.createElement("div",{children:l,className:"dropdown-button",onClick:()=>{console.log("show"),i(!0)}}),e.createElement("div",{className:v("dropdown-content",t||"top-right",c?"visible":"hidden"),children:r})))};let ce={};const ie=t((({children:t,title:n,headerRight:r,onClose:c,isVisible:s,className:o,screen:d},m)=>{const u=l(),h=l(),E=S(0),f=()=>p.goBack(1);i(m,(()=>({close:f})));const{width:y,height:b}=C(u,{onMove:e=>{},onUp:e=>{}});return a((()=>{s?E.spring(1):E.spring(0)}),[s]),a((()=>E.on((e=>{const t=1-e,n=ce.x*t,l=ce.y*t;u.current&&(u.current.style.transform=`translate(${n}px, ${l}px)`,u.current.style.width=g(e),u.current.style.height=g(e)),h.current&&(h.current.style.transform=`translate(${-1*n}px, ${-1*l}px)`)}))),[y,b]),e.createElement("div",{className:"layer reveal",ref:u},e.createElement("div",{className:v("card reveal-content",o),ref:h},e.createElement(Q,{title:n,onClose:f,headerRight:r,presentation:"card"}),e.createElement("div",{className:"card-body",children:t})))})),se=(e,t)=>Object.assign(ce,{x:e,y:t}),oe=e=>{const t=e.currentTarget.getBoundingClientRect();se((t.left+t.right)/2,(t.top+t.bottom)/2)},de=({title:t,icon:n,href:l})=>e.createElement(E,{href:l,className:"springboard-icon",onClick:oe},e.createElement("div",{className:"icon-frame"},e.createElement(V,{icon:n})),e.createElement("div",{className:"springboard-icon-name"},t)),me=({emoji:t})=>e.createElement("span",{className:"emoji",children:t}),ue=({title:t,icon:n,onClick:l,href:a,disabled:r,children:c,active:i})=>e.createElement(j,{className:"dropdown-item",onClick:l,disabled:r,active:i,children:c,href:a,leftIcon:n,title:t}),he=({icon:t,title:n,loading:l,disabled:a,active:r=!0,href:i,onPress:s})=>e.createElement(E,{className:v("fab",!n&&"round"),loading:l,disabled:a,active:r,onClick:s,href:i},l?e.createElement(R,{color:"#000"}):e.createElement(c,null,e.createElement(V,{icon:t}),n&&e.createElement("div",{className:"fab-title"},n))),pe=({title:t,children:n,footer:r,headerRight:c,SearchComponent:i})=>{const s=l(),o=S(0);return a((()=>(o.spring(1),o.on((e=>{s.current.style.opacity=e})))),[]),e.createElement("div",{className:"fullscreen",ref:s},e.createElement(Q,{title:t,presentation:"full",onClose:()=>{o.spring(0).then((()=>p.goBack()))},headerRight:c,SearchComponent:i}),e.createElement($,{className:"card-body"},n),r)},ve=({title:t,items:n=[],keyExtractor:l=(e=>e._id),renderItem:a,loading:r,className:i,ListEmptyComponent:o,HeaderComponent:d,children:m,showSeparators:u=!0})=>e.createElement("div",{className:v("list",i)},t?e.createElement(c,null,e.createElement("div",{className:"list-title"},t),e.createElement("hr",null)):null,d,n.length||m?e.createElement("div",{className:"list-body"},r||!n?null:o&&0===n.length?o:n.map(((t,r)=>e.createElement(c,{key:l(t)},a(t,r),u&&r<n.length-1&&e.createElement("hr",null)))),s.map(m,((t,n)=>e.createElement(c,{key:n},t,n<m.length-1&&e.createElement("hr",null))))):o),ge=({ar:t,url:n,alt:l,className:a,children:r,base64Png:c})=>e.createElement("div",{className:v("img",a)},e.createElement("div",{style:{paddingTop:100*(t||1)+"%"}}),n?e.createElement("img",{src:n,className:"img-real",alt:l,draggable:!1}):c?e.createElement("img",{src:`data:image/png;base64,${c}`}):e.createElement("div",{className:"img-real",alt:l,draggable:!1}),r?e.createElement("div",{className:"img-inside"},r):null),Ee=({icon:t,title:n,badge:l,loading:a,disabled:r,onClick:c,active:i,href:s})=>e.createElement(E,{className:v("header-button center","Cancel"===n&&"header-cancel"),onClick:c,loading:a,disabled:r,active:i,href:s},t?e.createElement(V,{icon:t}):null,n?e.createElement("span",null,n):null,l?e.createElement("span",{className:"badge"},l):null),fe=({percent:t})=>e.createElement("div",{className:"percent-bar"},e.createElement("div",{className:"percent-bar-inner",style:{width:100*t+"%"}})),ye=u([]),be=t=>e.createElement("div",{key:t.id,className:"layer",children:t.children}),Ne=()=>h(ye).map(be),ke=e=>ye.update([...ye.state,{id:Math.random(),children:e}]),Ce=()=>{ye.update([])},xe=({title:t,color:n,onClick:l})=>e.createElement(E,{className:"pill",onClick:l,style:{backgroundColor:n}},t),we=({title:t,LeftComponent:n,caret:l=!0,checked:a,active:r,href:c,onPress:i})=>e.createElement(E,{className:"filter-button",onClick:i,active:r,interactive:!0,href:c},n,t?e.createElement("div",{className:"filter-button-title"},t):null,l?e.createElement(V,{className:"filter-button-caret",icon:"expand_more"}):e.createElement(G,{active:a})),Me=u(),Pe=()=>{const t=h(Me);return a((()=>{if(!t)return;const e=setTimeout((()=>Me.update(null)),2e3);return()=>clearTimeout(e)}),[t]),t?e.createElement("div",{className:"toast-container"},e.createElement("div",{className:"toast",children:t})):null},Se=Me.update,Te=()=>e.createElement(c,null,e.createElement(Ne,null),e.createElement(O,null),e.createElement(_,null),e.createElement(Pe,null)),Le=()=>e.createElement("div",{className:"progress-indicator"}),Ve=({color:t="#fff",size:n=20,percent:l,spinning:a,completedIcon:r="check"})=>{if(a||!l)return e.createElement(Le,null);if(1===l)return e.createElement(V,{icon:r});const c=n/2,i=c-1,s=2*i*Math.PI,o=s-l*s;return e.createElement("svg",{height:n,width:n},e.createElement("circle",{stroke:t,opacity:.3,fill:"transparent",strokeWidth:2,r:i,cx:c,cy:c}),e.createElement("circle",{strokeDasharray:s+" "+s,style:{strokeDashoffset:o,transform:"rotate(-90deg)",transformOrigin:"50% 50%"},stroke:t,fill:"transparent",strokeWidth:2,r:i,cx:c,cy:c}))},De=({active:t,icon:n,title:l,elaboration:a,subtitle:r,value:c,disabled:i,onClick:s,children:o})=>e.createElement(j,{onClick:()=>{s(c)},disabled:i,className:"radio-btn",active:t},e.createElement("div",{className:"radio-top"},e.createElement("div",{className:"dot"},e.createElement("div",{className:"dot-inside"})),n&&e.createElement(V,{icon:n}),e.createElement("div",{className:"radio-title"},l)),o&&e.createElement("div",{className:"radio-subtitle"},o),r&&e.createElement("div",{className:"radio-subtitle"},r),t&&a&&e.createElement("div",{className:"radio-subtitle",children:a})),$e=t((({item:t,isLast:n,active:l,onChange:a,index:r},i)=>e.createElement(c,null,e.createElement(E,{children:t.name,onClick:()=>a(t.value),active:l,ref:i}),n?null:e.createElement("div",{className:"separator"})))),ze=({options:t,value:n,onChange:r})=>{const c=l([]),i=l(),s=t.findIndex((e=>e.value===n)),o=S(0),d=S(0);return a((()=>{o.on((e=>i.current.style.transform=`translateX(${e}px)`)),d.on((e=>i.current.style.width=`${e}px`))}),[]),a((()=>{const e=c.current[s];0===d.value?(o.setValue(e.offsetLeft),d.setValue(e.offsetWidth)):(o.spring(e.offsetLeft),d.spring(e.offsetWidth))}),[s]),e.createElement("div",{className:"segmented"},e.createElement("div",{className:"segmented-indicator",ref:i}),t.map(((n,l)=>e.createElement($e,{key:n.value,item:n,index:l,isLast:l===t.length-1,active:s===l,onChange:r,ref:e=>c.current[l]=e}))))},Re=({options:t,value:n,disabled:l,autoComplete:a,onChangeValue:r})=>e.createElement("select",{className:v("text select",l&&"disabled"),onChange:e=>r(e.target.value),value:n,disabled:l,autoComplete:a},(()=>{if(t instanceof Array)return t.map((t=>e.createElement("option",{key:t.value,value:t.value,children:t.name})));Object.keys(t).map((n=>e.createElement("option",{key:n,value:n,children:t[n]})))})()),Xe=({leftText:t,rightText:n})=>e.createElement("div",{className:"tabular-row"},e.createElement("div",{className:"tabular-row-left"},t),e.createElement("div",{className:"tabular-row-right"},n)),Ye=(e,t=0)=>{let n=3735928559^t,l=1103547991^t;for(let t,a=0;a<e.length;a++)t=e.charCodeAt(a),n=Math.imul(n^t,2654435761),l=Math.imul(l^t,1597334677);return n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(l^l>>>13,3266489909),l=Math.imul(l^l>>>16,2246822507),l^=Math.imul(n^n>>>13,3266489909),4294967296*(2097151&l)+(n>>>0)},We=360/Math.pow(2,53),Ue=o((({tag:t,count:n})=>{const l=(e=>`hsl(${180-We*Ye(e)}, 100%, 50%)`)(t);return e.createElement("div",{className:"tag",style:{borderColor:l,color:l},children:`${t} ${n||""}`})})),_e={code:"one-time-code"},Ie={phone:"tel",code:"tel"},je=t((({placeholder:t,value:l="",icon:a,type:r="text",dnt:c,disabled:i,rows:s=0,className:o,onFocus:m,autoComplete:u,onClick:h,maxLength:p,id:g,onChangeText:f=(()=>null),autoFocus:y,loading:b,RightComponent:N,countryCode:k,onChangePhone:C,lowerCase:x,min:w,max:M,onPressCountry:P,countries:S},T)=>{const[L,D]=n(l);return e.createElement("div",{className:"text-input"},"phone"===r&&(()=>{const t=S?S.find((e=>e.code===k)):null;return t?e.createElement(E,{className:"text-input-country",onClick:P},e.createElement("span",{className:"emoji"},t.flag),t.prefix):null})(),a?e.createElement(V,{className:"text-input-icon",icon:a}):"username"===r?e.createElement("span",{className:"text-input-icon"},"@"):"search"===r?e.createElement(V,{className:"text-input-icon",icon:"search"}):void 0,d("textarea"===r||s?"textarea":"input",{type:Ie[r]||r,autoComplete:_e[r],maxLength:p,className:v("text",i&&"disabled",c&&"fs-hide",o),readOnly:i,onChange:e=>{let t=e.target.value;D(t),"phone"===r?t=t.replace(/[^0-9]/g,""):(x&&(t=t.toLowerCase()),p&&(t=t.slice(0,p)),"username"===r&&(t=t.replace(/\s/g,""))),f(t)},value:(e=>{if("phone"===r&&k){const t=S.find((e=>e.code===k)),n=e.split("");return t.example.split("").map((e=>{if(n.length)return"X"===e?n.shift():e})).filter(Boolean).join("")}return e})(l),autoCapitalize:x&&"none",placeholder:t,rows:s,onFocus:m,onClick:h,id:g,autoFocus:y,ref:T,min:w,max:M}),a?e.createElement("img",{className:"text-input-icon",src:a}):null,N,b?e.createElement("div",{className:"text-input-spinner"},e.createElement(R,{size:18})):null,"search"!==r?null:l?e.createElement(E,{onClick:()=>f("")},e.createElement(V,{icon:"cancel",className:"text-input-clear"})):void 0)})),Ae=({pan:t,i:n,width:r})=>{const c=l();return a((()=>{if(!r)return;const e=n*r,l=r/3;return t.on((t=>{const n=Math.min(Math.abs(e-t),l);c.current.style.opacity=Math.min(1,1.5-n/l)}))}),[r]),e.createElement("div",{className:"pager-dot",ref:c,style:{opacity:t.value===n?1:.5}})},Be=({title:t,i:n,pan:r,width:c,onPress:i})=>{const s=l();return a((()=>{if(!c)return;const e=n*c,t=c/3;return r.on((n=>{const l=Math.min(Math.abs(e-n),t);s.current.style.opacity=1.5-l/t}))}),[c]),e.createElement("div",{children:t,className:"pager-tabs-title",onClick:()=>i(n),ref:s,style:{opacity:r.value===n?1:.5}})},He=t((({titles:t,children:n,vertical:r,dots:c,className:s},o)=>{const d=S(0),m=l(),u=l(),h=l({}).current;i(o,(()=>({scrollToPage:e=>{r?d.spring(e*g):d.spring(e*p)}})));const{width:p,height:g}=C(u,{enablePointerControls:!0,onCapture:e=>{if(r){if("v"===e.locked)return e.d.y<0||h.initPan-e.d.y>0}else if("h"===e.locked)return e.d.x<0||h.initPan-e.d.x>0},onDown:e=>{r?(h.currentPage=Math.round(d.value/e.height),h.initPan=d.value):(h.currentPage=Math.round(d.value/e.width),h.initPan=d.value)},onMove:e=>{if(r){const t=x(h.initPan-e.d.y,0,e.height*(n.length-1));d.setValue(t)}else{const t=x(h.initPan-e.d.x,0,e.width*(n.length-1));d.setValue(t)}},onUp:e=>{if(r)if(e.flick.y<0)d.spring(g*x(h.currentPage+1,0,n.length-1));else if(e.flick.y>0)d.spring(g*x(h.currentPage-1,0,n.length-1));else{const t=x(Math.round(d.value/e.height),0,n.length-1);d.spring(t*g)}else if(e.flick.x<0)d.spring(p*x(h.currentPage+1,0,n.length-1));else if(e.flick.x>0)d.spring(p*x(h.currentPage-1,0,n.length-1));else{const t=x(Math.round(d.value/e.width),0,n.length-1);d.spring(t*p)}},onPan:e=>{console.log("Pan:",e.d.x,e.d.y),d.setValue(x(d.value+e.d.x,0,p*(n.length-1)))}},[n]);a((()=>d.on((e=>{u.current.style.transform=`translate${r?"Y":"X"}(-${e}px)`,m.current&&(m.current.style.transform=`translateX(${e/n.length}px)`)}))),[p]);const E=e=>{d.spring(e*p)};return e.createElement("div",{className:v("pager",r?"vertical":"horizontal",s)},t?e.createElement("div",{className:"pager-tabs"},t.map(((t,n)=>e.createElement(Be,{key:n,title:t,pan:d,i:n,width:p,onPress:E}))),p?e.createElement("div",{className:"pager-tabs-indicator",ref:m,style:{width:p/t.length}}):null):null,e.createElement("div",{className:"pager-scroller"},e.createElement("div",{className:"pager-canvas",ref:u,style:{transform:r?"translateX(0px)":"translateY(0px)"}},e.Children.map(n,((t,n)=>e.createElement("div",{key:n,className:"pager-page",children:t}))))),c?e.createElement("div",{className:"pager-dots"},e.Children.map(n,((t,n)=>e.createElement(Ae,{key:n,pan:d,width:p,i:n})))):null)})),Oe=t((({children:t,title:n,search:r,onChangeSearch:c,searchLoading:s,hasScrollView:o=!0,headerRight:d,onClose:m,isVisible:u},h)=>{const v=l(),g=l(),E=S(0),f=()=>{console.log("close window"),m?E.spring(0).then(m):p.goBack(1)};i(h,(()=>({close:f})));const{height:y}=C(g,{onMove:e=>{E.setValue(y-Math.max(0,e.d.y))},onUp:e=>{1===e.flick.y||e.d.y>e.height/2?f():E.spring(e.height)}});return a((()=>{y&&(u||m?E.spring(y):E.spring(0))}),[u,y]),a((()=>{const e=document.querySelectorAll(".card");return E.on((t=>{const n=t/y;g.current&&(g.current.style.transform=`translateY(-${t}px)`),v.current&&(v.current.style.display=t?"block":"none",v.current.style.opacity=t/y*.8),[...e].forEach((e=>{e.style.transform=`scale(${1-.04*n})`}))}))}),[y]),e.createElement("div",{className:"layer"},e.createElement("div",{className:"shade",ref:v}),e.createElement("div",{className:"window",ref:g},e.createElement("div",{className:"window-content"},e.createElement(Q,{title:n,presentation:"modal",onClose:f,SearchComponent:c?e.createElement("div",{className:"header-search"},e.createElement(je,{placeholder:"Search",type:"search",value:r,onChangeText:c,loading:s})):null,headerRight:d}),o?e.createElement($,{className:"card-body",children:t}):e.createElement("div",{className:"card-body",children:t}))))})),Fe=({href:t,onClick:n,children:l,disabled:a,className:r})=>e.createElement(E,{className:v("touchable-highlight",a&&"disabled",r),onClick:n,href:t,children:l}),qe=new Map,Ke=e=>function(...t){const n=t[0];return qe.has(n)||qe.set(n,e.apply(this,t)),qe.get(n)},Ge=Ke((e=>new Promise((t=>{const n=document.createElement("link");n.setAttribute("rel","stylesheet"),n.setAttribute("href",e),n.onload=()=>t(),document.head.appendChild(n)})))),Je=Ke(((e,t)=>new Promise((n=>{const l=document.createElement("script");l.type="text/javascript",l.async=!0,l.src=e,l.onload=()=>n(window[t]),document.head.appendChild(l)})))),Qe=({width:e,height:t})=>{document.documentElement.style.setProperty("--viewport-width",`${e}px`),document.documentElement.style.setProperty("--viewport-height",`${t}px`)};Qe({width:document.documentElement.clientWidth,height:document.documentElement.clientHeight}),new ResizeObserver((e=>{Qe(e[0].contentRect)})).observe(document.documentElement);const Ze=navigator.virtualKeyboard,et=()=>a((()=>{if(Ze)return Ze.overlaysContent=!0,()=>Ze.overlaysContent=!1}),[]);export{O as ActionSheet,R as ActivityIndicator,_ as Alert,P as AnimatedValue,q as Avatar,A as BottomSheet,K as BreadCrumbs,X as Button,te as Card,G as CheckBox,ne as CircleCheck,le as ConnectionIndicator,ae as CornerDialog,de as DashboardIcon,re as Dropdown,ue as DropdownItem,me as Emoji,f as FLICK_SPEED,he as Fab,we as FilterButton,pe as FullScreen,Ee as HeaderButton,V as Icon,ge as Image,ve as List,Ne as Modal,fe as PercentBar,xe as Pill,Z as Placeholder,Te as PoonOverlays,Le as ProgressIndicator,Ve as ProgressRing,D as PullIndicator,De as RadioButton,ie as Reveal,Q as ScreenHeader,$ as ScrollView,ze as SegmentedController,Re as Select,ee as Shade,Xe as TabularRow,Ue as Tag,je as TextInput,Pe as Toast,E as Touchable,Fe as TouchableHighlight,j as TouchableRow,He as ViewPager,Oe as Window,w as bounce,v as c,x as clamp,Ye as cyrb53,M as easeOutCubic,Ce as hideModal,Ge as loadCss,Je as loadScript,Ke as memoize,ye as modalState,se as setRevealOrigin,F as showActionSheet,I as showAlert,ke as showModal,g as toPercent,Se as toast,S as useAnimatedValue,C as usePanGestures,N as useSize,et as useVirtualKeyboard};
{
"name": "poon-ui",
"version": "1.0.8",
"version": "1.0.9",
"description": "The provocative UI framework that's so native it's indecent!",

@@ -9,3 +9,3 @@ "type": "module",

"rollup": "rollup -c",
"patch": "npm version patch && npm publish"
"patch": "rollup -c && git commit -a -m \"publish\" && npm version patch && npm publish"
},

@@ -12,0 +12,0 @@ "keywords": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc