PageSourceSearch

https://diks.net/_next/static/chunks/1n4uenb_adauf.js

js diks.net collected 2026-09-24 10:28:08 UTC 82,613 bytes, 1,481 lines download raw bytes

1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="54ceb37a-7d1b-31c8-1c29-f0437ed52a1f")}catch(e){}}();
2(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push([typeof document === "object" ? document.currentScript : undefined,
3415458, 431462, 
4((__turbopack_context__) => {
5"use strict";
6
7// MERGED MODULE: [project]/src/generated/storageOrder/reactQueries.tsx [app-client] (ecmascript)
8;
9var __TURBOPACK__imported__module__954616__ = __turbopack_context__.i(954616);
10var __TURBOPACK__imported__module__266027__ = __turbopack_context__.i(266027);
11var __TURBOPACK__imported__module__912598__ = __turbopack_context__.i(912598);
12var __TURBOPACK__imported__module__197643__ = __turbopack_context__.i(197643);
13// MERGED MODULE: [project]/src/generated/storageOrder/apiClient.ts [app-client] (ecmascript)
14;
15async function apiStorageOrderCheckout(axiosInstance, body, requestConfig) {
16    const response = await axiosInstance.request({
17        url: "storage-order/checkout",
18        method: "POST",
19        data: body,
20        ...requestConfig
21    });
22    return response.data;
23}
24async function apiStorageOrderConfigure(axiosInstance, query, body, requestConfig) {
25    const response = await axiosInstance.request({
26        url: "storage-order/",
27        method: "POST",
28        params: query,
29        data: body,
30        ...requestConfig
31    });
32    return response.data;
33}
34async function apiStorageOrderCreateQuotation(axiosInstance, body, requestConfig) {
35    const response = await axiosInstance.request({
36        url: "storage-order/quotation",
37        method: "POST",
38        data: body,
39        ...requestConfig
40    });
41    return response.data;
42}
43async function apiStorageOrderDiscountApply(axiosInstance, body, requestConfig) {
44    const response = await axiosInstance.request({
45        url: "storage-order/discount",
46        method: "POST",
47        data: body,
48        ...requestConfig
49    });
50    return response.data;
51}
52async function apiStorageOrderDiscountRemove(axiosInstance, requestConfig) {
53    const response = await axiosInstance.request({
54        url: "storage-order/discount",
55        method: "DELETE",
56        ...requestConfig
57    });
58    return response.data;
59}
60async function apiStorageOrderOverview(axiosInstance, query, requestConfig) {
61    const response = await axiosInstance.request({
62        url: "storage-order/",
63        method: "GET",
64        params: query,
65        ...requestConfig
66    });
67    return response.data;
68}
69__turbopack_context__.s([
70    "apiStorageOrderCheckout",
71    0,
72    apiStorageOrderCheckout,
73    "apiStorageOrderConfigure",
74    0,
75    apiStorageOrderConfigure,
76    "apiStorageOrderCreateQuotation",
77    0,
78    apiStorageOrderCreateQuotation,
79    "apiStorageOrderDiscountApply",
80    0,
81    apiStorageOrderDiscountApply,
82    "apiStorageOrderDiscountRemove",
83    0,
84    apiStorageOrderDiscountRemove,
85    "apiStorageOrderOverview",
86    0,
87    apiStorageOrderOverview
88], 431462);
89;
90;
91;
92function useStorageOrderCheckout() {
93    let options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, hookOptions = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
94    const axiosInstance = (0, __TURBOPACK__imported__module__197643__["useApi"])();
95    const queryClient = (0, __TURBOPACK__imported__module__912598__["useQueryClient"])();
96    if (hookOptions.invalidateQueries) {
97        const originalOnSuccess = options.onSuccess;
98        options.onSuccess = async function(data, variables) {
99            for(var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++){
100                args[_key - 2] = arguments[_key];
101            }
102            queryClient.invalidateQueries({
103                queryKey: [
104                    "storageOrder"
105                ]
106            });
107            if (typeof originalOnSuccess === "function") {
108                return await originalOnSuccess(data, variables, ...args);
109            }
110        };
111    }
112    return (0, __TURBOPACK__imported__module__954616__["useMutation"])({
113        mutationFn: (variables)=>apiStorageOrderCheckout(axiosInstance, {
114                locale: variables["locale"],
115                password: variables["password"],
116                iban: variables["iban"],
117                allowDirectDebit: variables["allowDirectDebit"],
118                paymentMethod: variables["paymentMethod"],
119                paymentMethodId: variables["paymentMethodId"],
120                cardToken: variables["cardToken"],
121                applePayPaymentToken: variables["applePayPaymentToken"]
122            }, variables === null || variables === void 0 ? void 0 : variables.requestConfig),
123        ...options
124    });
125}
126function useStorageOrderConfigure() {
127    let options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, hookOptions = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
128    const axiosInstance = (0, __TURBOPACK__imported__module__197643__["useApi"])();
129    const queryClient = (0, __TURBOPACK__imported__module__912598__["useQueryClient"])();
130    if (hookOptions.invalidateQueries) {
131        const originalOnSuccess = options.onSuccess;
132        options.onSuccess = async function(data, variables) {
133            for(var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++){
134                args[_key - 2] = arguments[_key];
135            }
136            queryClient.invalidateQueries({
137                queryKey: [
138                    "storageOrder"
139                ]
140            });
141            if (typeof originalOnSuccess === "function") {
142                return await originalOnSuccess(data, variables, ...args);
143            }
144        };
145    }
146    return (0, __TURBOPACK__imported__module__954616__["useMutation"])({
147        mutationFn: (variables)=>apiStorageOrderConfigure(axiosInstance, {
148                locale: variables["locale"]
149            }, {
150                storageLocationId: variables["storageLocationId"],
151                categoryId: variables["categoryId"],
152                unitTypeId: variables["unitTypeId"],
153                startDate: variables["startDate"],
154                addons: variables["addons"],
155                expectedRentalPeriod: variables["expectedRentalPeriod"],
156                details: variables["details"],
157                dimensionType: variables["dimensionType"]
158            }, variables === null || variables === void 0 ? void 0 : variables.requestConfig),
159        ...options
160    });
161}
162function useStorageOrderCreateQuotation() {
163    let options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
164    const axiosInstance = (0, __TURBOPACK__imported__module__197643__["useApi"])();
165    const queryClient = (0, __TURBOPACK__imported__module__912598__["useQueryClient"])();
166    return (0, __TURBOPACK__imported__module__954616__["useMutation"])({
167        mutationFn: (variables)=>apiStorageOrderCreateQuotation(axiosInstance, {
168                locale: variables["locale"],
169                storageLocationId: variables["storageLocationId"],
170                categoryId: variables["categoryId"],
171                unitTypeId: variables["unitTypeId"],
172                startDate: variables["startDate"],
173                expectedRentalPeriod: variables["expectedRentalPeriod"],
174                firstName: variables["firstName"],
175                lastName: variables["lastName"],
176                email: variables["email"],
177                phone: variables["phone"],
178                remarks: variables["remarks"],
179                street: variables["street"],
180                houseNumber: variables["houseNumber"],
181                houseNumberAddition: variables["houseNumberAddition"],
182                postalCode: variables["postalCode"],
183                city: variables["city"],
184                countryCode: variables["countryCode"]
185            }, variables === null || variables === void 0 ? void 0 : variables.requestConfig),
186        ...options
187    });
188}
189function useStorageOrderDiscountApply() {
190    let options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, hookOptions = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
191    const axiosInstance = (0, __TURBOPACK__imported__module__197643__["useApi"])();
192    const queryClient = (0, __TURBOPACK__imported__module__912598__["useQueryClient"])();
193    if (hookOptions.invalidateQueries) {
194        const originalOnSuccess = options.onSuccess;
195        options.onSuccess = async function(data, variables) {
196            for(var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++){
197                args[_key - 2] = arguments[_key];
198            }
199            queryClient.invalidateQueries({
200                queryKey: [
201                    "storageOrder"
202                ]
203            });
204            if (typeof originalOnSuccess === "function") {
205                return await originalOnSuccess(data, variables, ...args);
206            }
207        };
208    }
209    return (0, __TURBOPACK__imported__module__954616__["useMutation"])({
210        mutationFn: (variables)=>apiStorageOrderDiscountApply(axiosInstance, {
211                discountCode: variables["discountCode"]
212            }, variables === null || variables === void 0 ? void 0 : variables.requestConfig),
213        ...options
214    });
215}
216function useStorageOrderDiscountRemove() {
217    let options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, hookOptions = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
218    const axiosInstance = (0, __TURBOPACK__imported__module__197643__["useApi"])();
219    const queryClient = (0, __TURBOPACK__imported__module__912598__["useQueryClient"])();
220    if (hookOptions.invalidateQueries) {
221        const originalOnSuccess = options.onSuccess;
222        options.onSuccess = async function(data, variables) {
223            for(var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++){
224                args[_key - 2] = arguments[_key];
225            }
226            queryClient.invalidateQueries({
227                queryKey: [
228                    "storageOrder"
229                ]
230            });
231            if (typeof originalOnSuccess === "function") {
232                return await originalOnSuccess(data, variables, ...args);
233            }
234        };
235    }
236    return (0, __TURBOPACK__imported__module__954616__["useMutation"])({
237        mutationFn: (variables)=>apiStorageOrderDiscountRemove(axiosInstance, variables === null || variables === void 0 ? void 0 : variables.requestConfig),
238        ...options
239    });
240}
241function useStorageOrderOverview(opts) {
242    var _ref;
243    const axiosInstance = (0, __TURBOPACK__imported__module__197643__["useApi"])();
244    const options = (_ref = opts === null || opts === void 0 ? void 0 : opts.queryOptions) !== null && _ref !== void 0 ? _ref : {};
245    return (0, __TURBOPACK__imported__module__266027__["useQuery"])({
246        queryKey: useStorageOrderOverview.queryKey(opts),
247        queryFn: (param)=>{
248            let { signal } = param;
249            var _opts, _requestConfig;
250            (_requestConfig = (_opts = opts).requestConfig) !== null && _requestConfig !== void 0 ? _requestConfig : _opts.requestConfig = {};
251            opts.requestConfig.signal = signal;
252            return apiStorageOrderOverview(axiosInstance, {
253                locale: opts["locale"]
254            }, opts === null || opts === void 0 ? void 0 : opts.requestConfig);
255        },
256        ...options
257    });
258}
259/**
260 * Base key used by useStorageOrderOverview.queryKey()
261 */ useStorageOrderOverview.baseKey = ()=>[
262        "storageOrder",
263        "overview"
264    ];
265/**
266 * Query key used by useStorageOrderOverview
267 */ useStorageOrderOverview.queryKey = (opts)=>{
268    var _opts_locale;
269    return [
270        ...useStorageOrderOverview.baseKey(),
271        {
272            locale: (_opts_locale = opts["locale"]) !== null && _opts_locale !== void 0 ? _opts_locale : null
273        }
274    ];
275};
276/**
277 * Fetch useStorageOrderOverview via the queryClient and return the result
278 */ useStorageOrderOverview.fetch = (queryClient, axiosInstance, opts)=>{
279    return queryClient.fetchQuery({
280        queryKey: useStorageOrderOverview.queryKey(opts),
281        queryFn: ()=>{
282            return apiStorageOrderOverview(axiosInstance, {
283                locale: opts["locale"]
284            }, opts === null || opts === void 0 ? void 0 : opts.requestConfig);
285        }
286    });
287};
288/**
289 * Prefetch useStorageOrderOverview via the queryClient
290 */ useStorageOrderOverview.prefetch = (queryClient, axiosInstance, opts)=>{
291    return queryClient.prefetchQuery({
292        queryKey: useStorageOrderOverview.queryKey(opts),
293        queryFn: ()=>{
294            return apiStorageOrderOverview(axiosInstance, {
295                locale: opts["locale"]
296            }, opts === null || opts === void 0 ? void 0 : opts.requestConfig);
297        }
298    });
299};
300/**
301 * Invalidate useStorageOrderOverview via the queryClient
302 */ useStorageOrderOverview.invalidate = (queryClient, opts)=>queryClient.invalidateQueries({
303        queryKey: useStorageOrderOverview.queryKey(opts)
304    });
305/**
306 * Set query data for useStorageOrderOverview via the queryClient
307 */ useStorageOrderOverview.setQueryData = (queryClient, opts, data)=>{
308    return queryClient.setQueryData(useStorageOrderOverview.queryKey(opts), data);
309};
310__turbopack_context__.s([
311    "useStorageOrderConfigure",
312    0,
313    useStorageOrderConfigure,
314    "useStorageOrderCreateQuotation",
315    0,
316    useStorageOrderCreateQuotation,
317    "useStorageOrderDiscountApply",
318    0,
319    useStorageOrderDiscountApply,
320    "useStorageOrderDiscountRemove",
321    0,
322    useStorageOrderDiscountRemove,
323    "useStorageOrderOverview",
324    0,
325    useStorageOrderOverview
326], 415458);
327}),
32830335, ((__turbopack_context__) => {
329"use strict";
330
331var __TURBOPACK__imported__module__271645__ = __turbopack_context__.i(271645);
332var __TURBOPACK__imported__module__595727__ = __turbopack_context__.i(595727);
333var __TURBOPACK__imported__module__585890__ = __turbopack_context__.i(585890);
334var __TURBOPACK__imported__module__957668__ = __turbopack_context__.i(957668);
335var __TURBOPACK__imported__module__415458__ = __turbopack_context__.i(415458);
336var __TURBOPACK__imported__module__501804__ = __turbopack_context__.i(501804);
337var __TURBOPACK__imported__module__773447__ = __turbopack_context__.i(773447);
338var __TURBOPACK__imported__module__614537__ = __turbopack_context__.i(614537);
339;
340;
341;
342;
343;
344;
345;
346function useRedirectIfConfigureIncomplete() {
347    const router = (0, __TURBOPACK__imported__module__614537__["useRouter"])();
348    const locale = (0, __TURBOPACK__imported__module__501804__["default"])();
349    const { data: overview, isPending, isFetching } = (0, __TURBOPACK__imported__module__415458__["useStorageOrderOverview"])({
350        locale,
351        queryOptions: {
352            staleTime: 10 * 1000
353        }
354    });
355    (0, __TURBOPACK__imported__module__271645__["useEffect"])(()=>{
356        var _overview_configuration, _overview_configuration1;
357        if (isFetching || isPending || !overview) {
358            return;
359        }
360        if (((_overview_configuration = overview.configuration) === null || _overview_configuration === void 0 ? void 0 : _overview_configuration.startDate) === undefined || ((_overview_configuration1 = overview.configuration) === null || _overview_configuration1 === void 0 ? void 0 : _overview_configuration1.unitTypeId) === undefined) {
361            router.replace("/opslag-huren/samenstellen");
362        }
363    }, [
364        isFetching,
365        isPending,
366        overview,
367        router
368    ]);
369}
370function useStorageStartDateLimit() {
371    const now = (0, __TURBOPACK__imported__module__773447__["useNow"])();
372    return (0, __TURBOPACK__imported__module__271645__["useMemo"])(()=>{
373        return (0, __TURBOPACK__imported__module__595727__["addDays"])((0, __TURBOPACK__imported__module__585890__["startOfDay"])(now), __TURBOPACK__imported__module__957668__["FUTURE_START_DAY_LIMIT_60_DAYS"]);
374    }, [
375        now
376    ]);
377}
378__turbopack_context__.s([
379    "useRedirectIfConfigureIncomplete",
380    0,
381    useRedirectIfConfigureIncomplete,
382    "useStorageStartDateLimit",
383    0,
384    useStorageStartDateLimit
385]);
386}),
387285186, ((__turbopack_context__) => {
388"use strict";
389
390var __TURBOPACK__imported__module__843476__ = __turbopack_context__.i(843476);
391var __TURBOPACK__imported__module__271645__ = __turbopack_context__.i(271645);
392"use client";
393;
394;
395const StorageGoogleRatingContext = /*#__PURE__*/ (0, __TURBOPACK__imported__module__271645__["createContext"])(undefined);
396function StorageGoogleRatingProvider(param) {
397    let { children, rating } = param;
398    return /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsx"])(StorageGoogleRatingContext.Provider, {
399        value: rating,
400        children: children
401    });
402}
403function useStorageGoogleRating() {
404    return (0, __TURBOPACK__imported__module__271645__["useContext"])(StorageGoogleRatingContext);
405}
406__turbopack_context__.s([
407    "StorageGoogleRatingProvider",
408    0,
409    StorageGoogleRatingProvider,
410    "useStorageGoogleRating",
411    0,
412    useStorageGoogleRating
413]);
414}),
41510204, ((__turbopack_context__) => {
416"use strict";
417
418var __TURBOPACK__imported__module__843476__ = __turbopack_context__.i(843476);
419var __TURBOPACK__imported__module__271645__ = __turbopack_context__.i(271645);
420"use client";
421;
422;
423const StorageCategoryCmsContext = /*#__PURE__*/ (0, __TURBOPACK__imported__module__271645__["createContext"])(undefined);
424function StorageCategoryCmsProvider(param) {
425    let { categories, children } = param;
426    return /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsx"])(StorageCategoryCmsContext.Provider, {
427        value: categories,
428        children: children
429    });
430}
431function useStorageCategoryCms() {
432    return (0, __TURBOPACK__imported__module__271645__["useContext"])(StorageCategoryCmsContext);
433}
434__turbopack_context__.s([
435    "StorageCategoryCmsProvider",
436    0,
437    StorageCategoryCmsProvider,
438    "useStorageCategoryCms",
439    0,
440    useStorageCategoryCms
441]);
442}),
443234914, ((__turbopack_context__) => {
444"use strict";
445
446// MERGED MODULE: [project]/src/components/widgets/NewStorageWidget/NewStorageWidget.tsx [app-client] (ecmascript)
447;
448var __TURBOPACK__imported__module__843476__ = __turbopack_context__.i(843476);
449var __TURBOPACK__imported__module__271645__ = __turbopack_context__.i(271645);
450var __TURBOPACK__imported__module__929387__ = __turbopack_context__.i(929387);
451var __TURBOPACK__imported__module__109881__ = __turbopack_context__.i(109881);
452var __TURBOPACK__imported__module__988052__ = __turbopack_context__.i(988052);
453var __TURBOPACK__imported__module__867228__ = __turbopack_context__.i(867228);
454var __TURBOPACK__imported__module__912598__ = __turbopack_context__.i(912598);
455var __TURBOPACK__imported__module__595727__ = __turbopack_context__.i(595727);
456var __TURBOPACK__imported__module__309000__ = __turbopack_context__.i(309000);
457var __TURBOPACK__imported__module__653145__ = __turbopack_context__.i(653145);
458var __TURBOPACK__imported__module__846696__ = __turbopack_context__.i(846696);
459var __TURBOPACK__imported__module__685149__ = __turbopack_context__.i(685149);
460var __TURBOPACK__imported__module__501804__ = __turbopack_context__.i(501804);
461var __TURBOPACK__imported__module__30335__ = __turbopack_context__.i(30335);
462var __TURBOPACK__imported__module__541378__ = __turbopack_context__.i(541378);
463var __TURBOPACK__imported__module__710007__ = __turbopack_context__.i(710007);
464var __TURBOPACK__imported__module__991548__ = __turbopack_context__.i(991548);
465var __TURBOPACK__imported__module__735436__ = __turbopack_context__.i(735436);
466var __TURBOPACK__imported__module__107282__ = __turbopack_context__.i(107282);
467var __TURBOPACK__imported__module__697329__ = __turbopack_context__.i(697329);
468var __TURBOPACK__imported__module__197643__ = __turbopack_context__.i(197643);
469var __TURBOPACK__imported__module__330079__ = __turbopack_context__.i(330079);
470var __TURBOPACK__imported__module__688886__ = __turbopack_context__.i(688886);
471var __TURBOPACK__imported__module__415458__ = __turbopack_context__.i(415458);
472var __TURBOPACK__imported__module__773447__ = __turbopack_context__.i(773447);
473var __TURBOPACK__imported__module__948148__ = __turbopack_context__.i(948148);
474var __TURBOPACK__imported__module__966601__ = __turbopack_context__.i(966601);
475var __TURBOPACK__imported__module__945060__ = __turbopack_context__.i(945060);
476var __TURBOPACK__imported__module__957668__ = __turbopack_context__.i(957668);
477// MERGED MODULE: [project]/src/components/widgets/NewStorageWidget/_components/NewStorageWidgetDatePicker.tsx [app-client] (ecmascript)
478;
479var __TURBOPACK__imported__module__843476__1 = __TURBOPACK__imported__module__843476__;
480var __TURBOPACK__imported__module__271645__1 = __TURBOPACK__imported__module__271645__;
481var __TURBOPACK__imported__module__929387__1 = __TURBOPACK__imported__module__929387__;
482var __TURBOPACK__imported__module__109881__1 = __TURBOPACK__imported__module__109881__;
483var __TURBOPACK__imported__module__867228__1 = __TURBOPACK__imported__module__867228__;
484var __TURBOPACK__imported__module__952027__ = __turbopack_context__.i(952027);
485var __TURBOPACK__imported__module__585890__ = __turbopack_context__.i(585890);
486var __TURBOPACK__imported__module__503636__ = __turbopack_context__.i(503636);
487var __TURBOPACK__imported__module__127923__ = __turbopack_context__.i(127923);
488var __TURBOPACK__imported__module__774084__ = __turbopack_context__.i(774084);
489var __TURBOPACK__imported__module__697791__ = __turbopack_context__.i(697791);
490var __TURBOPACK__imported__module__949907__ = __turbopack_context__.i(949907);
491var __TURBOPACK__imported__module__47897__ = __turbopack_context__.i(47897);
492var __TURBOPACK__imported__module__685149__1 = __TURBOPACK__imported__module__685149__;
493var __TURBOPACK__imported__module__480630__ = __turbopack_context__.i(480630);
494var __TURBOPACK__imported__module__47660__ = __turbopack_context__.i(47660);
495var __TURBOPACK__imported__module__812440__ = __turbopack_context__.i(812440);
496var __TURBOPACK__imported__module__773447__1 = __TURBOPACK__imported__module__773447__;
497var __TURBOPACK__imported__module__948148__1 = __TURBOPACK__imported__module__948148__;
498var __TURBOPACK__imported__module__861745__ = __turbopack_context__.i(861745);
499var __TURBOPACK__imported__module__945060__1 = __TURBOPACK__imported__module__945060__;
500var __TURBOPACK__imported__module__307741__ = __turbopack_context__.i(307741);
501"use client";
502;
503;
504;
505;
506;
507;
508;
509;
510;
511;
512;
513;
514;
515;
516;
517;
518;
519function NewStorageWidgetDatePicker(param) {
520    let { className, onChange, onOpen, rentalPeriodOptions, value, error, ref, open, onOpenChange, disabled, startMonth, endMonth, onSelect, ...props } = param;
521    var _ref;
522    const isDesktop = (0, __TURBOPACK__imported__module__867228__1["useMediaQuery"])(__TURBOPACK__imported__module__685149__1["MEDIA_QUERY_DESKTOP"]);
523    const [timePickerOpen, setTimePickerOpen] = (0, __TURBOPACK__imported__module__271645__1["useState"])(false);
524    const now = (0, __TURBOPACK__imported__module__773447__1["useNow"])();
525    const formatter = (0, __TURBOPACK__imported__module__948148__1["useFormatter"])();
526    const portal = (0, __TURBOPACK__imported__module__307741__["usePortal"])();
527    const t = (0, __TURBOPACK__imported__module__948148__1["useTranslations"])("NewStorageWidget.date_picker");
528    const locale = (0, __TURBOPACK__imported__module__861745__["useLocale"])();
529    // Route all "should this picker open?" decisions through `onOpen`, which may return `false`
530    // to cancel (e.g., when the mobile widget is collapsed and wants to expand instead).
531    const setDatePickerOpenAllowed = (nextOpen)=>{
532        var _onOpen;
533        if (!nextOpen) {
534            onOpenChange(false);
535            return;
536        }
537        onOpenChange((_onOpen = onOpen()) !== null && _onOpen !== void 0 ? _onOpen : true);
538    };
539    return /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__1["jsxs"])(__TURBOPACK__imported__module__127923__["Popover"].Root, {
540        open: open,
541        onOpenChange: setDatePickerOpenAllowed,
542        children: [
543            /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__1["jsx"])(__TURBOPACK__imported__module__127923__["Popover"].Anchor, {
544                asChild: true,
545                children: /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__1["jsx"])("div", {
546                    tabIndex: 0,
547                    onClick: (event)=>{
548                        // Child buttons (Popover.Trigger, period select) manage their own open state.
549                        if (event.target instanceof Element && event.target.closest("button")) {
550                            return;
551                        }
552                        setDatePickerOpenAllowed(true);
553                    },
554                    className: (0, __TURBOPACK__imported__module__945060__1["cn"])("focus:outline-none ring-blue-500 h-full w-full focus-within:ring-[0.125rem] ring-inset px-[1.5rem] xl:px-[0.75rem] 2xl:px-[1.5rem] py-[0.59375rem] xl:rounded-tr rounded-br rounded-bl xl:rounded-bl-none xl:rounded-br", {
555                        "ring-[0.125rem]": open
556                    }, className),
557                    ...props,
558                    children: /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__1["jsxs"])("div", {
559                        className: "flex items-center justify-between h-[45px]",
560                        children: [
561                            /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__1["jsxs"])("div", {
562                                className: "min-w-0 flex-1 overflow-x-auto",
563                                children: [
564                                    /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__1["jsx"])("div", {
565                                        className: (0, __TURBOPACK__imported__module__945060__1["cn"])("font-normal text-14  select-none", {
566                                            "text-dark-400": !error,
567                                            "text-red-700": !!error
568                                        }),
569                                        "aria-hidden": "true",
570                                        children: t("label")
571                                    }),
572                                    /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__1["jsxs"])("div", {
573                                        className: "mt-[2px] flex min-w-max items-center gap-x-[0.5rem] whitespace-nowrap pb-1",
574                                        children: [
575                                            /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__1["jsx"])("div", {
576                                                className: "relative shrink-0",
577                                                children: /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__1["jsx"])("span", {
578                                                    className: "h-[16px] w-[16px] flex items-center justify-center",
579                                                    children: !error ? /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__1["jsx"])(CalendarIcon, {
580                                                        className: (0, __TURBOPACK__imported__module__945060__1["cn"])("w-full", {
581                                                            "text-dark-300": !value,
582                                                            "text-brand-600": !!value
583                                                        })
584                                                    }) : /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__1["jsxs"])("svg", {
585                                                        className: "w-full text-red-500",
586                                                        xmlns: "http://www.w3.org/2000/svg",
587                                                        width: "24",
588                                                        height: "24",
589                                                        viewBox: "0 0 24 24",
590                                                        fill: "none",
591                                                        stroke: "currentColor",
592                                                        strokeWidth: "2",
593                                                        strokeLinecap: "round",
594                                                        strokeLinejoin: "round",
595                                                        children: [
596                                                            /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__1["jsx"])("circle", {
597                                                                cx: "12",
598                                                                cy: "12",
599                                                                r: "10"
600                                                            }),
601                                                            /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__1["jsx"])("line", {
602                                                                x1: "12",
603                                                                x2: "12",
604                                                                y1: "8",
605                                                                y2: "12"
606                                                            }),
607                                                            /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__1["jsx"])("line", {
608                                                                x1: "12",
609                                                                x2: "12.01",
610                                                                y1: "16",
611                                                                y2: "16"
612                                                            })
613                                                        ]
614                                                    })
615                                                })
616                                            }),
617                                            /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__1["jsx"])("div", {
618                                                className: "flex items-center gap-x-[0.125rem]",
619                                                children: /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__1["jsx"])(__TURBOPACK__imported__module__127923__["Popover"].Trigger, {
620                                                    asChild: true,
621                                                    ref: ref,
622                                                    children: /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__1["jsx"])(NewRentalWidgetDatePickerSegment, {
623                                                        active: open,
624                                                        "aria-label": !!(value === null || value === void 0 ? void 0 : value.startDate) ? "".concat(formatter.dateTime(value.startDate, {
625                                                            day: "numeric",
626                                                            month: "long",
627                                                            year: "numeric"
628                                                        }), ", ").concat(t("date.label")) : t("date.label"),
629                                                        children: !!(value === null || value === void 0 ? void 0 : value.startDate) ? formatter.dateTime(value.startDate, {
630                                                            day: "numeric",
631                                                            month: "short"
632                                                        }) : t("date.placeholder")
633                                                    })
634                                                })
635                                            }),
636                                            /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__1["jsx"])("div", {
637                                                className: "h-[1px] w-[6px] bg-brand-200"
638                                            }),
639                                            /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__1["jsx"])(RentalPeriodSegment, {
640                                                open: timePickerOpen,
641                                                value: value.rentalPeriod,
642                                                options: rentalPeriodOptions,
643                                                onOpenChange: (nextOpen)=>{
644                                                    var _onOpen;
645                                                    if (!nextOpen) {
646                                                        setTimePickerOpen(false);
647                                                        return;
648                                                    }
649                                                    setTimePickerOpen((_onOpen = onOpen()) !== null && _onOpen !== void 0 ? _onOpen : true);
650                                                },
651                                                onChange: (newRentalPeriod)=>{
652                                                    const nextValue = {
653                                                        ...value,
654                                                        rentalPeriod: newRentalPeriod
655                                                    };
656                                                    onChange(nextV
656alue);
657                                                },
658                                                onSelect: (newRentalPeriod)=>{
659                                                    const nextValue = {
660                                                        ...value,
661                                                        rentalPeriod: newRentalPeriod
662                                                    };
663                                                    if (nextValue.startDate) {
664                                                        onSelect === null || onSelect === void 0 ? void 0 : onSelect(nextValue);
665                                                    }
666                                                },
667                                                label: t("expected_rental_period.label")
668                                            })
669                                        ]
670                                    })
671                                ]
672                            }),
673                            /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__1["jsx"])(__TURBOPACK__imported__module__503636__["ChevronDownIcon"], {
674                                className: (0, __TURBOPACK__imported__module__945060__1["cn"])("w-[22px] text-dark-500 transition-transform duration-200 shrink-0", {
675                                    "scale-y-[-1]": open || timePickerOpen
676                                })
677                            })
678                        ]
679                    })
680                })
681            }),
682            /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__1["jsx"])(__TURBOPACK__imported__module__127923__["Popover"].Portal, {
683                container: portal,
684                children: /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__1["jsx"])(__TURBOPACK__imported__module__127923__["Popover"].Content, {
685                    className: "rounded bg-white border border-brand-100 px-3 pb-2 pt-1 shadow-lg flex items-center justify-center",
686                    sideOffset: 5,
687                    avoidCollisions: false,
688                    collisionPadding: __TURBOPACK__imported__module__812440__["PICKER_COLLISION_PADDING"],
689                    side: "bottom",
690                    align: "end",
691                    children: /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__1["jsx"])(__TURBOPACK__imported__module__697791__["DayPicker"], {
692                        locale: locale === "nl" ? __TURBOPACK__imported__module__949907__["nl"] : __TURBOPACK__imported__module__47897__["enGB"],
693                        classNames: {
694                            day: "font-inter",
695                            weekday: "font-inter font-normal text-sm text-dark-300",
696                            disabled: "line-through text-dark-300",
697                            caption_label: "text-brand-500 font-semibold flex items-center justify-center"
698                        },
699                        mode: "single",
700                        defaultMonth: (_ref = value === null || value === void 0 ? void 0 : value.startDate) !== null && _ref !== void 0 ? _ref : now,
701                        selected: value === null || value === void 0 ? void 0 : value.startDate,
702                        numberOfMonths: isDesktop ? 2 : 1,
703                        onSelect: (newDateValue)=>{
704                            if (!newDateValue) {
705                                onChange({
706                                    rentalPeriod: value.rentalPeriod,
707                                    startDate: undefined
708                                });
709                                onOpenChange(false);
710                                return;
711                            }
712                            // Add 8 hours from start of day to prevent timezone issues
713                            const startDate = (0, __TURBOPACK__imported__module__952027__["addHours"])((0, __TURBOPACK__imported__module__585890__["startOfDay"])(newDateValue, {
714                                in: (0, __TURBOPACK__imported__module__109881__1["tz"])(__TURBOPACK__imported__module__685149__1["TIMEZONE"])
715                            }), 8, {
716                                in: (0, __TURBOPACK__imported__module__109881__1["tz"])(__TURBOPACK__imported__module__685149__1["TIMEZONE"])
717                            });
718                            const nextValue = {
719                                ...value,
720                                startDate
721                            };
722                            onChange(nextValue);
723                            onOpenChange(false);
724                            onSelect === null || onSelect === void 0 ? void 0 : onSelect(nextValue);
725                        },
726                        disabled: disabled,
727                        startMonth: startMonth,
728                        endMonth: endMonth
729                    })
730                })
731            })
732        ]
733    });
734}
735function RentalPeriodSegment(param) {
736    let { open, label, value, onChange, onOpenChange, onSelect, options } = param;
737    const portal = (0, __TURBOPACK__imported__module__307741__["usePortal"])();
738    const t = (0, __TURBOPACK__imported__module__948148__1["useTranslations"])("NewStorageWidget.date_picker");
739    const { onItemPointerDown, onItemPointerUp } = (0, __TURBOPACK__imported__module__47660__["useSelectItemSelect"])(open, onSelect);
740    const handleKeyDown = (value)=>(event)=>{
741            if (event.key !== "Enter" && event.key !== " ") {
742                return;
743            }
744            onSelect === null || onSelect === void 0 ? void 0 : onSelect(value);
745        };
746    const handleCloseAutoFocus = (event)=>{
747        if (!onSelect) {
748            return;
749        }
750        event.preventDefault();
751    };
752    return /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__1["jsxs"])(__TURBOPACK__imported__module__480630__["SelectRoot"], {
753        value: value,
754        onValueChange: onChange,
755        open: open,
756        onOpenChange: onOpenChange,
757        children: [
758            /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__1["jsx"])(__TURBOPACK__imported__module__774084__["Select"].Trigger, {
759                asChild: true,
760                children: /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__1["jsx"])(NewRentalWidgetDatePickerSegment, {
761                    className: "data-[state=open]:bg-blue-100 data-[state=open]:text-dark-500",
762                    "aria-label": label,
763                    children: /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__1["jsx"])(__TURBOPACK__imported__module__774084__["Select"].Value, {
764                        placeholder: t("expected_rental_period.placeholder"),
765                        children: options[value]
766                    })
767                })
768            }),
769            /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__1["jsx"])(__TURBOPACK__imported__module__480630__["SelectContent"], {
770                className: "w-[270px]",
771                position: "popper",
772                sideOffset: 15,
773                align: "center",
774                portal: portal,
775                onCloseAutoFocus: handleCloseAutoFocus,
776                children: Object.entries(options).map((param)=>{
777                    let [value, label] = param;
778                    return /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__1["jsx"])(__TURBOPACK__imported__module__480630__["SelectItem"], {
779                        value: value,
780                        onPointerDown: onItemPointerDown,
781                        onPointerUp: ()=>onItemPointerUp(value),
782                        onKeyDown: handleKeyDown(value),
783                        className: "relative h-[46px] w-full text-16 font-inter text-dark-500 font-medium flex items-center justify-center",
784                        children: /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__1["jsx"])(__TURBOPACK__imported__module__774084__["Select"].ItemText, {
785                            children: label
786                        })
787                    }, value);
788                })
789            })
790        ]
791    });
792}
793function NewRentalWidgetDatePickerSegment(param) {
794    let { active = false, className, ...props } = param;
795    return /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__1["jsx"])("button", {
796        suppressHydrationWarning: true,
797        type: "button",
798        className: (0, __TURBOPACK__imported__module__945060__1["cn"])("select-none rounded h-[1.375rem] whitespace-nowrap px-[0.375rem] text-14 inline-flex items-center justify-center font-inter focus:bg-blue-100 focus:text-dark-500", {
799            "bg-blue-100 text-dark-500": active,
800            "bg-gray-50 text-dark-400 hover:bg-gray-100": !active
801        }, className),
802        ...props
803    });
804}
805function CalendarIcon(props) {
806    return /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__1["jsx"])("svg", {
807        width: "16",
808        height: "17",
809        viewBox: "0 0 16 17",
810        fill: "none",
811        xmlns: "http://www.w3.org/2000/svg",
812        ...props,
813        children: /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__1["jsx"])("path", {
814            fillRule: "evenodd",
815            clipRule: "evenodd",
816            d: "M4.04545 2.13636C4.04545 1.78491 4.33036 1.5 4.68182 1.5C5.03327 1.5 5.31818 1.78491 5.31818 2.13636V2.77273H10.4091V2.13636C10.4091 1.78491 10.694 1.5 11.0455 1.5C11.3969 1.5 11.6818 1.78491 11.6818 2.13636V2.77273H12.9545C13.6575 2.77273 14.2273 3.34255 14.2273 4.04545V14.2273C14.2273 14.9302 13.6575 15.5 12.9545 15.5H2.77273C2.06982 15.5 1.5 14.9302 1.5 14.2273V4.04545C1.5 3.34255 2.06982 2.77273 2.77273 2.77273H4.04545V2.13636ZM12.9545 5.95455H2.77273V7.22727H12.9545V5.95455Z",
817            fill: "currentColor"
818        })
819    });
820}
821// MERGED MODULE: [project]/src/components/widgets/NewStorageWidget/_components/StorageCategoryPickerField.tsx [app-client] (ecmascript)
822;
823var __TURBOPACK__imported__module__843476__2 = __TURBOPACK__imported__module__843476__;
824var __TURBOPACK__imported__module__271645__2 = __TURBOPACK__imported__module__271645__;
825var __TURBOPACK__imported__module__653145__1 = __TURBOPACK__imported__module__653145__;
826var __TURBOPACK__imported__module__362753__ = __turbopack_context__.i(362753);
827var __TURBOPACK__imported__module__10204__ = __turbopack_context__.i(10204);
828var __TURBOPACK__imported__module__480630__1 = __TURBOPACK__imported__module__480630__;
829var __TURBOPACK__imported__module__47660__1 = __TURBOPACK__imported__module__47660__;
830var __TURBOPACK__imported__module__688886__1 = __TURBOPACK__imported__module__688886__;
831var __TURBOPACK__imported__module__501804__1 = __TURBOPACK__imported__module__501804__;
832var __TURBOPACK__imported__module__773447__2 = __TURBOPACK__imported__module__773447__;
833var __TURBOPACK__imported__module__948148__2 = __TURBOPACK__imported__module__948148__;
834var __TURBOPACK__imported__module__957668__1 = __TURBOPACK__imported__module__957668__;
835// MERGED MODULE: [project]/src/components/widgets/NewStorageWidget/_components/CategoryPicker.tsx [app-client] (ecmascript)
836;
837var __TURBOPACK__imported__module__843476__3 = __TURBOPACK__imported__module__843476__;
838var __TURBOPACK__imported__module__774084__1 = __TURBOPACK__imported__module__774084__;
839var __TURBOPACK__imported__module__480630__2 = __TURBOPACK__imported__module__480630__;
840var __TURBOPACK__imported__module__773447__3 = __TURBOPACK__imported__module__773447__;
841var __TURBOPACK__imported__module__948148__3 = __TURBOPACK__imported__module__948148__;
842var __TURBOPACK__imported__module__945060__2 = __TURBOPACK__imported__module__945060__;
843;
844;
845;
846;
847;
848function CategoryPicker(param) {
849    let { value, onChange, error, open, onOpenChange, ref, items, selectedLabel } = param;
850    const t = (0, __TURBOPACK__imported__module__948148__3["useTranslations"])("NewStorageWidget.category");
851    return /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__3["jsxs"])(__TURBOPACK__imported__module__480630__2["SelectRoot"], {
852        value: value,
853        onValueChange: onChange,
854        open: open,
855        onOpenChange: onOpenChange,
856        children: [
857            /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__3["jsx"])(__TURBOPACK__imported__module__480630__2["SelectTrigger"], {
858                ref: ref,
859                error: error,
860                className: "lg:rounded-l",
861                "aria-label": t("label"),
862                children: /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__3["jsx"])(__TURBOPACK__imported__module__480630__2["SelectFieldset"], {
863                    label: t("label"),
864                    error: error,
865                    isOpen: open,
866                    children: /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__3["jsx"])("span", {
867                        className: (0, __TURBOPACK__imported__module__945060__2["cn"])("text-14 flex gap-1 items-center font-inter", {
868                            "text-brand-600": value,
869                            "text-dark-300": !value
870                        }),
871                        children: selectedLabel || /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__3["jsx"])(__TURBOPACK__imported__module__7
87174084__1["Select"].Value, {
872                            placeholder: t("placeholder")
873                        })
874                    })
875                })
876            }),
877            items
878        ]
879    });
880}
881function CategoryItem(param) {
882    let { type, title, size, ...props } = param;
883    const isCompact = !!type && !!size;
884    return /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__3["jsx"])(__TURBOPACK__imported__module__480630__2["SelectItem"], {
885        ...props,
886        textValue: isCompact ? "".concat(type, " (").concat(size, ")") : title,
887        className: "px-3 md:min-w-[460px] min-h-[80px]",
888        children: /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__3["jsxs"])(__TURBOPACK__imported__module__774084__1["Select"].ItemText, {
889            children: [
890                /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__3["jsx"])("span", {
891                    className: "sr-only",
892                    children: isCompact ? "".concat(type, ", ").concat(title, ", ").concat(size) : title
893                }),
894                /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__3["jsxs"])("span", {
895                    className: "flex items-center gap-2",
896                    children: [
897                        type && /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__3["jsx"])("span", {
898                            "aria-hidden": "true",
899                            className: "w-[44px] h-[44px] rounded bg-blue-100 text-brand-600 font-semibold text-16 flex items-center justify-center",
900                            children: type
901                        }),
902                        /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__3["jsx"])("span", {
903                            "aria-hidden": "true",
904                            className: "flex flex-col text-left leading-tight",
905                            children: size ? /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__3["jsxs"])(__TURBOPACK__imported__module__843476__3["Fragment"], {
906                                children: [
907                                    /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__3["jsx"])("span", {
908                                        className: "text-16 text-brand-600 font-semibold",
909                                        children: size
910                                    }),
911                                    /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__3["jsx"])("span", {
912                                        className: "text-base font-normal text-dark-400",
913                                        children: title
914                                    })
915                                ]
916                            }) : /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__3["jsx"])("span", {
917                                className: "text-16 text-brand-600 font-semibold",
918                                children: title
919                            })
920                        })
921                    ]
922                })
923            ]
924        })
925    });
926}
927;
928;
929;
930;
931;
932;
933;
934;
935;
936;
937;
938;
939function StorageCategoryPickerField(param) {
940    let { control, ref, storageLocationId, open, onOpenChange, onChangeCategory, onSelectCategory } = param;
941    const t = (0, __TURBOPACK__imported__module__948148__2["useTranslations"])("NewStorageWidget");
942    const apiLocale = (0, __TURBOPACK__imported__module__501804__1["default"])();
943    const cmsStorageCategories = (0, __TURBOPACK__imported__module__10204__["useStorageCategoryCms"])();
944    const cmsCategoryById = (0, __TURBOPACK__imported__module__271645__2["useMemo"])(()=>new Map((cmsStorageCategories !== null && cmsStorageCategories !== void 0 ? cmsStorageCategories : []).map((category)=>[
945                category.categoryId,
946                category
947            ])), [
948        cmsStorageCategories
949    ]);
950    const { data: { categories } = {} } = (0, __TURBOPACK__imported__module__688886__1["useStorageCategories"])({
951        storageLocationId
952    });
953    const handleCategorySelect = (0, __TURBOPACK__imported__module__271645__2["useCallback"])((value)=>{
954        onSelectCategory === null || onSelectCategory === void 0 ? void 0 : onSelectCategory((0, __TURBOPACK__imported__module__362753__["mapSelectOptionToCategory"])(value));
955    }, [
956        onSelectCategory
957    ]);
958    const { onItemPointerDown, onItemPointerUp } = (0, __TURBOPACK__imported__module__47660__1["useSelectItemSelect"])(open, handleCategorySelect);
959    const handleCategorySelectKeyDown = (0, __TURBOPACK__imported__module__271645__2["useCallback"])((value)=>(event)=>{
960            if (event.key !== "Enter" && event.key !== " ") {
961                return;
962            }
963            handleCategorySelect(value);
964        }, [
965        handleCategorySelect
966    ]);
967    const handleCategoryCloseAutoFocus = (0, __TURBOPACK__imported__module__271645__2["useCallback"])((event)=>{
968        if (!onSelectCategory) {
969            return;
970        }
971        event.preventDefault();
972    }, [
973        onSelectCategory
974    ]);
975    return /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__2["jsx"])(__TURBOPACK__imported__module__653145__1["Controller"], {
976        control: control,
977        name: "categoryId",
978        render: (param)=>{
979            let { field: { onChange, value }, fieldState } = param;
980            const category = categories === null || categories === void 0 ? void 0 : categories.find((category)=>category.id === value);
981            const cmsCategory = value ? cmsCategoryById.get(String(value)) : undefined;
982            const categorySize = cmsCategory === null || cmsCategory === void 0 ? void 0 : cmsCategory.sizeCubic;
983            // We'll use the CMS provided title if available, otherwise the API and
984            // fallback to the default "all sizes" label.
985            const categoryTitle = category === null || category === void 0 ? void 0 : category.title[apiLocale];
986            const categoryLabel = categoryTitle ? categorySize ? "".concat(categoryTitle, " (").concat(categorySize, ")") : categoryTitle : t("category.all_sizes");
987            return /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__2["jsx"])(CategoryPicker, {
988                ref: ref,
989                value: (0, __TURBOPACK__imported__module__362753__["mapCategoryToSelectValue"])(value),
990                selectedLabel: categoryLabel,
991                error: !!fieldState.error,
992                open: open,
993                onOpenChange: onOpenChange,
994                onChange: (newValue)=>{
995                    const formattedValue = (0, __TURBOPACK__imported__module__362753__["mapSelectOptionToCategory"])(newValue);
996                    onChange(formattedValue);
997                    onChangeCategory(formattedValue);
998                },
999                items: /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__2["jsxs"])(__TURBOPACK__imported__module__480630__1["SelectContent"], {
1000                    className: "w-full md:w-[460px] md:min-w-[460px]",
1001                    align: "start",
1002                    onCloseAutoFocus: handleCategoryCloseAutoFocus,
1003                    children: [
1004                        /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__2["jsx"])(CategoryItem, {
1005                            value: __TURBOPACK__imported__module__957668__1["CATEGORY_SHOW_ALL_VALUE"],
1006                            title: t("category.all_sizes"),
1007                            onPointerDown: onItemPointerDown,
1008                            onPointerUp: ()=>onItemPointerUp(__TURBOPACK__imported__module__957668__1["CATEGORY_SHOW_ALL_VALUE"]),
1009                            onKeyDown: handleCategorySelectKeyDown(__TURBOPACK__imported__module__957668__1["CATEGORY_SHOW_ALL_VALUE"])
1010                        }),
1011                        (categories !== null && categories !== void 0 ? categories : []).map((category)=>{
1012                            var _ref, _ref1;
1013                            const categoryCms = cmsCategoryById.get(category.id);
1014                            return /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__2["jsx"])(CategoryItem, {
1015                                value: category.id,
1016                                type: category.title[apiLocale],
1017                                // In the navigation we always show the cubic size.
1018                                size: categoryCms === null || categoryCms === void 0 ? void 0 : categoryCms.sizeCubic,
1019                                title: (_ref = (_ref1 = categoryCms === null || categoryCms === void 0 ? void 0 : categoryCms.title) !== null && _ref1 !== void 0 ? _ref1 : category.title[apiLocale]) !== null && _ref !== void 0 ? _ref : "",
1020                                onPointerDown: onItemPointerDown,
1021                                onPointerUp: ()=>onItemPointerUp(category.id),
1022                                onKeyDown: handleCategorySelectKeyDown(category.id)
1023                            }, category.id);
1024                        })
1025                    ]
1026                })
1027            });
1028        }
1029    });
1030}
1031"use client";
1032;
1033;
1034;
1035;
1036;
1037;
1038;
1039;
1040;
1041;
1042;
1043;
1044;
1045;
1046;
1047;
1048;
1049;
1050;
1051;
1052;
1053;
1054;
1055;
1056;
1057;
1058;
1059function NewStorageWidget(param) {
1060    let { footer, className, onSubmit, ref, onInteract, variant = "default", defaultLocationId, isMobileCollapsed = false, onExpandMobileCollapsed } = param;
1061    var _ref, _ref1;
1062    var _overview_configuration, _overview_configuration1, _overview_configuration2, _overview_configuration3;
1063    const t = (0, __TURBOPACK__imported__module__948148__["useTranslations"])("NewStorageWidget");
1064    const queryClient = (0, __TURBOPACK__imported__module__912598__["useQueryClient"])();
1065    const api = (0, __TURBOPACK__imported__module__197643__["useApi"])();
1066    const apiLocale = (0, __TURBOPACK__imported__module__501804__["default"])();
1067    const { data: overview } = (0, __TURBOPACK__imported__module__415458__["useStorageOrderOverview"])({
1068        locale: apiLocale,
1069        queryOptions: {
1070            staleTime: 10 * 1000
1071        }
1072    });
1073    const { data: locations = [] } = (0, __TURBOPACK__imported__module__330079__["useLocationList"])({
1074        queryOptions: {
1075            select: (data)=>data.locations.filter((location)=>!!location.storageLocationId)
1076        }
1077    });
1078    const rootRef = (0, __TURBOPACK__imported__module__271645__["useRef"])(null);
1079    const locationRef = (0, __TURBOPACK__imported__module__271645__["useRef"])(null);
1080    const dateRef = (0, __TURBOPACK__imported__module__271645__["useRef"])(null);
1081    const categoryRef = (0, __TURBOPACK__imported__module__271645__["useRef"])(null);
1082    const searchButtonRef = (0, __TURBOPACK__imported__module__271645__["useRef"])(null);
1083    const rentalPeriodOptions = (0, __TURBOPACK__imported__module__271645__["useMemo"])(()=>({
1084            unknown: t("date_picker.expected_rental_period.options.unknown"),
1085            oneMonth: t("date_picker.expected_rental_period.options.oneMonth"),
1086            moreThanOneMonth: t("date_picker.expected_rental_period.options.moreThanOneMonth"),
1087            moreThanThreeMonths: t("date_picker.expected_rental_period.options.moreThanThreeMonths"),
1088            moreThanTwelveMonths: t("date_picker.expected_rental_period.options.moreThanTwelveMonths")
1089        }), [
1090        t
1091    ]);
1092    const storageLocationId = (_ref = (_ref1 = overview === null || overview === void 0 ? void 0 : (_overview_configuration = overview.configuration) === null || _overview_configuration === void 0 ? void 0 : _overview_configuration.storageLocationId) !== null && _ref1 !== void 0 ? _ref1 : defaultLocationId) !== null && _ref !== void 0 ? _ref : __TURBOPACK__imported__module__957668__["DEFAULT_STORAGE_LOCATION_ID"];
1093    const defaultValues = (0, __TURBOPACK__imported__module__271645__["useMemo"])(()=>{
1094        var _ref, _ref1;
1095        var _overview_configuration, _overview_configuration1, _overview_configuration2, _overview_configuration3;
1096        return {
1097            categoryId: (_ref = overview === null || overview === void 0 ? void 0 : (_overview_configuration = overview.configuration) === null || _overview_configuration === void 0 ? void 0 : _overview_configuration.categoryId) !== null && _ref !== void 0 ? _ref : null,
1098            locationId: storageLocationId,
1099            startDateAndRentalPeriod: {
1100                startDate: (overview === null || overview === void 0 ? void 0 : (_overview_configuration1 = overview.configuration) === null || _overview_configuration1 === void 0 ? void 0 : _overview_configuration1.startDate) ? new __TURBOPACK__imported__module__988052__["TZDate"](overview === null || overview === void 0 ? void 0 : (_overview_configuration2 = overview.configuration) === null || _overview_configuration2 === void 0 ? void 0 : _overview_configuration2.startDate, __TURBOPACK__imported__module__685149__["TIMEZONE"]) : undefined,
1101                rentalPeriod: (_ref1 = overview === null || overview === void 0 ? void 0 : (_overview_configuration3 = overview.configuration) === null || _overview_configuration3 === void 0 ? void 0 : _overview_configuration3.expectedRentalPeriod) !== null && _ref1 !== void 0 ? _ref1 : "unknown"
1102            }
1103        };
1104    }, [
1105        overview === null || overview === void 0 ? void 0 : (_overview_configuration1 = overview.configuration) === null || _overview_configuration1 === void 0 ? void 0 : _overview_configuration1.categoryId,
1106        overview === null || overview === void 0 ? void 0 : (_overview_configuration2 = overview.configuration) === null || _overview_configuration2 === void 0 ? void 0 : _overview_configuration2.startDate,
1107        overview === null || overview === void 0 ? void 0 : (_overview_configuration3 = overview.configuration) === null || _overview_configuration3 === void 0 ? void 0 : _overview_configuration3.expectedRentalPeriod,
1108        storageLocationId
1109    ]);
1110    const { handleSubmit, control, watch, getValues, reset, formState: { errors, isDirty } } = (0, __TURBOPACK__imported__module__653145__["useForm"])({
1111        mode: "onChange",
1112        defaultValues,
1113        reValidateMode: "onChange",
1114        resetOptions: {
1115            keepDirtyValues: true,
1116            keepDirty: true
1117        }
1118    });
1119    (0, __TURBOPACK__imported__module__271645__["useEffect"])(()=>{
1120        if (isDirty) {
1121            return;
1122        }
1123        reset(defaultValues);
1124    }, [
1125        defaultValues,
1126        isDirty,
1127        reset
1128    ]);
1129    // Prefetch unit types for the selected category. Doing this with `watch()` allows us to
1130    // prefetch when the chosen category came from the backend session on page load.
1131    (0, __TURBOPACK__imported__module__271645__["useEffect"])(()=>{
1132        const { unsubscribe } = watch((values)=>{
1133            if (!!values.locationId) {
1134                __TURBOPACK__imported__module__688886__["useStorageStorageLocationUnitTypes"].prefetch(queryClient, api, {
1135                    storageLocationId: values.locationId,
1136                    categoryId: values.categoryId || undefined
1137                });
1138            }
1139        });
1140        return ()=>{
1141            unsubscribe();
1142        };
1143    }, [
1144        api,
1145        queryClient,
1146        watch
1147    ]);
1148    const [datePickerOpen, setDatePickerOpen] = (0, __TURBOPACK__imported__module__271645__["useState"])(false);
1149    const [categoryPickerOpen, setCategoryPickerOpen] = (0, __TURBOPACK__imported__module__271645__["useState"])(false);
1150    const [locationPickerOpen, setLocationPickerOpen] = (0, __TURBOPACK__imported__module__271645__["useState"])(false);
1151    const isDesktop = (0, __TURBOPACK__imported__module__867228__["useMediaQuery"])(__TURBOPACK__imported__module__685149__["MEDIA_QUERY_DESKTOP"]);
1152    const { mutate } = (0, __TURBOPACK__imported__module__415458__["useStorageOrderConfigure"])({
1153        onSuccess: (data)=>{
1154            if (data.tokens) {
1155                (0, __TURBOPACK__imported__module__541378__["createSession"])(data.tokens, {
1156                    isLoggedIn: false
1157                });
1158            }
1159        },
1160        onError: ()=>{
1161            __TURBOPACK__imported__module__846696__["toast"].custom((id)=>/*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsx"])(__TURBOPACK__imported__module__991548__["default"], {
1162                    variant: "error",
1163                    onDismiss: ()=>__TURBOPACK__imported__module__846696__["toast"].dismiss(id)
1164                }));
1165        }
1166    }, {
1167        invalidateQueries: true
1168    });
1169    const _onSubmit = (data)=>{
1170        if (onSubmit) {
1171            onSubmit(data);
1172        }
1173    };
1174    const onSubmitForm = (event)=>{
1175        event.preventDefault();
1176        const values = getValues();
1177        const hasMissingRequiredInput = !values.locationId || !values.startDateAndRentalPeriod.startDate;
1178        if (hasMissingRequiredInput) {
1179            if (isMobileCollapsed) {
1180                onExpandMobileCollapsed === null || onExpandMobileCollapsed === void 0 ? void 0 : onExpandMobileCollapsed(true);
1181                return;
1182            }
1183            // On desktop we'll open the first field that is invalid.
1184            if (isDesktop) {
1185                if (!values.locationId) {
1186                    var _locationRef_current;
1187                    setLocationPickerOpen(true);
1188                    (_locationRef_current = locationRef.current) === null || _locationRef_current === void 0 ? void 0 : _locationRef_current.focus();
1189                    return;
1190                }
1191                if (!values.startDateAndRentalPeriod.startDate) {
1192                    var _dateRef_current;
1193                    setDatePickerOpen(true);
1194                    (_dateRef_current = dateRef.current) === null || _dateRef_current === void 0 ? void 0 : _dateRef_current.focus();
1195                    return;
1196                }
1197            }
1198        }
1199        void handleSubmit(_onSubmit)(event);
1200    };
1201    const onOpenChangeLocationPicker = (0, __TURBOPACK__imported__module__271645__["useCallback"])((state)=>{
1202        if (state) {
1203            onInteract === null || onInteract === void 0 ? void 0 : onInteract();
1204        }
1205        setLocationPickerOpen(state);
1206    }, [
1207        onInteract
1208    ]);
1209    const onOpenDatePicker = (0, __TURBOPACK__imported__module__271645__["useCallback"])(()=>{
1210        if (isMobileCollapsed) {
1211            onExpandMobileCollapsed === null || onExpandMobileCollapsed === void 0 ? void 0 : onExpandMobileCollapsed(true);
1212            return false;
1213        }
1214        onInteract === null || onInteract === void 0 ? void 0 : onInteract();
1215        return true;
1216    }, [
1217        isMobileCollapsed,
1218        onExpandMobileCollapsed,
1219        onInteract
1220    ]);
1221    const advancedField = (0, __TURBOPACK__imported__module__271645__["useCallback"])((from, nextValues)=>{
1222        if (!isDesktop) {
1223            return;
1224        }
1225        const values = {
1226            ...getValues(),
1227            ...nextValues
1228        };
1229        const fields = [
1230            {
1231                key: "category",
1232                filled: true,
1233                open: ()=>{
1234                    onInteract === null || onInteract === void 0 ? void 0 : onInteract();
1235                    setCategoryPickerOpen(true);
1236                }
1237            },
1238            {
1239                key: "location",
1240                filled: !!values.locationId,
1241                open: ()=>onOpenChangeLocationPicker(true)
1242            },
1243            {
1244                key: "date",
1245                filled: !!values.startDateAndRentalPeriod.startDate,
1246                open: ()=>{
1247                    if (onOpenDatePicker() === false) {
1248                        return;
1249                    }
1250                    setDatePickerOpen(true);
1251                }
1252            }
1253        ];
1254        const next = (0, __TURBOPACK__imported__module__697329__["getNextUnfilledField"])(fields, from);
1255        if (next) {
1256            requestAnimationFrame(next.open);
1257            return;
1258        }
1259        requestAnimationFrame(()=>{
1260            var _searchButtonRef_current;
1261            return (_searchButtonRef_current = searchButtonRef.current) === null || _searchButtonRef_current === void 0 ? void 0 : _searchButtonRef_current.focus();
1262        });
1263    }, [
1264        getValues,
1265        isDesktop,
1266        onInteract,
1267        onOpenChangeLocationPicker,
1268        onOpenDatePicker
1269    ]);
1270    const error = Object.values(errors)[0];
1271    const now = (0, __TURBOPACK__imported__module__773447__["useNow"])();
1272    const startDateLimit = (0, __TURBOPACK__imported__module__30335__["useStorageStartDateLimit"])();
1273    const disabled = (0, __TURBOPACK__imported__module__271645__["useMemo"])(()=>{
1274        return [
1275            {
1276                before: (0, __TURBOPACK__imported__module__595727__["addDays"])(now, 1)
1277            },
1278            {
1279                after: startDateLimit
1280            }
1281        ];
1282    }, [
1283        startDateLimit,
1284        now
1285    ]);
1286    const lastFieldClassName = isMobileCollapsed ? "rounded-tl rounded-tr rounded-bl-none rounded-br-none py-[0.75rem]" : undefined;
1287    return /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsxs"])("div", {
1288        ref: ref,
1289        className: className,
1290        children: [
1291            /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsx"])("form", {
1292                onSubmit: onSubmitForm,
1293                className: (0, __TURBOPACK__imported__module__945060__["cn"])("relative"),
1294                children: /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsxs"])(__TURBOPACK__imported__module__107282__["WidgetWrapper"], {
1295                    variant: variant,
1296                    error: !!error,
1297                    ref: rootRef,
1298                    children: [
1299                        /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsxs"])(__TURBOPACK__imported__module__107282__["WidgetFieldsBorder"], {
1300                            children: [
1301                                /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsxs"])(__TURBOPACK__imported__module__107282__["WidgetFields"], {
1302                                    variant: variant,
1303                                    children: [
1304                                        /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsx"])(__TURBOPACK__imported__module__107282__["CollapsibleWidgetField"], {
1305                                            isCollapsed: isMobileCollapsed,
1306                                            children: /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsx"])(StorageCategoryPickerField, {
1307                                                ref: categoryRef,
1308                                                open: categoryPickerOpen,
1309                                                control: control,
1310                                                storageLocationId: storageLocationId,
1311                                                onOpenChange: (state)=>{
1312                                                    if (state) {
1313                                                        onInteract === null || onInteract === void 0 ? void 0 : onInteract();
1314                                                    }
1315                                                    setCategoryPickerOpen(state);
1316                                                },
1317                                                onChangeCategory: (categoryId)=>{
1318                                                    mutate({
1319                                                        locale: apiLocale,
1320                                                        storageLocationId: getValues("locationId"),
1321                                                        categoryId,
1322                                                        unitTypeId: null
1323                                                    });
1324                                                },
1325                                                onSelectCategory: (categoryId)=>{
1326                                                    advancedField("category", {
1327                                                        categoryId
1328                                                    });
1329                                                }
1330                                            })
1331                                        }),
1332                                        /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsx"])(__TURBOPACK__imported__module__107282__["CollapsibleWidgetDivider"], {
1333                                            variant: variant,
1334                                            isMobileCollapsed: isMobileCollapsed
1335                                        }),
1336                                        /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsx"])(__TURBOPACK__imported__module__107282__["CollapsibleWidgetField"], {
1337                                            isCollapsed: isMobileCollapsed,
1338                                            children: /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsx"])(__TURBOPACK__imported__module__653145__["Controller"], {
1339                                                control: control,
1340                                                name: "locationId",
1341                                                render: (param)=>{
1342                                                    let { field: { onChange, value }, fieldState } = param;
1343                                                    const location = locations.find((location)=>location.storageLocationId === value);
1344                                                    return /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsx"])(__TURBOPACK__imported__module__735436__["default"], {
1345                                                        ref: locationRef,
1346                                                        anchor: rootRef,
1347                                                        locations: locations,
1348                                                        onChangeLocation: (location)=>{
1349                                                            var _ref;
1350                                                            const newValue = (_ref = location === null || location === void 0 ? void 0 : location.storageLocationId) !== null && _ref !== void 0 ? _ref : "";
1351                                                            onChange(newValue);
1352                                                            if (!!newValue) {
1353                                                                mutate({
1354                                                                    locale: apiLocale,
1355                                                                    storageLocationId: newValue,
1356                                                                    categoryId: getValues("categoryId"),
1357                                                                    unitTypeId: null
1358                                                                });
1359                                                                advancedField("location", {
1360                                                                    locationId: newValue
1361                                                                });
1362                                                            }
1363                                                        },
1364                                                        value: location,
1365                                                        open: locationPickerOpen,
1366                                                        error: !!fieldState.error,
1367                                                        onOpenChange: onOpenChangeLocationPicker
1368                                                    });
1369                                                }
1370                                            })
1371                                        }),
1372                                        /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsx"])(__TURBOPACK__imported__module__107282__["CollapsibleWidgetDivider"], {
1373                                            variant: variant,
1374                                            isMobileCollapsed: isMobileCollapsed
1375                                        }),
1376                                        /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsx"])(__TURBOPACK__imported__module__107282__["WidgetFieldWrapper"], {
1377                                            children: /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsx"])(__TURBOPACK__imported__module__653145__["Controller"], {
1378                                                control: control,
1379                                                name: "startDateAndRentalPeriod",
1380                                                rules: {
1381                                                    validate: (value)=>{
1382                                                        if (!value.startDate) {
1383                                                            return t("error.startDate");
1384                                                        }
1385                                                        return true;
1386                                                    }
1387                                                },
1388                                                render: (param)=>{
1389                                                    let { field: { onChange, value }, fieldState } = param;
1390                                                    return /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsx"])(NewStorageWidgetDatePicker, {
1391                                                        ref: dateRef,
1392                                                        className: lastFieldClassName,
1393                                                        rentalPeriodOptions: rentalPeriodOptions,
1394                                                        value: {
1395                                                            startDate: value.startDate,
1396                                                            rentalPeriod: value.rentalPeriod
1397                                                        },
1398                                                        onChange: (newValue)=>{
1399                                                            onChange(newValue);
1400                                                            mutate({
1401                                                                startDate: newValue.startDate ? (0, __TURBOPACK__imported__module__309000__["formatISO"])(newValue.startDate, {
1402                                                                    in: (0, __TURBOPACK__imported__module__109881__["tz"])(__TURBOPACK__imported__module__685149__["TIMEZONE"])
1403                                                                }) : newValue.startDate,
1404                                                                expectedRentalPeriod: newValue.rentalPeriod === "unknown" ? null : newValue.rentalPeriod
1405                                                            });
1406                                                        },
1407                                                        open: datePickerOpen,
1408                                                        onOpenChange: setDatePickerOpen,
1409                                                        onOpen: onOpenDatePicker,
1410                                                        onSelect: (newValue)=>{
1411                                                            advancedField("date", {
1412                                                                startDateAndRentalPeriod: newValue
1413                                                            });
1414                                                        },
1415                                                        disabled: disabled,
1416                                                        endMonth: startDateLimit,
1417                                                        startMonth: now,
1418                                                        error: !!fieldState.error
1419                                                    });
1420                                                }
1421                                            })
1422                                        })
1423                                    ]
1424                                }),
1425                                !!onSubmit && /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsx"])("div", {
1426                                    className: (0, __TURBOPACK__imported__module__945060__["cn"])("h-full flex items-center justify-center ", {
1427                                        "bg-[#f0c800] pl-[4px]": variant === "prominent",
1428                                        "px-1": variant === "default"
1429                                    }),
1430                                    children: /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsxs"])(__TURBOPACK__imported__module__710007__["default"], {
1431                                        ref: searchButtonRef,
1432                                        type: "submit",
1433                                        className: (0, __TURBOPACK__imported__module__945060__["cn"])("hidden xl:flex px-4", {
1434                                            "h-full": variant === "prominent",
1435                                            "h-[3.1rem]": variant === "default"
1436                                        }),
1437                                        children: [
1438                                            /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsx"])(__TURBOPACK__imported__module__966601__["default"], {
1439                                                className: "relative w-2 h-2 mr-1 -top-[1px]",
1440                                                "aria-hidden": "true"
1441                                            }),
1442                                            t("searchShort")
1443                                        ]
1444                                    })
1445                                })
1446                            ]
1447                        }),
1448                        /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsx"])(__TURBOPACK__imported__module__107282__["WidgetErrorBar"], {
1449                            show: !!(error === null || error === void 0 ? void 0 : error.message),
1450                            message: error === null || error === void 0 ? void 0 : error.message
1451                        }),
1452                        !!onSubmit && /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsx"])("div", {
1453                            className: "border-t border-brand-100 xl:hidden relative w-full px-2 py-1",
1454                            children: /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsxs"])(__TURBOPACK__imported__module__710007__["default"], {
1455                                type: "submit",
1456                                className: "w-full items-center justify-center",
1457                                children: [
1458                                    /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsx"])(__TURBOPACK__imported__module__966601__["default"], {
1459                                        className: "relative w-2 h-2 mr-1 -top-[1px]",
1460                                        "aria-hidden": "true"
1461                                    }),
1462                                    t("search")
1463                                ]
1464                            })
1465                        })
1466                    ]
1467                })
1468            }),
1469            footer
1470        ]
1471    });
1472}
1473__turbopack_context__.s([
1474    "default",
1475    0,
1476    NewStorageWidget
1477], 234914);
1478}),
1479]);
1480
1481//# debugId=54ceb37a-7d1b-31c8-1c29-f0437ed52a1f

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.