ekm-ui 0.3.68 → 0.3.71

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.
Files changed (42) hide show
  1. package/.turbo/turbo-build.log +61 -38
  2. package/CHANGELOG.md +12 -0
  3. package/dist/card-payment-block.css +1 -1
  4. package/dist/card-payment-block.css.map +1 -1
  5. package/dist/card-payment-block.mjs +4 -3
  6. package/dist/chunk-4S3NZSBU.mjs +34 -0
  7. package/dist/chunk-4S3NZSBU.mjs.map +1 -0
  8. package/dist/chunk-CMA7TSQG.mjs +12 -0
  9. package/dist/chunk-CMA7TSQG.mjs.map +1 -0
  10. package/dist/drag-and-drop.css +1 -1
  11. package/dist/drag-and-drop.css.map +1 -1
  12. package/dist/drag-and-drop.mjs +4 -3
  13. package/dist/file-picker/file-picker.css +1 -1
  14. package/dist/file-picker/file-picker.css.map +1 -1
  15. package/dist/file-picker/file-picker.mjs +4 -3
  16. package/dist/index.css +1 -1
  17. package/dist/index.css.map +1 -1
  18. package/dist/index.d.ts +1 -0
  19. package/dist/index.mjs +4 -3
  20. package/dist/layout/layout.css +1 -1
  21. package/dist/layout/layout.css.map +1 -1
  22. package/dist/layout/layout.mjs +4 -3
  23. package/dist/product-picker/product-drawer.css +2 -0
  24. package/dist/product-picker/product-drawer.css.map +1 -0
  25. package/dist/product-picker/product-drawer.d.ts +11 -0
  26. package/dist/product-picker/product-drawer.mjs +60 -0
  27. package/dist/product-picker/product-drawer.mjs.map +1 -0
  28. package/dist/product-picker/product-listing.d.ts +31 -0
  29. package/dist/product-picker/product-listing.mjs +7 -0
  30. package/dist/product-picker/product-listing.mjs.map +1 -0
  31. package/dist/stacked-list-item.css +1 -1
  32. package/dist/stacked-list-item.css.map +1 -1
  33. package/dist/stacked-list-item.mjs +4 -3
  34. package/dist/table-result-block.css +1 -1
  35. package/dist/table-result-block.css.map +1 -1
  36. package/dist/table-result-block.mjs +4 -3
  37. package/package.json +2 -1
  38. package/src/index.tsx +1 -0
  39. package/src/product-picker/product-drawer.tsx +324 -0
  40. package/src/product-picker/product-listing.tsx +147 -0
  41. package/dist/chunk-SBWI5OCU.mjs +0 -32
  42. package/dist/chunk-SBWI5OCU.mjs.map +0 -1
@@ -1,4 +1,6 @@
1
- export { e as TableResultBlock } from './chunk-SBWI5OCU.mjs';
1
+ export { e as TableResultBlock } from './chunk-4S3NZSBU.mjs';
2
+ import './chunk-PPMW7YAZ.mjs';
3
+ import './chunk-Q365BFES.mjs';
2
4
  import './chunk-EHJJX6ZZ.mjs';
3
5
  import './chunk-ZJATBQ3X.mjs';
4
6
  import './chunk-CEK5K5TU.mjs';
@@ -7,8 +9,7 @@ import './chunk-ASCPOK5F.mjs';
7
9
  import './chunk-LQQDRIZN.mjs';
8
10
  import './chunk-256SAVHD.mjs';
9
11
  import './chunk-VPLCWU7T.mjs';
10
- import './chunk-PPMW7YAZ.mjs';
11
- import './chunk-Q365BFES.mjs';
12
+ import './chunk-CMA7TSQG.mjs';
12
13
  import './chunk-2IL2LP47.mjs';
13
14
  import './chunk-25FJ277C.mjs';
14
15
  import './chunk-FAFXVD4P.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ekm-ui",
3
- "version": "0.3.68",
3
+ "version": "0.3.71",
4
4
  "sideEffects": [
5
5
  "**/*.css"
6
6
  ],
@@ -66,6 +66,7 @@
66
66
  "clsx": "^1.2.1",
67
67
  "flowbite": "^1.8.1",
68
68
  "flowbite-react": "^0.6.4",
69
+ "pluralize": "^8.0.0",
69
70
  "react-color": "^2.19.3",
70
71
  "react-hook-form": "^7.51.0",
71
72
  "react-icons": "^4.8.0"
package/src/index.tsx CHANGED
@@ -55,5 +55,6 @@ export { Spinner } from "./spinner";
55
55
  export { FeaturePageGroup } from "./featurePageComponents/feature-page-group";
56
56
  export { TableResultBlock } from "./table-result-block";
57
57
  export { DateRangePicker } from "./date-range-picker";
58
+ export { ProductPicker } from "./product-picker/product-drawer";
58
59
 
59
60
  import "./styles.css";
