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]="d14e888a-40ef-c1df-9b12-4d7050fb4ef3")}catch(e){}}(); 2(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push([typeof document === "object" ? document.currentScript : undefined, 3667585, ((__turbopack_context__, module, exports) => { 4"use strict"; 5 6Object.defineProperty(exports, "__esModule", { 7 value: true 8}); 9Object.defineProperty(exports, "BailoutToCSR", { 10 enumerable: true, 11 get: function() { 12 return BailoutToCSR; 13 } 14}); 15const _bailouttocsr = __turbopack_context__.r(132061); 16function BailoutToCSR(param) { 17 let { reason, children } = param; 18 if (typeof window === 'undefined') { 19 throw Object.defineProperty(new _bailouttocsr.BailoutToCSRError(reason), "__NEXT_ERROR_CODE", { 20 value: "E394", 21 enumerable: false, 22 configurable: true 23 }); 24 } 25 return children; 26} 27}), 28309885, ((__turbopack_context__, module, exports) => { 29"use strict"; 30 31Object.defineProperty(exports, "__esModule", { 32 value: true 33}); 34Object.defineProperty(exports, "encodeURIPath", { 35 enumerable: true, 36 get: function() { 37 return encodeURIPath; 38 } 39}); 40function encodeURIPath(file) { 41 return file.split('/').map((p)=>encodeURIComponent(p)).join('/'); 42} 43}), 44652157, ((__turbopack_context__, module, exports) => { 45"use strict"; 46 47Object.defineProperty(exports, "__esModule", { 48 value: true 49}); 50Object.defineProperty(exports, "PreloadChunks", { 51 enumerable: true, 52 get: function() { 53 return PreloadChunks; 54 } 55}); 56const _jsxruntime = __turbopack_context__.r(843476); 57const _reactdom = __turbopack_context__.r(174080); 58const _workasyncstorageexternal = __turbopack_context__.r(563599); 59const _encodeuripath = __turbopack_context__.r(309885); 60const _deploymentid = __turbopack_context__.r(543369); 61function PreloadChunks(param) { 62 let { moduleIds } = param; 63 // Early return in client compilation and only load requestStore on server side 64 if (typeof window !== 'undefined') { 65 return null; 66 } 67 const workStore = _workasyncstorageexternal.workAsyncStorage.getStore(); 68 if (workStore === undefined) { 69 return null; 70 } 71 const allFiles = []; 72 // Search the current dynamic call unique key id in react loadable manifest, 73 // and find the corresponding CSS files to preload 74 if (workStore.reactLoadableManifest && moduleIds) { 75 const manifest = workStore.reactLoadableManifest; 76 for (const key of moduleIds){ 77 if (!manifest[key]) continue; 78 const chunks = manifest[key].files; 79 allFiles.push(...chunks); 80 } 81 } 82 if (allFiles.length === 0) { 83 return null; 84 } 85 const query = (0, _deploymentid.getAssetTokenQuery)(); 86 return /*#__PURE__*/ (0, _jsxruntime.jsx)(_jsxruntime.Fragment, { 87 children: allFiles.map((chunk)=>{ 88 const href = "".concat(workStore.assetPrefix, "/_next/").concat((0, _encodeuripath.encodeURIPath)(chunk)).concat(query); 89 const isCss = chunk.endsWith('.css'); 90 // If it's stylesheet we use `precedence` o help hoist with React Float. 91 // For stylesheets we actually need to render the CSS because nothing else is going to do it so it needs to be part of the component tree. 92 // The `preload` for stylesheet is not optional. 93 if (isCss) { 94 return /*#__PURE__*/ (0, _jsxruntime.jsx)("link", { 95 // @ts-ignore 96 precedence: "dynamic", 97 href: href, 98 rel: "stylesheet", 99 as: "style", 100 nonce: workStore.nonce 101 }, chunk); 102 } else { 103 // If it's script we use ReactDOM.preload to preload the resources 104 (0, _reactdom.preload)(href, { 105 as: 'script', 106 fetchPriority: 'low', 107 nonce: workStore.nonce 108 }); 109 return null; 110 } 111 }) 112 }); 113} 114}), 115323766, ((__turbopack_context__) => { 116"use strict"; 117 118const SHORTLEASE_TAG_ID = "cQcy1Gt-RHu6ocLUrqfuGg"; 119const PROPLANNER_CAR_OF_THE_MONTH_TAG = "Auto van de maand"; 120const SHORTLEASE_EXCLUDED_MAIN_CATEGORIES = [ 121 96, 122 6, 123 7, 124 160 125]; 126const SHORTLEASE_DEFAULT_EXPECTED_RENTAL_PERIOD = "twelveMonths"; 127const SHORTLEASE_DEFAULT_EXPECTED_KILOMETERS = 10000; 128__turbopack_context__.s([ 129 "PROPLANNER_CAR_OF_THE_MONTH_TAG", 130 0, 131 PROPLANNER_CAR_OF_THE_MONTH_TAG, 132 "SHORTLEASE_DEFAULT_EXPECTED_KILOMETERS", 133 0, 134 SHORTLEASE_DEFAULT_EXPECTED_KILOMETERS, 135 "SHORTLEASE_DEFAULT_EXPECTED_RENTAL_PERIOD", 136 0, 137 SHORTLEASE_DEFAULT_EXPECTED_RENTAL_PERIOD, 138 "SHORTLEASE_EXCLUDED_MAIN_CATEGORIES", 139 0, 140 SHORTLEASE_EXCLUDED_MAIN_CATEGORIES 141]); 142}), 14311274, ((__turbopack_context__) => { 144"use strict"; 145 146// MERGED MODULE: [project]/src/generated/shortleaseOrder/reactQueries.tsx [app-client] (ecmascript) 147; 148var __TURBOPACK__imported__module__954616__ = __turbopack_context__.i(954616); 149var __TURBOPACK__imported__module__266027__ = __turbopack_context__.i(266027); 150var __TURBOPACK__imported__module__912598__ = __turbopack_context__.i(912598); 151var __TURBOPACK__imported__module__197643__ = __turbopack_context__.i(197643); 152// MERGED MODULE: [project]/src/generated/shortleaseOrder/apiClient.ts [app-client] (ecmascript) 153; 154async function apiShortleaseOrderCheckout(axiosInstance, requestConfig) { 155 const response = await axiosInstance.request({ 156 url: "shortlease-order/checkout", 157 method: "POST", 158 ...requestConfig 159 }); 160 return response.data; 161} 162async function apiShortleaseOrderConfigure(axiosInstance, query, body, requestConfig) { 163 const response = await axiosInstance.request({ 164 url: "shortlease-order/", 165 method: "POST", 166 params: query, 167 data: body, 168 ...requestConfig 169 }); 170 return response.data; 171} 172async function apiShortleaseOrderOverview(axiosInstance, requestConfig) { 173 const response = await axiosInstance.request({ 174 url: "shortlease-order/", 175 method: "GET", 176 ...requestConfig 177 }); 178 return response.data; 179} 180; 181; 182; 183function useShortleaseOrderCheckout() { 184 let options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, hookOptions = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; 185 const axiosInstance = (0, __TURBOPACK__imported__module__197643__["useApi"])(); 186 const queryClient = (0, __TURBOPACK__imported__module__912598__["useQueryClient"])(); 187 if (hookOptions.invalidateQueries) { 188 const originalOnSuccess = options.onSuccess; 189 options.onSuccess = async function(data, variables) { 190 for(var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++){ 191 args[_key - 2] = arguments[_key]; 192 }
193 queryClient.invalidateQueries({ 194 queryKey: [ 195 "shortleaseOrder" 196 ] 197 }); 198 if (typeof originalOnSuccess === "function") { 199 return await originalOnSuccess(data, variables, ...args); 200 } 201 }; 202 } 203 return (0, __TURBOPACK__imported__module__954616__["useMutation"])({ 204 mutationFn: (variables)=>apiShortleaseOrderCheckout(axiosInstance, variables === null || variables === void 0 ? void 0 : variables.requestConfig), 205 ...options 206 }); 207} 208function useShortleaseOrderConfigure() { 209 let options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, hookOptions = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; 210 const axiosInstance = (0, __TURBOPACK__imported__module__197643__["useApi"])(); 211 const queryClient = (0, __TURBOPACK__imported__module__912598__["useQueryClient"])(); 212 if (hookOptions.invalidateQueries) { 213 const originalOnSuccess = options.onSuccess; 214 options.onSuccess = async function(data, variables) { 215 for(var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++){ 216 args[_key - 2] = arguments[_key]; 217 } 218 queryClient.invalidateQueries({ 219 queryKey: [ 220 "shortleaseOrder" 221 ] 222 }); 223 if (typeof originalOnSuccess === "function") { 224 return await originalOnSuccess(data, variables, ...args); 225 } 226 }; 227 } 228 return (0, __TURBOPACK__imported__module__954616__["useMutation"])({ 229 mutationFn: (variables)=>apiShortleaseOrderConfigure(axiosInstance, { 230 locale: variables["locale"] 231 }, { 232 categoryId: variables["categoryId"], 233 startDate: variables["startDate"], 234 expectedRentalPeriod: variables["expectedRentalPeriod"], 235 expectedKilometersPerMonth: variables["expectedKilometersPerMonth"], 236 details: variables["details"] 237 }, variables === null || variables === void 0 ? void 0 : variables.requestConfig), 238 ...options 239 }); 240} 241function useShortleaseOrderOverview() { 242 let opts = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; 243 var _ref; 244 const axiosInstance = (0, __TURBOPACK__imported__module__197643__["useApi"])(); 245 const options = (_ref = opts === null || opts === void 0 ? void 0 : opts.queryOptions) !== null && _ref !== void 0 ? _ref : {}; 246 return (0, __TURBOPACK__imported__module__266027__["useQuery"])({ 247 queryKey: useShortleaseOrderOverview.queryKey(), 248 queryFn: (param)=>{ 249 let { signal } = param; 250 var _opts, _requestConfig; 251 (_requestConfig = (_opts = opts).requestConfig) !== null && _requestConfig !== void 0 ? _requestConfig : _opts.requestConfig = {}; 252 opts.requestConfig.signal = signal; 253 return apiShortleaseOrderOverview(axiosInstance, opts === null || opts === void 0 ? void 0 : opts.requestConfig); 254 }, 255 ...options 256 }); 257} 258/** 259 * Base key used by useShortleaseOrderOverview.queryKey() 260 */ useShortleaseOrderOverview.baseKey = ()=>[ 261 "shortleaseOrder", 262 "overview" 263 ]; 264/** 265 * Query key used by useShortleaseOrderOverview 266 */ useShortleaseOrderOverview.queryKey = ()=>[ 267 ...useShortleaseOrderOverview.baseKey() 268 ]; 269/** 270 * Fetch useShortleaseOrderOverview via the queryClient and return the result 271 */ useShortleaseOrderOverview.fetch = (queryClient, axiosInstance, opts)=>{ 272 return queryClient.fetchQuery({ 273 queryKey: useShortleaseOrderOverview.queryKey(), 274 queryFn: ()=>{ 275 return apiShortleaseOrderOverview(axiosInstance, opts === null || opts === void 0 ? void 0 : opts.requestConfig); 276 } 277 }); 278}; 279/** 280 * Prefetch useShortleaseOrderOverview via the queryClient 281 */ useShortleaseOrderOverview.prefetch = (queryClient, axiosInstance, opts)=>{ 282 return queryClient.prefetchQuery({ 283 queryKey: useShortleaseOrderOverview.queryKey(), 284 queryFn: ()=>{ 285 return apiShortleaseOrderOverview(axiosInstance, opts === null || opts === void 0 ? void 0 : opts.requestConfig); 286 } 287 }); 288}; 289/** 290 * Invalidate useShortleaseOrderOverview via the queryClient 291 */ useShortleaseOrderOverview.invalidate = (queryClient)=>
291queryClient.invalidateQueries({ 292 queryKey: useShortleaseOrderOverview.queryKey() 293 }); 294/** 295 * Set query data for useShortleaseOrderOverview via the queryClient 296 */ useShortleaseOrderOverview.setQueryData = (queryClient, data)=>{ 297 return queryClient.setQueryData(useShortleaseOrderOverview.queryKey(), data); 298}; 299__turbopack_context__.s([ 300 "useShortleaseOrderCheckout", 301 0, 302 useShortleaseOrderCheckout, 303 "useShortleaseOrderConfigure", 304 0, 305 useShortleaseOrderConfigure, 306 "useShortleaseOrderOverview", 307 0, 308 useShortleaseOrderOverview 309], 11274); 310}), 311764550, ((__turbopack_context__) => { 312"use strict"; 313 314var __TURBOPACK__imported__module__852963__ = __turbopack_context__.i(852963); 315var __TURBOPACK__imported__module__323766__ = __turbopack_context__.i(323766); 316; 317; 318function useShortleaseMainCategoryList() { 319 return (0, __TURBOPACK__imported__module__852963__["useMainCategoryList"])({ 320 queryOptions: { 321 select: (data)=>data.mainCategories.filter((it)=>!__TURBOPACK__imported__module__323766__["SHORTLEASE_EXCLUDED_MAIN_CATEGORIES"].includes(it.id)), 322 staleTime: Infinity 323 } 324 }); 325} 326__turbopack_context__.s([ 327 "useShortleaseMainCategoryList", 328 0, 329 useShortleaseMainCategoryList 330]); 331}), 33227652, 137740, 333((__turbopack_context__) => { 334"use strict"; 335 336// MERGED MODULE: [project]/src/car-rental/shortlease/context.tsx [app-client] (ecmascript) 337; 338var __TURBOPACK__imported__module__843476__ = __turbopack_context__.i(843476); 339var __TURBOPACK__imported__module__271645__ = __turbopack_context__.i(271645); 340var __TURBOPACK__imported__module__898892__ = __turbopack_context__.i(898892); 341var __TURBOPACK__imported__module__414083__ = __turbopack_context__.i(414083); 342var __TURBOPACK__imported__module__773447__ = __turbopack_context__.i(773447); 343// MERGED MODULE: [project]/src/car-rental/shortlease/store.ts [app-client] (ecmascript) 344; 345var __TURBOPACK__imported__module__929387__ = __turbopack_context__.i(929387); 346var __TURBOPACK__imported__module__988052__ = __turbopack_context__.i(988052); 347var __TURBOPACK__imported__module__408155__ = __turbopack_context__.i(408155); 348var __TURBOPACK__imported__module__579473__ = __turbopack_context__.i(579473); 349var __TURBOPACK__imported__module__685149__ = __turbopack_context__.i(685149); 350var __TURBOPACK__imported__module__126476__ = __turbopack_context__.i(126476); 351// MERGED MODULE: [project]/src/car-rental/shortlease/validators.ts [app-client] (ecmascript) 352; 353var __TURBOPACK__imported__module__299378__ = __turbopack_context__.i(299378); 354var __TURBOPACK__imported__module__671857__ = __turbopack_context__.i(671857); 355var __TURBOPACK__imported__module__974875__ = __turbopack_context__.i(974875); 356; 357const isMainCategoryPresent = (param)=>{ 358 let { config } = param; 359 if (!config.mainCategoryId) { 360 return [ 361 { 362 field: "mainCategoryId", 363 type: "mainCategoryId.required", 364 message: "Kies een voertuigcategorie" 365 } 366 ]; 367 } 368 return []; 369}; 370const isStartDatePresent = (param)=>{ 371 let { config } = param; 372 if (!config.startDate) { 373 return [ 374 { 375 field: "startDate", 376 type: "startDate.required", 377 message: "Kies een datum" 378 } 379 ]; 380 } 381 return []; 382}; 383const isStartDateInFuture = (param)=>{ 384 let { config, now } = param; 385 if (config.startDate && (0, __TURBOPACK__imported__module__974875__["isBefore"])(config.startDate, now)) { 386 return [ 387 { 388 field: "startDate", 389 type: "startDate.min", 390 message: "De datum moet in de toekomst liggen" 391 } 392 ]; 393 } 394 return []; 395}; 396const isStartDateWithinOneYear = (param)=>{ 397 let { config, now } = param; 398 if (config.startDate && (0, __TURBOPACK__imported__module__671857__["isAfter"])(config.startDate, (0, __TURBOPACK__imported__module__299378__["addYears"])(now, 1))) { 399 return [ 400 { 401 field: "startDate", 402 type: "startDate.max", 403 message: "De datum mag maximaal één jaar in de toekomst liggen" 404 } 405 ]; 406 } 407 return []; 408}; 409const isExpectedKmPerMonthPresent = (param)=>{ 410 let { config } = param; 411 if (!config.expectedKilometersPerMonth) { 412 return [ 413 { 414 field: "expectedKilometersPerMonth", 415 type: "expectedKilometersPerMonth.required", 416 message: "Kies een verwacht aantal kilometer per maand" 417 } 418 ]; 419 } 420 return []; 421}; 422const isExpectedRentalPeriodPresent = (param)=>{ 423 let { config } = param; 424 if (!config.expectedRentalPeriod) { 425 return [ 426 { 427 field: "expectedRentalPeriod", 428 type: "expectedRentalPeriod.required", 429 message: "Kies een verwachte huurperiode" 430 } 431 ]; 432 } 433 return []; 434}; 435const validateShortleaseConfiguration = composeValidators([ 436 isMainCategoryPresent, 437 isStartDatePresent, 438 isStartDateInFuture, 439 isStartDateWithinOneYear, 440 isExpectedKmPerMonthPresent, 441 isExpectedRentalPeriodPresent 442]); 443function composeValidators(validators) { 444 return (args)=>validators.flatMap((v)=>v(args)); 445} 446__turbopack_context__.s([ 447 "composeValidators", 448 0, 449 composeValidators, 450 "isExpectedKmPerMonthPresent", 451 0, 452 isExpectedKmPerMonthPresent, 453 "isExpectedRentalPeriodPresent", 454 0, 455 isExpectedRentalPeriodPresent, 456 "isMainCategoryPresent", 457 0, 458 isMainCategoryPresent, 459 "isStartDateInFuture", 460 0, 461 isStartDateInFuture, 462 "isStartDatePresent", 463 0, 464 isStartDatePresent, 465 "isStartDateWithinOneYear", 466 0, 467 isStartDateWithinOneYear, 468 "validateShortleaseConfiguration", 469 0, 470 validateShortleaseConfiguration 471], 137740); 472var __TURBOPACK__imported__module__323766__ = __turbopack_context__.i(323766); 473// MERGED MODULE: [project]/src/car-rental/shortlease/cookie.ts [app-client] (ecmascript) 474; 475const SHORTLEASE_SELECTION_COOKIES = { 476 mainCategoryId: "diks_shortlease_main_category_id", 477 startDate: "diks_shortlease_start_date",
478 expectedRentalPeriod: "diks_shortlease_rental_period" 479}; 480; 481; 482; 483; 484; 485; 486; 487; 488const createShortleaseConfigurationStore = (param)=>{ 489 let { config, touched, errors, selection, defaultMainCategoryId, now } = param; 490 return (0, __TURBOPACK__imported__module__408155__["createStore"])()((0, __TURBOPACK__imported__module__579473__["subscribeWithSelector"])((0, __TURBOPACK__imported__module__579473__["devtools"])((set)=>{ 491 const defaultConfig = { 492 startDate: !!selection.startDate ? new __TURBOPACK__imported__module__988052__["TZDate"](selection.startDate, __TURBOPACK__imported__module__685149__["TIMEZONE"]) : undefined, 493 mainCategoryId: defaultMainCategoryId !== null && defaultMainCategoryId !== void 0 ? defaultMainCategoryId : selection.mainCategoryId, 494 expectedRentalPeriod: selection.expectedRentalPeriod, 495 expectedKilometersPerMonth: undefined 496 }; 497 const selectionTouched = config === undefined ? { 498 startDate: selection.startDate !== undefined, 499 mainCategoryId: selection.mainCategoryId !== undefined && defaultMainCategoryId === undefined, 500 expectedRentalPeriod: selection.expectedRentalPeriod !== undefined 501 } : {}; 502 const initialTouched = { 503 ...selectionTouched, 504 ...touched 505 }; 506 return { 507 now: now !== null && now !== void 0 ? now : __TURBOPACK__imported__module__988052__["TZDate"].tz(__TURBOPACK__imported__module__685149__["TIMEZONE"]), 508 config: withDefaults(config !== null && config !== void 0 ? config : defaultConfig), 509 defaultMainCategoryId, 510 errors: errors !== null && errors !== void 0 ? errors : [], 511 touched: initialTouched, 512 setNow: (now)=>set((state)=>withValidation({ 513 ...state, 514 now 515 }), undefined, "setNow"), 516 setErrors: (errors)=>set((state)=>withValidation({ 517 ...state, 518 errors 519 }), undefined, "setErrors"), 520 setConfig: (config)=>set((state)=>withValidation({ 521 ...state, 522 config: withDefaults(config) 523 }), undefined, "setConfig"), 524 setDefaultMainCategoryId: (defaultMainCategoryId)=>set((state)=>withValidation({ 525 ...state, 526 defaultMainCategoryId, 527 config: { 528 ...state.config, 529 mainCategoryId: state.touched["mainCategoryId"] ? state.config.mainCategoryId : defaultMainCategoryId 530 } 531 }), undefined, "setDefaultMainCategoryId"), 532 update: (initializer)=>set((state)=>{ 533 const newConfig = typeof initializer === "function" ? initializer(state.config) : initializer; 534 return withValidation({ 535 ...state, 536 config: newConfig 537 }); 538 }, undefined, "update"), 539 setMainCategoryId: (mainCategoryId)=>{ 540 return set((state)=>{ 541 (0, __TURBOPACK__imported__module__126476__["setCookie"])(SHORTLEASE_SELECTION_COOKIES.mainCategoryId, mainCategoryId); 542 return withValidation({ 543 ...state, 544 config: { 545 ...state.config, 546 mainCategoryId 547 }, 548 touched: { 549 ...state.touched, 550 mainCategoryId: true 551 } 552 }); 553 }, undefined, "setMainCategoryId"); 554 }, 555 setExpectedRentalPeriod: (expectedRentalPeriod)=>{ 556 return set((state)=>{ 557 (0, __TURBOPACK__imported__module__126476__["setCookie"])(SHORTLEASE_SELECTION_COOKIES.expectedRentalPeriod, expectedRentalPeriod); 558 return withValidation({ 559 ...state, 560 config: { 561 ...state.config, 562 expectedRentalPeriod 563 }, 564 touched: { 565 ...state.touched, 566 expectedRentalPeriod: true 567 } 568 }); 569 }, undefined, "setExpectedRentalPeriod"); 570 }, 571 setStartDate: (startDate)=>{ 572 return set((state)=>{ 573 (0, __TURBOPACK__imported__module__126476__["setCookie"])(SHORTLEASE_SELECTION_COOKIES.startDate, startDate); 574 return withValidation({ 575 ...state, 576 config: { 577 ...state.config, 578 startDate 579 }, 580 touched: { 581 ...state.touched, 582 startDate: true 583 } 584 }); 585 }, undefined, "setStartDate"); 586 }, 587 setExpectedKilometersPerMonth: (expectedKilometersPerMonth)=>{ 588 return set((state)=>{ 589 return withValidation({ 590 ...state, 591 config: { 592 ...state.config, 593 expectedKilometersPerMonth 594 }, 595 touched: { 596 ...state.touched, 597 expectedKilometersPerMonth: true 598 } 599 }); 600 }, undefined, "setExpectedKilometersPerMonth"); 601 } 602 }; 603 }
603))); 604}; 605function withDefaults(config) { 606 var _config_expectedRentalPeriod; 607 return { 608 ...config, 609 expectedRentalPeriod: (_config_expectedRentalPeriod = config.expectedRentalPeriod) !== null && _config_expectedRentalPeriod !== void 0 ? _config_expectedRentalPeriod : __TURBOPACK__imported__module__323766__["SHORTLEASE_DEFAULT_EXPECTED_RENTAL_PERIOD"] 610 }; 611} 612function withValidation(state) { 613 const errors = validateShortleaseConfiguration({ 614 now: state.now, 615 config: state.config 616 }); 617 return { 618 ...state, 619 errors 620 }; 621} 622"use client"; 623; 624; 625; 626; 627; 628; 629; 630; 631; 632; 633const ShortleaseConfigurationStoreContext = /*#__PURE__*/ (0, __TURBOPACK__imported__module__271645__["createContext"])(null); 634function useShortleaseConfigurationStoreContext() { 635 const store = (0, __TURBOPACK__imported__module__271645__["useContext"])(ShortleaseConfigurationStoreContext); 636 if (!store) { 637 throw Error("Missing <ShortleaseConfigurationProvider>"); 638 } 639 return store; 640} 641function useShortleaseConfigurationStore(selector) { 642 const store = useShortleaseConfigurationStoreContext(); 643 return (0, __TURBOPACK__imported__module__414083__["useStoreWithEqualityFn"])(store, selector, __TURBOPACK__imported__module__898892__["default"]); 644} 645const ShortleaseConfigurationProvider = /*#__PURE__*/ __TURBOPACK__imported__module__271645__["default"].memo(function ShortleaseConfigurationProvider(param) { 646 let { children, selection = {}, ...params } = param; 647 const [store] = (0, __TURBOPACK__imported__module__271645__["useState"])(()=>{ 648 // Pass parameters during store creation, in case the data is already available. 649 // This allows skipping a client-side re-render when the data was already fetched server-side. 650 return createShortleaseConfigurationStore({ 651 ...params, 652 selection 653 }); 654 }); 655 const _now = (0, __TURBOPACK__imported__module__773447__["useNow"])(); 656 const now = (0, __TURBOPACK__imported__module__271645__["useMemo"])(()=>{ 657 var _params_now; 658 return (_params_now = params.now) !== null && _params_now !== void 0 ? _params_now : _now; 659 }, [ 660 _now, 661 params.now 662 ]); 663 const { defaultMainCategoryId, errors, config } = params; 664 // Sync default location id, in case it changes client-side. 665 (0, __TURBOPACK__imported__module__271645__["useEffect"])(()=>{ 666 store.getState().setDefaultMainCategoryId(defaultMainCategoryId); 667 }, [ 668 defaultMainCategoryId, 669 store 670 ]); 671 (0, __TURBOPACK__imported__module__271645__["useEffect"])(()=>{ 672 store.getState().setNow(now); 673 }, [ 674 now, 675 store 676 ]); 677 (0, __TURBOPACK__imported__module__271645__["useEffect"])(()=>{ 678 if (!!errors) { 679 store.getState().setErrors(errors); 680 } 681 }, [ 682 errors, 683 store 684 ]); 685 (0, __TURBOPACK__imported__module__271645__["useEffect"])(()=>{ 686 if (!!config) { 687 store.getState().setConfig(config); 688 } 689 }, [ 690 config, 691 store 692 ]); 693 return /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsx"])(ShortleaseConfigurationStoreContext.Provider, { 694 value: store, 695 children: children 696 }); 697}); 698__turbopack_context__.s([ 699 "ShortleaseConfigurationProvider", 700 0, 701 ShortleaseConfigurationProvider, 702 "ShortleaseConfigurationStoreContext", 703 0, 704 ShortleaseConfigurationStoreContext, 705 "useShortleaseConfigurationStore", 706 0, 707 useShortleaseConfigurationStore, 708 "useShortleaseConfigurationStoreContext", 709 0, 710 useShortleaseConfigurationStoreContext 711], 27652); 712}), 713326999, ((__turbopack_context__) => { 714"use strict"; 715 716// src/dialog.tsx 717var __TURBOPACK__imported__module__271645__ = __turbopack_context__.i(271645); 718var __TURBOPACK__imported__module__981140__ = __turbopack_context__.i(981140); 719var __TURBOPACK__imported__module__820783__ = __turbopack_context__.i(820783); 720var __TURBOPACK__imported__module__30030__ = __turbopack_context__.i(30030); 721var __TURBOPACK__imported__module__610772__ = __turbopack_context__.i(610772); 722var __TURBOPACK__imported__module__369340__ = __turbopack_context__.i(369340); 723var __TURBOPACK__imported__module__726330__ = __turbopack_context__.i(726330); 724var __TURBOPACK__imported__module__765491__ = __turbopack_context__.i(765491);
725var __TURBOPACK__imported__module__774606__ = __turbopack_context__.i(774606); 726var __TURBOPACK__imported__module__296626__ = __turbopack_context__.i(296626); 727var __TURBOPACK__imported__module__248425__ = __turbopack_context__.i(248425); 728var __TURBOPACK__imported__module__303536__ = __turbopack_context__.i(303536); 729var __TURBOPACK__imported__module__934620__ = __turbopack_context__.i(934620); 730var __TURBOPACK__imported__module__985369__ = __turbopack_context__.i(985369); 731var __TURBOPACK__imported__module__186312__ = __turbopack_context__.i(186312); 732var __TURBOPACK__imported__module__991918__ = __turbopack_context__.i(991918); 733var __TURBOPACK__imported__module__843476__ = __turbopack_context__.i(843476); 734"use client"; 735var __defProp = Object.defineProperty; 736var __name = (target, value)=>__defProp(target, "name", { 737 value, 738 configurable: true 739 }); 740; 741; 742; 743; 744; 745; 746; 747; 748; 749; 750; 751; 752; 753; 754; 755; 756; 757var DIALOG_NAME = "Dialog"; 758var [createDialogContext, createDialogScope] = (0, __TURBOPACK__imported__module__30030__["createContextScope"])(DIALOG_NAME); 759var [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME); 760var Dialog = /* @__PURE__ */ __name((props)=>{ 761 const { __scopeDialog, children, open: openProp, defaultOpen, onOpenChange, modal = true } = props; 762 const triggerRef = __TURBOPACK__imported__module__271645__["useRef"](null); 763 const contentRef = __TURBOPACK__imported__module__271645__["useRef"](null); 764 const [open, setOpen] = (0, __TURBOPACK__imported__module__369340__["useControllableState"])({ 765 prop: openProp, 766 defaultProp: defaultOpen !== null && defaultOpen !== void 0 ? defaultOpen : false, 767 onChange: onOpenChange, 768 caller: DIALOG_NAME 769 }); 770 const [titleCount, setTitleCount] = __TURBOPACK__imported__module__271645__["useState"](0); 771 const [descriptionCount, setDescriptionCount] = __TURBOPACK__imported__module__271645__["useState"](0); 772 return /* @__PURE__ */ (0, __TURBOPACK__imported__module__843476__["jsx"])(DialogProvider, { 773 scope: __scopeDialog, 774 triggerRef, 775 contentRef, 776 contentId: (0, __TURBOPACK__imported__module__610772__["useId"])(), 777 titleId: (0, __TURBOPACK__imported__module__610772__["useId"])(), 778 descriptionId: (0, __TURBOPACK__imported__module__610772__["useId"])(), 779 titlePresent: titleCount > 0, 780 descriptionPresent: descriptionCount > 0, 781 setTitleCount, 782 setDescriptionCount, 783 open, 784 onOpenChange: setOpen, 785 onOpenToggle: __TURBOPACK__imported__module__271645__["useCallback"](()=>setOpen((prevOpen)=>!prevOpen), [ 786 setOpen 787 ]), 788 modal, 789 children 790 }); 791}, "Dialog"); 792var TRIGGER_NAME = "DialogTrigger"; 793var DialogTrigger = /* @__PURE__ */ __TURBOPACK__imported__module__271645__["forwardRef"](/* @__PURE__ */ __name(function DialogTrigger2(props, forwardedRef) { 794 const { __scopeDialog, ...triggerProps } = props; 795 const context = useDialogContext(TRIGGER_NAME, __scopeDialog); 796 const composedTriggerRef = (0, __TURBOPACK__imported__module__820783__["useComposedRefs"])(forwardedRef, context.triggerRef); 797 return /* @__PURE__ */ (0, __TURBOPACK__imported__module__843476__["jsx"])(__TURBOPACK__imported__module__248425__["Primitive"].button, { 798 type: "button", 799 "aria-haspopup": "dialog", 800 "aria-expanded": context.open, 801 "aria-controls": context.open ? context.contentId : void 0, 802 "data-state": getState(context.open), 803 ...triggerProps, 804 ref: composedTriggerRef, 805 onClick: (0, __TURBOPACK__imported__module__981140__["composeEventHandlers"])(props.onClick, context.onOpenToggle) 806 }); 807}, "DialogTrigger")); 808var PORTAL_NAME = "DialogPortal"; 809var [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME, { 810 forceMount: void 0 811}); 812var DialogPortal = /* @__PURE__ */ __name((props)=>{ 813 const { __scopeDialog, forceMount, children, container } = props; 814 const context = useDialogContext(PORTAL_NAME, __scopeDialog); 815 return /* @__PURE__ */ (0, __TURBOPACK__imported__module__843476__["jsx"])(PortalProvider, { 816 scope: __scopeDialog, 817 forceMount, 818 children: __TURBOPACK__imported__module__271645__["Children"].map(children, (child)=>/* @__PURE__ */ (0, __TURBOPACK__imported__module__843476__["jsx"])(__TURBOPACK__imported__module__296626__["Presence"], { 819 present: forceMount || context.open, 820 children: /* @__PURE__ */ (0, __TURBOPACK__imported__module__843476__["jsx"])(__TURBOPACK__imported__module__7
82074606__["Portal"], { 821 asChild: true, 822 container, 823 children: child 824 }) 825 })) 826 }); 827}, "DialogPortal"); 828var OVERLAY_NAME = "DialogOverlay"; 829var DialogOverlay = /* @__PURE__ */ __TURBOPACK__imported__module__271645__["forwardRef"](/* @__PURE__ */ __name(function DialogOverlay2(props, forwardedRef) { 830 const portalContext = usePortalContext(OVERLAY_NAME, props.__scopeDialog); 831 const { forceMount = portalContext.forceMount, ...overlayProps } = props; 832 const context = useDialogContext(OVERLAY_NAME, props.__scopeDialog); 833 return context.modal ? /* @__PURE__ */ (0, __TURBOPACK__imported__module__843476__["jsx"])(__TURBOPACK__imported__module__296626__["Presence"], { 834 present: forceMount || context.open, 835 children: /* @__PURE__ */ (0, __TURBOPACK__imported__module__843476__["jsx"])(DialogOverlayImpl, { 836 ...overlayProps, 837 ref: forwardedRef 838 }) 839 }) : null; 840}, "DialogOverlay")); 841var Slot = (0, __TURBOPACK__imported__module__991918__["createSlot"])("DialogOverlay.RemoveScroll"); 842var DialogOverlayImpl = /* @__PURE__ */ __TURBOPACK__imported__module__271645__["forwardRef"](// blank line to reduce diff noise 843/* @__PURE__ */ __name(function DialogOverlayImpl2(props, forwardedRef) { 844 const { __scopeDialog, ...overlayProps } = props; 845 const context = useDialogContext(OVERLAY_NAME, __scopeDialog); 846 const registerDismissableSurface = (0, __TURBOPACK__imported__module__726330__["useDismissableLayerSurface"])(); 847 const composedRefs = (0, __TURBOPACK__imported__module__820783__["useComposedRefs"])(forwardedRef, registerDismissableSurface); 848 return(// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll` 849 // ie. when `Overlay` and `Content` are siblings 850 /* @__PURE__ */ (0, __TURBOPACK__imported__module__843476__["jsx"])(__TURBOPACK__imported__module__985369__["RemoveScroll"], { 851 as: Slot, 852 allowPinchZoom: true, 853 shards: [ 854 context.contentRef 855 ], 856 children: /* @__PURE__ */ (0, __TURBOPACK__imported__module__843476__["jsx"])(__TURBOPACK__imported__module__248425__["Primitive"].div, { 857 "data-state": getState(context.open), 858 ...overlayProps, 859 ref: composedRefs, 860 style: { 861 pointerEvents: "auto", 862 ...overlayProps.style 863 } 864 }) 865 })); 866}, "DialogOverlayImpl")); 867var CONTENT_NAME = "DialogContent"; 868var DialogContent = /* @__PURE__ */ __TURBOPACK__imported__module__271645__["forwardRef"](/* @__PURE__ */ __name(function DialogContent2(props, forwardedRef) { 869 const portalContext = usePortalContext(CONTENT_NAME, props.__scopeDialog); 870 const { forceMount = portalContext.forceMount, ...contentProps } = props; 871 const context = useDialogContext(CONTENT_NAME, props.__scopeDialog); 872 return /* @__PURE__ */ (0, __TURBOPACK__imported__module__843476__["jsx"])(__TURBOPACK__imported__module__296626__["Presence"], { 873 present: forceMount || context.open, 874 children: context.modal ? /* @__PURE__ */ (0, __TURBOPACK__imported__module__843476__["jsx"])(DialogContentModal, { 875 ...contentProps, 876 ref: forwardedRef 877 }) : /* @__PURE__ */ (0, __TURBOPACK__imported__module__843476__["jsx"])(DialogContentNonModal, { 878 ...contentProps, 879 ref: forwardedRef 880 }) 881 }); 882}, "DialogContent")); 883var DialogContentModal = /* @__PURE__ */ __TURBOPACK__imported__module__271645__["forwardRef"](// blank line to reduce diff noise 884/* @__PURE__ */ __name(function DialogContentModal2(props, forwardedRef) { 885 const context = useDialogContext(CONTENT_NAME, props.__scopeDialog); 886 const contentRef = __TURBOPACK__imported__module__271645__["useRef"](null); 887 const composedRefs = (0, __TURBOPACK__imported__module__820783__["useComposedRefs"])(forwardedRef, context.contentRef, contentRef); 888 __TURBOPACK__imported__module__271645__["useEffect"](()=>{ 889 const content = contentRef.current; 890 if (content) return (0, __TURBOPACK__imported__module__186312__["hideOthers"])(content); 891 }, []); 892 return /* @__PURE__ */ (0, __TURBOPACK__imported__module__843476__["jsx"])(DialogContentImpl, { 893 ...props, 894 ref: composedRefs, 895 trapFocus: context.open, 896 disableOutsidePointerEvents: context.open, 897 onCloseAutoFocus: (0, __TURBOPACK__imported__module__981140__["composeEventHandlers"])(props.onCloseAutoFocus, (event)=>{ 898 var _context_triggerRef_current; 899 event.preventDefault(); 900 (_context_triggerRef_current = context.triggerRef.current) === null || _context_triggerRef_current === void 0 ? void 0 : _context_triggerRef_current.focus(); 901 }), 902 onPointerDownOutside: (0, __TURBOPACK__imported__module__981140__["composeEventHandlers"])(props.onPointerDownOutside, (event)=>{ 903 const originalEvent = event.detail.originalEvent; 904 const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true; 905 const isRightClick = originalEvent.button === 2 || ctrlLeftClick; 906 if (isRightClick) event.preventDefault(); 907 }), 908 onFocusOutside: (0, __TURBOPACK__imported__module__981140__["composeEventHandlers"])(props.onFocusOutside, (event)=>event.preventDefault()) 909 }); 910}, "DialogContentModal")); 911var DialogContentNonModal = /* @__PURE__ */ __TURBOPACK__imported__module__271645__["forwardRef"](// blank line to reduce diff noise 912/* @__PURE__ */ __name(function DialogContentNonModal2(props, forwardedRef) { 913 const context = useDialogContext(CONTENT_NAME, props.__scopeDialog); 914 const hasInteractedOutsideRef = __TURBOPACK__imported__module__271645__["useRef"](false); 915 const hasPointerDownOutsideRef = __TURBOPACK__imported__module__271645__["useRef"](false); 916 return /* @__PURE__ */ (0, __TURBOPACK__imported__module__843476__["jsx"])(DialogContentImpl, { 917 ...props, 918 ref: forwardedRef, 919 trapFocus: false, 920 disableOutsidePointerEvents: false, 921 onCloseAutoFocus: (event)=>{ 922 var _props_onCloseAutoFocus; 923 (_props_onCloseAutoFocus = props.onCloseAutoFocus) === null || _props_onCloseAutoFocus === void 0 ? void 0 : _props_onCloseAutoFocus.c
923all(props, event); 924 if (!event.defaultPrevented) { 925 var _context_triggerRef_current; 926 if (!hasInteractedOutsideRef.current) (_context_triggerRef_current = context.triggerRef.current) === null || _context_triggerRef_current === void 0 ? void 0 : _context_triggerRef_current.focus(); 927 event.preventDefault(); 928 } 929 hasInteractedOutsideRef.current = false; 930 hasPointerDownOutsideRef.current = false; 931 }, 932 onInteractOutside: (event)=>{ 933 var _props_onInteractOutside, _context_triggerRef_current; 934 (_props_onInteractOutside = props.onInteractOutside) === null || _props_onInteractOutside === void 0 ? void 0 : _props_onInteractOutside.call(props, event); 935 if (!event.defaultPrevented) { 936 hasInteractedOutsideRef.current = true; 937 if (event.detail.originalEvent.type === "pointerdown") { 938 hasPointerDownOutsideRef.current = true; 939 } 940 } 941 const target = event.target; 942 const targetIsTrigger = (_context_triggerRef_current = context.triggerRef.current) === null || _context_triggerRef_current === void 0 ? void 0 : _context_triggerRef_current.contains(target); 943 if (targetIsTrigger) event.preventDefault(); 944 if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) { 945 event.preventDefault(); 946 } 947 } 948 }); 949}, "DialogContentNonModal")); 950var DialogContentImpl = /* @__PURE__ */ __TURBOPACK__imported__module__271645__["forwardRef"](// blank line to reduce diff noise 951/* @__PURE__ */ __name(function DialogContentImpl2(props, forwardedRef) { 952 const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props; 953 const context = useDialogContext(CONTENT_NAME, __scopeDialog); 954 (0, __TURBOPACK__imported__module__303536__["useFocusGuards"])(); 955 return /* @__PURE__ */ (0, __TURBOPACK__imported__module__843476__["jsx"])(__TURBOPACK__imported__module__843476__["Fragment"], { 956 children: /* @__PURE__ */ (0, __TURBOPACK__imported__module__843476__["jsx"])(__TURBOPACK__imported__module__765491__["FocusScope"], { 957 asChild: true, 958 loop: true, 959 trapped: trapFocus, 960 onMountAutoFocus: onOpenAutoFocus, 961 onUnmountAutoFocus: onCloseAutoFocus, 962 children: /* @__PURE__ */ (0, __TURBOPACK__imported__module__843476__["jsx"])(__TURBOPACK__imported__module__726330__["DismissableLayer"], { 963 role: "dialog", 964 id: context.contentId, 965 "aria-describedby": context.descriptionPresent ? context.descriptionId : void 0, 966 "aria-labelledby": context.titlePresent ? context.titleId : void 0, 967 "data-state": getState(context.open), 968 ...contentProps, 969 ref: forwardedRef, 970 deferPointerDownOutside: true, 971 onDismiss: ()=>context.onOpenChange(false) 972 }) 973 }) 974 }); 975}, "DialogContentImpl")); 976var TITLE_NAME = "DialogTitle"; 977var DialogTitle = /* @__PURE__ */ __TURBOPACK__imported__module__271645__["forwardRef"](/* @__PURE__ */ __name(function DialogTitle2(props, forwardedRef) { 978 const { __scopeDialog, ...titleProps } = props; 979 const context = useDialogContext(TITLE_NAME, __scopeDialog); 980 const { setTitleCount } = context; 981 (0, __TURBOPACK__imported__module__934620__["useLayoutEffect"])(()=>{ 982 setTitleCount((count)=>count + 1); 983 return ()=>setTitleCount((count)=>count - 1); 984 }, [ 985 setTitleCount 986 ]); 987 return /* @__PURE__ */ (0, __TURBOPACK__imported__module__843476__["jsx"])(__TURBOPACK__imported__module__248425__["Primitive"].h2, { 988 id: context.titleId, 989 ...titleProps, 990 ref: forwardedRef 991 }); 992}, "DialogTitle")); 993var DESCRIPTION_NAME = "DialogDescription"; 994var DialogDescription = /* @__PURE__ */ __TURBOPACK__imported__module__271645__["forwardRef"](// blank line to reduce diff noise 995/* @__PURE__ */ __name(function DialogDescription2(props, forwardedRef) { 996 const { __scopeDialog, ...descriptionProps } = props; 997 const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog); 998 const { setDescriptionCount } = context; 999 (0, __TURBOPACK__imported__module__934620__["useLayoutEffect"])(()=>{ 1000 setDescriptionCount((count)=>count + 1); 1001 return ()=>setDescriptionCount((count)=>count - 1); 1002 }, [ 1003 setDescriptionCount 1004 ]); 1005 return /* @__PURE__ */ (0, __TURBOPACK__imported__module__843476__["jsx"])(__TURBOPACK__imported__module__248425__["Primitive"].p, { 1006 id: context.descriptionId, 1007 ...descriptionProps, 1008 ref: forwardedRef 1009 }); 1010}, "DialogDescription")); 1011var CLOSE_NAME = "DialogClose"; 1012var DialogClose = /* @__PURE__ */ __TURBOPACK__imported__module__271645__["forwardRef"](/* @__PURE__ */ __name(function DialogClose2(props, forwardedRef) { 1013 const { __scopeDialog, ...closeProps } = props; 1014 const context = useDialogContext(CLOSE_NAME, __scopeDialog); 1015 return /* @__PURE__ */ (0, __TURBOPACK__imported__module__843476__["jsx"])(__TURBOPACK__imported__module__248425__["Primitive"].button, { 1016 type: "button", 1017 ...closeProps, 1018 ref: forwardedRef, 1019 onClick: (0, __TURBOPACK__imported__module__981140__["composeEventHandlers"])(props.onClick, ()=>context.onOpenChange(false)) 1020 }); 1021}, "DialogClose")); 1022var WarningProvider = /* @__PURE__ */ __name((props)=>{ 1023 return props.children; 1024}, "WarningProvider"); 1025function getState(open) { 1026 return open ? "open" : "closed"; 1027} 1028__name(getState, "getState"); 1029; 1030__turbopack_context__.s([ 1031 "Close", 1032 0, 1033 DialogClose, 1034 "Content", 1035 0, 1036 DialogContent, 1037 "Description", 1038 0, 1039 DialogDescription, 1040 "Dialog", 1041 0, 1042 Dialog, 1043 "DialogClose", 1044 0, 1045 DialogClose, 1046 "DialogContent", 1047 0, 1048 DialogContent, 1049 "DialogDescription", 1050 0, 1051 DialogDescription, 1052 "DialogOverlay", 1053 0, 1054 DialogOverlay, 1055 "DialogPortal", 1056 0, 1057 DialogPortal, 1058 "DialogTitle", 1059 0, 1060 DialogTitle, 1061 "DialogTrigger", 1062 0, 1063 DialogTrigger, 1064 "Overlay", 1065 0, 1066 DialogOverlay, 1067 "Portal", 1068 0, 1069 DialogPortal, 1070 "Root", 1071 0, 1072 Dialog, 1073 "Title", 1074 0, 1075 DialogTitle, 1076 "Trigger", 1077 0, 1078 DialogTrigger, 1079 "WarningProvider", 1080 0, 1081 WarningProvider, 1082 "createDialogScope", 1083 0, 1084 createDialogScope 1085]); 1086}), 1087643957, ((__turbopack_context__) => { 1088"use strict"; 1089 1090/** 1091 * @license lucide-react v1.47.0 - ISC 1092 * 1093 * This source code is licensed under the ISC license. 1094 * See the LICENSE file in the root directory of this source tree. 1095 */ var __TURBOPACK__imported__module__456420__ = __turbopack_context__.i(456420); 1096; 1097const __iconData = { 1098 name: "check", 1099 size: 24, 1100 node: [ 1101 [ 1102 "path", 1103 { 1104 d: "M20 6 9 17l-5-5", 1105 key: "1gmf2c" 1106 } 1107 ] 1108 ] 1109}; 1110__iconData.node; 1111const Check = (0, __TURBOPACK__imported__module__456420__["default"])(__iconData); 1112; 1113__turbopack_context__.s([ 1114 "default", 1115 0, 1116 Check 1117]); 1118}), 1119689664, ((__turbopack_context__) => { 1120"use strict"; 1121 1122var __TURBOPACK__imported__module__643957__ = __turbopack_context__.i(643957); 1123__turbopack_context__.s([ 1124 "Check", 1125 ()=>__TURBOPACK__imported__module__643957__["default"] 1126]); 1127}), 1128716327, ((__turbopack_context__) => { 1129"use strict"; 1130 1131var __TURBOPACK__imported__module__26495__ = __turbopack_context__.i(26495); 1132__turbopack_context__.s([ 1133 "ChevronDown", 1134 ()=>__TURBOPACK__imported__module__26495__["default"] 1135]); 1136}), 1137111495, ((__turbopack_context__) => { 1138"use strict"; 1139 1140var __TURBOPACK__imported__module__867228__ = __turbopack_context__.i(867228); 1141var __TURBOPACK__imported__module__685149__ = __turbopack_context__.i(685149); 1142; 1143; 1144function useCategoryListDevice() { 1145 const isMobile = (0, __TURBOPACK__imported__module__867228__["useMediaQuery"])(__TURBOPACK__imported__module__685149__["MAX_MEDIA_QUERY_MOBILE"]); 1146 const isTablet = (0, __TURBOPACK__imported__module__867228__["useMediaQuery"])(__TURBOPACK__imported__module__685149__["MEDIA_QUERY_MD"]); 1147 const isDesktop = (0, __TURBOPACK__imported__module__867228__["useMediaQuery"])(__TURBOPACK__imported__module__685149__["MEDIA_QUERY_DESKTOP"]); 1148 if (isDesktop) { 1149 return "desktop"; 1150 } 1151 if (isTablet) { 1152 return "tablet"; 1153 } 1154 if (isMobile) { 1155 return "mobile"; 1156 } 1157 return undefined; 1158} 1159__turbopack_context__.s([ 1160 "useCategoryListDevice", 1161 0, 1162 useCategoryListDevice 1163]); 1164}), 1165389876, ((__turbopack_context__) => { 1166"use strict"; 1167 1168/** 1169 * @license lucide-react v1.47.0 - ISC 1170 * 1171 * This source code is licensed under the ISC license. 1172 * See the LICENSE file in the root directory of this source tree. 1173 */ var __TURBOPACK__imported__module__456420__ = __turbopack_context__.i(456420); 1174; 1175const __iconData = { 1176 name: "map-pin", 1177 size: 24, 1178 node: [ 1179 [ 1180 "path", 1181 { 1182 d: "M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0", 1183 key: "1r0f0z" 1184 } 1185 ], 1186 [ 1187 "circle", 1188 { 1189 cx: "12", 1190 cy: "10", 1191 r: "3", 1192 key: "ilqhr7" 1193 } 1194 ] 1195 ] 1196}; 1197__iconData.node; 1198const MapPin = (0, __TURBOPACK__imported__module__456420__["default"])(__iconData); 1199; 1200__turbopack_context__.s([ 1201 "default", 1202 0, 1203 MapPin 1204]); 1205}), 1206460573, ((__turbopack_context__) => { 1207"use strict"; 1208 1209/** 1210 * @license lucide-react v1.47.0 - ISC 1211 * 1212 * This source code is licensed under the ISC license. 1213 * See the LICENSE file in the root directory of this source tree. 1214 */ var __TURBOPACK__imported__module__456420__ = __turbopack_context__.i(456420); 1215; 1216const __iconData = { 1217 name: "calendar", 1218 size: 24, 1219 node: [ 1220 [ 1221 "path", 1222 { 1223 d: "M8 2v3", 1224 key: "1ioesn" 1225 } 1226 ], 1227 [ 1228 "path", 1229 { 1230 d: "M16 2v3", 1231 key: "otl347" 1232 } 1233 ], 1234 [ 1235 "rect", 1236 { 1237 x: "3", 1238 y: "3", 1239 width: "18", 1240 height: "18", 1241 rx: "2", 1242 key: "h1oib" 1243 } 1244 ], 1245 [ 1246 "path", 1247 { 1248 d: "M3 9h18", 1249 key: "1pudct" 1250 } 1251 ] 1252 ] 1253}; 1254__iconData.node; 1255const Calendar = (0, __TURBOPACK__imported__module__456420__["default"])(__iconData); 1256; 1257__turbopack_context__.s([ 1258 "default", 1259 0, 1260 Calendar 1261]); 1262}), 1263424863, ((__turbopack_context__) => { 1264"use strict"; 1265 1266var __TURBOPACK__imported__module__843476__ = __turbopack_context__.i(843476); 1267var __TURBOPACK__imported__module__271645__ = __turbopack_context__.i(271645); 1268var __TURBOPACK__imported__module__657688__ = __turbopack_context__.i(657688); 1269var __TURBOPACK__imported__module__912598__ = __turbopack_context__.i(912598); 1270var __TURBOPACK__imported__module__898892__ = __turbopack_context__.i(898892); 1271var __TURBOPACK__imported__module__673836__ = __turbopack_context__.i(673836); 1272var __TURBOPACK__imported__module__718580__ = __turbopack_context__.i(718580); 1273var __TURBOPACK__imported__module__685149__ = __turbopack_context__.i(685149); 1274var __TURBOPACK__imported__module__956460__ = __turbopack_context__.i(956460); 1275var __TURBOPACK__imported__module__372225__ = __turbopack_context__.i(372225); 1276var __TURBOPACK__imported__module__218330__ = __turbopack_context__.i(218330); 1277var __TURBOPACK__imported__module__732402__ = __turbopack_context__.i(732402); 1278var __TURBOPACK__imported__module__646122__ = __turbopack_context__.i(646122); 1279var __TURBOPACK__imported__module__585209__ = __turbopack_context__.i(585209); 1280var __TURBOPACK__imported__module__551438__ = __turbopack_context__.i(551438); 1281var __TURBOPACK__imported__module__19746__ = __turbopack_context__.i(19746); 1282var __TURBOPACK__imported__module__886282__ = __turbopack_context__.i(886282); 1283var __TURBOPACK__imported__module__710007__ = __turbopack_context__.i(710007); 1284var __TURBOPACK__imported__module__139503__ = __turbopack_context__.i(139503); 1285var __TURBOPACK__imported__module__740337__ = __turbopack_context__.i(740337);
1286var __TURBOPACK__imported__module__852963__ = __turbopack_context__.i(852963); 1287var __TURBOPACK__imported__module__501804__ = __turbopack_context__.i(501804); 1288var __TURBOPACK__imported__module__111495__ = __turbopack_context__.i(111495); 1289var __TURBOPACK__imported__module__989714__ = __turbopack_context__.i(989714); 1290var __TURBOPACK__imported__module__31158__ = __turbopack_context__.i(31158); 1291var __TURBOPACK__imported__module__773447__ = __turbopack_context__.i(773447); 1292var __TURBOPACK__imported__module__861745__ = __turbopack_context__.i(861745); 1293var __TURBOPACK__imported__module__948148__ = __turbopack_context__.i(948148); 1294var __TURBOPACK__imported__module__945060__ = __turbopack_context__.i(945060); 1295var __TURBOPACK__imported__module__614537__ = __turbopack_context__.i(614537); 1296var __TURBOPACK__imported__module__579712__ = __turbopack_context__.i(579712); 1297"use client"; 1298; 1299; 1300; 1301; 1302; 1303; 1304; 1305; 1306; 1307; 1308; 1309; 1310; 1311; 1312; 1313; 1314; 1315; 1316; 1317; 1318; 1319; 1320; 1321; 1322; 1323; 1324; 1325; 1326function RentalWidgetWithHero(param) { 1327 let { title, coverImage, promotion, validate: _validate, usps = [], linkedStorageLocationURL } = param; 1328 var _cta_url; 1329 const stickyOffsetRef = (0, __TURBOPACK__imported__module__271645__["useRef"])(null); 1330 const t = (0, __TURBOPACK__imported__module__948148__["useTranslations"])(); 1331 const store = (0, __TURBOPACK__imported__module__218330__["useCarRentalConfigurationStoreContext"])(); 1332 const _onSubmit = (0, __TURBOPACK__imported__module__585209__["useRentalWidgetOnSubmit"])(); 1333 const router = (0, __TURBOPACK__imported__module__614537__["useRouter"])(); 1334 const queryClient = (0, __TURBOPACK__imported__module__912598__["useQueryClient"])(); 1335 const locale = (0, __TURBOPACK__imported__module__861745__["useLocale"])(); 1336 const apiLocale = (0, __TURBOPACK__imported__module__501804__["default"])(); 1337 const [isSubmitted, setIsSubmitted] = __TURBOPACK__imported__module__271645__["default"].useState(false); 1338 const isFastlaneEnabled = (0, __TURBOPACK__imported__module__31158__["default"])(); 1339 const isRentalConfigurationComplete = (0, __TURBOPACK__imported__module__218330__["useCarRentalConfigurationStore"])((state)=>!!state.config.mainCategoryId && !!state.config.locationId && !!state.config.datePickup && !!state.config.dateReturn); 1340 const validator = (0, __TURBOPACK__imported__module__271645__["useMemo"])(()=>{ 1341 if (_validate) { 1342 return _validate; 1343 } 1344 return (0, __TURBOPACK__imported__module__732402__["composeValidators"])(isFastlaneEnabled ? [ 1345 __TURBOPACK__imported__module__732402__["isLocationPresent"], 1346 ...__TURBOPACK__imported__module__732402__["rentalConfigurationValidators"] 1347 ] : __TURBOPACK__imported__module__732402__["rentalConfigurationValidators"]); 1348 }, [ 1349 _validate, 1350 isFastlaneEnabled 1351 ]); 1352 const validate = (0, __TURBOPACK__imported__module__271645__["useCallback"])((state)=>{ 1353 let errors = validator(state); 1354 if (!isSubmitted) { 1355 errors = errors.filter((error)=>error.type !== "pickup_location_required"); 1356 } 1357 return errors; 1358 }, [ 1359 validator, 1360 isSubmitted 1361 ]); 1362 const onSubmit = (0, __TURBOPACK__imported__module__271645__["useCallback"])((config)=>{ 1363 setIsSubmitted(true); 1364 const errors = validator(store.getState()); 1365 if (errors.length > 0) { 1366 return; 1367 } 1368 // @ts-expect-error fix by validating using Zod and extracting types 1369 _onSubmit(config); 1370 }, [ 1371 validator, 1372 store, 1373 _onSubmit 1374 ]); 1375 // This effect prefetches the vehicle selection page with the current car rental configuration. 1376 // This allows Server Components to render before the user has even pressed the submit button. 1377 // Since the vehicle selection page is always the logical next step, we can afford to do this 1378 // here. 1379 (0, __TURBOPACK__imported__module__271645__["useEffect"])(()=>{ 1380 const unsubscribe = store.subscribe((state)=>state.config, (config)=>{ 1381 // Get main category data from query client directly, this saves us from re-running this 1382 // effect more than necessary. 1383 const data = queryClient.getQueryData(__TURBOPACK__imported__module__8529
138363__["useMainCategoryList"].queryKey()); 1384 const mainCategory = data === null || data === void 0 ? void 0 : data.mainCategories.find((it)=>it.id === config.mainCategoryId); 1385 // Checking against undefined, since `mainCategoryId` is a number. This is to prevent 1386 // potential issues like `!0` 1387 if (!mainCategory || config.mainCategoryId === undefined) { 1388 return; 1389 } 1390 const title = mainCategory.title[apiLocale]; 1391 const slug = !!title ? (0, __TURBOPACK__imported__module__956460__["default"])(title) : undefined; 1392 if (!slug) { 1393 return; 1394 } 1395 const query = (0, __TURBOPACK__imported__module__718580__["serializeAvailabilityQueryAsSearchParams"])(config, new URLSearchParams(window.location.search)); 1396 // Prefetch the vehicle selection page with the current configuration. This allows for a 1397 // faster follow-up navigation. 1398 router.prefetch({ 1399 pathname: "/voertuigen/[mainCategoryId]/[mainCategorySlug]", 1400 params: { 1401 mainCategoryId: config.mainCategoryId, 1402 mainCategorySlug: slug 1403 }, 1404 // Annoyingly, next-intl does not allow passing URLSearchParams directly. Probably 1405 // because it supports translating searchParams. 1406 query: Object.fromEntries(query.entries()) 1407 }, { 1408 locale 1409 }); 1410 }, { 1411 // Using lodash' `isEqual()` here helps prevent necessary triggers. 1412 // `isEqual()` is quite expensive, but the config object is currently small enough to 1413 // afford it. 1414 equalityFn: __TURBOPACK__imported__module__898892__["default"] 1415 }); 1416 return ()=>{ 1417 unsubscribe(); 1418 }; 1419 }, [ 1420 apiLocale, 1421 locale, 1422 queryClient, 1423 router, 1424 store 1425 ]); 1426 const widgetRef = (0, __TURBOPACK__imported__module__271645__["useRef"])(null); 1427 const cta = promotion ? (0, __TURBOPACK__imported__module__886282__["readFragment"])(__TURBOPACK__imported__module__646122__["ButtonBlockFragment"], promotion.cta) : null; 1428 const image = (0, __TURBOPACK__imported__module__886282__["readFragment"])(__TURBOPACK__imported__module__551438__["responsiveImageFragment"], (promotion === null || promotion === void 0 ? void 0 : promotion.coverImage) || coverImage); 1429 const device = (0, __TURBOPACK__imported__module__111495__["useCategoryListDevice"])(); 1430 const STICKY_SCROLL_OFFSET = (0, __TURBOPACK__imported__module__989714__["default"])(stickyOffsetRef).height; 1431 const STICKY_OFFSET = __TURBOPACK__imported__module__685149__["SITE_HEADER_HEIGHT_PX"] - (STICKY_SCROLL_OFFSET !== null && STICKY_SCROLL_OFFSET !== void 0 ? STICKY_SCROLL_OFFSET : 0) + (device === "mobile" ? 10 : 20); 1432 return /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsxs"])(__TURBOPACK__imported__module__843476__["Fragment"], { 1433 children: [ 1434 /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsxs"])("div", { 1435 children: [ 1436 !!image && /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsxs"])("div", { 1437 className: "relative", 1438 children: [ 1439 /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsx"])(__TURBOPACK__imported__module__673836__["Image"], { 1440 data: image, 1441 priority: true, 1442 className: (0, __TURBOPACK__imported__module__945060__["cn"])("max-w-full", promotion ? "h-[340px]" : "h-[110px]", "md:h-[340px]"), 1443 objectFit: "cover" 1444 }), 1445 promotion && cta && /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsxs"])(__TURBOPACK__imported__module__843476__["Fragment"], { 1446 children: [ 1447 /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsx"])("div", { 1448 className: "absolute inset-0 bg-brand-600/40" 1449 }), 1450 /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsx"])("div", { 1451 className: "absolute inset-0 flex items-center text-white mx-auto max-w-screen-2xl px-2 lg:flex-row md:px-5 xl:px-11", 1452 children: /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsxs"])("div", { 1453 children: [ 1454 /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsx"])("p", { 1455 className: "text-md font-bold drop-shadow-lg leading-tight mb-2", 1456 children: promotion.subtitle 1457 }), 1458 /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsx"])("p", { 1459 className: "mb-4 drop-shadow-md font-medium opacity-95 text-[22px] md:text-[32px] max-w-[600px] line-height-[1.2]", 1460 children: promotion.title 1461 }), 1462 /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsx"])(__TURBOPACK__imported__module__710007__["ButtonLink"], { 1463 href: (_cta_url = cta.url) !== null && _cta_url !== void 0 ? _cta_url : "", 1464 size: "modern", 1465 variant: "blue", 1466 children: cta.text 1467 }) 1468 ] 1469 }) 1470 }) 1471 ] 1472 }), 1473 /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsx"])("div", { 1474 className: "absolute inset-0 hidden lg:flex justify-end items-end mx-auto max-w-screen-2xl px-2 md:px-5 xl:px-11 pb-3.6 pointer-events-none", 1475 children: /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsxs"])("div", { 1476 className: "flex gap-1.25", 1477 children: [ 1478 /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsx"])(__TURBOPACK__imported__module__657688__["default"], { 1479 src: "/images/badges/nieuw-populairste-website-mobiliteit.svg", 1480 alt: "", 1481 "aria-hidden": "true", 1482 width: 138, 1483 height: 169, 1484 className: "h-[110px] w-auto object-contain" 1485 }), 1486 /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsx"])(__TURBOPACK__imported__module__657688__["default"], { 1487 src: "/images/badges/nieuw-beste-website-mobiliteit.svg", 1488 alt: "", 1489 "aria-hidden": "true", 1490 width: 138, 1491 height: 169, 1492 className: "h-[110px] w-auto object-contain" 1493 }), 1494 /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsx"])(__TURBOPACK__imported__module__657688__["default"], { 1495 src: "/images/badges/bovag.svg", 1496 alt: "", 1497 "aria-hidden": "true", 1498 width: 138, 1499 height: 169, 1500 className: "h-[110px] w-auto object-contain" 1501 }), 1502 /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsx"])(__TURBOPACK__imported__module__657688__["default"], { 1503 src: "/images/badges/google-review.svg", 1504 alt: "", 1505 "aria-hidden": "true", 1506 width: 138, 1507 height: 169, 1508 className: "h-[110px] w-auto object-contain" 1509 }) 1510 ] 1511 }) 1512 }) 1513 ] 1514 }), 1515 !!linkedStorageLocationURL && /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsx"])(__TURBOPACK__imported__module__139503__["default"], { 1516 storageHref: linkedStorageLocationURL 1517 }) 1518 ] 1519 }), 1520 /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsxs"])("div", { 1521 className: "sticky z-20 flex flex-col gap-0", 1522 style: { 1523 top: STICKY_OFFSET 1524 }, 1525 children: [ 1526 /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsxs"])("div", { 1527 className: "w-full bg-brand-600 bg-[url('/images/hero-bg.png')] bg-center bg-cover", 1528 children: [ 1529 /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsx"])("div", { 1530 ref: stickyOffsetRef, 1531 className: "w-full px-2 py-1.5 md:py-3", 1532 children: /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsxs"])("h1", { 1533 className: "text-balance text-center text-white text-lg md:text-[24px] xl:text-[28px] gap-1 font-semibold flex justify-center items-center select-none", 1534 children: [ 1535 /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsx"])("span", { 1536 className: "sr-only",
1537 children: title 1538 }), 1539 /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsx"])("span", { 1540 children: (title || t("NewRentalWidget.title")).split(/(diks)/i).map((part, index)=>{ 1541 if (/^diks$/i.test(part)) { 1542 return /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsx"])(__TURBOPACK__imported__module__372225__["DiksLabel"], { 1543 className: "inline -mt-[4px] mx-[0.1em] h-[0.8em] w-auto text-[#F0C800]" 1544 }, index); 1545 } 1546 return /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsx"])("span", { 1547 children: part 1548 }, index); 1549 }) 1550 }) 1551 ] 1552 }) 1553 }), 1554 /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsx"])("div", { 1555 className: "h-[40px] w-full" 1556 }) 1557 ] 1558 }), 1559 /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsx"])("div", { 1560 className: "relative z-10 container mx-auto max-w-(--breakpoint-2xl) pt-2 px-2 md:px-5 xl:px-11 -mt-[60px]", 1561 children: /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsx"])(__TURBOPACK__imported__module__579712__["default"], { 1562 onSubmit: onSubmit, 1563 ref: widgetRef, 1564 onInteract: ()=>{ 1565 var _widgetRef_current_container, _widgetRef_current; 1566 return (0, __TURBOPACK__imported__module__740337__["scrollWidgetIntoView"])((_widgetRef_current = widgetRef.current) === null || _widgetRef_current === void 0 ? void 0 : (_widgetRef_current_container = _widgetRef_current.container) === null || _widgetRef_current_container === void 0 ? void 0 : _widgetRef_current_container.current); 1567 }, 1568 validate: validate, 1569 hasCompletedConfiguration: isRentalConfigurationComplete, 1570 usps: usps 1571 }) 1572 }) 1573 ] 1574 }) 1575 ] 1576 }); 1577} 1578__turbopack_context__.s([ 1579 "default", 1580 0, 1581 RentalWidgetWithHero 1582]); 1583}), 1584]); 1585 1586//# debugId=d14e888a-40ef-c1df-9b12-4d7050fb4ef3
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.