@@ -0,0 +1,324 @@
1
+ // @ts-nocheck
2
+ import { useEffect, useRef, useState, useReducer, useImperativeHandle, forwardRef } from 'react'
3
+ import { Drawer } from '../drawer'
4
+ import { Button } from '../button'
5
+ import { Search} from '../search/search'
6
+ import { TableResultBlock } from '../table-result-block'
7
+ import { HiClipboardList } from 'react-icons/hi'
8
+ import { Listing } from './product-listing'
9
+ import PropTypes from 'prop-types'
10
+ import pluralize from 'pluralize'
11
+
12
+ const Status = Object.freeze({
13
+ EMPTY: 'EMPTY',
14
+ SEARCH_LOADING: 'SEARCH-LOADING',
15
+ LOADING: 'LOADING',
16
+ LOADED: 'LOADED',
17
+ SELECTED: 'SELECTED',
18
+ SEARCH_RESULTS: 'SEARCH-RESULTS',
19
+ SEARCH_EMPTY: 'SEARCH-EMPTY',
20
+ })
21
+
22
+ const searchCategories = [
23
+ {
24
+ display: 'Name',
25
+ value: 'NME',
26
+ },
27
+ {
28
+ display: 'Category',
29
+ value: 'CAT',
30
+ },
31
+ ]
32
+
33
+ const initialState = Object.freeze({
34
+ mode: Status.LOADING,
35
+ listSize: 'h-5/6',
36
+ listBorder: '',
37
+ searchDisabled: false,
38
+ })
39
+
40
+ function calculateSelectedProducts(obj) {
41
+ const mutatedOriginalArray = [...obj.orig].filter((x) => {
42
+ return !obj.remove.includes(x)
43
+ })
44
+ return [...mutatedOriginalArray, ...obj.add]
45
+ }
46
+
47
+ function ProductPickerReducer(state, action) {
48
+ switch (action.type) {
49
+ case Status.EMPTY:
50
+ return {
51
+ mode: Status.EMPTY,
52
+ listSize: 'h-5/6',
53
+ listBorder: '',
54
+ searchDisabled: true,
55
+ }
56
+ case Status.LOADING:
57
+ return initialState
58
+ case Status.LOADED:
59
+ return {
60
+ mode: Status.LOADED,
61
+ listSize: 'h-[87.333333%]',
62
+ listBorder: 'border',
63
+ searchDisabled: false,
64
+ }
65
+ case Status.SELECTED:
66
+ return { mode: Status.SELECTED, listSize: 'h-[80%]', listBorder: 'border', searchDisabled: false }
67
+ case Status.SEARCH_RESULTS:
68
+ return {
69
+ mode: Status.SEARCH_RESULTS,
70
+ listSize: 'h-5/6',
71
+ listBorder: 'border',
72
+ searchDisabled: false,
73
+ }
74
+ case Status.SEARCH_EMPTY:
75
+ return {
76
+ mode: Status.SEARCH_EMPTY,
77
+ listSize: 'h-5/6',
78
+ listBorder: '',
79
+ searchDisabled: false,
80
+ }
81
+ default:
82
+ throw new Error('Unknown file picker state: ' + action.page ?? '')
83
+ }
84
+ }
85
+
86
+ /**
87
+ * IMPORTANT TO NOTE
88
+ * The parent/calling component is responsible for fetching the products. This component should not really know
89
+ * what the products are, just how to display them. This means that searching and pagination logic should also
90
+ * be handled by the parent/calling component eg: fetching the products and passing them to this component.
91
+ */
92
+
93
+ export const ProductPicker = forwardRef(function ProductPicker({ show, preSelected = [], onClose, requestCallback, callback }, ref) {
94
+ const searchFieldRef = useRef()
95
+ const isViewableRef = useRef(false)
96
+ const [state, dispatch] = useReducer(ProductPickerReducer, { mode: Status.LOADING, footerBorder: 'border-t' })
97
+ const [totalPages, setTotalPages] = useState(0)
98
+ const currentPageRef = useRef(1)
99
+ const listAttributeRef = useRef({ pages: 0, totalEntries: 0 })
100
+ const [fetchData, setFetchData] = useState(false)
101
+ const [search, setSearch] = useState({ text: '', category: { display: 'Name', value: 'NME' } })
102
+ const [products, setProducts] = useState([])
103
+ // Selected State
104
+ const [session, setSession] = useState({ orig: [], add: [], remove: [], isAll: false }) // handles DEFAULT selection sessions
105
+
106
+ useEffect(() => {
107
+ // Workaround to ensure the drawer is cleared when it is first opened as its always on the DOM!
108
+ if (show) {
109
+ dispatch({ type: Status.LOADING })
110
+ // setSelected([])
111
+ listAttributeRef.current = { pages: 0, totalEntries: 0 }
112
+ clearState()
113
+ getProducts(1)
114
+ setSession({ ...session, orig: preSelected })
115
+ isViewableRef.current = true
116
+ }
117
+ }, [show])
118
+
119
+ useEffect(() => {
120
+ if (show && state.mode === isViewableRef.current) {
121
+ currentPageRef.current = 1
122
+ getProducts()
123
+ }
124
+ }, [search.text, search.category.display])
125
+
126
+ const clearState = () => {
127
+ setProducts([])
128
+ setSession({ orig: [], add: [], remove: [], isAll: false })
129
+ setFetchData(false)
130
+ }
131
+
132
+ const getProducts = (cp = 0) => {
133
+ let page = cp === 0 ? currentPageRef.current : cp
134
+ requestCallback({
135
+ SearchText: search.text,
136
+ PageSize: 11,
137
+ Page: page,
138
+ SearchType: search.category.display,
139
+ })
140
+ }
141
+
142
+ useImperativeHandle(ref, () => ({
143
+ responseHandler: (response) => {
144
+ try {
145
+ if (search.text?.length > 0) dispatch({ type: Status.SEARCH_RESULTS })
146
+ if (response.Result.Data.length > 0 && currentPageRef.current > 1) {
147
+ setProducts((products) => [...products, ...response.Result.Data])
148
+ } else {
149
+ setProducts(response.Result.Data)
150
+ }
151
+
152
+ listAttributeRef.current = { pages: response.Result.NumberOfPages, totalEntries: response.Result.Total }
153
+ setTotalPages(response.Result.NumberOfPages)
154
+
155
+ if (search.text?.length > 0) {
156
+ dispatch({ type: response.Result.Data.length > 0 ? Status.SEARCH_RESULTS : Status.SEARCH_EMPTY })
157
+ } else {
158
+ dispatch({ type: response.Result.Data.length > 0 ? Status.LOADED : Status.EMPTY })
159
+ }
160
+ if (session.orig.length + session.add.length - session.remove.length > 0) dispatch({ type: Status.SELECTED })
161
+ setFetchData(false)
162
+ } catch (error) {
163
+ console.error('Error fetching products', error)
164
+ dispatch({ type: search.text?.length === 0 ? Status.SEARCH_EMPTY : Status.EMPTY })
165
+ }
166
+ },
167
+ }))
168
+
169
+ const handleSearchRequest = (searchTerm) => {
170
+ const text = searchTerm.text ?? ''
171
+ const s = search.text ?? ''
172
+ setSearch(searchTerm)
173
+ if ((s.length > 0 && text.length === 0) || (s.length === 0 && text.length > 0 && state.mode !== Status.LOADING))
174
+ dispatch({ type: Status.LOADING })
175
+ }
176
+
177
+ const handleProductSelection = () => {
178
+ callback(session)
179
+ handleClose()
180
+ }
181
+
182
+ const handleClose = () => {
183
+ clearState()
184
+ isViewableRef.current = false
185
+ onClose()
186
+ }
187
+
188
+ const handleListActions = (action) => {
189
+ switch (action.type) {
190
+ case 'FETCH_DATA':
191
+ setFetchData(action.payload)
192
+ if (currentPageRef.current < listAttributeRef.current.pages && !fetchData) {
193
+ // pass in the current page + 1 to get the next page of data then change state as the state is not updated immediately
194
+ setFetchData(true)
195
+ currentPageRef.current = currentPageRef.current + 1
196
+ getProducts()
197
+ }
198
+ break
199
+ case 'SELECTION':
200
+ const added = session.add.find((x) => x === action.payload) != null
201
+ const removed = session.remove.find((x) => x === action.payload) != null
202
+ const preExisted = session.orig.find((x) => x === action.payload) != null
203
+ let rem = [...session.remove]
204
+ let add = [...session.add]
205
+ if (preExisted && !removed) {
206
+ rem.push(action.payload)
207
+ } else if (preExisted && removed) {
208
+ rem = [...rem].filter((x) => x !== action.payload)
209
+ } else if (!preExisted && !added) {
210
+ add.push(action.payload)
211
+ } else if (!preExisted && added) {
212
+ add = [...add].filter((x) => x !== action.payload)
213
+ }
214
+
215
+ setSession({ ...session, add: add, remove: rem })
216
+ if (session.orig.length + add.length - rem.length > 0) dispatch({ type: Status.SELECTED })
217
+ break
218
+ case 'DESELECT_ALL':
219
+ setSession({ ...session, orig: [], add: [], remove: [] })
220
+ dispatch({ type: Status.LOADED })
221
+ break
222
+ default:
223
+ break
224
+ }
225
+ }
226
+
227
+ const renderList = () => {
228
+ switch (state.mode) {
229
+ case Status.EMPTY:
230
+ return (
231
+ <TableResultBlock
232
+ icon={<HiClipboardList className="mb-4 h-16 w-16 text-gray-500 dark:text-gray-400" />}
233
+ title="You Have No Products"
234
+ message="Your products will appear here"
235
+ spinner={false}
236
+ />
237
+ )
238
+ case Status.LOADING:
239
+ return <TableResultBlock title="Loading Products" message="Please wait this may take a few minutes" spinner />
240
+ case Status.SEARCH_RESULTS:
241
+ case Status.SELECTED:
242
+ case Status.LOADED:
243
+ return (
244
+ <Listing
245
+ border={state.listSize}
246
+ products={products}
247
+ isMore={currentPageRef.current < listAttributeRef.current.pages}
248
+ selected={calculateSelectedProducts(session)}
249
+ page={currentPageRef.current}
250
+ pages={totalPages}
251
+ callback={handleListActions}
252
+ />
253
+ )
254
+ case Status.SEARCH_EMPTY:
255
+ return (
256
+ <TableResultBlock
257
+ icon={<HiClipboardList className="mb-4 h-16 w-16 text-gray-500 dark:text-gray-400" />}
258
+ title="No Products Found"
259
+ message="No products were found matching your search"
260
+ />
261
+ )
262
+
263
+ default:
264
+ break
265
+ }
266
+ }
267
+
268
+ const renderContent = () => (
269
+ <>
270
+ {session.orig.length + session.add.length - session.remove.length > 0 && (
271
+ <div className="mb-4 rounded-md border border-orange-200 bg-yellow-50 p-4">
272
+ <p className="text-center text-sm text-yellow-800">
273
+ {`${pluralize('product', session.orig.length + session.add.length - session.remove.length, true)} selected.`}
274
+ <span
275
+ onClick={() => handleListActions({ type: 'DESELECT_ALL', payload: null })}
276
+ className="cursor-pointer text-primary-600 hover:underline"
277
+ >{` Clear Selection.`}</span>
278
+ </p>
279
+ </div>
280
+ )}
281
+ <Search
282
+ id="file-search"
283
+ ref={searchFieldRef}
284
+ categories={searchCategories}
285
+ placeholder="Search your images"
286
+ disabled={state.searchDisabled}
287
+ callback={handleSearchRequest}
288
+ />
289
+ <div className="mt-4 mb-4">
290
+ {(state.mode === Status.SEARCH_RESULTS || state.mode === Status.SEARCH_EMPTY) && search.text.length > 0 && (
291
+ <span className="ms-1 text-sm font-medium text-gray-500 md:ms-2 dark:text-gray-400">{`Showing results for..."${search.text}"`}</span>
292
+ )}
293
+ </div>
294
+ {renderList()}
295
+ </>
296
+ )
297
+
298
+ return (
299
+ <Drawer show={show} onClose={handleClose} title="File Picker" onHide={() => {}}>
300
+ <div className="h-full">{show && renderContent()}</div>
301
+ <div className={`grid grid-cols-2 grid-flow-col gap-4 bottom-0 mt-0 pt-2 bg-white dark:border-gray-600`} style={{ marginTop: '-50px' }}>
302
+ <Button color="light" onClick={handleClose}>
303
+ Close
304
+ </Button>
305
+ <Button color="success" onClick={handleProductSelection} disabled={products.length === 0}>
306
+ Add Products
307
+ </Button>
308
+ </div>
309
+ </Drawer>
310
+ )
311
+ })
312
+
313
+ ProductPicker.propTypes = {
314
+ /** Show the drawer */
315
+ show: PropTypes.bool.isRequired,
316
+ /** Array of integers representing the product id's of currently selected products */
317
+ preSelected: PropTypes.array,
318
+ /** Callback to close the drawer */
319
+ onClose: PropTypes.func.isRequired,
320
+ /** Callback to return the selected products {orig - preselected, add - newly added, remove -items removed from pre-selected} */
321
+ callback: PropTypes.func.isRequired,
322
+ }
323
+
324
+ ProductPicker.displayName = 'ProductPicker'
@@ -0,0 +1,147 @@
1
+ // @ts-nocheck
2
+ import { useState, useEffect, useRef } from 'react'
3
+ import { Checkbox } from '../checkbox'
4
+ import PropTypes from 'prop-types'
5
+ import pluralize from 'pluralize'
6
+ // FOR USE WITH THE PRODUCT PICKER COMPONENT - ONLY
7
+
8
+ function BuildImageUrl(imageUrl) {
9
+ return `${window.resourceSettings.imageBasePath}${imageUrl}?v=${window.resourceSettings.version}`;
10
+ }
11
+
12
+ export function Listing({ border, products, isMore, selected, page, pages, callback }) {
13
+ const scrollRef = useRef()
14
+ const [showLoader, setShowLoader] = useState(false)
15
+
16
+ useEffect(() => {
17
+ const element = document.querySelector('#product-list')
18
+ if (element && !element.hasAttribute('scroll')) scrollRef.current.addEventListener('scroll', handleScroll)
19
+ if (scrollRef.current != null) scrollRef.current.scrollTop = 0
20
+ return () => {
21
+ const element = document.querySelector('#product-list')
22
+ if (element && element.hasAttribute('scroll')) scrollRef.current.removeEventListener('scroll', handleScroll)
23
+ }
24
+ }, [])
25
+
26
+ const handleScroll = () => {
27
+ if (!isMore) return
28
+ const offset = scrollRef.current.scrollHeight - scrollRef.current.offsetHeight
29
+ const scroll = Math.floor(scrollRef.current.scrollTop)
30
+ // the '-2 & +2' is used as a buffer, otherwise '==' positioning of the scroll becomes too accurate.
31
+ if (scroll == offset || scroll + 2 == offset || scroll - 2 == offset) {
32
+ setShowLoader(true)
33
+ callback({ type: 'FETCH_DATA', payload: true })
34
+ }
35
+ }
36
+
37
+ const handleProductSelection = (id) => {
38
+ callback({ type: 'SELECTION', payload: id })
39
+ }
40
+
41
+ return (
42
+ <div id="product-list" ref={scrollRef} className={`${border} border rounded-md overflow-y-auto`}>
43
+ {(products || []).map((p) => {
44
+ return <ProductRow key={`product-row-${p.Name}`} product={p} selected={selected.includes(p.ProductId)} callback={handleProductSelection} />
45
+ })}
46
+ {isMore && page < pages && showLoader && <InfiniteLoader />}
47
+ </div>
48
+ )
49
+ }
50
+
51
+ function ProductRow({ product, selected = false, callback }) {
52
+ const handleProductSelection = (e) => {
53
+ callback(product.ProductId)
54
+ }
55
+ return (
56
+ <div
57
+ className={`flex items-center pt-4 pb-4 mt-1 mb-1 ${selected && 'bg-blue-50'} justify-between border-b border-gray-100 cursor-pointer`}
58
+ onClick={handleProductSelection}
59
+ >
60
+ <div className="flex items-center ml-3">
61
+ <div className="flex-shrink-0">
62
+ <Checkbox id={`cb-prod-${product.Id}`} name={product.Name} checked={selected} onChange={() => {}} />
63
+ </div>
64
+ <div className="ml-4">
65
+ {product.Image && product.IamgeName !== '[URL-DownloadRequested]' ? (
66
+ <img
67
+ className="h-10 w-10 rounded-md"
68
+ src={product.Image}
69
+ alt={product.Name}
70
+ onError={(e) => {
71
+ e.target.onerror = null
72
+ e.target.src = `${BuildImageUrl('/admin/Content/images/no-image-discount.png')}`
73
+ }}
74
+ className="h-10 w-10 rounded-sm"
75
+ />
76
+ ) : (
77
+ <img src={BuildImageUrl('/admin/Content/images/no-image-discount.png')} alt={product.Name} className="h-10 w-10 rounded-sm" />
78
+ )}
79
+ </div>
80
+ <div className="ml-4">
81
+ <div className=" font-medium text-gray-900">{product.Name}</div>
82
+ {product.Categories.length > 0 ? (
83
+ <div className="text-xs text-gray-500">{`${product.CategoryName} & ${pluralize('other', product.Categories.length, true)}`}</div>
84
+ ) : (
85
+ <div className="text-xs text-gray-500">{product.CategoryName}</div>
86
+ )}
87
+ </div>
88
+ </div>
89
+ <div className="ml-4 flex-shrink-0">
90
+ <span className="text-sm mr-3 text-gray-500">{`${globalThis.globalSettings.CurrencySymbol}${product.Price.toFixed(
91
+ globalThis.globalSettings.CurrencyExponent ?? 2,
92
+ )}`}</span>
93
+ </div>
94
+ </div>
95
+ )
96
+ }
97
+
98
+ Listing.propTypes = {
99
+ /** Border style to use*/
100
+ border: PropTypes.string,
101
+ /** Array of files to list */
102
+ products: PropTypes.array,
103
+ /** Boolean to indicate if there are more products to load */
104
+ isMore: PropTypes.bool,
105
+ /** Name of the selected file */
106
+ selected: PropTypes.array,
107
+ /** Current page */
108
+ page: PropTypes.number,
109
+ /** Total number of pages */
110
+ pages: PropTypes.number,
111
+ /** Callback function to handle events */
112
+ callback: PropTypes.func,
113
+ }
114
+
115
+ ProductRow.propTypes = {
116
+ /** Product object to display */
117
+ product: PropTypes.object,
118
+ /** Boolean to indicate if the file is selected */
119
+ selected: PropTypes.bool,
120
+ /** Callback function to handle events */
121
+ callback: PropTypes.func,
122
+ }
123
+
124
+ function InfiniteLoader() {
125
+ return (
126
+ <div className="flex justify-center pt-4 pb-4 mt-1 mb-1">
127
+ <div role="status">
128
+ <svg
129
+ aria-hidden="true"
130
+ className="inline-block w-8 h-8 text-gray-200 animate-spin dark:text-gray-600 fill-gray-600 dark:fill-gray-300"
131
+ viewBox="0 0 100 101"
132
+ fill="none"
133
+ xmlns="http://www.w3.org/2000/svg"
134
+ >
135
+ <path
136
+ d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z"
137
+ fill="currentColor"
138
+ />
139
+ <path
140
+ d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z"
141
+ fill="currentFill"
142
+ />
143
+ </svg>
144
+ </div>
145
+ </div>
146
+ )
147
+ }
@@ -1,32 +0,0 @@
1
- import { a as a$6, b } from './chunk-EHJJX6ZZ.mjs';
2
- import { a as a$g } from './chunk-LQQDRIZN.mjs';
3
- import { a as a$7 } from './chunk-256SAVHD.mjs';
4
- import { a as a$e } from './chunk-Q365BFES.mjs';
5
- import { a as a$2 } from './chunk-MXH3TZWM.mjs';
6
- import { a as a$c } from './chunk-MRJOYGDD.mjs';
7
- import { a as a$5 } from './chunk-5DQUZENZ.mjs';
8
- import { a as a$8 } from './chunk-4IKXV4FQ.mjs';
9
- import { a as a$b } from './chunk-EWNPNF2B.mjs';
10
- import { a as a$9 } from './chunk-VQ3MZS4J.mjs';
11
- import { a as a$1 } from './chunk-PT4DPY4L.mjs';
12
- import { a as a$4 } from './chunk-HEKVJKLH.mjs';
13
- import { a as a$3 } from './chunk-D6H235SZ.mjs';
14
- import { a as a$f } from './chunk-KEIDXVZB.mjs';
15
- import { a as a$d } from './chunk-YJKULMWM.mjs';
16
- import { a as a$a } from './chunk-QHJF4QWW.mjs';
17
- import { a } from './chunk-PUJZGK7Y.mjs';
18
- import { e as e$1, f } from './chunk-23SJGKDR.mjs';
19
- import { HiCreditCard, HiOutlineSearch } from 'react-icons/hi';
20
- import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
21
- import { useState, useMemo, useEffect, useRef, useReducer } from 'react';
22
- import { Badge, Sidebar } from 'flowbite-react';
23
- import { HiChartPie, HiTag, HiShoppingBag, HiPaintBrush, HiStar, HiDocument, HiRocketLaunch, HiGlobeAlt } from 'react-icons/hi2';
24
- import { BsCloudUpload, BsFillCheckCircleFill, BsFillImageFill } from 'react-icons/bs';
25
- import { BiSearch } from 'react-icons/bi';
26
- import { FaTimesCircle } from 'react-icons/fa';
27
-
28
- function Ae({cardPayment:r,enablePayPal:a}){return jsxs(a$1,{className:"border-0 shadow-sm ",children:[jsx("h3",{className:"text-xl font-semibold dark:text-white",children:"Billing Details"}),jsx("div",{className:"flex items-center justify-between pb-4",children:jsxs("fieldset",{className:"flex w-full flex-col gap-4",id:"radio",children:[jsxs("div",{className:"flex flex-col gap-2",children:[jsxs("div",{className:"flex items-center gap-2",children:[a&&jsx(a$2,{id:"creditDebitCard",name:"paymentType",value:"creditDebitCard"}),jsx(a$3,{htmlFor:"creditDebitCard",children:"Pay by Credit or Debit card"})]}),jsxs("div",{className:a?"ml-6 flex gap-2":"flex gap-2",children:[jsx("img",{src:"https://shared.ekmcdn.com/images/uifw/cards/visa.png",alt:"VISA Card Logo"}),jsx("img",{src:"https://shared.ekmcdn.com/images/uifw/cards/mastercard.png",alt:"MasterCard Card Logo"}),jsx("img",{src:"https://shared.ekmcdn.com/images/uifw/cards/maestro.png",alt:"Maestro Card Logo"}),jsx("img",{src:"https://shared.ekmcdn.com/images/uifw/cards/amex.png",alt:"AMEX Card Logo"})]})]}),r&&jsxs(Fragment,{children:[jsxs("div",{className:"grid grid-cols-1 content-start gap-6 md:grid-cols-2",children:[jsx(a$4,{label:"Name on Card *",htmlFor:"nameOnCard",helperText:"This is your name as is appears on the front of your credit or debit card.",children:jsx(a$5,{id:"nameOnCard",name:"nameOnCard",placeholder:"Your name",type:"text",required:!0})}),jsx(a$4,{label:"Card Number *",htmlFor:"cardNumber",helperText:"This is the long number on the front of your credit or debit card.",children:jsx(a$5,{id:"nameOnCard",name:"nameOnCard",placeholder:"0000 0000 0000 0000",type:"number",rightIcon:HiCreditCard,required:!0})})]}),jsxs("div",{className:"grid grid-cols-1 content-start gap-6 sm:grid-cols-3 md:grid-cols-4",children:[jsx(a$4,{label:"Expiry Date *",htmlFor:"nameOnCard",helperText:"The expiry date as it appears on your card.",children:jsx(a$5,{id:"nameOnCard",name:"nameOnCard",placeholder:"MM / YY",type:"text",required:!0})}),jsx(a$4,{label:"Security Code (CVC) *",htmlFor:"cardNumber",helperText:"The last three digits on the back of your card\u2019s signature strip.",children:jsx(a$5,{id:"nameOnCard",name:"nameOnCard",placeholder:"123",type:"text",rightIcon:HiCreditCard,required:!0})}),jsx("img",{className:"mt-7 hidden h-auto w-16 sm:block",src:"https://shared.ekmcdn.com/images/rise/cvc-reminder-image.png",alt:""})]})]}),a&&jsxs("div",{className:"flex flex-col gap-2",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx(a$2,{id:"PayPal",name:"paymentType",value:"PayPal"}),jsx(a$3,{htmlFor:"PayPal",children:"PayPal"})]}),jsx("div",{className:"ml-6",children:jsx("img",{src:"https://shared.ekmcdn.com/images/uifw/cards/paypal.png",alt:"PayPal Icon"})})]})]})})]})}Ae.displayName="CardPaymentBlock";function Ie(){return jsxs(Sidebar.Items,{children:[jsxs(Sidebar.ItemGroup,{children:[jsx(Sidebar.Item,{href:"/",icon:HiChartPie,className:"bg-gray-100 dark:bg-gray-700",children:"Dashboard"}),jsx(Sidebar.Item,{href:"/products",icon:HiTag,className:"",children:"Products"}),jsx(Sidebar.Item,{href:"/orders",icon:HiShoppingBag,label:"27",className:"",children:"Orders"}),jsxs(Sidebar.Collapse,{icon:HiPaintBrush,label:"Design",children:[jsx(Sidebar.Item,{href:"/design/design",className:"",children:"Theme"}),jsx(Sidebar.Item,{href:"/design/editor",className:"",children:"Editor"}),jsx(Sidebar.Item,{href:"/theme/webpages",className:"",children:"Webpages"})]}),jsx(Sidebar.Item,{href:"/features",icon:HiStar,className:"",children:"Features"})]}),jsxs(Sidebar.ItemGroup,{children:[jsx(Sidebar.Item,{href:"https://github.com/themesberg/flowbite-react/",icon:HiDocument,children:"Docs"}),jsx(Sidebar.Item,{href:"https://flowbite-react.com/",icon:HiRocketLaunch,children:"What's New"}),jsx(Sidebar.Item,{href:"https://github.com/themesberg/flowbite-react/issues",icon:HiGlobeAlt,children:"Support Centre"})]})]})}function er({children:r,hasHeader:a}){let[o,m]=useState(!1),[u,v]=useState(!1);return useMemo(()=>{a$6()&&!o&&v(!0);},[o]),jsxs(Fragment,{children:[jsx(a$7,{onMenuButtonClick:()=>{m(!o);},showCloseButton:u,avatarImg:"https://avatars.githubusercontent.com/u/49406022?v=4"}),jsxs("div",{className:"flex",children:[jsx(b,{collapsed:o,children:jsx(Ie,{})}),jsxs("div",{className:"flex w-3/4 flex-grow flex-col",children:[jsx("main",{className:`"relative dark:bg-gray-900" flex h-full flex-grow flex-col gap-4 overflow-y-auto bg-gray-50 ${a?"":"p-4"}`,children:r}),jsx(a$8,{companyName:"EKM"})]})]})]})}var E=e$1(a());var d=Object.freeze({NONE:"none",OVER:"drag-over",UPLOADING:"uploading",ERROR:"error",SUCCESS:"success"}),nr=Object.freeze({[d.NONE]:"border-gray-300 bg-gray-50 dark:hover:bg-gray-800 dark:bg-gray-700 hover:bg-gray-100 dark:border-gray-600 dark:hover:border-gray-500 dark:hover:bg-gray-600",[d.OVER]:"border-blue-300 bg-gray-50 dark:hover:bg-gray-800 dark:bg-gray-700 hover:bg-gray-100 dark:border-blue-600 dark:hover:border-blue-500 dark:hover:bg-blue-600",[d.UPLOADING]:"border-blue-300 bg-gray-50 dark:hover:bg-gray-800 dark:bg-gray-700 hover:bg-gray-100 dark:border-blue-600 dark:hover:border-blue-500 dark:hover:bg-blue-600",[d.ERROR]:"border-red-300 bg-gray-50 dark:hover:bg-gray-800 dark:bg-gray-700 hover:bg-gray-100 dark:border-red-600 dark:hover:border-red-500 dark:hover:bg-red-600",[d.SUCCESS]:"border-green-300 bg-gray-50 dark:hover:bg-gray-800 dark:bg-gray-700 hover:bg-gray-100 dark:border-green-600 dark:hover:border-green-500 dark:hover:bg-green-600"}),dr=["png","webp","jpg","gif","jpeg"];function Oe(r,a){let o=!a||a.length===0?dr:a;if(!r||r.length===0)return !1;let m=r.split(".").pop().toLowerCase();return o.includes(m)}function Y({subtitle:r="PNG, WEBP, JPG, JPEG or GIF",filetypes:a,uploaded:o,exitCallback:m,callback:u,errorCallback:v,pickerCallback:S}){let[s,c]=useState(d.NONE);useEffect(()=>{Object.values(d).includes(o)&&(c(o),setTimeout(()=>{o===d.ERROR&&v?v():c(d.NONE);},2e3));},[o]);let L=p=>{p.preventDefault(),c(d.OVER);},j=p=>{p.preventDefault(),m&&m(),c(d.NONE);},h=p=>{p.preventDefault(),Oe(p.dataTransfer.files[0].name,a)?(c(d.UPLOADING),u(p.dataTransfer.files[0])):(c(d.ERROR),setTimeout(()=>{v();},2e3));},q=p=>{Oe(p.target.files[0].name,a)?c(d.UPLOADING):c(d.ERROR),u(p.target.files[0]);},y=()=>{S&&S();},k=()=>jsxs("div",{className:"flex flex-col items-center justify-center pb-6 pt-5",children:[jsx(BsCloudUpload,{className:"h-12 w-12 text-gray-400 dark:text-gray-500"}),jsxs("p",{className:"mb-2 mt-5 text-sm text-gray-500 dark:text-gray-400",children:[jsx("span",{className:"font-semibold",children:"Click to upload"})," or drag and drop"]}),jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:r}),S&&jsx("div",{className:"mt-5",children:jsxs(a$a,{color:"info",onClick:y,children:[jsx(BiSearch,{className:"mr-2"}),"Browse File Manager"]})})]}),b=()=>jsx("div",{className:"flex flex-col items-center justify-center pb-6 pt-5",children:jsx("p",{className:"mb-2 mt-5 text-sm text-blue-500 dark:text-blue-400",children:jsx("span",{className:"font-semibold",children:"Drop here to upload"})})}),R=()=>jsxs("div",{className:"flex flex-col items-center justify-center pb-6 pt-5",children:[jsxs("svg",{"aria-hidden":"true",className:"mr-2 inline h-10 w-10 animate-spin text-gray-200 dark:text-gray-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),jsx("p",{className:"mb-2 mt-5 text-sm text-blue-500 dark:text-blue-400",children:jsx("span",{className:"font-semibold",children:"Uploading..."})})]}),B=()=>jsxs("div",{className:"flex flex-col items-center justify-center pb-6 pt-5",children:[jsx(FaTimesCircle,{className:"h-12 w-12 text-red-400 dark:text-red-500"}),jsx("p",{className:"mb-2 mt-5 text-sm text-red-500 dark:text-red-400",children:jsx("span",{className:"font-semibold",children:"Unable to upload"})})]}),F=()=>jsxs("div",{className:"flex flex-col items-center justify-center pb-6 pt-5",children:[jsx(BsFillCheckCircleFill,{className:"h-12 w-12 text-green-400 dark:text-green-500"}),jsx("p",{className:"mb-2 mt-5 text-sm text-green-500 dark:text-green-400",children:jsx("span",{className:"font-semibold",children:"Uploaded"})})]}),i=()=>{switch(s){case d.OVER:return b();case d.UPLOADING:return R();case d.ERROR:return B();case d.SUCCESS:return F();default:return k()}};return jsx("div",{onDragEnter:p=>p.preventDefault(),onDragOver:L,onDrop:h,onDragLeave:j,className:"flex h-full w-full items-center justify-center",children:jsxs("label",{htmlFor:"dropzone-file",className:`flex h-full w-full cursor-pointer flex-col items-center justify-center rounded-lg border-2 border-dashed ${nr[s]}`,children:[i(),s===d.NONE&&jsx("input",{id:"dropzone-file",type:"file",className:"hidden",onChange:q})]})})}Y.propTypes={filetypes:E.default.arrayOf(E.default.string),subtitle:E.default.string,uploaded:E.default.oneOf(["none","success","error"]).isRequired,exitCallback:E.default.func,errorCallback:E.default.func.isRequired,callback:E.default.func.isRequired,pickerCallback:E.default.func};Y.displayName="DragAndDrop";var T=e$1(a());var Te="/admin/api/common/directoryinformation/",e=Object.freeze({EMPTY:"EMPTY",SEARCH_LOADING:"SEARCH-LOADING",LOADING:"LOADING",LOADED:"LOADED",LOADED_NO_DRAG:"LOADED_NO_DRAG",SEARCH_RESULTS:"SEARCH-RESULTS",SEARCH_EMPTY:"SEARCH-EMPTY",UPLOAD_ERROR:"ERROR",DRAGGING:"DRAGGING"}),fr=Object.freeze({mode:e.LOADING,actionBtnTxt:"I Accept",actionBtnColor:"success",listSize:"h-5/6",listBorder:"",searchDisabled:!1});function gr(r,a){switch(a.type){case e.EMPTY:return {mode:e.EMPTY,actionBtnTxt:"Add Image",actionBtnColor:"blue",listSize:"h-5/6",listBorder:"",searchDisabled:!0};case e.LOADING:return fr;case e.LOADED:return {mode:e.LOADED,actionBtnTxt:"I Accept",actionBtnColor:"success",listSize:"h-[68.666667%]",listBorder:"border",searchDisabled:!1};case e.LOADED_NO_DRAG:return {mode:e.LOADED_NO_DRAG,actionBtnTxt:"I Accept",actionBtnColor:"success",listSize:"h-[87.666667%]",listBorder:"border",searchDisabled:!1};case e.SEARCH_RESULTS:return {mode:e.SEARCH_RESULTS,actionBtnTxt:"I Accept",actionBtnColor:"success",listSize:"h-5/6",listBorder:"border",searchDisabled:!1};case e.SEARCH_EMPTY:return {mode:e.SEARCH_EMPTY,actionBtnTxt:"I Accept",actionBtnColor:"success",listSize:"h-5/6",listBorder:"",searchDisabled:!1};default:throw new Error("Unknown file picker state: "+a.page)}}function Ce({appUrl:r,uri:a,show:o,hideDrag:m=!1,onClose:u,callback:v}){let S=useRef(),[s,c]=useReducer(gr,{mode:e.LOADING,footerBorder:"border-t"}),[L,j]=useState(0),h=useRef(1),[q,y]=useState(!1),[k,b]=useState(!1),R=useRef({pages:0,totalEntries:0}),[B,F]=useState(!1),[i,p]=useState(null),[G,V]=useState(null),[Be,J]=useState([]),[ve,O]=useState("none");useEffect(()=>{o&&(c({type:e.LOADING}),V(null),R.current={pages:0,totalEntries:0},Se(),Z(1));},[o]),useEffect(()=>{o&&(h.current=1,Z(),b(!1));},[i]),useEffect(()=>{G&&V(null),k&&b(!1);},[s.mode]);let Se=()=>{J([]),O("none"),F(!1),V(null),b(!1);},Z=(f$1=0)=>f(this,null,function*(){try{let D=f$1===0?h.current:f$1,H=(i==null?void 0:i.length)>0?`&FileNameIncludesString=${i}`:"&FileNameIncludesString=",A=yield (yield fetch(`${r}${Te}?CurrentPage=${D}&PageSize=10&Uri=${a}${H}`,{method:"GET",credentials:"same-origin",headers:{"Content-Type":"application/json"}})).json();if((i==null?void 0:i.length)>0&&c({type:e.SEARCH_RESULTS}),A.Items.Data.length>0&&D>1?J(oe=>[...oe,...A.Items.Data]):J(A.Items.Data),R.current={pages:A.Items.NumberOfPages,totalEntries:A.Items.Total},j(A.Items.NumberOfPages),(i==null?void 0:i.length)>0)c({type:A.Items.Data.length>0?e.SEARCH_RESULTS:e.SEARCH_EMPTY});else {let oe=m?e.LOADED_NO_DRAG:e.LOADED;c({type:A.Items.Data.length>0?oe:e.EMPTY});}O("none"),F(!1),y(!1);}catch(D){c({type:(i==null?void 0:i.length)===0?e.SEARCH_EMPTY:e.EMPTY});}}),Fe=f=>{hidedrag||(y(!0),S.current.removeFocus(),f.preventDefault());},Ge=f=>{hidedrag||y(!1);},He=f=>{var W;let D=(W=f.text)!=null?W:"",H=i!=null?i:"";p(f.text),(H.length>0&&D.length===0||H.length===0&&D.length>0&&s.mode!==e.LOADING)&&c({type:e.LOADING});},te=()=>{b(!0),y(!1),O("none");},Me=()=>{v(`https://files.ekmcdn.com/${G.Uri}`),ae();},ae=()=>{Se(),u();},De=f$1=>f(this,null,function*(){if(f$1==null){O("error"),te();return}try{let D=yield yr(f$1),H={Path:`/${a}/`,Name:f$1.name,Bytes:Nr(D),ForceOverwriteFile:!0};(yield fetch(`${r}${Te}`,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify(H)})).status===200?(O("success"),p(null),S.current.clear(),J([]),b(!1),Z(1)):O("error");}catch(D){O("error");}}),_e=f=>{switch(f.type){case"FETCH_DATA":F(f.payload),h.current<R.current.pages&&!B&&(F(!0),h.current=h.current+1,Z());break;case"SELECTION":V(f.payload),b(!1);break;}},Ue=()=>{switch(s.mode){case e.EMPTY:return jsx(ur,{});case e.LOADING:return jsx(br,{});case e.SEARCH_RESULTS:case e.LOADED:case e.LOADED_NO_DRAG:return jsx(a$g,{border:s.listSize,files:Be,isMore:h.current<R.current.pages,selected:G==null?void 0:G.Name,page:h.current,pages:L,callback:_e});case e.SEARCH_EMPTY:return jsx(hr,{});}},Ye=()=>jsxs(Fragment,{children:[jsx(a$e,{id:"file-search",ref:S,placeholder:"Search your images",disabled:s.searchDisabled,callback:He}),jsxs("div",{className:"mt-4 mb-4",children:[k&&jsxs(a$f,{type:"danger",onDismiss:()=>{b(!1);},children:[jsx("p",{className:"font-semibold",children:"File could not be uploaded"}),jsx("p",{children:"There was an error uploading the file. Please try again."})]}),s.mode!==e.SEARCH_RESULTS&&s.mode!==e.SEARCH_EMPTY&&!m&&jsx("div",{className:"h-68",children:jsx(Y,{uploaded:ve,callback:De,errorCallback:te})}),(s.mode===e.SEARCH_RESULTS||s.mode===e.SEARCH_EMPTY)&&(i==null?void 0:i.length)>0&&jsx("span",{className:"ms-1 text-sm font-medium text-gray-500 md:ms-2 dark:text-gray-400",children:`Showing results for..."${i}"`})]}),Ue()]}),ze=()=>jsx("div",{className:"h-[90.666667%] w-[93.666667%] z-50 absolute",children:jsx(Y,{uploaded:ve,exitCallback:Ge,callback:De,errorCallback:te})});return jsxs(a$9,{show:o,onClose:ae,title:"File Picker",onHide:()=>{},children:[jsxs("div",{className:"h-full",onDragEnter:Fe,children:[o&&q&&!hidedrag&&ze(),o&&Ye()]}),jsxs("div",{className:"grid grid-cols-2 grid-flow-col gap-4 bottom-0 mt-0 pt-2 bg-white dark:border-gray-600",style:{marginTop:"-50px"},children:[jsx(a$a,{color:"light",onClick:ae,children:"Close"}),jsx(a$a,{color:s.actionBtnColor,onClick:Me,disabled:G==null,children:s.actionBtnTxt})]})]})}Ce.propTypes={appUrl:T.default.string.isRequired,uri:T.default.string.isRequired,show:T.default.bool.isRequired,hideDrag:T.default.bool,onClose:T.default.func.isRequired,callback:T.default.func.isRequired};Ce.displayName="FilePicker";function ur(){return jsxs("div",{className:"flex flex-col items-center justify-center mt-5",children:[jsx("h1",{children:jsx(BsFillImageFill,{className:"text-9xl text-gray-700"})}),jsx("p",{className:"mt-4 font-semibold text-2xl text-gray-900",children:"You Have No Images"}),jsx("p",{className:"mt-4 text-sm text-gray-500",children:"Images will appear here when you upload them"})]})}function br(){return jsx("div",{className:"h-2/3 overflow-y-auto flex items-center justify-center",children:jsxs("div",{className:"flex flex-col items-center justify-center",children:[jsx("h1",{children:jsx(xr,{})}),jsx("p",{className:"mt-4 font-semibold text-2xl text-gray-900",children:"Loading Files"}),jsx("p",{className:"mt-4 text-sm text-gray-500",children:"Don't worry, this won't take long..."})]})})}function hr(){return jsx("div",{className:"h-5/6 overflow-y-auto flex items-center justify-center",children:jsxs("div",{className:"flex flex-col items-center justify-center",children:[jsx("h1",{children:jsx(HiOutlineSearch,{className:"text-9xl text-gray-700"})}),jsx("p",{className:"mt-4 font-semibold text-2xl text-gray-900",children:"No Files Found"}),jsx("p",{className:"mt-4 text-sm text-gray-500",children:"No files were found matching your search"})]})})}function xr(){return jsxs("div",{role:"status",children:[jsxs("svg",{"aria-hidden":"true",className:"inline w-14 h-14 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),jsx("span",{className:"sr-only",children:"Loading..."})]})}function yr(r){return f(this,null,function*(){return new Uint8Array(yield Cr(r))})}function Cr(r){return new Promise((a,o)=>{let m=new FileReader;m.onloadend=u=>a(u.target.result),m.onerror=u=>o(u),m.readAsArrayBuffer(r);})}function Nr(r){return btoa(Array.from(r).map(a=>String.fromCharCode(a)).join(""))}var z=e$1(a());function Ne({title:r,message:a,icon:o,children:m}){return jsx(a$b,{icon:o||jsx(a$c,{}),title:r,text:a,children:m})}Ne.propTypes={title:z.PropTypes.string.isRequired,message:z.PropTypes.string,useSpinner:z.PropTypes.bool,icon:z.PropTypes.node,children:z.PropTypes.node};Ne.displayName="TableResultBlock";function Le({id:r,title:a,text:o,avatarShow:m,avatarColor:u,avatarBorder:v,children:S,badgeText:s,badgeColor:c,icon:L}){function j(q){var y=q.split(" "),k=y[0],b=y[y.length-1],R=k.charAt(0);if(k!==b)var B=b.charAt(0);else var B="";return [R,B]}let h=j(a);return jsxs("li",{className:"hover:bg-gray-90 relative flex justify-between gap-x-6 px-4 py-5 dark:hover:bg-gray-900",children:[jsxs("div",{className:"flex min-w-0 flex-auto items-center gap-x-4",children:[m&&jsx(a$d,{placeholderInitials:h,color:u,border:v}),L&&L,jsxs("div",{className:"min-w-0 flex-auto",children:[jsxs("div",{className:"flex gap-2",children:[jsx("p",{className:"truncate text-sm font-semibold text-gray-900 dark:text-white",children:a}),s&&jsx(Badge,{color:c||"info",children:s})]}),jsx("p",{className:"mt-1 flex text-xs text-gray-500 dark:text-gray-400",children:jsx("span",{className:"relative truncate",children:o})})]})]}),jsx("div",{className:"flex flex-shrink-0 items-center gap-x-4",children:jsx("div",{className:"sm:flex sm:flex-col sm:items-end",children:S})})]},r)}Le.displayName="StackedListItem";
29
-
30
- export { Le as a, er as b, Y as c, Ce as d, Ne as e, Ae as f };
31
- //# sourceMappingURL=out.js.map
32
- //# sourceMappingURL=chunk-SBWI5OCU.mjs.map